From xen-changelog-bounces@lists.xenproject.org Wed Apr 01 07:55:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Apr 2026 07:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1269834.1558716 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w7qPn-0000M2-Is; Wed, 01 Apr 2026 07:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1269834.1558716; Wed, 01 Apr 2026 07: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 1w7qPn-0000Lu-G0; Wed, 01 Apr 2026 07:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1269834;
 Wed, 01 Apr 2026 07:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w7qPm-0000LV-Jj
 for xen-changelog@lists.xenproject.org; Wed, 01 Apr 2026 07:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w7qPm-003yNM-2M
 for xen-changelog@lists.xenproject.org;
 Wed, 01 Apr 2026 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w7qPm-00DG4a-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 01 Apr 2026 07:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vc7+4bHzpNmfKFAjwwdRok8Xc7JQriq3AuSGYF9JKvw=; b=Kvu2tU5nIZPtSYyi+NNfn9vLgZ
	UDutGYMUSYqMJ0cjzMpk+u3dCZa9VPcEhCdmeIIBWGFswbKB/rtDNFWzV/cTgQ3HvRibSCCOtWYGM
	s9fEI6NR3yP1MRTr52zy7zai9Wkb+4isiamB0DxjxhR3d+Uv8OtD5yQAOUSY5a+TUiVg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Increase DOM0_FDT_EXTRA_SIZE to support max reserved memory banks
Message-Id: <E1w7qPm-00DG4a-1U@xenbits.xenproject.org>
Date: Wed, 01 Apr 2026 07:55:02 +0000

commit ad6f396a3f036ba6d3a271094af4b090ac7036d5
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Tue Mar 31 17:43:10 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 1 08:42:53 2026 +0200

    xen/arm: Increase DOM0_FDT_EXTRA_SIZE to support max reserved memory banks
    
    Xen fails to construct the hardware domain's device tree with
    FDT_ERR_NOSPACE (-3) when the host memory map is highly fragmented
    (e.g., numerous reserved memory regions) and the host DTB represents
    RAM compactly (e.g., a single reg pair or just a few).
    
    This occurs because DOM0_FDT_EXTRA_SIZE underestimates the space
    required for an extra /memory node. While the host DTB might
    represent RAM compactly, make_memory_node() aggregates all
    reserved regions into a single reg property. With NR_MEM_BANKS (256)
    and 64-bit address/size cells, this property can grow up to
    4KB (256 * 16), easily exceeding the space originally occupied by
    the host DTB's nodes plus the current padding, thereby overflowing
    the allocated buffer.
    
    Additionally, the SHM regions require space for discrete sub-nodes
    under /reserved-memory node, as well as an appendage to the
    main /memory node. Each of the up to NR_SHMEM_BANKS (32) regions
    triggers the creation of a sub-node with properties (compatible,
    reg, xen,id, and xen,offset). These runtime-generated sub-nodes
    require approximately 142 bytes each, while the appendage consumes
    an additional 16 bytes per region.
    
    Fix this by increasing DOM0_FDT_EXTRA_SIZE to account for fragmented
    reg properties (NR_MEM_BANKS * 16), the discrete SHM sub-nodes, and
    the SHM appendage to the /memory node (NR_SHMEM_BANKS * (160 + 16)).
    The SHM overhead is conditionally evaluated to avoid over-allocating
    memory when CONFIG_STATIC_SHM=n.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e8795745dd..6c17a84b26 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -98,11 +98,21 @@ int __init parse_arch_dom0_param(const char *s, const char *e)
 #endif
 
 /*
- * Amount of extra space required to dom0's device tree.  No new nodes
- * are added (yet) but one terminating reserve map entry (16 bytes) is
- * added.
+ * Amount of extra space required to dom0's device tree. This covers
+ * nodes generated by Xen, which are not directly copied from the host DTB.
+ * It is calculated as:
+ *  - Space for /hypervisor node (128 bytes).
+ *  - The reserve map terminator (16 bytes).
+ *  - Space for a generated /memory node covering all possible reserved
+ *    memory regions (NR_MEM_BANKS * 16).
+ *  - Space for a generated /reserved-memory node with discrete SHM sub-nodes,
+ *    plus the appendage to the main /memory node (NR_SHMEM_BANKS * (160 + 16)
+ *    bytes). This overhead is dropped when CONFIG_STATIC_SHM is disabled.
  */
-#define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry))
+#define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry) + \
+                             (NR_MEM_BANKS * 16) +                    \
+                             (IS_ENABLED(CONFIG_STATIC_SHM) ?         \
+                              (NR_SHMEM_BANKS * (160 + 16)) : 0))
 
 unsigned int __init dom0_max_vcpus(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 01 09:22:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Apr 2026 09:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1270054.1558872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w7rly-0006gy-5p; Wed, 01 Apr 2026 09:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1270054.1558872; Wed, 01 Apr 2026 09: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 1w7rly-0006gq-2r; Wed, 01 Apr 2026 09:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1270054;
 Wed, 01 Apr 2026 09:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w7rlx-0006gk-TW
 for xen-changelog@lists.xenproject.org; Wed, 01 Apr 2026 09:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w7rly-0040ZL-0A
 for xen-changelog@lists.xenproject.org;
 Wed, 01 Apr 2026 09:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w7rlx-00DLQJ-2b
 for xen-changelog@lists.xenproject.org;
 Wed, 01 Apr 2026 09:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vK7olT8lmU/uhU4RHb+yIwTL2yBkpX2qcASc96RAH1I=; b=v5wTFsFq/KvsQgt4AsPXPchjR9
	OR4GIvRum7l5Wjn3Hx+oSNguleCHpaUr/RXyvIlV0tsi0DA1bnGx2EWFM8eIu7LAPO0DD9yVx9U52
	leJK1w0UU/nr8LjTyXzfhMy5LIIxixVyBL6kzN3hmZ5GW+JPlbKqgyrnUuaZ9E06m104=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Increase DOM0_FDT_EXTRA_SIZE to support max reserved memory banks
Message-Id: <E1w7rlx-00DLQJ-2b@xenbits.xenproject.org>
Date: Wed, 01 Apr 2026 09:22:01 +0000

commit ad6f396a3f036ba6d3a271094af4b090ac7036d5
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Tue Mar 31 17:43:10 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 1 08:42:53 2026 +0200

    xen/arm: Increase DOM0_FDT_EXTRA_SIZE to support max reserved memory banks
    
    Xen fails to construct the hardware domain's device tree with
    FDT_ERR_NOSPACE (-3) when the host memory map is highly fragmented
    (e.g., numerous reserved memory regions) and the host DTB represents
    RAM compactly (e.g., a single reg pair or just a few).
    
    This occurs because DOM0_FDT_EXTRA_SIZE underestimates the space
    required for an extra /memory node. While the host DTB might
    represent RAM compactly, make_memory_node() aggregates all
    reserved regions into a single reg property. With NR_MEM_BANKS (256)
    and 64-bit address/size cells, this property can grow up to
    4KB (256 * 16), easily exceeding the space originally occupied by
    the host DTB's nodes plus the current padding, thereby overflowing
    the allocated buffer.
    
    Additionally, the SHM regions require space for discrete sub-nodes
    under /reserved-memory node, as well as an appendage to the
    main /memory node. Each of the up to NR_SHMEM_BANKS (32) regions
    triggers the creation of a sub-node with properties (compatible,
    reg, xen,id, and xen,offset). These runtime-generated sub-nodes
    require approximately 142 bytes each, while the appendage consumes
    an additional 16 bytes per region.
    
    Fix this by increasing DOM0_FDT_EXTRA_SIZE to account for fragmented
    reg properties (NR_MEM_BANKS * 16), the discrete SHM sub-nodes, and
    the SHM appendage to the /memory node (NR_SHMEM_BANKS * (160 + 16)).
    The SHM overhead is conditionally evaluated to avoid over-allocating
    memory when CONFIG_STATIC_SHM=n.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e8795745dd..6c17a84b26 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -98,11 +98,21 @@ int __init parse_arch_dom0_param(const char *s, const char *e)
 #endif
 
 /*
- * Amount of extra space required to dom0's device tree.  No new nodes
- * are added (yet) but one terminating reserve map entry (16 bytes) is
- * added.
+ * Amount of extra space required to dom0's device tree. This covers
+ * nodes generated by Xen, which are not directly copied from the host DTB.
+ * It is calculated as:
+ *  - Space for /hypervisor node (128 bytes).
+ *  - The reserve map terminator (16 bytes).
+ *  - Space for a generated /memory node covering all possible reserved
+ *    memory regions (NR_MEM_BANKS * 16).
+ *  - Space for a generated /reserved-memory node with discrete SHM sub-nodes,
+ *    plus the appendage to the main /memory node (NR_SHMEM_BANKS * (160 + 16)
+ *    bytes). This overhead is dropped when CONFIG_STATIC_SHM is disabled.
  */
-#define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry))
+#define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry) + \
+                             (NR_MEM_BANKS * 16) +                    \
+                             (IS_ENABLED(CONFIG_STATIC_SHM) ?         \
+                              (NR_SHMEM_BANKS * (160 + 16)) : 0))
 
 unsigned int __init dom0_max_vcpus(void)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 08:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 08:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271281.1559488 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8DU7-0006I8-Mo; Thu, 02 Apr 2026 08:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271281.1559488; Thu, 02 Apr 2026 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 1w8DU7-0006I0-KM; Thu, 02 Apr 2026 08:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1271281;
 Thu, 02 Apr 2026 08:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8DU5-0006Hu-Vq
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 08:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DU6-005gsW-0P
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 08:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DU5-00Ek3p-2o
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=imnyPTfJ2Mv25B8/P8dEVLBeua4hbynP63B4d9ZTmSE=; b=4xgAcKcynqqXVwGqLEZX8QnHzw
	t7OgzzMwhWdWExETB6KQ0jr+ifKJOIQ+ZlofuJb2nCHRQrVYfqhgyNLCUdGfvOECJyAjrDLnAGt+Q
	ADin5S1Scprhy4ZB/jZcMTCTiwqj1sdxX+ubO7AA9IhoxWRymO9cBDD/Jo4zaIgAvxVk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxc: Report EINVAL in invalid xc_resource_op use
Message-Id: <E1w8DU5-00Ek3p-2o@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 08:33:01 +0000

commit 9ccbd902df66bc44c0b442137f51d5a51b9349fd
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 2 08:49:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:49:17 2026 +0200

    libxc: Report EINVAL in invalid xc_resource_op use
    
    xc_report_op doesn't update errno when called with 0 operations
    (even though it returns -1).
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/ctrl/xc_resource.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libs/ctrl/xc_resource.c b/tools/libs/ctrl/xc_resource.c
index cb6a97202b..f65127f91c 100644
--- a/tools/libs/ctrl/xc_resource.c
+++ b/tools/libs/ctrl/xc_resource.c
@@ -137,6 +137,7 @@ int xc_resource_op(xc_interface *xch, uint32_t nr_ops, xc_resource_op_t *ops)
     if ( nr_ops > 1 )
         return xc_resource_op_multi(xch, nr_ops, ops);
 
+    errno = EINVAL;
     return -1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 08:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 08:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271282.1559493 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8DUH-0006K2-OH; Thu, 02 Apr 2026 08:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271282.1559493; Thu, 02 Apr 2026 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 1w8DUH-0006Ju-Lc; Thu, 02 Apr 2026 08:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1271282;
 Thu, 02 Apr 2026 08:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8DUG-0006Jh-1b
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 08:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DUG-005gsb-0k
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 08:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DUF-00Ek5n-38
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yRnVb1uWkk35c2fI3sef08lGGGA/0A6xAdY1aZtKkbw=; b=sPCAAwuS6nPAYfxH40YPBtxc0B
	Al3nuq64PUILeRFtK/fxQCT3S1/LYyCNhL6vlOUArVl0mcflvRSZgIQNwj/BiPTxTavnalBq0F2Il
	y3i0KSUr/yYvmIqID4iGlkCwZ1XUiSO9uqmFGFTfci7MdYzDntCs8/YW0zGZwHOe86xc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenpm: Use EXIT_{SUCCESS,FAILURE} instead of errno as exit codes
Message-Id: <E1w8DUF-00Ek5n-38@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 08:33:11 +0000

commit b18dab3e2aab2eca6029584b57ff115d4f988eb4
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 2 08:49:42 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:49:42 2026 +0200

    xenpm: Use EXIT_{SUCCESS,FAILURE} instead of errno as exit codes
    
    errno is not unified accross platforms, which makes error codes actually
    platform specific. C standard defines EXIT_SUCCESS and EXIT_FAILURE
    (respectively 0 and 1) as standard errors codes, even though it only reports
    whether it failed or not.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xenpm.c | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 682d092479..e4902d2e82 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -112,7 +112,7 @@ static void parse_cpuid(const char *arg, int *cpuid)
         if ( strcasecmp(arg, "all") )
         {
             fprintf(stderr, "Invalid CPU identifier: '%s'\n", arg);
-            exit(EINVAL);
+            exit(EXIT_FAILURE);
         }
         *cpuid = -1;
     }
@@ -124,7 +124,7 @@ static void parse_cpuid_and_int(int argc, char *argv[],
     if ( argc == 0 )
     {
          fprintf(stderr, "Missing %s\n", what);
-         exit(EINVAL);
+         exit(EXIT_FAILURE);
     }
 
     if ( argc > 1 )
@@ -133,7 +133,7 @@ static void parse_cpuid_and_int(int argc, char *argv[],
     if ( sscanf(argv[argc > 1], "%d", val) != 1 )
     {
         fprintf(stderr, "Invalid %s '%s'\n", what, argv[argc > 1]);
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -662,7 +662,7 @@ static void signal_int_handler(int signo)
 out:
     free(cputopo);
     xc_interface_close(xc_handle);
-    exit(0);
+    exit(EXIT_SUCCESS);
 }
 
 void start_gather_func(int argc, char *argv[])
@@ -1154,7 +1154,7 @@ void scaling_governor_func(int argc, char *argv[])
     else
     {
         fprintf(stderr, "Missing argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( cpuid < 0 )
@@ -1215,7 +1215,7 @@ void cpu_topology_func(int argc, char *argv[])
 out:
     free(cputopo);
     if ( rc )
-        exit(rc);
+        exit(EXIT_FAILURE);
 }
 
 void set_sched_smt_func(int argc, char *argv[])
@@ -1224,7 +1224,7 @@ void set_sched_smt_func(int argc, char *argv[])
 
     if ( argc != 1 ) {
         fprintf(stderr, "Missing or invalid argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( !strcasecmp(argv[0], "disable") )
@@ -1234,7 +1234,7 @@ void set_sched_smt_func(int argc, char *argv[])
     else
     {
         fprintf(stderr, "Invalid argument: %s\n", argv[0]);
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( !xc_set_sched_opt_smt(xc_handle, value) )
@@ -1254,12 +1254,12 @@ void set_vcpu_migration_delay_func(int argc, char *argv[])
 
     if ( argc != 1 || (value = atoi(argv[0])) < 0 ) {
         fprintf(stderr, "Missing or invalid argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( xc_sched_credit_params_get(xc_handle, 0, &sparam) < 0 ) {
         fprintf(stderr, "getting Credit scheduler parameters failed\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
     sparam.vcpu_migr_delay_us = value;
 
@@ -1304,7 +1304,7 @@ void set_max_cstate_func(int argc, char *argv[])
            : (subval = XEN_SYSCTL_CX_UNLIMITED, strcmp(argv[1], "unlimited")))) )
     {
         fprintf(stderr, "Missing, excess, or invalid argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     snprintf(buf, ARRAY_SIZE(buf), "C%d", value);
@@ -1575,7 +1575,7 @@ static void cppc_set_func(int argc, char *argv[])
     uint32_t set_params;
 
     if ( parse_cppc_opts(&set_cppc, &cpuid, argc, argv) )
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
 
     if ( cpuid != -1 )
     {
@@ -1637,7 +1637,7 @@ int main(int argc, char *argv[])
     if ( !xc_handle )
     {
         fprintf(stderr, "failed to get the handler\n");
-        return EIO;
+        return EXIT_FAILURE;
     }
 
     ret = xc_physinfo(xc_handle, &physinfo);
@@ -1647,7 +1647,7 @@ int main(int argc, char *argv[])
         fprintf(stderr, "failed to get processor information (%d - %s)\n",
                 ret, strerror(ret));
         xc_interface_close(xc_handle);
-        return ret;
+        return EXIT_FAILURE;
     }
     max_cpu_nr = physinfo.max_cpu_id + 1;
 
@@ -1662,7 +1662,8 @@ int main(int argc, char *argv[])
         for ( i = 0; i < nr_matches; i++ )
             fprintf(stderr, " %s", main_options[matches_main_options[i]].name);
         fprintf(stderr, "\n");
-        ret = EINVAL;
+        xc_interface_close(xc_handle);
+        return EXIT_FAILURE;
     }
     else if ( nr_matches == 1 )
         /* dispatch to the corresponding function handler */
@@ -1670,10 +1671,11 @@ int main(int argc, char *argv[])
     else
     {
         show_help();
-        ret = EINVAL;
+        xc_interface_close(xc_handle);
+        return EXIT_FAILURE;
     }
 
     xc_interface_close(xc_handle);
-    return ret;
+    return EXIT_SUCCESS;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 08:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 08:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271284.1559498 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8DUR-0006MU-QB; Thu, 02 Apr 2026 08:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271284.1559498; Thu, 02 Apr 2026 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 1w8DUR-0006MM-N3; Thu, 02 Apr 2026 08:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1271284;
 Thu, 02 Apr 2026 08:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8DUQ-0006MF-4q
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 08:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DUQ-005gsf-14
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 08:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DUQ-00Ek7K-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AMdHEhsiyA3VgutlYQ8pN+v/PujA4hKojNIRFfU4MvM=; b=l7aFvDj3wzjs315Rg2rbDO6aD1
	7IMmsyfUgLlg5SmzSPl4Rj2gPLjEeV05DMi2G7ANr8xwUXE735GtTz1ioxONCcyNAqB0XsPLZb/+5
	B6kakyS3fkLYIVW2Teav2mwmfTiAQL0BW0q+YlH+/LwW10G5U5XzXl/giT3Y3DXKDvzQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] common: move safe_copy_string_from_guest() to lib/
Message-Id: <E1w8DUQ-00Ek7K-0F@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 08:33:22 +0000

commit cdc0feca657328ac173a560d19a0dcc400c8f8ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 2 08:49:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:49:58 2026 +0200

    common: move safe_copy_string_from_guest() to lib/
    
    This function is unreachable on x86 when XSM_FLASK=n, and it is another
    good candidate to put in an archive.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/Makefile    |  1 -
 xen/common/guestcopy.c | 30 ------------------------------
 xen/lib/Makefile       |  1 +
 xen/lib/guest-strcpy.c | 30 ++++++++++++++++++++++++++++++
 4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index dac8b711cd..6018e25614 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -16,7 +16,6 @@ obj-y += event_2l.o
 obj-y += event_channel.o
 obj-$(CONFIG_EVTCHN_FIFO) += event_fifo.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
-obj-y += guestcopy.o
 obj-y += gzip/
 obj-$(CONFIG_HYPFS) += hypfs.o
 obj-$(CONFIG_IOREQ_SERVER) += ioreq.o
diff --git a/xen/common/guestcopy.c b/xen/common/guestcopy.c
deleted file mode 100644
index 6d38eefedd..0000000000
--- a/xen/common/guestcopy.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <xen/lib.h>
-#include <xen/guest_access.h>
-#include <xen/err.h>
-
-/*
- * The function copies a string from the guest and adds a NUL to
- * make sure the string is correctly terminated.
- */
-char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf,
-                                  size_t size, size_t max_size)
-{
-    char *tmp;
-
-    if ( size > max_size )
-        return ERR_PTR(-ENOBUFS);
-
-    /* Add an extra +1 to append \0 */
-    tmp = xmalloc_array(char, size + 1);
-    if ( !tmp )
-        return ERR_PTR(-ENOMEM);
-
-    if ( copy_from_guest(tmp, u_buf, size) )
-    {
-        xfree(tmp);
-        return ERR_PTR(-EFAULT);
-    }
-    tmp[size] = '\0';
-
-    return tmp;
-}
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index dcef1610b2..933f6d96fb 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -6,6 +6,7 @@ lib-y += find-next-bit.o
 lib-y += generic-ffsl.o
 lib-y += generic-flsl.o
 lib-y += generic-hweightl.o
+lib-y += guest-strcpy.o
 lib-y += list-sort.o
 lib-y += memchr.o
 lib-y += memchr_inv.o
diff --git a/xen/lib/guest-strcpy.c b/xen/lib/guest-strcpy.c
new file mode 100644
index 0000000000..6d38eefedd
--- /dev/null
+++ b/xen/lib/guest-strcpy.c
@@ -0,0 +1,30 @@
+#include <xen/lib.h>
+#include <xen/guest_access.h>
+#include <xen/err.h>
+
+/*
+ * The function copies a string from the guest and adds a NUL to
+ * make sure the string is correctly terminated.
+ */
+char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf,
+                                  size_t size, size_t max_size)
+{
+    char *tmp;
+
+    if ( size > max_size )
+        return ERR_PTR(-ENOBUFS);
+
+    /* Add an extra +1 to append \0 */
+    tmp = xmalloc_array(char, size + 1);
+    if ( !tmp )
+        return ERR_PTR(-ENOMEM);
+
+    if ( copy_from_guest(tmp, u_buf, size) )
+    {
+        xfree(tmp);
+        return ERR_PTR(-EFAULT);
+    }
+    tmp[size] = '\0';
+
+    return tmp;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 08:33:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 08:33:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271285.1559500 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8DUa-0006OR-Qy; Thu, 02 Apr 2026 08:33:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271285.1559500; Thu, 02 Apr 2026 08:33: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 1w8DUa-0006OL-OR; Thu, 02 Apr 2026 08:33:32 +0000
Received: by outflank-mailman (input) for mailman id 1271285;
 Thu, 02 Apr 2026 08:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8DUa-0006OF-7h
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 08:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DUa-005gt4-1L
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 08:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8DUa-00Ek81-0Y
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HwGXniM32wasrgbYV7gn/xtTsRpWj4zKtjsObdHUyqY=; b=GD0XfcgKZFIp23amATmRhZccQz
	BKrzgp0IEPs+T6Aaq8PlkjDHJjvwJvP+jBUAAqPN7SlxlGA+EoQlw4SzDHB9At1HXhXfuy7oaAYUi
	6X9zriOQpdgGxaj/H97oVA+Ocz+56gu5o7U8ZszLO8BCemuywjl6be/aGXT+E5T3imq4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: init_csr_masks()-related improvements
Message-Id: <E1w8DUa-00Ek81-0Y@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 08:33:32 +0000

commit 5a08ea4c5b422b9a0114617221b03efd2cb2c3b9
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Apr 2 08:51:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:51:44 2026 +0200

    xen/riscv: init_csr_masks()-related improvements
    
    There is no reason to use _UL() in define-s sitting in C file hence use UL
    suffix instead.
    
    Drop 3d argument of INIT_CSR_MASK() and INIT_RO_ONE_MASK() to reduce risk
    of incomplete editing after copy-and-paste, or other typo-ing.
    
    Use _VALID_ infix instead of _AVAIL_ as the mask identifies architecturally
    defined bits, not bits available for software use.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/domain.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index c327f44d07..c77be3b827 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -42,10 +42,10 @@ struct csr_masks {
 
 static struct csr_masks __ro_after_init csr_masks;
 
-#define HEDELEG_AVAIL_MASK ULONG_MAX
-#define HIDELEG_AVAIL_MASK ULONG_MAX
-#define HENVCFG_AVAIL_MASK _UL(0xE0000003000000FF)
-#define HSTATEEN0_AVAIL_MASK _UL(0xDE00000000000007)
+#define HEDELEG_VALID_MASK ULONG_MAX
+#define HIDELEG_VALID_MASK ULONG_MAX
+#define HENVCFG_VALID_MASK 0xe0000003000000ffUL
+#define HSTATEEN0_VALID_MASK 0xde00000000000007UL
 
 void __init init_csr_masks(void)
 {
@@ -57,25 +57,26 @@ void __init init_csr_masks(void)
      * fields that must be preserved. Any write to the full register must
      * therefore retain the original values of those fields.
      */
-#define INIT_CSR_MASK(csr, field, mask) do { \
-        register_t old = csr_read_set(CSR_ ## csr, mask); \
+#define INIT_CSR_MASK(csr, field) do { \
+        register_t old = csr_read_set(CSR_ ## csr, csr ## _VALID_MASK); \
         csr_masks.field = csr_swap(CSR_ ## csr, old); \
     } while (0)
 
-#define INIT_RO_ONE_MASK(csr, field, mask) do { \
-        register_t old = csr_read_clear(CSR_ ## csr, mask); \
-        csr_masks.ro_one.field = csr_swap(CSR_ ## csr, old) & mask; \
+#define INIT_RO_ONE_MASK(csr, field) do { \
+        register_t old = csr_read_clear(CSR_ ## csr, csr ## _VALID_MASK); \
+        csr_masks.ro_one.field = csr_swap(CSR_ ## csr, old) & \
+                                 csr ## _VALID_MASK; \
     } while (0)
 
-    INIT_CSR_MASK(HEDELEG, hedeleg, HEDELEG_AVAIL_MASK);
-    INIT_CSR_MASK(HIDELEG, hideleg, HIDELEG_AVAIL_MASK);
+    INIT_CSR_MASK(HEDELEG, hedeleg);
+    INIT_CSR_MASK(HIDELEG, hideleg);
 
-    INIT_CSR_MASK(HENVCFG, henvcfg, HENVCFG_AVAIL_MASK);
+    INIT_CSR_MASK(HENVCFG, henvcfg);
 
     if ( riscv_isa_extension_available(NULL, RISCV_ISA_EXT_smstateen) )
     {
-        INIT_CSR_MASK(HSTATEEN0, hstateen0, HSTATEEN0_AVAIL_MASK);
-        INIT_RO_ONE_MASK(HSTATEEN0, hstateen0, HSTATEEN0_AVAIL_MASK);
+        INIT_CSR_MASK(HSTATEEN0, hstateen0);
+        INIT_RO_ONE_MASK(HSTATEEN0, hstateen0);
     }
 
 #undef INIT_CSR_MASK
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 09:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 09:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271422.1559586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8Eao-0003JW-Q8; Thu, 02 Apr 2026 09:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271422.1559586; Thu, 02 Apr 2026 09: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 1w8Eao-0003JO-NN; Thu, 02 Apr 2026 09:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1271422;
 Thu, 02 Apr 2026 09:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8Ean-0003JF-KJ
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 09:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Ean-005iCU-2X
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 09:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Ean-00EoxC-1c
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DOmBQDAQFq9LPFdiNPkq5gzPhBmCqo2Jn/5O4Ig3NbY=; b=pBcx069eamoiWcDzeyZ76SnMH1
	PvAsQC+GrcCQgdUyx54lNPrCs2BAhUttz9+Pi9MqiuT4XzX/EOKlYuYZHCm68pe1/PjOI3jtvvmby
	ZWa05SnSGVCoHMIXbRCfgJA9r6Dn4fs3e38jqCN5YTdcsVmhGcqSWiaMMENxyJzAKDaA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxc: Report EINVAL in invalid xc_resource_op use
Message-Id: <E1w8Ean-00EoxC-1c@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 09:44:01 +0000

commit 9ccbd902df66bc44c0b442137f51d5a51b9349fd
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 2 08:49:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:49:17 2026 +0200

    libxc: Report EINVAL in invalid xc_resource_op use
    
    xc_report_op doesn't update errno when called with 0 operations
    (even though it returns -1).
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/ctrl/xc_resource.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libs/ctrl/xc_resource.c b/tools/libs/ctrl/xc_resource.c
index cb6a97202b..f65127f91c 100644
--- a/tools/libs/ctrl/xc_resource.c
+++ b/tools/libs/ctrl/xc_resource.c
@@ -137,6 +137,7 @@ int xc_resource_op(xc_interface *xch, uint32_t nr_ops, xc_resource_op_t *ops)
     if ( nr_ops > 1 )
         return xc_resource_op_multi(xch, nr_ops, ops);
 
+    errno = EINVAL;
     return -1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 09:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 09:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271423.1559591 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8Eay-0003LZ-Rx; Thu, 02 Apr 2026 09:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271423.1559591; Thu, 02 Apr 2026 09:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8Eay-0003LR-Ok; Thu, 02 Apr 2026 09:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1271423;
 Thu, 02 Apr 2026 09:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8Eax-0003LD-NJ
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 09:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Eax-005iCa-2v
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 09:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Eax-00EoyU-21
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pDOBYm1BIgbOuBaZgM+515BY3DuLsZL9pVRw5PsioL8=; b=58V2/ziiYqQ3rT2pdlL5aOCE77
	6wPIjnISuYzoyY8MNtU3Ux8Lo8nBacoCRoK259yXIAwktV6XPZ0Y+nAOtDYxU0ZoUjlesbVTNCc02
	fJc96FzwlSeoxWdK/Ec9klWaIvz0v/glyqZM9EaLVyN2Mt8LYSc3Spf9XMvATNCVZ8go=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenpm: Use EXIT_{SUCCESS,FAILURE} instead of errno as exit codes
Message-Id: <E1w8Eax-00EoyU-21@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 09:44:11 +0000

commit b18dab3e2aab2eca6029584b57ff115d4f988eb4
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 2 08:49:42 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:49:42 2026 +0200

    xenpm: Use EXIT_{SUCCESS,FAILURE} instead of errno as exit codes
    
    errno is not unified accross platforms, which makes error codes actually
    platform specific. C standard defines EXIT_SUCCESS and EXIT_FAILURE
    (respectively 0 and 1) as standard errors codes, even though it only reports
    whether it failed or not.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xenpm.c | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 682d092479..e4902d2e82 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -112,7 +112,7 @@ static void parse_cpuid(const char *arg, int *cpuid)
         if ( strcasecmp(arg, "all") )
         {
             fprintf(stderr, "Invalid CPU identifier: '%s'\n", arg);
-            exit(EINVAL);
+            exit(EXIT_FAILURE);
         }
         *cpuid = -1;
     }
@@ -124,7 +124,7 @@ static void parse_cpuid_and_int(int argc, char *argv[],
     if ( argc == 0 )
     {
          fprintf(stderr, "Missing %s\n", what);
-         exit(EINVAL);
+         exit(EXIT_FAILURE);
     }
 
     if ( argc > 1 )
@@ -133,7 +133,7 @@ static void parse_cpuid_and_int(int argc, char *argv[],
     if ( sscanf(argv[argc > 1], "%d", val) != 1 )
     {
         fprintf(stderr, "Invalid %s '%s'\n", what, argv[argc > 1]);
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -662,7 +662,7 @@ static void signal_int_handler(int signo)
 out:
     free(cputopo);
     xc_interface_close(xc_handle);
-    exit(0);
+    exit(EXIT_SUCCESS);
 }
 
 void start_gather_func(int argc, char *argv[])
@@ -1154,7 +1154,7 @@ void scaling_governor_func(int argc, char *argv[])
     else
     {
         fprintf(stderr, "Missing argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( cpuid < 0 )
@@ -1215,7 +1215,7 @@ void cpu_topology_func(int argc, char *argv[])
 out:
     free(cputopo);
     if ( rc )
-        exit(rc);
+        exit(EXIT_FAILURE);
 }
 
 void set_sched_smt_func(int argc, char *argv[])
@@ -1224,7 +1224,7 @@ void set_sched_smt_func(int argc, char *argv[])
 
     if ( argc != 1 ) {
         fprintf(stderr, "Missing or invalid argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( !strcasecmp(argv[0], "disable") )
@@ -1234,7 +1234,7 @@ void set_sched_smt_func(int argc, char *argv[])
     else
     {
         fprintf(stderr, "Invalid argument: %s\n", argv[0]);
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( !xc_set_sched_opt_smt(xc_handle, value) )
@@ -1254,12 +1254,12 @@ void set_vcpu_migration_delay_func(int argc, char *argv[])
 
     if ( argc != 1 || (value = atoi(argv[0])) < 0 ) {
         fprintf(stderr, "Missing or invalid argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     if ( xc_sched_credit_params_get(xc_handle, 0, &sparam) < 0 ) {
         fprintf(stderr, "getting Credit scheduler parameters failed\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
     sparam.vcpu_migr_delay_us = value;
 
@@ -1304,7 +1304,7 @@ void set_max_cstate_func(int argc, char *argv[])
            : (subval = XEN_SYSCTL_CX_UNLIMITED, strcmp(argv[1], "unlimited")))) )
     {
         fprintf(stderr, "Missing, excess, or invalid argument(s)\n");
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
     }
 
     snprintf(buf, ARRAY_SIZE(buf), "C%d", value);
@@ -1575,7 +1575,7 @@ static void cppc_set_func(int argc, char *argv[])
     uint32_t set_params;
 
     if ( parse_cppc_opts(&set_cppc, &cpuid, argc, argv) )
-        exit(EINVAL);
+        exit(EXIT_FAILURE);
 
     if ( cpuid != -1 )
     {
@@ -1637,7 +1637,7 @@ int main(int argc, char *argv[])
     if ( !xc_handle )
     {
         fprintf(stderr, "failed to get the handler\n");
-        return EIO;
+        return EXIT_FAILURE;
     }
 
     ret = xc_physinfo(xc_handle, &physinfo);
@@ -1647,7 +1647,7 @@ int main(int argc, char *argv[])
         fprintf(stderr, "failed to get processor information (%d - %s)\n",
                 ret, strerror(ret));
         xc_interface_close(xc_handle);
-        return ret;
+        return EXIT_FAILURE;
     }
     max_cpu_nr = physinfo.max_cpu_id + 1;
 
@@ -1662,7 +1662,8 @@ int main(int argc, char *argv[])
         for ( i = 0; i < nr_matches; i++ )
             fprintf(stderr, " %s", main_options[matches_main_options[i]].name);
         fprintf(stderr, "\n");
-        ret = EINVAL;
+        xc_interface_close(xc_handle);
+        return EXIT_FAILURE;
     }
     else if ( nr_matches == 1 )
         /* dispatch to the corresponding function handler */
@@ -1670,10 +1671,11 @@ int main(int argc, char *argv[])
     else
     {
         show_help();
-        ret = EINVAL;
+        xc_interface_close(xc_handle);
+        return EXIT_FAILURE;
     }
 
     xc_interface_close(xc_handle);
-    return ret;
+    return EXIT_SUCCESS;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 09:44:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 09:44:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271424.1559594 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8Eb8-0003Od-U8; Thu, 02 Apr 2026 09:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271424.1559594; Thu, 02 Apr 2026 09:44: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 1w8Eb8-0003OV-Rc; Thu, 02 Apr 2026 09:44:22 +0000
Received: by outflank-mailman (input) for mailman id 1271424;
 Thu, 02 Apr 2026 09:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8Eb7-0003OO-Vw
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 09:44:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Eb8-005iCe-0C
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 09:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Eb7-00Eozy-2P
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 09:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LijtIGLz4dZy/rFFrT1v2JoYzOU/TDqCT2qKD8ZOr3Q=; b=YiiMqjpr0cFKTmTKaThk6GWvSN
	WAOKxyrMFDNVRlDr/Md6qRjRvqLCZloImXRw2I7pYjrbJd0e9pDZHXtCWk5Mhscusk5xnYWNVbXoG
	t0oFk02RsfoN/bQcR0q49X28QdEvabUfRybB3m+Ym7+r09srFQCxcC3QHAPmHmId/siY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] common: move safe_copy_string_from_guest() to lib/
Message-Id: <E1w8Eb7-00Eozy-2P@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 09:44:21 +0000

commit cdc0feca657328ac173a560d19a0dcc400c8f8ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 2 08:49:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:49:58 2026 +0200

    common: move safe_copy_string_from_guest() to lib/
    
    This function is unreachable on x86 when XSM_FLASK=n, and it is another
    good candidate to put in an archive.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/Makefile    |  1 -
 xen/common/guestcopy.c | 30 ------------------------------
 xen/lib/Makefile       |  1 +
 xen/lib/guest-strcpy.c | 30 ++++++++++++++++++++++++++++++
 4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index dac8b711cd..6018e25614 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -16,7 +16,6 @@ obj-y += event_2l.o
 obj-y += event_channel.o
 obj-$(CONFIG_EVTCHN_FIFO) += event_fifo.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
-obj-y += guestcopy.o
 obj-y += gzip/
 obj-$(CONFIG_HYPFS) += hypfs.o
 obj-$(CONFIG_IOREQ_SERVER) += ioreq.o
diff --git a/xen/common/guestcopy.c b/xen/common/guestcopy.c
deleted file mode 100644
index 6d38eefedd..0000000000
--- a/xen/common/guestcopy.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <xen/lib.h>
-#include <xen/guest_access.h>
-#include <xen/err.h>
-
-/*
- * The function copies a string from the guest and adds a NUL to
- * make sure the string is correctly terminated.
- */
-char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf,
-                                  size_t size, size_t max_size)
-{
-    char *tmp;
-
-    if ( size > max_size )
-        return ERR_PTR(-ENOBUFS);
-
-    /* Add an extra +1 to append \0 */
-    tmp = xmalloc_array(char, size + 1);
-    if ( !tmp )
-        return ERR_PTR(-ENOMEM);
-
-    if ( copy_from_guest(tmp, u_buf, size) )
-    {
-        xfree(tmp);
-        return ERR_PTR(-EFAULT);
-    }
-    tmp[size] = '\0';
-
-    return tmp;
-}
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index dcef1610b2..933f6d96fb 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -6,6 +6,7 @@ lib-y += find-next-bit.o
 lib-y += generic-ffsl.o
 lib-y += generic-flsl.o
 lib-y += generic-hweightl.o
+lib-y += guest-strcpy.o
 lib-y += list-sort.o
 lib-y += memchr.o
 lib-y += memchr_inv.o
diff --git a/xen/lib/guest-strcpy.c b/xen/lib/guest-strcpy.c
new file mode 100644
index 0000000000..6d38eefedd
--- /dev/null
+++ b/xen/lib/guest-strcpy.c
@@ -0,0 +1,30 @@
+#include <xen/lib.h>
+#include <xen/guest_access.h>
+#include <xen/err.h>
+
+/*
+ * The function copies a string from the guest and adds a NUL to
+ * make sure the string is correctly terminated.
+ */
+char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf,
+                                  size_t size, size_t max_size)
+{
+    char *tmp;
+
+    if ( size > max_size )
+        return ERR_PTR(-ENOBUFS);
+
+    /* Add an extra +1 to append \0 */
+    tmp = xmalloc_array(char, size + 1);
+    if ( !tmp )
+        return ERR_PTR(-ENOMEM);
+
+    if ( copy_from_guest(tmp, u_buf, size) )
+    {
+        xfree(tmp);
+        return ERR_PTR(-EFAULT);
+    }
+    tmp[size] = '\0';
+
+    return tmp;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 02 09:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Apr 2026 09:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1271425.1559598 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8EbI-0003SP-Vk; Thu, 02 Apr 2026 09:44:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1271425.1559598; Thu, 02 Apr 2026 09:44: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 1w8EbI-0003SG-T0; Thu, 02 Apr 2026 09:44:32 +0000
Received: by outflank-mailman (input) for mailman id 1271425;
 Thu, 02 Apr 2026 09:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8EbH-0003S9-Vb
 for xen-changelog@lists.xenproject.org; Thu, 02 Apr 2026 09:44:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8EbI-005iCy-0V
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 09:44:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8EbH-00Ep1N-2v
 for xen-changelog@lists.xenproject.org;
 Thu, 02 Apr 2026 09:44:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2F5HzH916QEe3liI+OPaFhfRa2DrNfY/i1+L2yIWTPM=; b=vcvi39N05Z9O9++bfKXSGOVwRb
	e/6KpDN0neFSR8ceT3A6vjNLqbSmRG7UAwP0m4uK8jYGuVadYgvjhRssc40yy5v6eaz+4dDaj5oZg
	TMfDj7lZ6H09DQfkYxx6PhhSWnHnM5yob3MWGatzsuThqfVBXd+8S/FYmAxRpK+mKdeo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: init_csr_masks()-related improvements
Message-Id: <E1w8EbH-00Ep1N-2v@xenbits.xenproject.org>
Date: Thu, 02 Apr 2026 09:44:31 +0000

commit 5a08ea4c5b422b9a0114617221b03efd2cb2c3b9
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Apr 2 08:51:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 2 08:51:44 2026 +0200

    xen/riscv: init_csr_masks()-related improvements
    
    There is no reason to use _UL() in define-s sitting in C file hence use UL
    suffix instead.
    
    Drop 3d argument of INIT_CSR_MASK() and INIT_RO_ONE_MASK() to reduce risk
    of incomplete editing after copy-and-paste, or other typo-ing.
    
    Use _VALID_ infix instead of _AVAIL_ as the mask identifies architecturally
    defined bits, not bits available for software use.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/domain.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index c327f44d07..c77be3b827 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -42,10 +42,10 @@ struct csr_masks {
 
 static struct csr_masks __ro_after_init csr_masks;
 
-#define HEDELEG_AVAIL_MASK ULONG_MAX
-#define HIDELEG_AVAIL_MASK ULONG_MAX
-#define HENVCFG_AVAIL_MASK _UL(0xE0000003000000FF)
-#define HSTATEEN0_AVAIL_MASK _UL(0xDE00000000000007)
+#define HEDELEG_VALID_MASK ULONG_MAX
+#define HIDELEG_VALID_MASK ULONG_MAX
+#define HENVCFG_VALID_MASK 0xe0000003000000ffUL
+#define HSTATEEN0_VALID_MASK 0xde00000000000007UL
 
 void __init init_csr_masks(void)
 {
@@ -57,25 +57,26 @@ void __init init_csr_masks(void)
      * fields that must be preserved. Any write to the full register must
      * therefore retain the original values of those fields.
      */
-#define INIT_CSR_MASK(csr, field, mask) do { \
-        register_t old = csr_read_set(CSR_ ## csr, mask); \
+#define INIT_CSR_MASK(csr, field) do { \
+        register_t old = csr_read_set(CSR_ ## csr, csr ## _VALID_MASK); \
         csr_masks.field = csr_swap(CSR_ ## csr, old); \
     } while (0)
 
-#define INIT_RO_ONE_MASK(csr, field, mask) do { \
-        register_t old = csr_read_clear(CSR_ ## csr, mask); \
-        csr_masks.ro_one.field = csr_swap(CSR_ ## csr, old) & mask; \
+#define INIT_RO_ONE_MASK(csr, field) do { \
+        register_t old = csr_read_clear(CSR_ ## csr, csr ## _VALID_MASK); \
+        csr_masks.ro_one.field = csr_swap(CSR_ ## csr, old) & \
+                                 csr ## _VALID_MASK; \
     } while (0)
 
-    INIT_CSR_MASK(HEDELEG, hedeleg, HEDELEG_AVAIL_MASK);
-    INIT_CSR_MASK(HIDELEG, hideleg, HIDELEG_AVAIL_MASK);
+    INIT_CSR_MASK(HEDELEG, hedeleg);
+    INIT_CSR_MASK(HIDELEG, hideleg);
 
-    INIT_CSR_MASK(HENVCFG, henvcfg, HENVCFG_AVAIL_MASK);
+    INIT_CSR_MASK(HENVCFG, henvcfg);
 
     if ( riscv_isa_extension_available(NULL, RISCV_ISA_EXT_smstateen) )
     {
-        INIT_CSR_MASK(HSTATEEN0, hstateen0, HSTATEEN0_AVAIL_MASK);
-        INIT_RO_ONE_MASK(HSTATEEN0, hstateen0, HSTATEEN0_AVAIL_MASK);
+        INIT_CSR_MASK(HSTATEEN0, hstateen0);
+        INIT_RO_ONE_MASK(HSTATEEN0, hstateen0);
     }
 
 #undef INIT_CSR_MASK
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 08:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 08:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272658.1560087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8ZcN-0001bZ-7I; Fri, 03 Apr 2026 08:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272658.1560087; Fri, 03 Apr 2026 08: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 1w8ZcN-0001bR-3v; Fri, 03 Apr 2026 08:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1272658;
 Fri, 03 Apr 2026 08:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8ZcL-0001bL-Md
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 08:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8ZcL-007MPr-2j
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8ZcL-00GIC3-1k
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=k3dadDRznVOGMCEaajtTtsRpdqgA3zZfraHXamCMr6k=; b=BO6sX9CSXdqdXy4Wz9wy0KynqO
	AlYPpo9OH1bpiFqhanhjNcFd6iIyI7mGYLN1ri505pcC0lovKIHuyVVBnwXtAt8JJJQDO8xKfoZca
	RiQYetBDFv5eZJ9PLaoHSFR9A2tbXFGtfVZh5uYQqcyuadqoWs9Z8tYqjnu0pj0Kxoqk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: acpi: Rename local acpi_size to avoid shadowing typedef
Message-Id: <E1w8ZcL-00GIC3-1k@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 08:11:01 +0000

commit 26f023918ee51d2f7d0d566249a840bdd3ef7307
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 1 16:58:14 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:42:54 2026 +0200

    xen/arm: acpi: Rename local acpi_size to avoid shadowing typedef
    
    Rename the local variable acpi_size to acpi_len in
    estimate_acpi_efi_size() to avoid shadowing the acpi_size typedef
    from xen/include/acpi/actypes.h.
    
    This resolves a MISRA C Rule 5.6 violation.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/acpi/domain_build.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 1c3555d814..5a117001ef 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -447,18 +447,18 @@ static int __init acpi_create_fadt(struct domain *d, struct membank tbl_add[])
 static int __init estimate_acpi_efi_size(struct domain *d,
                                          const struct kernel_info *kinfo)
 {
-    size_t efi_size, acpi_size, madt_size;
+    size_t efi_size, acpi_len, madt_size;
     u64 addr;
     struct acpi_table_rsdp *rsdp_tbl;
     struct acpi_table_header *table;
 
     efi_size = estimate_efi_size(kernel_info_get_mem_const(kinfo)->nr_banks);
 
-    acpi_size = ROUNDUP(sizeof(struct acpi_table_fadt), 8);
-    acpi_size += ROUNDUP(sizeof(struct acpi_table_stao), 8);
+    acpi_len = ROUNDUP(sizeof(struct acpi_table_fadt), 8);
+    acpi_len += ROUNDUP(sizeof(struct acpi_table_stao), 8);
 
     madt_size = gic_get_hwdom_madt_size(d);
-    acpi_size += ROUNDUP(madt_size, 8);
+    acpi_len += ROUNDUP(madt_size, 8);
 
     addr = acpi_os_get_root_pointer();
     if ( !addr )
@@ -484,12 +484,12 @@ static int __init estimate_acpi_efi_size(struct domain *d,
     }
 
     /* Add place for STAO table in XSDT table */
-    acpi_size += ROUNDUP(table->length + sizeof(u64), 8);
+    acpi_len += ROUNDUP(table->length + sizeof(u64), 8);
     acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
 
-    acpi_size += ROUNDUP(sizeof(struct acpi_table_rsdp), 8);
+    acpi_len += ROUNDUP(sizeof(struct acpi_table_rsdp), 8);
     d->arch.efi_acpi_len = PAGE_ALIGN(ROUNDUP(efi_size, 8)
-                                      + ROUNDUP(acpi_size, 8));
+                                      + ROUNDUP(acpi_len, 8));
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 08:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 08:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272659.1560089 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8ZcX-0001dA-84; Fri, 03 Apr 2026 08:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272659.1560089; Fri, 03 Apr 2026 08: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 1w8ZcX-0001d3-5O; Fri, 03 Apr 2026 08:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1272659;
 Fri, 03 Apr 2026 08:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8ZcV-0001ci-Op
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 08:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8ZcV-007MQ4-34
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8ZcV-00GICc-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BSnQ7UBhN5OFxSmMH4B/8cgGOsyBPyiQmRRsFtjJ8d8=; b=6SpdImC/g6QHwrBeh4J1ngoLbH
	sxPK7BwlnHk/8qgxkYYcWZznGP4dlwV7Vze44LASzPlld0ASS9TQPIr6TrMSIGjFj+e3Qj9YQnSA0
	AbIlXwMCJ8cupXToy8FNpRF1Nui9tGWXwlVdMIbHRya0hhhgMZIGegi7stOlIEgqL37o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: pci: Narrow scope of file-local symbols
Message-Id: <E1w8ZcV-00GICc-2D@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 08:11:11 +0000

commit 9d9d7586c3a990c928f69578eccc656751ee70a7
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 1 16:58:15 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:43:00 2026 +0200

    xen/arm: pci: Narrow scope of file-local symbols
    
    Make pci_alloc_host_bridge() and pci_add_host_bridge() in
    pci-host-common.c, rcar4_pcie_ops and rcar4_pcie_child_ops in
    pci-host-rcar4.c, and nwl_pcie_ops in pci-host-zynqmp.c static, as
    they are only used within their respective translation units.
    
    Also include pci-host-rcar4.h in pci-host-rcar4.c so that the
    declarations of its externally visible functions are visible at the
    point of definition.
    
    This resolves MISRA C Rule 8.4 violations.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/pci/pci-host-common.c | 4 ++--
 xen/arch/arm/pci/pci-host-rcar4.c  | 5 +++--
 xen/arch/arm/pci/pci-host-zynqmp.c | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
index 487c545f3a..9060afc14d 100644
--- a/xen/arch/arm/pci/pci-host-common.c
+++ b/xen/arch/arm/pci/pci-host-common.c
@@ -158,7 +158,7 @@ err_exit:
     return NULL;
 }
 
-struct pci_host_bridge *pci_alloc_host_bridge(void)
+static struct pci_host_bridge *pci_alloc_host_bridge(void)
 {
     struct pci_host_bridge *bridge = xzalloc(struct pci_host_bridge);
 
@@ -170,7 +170,7 @@ struct pci_host_bridge *pci_alloc_host_bridge(void)
     return bridge;
 }
 
-void pci_add_host_bridge(struct pci_host_bridge *bridge)
+static void pci_add_host_bridge(struct pci_host_bridge *bridge)
 {
     list_add_tail(&bridge->node, &pci_host_bridges);
 }
diff --git a/xen/arch/arm/pci/pci-host-rcar4.c b/xen/arch/arm/pci/pci-host-rcar4.c
index 9290c6cac5..e1e8eb0ee1 100644
--- a/xen/arch/arm/pci/pci-host-rcar4.c
+++ b/xen/arch/arm/pci/pci-host-rcar4.c
@@ -13,6 +13,7 @@
 #include <asm/pci.h>
 
 #include "pci-designware.h"
+#include "pci-host-rcar4.h"
 
 #define RCAR4_DWC_VERSION       0x520A
 
@@ -61,7 +62,7 @@ static int __init rcar4_child_cfg_reg_index(struct dt_device_node *np)
 }
 
 /* ECAM ops */
-const struct pci_ecam_ops rcar4_pcie_ops = {
+static const struct pci_ecam_ops rcar4_pcie_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = rcar4_cfg_reg_index,
     .pci_ops    = {
@@ -73,7 +74,7 @@ const struct pci_ecam_ops rcar4_pcie_ops = {
     }
 };
 
-const struct pci_ecam_ops rcar4_pcie_child_ops = {
+static const struct pci_ecam_ops rcar4_pcie_child_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = rcar4_child_cfg_reg_index,
     .pci_ops    = {
diff --git a/xen/arch/arm/pci/pci-host-zynqmp.c b/xen/arch/arm/pci/pci-host-zynqmp.c
index 2c4afa7a19..2d98b00696 100644
--- a/xen/arch/arm/pci/pci-host-zynqmp.c
+++ b/xen/arch/arm/pci/pci-host-zynqmp.c
@@ -27,7 +27,7 @@ static int __init nwl_cfg_reg_index(struct dt_device_node *np)
 }
 
 /* ECAM ops */
-const struct pci_ecam_ops nwl_pcie_ops = {
+static const struct pci_ecam_ops nwl_pcie_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = nwl_cfg_reg_index,
     .pci_ops    = {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 08:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 08:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272660.1560094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8Zch-0001fW-A3; Fri, 03 Apr 2026 08:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272660.1560094; Fri, 03 Apr 2026 08: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 1w8Zch-0001fM-71; Fri, 03 Apr 2026 08:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1272660;
 Fri, 03 Apr 2026 08:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8Zcf-0001fE-RZ
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 08:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Zcg-007MQA-07
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Zcf-00GIDG-2Y
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pLdFD6nX1HDMU2gnw3jOYS2x40eIKSBNzUTA82HpCiA=; b=bjPI/JOHR719UegyZ2RcE8CNKd
	sGdc+z+4PZcPVY2quJdhm5nQ6D0gm4J58mhGhz/ULX9/qN68u76X1mTwtIFv3D5cDegFJ6Qc4L5Po
	UzpWiIU4mQ/YbYSTlsoeQ1sMjjGSi+8sjpfJrTmg+iZsr1mUNvF9UYJiP21pYS4NCbWE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: vpci: Move content of xen/arch/arm/vpci.h to arch header
Message-Id: <E1w8Zcf-00GIDG-2Y@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 08:11:21 +0000

commit b9f6a102f535b8444c3538fa99ccb0b12c3ab6b4
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 1 16:58:16 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:43:07 2026 +0200

    xen/arm: vpci: Move content of xen/arch/arm/vpci.h to arch header
    
    Move domain_vpci_init() and domain_vpci_get_num_mmio_handlers()
    declarations from the private xen/arch/arm/vpci.h into the public
    xen/arch/arm/include/asm/vpci.h, and remove the now redundant
    private header.
    
    Update domain.c to include <asm/vpci.h> instead of the removed private
    header.
    
    This ensures the declarations are visible where the functions are
    defined, resolving a MISRA C Rule 8.4 violation.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 xen/arch/arm/domain.c           |  2 +-
 xen/arch/arm/include/asm/vpci.h | 18 ++++++++++++++++++
 xen/arch/arm/vpci.h             | 42 -----------------------------------------
 3 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 581f82bddd..26380a807c 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -31,10 +31,10 @@
 #include <asm/tee/tee.h>
 #include <asm/vfp.h>
 #include <asm/vgic.h>
+#include <asm/vpci.h>
 #include <asm/vpsci.h>
 #include <asm/vtimer.h>
 
-#include "vpci.h"
 #include "vuart.h"
 
 DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
diff --git a/xen/arch/arm/include/asm/vpci.h b/xen/arch/arm/include/asm/vpci.h
index db04687fc0..0cc6f5a105 100644
--- a/xen/arch/arm/include/asm/vpci.h
+++ b/xen/arch/arm/include/asm/vpci.h
@@ -2,6 +2,9 @@
 #ifndef ARM_VPCI_H
 #define ARM_VPCI_H
 
+struct domain;
+
+#ifdef CONFIG_HAS_VPCI
 /* Arch-specific MSI data for vPCI. */
 struct vpci_arch_msi {
 };
@@ -10,4 +13,19 @@ struct vpci_arch_msi {
 struct vpci_arch_msix_entry {
 };
 
+
+int domain_vpci_init(struct domain *d);
+unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d);
+#else
+static inline int domain_vpci_init(struct domain *d)
+{
+    return 0;
+}
+
+static inline unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
+{
+    return 0;
+}
+#endif /* CONFIG_HAS_VPCI */
+
 #endif /* ARM_VPCI_H */
diff --git a/xen/arch/arm/vpci.h b/xen/arch/arm/vpci.h
deleted file mode 100644
index 3c713f3fcd..0000000000
--- a/xen/arch/arm/vpci.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * xen/arch/arm/vpci.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARCH_ARM_VPCI_H__
-#define __ARCH_ARM_VPCI_H__
-
-#ifdef CONFIG_HAS_VPCI
-int domain_vpci_init(struct domain *d);
-unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d);
-#else
-static inline int domain_vpci_init(struct domain *d)
-{
-    return 0;
-}
-
-static inline unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
-{
-    return 0;
-}
-#endif
-
-#endif /* __ARCH_ARM_VPCI_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#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 08:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 08:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272661.1560096 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8Zcr-0001ha-At; Fri, 03 Apr 2026 08:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272661.1560096; Fri, 03 Apr 2026 08: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 1w8Zcr-0001hS-8M; Fri, 03 Apr 2026 08:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1272661;
 Fri, 03 Apr 2026 08:11:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8Zcp-0001hM-Ub
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 08:11:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Zcq-007MQJ-0P
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08:11:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Zcp-00GIGR-2q
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08:11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MAeS90v1KESZr+JU9meWPZnYP6qxrawXLGfJZvEn6ys=; b=JcZj2rD5ilr7e6Nx+FbKD+aEaJ
	XjLxEMa2WkId9zu4j2IBhSJgIXbZnEzenR9dgWb/7YK/xfJrgDPAoZ949wB4L+xFbL+cwUX6T7dJ8
	jy5t6TlPHO9zMA3KNzIbY1DUqahfTUY3z2JsmSgALcqyU4yGt4y4zuCldf4O4j99Mn1c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: mpu: Fix ioremap_attr region size and return value
Message-Id: <E1w8Zcp-00GIGR-2q@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 08:11:31 +0000

commit 9e8aa00f627984670c782954e06fc3517c010f94
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Apr 2 09:56:45 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:44:07 2026 +0200

    xen/arm: mpu: Fix ioremap_attr region size and return value
    
    ioremap_attr() computes end_pg as round_pgup(start_pg + len), but
    start_pg has already had the sub-page offset stripped by round_pgdown().
    When start is not page-aligned, the sub-page offset is lost and the
    resulting MPU protection region can be one page too small, leaving the
    tail of the requested range covered by something else.
    
    Additionally, the function returns maddr_to_virt(start_pg) — the
    page-aligned base dropping the sub-page offset that callers (e.g. ioremap
    of an unaligned MMIO base) depend on to reach the correct register block.
    
    Fix end_pg to use the original start so the sub-page tail is included
    in the rounding, and return the original start address to preserve the
    offset, matching the behaviour of other ioremap implementations.
    
    Fixes: efeec4c70798 ("arm/mpu: Implement ioremap_attr for MPU")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/mpu/mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 6b3b0b06e9..aff88bd3a9 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -596,13 +596,13 @@ void free_init_memory(void)
 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
 {
     paddr_t start_pg = round_pgdown(start);
-    paddr_t end_pg = round_pgup(start_pg + len);
+    paddr_t end_pg = round_pgup(start + len);
 
     if ( xen_mpumap_update(start_pg, end_pg, flags) )
         return NULL;
 
     /* Mapped or already mapped */
-    return maddr_to_virt(start_pg);
+    return maddr_to_virt(start);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 08:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 08:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272662.1560101 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8Zd1-0001jr-CL; Fri, 03 Apr 2026 08:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272662.1560101; Fri, 03 Apr 2026 08: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 1w8Zd1-0001jk-9f; Fri, 03 Apr 2026 08:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1272662;
 Fri, 03 Apr 2026 08:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8Zd0-0001je-1R
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 08:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Zd0-007MQQ-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8Zcz-00GIHg-38
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 08:11:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VbXuH8wXEjD6jV4rPKlkUzsLwqce++7GmvsELTT7APs=; b=6aBGY8OlpSMebzonHdEFhOmwlF
	LaEEclWnYhn6vObBdBVeN79S7s1pfpRosIUcZfk5b3wK2DD8pOFjVDEB6SYpFx3tt1FXMl4OcXZ1Q
	PCNhMarCrXkWJsWkjVpNp0qFvpnHJqDMRZu1ujHWehsh3GFPpPnGSYHOPCPmvaxNIk+o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/device-tree: Fix off-by-one bounds check in make_memory_node()
Message-Id: <E1w8Zcz-00GIHg-38@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 08:11:41 +0000

commit fc453fef7708f65d4023ff63ebafe52c822229a1
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Thu Apr 2 20:38:35 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:45:14 2026 +0200

    xen/device-tree: Fix off-by-one bounds check in make_memory_node()
    
    When building Xen with CONFIG_STATIC_SHM=n, booting a hardware
    domain with exactly NR_MEM_BANKS (256) reserved-memory regions
    causes a panic:
    
    (XEN) Xen BUG at common/device-tree/domain-build.c:497
    (XEN) Xen call trace:
    (XEN)    [<00000a0000289aa8>] make_memory_node+0x178/0x234 (PC)
    
    This occurs due to an off-by-one error in the bounds checking of
    the reg array in make_memory_node(). The check:
        BUG_ON(nr_cells >= ARRAY_SIZE(reg));
    incorrectly triggers when the array is exactly full (i.e., when
    nr_cells == ARRAY_SIZE(reg)), preventing the 256th and final valid
    memory region from being written.
    
    When CONFIG_STATIC_SHM=y, this bug is usually hidden because
    DT_MEM_NODE_REG_RANGE_SIZE adds extra space for SHM banks.
    This extra capacity prevents the array from reaching its
    maximum limit while processing the 256th memory region.
    However, if a domain is configured with exactly NR_MEM_BANKS
    and NR_SHMEM_BANKS, the array will completely fill up and trigger
    the same panic.
    
    Fix this by changing the condition to strictly greater than (>).
    Apply the exact same fix to shm_mem_node_fill_reg_range() to
    prevent the same error.
    
    Fixes: cd8015b634b0 ("ARM/dom0: Avoid using a variable length array in make_memory_node()")
    Fixes: 7846f7699fea ("xen/arm: List static shared memory regions as /memory nodes")
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/device-tree/domain-build.c | 2 +-
 xen/common/device-tree/static-shmem.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index 6708c9dd66..540627b74e 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -494,7 +494,7 @@ int __init make_memory_node(const struct kernel_info *kinfo, int addrcells,
             continue;
 
         nr_cells += reg_size;
-        BUG_ON(nr_cells >= ARRAY_SIZE(reg));
+        BUG_ON(nr_cells > ARRAY_SIZE(reg));
         dt_child_set_range(&cells, addrcells, sizecells, start, size);
     }
 
diff --git a/xen/common/device-tree/static-shmem.c b/xen/common/device-tree/static-shmem.c
index 79f23caa77..4c4cc1b123 100644
--- a/xen/common/device-tree/static-shmem.c
+++ b/xen/common/device-tree/static-shmem.c
@@ -838,7 +838,7 @@ void __init shm_mem_node_fill_reg_range(const struct kernel_info *kinfo,
         paddr_t size = mem->bank[i].size;
 
         *nr_cells += addrcells + sizecells;
-        BUG_ON(*nr_cells >= DT_MEM_NODE_REG_RANGE_SIZE);
+        BUG_ON(*nr_cells > DT_MEM_NODE_REG_RANGE_SIZE);
         dt_child_set_range(&cells, addrcells, sizecells, start, size);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 09:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 09:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272716.1560114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8aYR-0000fM-Kc; Fri, 03 Apr 2026 09:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272716.1560114; Fri, 03 Apr 2026 09: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 1w8aYR-0000fF-Ht; Fri, 03 Apr 2026 09:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1272716;
 Fri, 03 Apr 2026 09:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8aYQ-0000f9-Eb
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 09:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYQ-007Nep-1v
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYQ-00GLaf-0v
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mHksLsjZsmj8XO4TJYvlMlb/9hXmZ+gX2THQYlUy3c0=; b=qCnmeGlyTs0tW2C1Q8xGtho9nT
	eygX2mjfPHqU2z6AA4ReZvyVNeDN81MZXl7hIfQ1caAllmjFgexlSxrE1GwbpI2cLG0LK7TFFgjG0
	cBHQOTMsju44GZ058OcL8loUmyjvNJgwC+Xpc4snd8NqqKP28uNfzwcwe8FRKXOQkx2o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: acpi: Rename local acpi_size to avoid shadowing typedef
Message-Id: <E1w8aYQ-00GLaf-0v@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 09:11:02 +0000

commit 26f023918ee51d2f7d0d566249a840bdd3ef7307
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 1 16:58:14 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:42:54 2026 +0200

    xen/arm: acpi: Rename local acpi_size to avoid shadowing typedef
    
    Rename the local variable acpi_size to acpi_len in
    estimate_acpi_efi_size() to avoid shadowing the acpi_size typedef
    from xen/include/acpi/actypes.h.
    
    This resolves a MISRA C Rule 5.6 violation.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/acpi/domain_build.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 1c3555d814..5a117001ef 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -447,18 +447,18 @@ static int __init acpi_create_fadt(struct domain *d, struct membank tbl_add[])
 static int __init estimate_acpi_efi_size(struct domain *d,
                                          const struct kernel_info *kinfo)
 {
-    size_t efi_size, acpi_size, madt_size;
+    size_t efi_size, acpi_len, madt_size;
     u64 addr;
     struct acpi_table_rsdp *rsdp_tbl;
     struct acpi_table_header *table;
 
     efi_size = estimate_efi_size(kernel_info_get_mem_const(kinfo)->nr_banks);
 
-    acpi_size = ROUNDUP(sizeof(struct acpi_table_fadt), 8);
-    acpi_size += ROUNDUP(sizeof(struct acpi_table_stao), 8);
+    acpi_len = ROUNDUP(sizeof(struct acpi_table_fadt), 8);
+    acpi_len += ROUNDUP(sizeof(struct acpi_table_stao), 8);
 
     madt_size = gic_get_hwdom_madt_size(d);
-    acpi_size += ROUNDUP(madt_size, 8);
+    acpi_len += ROUNDUP(madt_size, 8);
 
     addr = acpi_os_get_root_pointer();
     if ( !addr )
@@ -484,12 +484,12 @@ static int __init estimate_acpi_efi_size(struct domain *d,
     }
 
     /* Add place for STAO table in XSDT table */
-    acpi_size += ROUNDUP(table->length + sizeof(u64), 8);
+    acpi_len += ROUNDUP(table->length + sizeof(u64), 8);
     acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
 
-    acpi_size += ROUNDUP(sizeof(struct acpi_table_rsdp), 8);
+    acpi_len += ROUNDUP(sizeof(struct acpi_table_rsdp), 8);
     d->arch.efi_acpi_len = PAGE_ALIGN(ROUNDUP(efi_size, 8)
-                                      + ROUNDUP(acpi_size, 8));
+                                      + ROUNDUP(acpi_len, 8));
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 09:11:18 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 09:11:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272717.1560117 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8aYb-0000h5-M5; Fri, 03 Apr 2026 09:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272717.1560117; Fri, 03 Apr 2026 09: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 1w8aYb-0000gy-JV; Fri, 03 Apr 2026 09:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1272717;
 Fri, 03 Apr 2026 09:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8aYa-0000gi-Ik
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 09:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYa-007Nf3-2I
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYa-00GLbD-1P
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FkzXBLCtRy7W/HJcSk6BiNptPWljDRIX+wO2CHWEBnM=; b=US/Coxmth4qdNA2KXI12gCRC+M
	WfAc2y9QzeiLmVIhmcQ53lwOXtVi94yahHmHtCKJHY88/kCb5mVoi+65PLKFr+NOIDsP9dkBWg8OZ
	Dit1nfX+I0UDjZBYGloHiWGhdegq+u+D03TqnMmHekeSfBfsepIsXEdHTFWdm5c4Zq/U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: pci: Narrow scope of file-local symbols
Message-Id: <E1w8aYa-00GLbD-1P@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 09:11:12 +0000

commit 9d9d7586c3a990c928f69578eccc656751ee70a7
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 1 16:58:15 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:43:00 2026 +0200

    xen/arm: pci: Narrow scope of file-local symbols
    
    Make pci_alloc_host_bridge() and pci_add_host_bridge() in
    pci-host-common.c, rcar4_pcie_ops and rcar4_pcie_child_ops in
    pci-host-rcar4.c, and nwl_pcie_ops in pci-host-zynqmp.c static, as
    they are only used within their respective translation units.
    
    Also include pci-host-rcar4.h in pci-host-rcar4.c so that the
    declarations of its externally visible functions are visible at the
    point of definition.
    
    This resolves MISRA C Rule 8.4 violations.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/pci/pci-host-common.c | 4 ++--
 xen/arch/arm/pci/pci-host-rcar4.c  | 5 +++--
 xen/arch/arm/pci/pci-host-zynqmp.c | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
index 487c545f3a..9060afc14d 100644
--- a/xen/arch/arm/pci/pci-host-common.c
+++ b/xen/arch/arm/pci/pci-host-common.c
@@ -158,7 +158,7 @@ err_exit:
     return NULL;
 }
 
-struct pci_host_bridge *pci_alloc_host_bridge(void)
+static struct pci_host_bridge *pci_alloc_host_bridge(void)
 {
     struct pci_host_bridge *bridge = xzalloc(struct pci_host_bridge);
 
@@ -170,7 +170,7 @@ struct pci_host_bridge *pci_alloc_host_bridge(void)
     return bridge;
 }
 
-void pci_add_host_bridge(struct pci_host_bridge *bridge)
+static void pci_add_host_bridge(struct pci_host_bridge *bridge)
 {
     list_add_tail(&bridge->node, &pci_host_bridges);
 }
diff --git a/xen/arch/arm/pci/pci-host-rcar4.c b/xen/arch/arm/pci/pci-host-rcar4.c
index 9290c6cac5..e1e8eb0ee1 100644
--- a/xen/arch/arm/pci/pci-host-rcar4.c
+++ b/xen/arch/arm/pci/pci-host-rcar4.c
@@ -13,6 +13,7 @@
 #include <asm/pci.h>
 
 #include "pci-designware.h"
+#include "pci-host-rcar4.h"
 
 #define RCAR4_DWC_VERSION       0x520A
 
@@ -61,7 +62,7 @@ static int __init rcar4_child_cfg_reg_index(struct dt_device_node *np)
 }
 
 /* ECAM ops */
-const struct pci_ecam_ops rcar4_pcie_ops = {
+static const struct pci_ecam_ops rcar4_pcie_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = rcar4_cfg_reg_index,
     .pci_ops    = {
@@ -73,7 +74,7 @@ const struct pci_ecam_ops rcar4_pcie_ops = {
     }
 };
 
-const struct pci_ecam_ops rcar4_pcie_child_ops = {
+static const struct pci_ecam_ops rcar4_pcie_child_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = rcar4_child_cfg_reg_index,
     .pci_ops    = {
diff --git a/xen/arch/arm/pci/pci-host-zynqmp.c b/xen/arch/arm/pci/pci-host-zynqmp.c
index 2c4afa7a19..2d98b00696 100644
--- a/xen/arch/arm/pci/pci-host-zynqmp.c
+++ b/xen/arch/arm/pci/pci-host-zynqmp.c
@@ -27,7 +27,7 @@ static int __init nwl_cfg_reg_index(struct dt_device_node *np)
 }
 
 /* ECAM ops */
-const struct pci_ecam_ops nwl_pcie_ops = {
+static const struct pci_ecam_ops nwl_pcie_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = nwl_cfg_reg_index,
     .pci_ops    = {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 09:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 09:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272718.1560122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8aYl-0000jj-Op; Fri, 03 Apr 2026 09:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272718.1560122; Fri, 03 Apr 2026 09: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 1w8aYl-0000jb-MJ; Fri, 03 Apr 2026 09:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1272718;
 Fri, 03 Apr 2026 09:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8aYk-0000jV-KR
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 09:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYk-007Nf7-2d
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYk-00GLbh-1n
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LHqMq/F3wrZ1ggANJVO4LrLTgw6/sX63pEy1odvSTys=; b=mL2WW+7J/EVlUoBww/GykP9QOp
	ZMyp0wNe9Bu8CGXkJvttv6SLt2fnRwPnf/TxYzB/akRygLJYsvfx7UMT31OEpyh2xDOZ5TkaYKHmo
	bhVu9zql8atccZFElZEJIlseBWYQjaf8rAfCf9eDAQqLZpJcZWQHRTXs7cVrG7FLy6N4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: vpci: Move content of xen/arch/arm/vpci.h to arch header
Message-Id: <E1w8aYk-00GLbh-1n@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 09:11:22 +0000

commit b9f6a102f535b8444c3538fa99ccb0b12c3ab6b4
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 1 16:58:16 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:43:07 2026 +0200

    xen/arm: vpci: Move content of xen/arch/arm/vpci.h to arch header
    
    Move domain_vpci_init() and domain_vpci_get_num_mmio_handlers()
    declarations from the private xen/arch/arm/vpci.h into the public
    xen/arch/arm/include/asm/vpci.h, and remove the now redundant
    private header.
    
    Update domain.c to include <asm/vpci.h> instead of the removed private
    header.
    
    This ensures the declarations are visible where the functions are
    defined, resolving a MISRA C Rule 8.4 violation.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 xen/arch/arm/domain.c           |  2 +-
 xen/arch/arm/include/asm/vpci.h | 18 ++++++++++++++++++
 xen/arch/arm/vpci.h             | 42 -----------------------------------------
 3 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 581f82bddd..26380a807c 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -31,10 +31,10 @@
 #include <asm/tee/tee.h>
 #include <asm/vfp.h>
 #include <asm/vgic.h>
+#include <asm/vpci.h>
 #include <asm/vpsci.h>
 #include <asm/vtimer.h>
 
-#include "vpci.h"
 #include "vuart.h"
 
 DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
diff --git a/xen/arch/arm/include/asm/vpci.h b/xen/arch/arm/include/asm/vpci.h
index db04687fc0..0cc6f5a105 100644
--- a/xen/arch/arm/include/asm/vpci.h
+++ b/xen/arch/arm/include/asm/vpci.h
@@ -2,6 +2,9 @@
 #ifndef ARM_VPCI_H
 #define ARM_VPCI_H
 
+struct domain;
+
+#ifdef CONFIG_HAS_VPCI
 /* Arch-specific MSI data for vPCI. */
 struct vpci_arch_msi {
 };
@@ -10,4 +13,19 @@ struct vpci_arch_msi {
 struct vpci_arch_msix_entry {
 };
 
+
+int domain_vpci_init(struct domain *d);
+unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d);
+#else
+static inline int domain_vpci_init(struct domain *d)
+{
+    return 0;
+}
+
+static inline unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
+{
+    return 0;
+}
+#endif /* CONFIG_HAS_VPCI */
+
 #endif /* ARM_VPCI_H */
diff --git a/xen/arch/arm/vpci.h b/xen/arch/arm/vpci.h
deleted file mode 100644
index 3c713f3fcd..0000000000
--- a/xen/arch/arm/vpci.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * xen/arch/arm/vpci.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARCH_ARM_VPCI_H__
-#define __ARCH_ARM_VPCI_H__
-
-#ifdef CONFIG_HAS_VPCI
-int domain_vpci_init(struct domain *d);
-unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d);
-#else
-static inline int domain_vpci_init(struct domain *d)
-{
-    return 0;
-}
-
-static inline unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
-{
-    return 0;
-}
-#endif
-
-#endif /* __ARCH_ARM_VPCI_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 Fri Apr 03 09:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 09:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272719.1560126 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8aYv-0000lr-QP; Fri, 03 Apr 2026 09:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272719.1560126; Fri, 03 Apr 2026 09: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 1w8aYv-0000lj-Ni; Fri, 03 Apr 2026 09:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1272719;
 Fri, 03 Apr 2026 09:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8aYu-0000ld-OE
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 09:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYu-007NfF-2x
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aYu-00GLdB-27
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lVIQZJcwrwRpdzALEj0NuryRifuE6i5onZicVW5mv8c=; b=1Xb9zcLqPECfktGkbTNnXoH/uN
	0sG1eeBm6BgOhZEyacDyK0y8usnJ4aI+QWv7oF16EsdE0W8BBCMVc4++oHFU3tFcCKbt/kZfZHrJA
	dSOwjUksqAM62elRxgPCpv/ew+yikX3ilTMCRimkXBHJtrVVaCn0FU+Z2950woYAtNWE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: mpu: Fix ioremap_attr region size and return value
Message-Id: <E1w8aYu-00GLdB-27@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 09:11:32 +0000

commit 9e8aa00f627984670c782954e06fc3517c010f94
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Apr 2 09:56:45 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:44:07 2026 +0200

    xen/arm: mpu: Fix ioremap_attr region size and return value
    
    ioremap_attr() computes end_pg as round_pgup(start_pg + len), but
    start_pg has already had the sub-page offset stripped by round_pgdown().
    When start is not page-aligned, the sub-page offset is lost and the
    resulting MPU protection region can be one page too small, leaving the
    tail of the requested range covered by something else.
    
    Additionally, the function returns maddr_to_virt(start_pg) — the
    page-aligned base dropping the sub-page offset that callers (e.g. ioremap
    of an unaligned MMIO base) depend on to reach the correct register block.
    
    Fix end_pg to use the original start so the sub-page tail is included
    in the rounding, and return the original start address to preserve the
    offset, matching the behaviour of other ioremap implementations.
    
    Fixes: efeec4c70798 ("arm/mpu: Implement ioremap_attr for MPU")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/mpu/mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 6b3b0b06e9..aff88bd3a9 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -596,13 +596,13 @@ void free_init_memory(void)
 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
 {
     paddr_t start_pg = round_pgdown(start);
-    paddr_t end_pg = round_pgup(start_pg + len);
+    paddr_t end_pg = round_pgup(start + len);
 
     if ( xen_mpumap_update(start_pg, end_pg, flags) )
         return NULL;
 
     /* Mapped or already mapped */
-    return maddr_to_virt(start_pg);
+    return maddr_to_virt(start);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 03 09:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Apr 2026 09:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1272720.1560130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w8aZ5-0000o6-Rl; Fri, 03 Apr 2026 09:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1272720.1560130; Fri, 03 Apr 2026 09: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 1w8aZ5-0000ny-P9; Fri, 03 Apr 2026 09:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1272720;
 Fri, 03 Apr 2026 09:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w8aZ4-0000ns-QS
 for xen-changelog@lists.xenproject.org; Fri, 03 Apr 2026 09:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aZ5-007NfM-01
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w8aZ4-00GLdg-2S
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=22WZzYof2cxuUhUfBcI1X883OABDCn5ImnF9R1YToEY=; b=F/qTLUuUc3IL85rBjbfUCgXzmP
	SEpJWxZzaWw5ujNoJJSmxFEn1YiV8Nxg5Vv2RN1N6o6KEy7JKCCzUs83EIg+RFM3UOHUDCHxUBLDU
	0HSNgdgGDn7rT+XD5It+0/fJjylcg7INIWFmA83TGv7O/2yQB06zU1jw1p+rrGKZkvO8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/device-tree: Fix off-by-one bounds check in make_memory_node()
Message-Id: <E1w8aZ4-00GLdg-2S@xenbits.xenproject.org>
Date: Fri, 03 Apr 2026 09:11:42 +0000

commit fc453fef7708f65d4023ff63ebafe52c822229a1
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Thu Apr 2 20:38:35 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 3 08:45:14 2026 +0200

    xen/device-tree: Fix off-by-one bounds check in make_memory_node()
    
    When building Xen with CONFIG_STATIC_SHM=n, booting a hardware
    domain with exactly NR_MEM_BANKS (256) reserved-memory regions
    causes a panic:
    
    (XEN) Xen BUG at common/device-tree/domain-build.c:497
    (XEN) Xen call trace:
    (XEN)    [<00000a0000289aa8>] make_memory_node+0x178/0x234 (PC)
    
    This occurs due to an off-by-one error in the bounds checking of
    the reg array in make_memory_node(). The check:
        BUG_ON(nr_cells >= ARRAY_SIZE(reg));
    incorrectly triggers when the array is exactly full (i.e., when
    nr_cells == ARRAY_SIZE(reg)), preventing the 256th and final valid
    memory region from being written.
    
    When CONFIG_STATIC_SHM=y, this bug is usually hidden because
    DT_MEM_NODE_REG_RANGE_SIZE adds extra space for SHM banks.
    This extra capacity prevents the array from reaching its
    maximum limit while processing the 256th memory region.
    However, if a domain is configured with exactly NR_MEM_BANKS
    and NR_SHMEM_BANKS, the array will completely fill up and trigger
    the same panic.
    
    Fix this by changing the condition to strictly greater than (>).
    Apply the exact same fix to shm_mem_node_fill_reg_range() to
    prevent the same error.
    
    Fixes: cd8015b634b0 ("ARM/dom0: Avoid using a variable length array in make_memory_node()")
    Fixes: 7846f7699fea ("xen/arm: List static shared memory regions as /memory nodes")
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/device-tree/domain-build.c | 2 +-
 xen/common/device-tree/static-shmem.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index 6708c9dd66..540627b74e 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -494,7 +494,7 @@ int __init make_memory_node(const struct kernel_info *kinfo, int addrcells,
             continue;
 
         nr_cells += reg_size;
-        BUG_ON(nr_cells >= ARRAY_SIZE(reg));
+        BUG_ON(nr_cells > ARRAY_SIZE(reg));
         dt_child_set_range(&cells, addrcells, sizecells, start, size);
     }
 
diff --git a/xen/common/device-tree/static-shmem.c b/xen/common/device-tree/static-shmem.c
index 79f23caa77..4c4cc1b123 100644
--- a/xen/common/device-tree/static-shmem.c
+++ b/xen/common/device-tree/static-shmem.c
@@ -838,7 +838,7 @@ void __init shm_mem_node_fill_reg_range(const struct kernel_info *kinfo,
         paddr_t size = mem->bank[i].size;
 
         *nr_cells += addrcells + sizecells;
-        BUG_ON(*nr_cells >= DT_MEM_NODE_REG_RANGE_SIZE);
+        BUG_ON(*nr_cells > DT_MEM_NODE_REG_RANGE_SIZE);
         dt_child_set_range(&cells, addrcells, sizecells, start, size);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Apr 04 12:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Apr 2026 12:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273688.1560249 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90M8-00028V-6M; Sat, 04 Apr 2026 12:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273688.1560249; Sat, 04 Apr 2026 12:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90M8-00028I-3Y; Sat, 04 Apr 2026 12:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1273688;
 Sat, 04 Apr 2026 12:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w90M6-00028C-Lj
 for xen-changelog@lists.xenproject.org; Sat, 04 Apr 2026 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90M6-0098F0-2U
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90M6-000DRQ-1f
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1JxgpG62y/b8GGVJ4dJCMq9FK0EEP1ccJkRZOEx5NYU=; b=r1JcDBwEdlqPGR/xCBrqfrEXUK
	EFbdnn16/7+gGZNUxStdzVot7J7qiZARUAO4bSR3rL2CPpr/tyCLB3VZutmZx8AyMticqqn/TlnQU
	W9Es4PNBsjcZyXA12hBYzDSVBSpQD6nkajjcCZr3BPHbtlF5vEcftN91rXIPAZxuMHwg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu: Drop NOISY_CAPS
Message-Id: <E1w90M6-000DRQ-1f@xenbits.xenproject.org>
Date: Sat, 04 Apr 2026 12:44:02 +0000

commit 591f76e1994ccde47b6698e2ca89f69828692f12
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 19 11:21:54 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Drop NOISY_CAPS
    
    These were plausibly useful for debugging when there were 4 words in
    x86_capability[], but it's currently 22 words and growing.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 057592b7c8..444aa9cb4d 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -571,13 +571,6 @@ void identify_cpu(struct cpuinfo_x86 *c)
 	reset_cpuinfo(c, false);
 	generic_identify(c);
 
-#ifdef NOISY_CAPS
-	printk(KERN_DEBUG "CPU: After vendor identify, caps:");
-	for (i = 0; i < NCAPINTS; i++)
-		printk(" %08x", c->x86_capability[i]);
-	printk("\n");
-#endif
-
 	/*
 	 * Vendor-specific initialization.  In this section we
 	 * canonicalize the feature flags, meaning if there are
@@ -614,13 +607,6 @@ void identify_cpu(struct cpuinfo_x86 *c)
 
 	xstate_init(c);
 
-#ifdef NOISY_CAPS
-	printk(KERN_DEBUG "CPU: After all inits, caps:");
-	for (i = 0; i < NCAPINTS; i++)
-		printk(" %08x", c->x86_capability[i]);
-	printk("\n");
-#endif
-
 	/*
 	 * If RDRAND is available, make an attempt to check that it actually
 	 * (still) works.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Apr 04 12:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Apr 2026 12:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273689.1560253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90MI-00029r-7S; Sat, 04 Apr 2026 12:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273689.1560253; Sat, 04 Apr 2026 12:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90MI-00029j-4w; Sat, 04 Apr 2026 12:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1273689;
 Sat, 04 Apr 2026 12:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w90MG-00029X-N9
 for xen-changelog@lists.xenproject.org; Sat, 04 Apr 2026 12:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90MG-0098F9-2q
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90MG-000DSk-21
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I5E78d2R+8CoHprZaZOLnVzdaEKg76h58LjEgf5yglY=; b=q9NOFWn5fs56FPB+1zC2VU2ehS
	P7jFhCJpG2dnjo7Sa4UPeqyfd3LC4NDlnR1i/gP2YqVEQzToUNhmoXcYL8jM/wcXlMRhC3BjhH5o0
	Rx0KDLeNhYBqHt18XeXMqumyYH6xlQJPERTNHTb45V5/LIxGb1qaVSaErT+1o4RhNLpo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu: Drop default_init() and default_cpu
Message-Id: <E1w90MG-000DSk-21@xenbits.xenproject.org>
Date: Sat, 04 Apr 2026 12:44:12 +0000

commit 63ddf5027fb229c42653df27579eab97dc8e9564
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 19 11:27:12 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Drop default_init() and default_cpu
    
    While the comment is reasonable, clearing SEP as the only action for an
    unknown CPU is useless.  Drop the infrastructure.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 444aa9cb4d..dd88694a72 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -99,15 +99,6 @@ bool __init is_forced_cpu_cap(unsigned int cap)
 	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
-static void cf_check default_init(struct cpuinfo_x86 * c)
-{
-	/* Not much we can do here... */
-	__clear_bit(X86_FEATURE_SEP, c->x86_capability);
-}
-
-static const struct cpu_dev __initconst_cf_clobber __used default_cpu = {
-	.c_init	= default_init,
-};
 static struct cpu_dev __ro_after_init actual_cpu;
 
 static DEFINE_PER_CPU(uint64_t, msr_misc_features);
@@ -336,7 +327,6 @@ void __init early_cpu_init(bool verbose)
 	case X86_VENDOR_SHANGHAI: actual_cpu = shanghai_cpu_dev; break;
 	case X86_VENDOR_HYGON:    actual_cpu = hygon_cpu_dev;    break;
 	default:
-		actual_cpu = default_cpu;
 		if (!verbose)
 			break;
 		printk(XENLOG_ERR
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Apr 04 12:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Apr 2026 12:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273690.1560258 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90MS-0002CP-8y; Sat, 04 Apr 2026 12:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273690.1560258; Sat, 04 Apr 2026 12:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90MS-0002CH-6J; Sat, 04 Apr 2026 12:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1273690;
 Sat, 04 Apr 2026 12:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w90MQ-0002CA-Q8
 for xen-changelog@lists.xenproject.org; Sat, 04 Apr 2026 12:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90MQ-0098FY-3C
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90MQ-000DTo-2L
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s8uGZqntclcd2zd9S8PO95iY1mrutUuM/uvpBeRuffk=; b=nyEOcHqfIqKAcXvIzywMW+AmP7
	492pINX13qpTOwg0dg507e9wj1BRec/bkEpo95B6PEF9eQbq41zneUZl7PHVFGjaS4O6duZvSxOf4
	AsfhGI9ZYsPntUALBgF/9T36QW7ZtGm593DHTjDqBdkArtyDQ14KlyXaoq721k6RYk/I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu: Fold generic_identify() into its single caller
Message-Id: <E1w90MQ-000DTo-2L@xenbits.xenproject.org>
Date: Sat, 04 Apr 2026 12:44:22 +0000

commit 670ef9e7192d0413feefbabeea757e0275549d4c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 17:32:58 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Fold generic_identify() into its single caller
    
    This makes the correctness of future changes more obvious.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index dd88694a72..fe8a818c1b 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -446,10 +446,13 @@ void reset_cpuinfo(struct cpuinfo_x86 *c, bool keep_basic)
     CPU_DATA_INIT((*c));
 }
 
-static void generic_identify(struct cpuinfo_x86 *c)
+void identify_cpu(struct cpuinfo_x86 *c)
 {
 	uint64_t val;
 	u32 eax, ebx, ecx, edx, tmp;
+	unsigned int i;
+
+	reset_cpuinfo(c, false);
 
 	/* Get vendor name */
 	cpuid(0, &c->cpuid_level, &ebx, &ecx, &edx);
@@ -549,17 +552,6 @@ static void generic_identify(struct cpuinfo_x86 *c)
 		c->x86_capability[FEATURESET_m10Al] = val;
 		c->x86_capability[FEATURESET_m10Ah] = val >> 32;
 	}
-}
-
-/*
- * This does the hard work of actually picking apart the CPU stuff...
- */
-void identify_cpu(struct cpuinfo_x86 *c)
-{
-	int i;
-
-	reset_cpuinfo(c, false);
-	generic_identify(c);
 
 	/*
 	 * Vendor-specific initialization.  In this section we
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Apr 04 12:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Apr 2026 12:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273691.1560261 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90Mc-0002G1-AN; Sat, 04 Apr 2026 12:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273691.1560261; Sat, 04 Apr 2026 12: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 1w90Mc-0002Fu-7j; Sat, 04 Apr 2026 12:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1273691;
 Sat, 04 Apr 2026 12:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w90Ma-0002Fo-TC
 for xen-changelog@lists.xenproject.org; Sat, 04 Apr 2026 12:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90Mb-0098Fc-0H
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90Ma-000DUw-2j
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OsIqKKcXMarMvi463YyXSoKXxPm/w4HsdR0/ww4RCMI=; b=NzluCmT7mi/5D5vwsmgaL96nw4
	JaGjeMiTfmd50m1jy3VIpdZw29eUKt42S4Vq3HfKjYS9YojTzP+9VJTKqTu7UogNdgkqjyUztL7re
	e/rmajlT7KJQM9r7PFd1gfSd28QZX9sUixUoqKlsxp1jS37jME1Vdo6zRNc0HeMkP78I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/sysctl: Drop XEN_SYSCTL_get_cpu_levelling_caps
Message-Id: <E1w90Ma-000DUw-2j@xenbits.xenproject.org>
Date: Sat, 04 Apr 2026 12:44:32 +0000

commit 370c23d0329fdb0d131e6fea19e76565141716b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 15:28:08 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    xen/sysctl: Drop XEN_SYSCTL_get_cpu_levelling_caps
    
    This hypercall is an addition of mine from commit 67528a3f0649 ("x86/cpu:
    Sysctl and common infrastructure for levelling context switching", 2016), but
    it never got wired into any toolstacks.  In the meantime, how we handle CPUID
    for guests has evolved substantially.
    
    In order to reuse the AMD levelling infrasturcture for boot time quirks,
    levelling_caps is going to have to change.  While it's probably safe to expose
    this difference, it's safer still to make it an internal detail.
    
    When re-plummbing the LCAP_* constants, turn them all into single bits.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 CHANGELOG.md                        |  2 ++
 tools/flask/policy/modules/dom0.te  |  1 -
 tools/include/xenguest.h            |  1 -
 tools/libs/guest/xg_cpuid_x86.c     | 14 --------------
 xen/arch/x86/include/asm/cpuid.h    | 15 ++++++---------
 xen/arch/x86/sysctl.c               |  6 ------
 xen/include/public/sysctl.h         | 24 ++----------------------
 xen/xsm/flask/hooks.c               |  4 ----
 xen/xsm/flask/policy/access_vectors |  2 --
 9 files changed, 10 insertions(+), 59 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a065c7a8e..166df43c63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - The cpuid_mask_* command line options for legacy CPUs.  These were
      deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from
      2011 onwards, nor work at all with Intel CPUs from 2012.
+   - The SYSCTL_get_cpu_levelling_caps sysctl.  This is not known to have been
+     used by any toolstack.
    - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
diff --git a/tools/flask/policy/modules/dom0.te b/tools/flask/policy/modules/dom0.te
index d30edf8be1..aae69041a9 100644
--- a/tools/flask/policy/modules/dom0.te
+++ b/tools/flask/policy/modules/dom0.te
@@ -43,7 +43,6 @@ allow dom0_t xen_t:xen2 {
 	psr_alloc
 	pmu_ctrl
 	get_symbol
-	get_cpu_levelling_caps
 	get_cpu_featureset
 	livepatch_op
 	coverage_op
diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index 7c3b8b0983..2a277cb7cd 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -822,7 +822,6 @@ int xc_cpu_policy_update_msrs(xc_interface *xch, xc_cpu_policy_t *policy,
 bool xc_cpu_policy_is_compatible(xc_interface *xch, xc_cpu_policy_t *host,
                                  xc_cpu_policy_t *guest);
 
-int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps);
 int xc_get_cpu_featureset(xc_interface *xch, uint32_t index,
                           uint32_t *nr_features, uint32_t *featureset);
 
diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 263a9d4787..0db6d77cd8 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -36,20 +36,6 @@ enum {
 #define bitmaskof(idx)      (1u << ((idx) & 31))
 #define featureword_of(idx) ((idx) >> 5)
 
-int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps)
-{
-    struct xen_sysctl sysctl = {};
-    int ret;
-
-    sysctl.cmd = XEN_SYSCTL_get_cpu_levelling_caps;
-    ret = do_sysctl(xch, &sysctl);
-
-    if ( !ret )
-        *caps = sysctl.u.cpu_levelling_caps.caps;
-
-    return ret;
-}
-
 int xc_get_cpu_featureset(xc_interface *xch, uint32_t index,
                           uint32_t *nr_features, uint32_t *featureset)
 {
diff --git a/xen/arch/x86/include/asm/cpuid.h b/xen/arch/x86/include/asm/cpuid.h
index f1b9e37a42..c7ee1d54bc 100644
--- a/xen/arch/x86/include/asm/cpuid.h
+++ b/xen/arch/x86/include/asm/cpuid.h
@@ -15,15 +15,12 @@ extern const uint32_t known_features[FSCAPINTS];
  * Expected levelling capabilities (given cpuid vendor/family information),
  * and levelling capabilities actually available (given MSR probing).
  */
-#define LCAP_faulting XEN_SYSCTL_CPU_LEVELCAP_faulting
-#define LCAP_1cd      (XEN_SYSCTL_CPU_LEVELCAP_ecx |        \
-                       XEN_SYSCTL_CPU_LEVELCAP_edx)
-#define LCAP_e1cd     (XEN_SYSCTL_CPU_LEVELCAP_extd_ecx |   \
-                       XEN_SYSCTL_CPU_LEVELCAP_extd_edx)
-#define LCAP_Da1      XEN_SYSCTL_CPU_LEVELCAP_xsave_eax
-#define LCAP_6c       XEN_SYSCTL_CPU_LEVELCAP_thermal_ecx
-#define LCAP_7ab0     (XEN_SYSCTL_CPU_LEVELCAP_l7s0_eax |   \
-                       XEN_SYSCTL_CPU_LEVELCAP_l7s0_ebx)
+#define LCAP_faulting (1U <<  0) /* CPUID Faulting       */
+#define LCAP_1cd      (1U <<  1) /* 0x00000001.ecx/edx   */
+#define LCAP_e1cd     (1U <<  2) /* 0x80000001.ecx/edx   */
+#define LCAP_Da1      (1U <<  3) /* 0x0000000D:1.eax     */
+#define LCAP_6c       (1U <<  4) /* 0x00000006.ecx       */
+#define LCAP_7ab0     (1U <<  5) /* 0x00000007:0.eax/ebx */
 extern unsigned int expected_levelling_cap, levelling_caps;
 
 struct cpuidmasks
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 1b04947516..0fbbdd8b28 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -289,12 +289,6 @@ long arch_do_sysctl(
         break;
     }
 
-    case XEN_SYSCTL_get_cpu_levelling_caps:
-        sysctl->u.cpu_levelling_caps.caps = levelling_caps;
-        if ( __copy_field_to_guest(u_sysctl, sysctl, u.cpu_levelling_caps.caps) )
-            ret = -EFAULT;
-        break;
-
     case XEN_SYSCTL_get_cpu_featureset:
     {
         static const struct cpu_policy *const policy_table[6] = {
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 66c9b65465..c7cd9b4eb0 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -932,25 +932,6 @@ struct xen_sysctl_psr_alloc {
     } u;
 };
 
-/*
- * XEN_SYSCTL_get_cpu_levelling_caps (x86 specific)
- *
- * Return hardware capabilities concerning masking or faulting of the cpuid
- * instruction for PV guests.
- */
-struct xen_sysctl_cpu_levelling_caps {
-#define XEN_SYSCTL_CPU_LEVELCAP_faulting    (1UL <<  0) /* CPUID faulting    */
-#define XEN_SYSCTL_CPU_LEVELCAP_ecx         (1UL <<  1) /* 0x00000001.ecx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_edx         (1UL <<  2) /* 0x00000001.edx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_extd_ecx    (1UL <<  3) /* 0x80000001.ecx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_extd_edx    (1UL <<  4) /* 0x80000001.edx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_xsave_eax   (1UL <<  5) /* 0x0000000D:1.eax  */
-#define XEN_SYSCTL_CPU_LEVELCAP_thermal_ecx (1UL <<  6) /* 0x00000006.ecx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_l7s0_eax    (1UL <<  7) /* 0x00000007:0.eax  */
-#define XEN_SYSCTL_CPU_LEVELCAP_l7s0_ebx    (1UL <<  8) /* 0x00000007:0.ebx  */
-    uint32_t caps;
-};
-
 /*
  * XEN_SYSCTL_get_cpu_featureset (x86 specific)
  *
@@ -1269,8 +1250,8 @@ struct xen_sysctl {
 #define XEN_SYSCTL_psr_cmt_op                    21
 #define XEN_SYSCTL_pcitopoinfo                   22
 #define XEN_SYSCTL_psr_alloc                     23
-/* #define XEN_SYSCTL_tmem_op                       24 */
-#define XEN_SYSCTL_get_cpu_levelling_caps        25
+/* #define XEN_SYSCTL_tmem_op                    24 */
+/* #define XEN_SYSCTL_get_cpu_levelling_caps     25 */
 #define XEN_SYSCTL_get_cpu_featureset            26
 #define XEN_SYSCTL_livepatch_op                  27
 /* #define XEN_SYSCTL_set_parameter              28 */
@@ -1300,7 +1281,6 @@ struct xen_sysctl {
         struct xen_sysctl_coverage_op       coverage_op;
         struct xen_sysctl_psr_cmt_op        psr_cmt_op;
         struct xen_sysctl_psr_alloc         psr_alloc;
-        struct xen_sysctl_cpu_levelling_caps cpu_levelling_caps;
         struct xen_sysctl_cpu_featureset    cpu_featureset;
         struct xen_sysctl_livepatch_op      livepatch;
 #if defined(__i386__) || defined(__x86_64__)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b250b27065..28522dcbd2 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -884,10 +884,6 @@ static int cf_check flask_sysctl(int cmd)
         return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
                                     XEN2__PSR_ALLOC, NULL);
 
-    case XEN_SYSCTL_get_cpu_levelling_caps:
-        return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
-                                    XEN2__GET_CPU_LEVELLING_CAPS, NULL);
-
     case XEN_SYSCTL_get_cpu_featureset:
         return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
                                     XEN2__GET_CPU_FEATURESET, NULL);
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index ce907d50a4..bbb9c117ec 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -87,8 +87,6 @@ class xen2
     pmu_ctrl
 # PMU use (domains, including unprivileged ones, will be using this operation)
     pmu_use
-# XEN_SYSCTL_get_cpu_levelling_caps
-    get_cpu_levelling_caps
 # XEN_SYSCTL_get_cpu_featureset
     get_cpu_featureset
 # XEN_SYSCTL_livepatch_op
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Apr 04 12:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Apr 2026 12:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273692.1560266 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90Mm-0002I0-Bg; Sat, 04 Apr 2026 12:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273692.1560266; Sat, 04 Apr 2026 12:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90Mm-0002Hs-9A; Sat, 04 Apr 2026 12:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1273692;
 Sat, 04 Apr 2026 12:44:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w90Mk-0002Hm-W5
 for xen-changelog@lists.xenproject.org; Sat, 04 Apr 2026 12:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90Ml-0098Fg-0Y
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90Mk-000DVu-30
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yd+6+HjCrivk/M5Dl57Fqu59ZG9+/W98wa4AgLw6gi0=; b=njl5Zo5I3G8ez14WAPN0sd2Qj+
	O/SXWcugu3vDotYG9mHAQgms7mENlm2uIWkfBgeGjZ1SZ4U6uvFiNRURJl+A749FMJ6aq6hwULhvW
	hQ6PYIMmcUfjRpeyKXjO9nu/eBS98UEFKbLo51Gh8aIwlup+j2bx72MCvhsG3HODWrDI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu: Clean up use of LCAP_* constants
Message-Id: <E1w90Mk-000DVu-30@xenbits.xenproject.org>
Date: Sat, 04 Apr 2026 12:44:42 +0000

commit f962ef76bcab26c65b52c667896530c62b808799
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 15:41:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Clean up use of LCAP_* constants
    
    Now that the LCAP_* constants are single bits, we can simplify the expressions
    using them.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 12 ++++++------
 xen/arch/x86/domain.c  | 10 +++++-----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 2b7f60aa30..45b55b7a8c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -170,7 +170,7 @@ static void cf_check amd_ctxt_switch_masking(const struct vcpu *next)
 		(nextd && is_pv_domain(nextd) && nextd->arch.pv.cpuidmasks)
 		? nextd->arch.pv.cpuidmasks : &cpuidmask_defaults;
 
-	if ((levelling_caps & LCAP_1cd) == LCAP_1cd) {
+	if (levelling_caps & LCAP_1cd) {
 		uint64_t val = masks->_1cd;
 
 		/*
@@ -191,7 +191,7 @@ static void cf_check amd_ctxt_switch_masking(const struct vcpu *next)
 #define LAZY(cap, msr, field)						\
 	({								\
 		if (unlikely(these_masks->field != masks->field) &&	\
-		    ((levelling_caps & cap) == cap))			\
+		    (levelling_caps & cap))				\
 		{							\
 			wrmsr_amd(msr, masks->field);			\
 			these_masks->field = masks->field;		\
@@ -247,7 +247,7 @@ static void __init noinline amd_init_levelling(void)
 
 	probe_masking_msrs();
 
-	if ((levelling_caps & LCAP_1cd) == LCAP_1cd) {
+	if (levelling_caps & LCAP_1cd) {
 		uint32_t ecx, edx, tmp;
 
 		cpuid(0x00000001, &tmp, &tmp, &ecx, &edx);
@@ -260,7 +260,7 @@ static void __init noinline amd_init_levelling(void)
 		cpuidmask_defaults._1cd = ((uint64_t)ecx << 32) | edx;
 	}
 
-	if ((levelling_caps & LCAP_e1cd) == LCAP_e1cd) {
+	if (levelling_caps & LCAP_e1cd) {
 		uint32_t ecx, edx, tmp;
 
 		cpuid(0x80000001, &tmp, &tmp, &ecx, &edx);
@@ -271,7 +271,7 @@ static void __init noinline amd_init_levelling(void)
 		cpuidmask_defaults.e1cd = ((uint64_t)ecx << 32) | edx;
 	}
 
-	if ((levelling_caps & LCAP_7ab0) == LCAP_7ab0) {
+	if (levelling_caps & LCAP_7ab0) {
 		uint32_t eax, ebx, tmp;
 
 		cpuid(0x00000007, &eax, &ebx, &tmp, &tmp);
@@ -279,7 +279,7 @@ static void __init noinline amd_init_levelling(void)
 		cpuidmask_defaults._7ab0 &= ((uint64_t)eax << 32) | ebx;
 	}
 
-	if ((levelling_caps & LCAP_6c) == LCAP_6c) {
+	if (levelling_caps & LCAP_6c) {
 		uint32_t ecx = cpuid_ecx(6);
 
 		cpuidmask_defaults._6c &= (~0ULL << 32) | ecx;
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c9ae8ee6e3..1d458f1372 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -303,7 +303,7 @@ void domain_cpu_policy_changed(struct domain *d)
 
     if ( is_pv_domain(d) )
     {
-        if ( ((levelling_caps & LCAP_1cd) == LCAP_1cd) )
+        if ( levelling_caps & LCAP_1cd )
         {
             uint64_t mask = cpuidmask_defaults._1cd;
             uint32_t ecx = p->basic._1c;
@@ -368,7 +368,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->_1cd = mask;
         }
 
-        if ( ((levelling_caps & LCAP_6c) == LCAP_6c) )
+        if ( levelling_caps & LCAP_6c )
         {
             uint64_t mask = cpuidmask_defaults._6c;
 
@@ -378,7 +378,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->_6c = mask;
         }
 
-        if ( ((levelling_caps & LCAP_7ab0) == LCAP_7ab0) )
+        if ( levelling_caps & LCAP_7ab0 )
         {
             uint64_t mask = cpuidmask_defaults._7ab0;
 
@@ -395,7 +395,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->_7ab0 = mask;
         }
 
-        if ( ((levelling_caps & LCAP_Da1) == LCAP_Da1) )
+        if ( levelling_caps & LCAP_Da1 )
         {
             uint64_t mask = cpuidmask_defaults.Da1;
             uint32_t eax = p->xstate.Da1;
@@ -406,7 +406,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->Da1 = mask;
         }
 
-        if ( ((levelling_caps & LCAP_e1cd) == LCAP_e1cd) )
+        if ( levelling_caps & LCAP_e1cd )
         {
             uint64_t mask = cpuidmask_defaults.e1cd;
             uint32_t ecx = p->extd.e1c;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Apr 04 12:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Apr 2026 12:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273693.1560270 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90Mw-0002KI-DF; Sat, 04 Apr 2026 12:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273693.1560270; Sat, 04 Apr 2026 12:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w90Mw-0002K8-AW; Sat, 04 Apr 2026 12:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1273693;
 Sat, 04 Apr 2026 12:44:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w90Mv-0002Jl-2W
 for xen-changelog@lists.xenproject.org; Sat, 04 Apr 2026 12:44:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90Mv-0098Fm-0q
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w90Mv-000DWT-03
 for xen-changelog@lists.xenproject.org;
 Sat, 04 Apr 2026 12:44:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZVDN+ib33t9+Jph/HJ/cJhSOCz2LUALj47TQIBCluGs=; b=hoJDTUepQF1Vnp+SuMORqWYZ/G
	RH/esb03Y/gvq/7f7jWd7afIWfWAkoIH6FuSuvJ53+nZBvq6T2SNXhZaoW61FH3iMcgM8y7GbhQKw
	+q8CIZpZ08qj1lxaPmSWWwXBr8wK9mdSzqEIsPlS0+TzS3AAsr3l9YIpzd9nfSn5y2YY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpuid: Drop the include of public/sysctl.h
Message-Id: <E1w90Mv-000DWT-03@xenbits.xenproject.org>
Date: Sat, 04 Apr 2026 12:44:53 +0000

commit 33ceaa28275ca4e298616689ef96f19efaa87c35
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 15:48:33 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpuid: Drop the include of public/sysctl.h
    
    Following the removal of XEN_SYSCTL_get_cpu_levelling_caps, asm/cpuid.h
    doesn't need to include public/sysctl.h, but several other header files were
    picking up their includes transitively through asm/cpuid.h.  Untangle them.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/cpuid.h      | 2 --
 xen/arch/x86/include/asm/hvm/hvm.h    | 2 ++
 xen/arch/x86/include/asm/hvm/vlapic.h | 2 ++
 xen/arch/x86/include/asm/hvm/vpt.h    | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/cpuid.h b/xen/arch/x86/include/asm/cpuid.h
index c7ee1d54bc..774cfdf868 100644
--- a/xen/arch/x86/include/asm/cpuid.h
+++ b/xen/arch/x86/include/asm/cpuid.h
@@ -7,8 +7,6 @@
 #include <xen/kernel.h>
 #include <xen/percpu.h>
 
-#include <public/sysctl.h>
-
 extern const uint32_t known_features[FSCAPINTS];
 
 /*
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 846b91ebef..e7c1364802 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -19,6 +19,8 @@
 #include <asm/x86_emulate.h>
 
 struct pirq; /* needed by pi_update_irte */
+struct hvm_hw_cpu;
+struct xen_domctl_createdomain;
 
 #ifdef CONFIG_HVM_FEP
 /* Permit use of the Forced Emulation Prefix in HVM guests */
diff --git a/xen/arch/x86/include/asm/hvm/vlapic.h b/xen/arch/x86/include/asm/hvm/vlapic.h
index c388551198..f442dec3d9 100644
--- a/xen/arch/x86/include/asm/hvm/vlapic.h
+++ b/xen/arch/x86/include/asm/hvm/vlapic.h
@@ -12,6 +12,8 @@
 #include <xen/tasklet.h>
 #include <asm/hvm/vpt.h>
 
+#include <public/hvm/save.h>
+
 #define vcpu_vlapic(x)   (&(x)->arch.hvm.vlapic)
 #define vlapic_vcpu(x)   (container_of((x), struct vcpu, arch.hvm.vlapic))
 #define const_vlapic_vcpu(x) (container_of((x), const struct vcpu, \
diff --git a/xen/arch/x86/include/asm/hvm/vpt.h b/xen/arch/x86/include/asm/hvm/vpt.h
index 0b92b28625..24f0918280 100644
--- a/xen/arch/x86/include/asm/hvm/vpt.h
+++ b/xen/arch/x86/include/asm/hvm/vpt.h
@@ -12,6 +12,8 @@
 #include <xen/list.h>
 #include <xen/rwlock.h>
 
+#include <public/hvm/save.h>
+
 /*
  * Abstract layer of periodic time, one short time.
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sun Apr 05 00:55:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Apr 2026 00:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273957.1560337 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w9BlX-00070s-Lq; Sun, 05 Apr 2026 00:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273957.1560337; Sun, 05 Apr 2026 00: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 1w9BlX-00070j-Ie; Sun, 05 Apr 2026 00:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1273957;
 Sun, 05 Apr 2026 00:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w9BlV-00070b-T9
 for xen-changelog@lists.xenproject.org; Sun, 05 Apr 2026 00:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9BlW-009NmG-0A
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9BlV-000vMJ-2Y
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pef4oM9yNI+bcj0kSEDtTA1bCLqsUpS0jtYjyThNg58=; b=Pxp/beqn5ksKpLWlu306f0h8G0
	BK+WDvnoO/v8nnp0TvgXQxcV5uPviRfu7piA19IOI71Om8ab2ah/66pQVIBNLEwBfscQMMpP8jtiV
	jFFN/q9/IonBLKHuTgiT6ODbh2IInolNH02ocuEW+RR2BWfq9L0Uoh1cvgOakdXnKdY0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu: Drop NOISY_CAPS
Message-Id: <E1w9BlV-000vMJ-2Y@xenbits.xenproject.org>
Date: Sun, 05 Apr 2026 00:55:01 +0000

commit 591f76e1994ccde47b6698e2ca89f69828692f12
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 19 11:21:54 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Drop NOISY_CAPS
    
    These were plausibly useful for debugging when there were 4 words in
    x86_capability[], but it's currently 22 words and growing.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 057592b7c8..444aa9cb4d 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -571,13 +571,6 @@ void identify_cpu(struct cpuinfo_x86 *c)
 	reset_cpuinfo(c, false);
 	generic_identify(c);
 
-#ifdef NOISY_CAPS
-	printk(KERN_DEBUG "CPU: After vendor identify, caps:");
-	for (i = 0; i < NCAPINTS; i++)
-		printk(" %08x", c->x86_capability[i]);
-	printk("\n");
-#endif
-
 	/*
 	 * Vendor-specific initialization.  In this section we
 	 * canonicalize the feature flags, meaning if there are
@@ -614,13 +607,6 @@ void identify_cpu(struct cpuinfo_x86 *c)
 
 	xstate_init(c);
 
-#ifdef NOISY_CAPS
-	printk(KERN_DEBUG "CPU: After all inits, caps:");
-	for (i = 0; i < NCAPINTS; i++)
-		printk(" %08x", c->x86_capability[i]);
-	printk("\n");
-#endif
-
 	/*
 	 * If RDRAND is available, make an attempt to check that it actually
 	 * (still) works.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Apr 05 00:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Apr 2026 00:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273958.1560341 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w9Blg-00072G-N3; Sun, 05 Apr 2026 00:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273958.1560341; Sun, 05 Apr 2026 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 1w9Blg-000728-K4; Sun, 05 Apr 2026 00:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1273958;
 Sun, 05 Apr 2026 00:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w9Blf-00071y-VM
 for xen-changelog@lists.xenproject.org; Sun, 05 Apr 2026 00:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9Blg-009NmV-0U
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9Blf-000vMf-2s
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0/hUDQaXZDPcRkBGQJAgRmPIYwXlYDmQ4BpyFC4jGhk=; b=J5RJkYPTPCiQSw0RAJHEd9QTIG
	pfwPtaN9EbdtV3RIQ0bqcNaYNdjoVvMwVvoNYD9gsly9RfhWJVkNydBjAX4PraNiBk3c9XiKN5Os6
	DAn410zWK9044wmwa2JIz5OULVzY7cfalZLe/w2mijh/aqwM5O8ATAjyTdBaPCPe/faM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu: Drop default_init() and default_cpu
Message-Id: <E1w9Blf-000vMf-2s@xenbits.xenproject.org>
Date: Sun, 05 Apr 2026 00:55:11 +0000

commit 63ddf5027fb229c42653df27579eab97dc8e9564
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 19 11:27:12 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Drop default_init() and default_cpu
    
    While the comment is reasonable, clearing SEP as the only action for an
    unknown CPU is useless.  Drop the infrastructure.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 444aa9cb4d..dd88694a72 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -99,15 +99,6 @@ bool __init is_forced_cpu_cap(unsigned int cap)
 	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
-static void cf_check default_init(struct cpuinfo_x86 * c)
-{
-	/* Not much we can do here... */
-	__clear_bit(X86_FEATURE_SEP, c->x86_capability);
-}
-
-static const struct cpu_dev __initconst_cf_clobber __used default_cpu = {
-	.c_init	= default_init,
-};
 static struct cpu_dev __ro_after_init actual_cpu;
 
 static DEFINE_PER_CPU(uint64_t, msr_misc_features);
@@ -336,7 +327,6 @@ void __init early_cpu_init(bool verbose)
 	case X86_VENDOR_SHANGHAI: actual_cpu = shanghai_cpu_dev; break;
 	case X86_VENDOR_HYGON:    actual_cpu = hygon_cpu_dev;    break;
 	default:
-		actual_cpu = default_cpu;
 		if (!verbose)
 			break;
 		printk(XENLOG_ERR
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Apr 05 00:55:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Apr 2026 00:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273959.1560345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w9Blq-00074X-O6; Sun, 05 Apr 2026 00:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273959.1560345; Sun, 05 Apr 2026 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 1w9Blq-00074Q-LS; Sun, 05 Apr 2026 00:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1273959;
 Sun, 05 Apr 2026 00:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w9Blq-00074K-2V
 for xen-changelog@lists.xenproject.org; Sun, 05 Apr 2026 00:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9Blq-009Nmd-0q
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9Blp-000vN3-3D
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iqfKN8OgcmToc9h1eBgd6p0Adl81J8rP8XeX1Q7kh48=; b=SRE9gH+B1XL5OWGYDXf5sqo+vI
	BjUw3R+resiBdywYG3BUfB4gcsBSOqOXlQuPTH6GblzocMUwydtjtyIrbMjazSi04lo7e+GqD/kEO
	zXMpGyREL3Uiu/98FXxan9VYXOQ3SROyV12QuKisWxLkwFuwwsrnamrCrjqJwjEjY+s0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu: Fold generic_identify() into its single caller
Message-Id: <E1w9Blp-000vN3-3D@xenbits.xenproject.org>
Date: Sun, 05 Apr 2026 00:55:21 +0000

commit 670ef9e7192d0413feefbabeea757e0275549d4c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 17:32:58 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Fold generic_identify() into its single caller
    
    This makes the correctness of future changes more obvious.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index dd88694a72..fe8a818c1b 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -446,10 +446,13 @@ void reset_cpuinfo(struct cpuinfo_x86 *c, bool keep_basic)
     CPU_DATA_INIT((*c));
 }
 
-static void generic_identify(struct cpuinfo_x86 *c)
+void identify_cpu(struct cpuinfo_x86 *c)
 {
 	uint64_t val;
 	u32 eax, ebx, ecx, edx, tmp;
+	unsigned int i;
+
+	reset_cpuinfo(c, false);
 
 	/* Get vendor name */
 	cpuid(0, &c->cpuid_level, &ebx, &ecx, &edx);
@@ -549,17 +552,6 @@ static void generic_identify(struct cpuinfo_x86 *c)
 		c->x86_capability[FEATURESET_m10Al] = val;
 		c->x86_capability[FEATURESET_m10Ah] = val >> 32;
 	}
-}
-
-/*
- * This does the hard work of actually picking apart the CPU stuff...
- */
-void identify_cpu(struct cpuinfo_x86 *c)
-{
-	int i;
-
-	reset_cpuinfo(c, false);
-	generic_identify(c);
 
 	/*
 	 * Vendor-specific initialization.  In this section we
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Apr 05 00:55:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Apr 2026 00:55:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273960.1560348 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w9Bm0-000771-Pz; Sun, 05 Apr 2026 00:55:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273960.1560348; Sun, 05 Apr 2026 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 1w9Bm0-00076s-N3; Sun, 05 Apr 2026 00:55:32 +0000
Received: by outflank-mailman (input) for mailman id 1273960;
 Sun, 05 Apr 2026 00:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w9Bm0-00076f-6H
 for xen-changelog@lists.xenproject.org; Sun, 05 Apr 2026 00:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9Bm0-009Nmx-1A
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9Bm0-000vNl-0N
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/+dScR9rbT2/wiar32UQaq6u3xuGcFD/EMA92Jcbcys=; b=CbjWtXEH+8H7VsTf43l58Rnzgn
	3Cqx1bJ5SCEdIRy1/h3hpT4NGrbAs5Q7mK2CV5XMgKePIY4Cdz8I6RIK57lMZr3GfphxTYO/kTzbM
	T6ZhcpO9+1ZGUpe0WRScK6HqPMVRtr328zrjYnA0rhMLQtpBwrUzdJ9LOrjIxDA7d3q8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sysctl: Drop XEN_SYSCTL_get_cpu_levelling_caps
Message-Id: <E1w9Bm0-000vNl-0N@xenbits.xenproject.org>
Date: Sun, 05 Apr 2026 00:55:32 +0000

commit 370c23d0329fdb0d131e6fea19e76565141716b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 15:28:08 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    xen/sysctl: Drop XEN_SYSCTL_get_cpu_levelling_caps
    
    This hypercall is an addition of mine from commit 67528a3f0649 ("x86/cpu:
    Sysctl and common infrastructure for levelling context switching", 2016), but
    it never got wired into any toolstacks.  In the meantime, how we handle CPUID
    for guests has evolved substantially.
    
    In order to reuse the AMD levelling infrasturcture for boot time quirks,
    levelling_caps is going to have to change.  While it's probably safe to expose
    this difference, it's safer still to make it an internal detail.
    
    When re-plummbing the LCAP_* constants, turn them all into single bits.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 CHANGELOG.md                        |  2 ++
 tools/flask/policy/modules/dom0.te  |  1 -
 tools/include/xenguest.h            |  1 -
 tools/libs/guest/xg_cpuid_x86.c     | 14 --------------
 xen/arch/x86/include/asm/cpuid.h    | 15 ++++++---------
 xen/arch/x86/sysctl.c               |  6 ------
 xen/include/public/sysctl.h         | 24 ++----------------------
 xen/xsm/flask/hooks.c               |  4 ----
 xen/xsm/flask/policy/access_vectors |  2 --
 9 files changed, 10 insertions(+), 59 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a065c7a8e..166df43c63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - The cpuid_mask_* command line options for legacy CPUs.  These were
      deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from
      2011 onwards, nor work at all with Intel CPUs from 2012.
+   - The SYSCTL_get_cpu_levelling_caps sysctl.  This is not known to have been
+     used by any toolstack.
    - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
diff --git a/tools/flask/policy/modules/dom0.te b/tools/flask/policy/modules/dom0.te
index d30edf8be1..aae69041a9 100644
--- a/tools/flask/policy/modules/dom0.te
+++ b/tools/flask/policy/modules/dom0.te
@@ -43,7 +43,6 @@ allow dom0_t xen_t:xen2 {
 	psr_alloc
 	pmu_ctrl
 	get_symbol
-	get_cpu_levelling_caps
 	get_cpu_featureset
 	livepatch_op
 	coverage_op
diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index 7c3b8b0983..2a277cb7cd 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -822,7 +822,6 @@ int xc_cpu_policy_update_msrs(xc_interface *xch, xc_cpu_policy_t *policy,
 bool xc_cpu_policy_is_compatible(xc_interface *xch, xc_cpu_policy_t *host,
                                  xc_cpu_policy_t *guest);
 
-int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps);
 int xc_get_cpu_featureset(xc_interface *xch, uint32_t index,
                           uint32_t *nr_features, uint32_t *featureset);
 
diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 263a9d4787..0db6d77cd8 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -36,20 +36,6 @@ enum {
 #define bitmaskof(idx)      (1u << ((idx) & 31))
 #define featureword_of(idx) ((idx) >> 5)
 
-int xc_get_cpu_levelling_caps(xc_interface *xch, uint32_t *caps)
-{
-    struct xen_sysctl sysctl = {};
-    int ret;
-
-    sysctl.cmd = XEN_SYSCTL_get_cpu_levelling_caps;
-    ret = do_sysctl(xch, &sysctl);
-
-    if ( !ret )
-        *caps = sysctl.u.cpu_levelling_caps.caps;
-
-    return ret;
-}
-
 int xc_get_cpu_featureset(xc_interface *xch, uint32_t index,
                           uint32_t *nr_features, uint32_t *featureset)
 {
diff --git a/xen/arch/x86/include/asm/cpuid.h b/xen/arch/x86/include/asm/cpuid.h
index f1b9e37a42..c7ee1d54bc 100644
--- a/xen/arch/x86/include/asm/cpuid.h
+++ b/xen/arch/x86/include/asm/cpuid.h
@@ -15,15 +15,12 @@ extern const uint32_t known_features[FSCAPINTS];
  * Expected levelling capabilities (given cpuid vendor/family information),
  * and levelling capabilities actually available (given MSR probing).
  */
-#define LCAP_faulting XEN_SYSCTL_CPU_LEVELCAP_faulting
-#define LCAP_1cd      (XEN_SYSCTL_CPU_LEVELCAP_ecx |        \
-                       XEN_SYSCTL_CPU_LEVELCAP_edx)
-#define LCAP_e1cd     (XEN_SYSCTL_CPU_LEVELCAP_extd_ecx |   \
-                       XEN_SYSCTL_CPU_LEVELCAP_extd_edx)
-#define LCAP_Da1      XEN_SYSCTL_CPU_LEVELCAP_xsave_eax
-#define LCAP_6c       XEN_SYSCTL_CPU_LEVELCAP_thermal_ecx
-#define LCAP_7ab0     (XEN_SYSCTL_CPU_LEVELCAP_l7s0_eax |   \
-                       XEN_SYSCTL_CPU_LEVELCAP_l7s0_ebx)
+#define LCAP_faulting (1U <<  0) /* CPUID Faulting       */
+#define LCAP_1cd      (1U <<  1) /* 0x00000001.ecx/edx   */
+#define LCAP_e1cd     (1U <<  2) /* 0x80000001.ecx/edx   */
+#define LCAP_Da1      (1U <<  3) /* 0x0000000D:1.eax     */
+#define LCAP_6c       (1U <<  4) /* 0x00000006.ecx       */
+#define LCAP_7ab0     (1U <<  5) /* 0x00000007:0.eax/ebx */
 extern unsigned int expected_levelling_cap, levelling_caps;
 
 struct cpuidmasks
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 1b04947516..0fbbdd8b28 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -289,12 +289,6 @@ long arch_do_sysctl(
         break;
     }
 
-    case XEN_SYSCTL_get_cpu_levelling_caps:
-        sysctl->u.cpu_levelling_caps.caps = levelling_caps;
-        if ( __copy_field_to_guest(u_sysctl, sysctl, u.cpu_levelling_caps.caps) )
-            ret = -EFAULT;
-        break;
-
     case XEN_SYSCTL_get_cpu_featureset:
     {
         static const struct cpu_policy *const policy_table[6] = {
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 66c9b65465..c7cd9b4eb0 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -932,25 +932,6 @@ struct xen_sysctl_psr_alloc {
     } u;
 };
 
-/*
- * XEN_SYSCTL_get_cpu_levelling_caps (x86 specific)
- *
- * Return hardware capabilities concerning masking or faulting of the cpuid
- * instruction for PV guests.
- */
-struct xen_sysctl_cpu_levelling_caps {
-#define XEN_SYSCTL_CPU_LEVELCAP_faulting    (1UL <<  0) /* CPUID faulting    */
-#define XEN_SYSCTL_CPU_LEVELCAP_ecx         (1UL <<  1) /* 0x00000001.ecx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_edx         (1UL <<  2) /* 0x00000001.edx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_extd_ecx    (1UL <<  3) /* 0x80000001.ecx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_extd_edx    (1UL <<  4) /* 0x80000001.edx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_xsave_eax   (1UL <<  5) /* 0x0000000D:1.eax  */
-#define XEN_SYSCTL_CPU_LEVELCAP_thermal_ecx (1UL <<  6) /* 0x00000006.ecx    */
-#define XEN_SYSCTL_CPU_LEVELCAP_l7s0_eax    (1UL <<  7) /* 0x00000007:0.eax  */
-#define XEN_SYSCTL_CPU_LEVELCAP_l7s0_ebx    (1UL <<  8) /* 0x00000007:0.ebx  */
-    uint32_t caps;
-};
-
 /*
  * XEN_SYSCTL_get_cpu_featureset (x86 specific)
  *
@@ -1269,8 +1250,8 @@ struct xen_sysctl {
 #define XEN_SYSCTL_psr_cmt_op                    21
 #define XEN_SYSCTL_pcitopoinfo                   22
 #define XEN_SYSCTL_psr_alloc                     23
-/* #define XEN_SYSCTL_tmem_op                       24 */
-#define XEN_SYSCTL_get_cpu_levelling_caps        25
+/* #define XEN_SYSCTL_tmem_op                    24 */
+/* #define XEN_SYSCTL_get_cpu_levelling_caps     25 */
 #define XEN_SYSCTL_get_cpu_featureset            26
 #define XEN_SYSCTL_livepatch_op                  27
 /* #define XEN_SYSCTL_set_parameter              28 */
@@ -1300,7 +1281,6 @@ struct xen_sysctl {
         struct xen_sysctl_coverage_op       coverage_op;
         struct xen_sysctl_psr_cmt_op        psr_cmt_op;
         struct xen_sysctl_psr_alloc         psr_alloc;
-        struct xen_sysctl_cpu_levelling_caps cpu_levelling_caps;
         struct xen_sysctl_cpu_featureset    cpu_featureset;
         struct xen_sysctl_livepatch_op      livepatch;
 #if defined(__i386__) || defined(__x86_64__)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b250b27065..28522dcbd2 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -884,10 +884,6 @@ static int cf_check flask_sysctl(int cmd)
         return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
                                     XEN2__PSR_ALLOC, NULL);
 
-    case XEN_SYSCTL_get_cpu_levelling_caps:
-        return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
-                                    XEN2__GET_CPU_LEVELLING_CAPS, NULL);
-
     case XEN_SYSCTL_get_cpu_featureset:
         return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
                                     XEN2__GET_CPU_FEATURESET, NULL);
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index ce907d50a4..bbb9c117ec 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -87,8 +87,6 @@ class xen2
     pmu_ctrl
 # PMU use (domains, including unprivileged ones, will be using this operation)
     pmu_use
-# XEN_SYSCTL_get_cpu_levelling_caps
-    get_cpu_levelling_caps
 # XEN_SYSCTL_get_cpu_featureset
     get_cpu_featureset
 # XEN_SYSCTL_livepatch_op
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Apr 05 00:55:42 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Apr 2026 00:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273961.1560352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w9BmA-000791-R2; Sun, 05 Apr 2026 00:55:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273961.1560352; Sun, 05 Apr 2026 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 1w9BmA-00078s-OS; Sun, 05 Apr 2026 00:55:42 +0000
Received: by outflank-mailman (input) for mailman id 1273961;
 Sun, 05 Apr 2026 00:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w9BmA-00078m-91
 for xen-changelog@lists.xenproject.org; Sun, 05 Apr 2026 00:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9BmA-009NpQ-1V
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9BmA-000vQU-0f
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MhCb9SKZmd9tRLeyiNTr3bB0Pj9BTnaWN+L4NNyRhQQ=; b=T001U4X5FzkhWr70UB8CDAcJAS
	ZreHHAbLI55hFHfK4as533oNotjbtrUYdLqKipi1PUx1QH0/fjP4nlP8Pi07v7CVLMg58oScG5OcB
	yg09HC7gXyEEvxQvq6wdXqnm824n89GLV7JgTwSkPO2edP28oucERk2x9jdvQmQnqezA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu: Clean up use of LCAP_* constants
Message-Id: <E1w9BmA-000vQU-0f@xenbits.xenproject.org>
Date: Sun, 05 Apr 2026 00:55:42 +0000

commit f962ef76bcab26c65b52c667896530c62b808799
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 15:41:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpu: Clean up use of LCAP_* constants
    
    Now that the LCAP_* constants are single bits, we can simplify the expressions
    using them.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 12 ++++++------
 xen/arch/x86/domain.c  | 10 +++++-----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 2b7f60aa30..45b55b7a8c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -170,7 +170,7 @@ static void cf_check amd_ctxt_switch_masking(const struct vcpu *next)
 		(nextd && is_pv_domain(nextd) && nextd->arch.pv.cpuidmasks)
 		? nextd->arch.pv.cpuidmasks : &cpuidmask_defaults;
 
-	if ((levelling_caps & LCAP_1cd) == LCAP_1cd) {
+	if (levelling_caps & LCAP_1cd) {
 		uint64_t val = masks->_1cd;
 
 		/*
@@ -191,7 +191,7 @@ static void cf_check amd_ctxt_switch_masking(const struct vcpu *next)
 #define LAZY(cap, msr, field)						\
 	({								\
 		if (unlikely(these_masks->field != masks->field) &&	\
-		    ((levelling_caps & cap) == cap))			\
+		    (levelling_caps & cap))				\
 		{							\
 			wrmsr_amd(msr, masks->field);			\
 			these_masks->field = masks->field;		\
@@ -247,7 +247,7 @@ static void __init noinline amd_init_levelling(void)
 
 	probe_masking_msrs();
 
-	if ((levelling_caps & LCAP_1cd) == LCAP_1cd) {
+	if (levelling_caps & LCAP_1cd) {
 		uint32_t ecx, edx, tmp;
 
 		cpuid(0x00000001, &tmp, &tmp, &ecx, &edx);
@@ -260,7 +260,7 @@ static void __init noinline amd_init_levelling(void)
 		cpuidmask_defaults._1cd = ((uint64_t)ecx << 32) | edx;
 	}
 
-	if ((levelling_caps & LCAP_e1cd) == LCAP_e1cd) {
+	if (levelling_caps & LCAP_e1cd) {
 		uint32_t ecx, edx, tmp;
 
 		cpuid(0x80000001, &tmp, &tmp, &ecx, &edx);
@@ -271,7 +271,7 @@ static void __init noinline amd_init_levelling(void)
 		cpuidmask_defaults.e1cd = ((uint64_t)ecx << 32) | edx;
 	}
 
-	if ((levelling_caps & LCAP_7ab0) == LCAP_7ab0) {
+	if (levelling_caps & LCAP_7ab0) {
 		uint32_t eax, ebx, tmp;
 
 		cpuid(0x00000007, &eax, &ebx, &tmp, &tmp);
@@ -279,7 +279,7 @@ static void __init noinline amd_init_levelling(void)
 		cpuidmask_defaults._7ab0 &= ((uint64_t)eax << 32) | ebx;
 	}
 
-	if ((levelling_caps & LCAP_6c) == LCAP_6c) {
+	if (levelling_caps & LCAP_6c) {
 		uint32_t ecx = cpuid_ecx(6);
 
 		cpuidmask_defaults._6c &= (~0ULL << 32) | ecx;
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c9ae8ee6e3..1d458f1372 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -303,7 +303,7 @@ void domain_cpu_policy_changed(struct domain *d)
 
     if ( is_pv_domain(d) )
     {
-        if ( ((levelling_caps & LCAP_1cd) == LCAP_1cd) )
+        if ( levelling_caps & LCAP_1cd )
         {
             uint64_t mask = cpuidmask_defaults._1cd;
             uint32_t ecx = p->basic._1c;
@@ -368,7 +368,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->_1cd = mask;
         }
 
-        if ( ((levelling_caps & LCAP_6c) == LCAP_6c) )
+        if ( levelling_caps & LCAP_6c )
         {
             uint64_t mask = cpuidmask_defaults._6c;
 
@@ -378,7 +378,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->_6c = mask;
         }
 
-        if ( ((levelling_caps & LCAP_7ab0) == LCAP_7ab0) )
+        if ( levelling_caps & LCAP_7ab0 )
         {
             uint64_t mask = cpuidmask_defaults._7ab0;
 
@@ -395,7 +395,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->_7ab0 = mask;
         }
 
-        if ( ((levelling_caps & LCAP_Da1) == LCAP_Da1) )
+        if ( levelling_caps & LCAP_Da1 )
         {
             uint64_t mask = cpuidmask_defaults.Da1;
             uint32_t eax = p->xstate.Da1;
@@ -406,7 +406,7 @@ void domain_cpu_policy_changed(struct domain *d)
             d->arch.pv.cpuidmasks->Da1 = mask;
         }
 
-        if ( ((levelling_caps & LCAP_e1cd) == LCAP_e1cd) )
+        if ( levelling_caps & LCAP_e1cd )
         {
             uint64_t mask = cpuidmask_defaults.e1cd;
             uint32_t ecx = p->extd.e1c;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Apr 05 00:55:52 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Apr 2026 00:55:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1273962.1560356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1w9BmK-0007B6-Su; Sun, 05 Apr 2026 00:55:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1273962.1560356; Sun, 05 Apr 2026 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 1w9BmK-0007Ay-Pv; Sun, 05 Apr 2026 00:55:52 +0000
Received: by outflank-mailman (input) for mailman id 1273962;
 Sun, 05 Apr 2026 00:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1w9BmK-0007As-Bp
 for xen-changelog@lists.xenproject.org; Sun, 05 Apr 2026 00:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9BmK-009NpX-1m
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 00:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1w9BmK-000vRS-0z
 for xen-changelog@lists.xenproject.org;
 Sun, 05 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yhm8zW6i4oGeBgfmdU/FSEakS0OWJhPQTpc6L1f7tnQ=; b=A0twNm4qGx7qfTynf34+E7RT4p
	PLfhY2qaI3W1rEFhEcKZuomSKl0AtzSq1B0oBpq/MesxjMk5Wk2A+f0hLB3BUE1xMl2o2FWPqROwS
	Sso2ghivi0YSIsaTOVacoz8CwRzLLoVG6Qy58hnixea49q9gBCOgQV04dHFnUwcugrjc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpuid: Drop the include of public/sysctl.h
Message-Id: <E1w9BmK-000vRS-0z@xenbits.xenproject.org>
Date: Sun, 05 Apr 2026 00:55:52 +0000

commit 33ceaa28275ca4e298616689ef96f19efaa87c35
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 23 15:48:33 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Apr 4 12:20:11 2026 +0200

    x86/cpuid: Drop the include of public/sysctl.h
    
    Following the removal of XEN_SYSCTL_get_cpu_levelling_caps, asm/cpuid.h
    doesn't need to include public/sysctl.h, but several other header files were
    picking up their includes transitively through asm/cpuid.h.  Untangle them.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/cpuid.h      | 2 --
 xen/arch/x86/include/asm/hvm/hvm.h    | 2 ++
 xen/arch/x86/include/asm/hvm/vlapic.h | 2 ++
 xen/arch/x86/include/asm/hvm/vpt.h    | 2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/cpuid.h b/xen/arch/x86/include/asm/cpuid.h
index c7ee1d54bc..774cfdf868 100644
--- a/xen/arch/x86/include/asm/cpuid.h
+++ b/xen/arch/x86/include/asm/cpuid.h
@@ -7,8 +7,6 @@
 #include <xen/kernel.h>
 #include <xen/percpu.h>
 
-#include <public/sysctl.h>
-
 extern const uint32_t known_features[FSCAPINTS];
 
 /*
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 846b91ebef..e7c1364802 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -19,6 +19,8 @@
 #include <asm/x86_emulate.h>
 
 struct pirq; /* needed by pi_update_irte */
+struct hvm_hw_cpu;
+struct xen_domctl_createdomain;
 
 #ifdef CONFIG_HVM_FEP
 /* Permit use of the Forced Emulation Prefix in HVM guests */
diff --git a/xen/arch/x86/include/asm/hvm/vlapic.h b/xen/arch/x86/include/asm/hvm/vlapic.h
index c388551198..f442dec3d9 100644
--- a/xen/arch/x86/include/asm/hvm/vlapic.h
+++ b/xen/arch/x86/include/asm/hvm/vlapic.h
@@ -12,6 +12,8 @@
 #include <xen/tasklet.h>
 #include <asm/hvm/vpt.h>
 
+#include <public/hvm/save.h>
+
 #define vcpu_vlapic(x)   (&(x)->arch.hvm.vlapic)
 #define vlapic_vcpu(x)   (container_of((x), struct vcpu, arch.hvm.vlapic))
 #define const_vlapic_vcpu(x) (container_of((x), const struct vcpu, \
diff --git a/xen/arch/x86/include/asm/hvm/vpt.h b/xen/arch/x86/include/asm/hvm/vpt.h
index 0b92b28625..24f0918280 100644
--- a/xen/arch/x86/include/asm/hvm/vpt.h
+++ b/xen/arch/x86/include/asm/hvm/vpt.h
@@ -12,6 +12,8 @@
 #include <xen/list.h>
 #include <xen/rwlock.h>
 
+#include <public/hvm/save.h>
+
 /*
  * Abstract layer of periodic time, one short time.
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 08:33:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 08:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274539.1560626 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA1rr-0007cn-Nz; Tue, 07 Apr 2026 08:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274539.1560626; Tue, 07 Apr 2026 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 1wA1rr-0007cf-LB; Tue, 07 Apr 2026 08:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1274539;
 Tue, 07 Apr 2026 08:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA1rq-0007cZ-7y
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 08:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA1rq-00E3gj-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 08:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA1rq-00454P-0X
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V9d5k3U6MUkpfqUUo3rSM9pt+DuS2vKwLdUS4HZ4ymk=; b=pNqYNgSbPAiJUtjA7JPDepwvfG
	ohrPY+tKN7TTPTSSefo7gBdC2UEYIVP1hKc0akNjdszOroRn2ilCDb9UR/BUVlh/jBrqnLSrzNZR2
	seL1vRGreVIuLVBpPivmm3Dmkcr0Fn8sCweo7ruVNVxRPVcT1t/ShdF5Q0TAKJNaeeHI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI: avoid OOB config file reads
Message-Id: <E1wA1rq-00454P-0X@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 08:33:02 +0000

commit df75f77092c1cc47f3ed5be86cf6c04e732f3f80
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 08:59:15 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 08:59:15 2026 +0200

    EFI: avoid OOB config file reads
    
    The message emitted by pre_parse() pretty clearly states the original
    intention. Yet what it said wasn't done, and would have been unfriendly to
    the user. Hence accesses past the allocated buffer were possible. Insert a
    terminating NUL immediately past the data read, to then drop the no longer
    applicable message.
    
    NB: The iscntrl() check of just the last byte is more strict than what
    pre_parse() would accept without issuing its prior message, yet I'd like
    to keep the new logic reasonably simple. Config files shouldn't be huge,
    and we shouldn't be _that_ short of memory (or we'd fail elsewhere pretty
    soon).
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/common/efi/boot.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 967094994d..fa2e4abf00 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -833,8 +833,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     what = L"Allocation";
     file->addr = min(1UL << (32 + PAGE_SHIFT),
                      HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
+    /* For config files allocate an extra byte to put a NUL there. */
     ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
-                                PFN_UP(size), &file->addr);
+                                PFN_UP(size + (file == &cfg)), &file->addr);
     if ( EFI_ERROR(ret) )
         goto fail;
 
@@ -853,6 +854,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
 
     efi_arch_flush_dcache_area(file->ptr, file->size);
 
+    if ( file == &cfg )
+        file->str[file->size] = 0;
+
     return true;
 
  fail:
@@ -878,6 +882,23 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
 
     file->ptr = ptr;
 
+    /* For cfg file, if necessary allocate space to put an extra NUL there. */
+    if ( file == &cfg && file->size && !iscntrl(file->str[file->size - 1]) )
+    {
+        EFI_PHYSICAL_ADDRESS addr;
+        EFI_STATUS ret = efi_bs->AllocatePages(AllocateMaxAddress,
+                                               EfiLoaderData,
+                                               PFN_UP(file->size + 1), &addr);
+
+        if ( EFI_ERROR(ret) )
+            return false;
+
+        memcpy((void *)addr, ptr, file->size);
+        file->addr = addr;
+        file->need_to_free = true;
+        file->str[file->size] = 0;
+    }
+
     handle_file_info(name, file, options);
 
     return true;
@@ -906,9 +927,6 @@ static void __init pre_parse(const struct file *file)
         else
             start = 0;
     }
-    if ( file->size && end[-1] )
-         PrintStr(L"No newline at end of config file,"
-                   " last line will be ignored.\r\n");
 }
 
 static void __init init_secure_boot_mode(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 08:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 08:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274540.1560630 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA1s1-0007eP-PM; Tue, 07 Apr 2026 08:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274540.1560630; Tue, 07 Apr 2026 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 1wA1s1-0007eH-Mf; Tue, 07 Apr 2026 08:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1274540;
 Tue, 07 Apr 2026 08:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA1s0-0007e3-Ce
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 08:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA1s0-00E3gp-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 08:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA1s0-00454s-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+ddKLx2vKrfLQ9xnO36WsajlhjVTUUuyIek9UMIe2yI=; b=hnq+2lELQ7zr5Pn52EayHmBZ0S
	za27HNNPSHmsxSpK6lFyhYpFGgHGHw+MZjLyfzpwBT+2/PWWHaamAWQXUaHk2Nslp0aVBlWiMCwbS
	+C0hzPsxtvzSYLGiitiGuKFZecBBc52Xd4obZVDBrXbTfOZoE65ou7ZYilK80Byvz+Dg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI: move pre_parse() back next to get_value()
Message-Id: <E1wA1s0-00454s-0q@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 08:33:12 +0000

commit 97bd7f26f631052ca27e3a1f4d8dcb10ffe89bf3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 09:00:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 09:00:01 2026 +0200

    EFI: move pre_parse() back next to get_value()
    
    These are siblings, so better would live close together. Sadly in
    1f9540cd8eb6 ("EFI: move efi-boot.h inclusion point") I moved get_value()
    without also moving pre_parse().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/common/efi/boot.c | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index fa2e4abf00..0ddc7bfd12 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -581,6 +581,31 @@ static char * __init split_string(char *s)
     return NULL;
 }
 
+static void __init pre_parse(const struct file *file)
+{
+    char *ptr = file->str, *end = ptr + file->size;
+    bool start = true, comment = false;
+
+    for ( ; ptr < end; ++ptr )
+    {
+        if ( iscntrl(*ptr) )
+        {
+            comment = false;
+            start = true;
+            *ptr = 0;
+        }
+        else if ( comment || (start && isspace(*ptr)) )
+            *ptr = 0;
+        else if ( *ptr == '#' || (start && *ptr == ';') )
+        {
+            comment = true;
+            *ptr = 0;
+        }
+        else
+            start = 0;
+    }
+}
+
 static char *__init get_value(const struct file *file, const char *section,
                               const char *item)
 {
@@ -904,31 +929,6 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
     return true;
 }
 
-static void __init pre_parse(const struct file *file)
-{
-    char *ptr = file->str, *end = ptr + file->size;
-    bool start = true, comment = false;
-
-    for ( ; ptr < end; ++ptr )
-    {
-        if ( iscntrl(*ptr) )
-        {
-            comment = false;
-            start = true;
-            *ptr = 0;
-        }
-        else if ( comment || (start && isspace(*ptr)) )
-            *ptr = 0;
-        else if ( *ptr == '#' || (start && *ptr == ';') )
-        {
-            comment = true;
-            *ptr = 0;
-        }
-        else
-            start = 0;
-    }
-}
-
 static void __init init_secure_boot_mode(void)
 {
     static EFI_GUID __initdata gv_uuid = EFI_GLOBAL_VARIABLE;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 09:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 09:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274589.1560679 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA2yY-0001sD-Jm; Tue, 07 Apr 2026 09:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274589.1560679; Tue, 07 Apr 2026 09: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 1wA2yY-0001s5-Gs; Tue, 07 Apr 2026 09:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1274589;
 Tue, 07 Apr 2026 09:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA2yX-0001rz-Na
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 09:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA2yX-00E52a-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 09:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA2yX-0049uc-1y
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5hCLVN+MNCnQJ/cQxhUtdwvVcxbZbk/Dz3yP6xqqjMM=; b=VSkEYSiSSoVnO7iTGBBYsEVtS7
	FoEZy1E5updP+w1FfBkMLPIRnaZ5PyVTOcqI7CIauxsnQ04c63/1XrcQMkDmXedKNKSW6YqbyvihB
	5iGeuIe1ajw/fAFkwn2pBulUYN55AEZGoHA10CO59w9ZJ0yBmFBcQs2HGgJ/n9LGY42M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: avoid OOB config file reads
Message-Id: <E1wA2yX-0049uc-1y@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 09:44:01 +0000

commit df75f77092c1cc47f3ed5be86cf6c04e732f3f80
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 08:59:15 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 08:59:15 2026 +0200

    EFI: avoid OOB config file reads
    
    The message emitted by pre_parse() pretty clearly states the original
    intention. Yet what it said wasn't done, and would have been unfriendly to
    the user. Hence accesses past the allocated buffer were possible. Insert a
    terminating NUL immediately past the data read, to then drop the no longer
    applicable message.
    
    NB: The iscntrl() check of just the last byte is more strict than what
    pre_parse() would accept without issuing its prior message, yet I'd like
    to keep the new logic reasonably simple. Config files shouldn't be huge,
    and we shouldn't be _that_ short of memory (or we'd fail elsewhere pretty
    soon).
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/common/efi/boot.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 967094994d..fa2e4abf00 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -833,8 +833,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     what = L"Allocation";
     file->addr = min(1UL << (32 + PAGE_SHIFT),
                      HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
+    /* For config files allocate an extra byte to put a NUL there. */
     ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
-                                PFN_UP(size), &file->addr);
+                                PFN_UP(size + (file == &cfg)), &file->addr);
     if ( EFI_ERROR(ret) )
         goto fail;
 
@@ -853,6 +854,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
 
     efi_arch_flush_dcache_area(file->ptr, file->size);
 
+    if ( file == &cfg )
+        file->str[file->size] = 0;
+
     return true;
 
  fail:
@@ -878,6 +882,23 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
 
     file->ptr = ptr;
 
+    /* For cfg file, if necessary allocate space to put an extra NUL there. */
+    if ( file == &cfg && file->size && !iscntrl(file->str[file->size - 1]) )
+    {
+        EFI_PHYSICAL_ADDRESS addr;
+        EFI_STATUS ret = efi_bs->AllocatePages(AllocateMaxAddress,
+                                               EfiLoaderData,
+                                               PFN_UP(file->size + 1), &addr);
+
+        if ( EFI_ERROR(ret) )
+            return false;
+
+        memcpy((void *)addr, ptr, file->size);
+        file->addr = addr;
+        file->need_to_free = true;
+        file->str[file->size] = 0;
+    }
+
     handle_file_info(name, file, options);
 
     return true;
@@ -906,9 +927,6 @@ static void __init pre_parse(const struct file *file)
         else
             start = 0;
     }
-    if ( file->size && end[-1] )
-         PrintStr(L"No newline at end of config file,"
-                   " last line will be ignored.\r\n");
 }
 
 static void __init init_secure_boot_mode(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 09:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 09:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274590.1560683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA2yi-0001uH-L1; Tue, 07 Apr 2026 09:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274590.1560683; Tue, 07 Apr 2026 09:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA2yi-0001u7-IE; Tue, 07 Apr 2026 09:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1274590;
 Tue, 07 Apr 2026 09:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA2yh-0001tx-Pc
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 09:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA2yh-00E52h-36
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 09:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA2yh-0049wB-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/gU+pmc/4Fz190Ofyl+1x8nTrlrl0mRPDMj3tznu0U0=; b=gALHy3FAsPbchmPWJGXw26MMrS
	q3Ml1dZ2Wht0IywMdyRuwVmoefyyEvcKaPTMe/YWlcJJVQbVokFGo7xHFFFGQuluSbDAc/5A+HlDr
	VKvbRucmffwNIUvrXKX1pOpHz57C1DMJvJtngRv/V8oOpMFcVTbxK927w16kZYKDftTI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: move pre_parse() back next to get_value()
Message-Id: <E1wA2yh-0049wB-2I@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 09:44:11 +0000

commit 97bd7f26f631052ca27e3a1f4d8dcb10ffe89bf3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 09:00:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 09:00:01 2026 +0200

    EFI: move pre_parse() back next to get_value()
    
    These are siblings, so better would live close together. Sadly in
    1f9540cd8eb6 ("EFI: move efi-boot.h inclusion point") I moved get_value()
    without also moving pre_parse().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/common/efi/boot.c | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index fa2e4abf00..0ddc7bfd12 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -581,6 +581,31 @@ static char * __init split_string(char *s)
     return NULL;
 }
 
+static void __init pre_parse(const struct file *file)
+{
+    char *ptr = file->str, *end = ptr + file->size;
+    bool start = true, comment = false;
+
+    for ( ; ptr < end; ++ptr )
+    {
+        if ( iscntrl(*ptr) )
+        {
+            comment = false;
+            start = true;
+            *ptr = 0;
+        }
+        else if ( comment || (start && isspace(*ptr)) )
+            *ptr = 0;
+        else if ( *ptr == '#' || (start && *ptr == ';') )
+        {
+            comment = true;
+            *ptr = 0;
+        }
+        else
+            start = 0;
+    }
+}
+
 static char *__init get_value(const struct file *file, const char *section,
                               const char *item)
 {
@@ -904,31 +929,6 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
     return true;
 }
 
-static void __init pre_parse(const struct file *file)
-{
-    char *ptr = file->str, *end = ptr + file->size;
-    bool start = true, comment = false;
-
-    for ( ; ptr < end; ++ptr )
-    {
-        if ( iscntrl(*ptr) )
-        {
-            comment = false;
-            start = true;
-            *ptr = 0;
-        }
-        else if ( comment || (start && isspace(*ptr)) )
-            *ptr = 0;
-        else if ( *ptr == '#' || (start && *ptr == ';') )
-        {
-            comment = true;
-            *ptr = 0;
-        }
-        else
-            start = 0;
-    }
-}
-
 static void __init init_secure_boot_mode(void)
 {
     static EFI_GUID __initdata gv_uuid = EFI_GLOBAL_VARIABLE;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 13:33:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 13:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274986.1560946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6YB-0003Lr-4g; Tue, 07 Apr 2026 13:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274986.1560946; Tue, 07 Apr 2026 13:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6YB-0003Lj-1y; Tue, 07 Apr 2026 13:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1274986;
 Tue, 07 Apr 2026 13:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA6Y9-0003Ld-QC
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 13:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6Y9-00E9Vy-36
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6Y9-004N9k-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q4OSP+HJCBCFyoeMKqHCgpQBOomNMqUwvFHjF+sWH/Y=; b=pdPd8e8W0tlOW5qGrKDAJoI2OQ
	Jsbs9dicXZHKaM/Id9MBJgvKPy5FaEHNRhDfY9TybkIqXA0O5kQEyDBjtMOItmwKxx7vh02Cq5diT
	MnDqKclGlkVjE+bJZB65kPh3YdWJVNWna7aX+Ql7rmrkxny4QEe2nEtjrzaYI/Yc3Ys0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] llc-coloring: improve checking while parsing
Message-Id: <E1wA6Y9-004N9k-2I@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 13:33:01 +0000

commit cba8a584de171c8c4510709c2edc9f1cf86b21ab
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:52:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:52:44 2026 +0200

    llc-coloring: improve checking while parsing
    
    We can easily avoid the risk of wrapping UINT_MAX <-> 0 by applying a
    check against the compile-time-constant maximum number of colors.
    
    Additionally the overflow checks suffered from an off-by-1, as the parsed
    ranges are inclusive (e.g. end == start being possible, requiring 1 array
    slot, while availability of 0 slots was checked in that case).
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/llc-coloring.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 822a6b2ed5..eb7c72b240 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -76,8 +76,9 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         else                /* Single value */
             end = start;
 
-        if ( start > end || (end - start) > (UINT_MAX - *num_colors) ||
-             (*num_colors + (end - start)) >= max_num_colors )
+        if ( end >= NR_LLC_COLORS || start > end ||
+             (end - start) >= (UINT_MAX - *num_colors) ||
+             (*num_colors + (end - start + 1)) >= max_num_colors )
             return -EINVAL;
 
         /* Colors are range checked in check_colors() */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 13:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 13:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274988.1560959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6YL-0003aX-CA; Tue, 07 Apr 2026 13:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274988.1560959; Tue, 07 Apr 2026 13:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6YL-0003aP-9G; Tue, 07 Apr 2026 13:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1274988;
 Tue, 07 Apr 2026 13:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA6YJ-0003NF-S6
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 13:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6YK-00E9W2-0A
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6YJ-004NAE-2b
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3cdKmmZuj0My4UKDm+MLWVo8aXxCBXil/zUF5MeBudQ=; b=Vcq+qqSgC1hCpFpYDtjVFnVXhq
	QZCnAS1M1rYvpwWRDzIboOV6vksyOlX/wSQ7lGcOxXgcyQsrpAZt+b5v8L9FvpzViEsXvXvN6r5EB
	8Jzmu4CK0EPY9eXBiwfH9FLZkrjo/17CQvMPUMvnoaIdDrisbqYdsuSX4zDiRviKCIjE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] ns16550: harden name/value pair parsing
Message-Id: <E1wA6YJ-004NAE-2b@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 13:33:11 +0000

commit b27d3b45c75cf378f06ed72758c034a5d0f8d560
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:53:49 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:53:49 2026 +0200

    ns16550: harden name/value pair parsing
    
    strsep(), unless passed a 1st argument which itself points at a NULL
    pointer, won't return NULL. Instead if the separator(s) looked for isn't
    found, that pointed-to field would be updated to hold NULL. Hence the
    important check in get_token() is for token to be non-NULL after the call
    (which get_token()'s callers rely upon), while the checking of param_name
    is left there just in case.
    
    Fixes: 97fd49a7e074 ("ns16550: add support for UART parameters to be specifed with name-value pairs")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.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 b23e85a3c6..0339d321bd 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1443,7 +1443,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
     unsigned int i;
 
     param_name = strsep(&token, "=");
-    if ( param_name == NULL )
+    if ( !param_name || !token )
         return num_serial_params;
 
     /* Linear search for the parameter. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 13:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 13:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274991.1560963 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6YV-0003fO-DH; Tue, 07 Apr 2026 13:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274991.1560963; Tue, 07 Apr 2026 13:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6YV-0003fG-Aa; Tue, 07 Apr 2026 13:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1274991;
 Tue, 07 Apr 2026 13:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA6YT-0003eu-V0
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 13:33:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6YU-00E9WR-0R
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6YT-004NAn-2t
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Z2u6/85bYStoZKxG3xqonN1TzF2KQ5XGt+kyzIOZpZ4=; b=D8ir2y1n2pB7y954fx1X0Ud5v6
	1wRtZOxzvt35G8xbFtxgRqndrIY8SeR1PEGFxl/eIS0ffHJX5o6Ab851qyYSw2xZLutgZRGtXMdDw
	IhZXSQR0qz7EBkA+8uFkMkYh4iuWZxGmP9O5ogLwYZEP6/VQigg8awa+kntIv0a9/Bvc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] ns16550: harden positional parsing
Message-Id: <E1wA6YT-004NAn-2t@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 13:33:21 +0000

commit 2c43b5611ffbe35611dd391c949f7cb15e1b29e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:54:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:54:19 2026 +0200

    ns16550: harden positional parsing
    
    Advancing past a character without knowing whether that's the NUL char is
    at risk of reading beyond the buffer.
    
    Fixes: 25de1f692059 ("Allow arch-specific defaults to be specified for ns16550")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/char/ns16550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 0339d321bd..a17a87de31 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1518,6 +1518,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
     {
         uart->data_bits = simple_strtoul(conf, &conf, 10);
 
+        if ( !*conf )
+            PARSE_ERR_RET("bad DPS setting");
+
         uart->parity = parse_parity_char(*conf);
 
         uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 13:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 13:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1274993.1560968 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6Yf-0003l5-F5; Tue, 07 Apr 2026 13:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1274993.1560968; Tue, 07 Apr 2026 13:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA6Yf-0003ku-C6; Tue, 07 Apr 2026 13:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1274993;
 Tue, 07 Apr 2026 13:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA6Ye-0003ke-1u
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 13:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6Ye-00E9WV-0m
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA6Yd-004NBB-3A
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+it6C4lbJV3Th+XTDhDQZz/OwHVi7uUq9KHRx2kYa54=; b=OGQ9g//U+Q0uhTfbMlmfsN7fTo
	qUCYe4ean6P5m8JQxPvWTpfLqdBtszFiy+P9yKm70BskQK7xdusY/pjL6/f5vHOQ/ibO9Z7Ch9Uu4
	VrSpqce6ZhaN3tWA+VtQxPVoQnivYisQuX7K2oLXMZ8EIotl8bzt+qvGbQaJw8VL1tVM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] video/vesa: harden font height parsing
Message-Id: <E1wA6Yd-004NBB-3A@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 13:33:31 +0000

commit 3bcce461a33a8c0c0721543638ce375178d90006
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:54:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:54:37 2026 +0200

    video/vesa: harden font height parsing
    
    We should not prematurely increment the pointer, to avoid inadvertently
    skipping a NUL terminator.
    
    Fixes: 6d9199bd0f22 ("x86-64: enable hypervisor output on VESA frame buffer")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/video/vesa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 70feca21ac..f6c6afd40c 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -31,8 +31,8 @@ static unsigned int __initdata vram_remap;
 static unsigned int __initdata font_height;
 static int __init cf_check parse_font_height(const char *s)
 {
-    if ( simple_strtoul(s, &s, 10) == 8 && (*s++ == 'x') )
-        font_height = simple_strtoul(s, &s, 10);
+    if ( simple_strtoul(s, &s, 10) == 8 && (*s == 'x') )
+        font_height = simple_strtoul(s + 1, &s, 10);
     if ( *s != '\0' )
         font_height = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 14:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 14:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275079.1561052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA7UG-0007co-Ki; Tue, 07 Apr 2026 14:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275079.1561052; Tue, 07 Apr 2026 14: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 1wA7UG-0007cf-I3; Tue, 07 Apr 2026 14:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1275079;
 Tue, 07 Apr 2026 14:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA7UE-0007cZ-FY
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 14:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7UE-00EAkN-24
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7UE-004Qoi-1G
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aMe2HPGuInMwZO/rM3ukACNBpyPXF8XF1fjFm4wrAnM=; b=1fNs2K0f6kNfii3J9U4NPoSNhl
	zM/1okf85fTwKHgv8W6xLoI1REuQ9fIQPCVxAlKc0FtsW/VZNE3d1tQSKYS+UwFd/H0dOoA/U/Rx9
	p32HnyvHy3tb351Y3NAcqRE0m6d45DtZq06fHqloCMaQJqCSiV2iI0lr8efxRfC3/7rc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] llc-coloring: improve checking while parsing
Message-Id: <E1wA7UE-004Qoi-1G@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 14:33:02 +0000

commit cba8a584de171c8c4510709c2edc9f1cf86b21ab
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:52:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:52:44 2026 +0200

    llc-coloring: improve checking while parsing
    
    We can easily avoid the risk of wrapping UINT_MAX <-> 0 by applying a
    check against the compile-time-constant maximum number of colors.
    
    Additionally the overflow checks suffered from an off-by-1, as the parsed
    ranges are inclusive (e.g. end == start being possible, requiring 1 array
    slot, while availability of 0 slots was checked in that case).
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/llc-coloring.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 822a6b2ed5..eb7c72b240 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -76,8 +76,9 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         else                /* Single value */
             end = start;
 
-        if ( start > end || (end - start) > (UINT_MAX - *num_colors) ||
-             (*num_colors + (end - start)) >= max_num_colors )
+        if ( end >= NR_LLC_COLORS || start > end ||
+             (end - start) >= (UINT_MAX - *num_colors) ||
+             (*num_colors + (end - start + 1)) >= max_num_colors )
             return -EINVAL;
 
         /* Colors are range checked in check_colors() */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 14:33:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 14:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275080.1561055 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA7UQ-0007eg-MC; Tue, 07 Apr 2026 14:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275080.1561055; Tue, 07 Apr 2026 14: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 1wA7UQ-0007eZ-JO; Tue, 07 Apr 2026 14:33:14 +0000
Received: by outflank-mailman (input) for mailman id 1275080;
 Tue, 07 Apr 2026 14:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA7UO-0007eM-JZ
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 14:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7UO-00EAkT-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7UO-004QpK-1Z
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wF4vRxWamFIY8OHbol18r4QlqTepVFE+xPsRWs2twgA=; b=mCAm/G/mCsI/YkKyDkvSk9YyTM
	rL4okX6ImhW/wY6pJXng60C6/o/054j+ndojD4yg2Fz0Ikb/8Vu5qFj80GM0SqAcAUrV7ie0mxVDX
	dieQHIqp8vELgwW3Vcxy4E4JBi0Xfnv5lfD+fOrhbDo20oJqUiPgAMn5XgpjNvwyrTFo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ns16550: harden name/value pair parsing
Message-Id: <E1wA7UO-004QpK-1Z@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 14:33:12 +0000

commit b27d3b45c75cf378f06ed72758c034a5d0f8d560
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:53:49 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:53:49 2026 +0200

    ns16550: harden name/value pair parsing
    
    strsep(), unless passed a 1st argument which itself points at a NULL
    pointer, won't return NULL. Instead if the separator(s) looked for isn't
    found, that pointed-to field would be updated to hold NULL. Hence the
    important check in get_token() is for token to be non-NULL after the call
    (which get_token()'s callers rely upon), while the checking of param_name
    is left there just in case.
    
    Fixes: 97fd49a7e074 ("ns16550: add support for UART parameters to be specifed with name-value pairs")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.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 b23e85a3c6..0339d321bd 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1443,7 +1443,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
     unsigned int i;
 
     param_name = strsep(&token, "=");
-    if ( param_name == NULL )
+    if ( !param_name || !token )
         return num_serial_params;
 
     /* Linear search for the parameter. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 14:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 14:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275081.1561060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA7Ua-0007gj-NT; Tue, 07 Apr 2026 14:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275081.1561060; Tue, 07 Apr 2026 14: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 1wA7Ua-0007gb-Kt; Tue, 07 Apr 2026 14:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1275081;
 Tue, 07 Apr 2026 14:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA7UY-0007gT-Mm
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 14:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7UY-00EAkq-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7UY-004Qpq-21
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d5XyBT9AwHXyKWP0aQo6lKh5KgCT3lLZgpmzEoBQbcs=; b=LA8lffoK/34VylpBHYQ1LleDyZ
	qlT3EDX6nZhuHhoDpO8+y13vJ/+8CDsiF9ZTJNEar/C4jytiM5MoUam4pityPuotRkmIKp9QsMS/8
	gZuza431CbeAfN2+nEKDdEmcXSQUQh6L5+vBnmFJNaYcKsL6r3NBZ/mrLjl5UAwOpheY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ns16550: harden positional parsing
Message-Id: <E1wA7UY-004Qpq-21@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 14:33:22 +0000

commit 2c43b5611ffbe35611dd391c949f7cb15e1b29e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:54:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:54:19 2026 +0200

    ns16550: harden positional parsing
    
    Advancing past a character without knowing whether that's the NUL char is
    at risk of reading beyond the buffer.
    
    Fixes: 25de1f692059 ("Allow arch-specific defaults to be specified for ns16550")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/char/ns16550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 0339d321bd..a17a87de31 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1518,6 +1518,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
     {
         uart->data_bits = simple_strtoul(conf, &conf, 10);
 
+        if ( !*conf )
+            PARSE_ERR_RET("bad DPS setting");
+
         uart->parity = parse_parity_char(*conf);
 
         uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 14:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 14:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275082.1561063 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA7Uk-0007il-Oo; Tue, 07 Apr 2026 14:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275082.1561063; Tue, 07 Apr 2026 14: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 1wA7Uk-0007ie-MF; Tue, 07 Apr 2026 14:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1275082;
 Tue, 07 Apr 2026 14:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA7Ui-0007iX-Pc
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 14:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7Ui-00EAku-39
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA7Ui-004QqJ-2L
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 14: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bZ6Ewf1soNahwWAj2g5Nn/DHM78qmSEvJ+w+O0NVVIw=; b=CEfb3oP/ZcW5oPVvf5FdfTslUL
	5N/tsjbIScdTgcPEYlsUVQX27HajeS/5UBEo4o1XDKnSiKrQAVsbZAs3dLa/+1V83dwCypf5g3yQA
	RpwyWscO7FkN3wWlvYYm5G60ZEiz6DN7vm1OgVSUlLYEpDZdFtD986ccJqZjTjDOovHU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] video/vesa: harden font height parsing
Message-Id: <E1wA7Ui-004QqJ-2L@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 14:33:32 +0000

commit 3bcce461a33a8c0c0721543638ce375178d90006
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 7 13:54:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 7 13:54:37 2026 +0200

    video/vesa: harden font height parsing
    
    We should not prematurely increment the pointer, to avoid inadvertently
    skipping a NUL terminator.
    
    Fixes: 6d9199bd0f22 ("x86-64: enable hypervisor output on VESA frame buffer")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/video/vesa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 70feca21ac..f6c6afd40c 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -31,8 +31,8 @@ static unsigned int __initdata vram_remap;
 static unsigned int __initdata font_height;
 static int __init cf_check parse_font_height(const char *s)
 {
-    if ( simple_strtoul(s, &s, 10) == 8 && (*s++ == 'x') )
-        font_height = simple_strtoul(s, &s, 10);
+    if ( simple_strtoul(s, &s, 10) == 8 && (*s == 'x') )
+        font_height = simple_strtoul(s + 1, &s, 10);
     if ( *s != '\0' )
         font_height = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 15:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 15:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275145.1561103 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA8QJ-00007Y-Ny; Tue, 07 Apr 2026 15:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275145.1561103; Tue, 07 Apr 2026 15: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 1wA8QJ-00007Q-L5; Tue, 07 Apr 2026 15:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1275145;
 Tue, 07 Apr 2026 15:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA8QI-00007I-82
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 15:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA8QI-00EBtk-17
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 15:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA8QI-004UBH-06
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 15: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Y/0aFf5mbTXmIGGJb7XJVzFS5e7Wn1HB+uQs+GSLQBE=; b=HUey9D2Yi9NbBohziuHr1GtXqu
	Fs3KRV5KogVIQaHIh8ooPP3JYWNnsaw3zaBpRLo7ytCUSGaLn34GS1HH/ddeA5dOiq8S6LECGK9rq
	NhoUK5n5IPhM+Jj2vFXl5BuXR9/L1HcuV3IcIUMLvUp0d8SfJD5T16SjNPVWRxlEQmXE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/emul: Remove fallback path from SWAPGS
Message-Id: <E1wA8QI-004UBH-06@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 15:33:02 +0000

commit 4bedbe47eef4ff68265a63d89ab55401334424b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Feb 23 15:38:14 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 7 16:26:34 2026 +0100

    x86/emul: Remove fallback path from SWAPGS
    
    In real hardware, accesses to the registers cannot fail.  The error paths are
    just an artefact of the hook functions needing to return something.
    
    The best effort unwind is also something that doesn't exist in real hardware,
    and makes the logic more complicated to follow.  Instead, use an
    ASSERT_UNREACHABLE() with a fallback of injecting #DF.  Hitting this path is
    an error in Xen.
    
    While adjusting, remove {read,write}_segment() and use {read,write}_msr() to
    access MSR_GS_BASE.  There's no need to access the other parts of the GS
    segment, and this is less work behind the scenes.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_emulate/0f01.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 6c10979dd6..54bd6faf0f 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -189,22 +189,24 @@ int x86emul_0f01(struct x86_emulate_state *s,
         generate_exception_if(!mode_ring0(), X86_EXC_GP, 0);
         fail_if(!ops->read_segment || !ops->read_msr ||
                 !ops->write_segment || !ops->write_msr);
-        if ( (rc = ops->read_segment(x86_seg_gs, &sreg,
-                                     ctxt)) != X86EMUL_OKAY ||
-             (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
+        if ( (rc = ops->read_msr(MSR_GS_BASE, &sreg.base,
                                  ctxt)) != X86EMUL_OKAY ||
-             (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
-                                  ctxt, false)) != X86EMUL_OKAY )
+             (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
+                                 ctxt)) != X86EMUL_OKAY )
             goto done;
-        sreg.base = msr_val;
-        if ( (rc = ops->write_segment(x86_seg_gs, &sreg,
-                                      ctxt)) != X86EMUL_OKAY )
+        if ( (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
+                                  ctxt, false)) != X86EMUL_OKAY ||
+             (rc = ops->write_msr(MSR_GS_BASE, msr_val,
+                                  ctxt, false)) != X86EMUL_OKAY )
         {
-            /* Best effort unwind (i.e. no real error checking). */
-            if ( ops->write_msr(MSR_SHADOW_GS_BASE, msr_val,
-                                ctxt, false) == X86EMUL_EXCEPTION )
-                x86_emul_reset_event(ctxt);
-            goto done;
+            /*
+             * In real hardware, access to the registers cannot fail.  It is
+             * an error in Xen if the writes fail given that both MSRs have
+             * equivalent checks.
+             */
+            ASSERT_UNREACHABLE();
+            x86_emul_reset_event(ctxt);
+            generate_exception(X86_EXC_DF, 0);
         }
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 07 16:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Apr 2026 16:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275239.1561151 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wA9hf-0004WH-OK; Tue, 07 Apr 2026 16:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275239.1561151; Tue, 07 Apr 2026 16: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 1wA9hf-0004W9-Ld; Tue, 07 Apr 2026 16:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1275239;
 Tue, 07 Apr 2026 16:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wA9he-0004W3-Ax
 for xen-changelog@lists.xenproject.org; Tue, 07 Apr 2026 16:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA9he-00EDxF-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 16:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wA9he-004dit-0h
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QQjOLjwZcvwGlf00O4M+m0DXZZ2BcqSzT3Hs3LxpH74=; b=THX6U/H8lvAJGuHUJgLHIBN/En
	VQslcSHoJsaj3tsLmqt+lqYu3/bD8PYcdqU82yXU+8YAGCYTPYz8Dwiv9LzgZsuV5+Ac62DfJaLSS
	+fhQdDTM4GTphiSsvNLA4XvX/aqLLYE79E0fx5WdRvtX9QriBUbn6PYxQCox6XK31CLM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/emul: Remove fallback path from SWAPGS
Message-Id: <E1wA9he-004dit-0h@xenbits.xenproject.org>
Date: Tue, 07 Apr 2026 16:55:02 +0000

commit 4bedbe47eef4ff68265a63d89ab55401334424b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Feb 23 15:38:14 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 7 16:26:34 2026 +0100

    x86/emul: Remove fallback path from SWAPGS
    
    In real hardware, accesses to the registers cannot fail.  The error paths are
    just an artefact of the hook functions needing to return something.
    
    The best effort unwind is also something that doesn't exist in real hardware,
    and makes the logic more complicated to follow.  Instead, use an
    ASSERT_UNREACHABLE() with a fallback of injecting #DF.  Hitting this path is
    an error in Xen.
    
    While adjusting, remove {read,write}_segment() and use {read,write}_msr() to
    access MSR_GS_BASE.  There's no need to access the other parts of the GS
    segment, and this is less work behind the scenes.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_emulate/0f01.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 6c10979dd6..54bd6faf0f 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -189,22 +189,24 @@ int x86emul_0f01(struct x86_emulate_state *s,
         generate_exception_if(!mode_ring0(), X86_EXC_GP, 0);
         fail_if(!ops->read_segment || !ops->read_msr ||
                 !ops->write_segment || !ops->write_msr);
-        if ( (rc = ops->read_segment(x86_seg_gs, &sreg,
-                                     ctxt)) != X86EMUL_OKAY ||
-             (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
+        if ( (rc = ops->read_msr(MSR_GS_BASE, &sreg.base,
                                  ctxt)) != X86EMUL_OKAY ||
-             (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
-                                  ctxt, false)) != X86EMUL_OKAY )
+             (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
+                                 ctxt)) != X86EMUL_OKAY )
             goto done;
-        sreg.base = msr_val;
-        if ( (rc = ops->write_segment(x86_seg_gs, &sreg,
-                                      ctxt)) != X86EMUL_OKAY )
+        if ( (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
+                                  ctxt, false)) != X86EMUL_OKAY ||
+             (rc = ops->write_msr(MSR_GS_BASE, msr_val,
+                                  ctxt, false)) != X86EMUL_OKAY )
         {
-            /* Best effort unwind (i.e. no real error checking). */
-            if ( ops->write_msr(MSR_SHADOW_GS_BASE, msr_val,
-                                ctxt, false) == X86EMUL_EXCEPTION )
-                x86_emul_reset_event(ctxt);
-            goto done;
+            /*
+             * In real hardware, access to the registers cannot fail.  It is
+             * an error in Xen if the writes fail given that both MSRs have
+             * equivalent checks.
+             */
+            ASSERT_UNREACHABLE();
+            x86_emul_reset_event(ctxt);
+            generate_exception(X86_EXC_DF, 0);
         }
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 08 06:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Apr 2026 06:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275409.1561243 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAMId-00050m-JS; Wed, 08 Apr 2026 06:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275409.1561243; Wed, 08 Apr 2026 06:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAMId-00050d-Gc; Wed, 08 Apr 2026 06:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1275409;
 Wed, 08 Apr 2026 06:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAMIc-00050X-Hb
 for xen-changelog@lists.xenproject.org; Wed, 08 Apr 2026 06:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAMIc-00Fgdt-2A
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 06:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAMIc-005MYW-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 06:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/YXo6aTRdfo8yCGMH23ekKVvLO0lblOPrOrG5gNDT+k=; b=lrJvFQzj/zns4X2jo58xvrvxKO
	frSziTkFGaUPGZhajPOi2EhZq1T6RDO87BW4TDXrR86Zf8PvBdj6sRWkw1zgbmEcO+ouFBaJg+el0
	K0dJ+TDRgCLF1e2a5bpwYPiD+tVn54GDEgUAZ2JZ0D2afyI1Q8Ph2XR4BEHLevgEl2yI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] iommu/arm: smmu: Fix variable shadowing
Message-Id: <E1wAMIc-005MYW-1M@xenbits.xenproject.org>
Date: Wed, 08 Apr 2026 06:22:02 +0000

commit ecd7038deb309a746042960ad93748e7787a1327
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 7 12:34:32 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 8 08:12:27 2026 +0200

    iommu/arm: smmu: Fix variable shadowing
    
    Rename 'pdev' to 'pci_dev' in the dev_print_pci() macro to avoid
    shadowing local 'pdev' variables at call sites.
    
    Remove the unused 'ret' declaration from arm_smmu_dt_add_device_generic()
    where the function-scope 'ret' is sufficient.
    
    Fix shadowing of 'domain' in arm_smmu_assign_dev() by removing the
    inner-scope redeclaration, using the function-scope variable instead.
    
    This fixes MISRA C R5.3.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/passthrough/arm/smmu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 22d306d0cb..d63c901551 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -130,8 +130,8 @@ typedef enum irqreturn irqreturn_t;
         printk(lvl "smmu: %s: " fmt, dev_name((dev)), ## __VA_ARGS__);  \
     else                                                                \
     {                                                                   \
-        struct pci_dev *pdev = dev_to_pci((dev));                       \
-        printk(lvl "smmu: %pp: " fmt, &pdev->sbdf, ## __VA_ARGS__);     \
+        struct pci_dev *pci_dev = dev_to_pci((dev));                    \
+        printk(lvl "smmu: %pp: " fmt, &pci_dev->sbdf, ## __VA_ARGS__);  \
     }                                                                   \
 })
 #endif
@@ -927,7 +927,6 @@ static int arm_smmu_dt_add_device_generic(u8 devfn, struct device *dev)
 	if ( dev_is_pci(dev) )
 	{
 		struct pci_dev *pdev = dev_to_pci(dev);
-		int ret;
 
 		/* Ignore calls for phantom functions */
 		if ( devfn != pdev->devfn )
@@ -2788,7 +2787,7 @@ static int arm_smmu_assign_dev(struct domain *d, u8 devfn,
 		/* dom_io is used as a sentinel for quarantined devices */
 		if ( d == dom_io )
 		{
-			struct iommu_domain *domain = dev_iommu_domain(dev);
+			domain = dev_iommu_domain(dev);
 			if ( !iommu_quarantine )
 				return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 08 06:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Apr 2026 06:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275410.1561247 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAMIn-00052Q-KV; Wed, 08 Apr 2026 06:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275410.1561247; Wed, 08 Apr 2026 06:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAMIn-00052I-Ht; Wed, 08 Apr 2026 06:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1275410;
 Wed, 08 Apr 2026 06:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAMIm-000528-Iw
 for xen-changelog@lists.xenproject.org; Wed, 08 Apr 2026 06:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAMIm-00Fge0-2T
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 06:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAMIm-005MZQ-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 06:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QTWY5SHBsFAH8nNlEQvSOFK/ZOG7srN9konBvRs/ICE=; b=u6saSNZe5fE6qN34qOFszwkxua
	drdX48x1ep47iAMrpHg9nT+vbENKdTjZOhvd32GquFVCNKXaFvY+wG8p8pRT7XUGiL5C5BMiQWk/a
	JGlyzsWqfNs5cbYfLfWEhqoPwMz58nQhZ3DLzwuj0dBZ9RSdNeucxiOwYprfBL8WeNqQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] iommu/arm: ipmmu-vmsa: Fix variable shadowing
Message-Id: <E1wAMIm-005MZQ-1f@xenbits.xenproject.org>
Date: Wed, 08 Apr 2026 06:22:12 +0000

commit af5495d7c6a5cc2d61fab8416710d800bcbacc5a
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 7 12:34:33 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 8 08:12:42 2026 +0200

    iommu/arm: ipmmu-vmsa: Fix variable shadowing
    
    Rename 'pdev' to 'pci_dev' in the dev_print() macro to avoid
    shadowing local 'pdev' variables at call sites.
    
    Remove the unused 'ret' declaration from ipmmu_assign_device() where
    the function-scope 'ret' is sufficient.
    
    This fixes MISRA C R5.3.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/passthrough/arm/ipmmu-vmsa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
index ea9fa9ddf3..fa9ab9cb13 100644
--- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
+++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
@@ -65,8 +65,8 @@
         printk(lvl "ipmmu: %s: " fmt, dev_name((dev)), ## __VA_ARGS__);  \
     else                                                                \
     {                                                                   \
-        struct pci_dev *pdev = dev_to_pci((dev));                       \
-        printk(lvl "ipmmu: %pp: " fmt, &pdev->sbdf, ## __VA_ARGS__);     \
+        struct pci_dev *pci_dev = dev_to_pci((dev));                       \
+        printk(lvl "ipmmu: %pp: " fmt, &pci_dev->sbdf, ## __VA_ARGS__);     \
     }                                                                   \
 })
 #endif
@@ -1171,8 +1171,6 @@ static int ipmmu_assign_device(struct domain *d, u8 devfn, struct device *dev,
         /* dom_io is used as a sentinel for quarantined devices */
         if ( d == dom_io )
         {
-            int ret;
-
             /*
              * Try to de-assign: do not return error if it was already
              * de-assigned.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 08 07:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Apr 2026 07:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275419.1561266 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wANEg-00049O-VP; Wed, 08 Apr 2026 07:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275419.1561266; Wed, 08 Apr 2026 07: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 1wANEg-00049I-St; Wed, 08 Apr 2026 07:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1275419;
 Wed, 08 Apr 2026 07:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wANEg-00048u-Aa
 for xen-changelog@lists.xenproject.org; Wed, 08 Apr 2026 07:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wANEg-00Fwe3-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 07:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wANEg-005RXW-0S
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 07:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2ehb/xLC5kfyUjVK5JNtQKJBh8FszD28zpNqof3FTI0=; b=vQCKusElsgKQ4A3G1FJdpy6bmJ
	9t6beupmoW1RY1Na8u333stqbbt5T+mtFHsLu4ktqNSNwrg7OuLzUSBNEsBUyoMY7kGreY/k0Z4d2
	5ZggHnaSnh5UJvmlFxxQBQ6KX+Tl2L+q+fSt/4dnINs6PaQs1Q/IvsE04hl4uFcaBTD0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu/arm: smmu: Fix variable shadowing
Message-Id: <E1wANEg-005RXW-0S@xenbits.xenproject.org>
Date: Wed, 08 Apr 2026 07:22:02 +0000

commit ecd7038deb309a746042960ad93748e7787a1327
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 7 12:34:32 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 8 08:12:27 2026 +0200

    iommu/arm: smmu: Fix variable shadowing
    
    Rename 'pdev' to 'pci_dev' in the dev_print_pci() macro to avoid
    shadowing local 'pdev' variables at call sites.
    
    Remove the unused 'ret' declaration from arm_smmu_dt_add_device_generic()
    where the function-scope 'ret' is sufficient.
    
    Fix shadowing of 'domain' in arm_smmu_assign_dev() by removing the
    inner-scope redeclaration, using the function-scope variable instead.
    
    This fixes MISRA C R5.3.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/passthrough/arm/smmu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 22d306d0cb..d63c901551 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -130,8 +130,8 @@ typedef enum irqreturn irqreturn_t;
         printk(lvl "smmu: %s: " fmt, dev_name((dev)), ## __VA_ARGS__);  \
     else                                                                \
     {                                                                   \
-        struct pci_dev *pdev = dev_to_pci((dev));                       \
-        printk(lvl "smmu: %pp: " fmt, &pdev->sbdf, ## __VA_ARGS__);     \
+        struct pci_dev *pci_dev = dev_to_pci((dev));                    \
+        printk(lvl "smmu: %pp: " fmt, &pci_dev->sbdf, ## __VA_ARGS__);  \
     }                                                                   \
 })
 #endif
@@ -927,7 +927,6 @@ static int arm_smmu_dt_add_device_generic(u8 devfn, struct device *dev)
 	if ( dev_is_pci(dev) )
 	{
 		struct pci_dev *pdev = dev_to_pci(dev);
-		int ret;
 
 		/* Ignore calls for phantom functions */
 		if ( devfn != pdev->devfn )
@@ -2788,7 +2787,7 @@ static int arm_smmu_assign_dev(struct domain *d, u8 devfn,
 		/* dom_io is used as a sentinel for quarantined devices */
 		if ( d == dom_io )
 		{
-			struct iommu_domain *domain = dev_iommu_domain(dev);
+			domain = dev_iommu_domain(dev);
 			if ( !iommu_quarantine )
 				return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 08 07:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Apr 2026 07:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1275420.1561271 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wANEr-0004E3-17; Wed, 08 Apr 2026 07:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1275420.1561271; Wed, 08 Apr 2026 07: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 1wANEq-0004Dv-UF; Wed, 08 Apr 2026 07:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1275420;
 Wed, 08 Apr 2026 07:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wANEq-0004Dh-BB
 for xen-changelog@lists.xenproject.org; Wed, 08 Apr 2026 07:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wANEq-00FweA-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 07:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wANEq-005RYB-0q
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Apr 2026 07:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VMsvtZWTNAdj4oIYgkqPBIJNqHO54KtLxuaMIdEXLLE=; b=EGHSVE7Zwv4HXYZcEHVuCKkWfA
	icj6WVLjGUJG6w1kxl0F1WUoqu/wlJwnDUmoatJkRnlxmGeFObA0+t6cCivM4r5Ky2D75cnxxaPga
	kKWrjxMlY2oIxmjHpvKKEyWa/3pkhA+QC2UkE+B+Y2TmO6JH7NR/lPZ/ABGxxHBcTNWY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu/arm: ipmmu-vmsa: Fix variable shadowing
Message-Id: <E1wANEq-005RYB-0q@xenbits.xenproject.org>
Date: Wed, 08 Apr 2026 07:22:12 +0000

commit af5495d7c6a5cc2d61fab8416710d800bcbacc5a
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 7 12:34:33 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 8 08:12:42 2026 +0200

    iommu/arm: ipmmu-vmsa: Fix variable shadowing
    
    Rename 'pdev' to 'pci_dev' in the dev_print() macro to avoid
    shadowing local 'pdev' variables at call sites.
    
    Remove the unused 'ret' declaration from ipmmu_assign_device() where
    the function-scope 'ret' is sufficient.
    
    This fixes MISRA C R5.3.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/passthrough/arm/ipmmu-vmsa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
index ea9fa9ddf3..fa9ab9cb13 100644
--- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
+++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
@@ -65,8 +65,8 @@
         printk(lvl "ipmmu: %s: " fmt, dev_name((dev)), ## __VA_ARGS__);  \
     else                                                                \
     {                                                                   \
-        struct pci_dev *pdev = dev_to_pci((dev));                       \
-        printk(lvl "ipmmu: %pp: " fmt, &pdev->sbdf, ## __VA_ARGS__);     \
+        struct pci_dev *pci_dev = dev_to_pci((dev));                       \
+        printk(lvl "ipmmu: %pp: " fmt, &pci_dev->sbdf, ## __VA_ARGS__);     \
     }                                                                   \
 })
 #endif
@@ -1171,8 +1171,6 @@ static int ipmmu_assign_device(struct domain *d, u8 devfn, struct device *dev,
         /* dom_io is used as a sentinel for quarantined devices */
         if ( d == dom_io )
         {
-            int ret;
-
             /*
              * Try to de-assign: do not return error if it was already
              * de-assigned.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:33:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276906.1562194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAll2-0000G9-5J; Thu, 09 Apr 2026 09:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276906.1562194; Thu, 09 Apr 2026 09: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 1wAll2-0000G2-2Y; Thu, 09 Apr 2026 09:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1276906;
 Thu, 09 Apr 2026 09:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAll0-0000Fw-KO
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAll0-000KFW-24
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAll0-007PIn-1B
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NHsHIp3f2sIjDgM1bVttHjYEy9KqKXvIumebSKX+YDk=; b=bisL9P21B9++D5Ms5HrVQOWad/
	jv3DgK/tv19w5famn45oEhI5chcbWW4aNf+wakM14p+ssoHAibP06gyqYnGXxz5kOJh2U9E561zmB
	K8VE6gYEynZXLEaKukcrkNG9Is4394thPkuP2hoasOFtLEPP0LqOOojA7jVwGgFVgtBQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Reject CPU policies with vendors other than the host's
Message-Id: <E1wAll0-007PIn-1B@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:33:02 +0000

commit c520286a5380b0133213b53480fb2a4c2d631fc4
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:22:36 2026 +0200

    x86: Reject CPU policies with vendors other than the host's
    
    While in principle it's possible to have a vendor virtualising another,
    this is fairly tricky in practice and comes with the world's supply of
    security issues.
    
    Reject any CPU policy with vendors not matching the host's.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # CHANGELOG.md
---
 CHANGELOG.md                             |  6 ++++++
 tools/tests/cpu-policy/test-cpu-policy.c | 27 +++++++++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/policy.c     |  5 ++++-
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 166df43c63..47b6021ce7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
+   - Cross-vendor support; guests can now only be configured as the same
+     vendor as the host CPU.  When added back in 2009, with enough trickery
+     Intel and AMD CPUs could be made to be compatible enough to live migrate
+     a guest, but the vendors have been diverging since then in ways that Xen
+     cannot compensate for, and the advent of speculative security issues has
+     put to rest any possibility of this being a viable option.
 
  - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
    anything useful outside of x86.
diff --git a/tools/tests/cpu-policy/test-cpu-policy.c b/tools/tests/cpu-policy/test-cpu-policy.c
index 301df2c002..88a9a26e8f 100644
--- a/tools/tests/cpu-policy/test-cpu-policy.c
+++ b/tools/tests/cpu-policy/test-cpu-policy.c
@@ -586,6 +586,19 @@ static void test_is_compatible_success(void)
                 .platform_info.cpuid_faulting = true,
             },
         },
+        {
+            .name = "Host CPU vendor == Guest CPU vendor (both unknown)",
+            .host = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 1,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+            .guest = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 1,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+        },
     };
     struct cpu_policy_errors no_errors = INIT_CPU_POLICY_ERRORS;
 
@@ -629,6 +642,20 @@ static void test_is_compatible_failure(void)
             },
             .e = { -1, -1, 0xce },
         },
+        {
+            .name = "Host CPU vendor != Guest CPU vendor (both unknown)",
+            .host = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 1,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+            .guest = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 2,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+            .e = { 0, -1, -1 },
+        },
     };
 
     printf("Testing policy compatibility failure:\n");
diff --git a/xen/arch/x86/lib/cpu-policy/policy.c b/xen/arch/x86/lib/cpu-policy/policy.c
index f033d22785..f991b1f3a9 100644
--- a/xen/arch/x86/lib/cpu-policy/policy.c
+++ b/xen/arch/x86/lib/cpu-policy/policy.c
@@ -15,7 +15,10 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
 #define FAIL_MSR(m) \
     do { e.msr = (m); goto out; } while ( 0 )
 
-    if ( guest->basic.max_leaf > host->basic.max_leaf )
+    if ( (guest->basic.vendor_ebx != host->basic.vendor_ebx) ||
+         (guest->basic.vendor_ecx != host->basic.vendor_ecx) ||
+         (guest->basic.vendor_edx != host->basic.vendor_edx) ||
+         (guest->basic.max_leaf   >  host->basic.max_leaf) )
         FAIL_CPUID(0, NA);
 
     if ( guest->feat.max_subleaf > host->feat.max_subleaf )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276907.1562199 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAllB-0000IC-7N; Thu, 09 Apr 2026 09:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276907.1562199; Thu, 09 Apr 2026 09: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 1wAllB-0000I3-4A; Thu, 09 Apr 2026 09:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1276907;
 Thu, 09 Apr 2026 09:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAllA-0000Hx-JE
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllA-000KFb-2S
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllA-007PJp-1c
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/3le6Zw7Oz24oc9fZspzK6WI6wqyV+gCWdMJBH91l+I=; b=6lWXnH72+wWZ4KsIQ/FKOOEbdA
	AR21ol8sIYVOlt1AfRhEVwBL0b9yY3ClDuuCjSRi8aevtP2TcjQUWnkcEZAd8b2uScJGdBRfgIQzO
	3/O/fu9AH1x7K7VgjLLqP71ej2xiyN9YoskPc9xN2kHlm59hvwGRtqjMZBP+iiXjjV3I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: Disable cross-vendor handling in #UD handler
Message-Id: <E1wAllA-007PJp-1c@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:33:12 +0000

commit e39e473188ccc60ed10b444dff0cc73648d4e7ad
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:11 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:22:52 2026 +0200

    x86/hvm: Disable cross-vendor handling in #UD handler
    
    Remove cross-vendor support now that VMs can no longer have a different
    vendor than the host.
    
    No functional change intended.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c     | 19 ++-----------------
 xen/arch/x86/hvm/svm/svm.c |  3 +--
 xen/arch/x86/hvm/vmx/vmx.c |  3 +--
 3 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 11e9b2bc88..4a81afce02 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3829,28 +3829,13 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
     return X86EMUL_OKAY;
 }
 
-static bool cf_check is_cross_vendor(
-    const struct x86_emulate_state *state, const struct x86_emulate_ctxt *ctxt)
-{
-    switch ( ctxt->opcode )
-    {
-    case X86EMUL_OPC(0x0f, 0x05): /* syscall */
-    case X86EMUL_OPC(0x0f, 0x34): /* sysenter */
-    case X86EMUL_OPC(0x0f, 0x35): /* sysexit */
-        return true;
-    }
-
-    return false;
-}
-
 void hvm_ud_intercept(struct cpu_user_regs *regs)
 {
     struct vcpu *cur = current;
-    bool should_emulate =
-        cur->domain->arch.cpuid->x86_vendor != boot_cpu_data.x86_vendor;
+    bool should_emulate = false;
     struct hvm_emulate_ctxt ctxt;
 
-    hvm_emulate_init_once(&ctxt, opt_hvm_fep ? NULL : is_cross_vendor, regs);
+    hvm_emulate_init_once(&ctxt, NULL, regs);
 
     if ( opt_hvm_fep )
     {
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 2546705d24..d4502d3c0f 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -543,8 +543,7 @@ static void cf_check svm_cpuid_policy_changed(struct vcpu *v)
     const struct cpu_policy *cp = v->domain->arch.cpu_policy;
     u32 bitmap = vmcb_get_exception_intercepts(vmcb);
 
-    if ( opt_hvm_fep ||
-         (v->domain->arch.cpuid->x86_vendor != boot_cpu_data.x86_vendor) )
+    if ( opt_hvm_fep )
         bitmap |= (1U << X86_EXC_UD);
     else
         bitmap &= ~(1U << X86_EXC_UD);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 03daf2f52b..269ca56433 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -802,8 +802,7 @@ static void cf_check vmx_cpuid_policy_changed(struct vcpu *v)
     const struct cpu_policy *cp = v->domain->arch.cpu_policy;
     int rc = 0;
 
-    if ( opt_hvm_fep ||
-         (v->domain->arch.cpuid->x86_vendor != boot_cpu_data.x86_vendor) )
+    if ( opt_hvm_fep )
         v->arch.hvm.vmx.exception_bitmap |= (1U << X86_EXC_UD);
     else
         v->arch.hvm.vmx.exception_bitmap &= ~(1U << X86_EXC_UD);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276908.1562202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAllM-0000Kd-89; Thu, 09 Apr 2026 09:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276908.1562202; Thu, 09 Apr 2026 09: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 1wAllM-0000KV-5U; Thu, 09 Apr 2026 09:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1276908;
 Thu, 09 Apr 2026 09:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAllK-0000KO-MT
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllK-000KFf-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllK-007PLB-22
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0+RjDI4SDlFr/BaHmf69e7/YdyXLI9OsTpNhwwDRc18=; b=7Eu04IEWEPan97R6AsNNdWItHa
	5/LMsoU940jA4Uxi3a7I1cFvfkbz8tfjtI4oOahlvyO+9LcZbHYqqkpIwIfNpTKXb5D7HI5oxME0S
	TwEqbEmE7fzf1m1QQI2ldmYrM+34WW+sw4v4zEGszDjc9HIJc+ySvjqZ/VFqhWn5Mwq4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: Remove cross-vendor checks from MSR handlers.
Message-Id: <E1wAllK-007PLB-22@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:33:22 +0000

commit f2dc22e6320e0ef0348c4e31717a2f0bbde31756
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:23:05 2026 +0200

    x86/hvm: Remove cross-vendor checks from MSR handlers.
    
    Not a functional change now that cross-vendor guests are not launchable.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msr.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 6a97be59d5..d10891dcfc 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -169,9 +169,9 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
         break;
 
     case MSR_IA32_PLATFORM_ID:
-        if ( !(cp->x86_vendor & X86_VENDOR_INTEL) ||
-             !(boot_cpu_data.vendor & X86_VENDOR_INTEL) )
+        if ( boot_cpu_data.vendor != X86_VENDOR_INTEL )
             goto gp_fault;
+
         rdmsrl(MSR_IA32_PLATFORM_ID, *val);
         break;
 
@@ -189,9 +189,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
          * from Xen's last microcode load, which can be forwarded straight to
          * the guest.
          */
-        if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
-             !(boot_cpu_data.vendor &
-               (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
+        if ( !(boot_cpu_data.vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
              rdmsr_safe(MSR_AMD_PATCHLEVEL, val) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276909.1562206 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAllW-0000MK-9t; Thu, 09 Apr 2026 09:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276909.1562206; Thu, 09 Apr 2026 09: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 1wAllW-0000M9-6s; Thu, 09 Apr 2026 09:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1276909;
 Thu, 09 Apr 2026 09:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAllU-0000Lz-Qa
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllV-000KFl-00
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllU-007PM7-2L
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=60g7oRUBuBv+d1eDtnkBOg8yut5o8MyqinuWQ3EOZgc=; b=gEicMBbX9w4fj3wyotT/PznQqi
	RGCqavEL44Du1aQIpH9sHrOjhPsjPgu31uMD8DuPwKBAWn3sQZHGST0AaZTIm/kKy9MApL3muLQgv
	kI/b/1WLOi4PTjEwYUkJ/NOvhOMHrFAogDZaJD+5myRzwYTaaQKQ7IyjQPlnGF6ukXXU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Drop emulation of Intel's SYSENTER MSR behaviour
Message-Id: <E1wAllU-007PM7-2L@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:33:32 +0000

commit fc30191a6a5ff805bcef767d5b3ae5022b41c4d5
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:23:17 2026 +0200

    x86/svm: Drop emulation of Intel's SYSENTER MSR behaviour
    
    With cross-vendor support gone, it's no longer needed.
    
    AMD CPUs ignore the top 32 bits of the SYSENTER/SYSEXIT MSRs, which is
    not how this emulation worked due to the need for cross-vendor support.
    Any AMD VMs storing state in the top 32bits of the SEP MSRs will lose
    it.
    
    It's very unlikely to affect any production VM because having 64bit width
    just isn't how real AMD CPUs behave.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/svm.c               | 42 +++++++++++++++-----------------
 xen/arch/x86/hvm/svm/vmcb.c              |  3 +++
 xen/arch/x86/include/asm/hvm/svm-types.h | 10 --------
 3 files changed, 22 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index d4502d3c0f..ced6166847 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -355,10 +355,6 @@ static int svm_vmcb_save(struct vcpu *v, struct hvm_hw_cpu *c)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
-    c->sysenter_cs = v->arch.hvm.svm.guest_sysenter_cs;
-    c->sysenter_esp = v->arch.hvm.svm.guest_sysenter_esp;
-    c->sysenter_eip = v->arch.hvm.svm.guest_sysenter_eip;
-
     if ( vmcb->event_inj.v &&
          hvm_event_needs_reinjection(vmcb->event_inj.type,
                                      vmcb->event_inj.vector) )
@@ -422,11 +418,6 @@ static int svm_vmcb_restore(struct vcpu *v, struct hvm_hw_cpu *c)
     svm_update_guest_cr(v, 0, 0);
     svm_update_guest_cr(v, 4, 0);
 
-    /* Load sysenter MSRs into both VMCB save area and VCPU fields. */
-    vmcb->sysenter_cs = v->arch.hvm.svm.guest_sysenter_cs = c->sysenter_cs;
-    vmcb->sysenter_esp = v->arch.hvm.svm.guest_sysenter_esp = c->sysenter_esp;
-    vmcb->sysenter_eip = v->arch.hvm.svm.guest_sysenter_eip = c->sysenter_eip;
-
     if ( paging_mode_hap(v->domain) )
     {
         vmcb_set_np(vmcb, true);
@@ -455,6 +446,9 @@ static void svm_save_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
+    data->sysenter_cs      = vmcb->sysenter_cs;
+    data->sysenter_esp     = vmcb->sysenter_esp;
+    data->sysenter_eip     = vmcb->sysenter_eip;
     data->shadow_gs        = vmcb->kerngsbase;
     data->msr_lstar        = vmcb->lstar;
     data->msr_star         = vmcb->star;
@@ -466,11 +460,14 @@ static void svm_load_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
-    vmcb->kerngsbase = data->shadow_gs;
-    vmcb->lstar      = data->msr_lstar;
-    vmcb->star       = data->msr_star;
-    vmcb->cstar      = data->msr_cstar;
-    vmcb->sfmask     = data->msr_syscall_mask;
+    vmcb->lstar        = data->msr_lstar;
+    vmcb->star         = data->msr_star;
+    vmcb->cstar        = data->msr_cstar;
+    vmcb->sfmask       = data->msr_syscall_mask;
+    vmcb->kerngsbase   = data->shadow_gs;
+    vmcb->sysenter_cs  = data->sysenter_cs;
+    vmcb->sysenter_esp = data->sysenter_esp;
+    vmcb->sysenter_eip = data->sysenter_eip;
     v->arch.hvm.guest_efer = data->msr_efer;
     svm_update_guest_efer(v);
 }
@@ -1663,12 +1660,9 @@ static int cf_check svm_msr_read_intercept(
 
     switch ( msr )
     {
-        /*
-         * Sync not needed while the cross-vendor logic is in unilateral effect.
     case MSR_IA32_SYSENTER_CS:
     case MSR_IA32_SYSENTER_ESP:
     case MSR_IA32_SYSENTER_EIP:
-         */
     case MSR_STAR:
     case MSR_LSTAR:
     case MSR_CSTAR:
@@ -1683,13 +1677,15 @@ static int cf_check svm_msr_read_intercept(
     switch ( msr )
     {
     case MSR_IA32_SYSENTER_CS:
-        *msr_content = v->arch.hvm.svm.guest_sysenter_cs;
+        *msr_content = vmcb->sysenter_cs;
         break;
+
     case MSR_IA32_SYSENTER_ESP:
-        *msr_content = v->arch.hvm.svm.guest_sysenter_esp;
+        *msr_content = vmcb->sysenter_esp;
         break;
+
     case MSR_IA32_SYSENTER_EIP:
-        *msr_content = v->arch.hvm.svm.guest_sysenter_eip;
+        *msr_content = vmcb->sysenter_eip;
         break;
 
     case MSR_STAR:
@@ -1883,11 +1879,11 @@ static int cf_check svm_msr_write_intercept(
         switch ( msr )
         {
         case MSR_IA32_SYSENTER_ESP:
-            vmcb->sysenter_esp = v->arch.hvm.svm.guest_sysenter_esp = msr_content;
+            vmcb->sysenter_esp = msr_content;
             break;
 
         case MSR_IA32_SYSENTER_EIP:
-            vmcb->sysenter_eip = v->arch.hvm.svm.guest_sysenter_eip = msr_content;
+            vmcb->sysenter_eip = msr_content;
             break;
 
         case MSR_LSTAR:
@@ -1913,7 +1909,7 @@ static int cf_check svm_msr_write_intercept(
         break;
 
     case MSR_IA32_SYSENTER_CS:
-        vmcb->sysenter_cs = v->arch.hvm.svm.guest_sysenter_cs = msr_content;
+        vmcb->sysenter_cs = msr_content;
         break;
 
     case MSR_STAR:
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 5ed7123d9a..514e530cbd 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -97,6 +97,9 @@ static int construct_vmcb(struct vcpu *v)
     svm_disable_intercept_for_msr(v, MSR_LSTAR);
     svm_disable_intercept_for_msr(v, MSR_STAR);
     svm_disable_intercept_for_msr(v, MSR_SYSCALL_MASK);
+    svm_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
+    svm_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
+    svm_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
 
     vmcb->_msrpm_base_pa = virt_to_maddr(svm->msrpm);
     vmcb->_iopm_base_pa = __pa(v->domain->arch.hvm.io_bitmap);
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index 3ede62cade..8acadb9dcc 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -27,16 +27,6 @@ struct svm_vcpu {
 
     /* VMCB has a cached instruction from #PF/#NPF Decode Assist? */
     uint8_t cached_insn_len; /* Zero if no cached instruction. */
-
-    /*
-     * Upper four bytes are undefined in the VMCB, therefore we can't use the
-     * fields in the VMCB. Write a 64bit value and then read a 64bit value is
-     * fine unless there's a VMRUN/VMEXIT in between which clears the upper
-     * four bytes.
-     */
-    uint64_t guest_sysenter_cs;
-    uint64_t guest_sysenter_esp;
-    uint64_t guest_sysenter_eip;
 };
 
 struct nestedsvm {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276910.1562210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAllg-0000ON-Ar; Thu, 09 Apr 2026 09:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276910.1562210; Thu, 09 Apr 2026 09: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 1wAllg-0000OF-8F; Thu, 09 Apr 2026 09:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1276910;
 Thu, 09 Apr 2026 09:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAlle-0000O6-TL
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllf-000KFp-0I
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAlle-007PNX-2j
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JfJz/LlOgsEaYBsLlMtP5xAwn8o/lyrlWAdjJoyWLys=; b=u8T+QOsZjfEN43KogLMZqnvnUu
	/eR9Htxaq/utb1OGeRKQNMUlITPALTgrsRWBdcf1Fxa/woENN1ZL8/amqus/BMLjbQqCKCsmh0nhz
	k0l8h6REn4xG8dYcgzMPvyB42Vgx3bHA8mBx5JmwZ3T/ufKgCQAbSK9fh62g7M1XzoTs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add exception table support
Message-Id: <E1wAlle-007PNX-2j@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:33:42 +0000

commit a651dabf873d28692f1e4c2e57a3c47b560a16c4
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Mar 31 21:04:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:23:32 2026 +0200

    xen/riscv: add exception table support
    
    Introduce exception table handling for RISC-V so faults from selected
    instructions can be recovered via fixup handlers instead of being
    treated as fatal.
    
    Add the RISC-V exception table format, sorting at boot to allow binary
    search used furthuer, and lookup from the trap handler. Update the
    linker script to emit the .ex_table section using introduced common
    EX_TABLE macro shared with other architectures.
    
    Also, reduce __start___ex_table alignment from 8 to 4 bytes to
    match the natural alignment of struct exception_table_entry,
    which contains two int32_t fields.
    
    Add inclusion of asm/extable.h to asm/bug.h to deal with compilation
    issue of common/virtual_region.c, which require declaration of
    __start___ex_table and __stop___ex_table.
    
    This implementation is based on Linux 6.16.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Kconfig               |  1 +
 xen/arch/riscv/Makefile              |  1 +
 xen/arch/riscv/extable.c             | 84 ++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/bug.h     |  2 +
 xen/arch/riscv/include/asm/extable.h | 58 +++++++++++++++++++++++++
 xen/arch/riscv/setup.c               |  3 ++
 xen/arch/riscv/traps.c               |  5 +++
 xen/arch/riscv/xen.lds.S             |  3 ++
 xen/arch/x86/xen.lds.S               |  6 +--
 xen/include/xen/xen.lds.h            |  6 +++
 10 files changed, 164 insertions(+), 5 deletions(-)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 89876b3217..a5e87c1757 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -4,6 +4,7 @@ config RISCV
 	select GENERIC_BUG_FRAME
 	select GENERIC_UART_INIT
 	select HAS_DEVICE_TREE_DISCOVERY
+	select HAS_EX_TABLE
 	select HAS_PMAP
 	select HAS_UBSAN
 	select HAS_VMAP
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index ffbd7062e2..04f02ad89c 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -3,6 +3,7 @@ obj-y += cpufeature.o
 obj-y += domain.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
+obj-y += extable.o
 obj-y += imsic.o
 obj-y += intc.o
 obj-y += irq.o
diff --git a/xen/arch/riscv/extable.c b/xen/arch/riscv/extable.c
new file mode 100644
index 0000000000..77e5e9e894
--- /dev/null
+++ b/xen/arch/riscv/extable.c
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/init.h>
+#include <xen/bsearch.h>
+#include <xen/lib.h>
+#include <xen/livepatch.h>
+#include <xen/sort.h>
+#include <xen/virtual_region.h>
+
+#include <asm/extable.h>
+#include <asm/processor.h>
+
+#define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
+
+static inline unsigned long ex_insn(const struct exception_table_entry *ex)
+{
+    return EX_FIELD(ex, insn);
+}
+
+static inline unsigned long ex_fixup(const struct exception_table_entry *ex)
+{
+    return EX_FIELD(ex, fixup);
+}
+
+static void __init cf_check swap_ex(void *a, void *b)
+{
+    struct exception_table_entry *x = a, *y = b, tmp;
+    long delta = b - a;
+
+    tmp = *x;
+    x->insn = y->insn + delta;
+    y->insn = tmp.insn - delta;
+
+    x->fixup = y->fixup + delta;
+    y->fixup = tmp.fixup - delta;
+}
+
+static int cf_check cmp_ex(const void *a, const void *b)
+{
+    const unsigned long insn_a = ex_insn(a);
+    const unsigned long insn_b = ex_insn(b);
+
+    return (insn_a > insn_b) - (insn_a < insn_b);
+}
+
+void init_or_livepatch sort_exception_table(struct exception_table_entry *start,
+                                 const struct exception_table_entry *stop)
+{
+    sort(start, stop - start, sizeof(*start), cmp_ex, swap_ex);
+}
+
+void __init sort_exception_tables(void)
+{
+    sort_exception_table(__start___ex_table, __stop___ex_table);
+}
+
+static void ex_handler_fixup(const struct exception_table_entry *ex,
+                             struct cpu_user_regs *regs)
+{
+    regs->sepc = ex_fixup(ex);
+}
+
+bool fixup_exception(struct cpu_user_regs *regs)
+{
+    unsigned long pc = regs->sepc;
+    const struct virtual_region *region = find_text_region(pc);
+    const struct exception_table_entry *ex;
+    struct exception_table_entry key;
+
+    if ( !region || !region->ex )
+        return false;
+
+    key.insn = pc - (unsigned long)&key.insn;
+
+    ex = bsearch(&key, region->ex, region->ex_end - region->ex, sizeof(key),
+                 cmp_ex);
+
+    if ( !ex )
+        return false;
+
+    ex_handler_fixup(ex, regs);
+
+    return true;
+}
diff --git a/xen/arch/riscv/include/asm/bug.h b/xen/arch/riscv/include/asm/bug.h
index 6ec8adc528..e6f2868816 100644
--- a/xen/arch/riscv/include/asm/bug.h
+++ b/xen/arch/riscv/include/asm/bug.h
@@ -9,6 +9,8 @@
 
 #ifndef __ASSEMBLER__
 
+#include <asm/extable.h>
+
 #define BUG_INSTR "unimp"
 
 /*
diff --git a/xen/arch/riscv/include/asm/extable.h b/xen/arch/riscv/include/asm/extable.h
new file mode 100644
index 0000000000..c0128a9181
--- /dev/null
+++ b/xen/arch/riscv/include/asm/extable.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef ASM__RISCV__ASM_EXTABLE_H
+#define ASM__RISCV__ASM_EXTABLE_H
+
+#ifdef __ASSEMBLER__
+
+#define ASM_EXTABLE(insn, fixup) \
+    .pushsection .ex_table, "a"; \
+    .balign     4;               \
+    .word       (insn) - .;      \
+    .word       (fixup) - .;     \
+    .popsection
+
+.macro asm_extable, insn, fixup
+    ASM_EXTABLE(\insn, \fixup)
+.endm
+
+#else /* __ASSEMBLER__ */
+
+#include <xen/stringify.h>
+#include <xen/types.h>
+
+struct cpu_user_regs;
+
+#define ASM_EXTABLE(insn, fixup)      \
+    ".pushsection .ex_table, \"a\"\n" \
+    ".balign    4\n"                  \
+    ".word      (" #insn " - .)\n"    \
+    ".word      (" #fixup " - .)\n"   \
+    ".popsection\n"
+
+/*
+ * The exception table consists of pairs of relative offsets: the first
+ * is the relative offset to an instruction that is allowed to fault,
+ * and the second is the relative offset at which the program should
+ * continue. No general-purpose registers are modified by the exception
+ * handling mechanism itself, so it is up to the fixup code to handle
+ * any necessary state cleanup.
+ *
+ * The exception table and fixup code live out of line with the main
+ * instruction path. This means when everything is well, we don't even
+ * have to jump over them. Further, they do not intrude on our cache or
+ * tlb entries.
+ */
+struct exception_table_entry {
+    int32_t insn, fixup;
+};
+
+extern struct exception_table_entry __start___ex_table[];
+extern struct exception_table_entry __stop___ex_table[];
+
+void sort_exception_tables(void);
+bool fixup_exception(struct cpu_user_regs *regs);
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* ASM__RISCV__ASM_EXTABLE_H */
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index cae49bb296..56a0907a85 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -19,6 +19,7 @@
 
 #include <public/version.h>
 
+#include <asm/extable.h>
 #include <asm/cpufeature.h>
 #include <asm/early_printk.h>
 #include <asm/fixmap.h>
@@ -81,6 +82,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     smp_prepare_boot_cpu();
 
+    sort_exception_tables();
+
     set_cpuid_to_hartid(0, bootcpu_id);
 
     trap_init();
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 326f2be628..d35c013e13 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -12,6 +12,7 @@
 #include <xen/sched.h>
 #include <xen/softirq.h>
 
+#include <asm/extable.h>
 #include <asm/cpufeature.h>
 #include <asm/intc.h>
 #include <asm/processor.h>
@@ -217,6 +218,10 @@ void do_trap(struct cpu_user_regs *cpu_regs)
 
             break;
         }
+
+        if ( fixup_exception(cpu_regs) )
+            break;
+
         fallthrough;
     default:
         if ( cause & CAUSE_IRQ_FLAG )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 331a7d63d3..65f136dce9 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -74,6 +74,9 @@ SECTIONS
     .data.ro_after_init : {
         __ro_after_init_start = .;
         *(.data.ro_after_init)
+
+        EX_TABLE
+
         . = ALIGN(PAGE_SIZE);
         __ro_after_init_end = .;
     } : text
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index c326538ebb..b9e888e596 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -113,11 +113,7 @@ SECTIONS
        __ro_after_init_start = .;
        *(.data.ro_after_init)
 
-       . = ALIGN(8);
-       /* Exception table */
-       __start___ex_table = .;
-       *(.ex_table)
-       __stop___ex_table = .;
+       EX_TABLE
 
        . = ALIGN(PAGE_SIZE);
        __ro_after_init_end = .;
diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index 136849ecd5..ea11e3fb62 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -219,4 +219,10 @@
 #define VPCI_ARRAY
 #endif
 
+#define EX_TABLE                  \
+        . = ALIGN(4);             \
+        __start___ex_table = .;   \
+        *(.ex_table)              \
+        __stop___ex_table = .;
+
 #endif /* __XEN_LDS_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276911.1562213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAllq-0000R4-Dv; Thu, 09 Apr 2026 09:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276911.1562213; Thu, 09 Apr 2026 09: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 1wAllq-0000Qv-Ay; Thu, 09 Apr 2026 09:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1276911;
 Thu, 09 Apr 2026 09:33:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAllp-0000Qp-06
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:33:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllp-000KFw-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllo-007POL-30
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xI3oQk05X1SVOH4hfyxhsnKL6bFjqYcg9fBswI3BKBo=; b=16VIfELWBynfzM0McMi1NtFZXb
	qJItGjypOS8RnPGiHC3Ue73uKLWygscEIdZ0KSA0iL2Kj0LRTFmwu6OZWBWYXB9np2bTAnUuFpzxR
	8lcU3lXFMI4rCz9WWb7itZVAfXzWjHv2YPhnOfsDk1alL3xMhimW0ZN8JbKoU7iDgqbs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add csr_read_safe() helper
Message-Id: <E1wAllo-007POL-30@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:33:52 +0000

commit 889c68b648ebb1b75a9fa3d780960e53c110d0bc
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Mar 31 21:04:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:24:01 2026 +0200

    xen/riscv: add csr_read_safe() helper
    
    Accessing some CSRs may trap when the corresponding extension is not
    implemented or enabled. Introduce csr_read_safe() which attempts to
    read a CSR and relies on the exception table mechanism to safely recover
    if the access faults.
    
    This helper allows Xen to probe CSR availability without taking a fatal
    trap and will be used for feature detection during early boot as we
    can't always rely on what is in riscv,isa string in DTS.
    
    While touching the header, reorder the include directives to follow the
    usual Xen style.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/csr.h | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/include/asm/csr.h b/xen/arch/riscv/include/asm/csr.h
index 01876f8289..27d4b7942f 100644
--- a/xen/arch/riscv/include/asm/csr.h
+++ b/xen/arch/riscv/include/asm/csr.h
@@ -6,8 +6,10 @@
 #ifndef ASM__RISCV__CSR_H
 #define ASM__RISCV__CSR_H
 
-#include <asm/asm.h>
 #include <xen/const.h>
+
+#include <asm/asm.h>
+#include <asm/extable.h>
 #include <asm/riscv_encoding.h>
 
 #ifndef __ASSEMBLER__
@@ -78,6 +80,37 @@
                            : "memory" );                        \
 })
 
+static always_inline bool csr_read_safe(unsigned long csr,
+                                        unsigned long *val)
+{
+#ifdef CONFIG_CC_HAS_ASM_GOTO_OUTPUT
+    asm_inline goto (
+        "1: csrr %[val], %[csr]\n"
+        ASM_EXTABLE(1b, %l[fault])
+        : [val] "=r" (*val)
+        : [csr] "i" (csr)
+        :
+        : fault );
+
+    return true;
+
+ fault:
+    return false;
+#else
+    bool allowed = false;
+
+    asm_inline volatile (
+        "1: csrr %[val], %[csr]\n"
+        "   li %[allowed], 1\n"
+        "2:\n"
+        ASM_EXTABLE(1b, 2b)
+        : [val] "=&r" (*val), [allowed] "+r" (allowed)
+        : [csr] "i" (csr) );
+
+    return allowed;
+#endif
+}
+
 #endif /* __ASSEMBLER__ */
 
 #endif /* ASM__RISCV__CSR_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276912.1562218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAlm0-0000TW-Eo; Thu, 09 Apr 2026 09:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276912.1562218; Thu, 09 Apr 2026 09: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 1wAlm0-0000TO-CI; Thu, 09 Apr 2026 09:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1276912;
 Thu, 09 Apr 2026 09:34:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAllz-0000TB-41
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:34:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllz-000KGV-0x
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAllz-007PQ6-0A
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:34:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jxvOBxL48LF6KHBWf09ke6l8t+Gu29Uvlc/uVvqNtvs=; b=G6/PkSF3lqk36C1rNly+uDHkLT
	7cM4mXzKSPVoRXKztg2UutqIJYDOWqNOfOhjHuFfBiDnk0B6dadBQnVf2zOgErwo2CMVVas0Bse6N
	eRNeQ25xap/p+PJv1kUQvLIOffNeCw1FCq8HLaAnIkq9QIwe9Ug6/ME+X42jKADFPzCs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: support AVX512-BMM
Message-Id: <E1wAllz-007PQ6-0A@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:34:03 +0000

commit ea3d4312f7f34451a360a1a65162f220e329aeb3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 9 08:25:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:25:25 2026 +0200

    x86emul: support AVX512-BMM
    
    EVEX.W meaning is unusual for VBMAC{,X}OR16x16x16, but that needs taking
    care of only in the test harness.
    
    Like already proposed in "x86emul: support AVX10.1", use just
    vcpu_must_have(), not host_and_vcpu_must_have().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/evex-disp8.c       | 17 +++++++++++++++++
 tools/tests/x86_emulator/predicates.c       |  3 +++
 tools/tests/x86_emulator/x86-emulate.h      |  2 ++
 xen/arch/x86/x86_emulate/decode.c           |  1 +
 xen/arch/x86/x86_emulate/private.h          |  1 +
 xen/arch/x86/x86_emulate/x86_emulate.c      | 13 +++++++++++++
 xen/include/public/arch-x86/cpufeatureset.h |  1 +
 xen/tools/gen-cpuid.py                      |  2 +-
 8 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/evex-disp8.c b/tools/tests/x86_emulator/evex-disp8.c
index efb6c70637..3bd5944dd8 100644
--- a/tools/tests/x86_emulator/evex-disp8.c
+++ b/tools/tests/x86_emulator/evex-disp8.c
@@ -689,6 +689,15 @@ static const struct test avx512_fp16_128[] = {
     INSN(movw, 66, map5, 7e, el, fp16, el),
 };
 
+static const struct test avx512_bmm_all[] = {
+    INSN(bitrev,   , map6, 81, vl, b, vl),
+};
+
+static const struct test avx512_bmm_no128[] = {
+    INSN(bmacor16x16x16,    , map6, 81, vl, w, vl),
+    INSN(bmacxor16x16x16,   , map6, 81, vl, w, vl),
+};
+
 static const struct test gfni_all[] = {
     INSN(gf2p8affineinvqb, 66, 0f3a, cf, vl, q, vl),
     INSN(gf2p8affineqb,    66, 0f3a, ce, vl, q, vl),
@@ -817,6 +826,12 @@ static void test_one(const struct test *test, enum vl vl,
 
     case ESZ_w:
         evex.w = 1;
+        /*
+         * VBMAC{,X}OR16x16x16 don't follow the general pattern: EVEX.W controls
+         * reduction kind there, not element size.
+         */
+        if ( test->spc == SPC_map6 && !test->pfx && test->opc == 0x80 )
+            evex.w = test->mnemonic[4] == 'x';
         /* fall through */
     case ESZ_fp16:
         esz = 2;
@@ -1087,6 +1102,8 @@ void evex_disp8_test(void *instr, struct x86_emulate_ctxt *ctxt,
     RUN(avx512_vpopcntdq, all);
     RUN(avx512_fp16, all);
     RUN(avx512_fp16, 128);
+    RUN(avx512_bmm, all);
+    RUN(avx512_bmm, no128);
 
     if ( cpu_has_avx512f )
     {
diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index afe2e297d9..019c2ced8a 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -2140,6 +2140,9 @@ static const struct evex {
     { { 0x56 }, 2, T, R, pfx_f2, W0, Ln }, /* vfcmaddcph */
     { { 0x57 }, 2, T, R, pfx_f3, W0, LIG }, /* vfmaddcsh */
     { { 0x57 }, 2, T, R, pfx_f2, W0, LIG }, /* vfcmaddcsh */
+    { { 0x80 }, 2, T, R, pfx_no, W0, L1 | L2 }, /* vbmacor16x16x16 */
+    { { 0x80 }, 2, T, R, pfx_no, W1, L1 | L2 }, /* vbmacxor16x16x16 */
+    { { 0x81 }, 2, T, R, pfx_no, W0, Ln }, /* vbitrev */
     { { 0x96 }, 2, T, R, pfx_66, W0, Ln }, /* vfmaddsub132ph */
     { { 0x97 }, 2, T, R, pfx_66, W0, Ln }, /* vfmsubadd132ph */
     { { 0x98 }, 2, T, R, pfx_66, W0, Ln }, /* vfmadd132ph */
diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h
index 4c292ac338..62ebd881c9 100644
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -223,6 +223,8 @@ void wrpkru(unsigned int val);
 #define cpu_has_xop                 (cpu_policy.extd.xop  && xcr0_mask(6))
 #define cpu_has_fma4                (cpu_policy.extd.fma4 && xcr0_mask(6))
 #define cpu_has_tbm                  cpu_policy.extd.tbm
+#define cpu_has_avx512_bmm          (cpu_policy.extd.avx512_bmm && \
+                                     xcr0_mask(0xe6))
 
 int emul_test_cpuid(
     uint32_t leaf,
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 7ce97c4726..2fe77c4d8d 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -387,6 +387,7 @@ static const struct ext0f38_table {
     [0x7a ... 0x7c] = { .simd_size = simd_none, .two_op = 1 },
     [0x7d ... 0x7e] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
     [0x7f] = { .simd_size = simd_packed_fp, .d8s = d8s_vl },
+    [0x80 ... 0x81] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
     [0x82] = { .simd_size = simd_other },
     [0x83] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
     [0x88] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_dq },
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index 24c79c4e8f..dfdc263f9c 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -566,6 +566,7 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 #define vcpu_has_clzero()      (ctxt->cpuid->extd.clzero)
 #define vcpu_has_wbnoinvd()    (ctxt->cpuid->extd.wbnoinvd)
 #define vcpu_has_nscb()        (ctxt->cpuid->extd.nscb)
+#define vcpu_has_avx512_bmm()  (ctxt->cpuid->extd.avx512_bmm)
 
 #define vcpu_has_bmi1()        (ctxt->cpuid->feat.bmi1)
 #define vcpu_has_hle()         (ctxt->cpuid->feat.hle)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 7751a67130..11d145e177 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -7859,6 +7859,19 @@ x86_emulate(
         goto simd_zmm;
     }
 
+    case X86EMUL_OPC_EVEX(6, 0x80): /* vbmac{,x}or16x16x16 [xyz]mm/mem,[xyz]mm,[xyz]mm */
+        vcpu_must_have(avx512_bmm);
+        generate_exception_if(!evex.lr || evex.brs || evex.opmsk, X86_EXC_UD);
+        avx512_vlen_check(false);
+        goto simd_zmm;
+
+    case X86EMUL_OPC_EVEX(6, 0x81): /* vbitrev [xyz]mm/mem,[xyz]mm */
+        vcpu_must_have(avx512_bmm);
+        generate_exception_if(evex.w || evex.brs || evex.reg != 0xf || !evex.RX,
+                              X86_EXC_UD);
+        avx512_vlen_check(false);
+        goto simd_zmm;
+
     case X86EMUL_OPC_XOP(08, 0x85): /* vpmacssww xmm,xmm/m128,xmm,xmm */
     case X86EMUL_OPC_XOP(08, 0x86): /* vpmacsswd xmm,xmm/m128,xmm,xmm */
     case X86EMUL_OPC_XOP(08, 0x87): /* vpmacssdql xmm,xmm/m128,xmm,xmm */
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index 438acba4e2..ce4a7982a5 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -333,6 +333,7 @@ XEN_CPUFEATURE(CPUID_USER_DIS,     11*32+17) /*   CPUID disable for CPL > 0 soft
 XEN_CPUFEATURE(EPSF,               11*32+18) /*A  Enhanced Predictive Store Forwarding */
 XEN_CPUFEATURE(FSRSC,              11*32+19) /*A  Fast Short REP SCASB */
 XEN_CPUFEATURE(AMD_PREFETCHI,      11*32+20) /*A  PREFETCHIT{0,1} Instructions */
+XEN_CPUFEATURE(AVX512_BMM,         11*32+23) /*a  AVX512 Bitmap Manipulation Instructions */
 XEN_CPUFEATURE(SBPB,               11*32+27) /*A  Selective Branch Predictor Barrier */
 XEN_CPUFEATURE(IBPB_BRTYPE,        11*32+28) /*A  IBPB flushes Branch Type predictions too */
 XEN_CPUFEATURE(SRSO_NO,            11*32+29) /*A  Hardware not vulnerable to Speculative Return Stack Overflow */
diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index 13d85a4348..b751dbab27 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -307,7 +307,7 @@ def crunch_numbers(state):
         # dependents of AVX512BW (as to requiring wider than 16-bit mask
         # registers), despite the SDM not formally making this connection.
         AVX512BW: [AVX512_VBMI, AVX512_VBMI2, AVX512_BITALG, AVX512_BF16,
-                   AVX512_FP16],
+                   AVX512_FP16, AVX512_BMM],
 
         # Extensions with VEX/EVEX encodings keyed to a separate feature
         # flag are made dependents of their respective legacy feature.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:34:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276913.1562222 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAlmA-0000Vn-GF; Thu, 09 Apr 2026 09:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276913.1562222; Thu, 09 Apr 2026 09: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 1wAlmA-0000Vf-Df; Thu, 09 Apr 2026 09:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1276913;
 Thu, 09 Apr 2026 09:34:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAlm9-0000VY-6q
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:34:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAlm9-000KGb-1G
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAlm9-007PRI-0R
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0uxGmKVw5BxZ73EDQ7c4lyYyjlNQNexRyqkY2KK2maI=; b=dhiZzBgFFoh5/MslnlKDm4IByr
	If55PW24RqGGZtkICjidmgWIcURx8wiksLUi6K/DBwRXUdlOYVHbEGGTZ3BXVCkGWWZN8By7FxUha
	ptFvHqXIRhgjbZrcu5tVnfrFR8D4PHe1TrbQKQHOhcwo3HFYea+8MRREUpUVP6sAho44=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: Add myself as x86 reviewer
Message-Id: <E1wAlm9-007PRI-0R@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:34:13 +0000

commit a90d38d3501875034aea1268407589378217865c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 9 08:26:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:26:08 2026 +0200

    MAINTAINERS: Add myself as x86 reviewer
    
    I already started reviewing patches, but would like to
    be more active in that area.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 MAINTAINERS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1ac61da59a..77f72e52f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -225,6 +225,7 @@ M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
 M:	Roger Pau Monné <roger.pau@citrix.com>
 R:	Jason Andryuk <jason.andryuk@amd.com>
+R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
 F:	xen/drivers/passthrough/amd/
 
@@ -233,6 +234,7 @@ M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
 M:	Roger Pau Monné <roger.pau@citrix.com>
 R:	Jason Andryuk <jason.andryuk@amd.com>
+R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
 F:	xen/arch/x86/cpu/vpmu_amd.c
 F:	xen/arch/x86/hvm/svm/
@@ -613,6 +615,7 @@ X86 ARCHITECTURE
 M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
 M:	Roger Pau Monné <roger.pau@citrix.com>
+R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
 L:	xen-devel@lists.xenproject.org
 F:	xen/arch/x86/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:34:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276914.1562225 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAlmK-0000Xj-Ha; Thu, 09 Apr 2026 09:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276914.1562225; Thu, 09 Apr 2026 09: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 1wAlmK-0000Xb-F2; Thu, 09 Apr 2026 09:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1276914;
 Thu, 09 Apr 2026 09:34:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAlmJ-0000XV-9c
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:34:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAlmJ-000KGf-1X
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAlmJ-007PSH-0l
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VO+B9Q6OfyrTHnTo0skwhhxbEc2EX5W9FCEoLSM9/PQ=; b=EJnBzUnJgHV7X3ol64bNikusWN
	RrXpLetxAwBWbIdgApNZoysJr21yIXDL/NzthAlv1Qt9dzmjlzKA27mocJi11N3ezymshtWnbM2Q8
	951+ePI5tUduRv9Cx5LIwK1zeCkoPgg03o34uCgK91O4DMpPsClKO3B2ZyjLcCJXt/Qc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/emul: Remove ops->{read,write}_segment checks for swapgs
Message-Id: <E1wAlmJ-007PSH-0l@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:34:23 +0000

commit 98610a6c342d0b491f0466806e213975f2134bd3
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 9 08:26:27 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:26:27 2026 +0200

    x86/emul: Remove ops->{read,write}_segment checks for swapgs
    
    Remove these checks now that we don't use these 2 ops anymore.
    
    Amends: 4bedbe47eef4f ("x86/emul: Remove fallback path from SWAPGS")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/0f01.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 54bd6faf0f..4d36c7d289 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -187,8 +187,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xf8: /* swapgs */
         generate_exception_if(!mode_64bit(), X86_EXC_UD);
         generate_exception_if(!mode_ring0(), X86_EXC_GP, 0);
-        fail_if(!ops->read_segment || !ops->read_msr ||
-                !ops->write_segment || !ops->write_msr);
+        fail_if(!ops->read_msr || !ops->write_msr);
         if ( (rc = ops->read_msr(MSR_GS_BASE, &sreg.base,
                                  ctxt)) != X86EMUL_OKAY ||
              (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 09:34:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 09:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1276915.1562231 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAlmU-0000bX-Jd; Thu, 09 Apr 2026 09:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1276915.1562231; Thu, 09 Apr 2026 09: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 1wAlmU-0000bP-GM; Thu, 09 Apr 2026 09:34:34 +0000
Received: by outflank-mailman (input) for mailman id 1276915;
 Thu, 09 Apr 2026 09:34:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAlmT-0000bI-CN
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 09:34:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAlmT-000KGj-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAlmT-007PSo-13
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U2lc/O2lr2UkihLDoi4FFSFBwqadlHCOV9JLZflvohE=; b=rNfPV78cYTWuk5ALqQypOJQbtY
	N3BtfqejMcaG3SlWo5cDJFFVO+LjL/p5EREUxDu/xT2qT8QloLQXaDywEtisNa0M5ikq6GgDgRUjU
	KwD5tSdrktzqRqpI2kYCWjIend/VyKQJKL/teMA5niW54MHaObEyioh0ELJ4Tb+dbF6c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: use / "support" UDB
Message-Id: <E1wAlmT-007PSo-13@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 09:34:33 +0000

commit 1f3dd605eab1770ee9f9359690eff61adca17c33
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 9 08:27:47 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:27:47 2026 +0200

    x86: use / "support" UDB
    
    With opcode D6h now firmly reserved as another #UD-raising one in 64-bit
    mode, use that instead of the two-byte UD2 for bug frame marking.
    
    While there also make a minor adjustment to the emulator.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/bug.h    | 4 ++--
 xen/arch/x86/traps.c              | 6 +++---
 xen/arch/x86/x86_emulate/decode.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/include/asm/bug.h b/xen/arch/x86/include/asm/bug.h
index 3a4f41e380..211b480f26 100644
--- a/xen/arch/x86/include/asm/bug.h
+++ b/xen/arch/x86/include/asm/bug.h
@@ -21,7 +21,7 @@
 
 #ifndef __ASSEMBLER__
 
-#define BUG_INSTR       "ud2"
+#define BUG_INSTR       ".byte 0xd6" /* UDB, requiring gas 2.46 */
 #define BUG_ASM_CONST   "c"
 
 #else  /* !__ASSEMBLER__ */
@@ -37,7 +37,7 @@
         .error "Invalid BUGFRAME index"
     .endif
 
-    .L\@ud: ud2a
+    .L\@ud: .byte 0xd6 /* UDB, requiring gas 2.46 */
 
     .pushsection .rodata.str1, "aMS", @progbits, 1
          .L\@s1: .asciz "\file_str"
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8aa1e4181b..855147d7f3 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1338,7 +1338,7 @@ void asmlinkage do_trap(struct cpu_user_regs *regs)
 
 void asmlinkage do_invalid_op(struct cpu_user_regs *regs)
 {
-    u8 bug_insn[2];
+    uint8_t bug_insn;
     const void *eip = (const void *)regs->rip;
     int id;
 
@@ -1350,8 +1350,8 @@ void asmlinkage do_invalid_op(struct cpu_user_regs *regs)
     }
 
     if ( !is_active_kernel_text(regs->rip) ||
-         copy_from_unsafe(bug_insn, eip, sizeof(bug_insn)) ||
-         memcmp(bug_insn, "\xf\xb", sizeof(bug_insn)) )
+         copy_from_unsafe(&bug_insn, eip, sizeof(bug_insn)) ||
+         bug_insn != 0xd6 /* UDB */ )
         goto die;
 
     id = do_bug_frame(regs, regs->rip);
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 2fe77c4d8d..346777422b 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -652,7 +652,7 @@ decode_onebyte(struct x86_emulate_state *s,
     case 0xce: /* into */
     case 0xd4: /* aam */
     case 0xd5: /* aad */
-    case 0xd6: /* salc */
+    case 0xd6: /* salc / udb */
         s->not_64bit = true;
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277302.1562513 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAouV-0004RQ-KL; Thu, 09 Apr 2026 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277302.1562513; Thu, 09 Apr 2026 12:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAouV-0004RI-Hd; Thu, 09 Apr 2026 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1277302;
 Thu, 09 Apr 2026 12:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAouU-0004RA-O6
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAouU-000OZx-26
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAouU-007iBk-1H
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xIjws98GiQ002jqUWKswQHNKgVXrQjEKrp0xQ3ZXHh0=; b=okgJbHxV7izo7y4rCEkikkgW9C
	gMBKDqWQA5coJxE8K5Uww30MdYsXKJPn/1vwEhCE1UqDO9K2ZiQqiyQKEHBZWaKM/l4HzqpYppLdk
	iyoycSx6bcDNQCDy68C8yk/tq3Y/wbLaV3xXLireqruCW22xQocY/T/Dqx8i+7WjJ1JE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Reject CPU policies with vendors other than the host's
Message-Id: <E1wAouU-007iBk-1H@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:55:02 +0000

commit c520286a5380b0133213b53480fb2a4c2d631fc4
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:22:36 2026 +0200

    x86: Reject CPU policies with vendors other than the host's
    
    While in principle it's possible to have a vendor virtualising another,
    this is fairly tricky in practice and comes with the world's supply of
    security issues.
    
    Reject any CPU policy with vendors not matching the host's.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # CHANGELOG.md
---
 CHANGELOG.md                             |  6 ++++++
 tools/tests/cpu-policy/test-cpu-policy.c | 27 +++++++++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/policy.c     |  5 ++++-
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 166df43c63..47b6021ce7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
+   - Cross-vendor support; guests can now only be configured as the same
+     vendor as the host CPU.  When added back in 2009, with enough trickery
+     Intel and AMD CPUs could be made to be compatible enough to live migrate
+     a guest, but the vendors have been diverging since then in ways that Xen
+     cannot compensate for, and the advent of speculative security issues has
+     put to rest any possibility of this being a viable option.
 
  - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
    anything useful outside of x86.
diff --git a/tools/tests/cpu-policy/test-cpu-policy.c b/tools/tests/cpu-policy/test-cpu-policy.c
index 301df2c002..88a9a26e8f 100644
--- a/tools/tests/cpu-policy/test-cpu-policy.c
+++ b/tools/tests/cpu-policy/test-cpu-policy.c
@@ -586,6 +586,19 @@ static void test_is_compatible_success(void)
                 .platform_info.cpuid_faulting = true,
             },
         },
+        {
+            .name = "Host CPU vendor == Guest CPU vendor (both unknown)",
+            .host = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 1,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+            .guest = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 1,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+        },
     };
     struct cpu_policy_errors no_errors = INIT_CPU_POLICY_ERRORS;
 
@@ -629,6 +642,20 @@ static void test_is_compatible_failure(void)
             },
             .e = { -1, -1, 0xce },
         },
+        {
+            .name = "Host CPU vendor != Guest CPU vendor (both unknown)",
+            .host = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 1,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+            .guest = {
+                .basic.vendor_ebx = X86_VENDOR_AMD_EBX + 2,
+                .basic.vendor_ecx = X86_VENDOR_AMD_ECX,
+                .basic.vendor_edx = X86_VENDOR_AMD_EDX,
+            },
+            .e = { 0, -1, -1 },
+        },
     };
 
     printf("Testing policy compatibility failure:\n");
diff --git a/xen/arch/x86/lib/cpu-policy/policy.c b/xen/arch/x86/lib/cpu-policy/policy.c
index f033d22785..f991b1f3a9 100644
--- a/xen/arch/x86/lib/cpu-policy/policy.c
+++ b/xen/arch/x86/lib/cpu-policy/policy.c
@@ -15,7 +15,10 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
 #define FAIL_MSR(m) \
     do { e.msr = (m); goto out; } while ( 0 )
 
-    if ( guest->basic.max_leaf > host->basic.max_leaf )
+    if ( (guest->basic.vendor_ebx != host->basic.vendor_ebx) ||
+         (guest->basic.vendor_ecx != host->basic.vendor_ecx) ||
+         (guest->basic.vendor_edx != host->basic.vendor_edx) ||
+         (guest->basic.max_leaf   >  host->basic.max_leaf) )
         FAIL_CPUID(0, NA);
 
     if ( guest->feat.max_subleaf > host->feat.max_subleaf )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277303.1562516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAouf-0004Tq-Lq; Thu, 09 Apr 2026 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277303.1562516; Thu, 09 Apr 2026 12:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAouf-0004Ti-J8; Thu, 09 Apr 2026 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1277303;
 Thu, 09 Apr 2026 12:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAoue-0004TD-JD
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAoue-000Oa1-2U
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAoue-007iCT-1e
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B0/ZvaFo5FUSAQVVJZXyTnd2mkG7FcMouGJCgukaFVk=; b=brCp/Kyfdia+yjZMJxSw1jupdT
	tu9Y/ZfLXwdrj77DySJfJNugL73Hh8sw3O8KZ9hMQF93IQwczndgBfv2VNMv79/FTIIOOM0mpH2YQ
	xPDstXLWM9ImTRdNBfHe67aXGat40ZEPoVPHkJYiFwpX2zjjmQesFI8RwudmfbzIc+x8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Disable cross-vendor handling in #UD handler
Message-Id: <E1wAoue-007iCT-1e@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:55:12 +0000

commit e39e473188ccc60ed10b444dff0cc73648d4e7ad
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:11 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:22:52 2026 +0200

    x86/hvm: Disable cross-vendor handling in #UD handler
    
    Remove cross-vendor support now that VMs can no longer have a different
    vendor than the host.
    
    No functional change intended.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c     | 19 ++-----------------
 xen/arch/x86/hvm/svm/svm.c |  3 +--
 xen/arch/x86/hvm/vmx/vmx.c |  3 +--
 3 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 11e9b2bc88..4a81afce02 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3829,28 +3829,13 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
     return X86EMUL_OKAY;
 }
 
-static bool cf_check is_cross_vendor(
-    const struct x86_emulate_state *state, const struct x86_emulate_ctxt *ctxt)
-{
-    switch ( ctxt->opcode )
-    {
-    case X86EMUL_OPC(0x0f, 0x05): /* syscall */
-    case X86EMUL_OPC(0x0f, 0x34): /* sysenter */
-    case X86EMUL_OPC(0x0f, 0x35): /* sysexit */
-        return true;
-    }
-
-    return false;
-}
-
 void hvm_ud_intercept(struct cpu_user_regs *regs)
 {
     struct vcpu *cur = current;
-    bool should_emulate =
-        cur->domain->arch.cpuid->x86_vendor != boot_cpu_data.x86_vendor;
+    bool should_emulate = false;
     struct hvm_emulate_ctxt ctxt;
 
-    hvm_emulate_init_once(&ctxt, opt_hvm_fep ? NULL : is_cross_vendor, regs);
+    hvm_emulate_init_once(&ctxt, NULL, regs);
 
     if ( opt_hvm_fep )
     {
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 2546705d24..d4502d3c0f 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -543,8 +543,7 @@ static void cf_check svm_cpuid_policy_changed(struct vcpu *v)
     const struct cpu_policy *cp = v->domain->arch.cpu_policy;
     u32 bitmap = vmcb_get_exception_intercepts(vmcb);
 
-    if ( opt_hvm_fep ||
-         (v->domain->arch.cpuid->x86_vendor != boot_cpu_data.x86_vendor) )
+    if ( opt_hvm_fep )
         bitmap |= (1U << X86_EXC_UD);
     else
         bitmap &= ~(1U << X86_EXC_UD);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 03daf2f52b..269ca56433 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -802,8 +802,7 @@ static void cf_check vmx_cpuid_policy_changed(struct vcpu *v)
     const struct cpu_policy *cp = v->domain->arch.cpu_policy;
     int rc = 0;
 
-    if ( opt_hvm_fep ||
-         (v->domain->arch.cpuid->x86_vendor != boot_cpu_data.x86_vendor) )
+    if ( opt_hvm_fep )
         v->arch.hvm.vmx.exception_bitmap |= (1U << X86_EXC_UD);
     else
         v->arch.hvm.vmx.exception_bitmap &= ~(1U << X86_EXC_UD);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277304.1562521 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAoup-0004W2-NH; Thu, 09 Apr 2026 12:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277304.1562521; Thu, 09 Apr 2026 12:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAoup-0004Vu-KW; Thu, 09 Apr 2026 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1277304;
 Thu, 09 Apr 2026 12:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAouo-0004Vo-MS
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAouo-000Oa5-2m
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAouo-007iDC-1y
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WYIIW5r0y1uIb5X3AEFO6Pl1vZCdaZaWCC+4x1VAMBg=; b=tMrBTCpPeLnUiEhVeRoZtheBOp
	MADBn8bMI4z11yTlompSHIOWGiNXU+P0GoTLrXAJ9vb5T6k5U+TtW73rTg7N04niuNdrN6vOERZVP
	2wxaZHXtPGo0sf2hNSKr/Qpq43XG0YOrr0IPKKQJDdIvBE8zmAL+LoA4PhYekh4xVHOI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Remove cross-vendor checks from MSR handlers.
Message-Id: <E1wAouo-007iDC-1y@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:55:22 +0000

commit f2dc22e6320e0ef0348c4e31717a2f0bbde31756
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:23:05 2026 +0200

    x86/hvm: Remove cross-vendor checks from MSR handlers.
    
    Not a functional change now that cross-vendor guests are not launchable.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msr.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 6a97be59d5..d10891dcfc 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -169,9 +169,9 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
         break;
 
     case MSR_IA32_PLATFORM_ID:
-        if ( !(cp->x86_vendor & X86_VENDOR_INTEL) ||
-             !(boot_cpu_data.vendor & X86_VENDOR_INTEL) )
+        if ( boot_cpu_data.vendor != X86_VENDOR_INTEL )
             goto gp_fault;
+
         rdmsrl(MSR_IA32_PLATFORM_ID, *val);
         break;
 
@@ -189,9 +189,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
          * from Xen's last microcode load, which can be forwarded straight to
          * the guest.
          */
-        if ( !(cp->x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
-             !(boot_cpu_data.vendor &
-               (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
+        if ( !(boot_cpu_data.vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD)) ||
              rdmsr_safe(MSR_AMD_PATCHLEVEL, val) )
             goto gp_fault;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277305.1562525 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAouz-0004Y8-OS; Thu, 09 Apr 2026 12:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277305.1562525; Thu, 09 Apr 2026 12:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAouz-0004Y0-Lr; Thu, 09 Apr 2026 12:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1277305;
 Thu, 09 Apr 2026 12:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAouy-0004Xs-P1
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAouy-000OaA-35
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAouy-007iDm-2I
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SsNawaM7tFJiDCrk3VZsjVZmazbUBS7PZTgZzolLmX8=; b=orMZHrDI6VuFMTw05pjDnB6tnI
	DIQVlesVNsUfQIbO3vPKIhA6ReTE6KLlcL1CqjPy+GhRcQ3HMZvvRtH/jMqTcdhFpurV5N0boINy5
	YzoOsrHjOCDqJ74gEVKVW2SbJ8Rqqu9iqYkLixxH9+Y8qeZyZi5kgFjF1v4vOTdII6Bo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Drop emulation of Intel's SYSENTER MSR behaviour
Message-Id: <E1wAouy-007iDm-2I@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:55:32 +0000

commit fc30191a6a5ff805bcef767d5b3ae5022b41c4d5
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Mar 12 12:21:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:23:17 2026 +0200

    x86/svm: Drop emulation of Intel's SYSENTER MSR behaviour
    
    With cross-vendor support gone, it's no longer needed.
    
    AMD CPUs ignore the top 32 bits of the SYSENTER/SYSEXIT MSRs, which is
    not how this emulation worked due to the need for cross-vendor support.
    Any AMD VMs storing state in the top 32bits of the SEP MSRs will lose
    it.
    
    It's very unlikely to affect any production VM because having 64bit width
    just isn't how real AMD CPUs behave.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/svm.c               | 42 +++++++++++++++-----------------
 xen/arch/x86/hvm/svm/vmcb.c              |  3 +++
 xen/arch/x86/include/asm/hvm/svm-types.h | 10 --------
 3 files changed, 22 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index d4502d3c0f..ced6166847 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -355,10 +355,6 @@ static int svm_vmcb_save(struct vcpu *v, struct hvm_hw_cpu *c)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
-    c->sysenter_cs = v->arch.hvm.svm.guest_sysenter_cs;
-    c->sysenter_esp = v->arch.hvm.svm.guest_sysenter_esp;
-    c->sysenter_eip = v->arch.hvm.svm.guest_sysenter_eip;
-
     if ( vmcb->event_inj.v &&
          hvm_event_needs_reinjection(vmcb->event_inj.type,
                                      vmcb->event_inj.vector) )
@@ -422,11 +418,6 @@ static int svm_vmcb_restore(struct vcpu *v, struct hvm_hw_cpu *c)
     svm_update_guest_cr(v, 0, 0);
     svm_update_guest_cr(v, 4, 0);
 
-    /* Load sysenter MSRs into both VMCB save area and VCPU fields. */
-    vmcb->sysenter_cs = v->arch.hvm.svm.guest_sysenter_cs = c->sysenter_cs;
-    vmcb->sysenter_esp = v->arch.hvm.svm.guest_sysenter_esp = c->sysenter_esp;
-    vmcb->sysenter_eip = v->arch.hvm.svm.guest_sysenter_eip = c->sysenter_eip;
-
     if ( paging_mode_hap(v->domain) )
     {
         vmcb_set_np(vmcb, true);
@@ -455,6 +446,9 @@ static void svm_save_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
+    data->sysenter_cs      = vmcb->sysenter_cs;
+    data->sysenter_esp     = vmcb->sysenter_esp;
+    data->sysenter_eip     = vmcb->sysenter_eip;
     data->shadow_gs        = vmcb->kerngsbase;
     data->msr_lstar        = vmcb->lstar;
     data->msr_star         = vmcb->star;
@@ -466,11 +460,14 @@ static void svm_load_cpu_state(struct vcpu *v, struct hvm_hw_cpu *data)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
-    vmcb->kerngsbase = data->shadow_gs;
-    vmcb->lstar      = data->msr_lstar;
-    vmcb->star       = data->msr_star;
-    vmcb->cstar      = data->msr_cstar;
-    vmcb->sfmask     = data->msr_syscall_mask;
+    vmcb->lstar        = data->msr_lstar;
+    vmcb->star         = data->msr_star;
+    vmcb->cstar        = data->msr_cstar;
+    vmcb->sfmask       = data->msr_syscall_mask;
+    vmcb->kerngsbase   = data->shadow_gs;
+    vmcb->sysenter_cs  = data->sysenter_cs;
+    vmcb->sysenter_esp = data->sysenter_esp;
+    vmcb->sysenter_eip = data->sysenter_eip;
     v->arch.hvm.guest_efer = data->msr_efer;
     svm_update_guest_efer(v);
 }
@@ -1663,12 +1660,9 @@ static int cf_check svm_msr_read_intercept(
 
     switch ( msr )
     {
-        /*
-         * Sync not needed while the cross-vendor logic is in unilateral effect.
     case MSR_IA32_SYSENTER_CS:
     case MSR_IA32_SYSENTER_ESP:
     case MSR_IA32_SYSENTER_EIP:
-         */
     case MSR_STAR:
     case MSR_LSTAR:
     case MSR_CSTAR:
@@ -1683,13 +1677,15 @@ static int cf_check svm_msr_read_intercept(
     switch ( msr )
     {
     case MSR_IA32_SYSENTER_CS:
-        *msr_content = v->arch.hvm.svm.guest_sysenter_cs;
+        *msr_content = vmcb->sysenter_cs;
         break;
+
     case MSR_IA32_SYSENTER_ESP:
-        *msr_content = v->arch.hvm.svm.guest_sysenter_esp;
+        *msr_content = vmcb->sysenter_esp;
         break;
+
     case MSR_IA32_SYSENTER_EIP:
-        *msr_content = v->arch.hvm.svm.guest_sysenter_eip;
+        *msr_content = vmcb->sysenter_eip;
         break;
 
     case MSR_STAR:
@@ -1883,11 +1879,11 @@ static int cf_check svm_msr_write_intercept(
         switch ( msr )
         {
         case MSR_IA32_SYSENTER_ESP:
-            vmcb->sysenter_esp = v->arch.hvm.svm.guest_sysenter_esp = msr_content;
+            vmcb->sysenter_esp = msr_content;
             break;
 
         case MSR_IA32_SYSENTER_EIP:
-            vmcb->sysenter_eip = v->arch.hvm.svm.guest_sysenter_eip = msr_content;
+            vmcb->sysenter_eip = msr_content;
             break;
 
         case MSR_LSTAR:
@@ -1913,7 +1909,7 @@ static int cf_check svm_msr_write_intercept(
         break;
 
     case MSR_IA32_SYSENTER_CS:
-        vmcb->sysenter_cs = v->arch.hvm.svm.guest_sysenter_cs = msr_content;
+        vmcb->sysenter_cs = msr_content;
         break;
 
     case MSR_STAR:
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 5ed7123d9a..514e530cbd 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -97,6 +97,9 @@ static int construct_vmcb(struct vcpu *v)
     svm_disable_intercept_for_msr(v, MSR_LSTAR);
     svm_disable_intercept_for_msr(v, MSR_STAR);
     svm_disable_intercept_for_msr(v, MSR_SYSCALL_MASK);
+    svm_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
+    svm_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
+    svm_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
 
     vmcb->_msrpm_base_pa = virt_to_maddr(svm->msrpm);
     vmcb->_iopm_base_pa = __pa(v->domain->arch.hvm.io_bitmap);
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index 3ede62cade..8acadb9dcc 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -27,16 +27,6 @@ struct svm_vcpu {
 
     /* VMCB has a cached instruction from #PF/#NPF Decode Assist? */
     uint8_t cached_insn_len; /* Zero if no cached instruction. */
-
-    /*
-     * Upper four bytes are undefined in the VMCB, therefore we can't use the
-     * fields in the VMCB. Write a 64bit value and then read a 64bit value is
-     * fine unless there's a VMRUN/VMEXIT in between which clears the upper
-     * four bytes.
-     */
-    uint64_t guest_sysenter_cs;
-    uint64_t guest_sysenter_esp;
-    uint64_t guest_sysenter_eip;
 };
 
 struct nestedsvm {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277306.1562528 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAov9-0004a4-Q1; Thu, 09 Apr 2026 12:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277306.1562528; Thu, 09 Apr 2026 12:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAov9-0004Zw-NH; Thu, 09 Apr 2026 12:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1277306;
 Thu, 09 Apr 2026 12:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAov8-0004Zq-Tw
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAov9-000Ocb-0J
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAov8-007iGi-2Z
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MU5auVFsZqxfQH/WmiPzAAw4nFM/9sXI1jznGc1xsQ0=; b=KJ71djRdRIAljcPOz67SeK+3Ym
	SsnkuRCIklMJ6V5/yGUTqsBhiPGhzEJ4g4Aan6yuj1aEgF7BaWuiCPTTzC7jd4Pd/O/pZkucb810h
	WPvi/OY7hTIP3gyBUBwcdJwyE+hnyU/Iwwm62eskdo5LCLkhjLm9pp+YW15KPiQZjpMI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add exception table support
Message-Id: <E1wAov8-007iGi-2Z@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:55:42 +0000

commit a651dabf873d28692f1e4c2e57a3c47b560a16c4
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Mar 31 21:04:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:23:32 2026 +0200

    xen/riscv: add exception table support
    
    Introduce exception table handling for RISC-V so faults from selected
    instructions can be recovered via fixup handlers instead of being
    treated as fatal.
    
    Add the RISC-V exception table format, sorting at boot to allow binary
    search used furthuer, and lookup from the trap handler. Update the
    linker script to emit the .ex_table section using introduced common
    EX_TABLE macro shared with other architectures.
    
    Also, reduce __start___ex_table alignment from 8 to 4 bytes to
    match the natural alignment of struct exception_table_entry,
    which contains two int32_t fields.
    
    Add inclusion of asm/extable.h to asm/bug.h to deal with compilation
    issue of common/virtual_region.c, which require declaration of
    __start___ex_table and __stop___ex_table.
    
    This implementation is based on Linux 6.16.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Kconfig               |  1 +
 xen/arch/riscv/Makefile              |  1 +
 xen/arch/riscv/extable.c             | 84 ++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/bug.h     |  2 +
 xen/arch/riscv/include/asm/extable.h | 58 +++++++++++++++++++++++++
 xen/arch/riscv/setup.c               |  3 ++
 xen/arch/riscv/traps.c               |  5 +++
 xen/arch/riscv/xen.lds.S             |  3 ++
 xen/arch/x86/xen.lds.S               |  6 +--
 xen/include/xen/xen.lds.h            |  6 +++
 10 files changed, 164 insertions(+), 5 deletions(-)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 89876b3217..a5e87c1757 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -4,6 +4,7 @@ config RISCV
 	select GENERIC_BUG_FRAME
 	select GENERIC_UART_INIT
 	select HAS_DEVICE_TREE_DISCOVERY
+	select HAS_EX_TABLE
 	select HAS_PMAP
 	select HAS_UBSAN
 	select HAS_VMAP
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index ffbd7062e2..04f02ad89c 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -3,6 +3,7 @@ obj-y += cpufeature.o
 obj-y += domain.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
+obj-y += extable.o
 obj-y += imsic.o
 obj-y += intc.o
 obj-y += irq.o
diff --git a/xen/arch/riscv/extable.c b/xen/arch/riscv/extable.c
new file mode 100644
index 0000000000..77e5e9e894
--- /dev/null
+++ b/xen/arch/riscv/extable.c
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/init.h>
+#include <xen/bsearch.h>
+#include <xen/lib.h>
+#include <xen/livepatch.h>
+#include <xen/sort.h>
+#include <xen/virtual_region.h>
+
+#include <asm/extable.h>
+#include <asm/processor.h>
+
+#define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
+
+static inline unsigned long ex_insn(const struct exception_table_entry *ex)
+{
+    return EX_FIELD(ex, insn);
+}
+
+static inline unsigned long ex_fixup(const struct exception_table_entry *ex)
+{
+    return EX_FIELD(ex, fixup);
+}
+
+static void __init cf_check swap_ex(void *a, void *b)
+{
+    struct exception_table_entry *x = a, *y = b, tmp;
+    long delta = b - a;
+
+    tmp = *x;
+    x->insn = y->insn + delta;
+    y->insn = tmp.insn - delta;
+
+    x->fixup = y->fixup + delta;
+    y->fixup = tmp.fixup - delta;
+}
+
+static int cf_check cmp_ex(const void *a, const void *b)
+{
+    const unsigned long insn_a = ex_insn(a);
+    const unsigned long insn_b = ex_insn(b);
+
+    return (insn_a > insn_b) - (insn_a < insn_b);
+}
+
+void init_or_livepatch sort_exception_table(struct exception_table_entry *start,
+                                 const struct exception_table_entry *stop)
+{
+    sort(start, stop - start, sizeof(*start), cmp_ex, swap_ex);
+}
+
+void __init sort_exception_tables(void)
+{
+    sort_exception_table(__start___ex_table, __stop___ex_table);
+}
+
+static void ex_handler_fixup(const struct exception_table_entry *ex,
+                             struct cpu_user_regs *regs)
+{
+    regs->sepc = ex_fixup(ex);
+}
+
+bool fixup_exception(struct cpu_user_regs *regs)
+{
+    unsigned long pc = regs->sepc;
+    const struct virtual_region *region = find_text_region(pc);
+    const struct exception_table_entry *ex;
+    struct exception_table_entry key;
+
+    if ( !region || !region->ex )
+        return false;
+
+    key.insn = pc - (unsigned long)&key.insn;
+
+    ex = bsearch(&key, region->ex, region->ex_end - region->ex, sizeof(key),
+                 cmp_ex);
+
+    if ( !ex )
+        return false;
+
+    ex_handler_fixup(ex, regs);
+
+    return true;
+}
diff --git a/xen/arch/riscv/include/asm/bug.h b/xen/arch/riscv/include/asm/bug.h
index 6ec8adc528..e6f2868816 100644
--- a/xen/arch/riscv/include/asm/bug.h
+++ b/xen/arch/riscv/include/asm/bug.h
@@ -9,6 +9,8 @@
 
 #ifndef __ASSEMBLER__
 
+#include <asm/extable.h>
+
 #define BUG_INSTR "unimp"
 
 /*
diff --git a/xen/arch/riscv/include/asm/extable.h b/xen/arch/riscv/include/asm/extable.h
new file mode 100644
index 0000000000..c0128a9181
--- /dev/null
+++ b/xen/arch/riscv/include/asm/extable.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef ASM__RISCV__ASM_EXTABLE_H
+#define ASM__RISCV__ASM_EXTABLE_H
+
+#ifdef __ASSEMBLER__
+
+#define ASM_EXTABLE(insn, fixup) \
+    .pushsection .ex_table, "a"; \
+    .balign     4;               \
+    .word       (insn) - .;      \
+    .word       (fixup) - .;     \
+    .popsection
+
+.macro asm_extable, insn, fixup
+    ASM_EXTABLE(\insn, \fixup)
+.endm
+
+#else /* __ASSEMBLER__ */
+
+#include <xen/stringify.h>
+#include <xen/types.h>
+
+struct cpu_user_regs;
+
+#define ASM_EXTABLE(insn, fixup)      \
+    ".pushsection .ex_table, \"a\"\n" \
+    ".balign    4\n"                  \
+    ".word      (" #insn " - .)\n"    \
+    ".word      (" #fixup " - .)\n"   \
+    ".popsection\n"
+
+/*
+ * The exception table consists of pairs of relative offsets: the first
+ * is the relative offset to an instruction that is allowed to fault,
+ * and the second is the relative offset at which the program should
+ * continue. No general-purpose registers are modified by the exception
+ * handling mechanism itself, so it is up to the fixup code to handle
+ * any necessary state cleanup.
+ *
+ * The exception table and fixup code live out of line with the main
+ * instruction path. This means when everything is well, we don't even
+ * have to jump over them. Further, they do not intrude on our cache or
+ * tlb entries.
+ */
+struct exception_table_entry {
+    int32_t insn, fixup;
+};
+
+extern struct exception_table_entry __start___ex_table[];
+extern struct exception_table_entry __stop___ex_table[];
+
+void sort_exception_tables(void);
+bool fixup_exception(struct cpu_user_regs *regs);
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* ASM__RISCV__ASM_EXTABLE_H */
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index cae49bb296..56a0907a85 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -19,6 +19,7 @@
 
 #include <public/version.h>
 
+#include <asm/extable.h>
 #include <asm/cpufeature.h>
 #include <asm/early_printk.h>
 #include <asm/fixmap.h>
@@ -81,6 +82,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     smp_prepare_boot_cpu();
 
+    sort_exception_tables();
+
     set_cpuid_to_hartid(0, bootcpu_id);
 
     trap_init();
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 326f2be628..d35c013e13 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -12,6 +12,7 @@
 #include <xen/sched.h>
 #include <xen/softirq.h>
 
+#include <asm/extable.h>
 #include <asm/cpufeature.h>
 #include <asm/intc.h>
 #include <asm/processor.h>
@@ -217,6 +218,10 @@ void do_trap(struct cpu_user_regs *cpu_regs)
 
             break;
         }
+
+        if ( fixup_exception(cpu_regs) )
+            break;
+
         fallthrough;
     default:
         if ( cause & CAUSE_IRQ_FLAG )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 331a7d63d3..65f136dce9 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -74,6 +74,9 @@ SECTIONS
     .data.ro_after_init : {
         __ro_after_init_start = .;
         *(.data.ro_after_init)
+
+        EX_TABLE
+
         . = ALIGN(PAGE_SIZE);
         __ro_after_init_end = .;
     } : text
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index c326538ebb..b9e888e596 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -113,11 +113,7 @@ SECTIONS
        __ro_after_init_start = .;
        *(.data.ro_after_init)
 
-       . = ALIGN(8);
-       /* Exception table */
-       __start___ex_table = .;
-       *(.ex_table)
-       __stop___ex_table = .;
+       EX_TABLE
 
        . = ALIGN(PAGE_SIZE);
        __ro_after_init_end = .;
diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index 136849ecd5..ea11e3fb62 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -219,4 +219,10 @@
 #define VPCI_ARRAY
 #endif
 
+#define EX_TABLE                  \
+        . = ALIGN(4);             \
+        __start___ex_table = .;   \
+        *(.ex_table)              \
+        __stop___ex_table = .;
+
 #endif /* __XEN_LDS_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:55:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277307.1562532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAovJ-0004co-TT; Thu, 09 Apr 2026 12:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277307.1562532; Thu, 09 Apr 2026 12: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 1wAovJ-0004ch-Qt; Thu, 09 Apr 2026 12:55:53 +0000
Received: by outflank-mailman (input) for mailman id 1277307;
 Thu, 09 Apr 2026 12:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAovJ-0004cR-1z
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:55:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovJ-000Ocn-0k
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovI-007iHK-31
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XhylNAalhfKLPTQtOXQ7gahGwDPHGNyWI9hwUK7+Dyw=; b=qtYcgBzvrLDfox9xxHH0sGHUYK
	OQ7Yq70SnSmXQ/N9O2OWTFT++FR+8rCtyC6aQp/HmYZ3dpcXxiSzNJJInVOc6GB9QLbb6uez0uUYi
	rOB4lMFZfLPSP7bN8eaKZQydut5sLYb0ItLHnQ8w0ETc9GHf9rsDFuT38uo+Wl5Dj1eE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add csr_read_safe() helper
Message-Id: <E1wAovI-007iHK-31@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:55:52 +0000

commit 889c68b648ebb1b75a9fa3d780960e53c110d0bc
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Mar 31 21:04:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:24:01 2026 +0200

    xen/riscv: add csr_read_safe() helper
    
    Accessing some CSRs may trap when the corresponding extension is not
    implemented or enabled. Introduce csr_read_safe() which attempts to
    read a CSR and relies on the exception table mechanism to safely recover
    if the access faults.
    
    This helper allows Xen to probe CSR availability without taking a fatal
    trap and will be used for feature detection during early boot as we
    can't always rely on what is in riscv,isa string in DTS.
    
    While touching the header, reorder the include directives to follow the
    usual Xen style.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/csr.h | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/include/asm/csr.h b/xen/arch/riscv/include/asm/csr.h
index 01876f8289..27d4b7942f 100644
--- a/xen/arch/riscv/include/asm/csr.h
+++ b/xen/arch/riscv/include/asm/csr.h
@@ -6,8 +6,10 @@
 #ifndef ASM__RISCV__CSR_H
 #define ASM__RISCV__CSR_H
 
-#include <asm/asm.h>
 #include <xen/const.h>
+
+#include <asm/asm.h>
+#include <asm/extable.h>
 #include <asm/riscv_encoding.h>
 
 #ifndef __ASSEMBLER__
@@ -78,6 +80,37 @@
                            : "memory" );                        \
 })
 
+static always_inline bool csr_read_safe(unsigned long csr,
+                                        unsigned long *val)
+{
+#ifdef CONFIG_CC_HAS_ASM_GOTO_OUTPUT
+    asm_inline goto (
+        "1: csrr %[val], %[csr]\n"
+        ASM_EXTABLE(1b, %l[fault])
+        : [val] "=r" (*val)
+        : [csr] "i" (csr)
+        :
+        : fault );
+
+    return true;
+
+ fault:
+    return false;
+#else
+    bool allowed = false;
+
+    asm_inline volatile (
+        "1: csrr %[val], %[csr]\n"
+        "   li %[allowed], 1\n"
+        "2:\n"
+        ASM_EXTABLE(1b, 2b)
+        : [val] "=&r" (*val), [allowed] "+r" (allowed)
+        : [csr] "i" (csr) );
+
+    return allowed;
+#endif
+}
+
 #endif /* __ASSEMBLER__ */
 
 #endif /* ASM__RISCV__CSR_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:56:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277308.1562537 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAovT-0004en-Uz; Thu, 09 Apr 2026 12:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277308.1562537; Thu, 09 Apr 2026 12: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 1wAovT-0004ed-SI; Thu, 09 Apr 2026 12:56:03 +0000
Received: by outflank-mailman (input) for mailman id 1277308;
 Thu, 09 Apr 2026 12:56:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAovT-0004eX-54
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:56:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovT-000OdL-15
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovT-007iIS-0J
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lNmL3/DIVcPEN32ngyPtj5avUGZJ+dnRNR+Yxl8qwHs=; b=KQ6nBFDEjYu5FDlu7/AMAOb/Tl
	0YE0jL20d/3u0ZFMGo1qHTJs6lqZlBlADT0Prs8ObGhYgkIhF/2GWj8Xd/0rJan2qNU1Irr3tH8f8
	5lxRLdhfjXJqqmXtvdzqp/kfRI6UPb63dS8IqSaxwXkC7s1WIdGJ2lNautIfQ4WeQJBE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: support AVX512-BMM
Message-Id: <E1wAovT-007iIS-0J@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:56:03 +0000

commit ea3d4312f7f34451a360a1a65162f220e329aeb3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 9 08:25:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:25:25 2026 +0200

    x86emul: support AVX512-BMM
    
    EVEX.W meaning is unusual for VBMAC{,X}OR16x16x16, but that needs taking
    care of only in the test harness.
    
    Like already proposed in "x86emul: support AVX10.1", use just
    vcpu_must_have(), not host_and_vcpu_must_have().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/evex-disp8.c       | 17 +++++++++++++++++
 tools/tests/x86_emulator/predicates.c       |  3 +++
 tools/tests/x86_emulator/x86-emulate.h      |  2 ++
 xen/arch/x86/x86_emulate/decode.c           |  1 +
 xen/arch/x86/x86_emulate/private.h          |  1 +
 xen/arch/x86/x86_emulate/x86_emulate.c      | 13 +++++++++++++
 xen/include/public/arch-x86/cpufeatureset.h |  1 +
 xen/tools/gen-cpuid.py                      |  2 +-
 8 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/evex-disp8.c b/tools/tests/x86_emulator/evex-disp8.c
index efb6c70637..3bd5944dd8 100644
--- a/tools/tests/x86_emulator/evex-disp8.c
+++ b/tools/tests/x86_emulator/evex-disp8.c
@@ -689,6 +689,15 @@ static const struct test avx512_fp16_128[] = {
     INSN(movw, 66, map5, 7e, el, fp16, el),
 };
 
+static const struct test avx512_bmm_all[] = {
+    INSN(bitrev,   , map6, 81, vl, b, vl),
+};
+
+static const struct test avx512_bmm_no128[] = {
+    INSN(bmacor16x16x16,    , map6, 81, vl, w, vl),
+    INSN(bmacxor16x16x16,   , map6, 81, vl, w, vl),
+};
+
 static const struct test gfni_all[] = {
     INSN(gf2p8affineinvqb, 66, 0f3a, cf, vl, q, vl),
     INSN(gf2p8affineqb,    66, 0f3a, ce, vl, q, vl),
@@ -817,6 +826,12 @@ static void test_one(const struct test *test, enum vl vl,
 
     case ESZ_w:
         evex.w = 1;
+        /*
+         * VBMAC{,X}OR16x16x16 don't follow the general pattern: EVEX.W controls
+         * reduction kind there, not element size.
+         */
+        if ( test->spc == SPC_map6 && !test->pfx && test->opc == 0x80 )
+            evex.w = test->mnemonic[4] == 'x';
         /* fall through */
     case ESZ_fp16:
         esz = 2;
@@ -1087,6 +1102,8 @@ void evex_disp8_test(void *instr, struct x86_emulate_ctxt *ctxt,
     RUN(avx512_vpopcntdq, all);
     RUN(avx512_fp16, all);
     RUN(avx512_fp16, 128);
+    RUN(avx512_bmm, all);
+    RUN(avx512_bmm, no128);
 
     if ( cpu_has_avx512f )
     {
diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index afe2e297d9..019c2ced8a 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -2140,6 +2140,9 @@ static const struct evex {
     { { 0x56 }, 2, T, R, pfx_f2, W0, Ln }, /* vfcmaddcph */
     { { 0x57 }, 2, T, R, pfx_f3, W0, LIG }, /* vfmaddcsh */
     { { 0x57 }, 2, T, R, pfx_f2, W0, LIG }, /* vfcmaddcsh */
+    { { 0x80 }, 2, T, R, pfx_no, W0, L1 | L2 }, /* vbmacor16x16x16 */
+    { { 0x80 }, 2, T, R, pfx_no, W1, L1 | L2 }, /* vbmacxor16x16x16 */
+    { { 0x81 }, 2, T, R, pfx_no, W0, Ln }, /* vbitrev */
     { { 0x96 }, 2, T, R, pfx_66, W0, Ln }, /* vfmaddsub132ph */
     { { 0x97 }, 2, T, R, pfx_66, W0, Ln }, /* vfmsubadd132ph */
     { { 0x98 }, 2, T, R, pfx_66, W0, Ln }, /* vfmadd132ph */
diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h
index 4c292ac338..62ebd881c9 100644
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -223,6 +223,8 @@ void wrpkru(unsigned int val);
 #define cpu_has_xop                 (cpu_policy.extd.xop  && xcr0_mask(6))
 #define cpu_has_fma4                (cpu_policy.extd.fma4 && xcr0_mask(6))
 #define cpu_has_tbm                  cpu_policy.extd.tbm
+#define cpu_has_avx512_bmm          (cpu_policy.extd.avx512_bmm && \
+                                     xcr0_mask(0xe6))
 
 int emul_test_cpuid(
     uint32_t leaf,
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 7ce97c4726..2fe77c4d8d 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -387,6 +387,7 @@ static const struct ext0f38_table {
     [0x7a ... 0x7c] = { .simd_size = simd_none, .two_op = 1 },
     [0x7d ... 0x7e] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
     [0x7f] = { .simd_size = simd_packed_fp, .d8s = d8s_vl },
+    [0x80 ... 0x81] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
     [0x82] = { .simd_size = simd_other },
     [0x83] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
     [0x88] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_dq },
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index 24c79c4e8f..dfdc263f9c 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -566,6 +566,7 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 #define vcpu_has_clzero()      (ctxt->cpuid->extd.clzero)
 #define vcpu_has_wbnoinvd()    (ctxt->cpuid->extd.wbnoinvd)
 #define vcpu_has_nscb()        (ctxt->cpuid->extd.nscb)
+#define vcpu_has_avx512_bmm()  (ctxt->cpuid->extd.avx512_bmm)
 
 #define vcpu_has_bmi1()        (ctxt->cpuid->feat.bmi1)
 #define vcpu_has_hle()         (ctxt->cpuid->feat.hle)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 7751a67130..11d145e177 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -7859,6 +7859,19 @@ x86_emulate(
         goto simd_zmm;
     }
 
+    case X86EMUL_OPC_EVEX(6, 0x80): /* vbmac{,x}or16x16x16 [xyz]mm/mem,[xyz]mm,[xyz]mm */
+        vcpu_must_have(avx512_bmm);
+        generate_exception_if(!evex.lr || evex.brs || evex.opmsk, X86_EXC_UD);
+        avx512_vlen_check(false);
+        goto simd_zmm;
+
+    case X86EMUL_OPC_EVEX(6, 0x81): /* vbitrev [xyz]mm/mem,[xyz]mm */
+        vcpu_must_have(avx512_bmm);
+        generate_exception_if(evex.w || evex.brs || evex.reg != 0xf || !evex.RX,
+                              X86_EXC_UD);
+        avx512_vlen_check(false);
+        goto simd_zmm;
+
     case X86EMUL_OPC_XOP(08, 0x85): /* vpmacssww xmm,xmm/m128,xmm,xmm */
     case X86EMUL_OPC_XOP(08, 0x86): /* vpmacsswd xmm,xmm/m128,xmm,xmm */
     case X86EMUL_OPC_XOP(08, 0x87): /* vpmacssdql xmm,xmm/m128,xmm,xmm */
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index 438acba4e2..ce4a7982a5 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -333,6 +333,7 @@ XEN_CPUFEATURE(CPUID_USER_DIS,     11*32+17) /*   CPUID disable for CPL > 0 soft
 XEN_CPUFEATURE(EPSF,               11*32+18) /*A  Enhanced Predictive Store Forwarding */
 XEN_CPUFEATURE(FSRSC,              11*32+19) /*A  Fast Short REP SCASB */
 XEN_CPUFEATURE(AMD_PREFETCHI,      11*32+20) /*A  PREFETCHIT{0,1} Instructions */
+XEN_CPUFEATURE(AVX512_BMM,         11*32+23) /*a  AVX512 Bitmap Manipulation Instructions */
 XEN_CPUFEATURE(SBPB,               11*32+27) /*A  Selective Branch Predictor Barrier */
 XEN_CPUFEATURE(IBPB_BRTYPE,        11*32+28) /*A  IBPB flushes Branch Type predictions too */
 XEN_CPUFEATURE(SRSO_NO,            11*32+29) /*A  Hardware not vulnerable to Speculative Return Stack Overflow */
diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index 13d85a4348..b751dbab27 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -307,7 +307,7 @@ def crunch_numbers(state):
         # dependents of AVX512BW (as to requiring wider than 16-bit mask
         # registers), despite the SDM not formally making this connection.
         AVX512BW: [AVX512_VBMI, AVX512_VBMI2, AVX512_BITALG, AVX512_BF16,
-                   AVX512_FP16],
+                   AVX512_FP16, AVX512_BMM],
 
         # Extensions with VEX/EVEX encodings keyed to a separate feature
         # flag are made dependents of their respective legacy feature.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:56:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277309.1562541 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAove-0004h1-07; Thu, 09 Apr 2026 12:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277309.1562541; Thu, 09 Apr 2026 12: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 1wAovd-0004gt-Th; Thu, 09 Apr 2026 12:56:13 +0000
Received: by outflank-mailman (input) for mailman id 1277309;
 Thu, 09 Apr 2026 12:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAovd-0004gn-9o
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovd-000OdV-1N
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovd-007iJ1-0Z
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=K2lXYyUzNi8Lj0sIwOVY3aWpTcgEjwm6eel0YzBLQGQ=; b=gMtCE+mMYXaGuucNxPbm/8eCnl
	W6sy9pe871EJkozweDjUHTRwNMelvLIMJ1LK04fO/4EdE3V8i8ZfhUpLolhzHmh2VBCV3yVKKAe1j
	ySx/lR9GyGjz52pCSD4TMWciMx9fAyS7x7p3pHVuXWNFt26UngRlTKbf45TaemoYzOxw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: Add myself as x86 reviewer
Message-Id: <E1wAovd-007iJ1-0Z@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:56:13 +0000

commit a90d38d3501875034aea1268407589378217865c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 9 08:26:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:26:08 2026 +0200

    MAINTAINERS: Add myself as x86 reviewer
    
    I already started reviewing patches, but would like to
    be more active in that area.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 MAINTAINERS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1ac61da59a..77f72e52f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -225,6 +225,7 @@ M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
 M:	Roger Pau Monné <roger.pau@citrix.com>
 R:	Jason Andryuk <jason.andryuk@amd.com>
+R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
 F:	xen/drivers/passthrough/amd/
 
@@ -233,6 +234,7 @@ M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
 M:	Roger Pau Monné <roger.pau@citrix.com>
 R:	Jason Andryuk <jason.andryuk@amd.com>
+R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
 F:	xen/arch/x86/cpu/vpmu_amd.c
 F:	xen/arch/x86/hvm/svm/
@@ -613,6 +615,7 @@ X86 ARCHITECTURE
 M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
 M:	Roger Pau Monné <roger.pau@citrix.com>
+R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
 L:	xen-devel@lists.xenproject.org
 F:	xen/arch/x86/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:56:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277311.1562544 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAovo-0004j8-1Y; Thu, 09 Apr 2026 12:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277311.1562544; Thu, 09 Apr 2026 12: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 1wAovn-0004j0-V6; Thu, 09 Apr 2026 12:56:23 +0000
Received: by outflank-mailman (input) for mailman id 1277311;
 Thu, 09 Apr 2026 12:56:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAovn-0004iu-AY
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovn-000OdZ-1e
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovn-007iJt-0r
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=69EZgBc8CcepLfIzm8JaOxiMB0bl3sL5isdLuJ1oKpk=; b=PVG3vc6pDJ2qaOmL6LCQqhtNBc
	Mb+cWGM0B64sBzNX2OM2atwECWRwm3FBu7LT1Ljk/Wg12l3Ue/vYJHxyVy23lgHe0agXrDGcJHe7Z
	1bxOUaJGvqynPWZwRMmMcy9lBZBalFO9cyzRubw2qWjSPkoRL5UyDJTtH/X5JTp7q4Ww=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/emul: Remove ops->{read,write}_segment checks for swapgs
Message-Id: <E1wAovn-007iJt-0r@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:56:23 +0000

commit 98610a6c342d0b491f0466806e213975f2134bd3
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu Apr 9 08:26:27 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:26:27 2026 +0200

    x86/emul: Remove ops->{read,write}_segment checks for swapgs
    
    Remove these checks now that we don't use these 2 ops anymore.
    
    Amends: 4bedbe47eef4f ("x86/emul: Remove fallback path from SWAPGS")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/0f01.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 54bd6faf0f..4d36c7d289 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -187,8 +187,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xf8: /* swapgs */
         generate_exception_if(!mode_64bit(), X86_EXC_UD);
         generate_exception_if(!mode_ring0(), X86_EXC_GP, 0);
-        fail_if(!ops->read_segment || !ops->read_msr ||
-                !ops->write_segment || !ops->write_msr);
+        fail_if(!ops->read_msr || !ops->write_msr);
         if ( (rc = ops->read_msr(MSR_GS_BASE, &sreg.base,
                                  ctxt)) != X86EMUL_OKAY ||
              (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 12:56:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 12:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1277313.1562549 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAovz-0004lO-36; Thu, 09 Apr 2026 12:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1277313.1562549; Thu, 09 Apr 2026 12: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 1wAovz-0004lG-0R; Thu, 09 Apr 2026 12:56:35 +0000
Received: by outflank-mailman (input) for mailman id 1277313;
 Thu, 09 Apr 2026 12:56:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAovx-0004l8-EF
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 12:56:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovx-000Odj-21
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAovx-007iLW-19
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tYB/a9U5pbBkkYz5ibh8ms/YZoRifJvgN7HFpSLb/BE=; b=YQMe3mDqVwXZ834oPAaTTiHhX6
	wqMTYniRVuj9jBFLNtSdCmyNWVY0Hzs5xJkuNTy1S1qZWMT5zL27zGGSf/cOut0OwkXtZJUdzl+K3
	T1qjoU0LElHRrYxqaSLH1SZt7q6GUUFYc2LPhuFPJDqf+TOpaQVlX8bAFIvNlb50Rtxc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: use / "support" UDB
Message-Id: <E1wAovx-007iLW-19@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 12:56:33 +0000

commit 1f3dd605eab1770ee9f9359690eff61adca17c33
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 9 08:27:47 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 9 08:27:47 2026 +0200

    x86: use / "support" UDB
    
    With opcode D6h now firmly reserved as another #UD-raising one in 64-bit
    mode, use that instead of the two-byte UD2 for bug frame marking.
    
    While there also make a minor adjustment to the emulator.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/bug.h    | 4 ++--
 xen/arch/x86/traps.c              | 6 +++---
 xen/arch/x86/x86_emulate/decode.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/include/asm/bug.h b/xen/arch/x86/include/asm/bug.h
index 3a4f41e380..211b480f26 100644
--- a/xen/arch/x86/include/asm/bug.h
+++ b/xen/arch/x86/include/asm/bug.h
@@ -21,7 +21,7 @@
 
 #ifndef __ASSEMBLER__
 
-#define BUG_INSTR       "ud2"
+#define BUG_INSTR       ".byte 0xd6" /* UDB, requiring gas 2.46 */
 #define BUG_ASM_CONST   "c"
 
 #else  /* !__ASSEMBLER__ */
@@ -37,7 +37,7 @@
         .error "Invalid BUGFRAME index"
     .endif
 
-    .L\@ud: ud2a
+    .L\@ud: .byte 0xd6 /* UDB, requiring gas 2.46 */
 
     .pushsection .rodata.str1, "aMS", @progbits, 1
          .L\@s1: .asciz "\file_str"
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8aa1e4181b..855147d7f3 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1338,7 +1338,7 @@ void asmlinkage do_trap(struct cpu_user_regs *regs)
 
 void asmlinkage do_invalid_op(struct cpu_user_regs *regs)
 {
-    u8 bug_insn[2];
+    uint8_t bug_insn;
     const void *eip = (const void *)regs->rip;
     int id;
 
@@ -1350,8 +1350,8 @@ void asmlinkage do_invalid_op(struct cpu_user_regs *regs)
     }
 
     if ( !is_active_kernel_text(regs->rip) ||
-         copy_from_unsafe(bug_insn, eip, sizeof(bug_insn)) ||
-         memcmp(bug_insn, "\xf\xb", sizeof(bug_insn)) )
+         copy_from_unsafe(&bug_insn, eip, sizeof(bug_insn)) ||
+         bug_insn != 0xd6 /* UDB */ )
         goto die;
 
     id = do_bug_frame(regs, regs->rip);
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 2fe77c4d8d..346777422b 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -652,7 +652,7 @@ decode_onebyte(struct x86_emulate_state *s,
     case 0xce: /* into */
     case 0xd4: /* aam */
     case 0xd5: /* aad */
-    case 0xd6: /* salc */
+    case 0xd6: /* salc / udb */
         s->not_64bit = true;
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 20:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 20:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278136.1563090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAw3j-0005L5-Rt; Thu, 09 Apr 2026 20:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278136.1563090; Thu, 09 Apr 2026 20:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAw3j-0005Kx-OZ; Thu, 09 Apr 2026 20:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1278136;
 Thu, 09 Apr 2026 20:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAw3i-0005Kr-BO
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 20:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw3i-000nYG-12
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw3i-008Zgz-0A
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Z3bq3EsWcGmxHZNNJWuwqqOcOgo+Ad4K575VGoS4p3I=; b=dnOEKtX3i3Cpmkjb2Av+vJ1cej
	u7jJaVXD6xbfooiaJc4yE1xIv56eyqaO+67lpUPxdM8a8ncjcRwEpYR57TOWpLMeCl4CTqoEuXDoL
	RYAANuZ41YqLNhrprNEwu37HCRlQMAw1mqsQtPEvfCTHnZDa1CrAqUIfE3xoPfFaQ4i0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/extable: Adjust UD1 encoding in stub_selftest()
Message-Id: <E1wAw3i-008Zgz-0A@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 20:33:02 +0000

commit d473af5006a148dd1d4a18f9d9aaf636bbf48b47
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 9 09:33:07 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    x86/extable: Adjust UD1 encoding in stub_selftest()
    
    The 0x90 is a ModRM byte and technically needs following by an imm32.
    
    Switch to 0xc0 which encodes two %eax operands, and is a complete instruction.
    
    No practical change.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/extable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index a9b6c6b904..e1c8c9fab8 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -157,7 +157,7 @@ int __init cf_check stub_selftest(void)
         union stub_exception_token res;
     } tests[] __initconst = {
 #define endbr64 0xf3, 0x0f, 0x1e, 0xfa
-        { .opc = { endbr64, 0x0f, 0xb9, 0x90 }, /* ud1 */
+        { .opc = { endbr64, 0x0f, 0xb9, 0xc0 }, /* ud1 %eax,%eax */
           .res.fields.trapnr = X86_EXC_UD },
         { .opc = { endbr64, 0x90, 0x02, 0x00 }, /* nop; add (%rax),%al */
           .rax = 0x0123456789abcdef,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 20:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 20:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278137.1563093 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAw3t-0005Mj-T7; Thu, 09 Apr 2026 20:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278137.1563093; Thu, 09 Apr 2026 20: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 1wAw3t-0005Mb-Pq; Thu, 09 Apr 2026 20:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1278137;
 Thu, 09 Apr 2026 20:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAw3s-0005MC-8R
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 20:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw3s-000nYa-1P
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw3s-008Zkc-0Z
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kX50iCMFuYltPFh62JKLOn4/ozrLgAq0z9rVOF1xpTU=; b=tvo9REZBbU0QBDmGzDfB6g0OK4
	f/BzJoUE0cPsyNxd3i4SHgyXLlZrYq0Nbh5gl93cTNyzAWiaGHq0szB4JHwgK7MPkvPGf6F2RveAy
	ACrxOe+MS913AuEOKGKG842sri8Kbn2xEtAURVaEOzfiQ2gRGxWBHW5V+vFi2x+fGlnM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Avoid using .byte for instructions where safe to do so
Message-Id: <E1wAw3s-008Zkc-0Z@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 20:33:12 +0000

commit 964a4d4281aeee88c63f1da07a344424a8755788
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 13:51:36 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    x86: Avoid using .byte for instructions where safe to do so
    
    The new toolchain baseline knows XGETBV, VPXOR and VPOR.
    
    For the other cases using .byte, annotate the toolchain minima.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/arch.mk                   |  4 ++++
 xen/arch/x86/include/asm/asm-defns.h   |  1 +
 xen/arch/x86/include/asm/msr.h         |  2 ++
 xen/arch/x86/include/asm/prot-key.h    |  4 ++--
 xen/arch/x86/include/asm/xstate.h      |  3 +--
 xen/arch/x86/x86_emulate/0f01.c        |  2 +-
 xen/arch/x86/x86_emulate/x86_emulate.c | 34 ++++++++++++++++------------------
 7 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 0b42e6312f..cd0602a79a 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -17,7 +17,11 @@ CFLAGS-$(CONFIG_CC_IS_GCC) += -malign-data=abi
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
+
+# Binutils >= 2.31, Clang >= 7
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
+
+# Binutils >= 2.33, Clang >= 9
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
 # Check to see whether the assembler supports the .nop directive.
diff --git a/xen/arch/x86/include/asm/asm-defns.h b/xen/arch/x86/include/asm/asm-defns.h
index 239dc3af09..dc9b3ce272 100644
--- a/xen/arch/x86/include/asm/asm-defns.h
+++ b/xen/arch/x86/include/asm/asm-defns.h
@@ -1,5 +1,6 @@
 #include <asm/page-bits.h>
 
+/* binutils >= 2.26 or Clang >= 3.8 */
 .macro clzero
     .byte 0x0f, 0x01, 0xfc
 .endm
diff --git a/xen/arch/x86/include/asm/msr.h b/xen/arch/x86/include/asm/msr.h
index 941a7612f4..1377d156f4 100644
--- a/xen/arch/x86/include/asm/msr.h
+++ b/xen/arch/x86/include/asm/msr.h
@@ -63,6 +63,8 @@ static inline void wrmsrns(uint32_t msr, uint64_t val)
     /*
      * WRMSR is 2 bytes.  WRMSRNS is 3 bytes.  Pad WRMSR with a redundant CS
      * prefix to avoid a trailing NOP.
+     *
+     * Binutils >= 2.40, Clang >= 16
      */
     alternative_input(".byte 0x2e; wrmsr",
                       ".byte 0x0f,0x01,0xc6", X86_FEATURE_WRMSRNS,
diff --git a/xen/arch/x86/include/asm/prot-key.h b/xen/arch/x86/include/asm/prot-key.h
index 8fb15b5c32..e8550e0c92 100644
--- a/xen/arch/x86/include/asm/prot-key.h
+++ b/xen/arch/x86/include/asm/prot-key.h
@@ -19,7 +19,7 @@ static inline uint32_t rdpkru(void)
 {
     uint32_t pkru;
 
-    asm volatile ( ".byte 0x0f,0x01,0xee"
+    asm volatile ( ".byte 0x0f,0x01,0xee" /* binutils >= 2.26 or Clang >= 3.8 */
                    : "=a" (pkru) : "c" (0) : "dx" );
 
     return pkru;
@@ -27,7 +27,7 @@ static inline uint32_t rdpkru(void)
 
 static inline void wrpkru(uint32_t pkru)
 {
-    asm volatile ( ".byte 0x0f,0x01,0xef"
+    asm volatile ( ".byte 0x0f,0x01,0xef" /* binutils >= 2.26 or Clang >= 3.8 */
                    :: "a" (pkru), "d" (0), "c" (0) );
 }
 
diff --git a/xen/arch/x86/include/asm/xstate.h b/xen/arch/x86/include/asm/xstate.h
index c96d75e38b..0519379edb 100644
--- a/xen/arch/x86/include/asm/xstate.h
+++ b/xen/arch/x86/include/asm/xstate.h
@@ -118,8 +118,7 @@ static inline uint64_t xgetbv(unsigned int index)
     uint32_t lo, hi;
 
     ASSERT(index); /* get_xcr0() should be used instead. */
-    asm volatile ( ".byte 0x0f,0x01,0xd0" /* xgetbv */
-                   : "=a" (lo), "=d" (hi) : "c" (index) );
+    asm volatile ( "xgetbv" : "=a" (lo), "=d" (hi) : "c" (index) );
 
     return lo | ((uint64_t)hi << 32);
 }
diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 4d36c7d289..87d338f0c7 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -122,7 +122,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
         {
         case vex_none: /* serialize */
             host_and_vcpu_must_have(serialize);
-            asm volatile ( ".byte 0x0f, 0x01, 0xe8" );
+            asm volatile ( ".byte 0x0f, 0x01, 0xe8" ); /* Binutils >= 2.34, Clang >= 11 */
             break;
         case vex_f2: /* xsusldtrk */
             vcpu_must_have(tsxldtrk);
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 11d145e177..e58735ee95 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4748,27 +4748,25 @@ x86_emulate(
                  */
                 if ( vex.l )
                 {
-                    /* vpxor %xmmN, %xmmN, %xmmN */
-                    asm volatile ( ".byte 0xc5,0xf9,0xef,0xc0" );
-                    asm volatile ( ".byte 0xc5,0xf1,0xef,0xc9" );
-                    asm volatile ( ".byte 0xc5,0xe9,0xef,0xd2" );
-                    asm volatile ( ".byte 0xc5,0xe1,0xef,0xdb" );
-                    asm volatile ( ".byte 0xc5,0xd9,0xef,0xe4" );
-                    asm volatile ( ".byte 0xc5,0xd1,0xef,0xed" );
-                    asm volatile ( ".byte 0xc5,0xc9,0xef,0xf6" );
-                    asm volatile ( ".byte 0xc5,0xc1,0xef,0xff" );
+                    asm volatile ( "vpxor %xmm0, %xmm0, %xmm0" );
+                    asm volatile ( "vpxor %xmm1, %xmm1, %xmm1" );
+                    asm volatile ( "vpxor %xmm2, %xmm2, %xmm2" );
+                    asm volatile ( "vpxor %xmm3, %xmm3, %xmm3" );
+                    asm volatile ( "vpxor %xmm4, %xmm4, %xmm4" );
+                    asm volatile ( "vpxor %xmm5, %xmm5, %xmm5" );
+                    asm volatile ( "vpxor %xmm6, %xmm6, %xmm6" );
+                    asm volatile ( "vpxor %xmm7, %xmm7, %xmm7" );
                 }
                 else
                 {
-                    /* vpor %xmmN, %xmmN, %xmmN */
-                    asm volatile ( ".byte 0xc5,0xf9,0xeb,0xc0" );
-                    asm volatile ( ".byte 0xc5,0xf1,0xeb,0xc9" );
-                    asm volatile ( ".byte 0xc5,0xe9,0xeb,0xd2" );
-                    asm volatile ( ".byte 0xc5,0xe1,0xeb,0xdb" );
-                    asm volatile ( ".byte 0xc5,0xd9,0xeb,0xe4" );
-                    asm volatile ( ".byte 0xc5,0xd1,0xeb,0xed" );
-                    asm volatile ( ".byte 0xc5,0xc9,0xeb,0xf6" );
-                    asm volatile ( ".byte 0xc5,0xc1,0xeb,0xff" );
+                    asm volatile ( "vpor %xmm0, %xmm0, %xmm0" );
+                    asm volatile ( "vpor %xmm1, %xmm1, %xmm1" );
+                    asm volatile ( "vpor %xmm2, %xmm2, %xmm2" );
+                    asm volatile ( "vpor %xmm3, %xmm3, %xmm3" );
+                    asm volatile ( "vpor %xmm4, %xmm4, %xmm4" );
+                    asm volatile ( "vpor %xmm5, %xmm5, %xmm5" );
+                    asm volatile ( "vpor %xmm6, %xmm6, %xmm6" );
+                    asm volatile ( "vpor %xmm7, %xmm7, %xmm7" );
                 }
 
                 ASSERT(!state->simd_size);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 20:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 20:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278138.1563098 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAw43-0005Pm-VF; Thu, 09 Apr 2026 20:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278138.1563098; Thu, 09 Apr 2026 20: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 1wAw43-0005Pd-Si; Thu, 09 Apr 2026 20:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1278138;
 Thu, 09 Apr 2026 20:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAw42-0005PT-DD
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 20:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw42-000nYg-1s
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw42-008Zni-0z
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AnUj2clPSc6OEn7O7LVUmSHYiCJ4FPBW/pcY6OyXpxg=; b=wRVUmT0j60KlkOh74UHvEbqfDU
	6q59TJZomB9VT/QQ/Ya96cJpskGbV1n6MoOFjb4O7u6E+iEtn7PtJgO1b+ONDL6ZHTLciY6xTiAyU
	qRKCr3MxZhhPoIKobNFFNsljlAH1tpEMygTK4pATG1Jizc4f5ZYJpWLpfr8yEvLhmjnc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/efi: Reduce ifdefary in efi_exit_boot()
Message-Id: <E1wAw42-008Zni-0z@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 20:33:22 +0000

commit c16b0e5273ea6012e5b497368967075bef541496
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 9 11:30:30 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    xen/efi: Reduce ifdefary in efi_exit_boot()
    
    Use IS_ENABLED() rather than #ifdef to give the compiler visibility into the
    block, which in turn removes the #ifdef from the variable block.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/common/efi/boot.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 0ddc7bfd12..b44762878b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1335,9 +1335,7 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *Syste
     EFI_STATUS status;
     UINTN info_size = 0, map_key;
     bool retry;
-#ifdef CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP
     unsigned int i;
-#endif
 
     efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
                          &efi_mdesc_size, &mdesc_ver);
@@ -1371,31 +1369,33 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *Syste
     if ( EFI_ERROR(status) )
         PrintErrMesg(L"Cannot exit boot services", status);
 
-#ifdef CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP
-    for ( i = 0; i < efi_memmap_size; i += efi_mdesc_size )
+    if ( IS_ENABLED(CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP) )
     {
-        EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i;
+        for ( i = 0; i < efi_memmap_size; i += efi_mdesc_size )
+        {
+            EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i;
 
-        /*
-         * Runtime services regions are always mapped here.
-         * Attributes may be adjusted in efi_init_memory().
-         */
-        if ( (desc->Attribute & EFI_MEMORY_RUNTIME) ||
-             desc->Type == EfiRuntimeServicesCode ||
-             desc->Type == EfiRuntimeServicesData )
-            desc->VirtualStart = desc->PhysicalStart;
-        else
-            desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
-    }
-    status = efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size,
-                                          mdesc_ver, efi_memmap);
-    if ( status != EFI_SUCCESS )
-    {
-        printk(XENLOG_ERR "EFI: SetVirtualAddressMap() failed (%#lx), disabling runtime services\n",
-               status);
-        __clear_bit(EFI_RS, &efi_flags);
+            /*
+             * Runtime services regions are always mapped here.
+             * Attributes may be adjusted in efi_init_memory().
+             */
+            if ( (desc->Attribute & EFI_MEMORY_RUNTIME) ||
+                 desc->Type == EfiRuntimeServicesCode ||
+                 desc->Type == EfiRuntimeServicesData )
+                desc->VirtualStart = desc->PhysicalStart;
+            else
+                desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
+        }
+        status = efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size,
+                                              mdesc_ver, efi_memmap);
+        if ( status != EFI_SUCCESS )
+        {
+            printk(XENLOG_ERR
+                   "EFI: SetVirtualAddressMap() failed (%#lx), disabling runtime services\n",
+                   status);
+            __clear_bit(EFI_RS, &efi_flags);
+        }
     }
-#endif
 
     /* Adjust pointers into EFI. */
     efi_ct = (const void *)efi_ct + DIRECTMAP_VIRT_START;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 20:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 20:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278139.1563102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAw4E-0005Rs-0Y; Thu, 09 Apr 2026 20:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278139.1563102; Thu, 09 Apr 2026 20: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 1wAw4D-0005Rk-UH; Thu, 09 Apr 2026 20:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1278139;
 Thu, 09 Apr 2026 20:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAw4C-0005Rd-Ft
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 20:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw4C-000nYk-2B
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAw4C-008ZpF-1N
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 20: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CFQMhiHCSrB+MERpeKFnnM9VsYUnOWRUG1ewCGtHd54=; b=Ln3Av/PmkbZL+FlAbxpZVzuD9l
	URV7tV5YBeNw+JfeyP9BZ7ELpK7QrVxnElfXtnpSGBhOLs1b2T0/WGgTj1q50m9au5gf21W/yOnuP
	BQd97uJV29xLF/BCCeNycfh6RSOmXbIBAU/QoUAQCZFZCBy1AWmgXdkWnTGdl4Igc+Lo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/x86: Check supported features even for PVH dom0
Message-Id: <E1wAw4C-008ZpF-1N@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 20:33:32 +0000

commit 44429b69319975f25d3762629b40fecdd4e3e554
Author:     Frediano Ziglio <freddy77@gmail.com>
AuthorDate: Wed Apr 8 13:55:14 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    xen/x86: Check supported features even for PVH dom0
    
    The supported features ELF notes was tested only if the dom0 was
    PV. Factor out a function to check ELF notes and reuse it even
    for PVH.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/dom0_build.c             | 12 ++++++++++++
 xen/arch/x86/hvm/dom0_build.c         |  3 +++
 xen/arch/x86/include/asm/dom0_build.h |  2 ++
 xen/arch/x86/pv/dom0_build.c          | 10 ++--------
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 864dd9e53e..80308ca9af 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -320,6 +320,18 @@ unsigned long __init dom0_paging_pages(const struct domain *d,
     return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
 }
 
+int __init initdom_check_parms(
+    const struct domain *d, const struct elf_dom_parms *parms)
+{
+    if ( parms->elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE &&
+         is_hardware_domain(d) && !test_bit(XENFEAT_dom0, parms->f_supported) )
+    {
+        printk("Kernel does not support Dom0 operation\n");
+        return -EINVAL;
+    }
+
+    return 0;
+}
 
 /*
  * If allocation isn't specified, reserve 1/16th of available memory for
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index d69a83b089..aa06cdb2f7 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -692,6 +692,9 @@ static int __init pvh_load_kernel(
         return -EINVAL;
     }
 
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
+
     /* Copy the OS image and free temporary buffer. */
     elf.dest_base = (void *)(parms.virt_kstart - parms.virt_base);
     elf.dest_size = parms.virt_kend - parms.virt_kstart;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index ff021c24af..1332f18cc6 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -8,6 +8,8 @@
 
 extern unsigned int dom0_memflags;
 
+int initdom_check_parms(const struct domain *d,
+                        const struct elf_dom_parms *parms);
 unsigned long dom0_compute_nr_pages(struct domain *d,
                                     struct elf_dom_parms *parms,
                                     unsigned long initrd_len);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 075a3646c2..12d8ba744a 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -494,14 +494,8 @@ static int __init dom0_construct(const struct boot_domain *bd)
         return -EINVAL;
     }
 
-    if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE )
-    {
-        if ( !pv_shim && !test_bit(XENFEAT_dom0, parms.f_supported) )
-        {
-            printk("Kernel does not support Dom0 operation\n");
-            return -EINVAL;
-        }
-    }
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
 
     nr_pages = dom0_compute_nr_pages(d, &parms, initrd_len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 22:55:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 22:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278186.1563115 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAyH9-0004n6-OW; Thu, 09 Apr 2026 22:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278186.1563115; Thu, 09 Apr 2026 22: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 1wAyH9-0004mz-Ln; Thu, 09 Apr 2026 22:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1278186;
 Thu, 09 Apr 2026 22:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAyH8-0004mt-Hv
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 22:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyH8-000qHZ-23
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyH8-008yD8-1D
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=k2abO0qzacj+b/J69rC8ZImGcPWEYP1+zKY0VG3jd0A=; b=gZaJ7mKAfpzbCb+JYLbDpC8+wJ
	Woz7Av7rhFt/c3yGwKumTWO4XuJeoyl4X+zHjxDcX1LomiPtSbqMylMVX9gih4xZUye2XQ9tr8FF0
	OCM74h9hkYvnjO+/R2AH0BQM5xYPbqgZ2atmeVmiVSRuNBqMkwSlBHYWnehoTCBPDunA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/extable: Adjust UD1 encoding in stub_selftest()
Message-Id: <E1wAyH8-008yD8-1D@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 22:55:02 +0000

commit d473af5006a148dd1d4a18f9d9aaf636bbf48b47
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 9 09:33:07 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    x86/extable: Adjust UD1 encoding in stub_selftest()
    
    The 0x90 is a ModRM byte and technically needs following by an imm32.
    
    Switch to 0xc0 which encodes two %eax operands, and is a complete instruction.
    
    No practical change.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/extable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index a9b6c6b904..e1c8c9fab8 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -157,7 +157,7 @@ int __init cf_check stub_selftest(void)
         union stub_exception_token res;
     } tests[] __initconst = {
 #define endbr64 0xf3, 0x0f, 0x1e, 0xfa
-        { .opc = { endbr64, 0x0f, 0xb9, 0x90 }, /* ud1 */
+        { .opc = { endbr64, 0x0f, 0xb9, 0xc0 }, /* ud1 %eax,%eax */
           .res.fields.trapnr = X86_EXC_UD },
         { .opc = { endbr64, 0x90, 0x02, 0x00 }, /* nop; add (%rax),%al */
           .rax = 0x0123456789abcdef,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 22:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 22:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278187.1563119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAyHJ-0004om-Pr; Thu, 09 Apr 2026 22:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278187.1563119; Thu, 09 Apr 2026 22: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 1wAyHJ-0004oe-NL; Thu, 09 Apr 2026 22:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1278187;
 Thu, 09 Apr 2026 22:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAyHI-0004oQ-KD
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 22:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyHI-000qHt-2b
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyHI-008yEn-1a
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=P43RQkhXrjVAbMocRb9NWJCzpZ6kN1aO1T//3bOBut8=; b=DBPD15t/UtJ7dZLLzbQlCWPt5M
	4VIDOao0a/NFtbmpCH/H1NbW7UnxDd7xp0/w56BupEl8CYXcaESo6VCJfbPiU1H0qYHC4qjljzbmp
	6mT6yy4PB1oESaZvOg/maeKA+11iBYsDMeQ4GjKSl6Ed20QY2B8PuMT9JS3QbzesfB9M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Avoid using .byte for instructions where safe to do so
Message-Id: <E1wAyHI-008yEn-1a@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 22:55:12 +0000

commit 964a4d4281aeee88c63f1da07a344424a8755788
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 13:51:36 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    x86: Avoid using .byte for instructions where safe to do so
    
    The new toolchain baseline knows XGETBV, VPXOR and VPOR.
    
    For the other cases using .byte, annotate the toolchain minima.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/arch.mk                   |  4 ++++
 xen/arch/x86/include/asm/asm-defns.h   |  1 +
 xen/arch/x86/include/asm/msr.h         |  2 ++
 xen/arch/x86/include/asm/prot-key.h    |  4 ++--
 xen/arch/x86/include/asm/xstate.h      |  3 +--
 xen/arch/x86/x86_emulate/0f01.c        |  2 +-
 xen/arch/x86/x86_emulate/x86_emulate.c | 34 ++++++++++++++++------------------
 7 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 0b42e6312f..cd0602a79a 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -17,7 +17,11 @@ CFLAGS-$(CONFIG_CC_IS_GCC) += -malign-data=abi
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$(comma)1",-DHAVE_AS_QUOTED_SYM)
+
+# Binutils >= 2.31, Clang >= 7
 $(call as-option-add,CFLAGS,CC,"movdiri %rax$(comma)(%rax)",-DHAVE_AS_MOVDIR)
+
+# Binutils >= 2.33, Clang >= 9
 $(call as-option-add,CFLAGS,CC,"enqcmd (%rax)$(comma)%rax",-DHAVE_AS_ENQCMD)
 
 # Check to see whether the assembler supports the .nop directive.
diff --git a/xen/arch/x86/include/asm/asm-defns.h b/xen/arch/x86/include/asm/asm-defns.h
index 239dc3af09..dc9b3ce272 100644
--- a/xen/arch/x86/include/asm/asm-defns.h
+++ b/xen/arch/x86/include/asm/asm-defns.h
@@ -1,5 +1,6 @@
 #include <asm/page-bits.h>
 
+/* binutils >= 2.26 or Clang >= 3.8 */
 .macro clzero
     .byte 0x0f, 0x01, 0xfc
 .endm
diff --git a/xen/arch/x86/include/asm/msr.h b/xen/arch/x86/include/asm/msr.h
index 941a7612f4..1377d156f4 100644
--- a/xen/arch/x86/include/asm/msr.h
+++ b/xen/arch/x86/include/asm/msr.h
@@ -63,6 +63,8 @@ static inline void wrmsrns(uint32_t msr, uint64_t val)
     /*
      * WRMSR is 2 bytes.  WRMSRNS is 3 bytes.  Pad WRMSR with a redundant CS
      * prefix to avoid a trailing NOP.
+     *
+     * Binutils >= 2.40, Clang >= 16
      */
     alternative_input(".byte 0x2e; wrmsr",
                       ".byte 0x0f,0x01,0xc6", X86_FEATURE_WRMSRNS,
diff --git a/xen/arch/x86/include/asm/prot-key.h b/xen/arch/x86/include/asm/prot-key.h
index 8fb15b5c32..e8550e0c92 100644
--- a/xen/arch/x86/include/asm/prot-key.h
+++ b/xen/arch/x86/include/asm/prot-key.h
@@ -19,7 +19,7 @@ static inline uint32_t rdpkru(void)
 {
     uint32_t pkru;
 
-    asm volatile ( ".byte 0x0f,0x01,0xee"
+    asm volatile ( ".byte 0x0f,0x01,0xee" /* binutils >= 2.26 or Clang >= 3.8 */
                    : "=a" (pkru) : "c" (0) : "dx" );
 
     return pkru;
@@ -27,7 +27,7 @@ static inline uint32_t rdpkru(void)
 
 static inline void wrpkru(uint32_t pkru)
 {
-    asm volatile ( ".byte 0x0f,0x01,0xef"
+    asm volatile ( ".byte 0x0f,0x01,0xef" /* binutils >= 2.26 or Clang >= 3.8 */
                    :: "a" (pkru), "d" (0), "c" (0) );
 }
 
diff --git a/xen/arch/x86/include/asm/xstate.h b/xen/arch/x86/include/asm/xstate.h
index c96d75e38b..0519379edb 100644
--- a/xen/arch/x86/include/asm/xstate.h
+++ b/xen/arch/x86/include/asm/xstate.h
@@ -118,8 +118,7 @@ static inline uint64_t xgetbv(unsigned int index)
     uint32_t lo, hi;
 
     ASSERT(index); /* get_xcr0() should be used instead. */
-    asm volatile ( ".byte 0x0f,0x01,0xd0" /* xgetbv */
-                   : "=a" (lo), "=d" (hi) : "c" (index) );
+    asm volatile ( "xgetbv" : "=a" (lo), "=d" (hi) : "c" (index) );
 
     return lo | ((uint64_t)hi << 32);
 }
diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 4d36c7d289..87d338f0c7 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -122,7 +122,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
         {
         case vex_none: /* serialize */
             host_and_vcpu_must_have(serialize);
-            asm volatile ( ".byte 0x0f, 0x01, 0xe8" );
+            asm volatile ( ".byte 0x0f, 0x01, 0xe8" ); /* Binutils >= 2.34, Clang >= 11 */
             break;
         case vex_f2: /* xsusldtrk */
             vcpu_must_have(tsxldtrk);
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 11d145e177..e58735ee95 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4748,27 +4748,25 @@ x86_emulate(
                  */
                 if ( vex.l )
                 {
-                    /* vpxor %xmmN, %xmmN, %xmmN */
-                    asm volatile ( ".byte 0xc5,0xf9,0xef,0xc0" );
-                    asm volatile ( ".byte 0xc5,0xf1,0xef,0xc9" );
-                    asm volatile ( ".byte 0xc5,0xe9,0xef,0xd2" );
-                    asm volatile ( ".byte 0xc5,0xe1,0xef,0xdb" );
-                    asm volatile ( ".byte 0xc5,0xd9,0xef,0xe4" );
-                    asm volatile ( ".byte 0xc5,0xd1,0xef,0xed" );
-                    asm volatile ( ".byte 0xc5,0xc9,0xef,0xf6" );
-                    asm volatile ( ".byte 0xc5,0xc1,0xef,0xff" );
+                    asm volatile ( "vpxor %xmm0, %xmm0, %xmm0" );
+                    asm volatile ( "vpxor %xmm1, %xmm1, %xmm1" );
+                    asm volatile ( "vpxor %xmm2, %xmm2, %xmm2" );
+                    asm volatile ( "vpxor %xmm3, %xmm3, %xmm3" );
+                    asm volatile ( "vpxor %xmm4, %xmm4, %xmm4" );
+                    asm volatile ( "vpxor %xmm5, %xmm5, %xmm5" );
+                    asm volatile ( "vpxor %xmm6, %xmm6, %xmm6" );
+                    asm volatile ( "vpxor %xmm7, %xmm7, %xmm7" );
                 }
                 else
                 {
-                    /* vpor %xmmN, %xmmN, %xmmN */
-                    asm volatile ( ".byte 0xc5,0xf9,0xeb,0xc0" );
-                    asm volatile ( ".byte 0xc5,0xf1,0xeb,0xc9" );
-                    asm volatile ( ".byte 0xc5,0xe9,0xeb,0xd2" );
-                    asm volatile ( ".byte 0xc5,0xe1,0xeb,0xdb" );
-                    asm volatile ( ".byte 0xc5,0xd9,0xeb,0xe4" );
-                    asm volatile ( ".byte 0xc5,0xd1,0xeb,0xed" );
-                    asm volatile ( ".byte 0xc5,0xc9,0xeb,0xf6" );
-                    asm volatile ( ".byte 0xc5,0xc1,0xeb,0xff" );
+                    asm volatile ( "vpor %xmm0, %xmm0, %xmm0" );
+                    asm volatile ( "vpor %xmm1, %xmm1, %xmm1" );
+                    asm volatile ( "vpor %xmm2, %xmm2, %xmm2" );
+                    asm volatile ( "vpor %xmm3, %xmm3, %xmm3" );
+                    asm volatile ( "vpor %xmm4, %xmm4, %xmm4" );
+                    asm volatile ( "vpor %xmm5, %xmm5, %xmm5" );
+                    asm volatile ( "vpor %xmm6, %xmm6, %xmm6" );
+                    asm volatile ( "vpor %xmm7, %xmm7, %xmm7" );
                 }
 
                 ASSERT(!state->simd_size);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 22:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 22:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278188.1563123 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAyHT-0004rR-RM; Thu, 09 Apr 2026 22:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278188.1563123; Thu, 09 Apr 2026 22: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 1wAyHT-0004rI-Oi; Thu, 09 Apr 2026 22:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1278188;
 Thu, 09 Apr 2026 22:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAyHS-0004rA-Mr
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 22:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyHS-000qHx-2s
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyHS-008yG0-25
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3dv9tGKpqBEewx4uG6WNmk45G94nkw9NDY4Y+/3IMhY=; b=ux1s1Kn2pbKLPc/CrGwgE5ZsLo
	BQZhtO/I9SO3YznEyHcAdBnKw0oVKw7xQ0V2M1f83hnu+nffVNLMkL4dVi4Mrxyn2qMWVbIGFmYNP
	hbAF29n9LZ14X4N9hSA0U6wSHDFCgNh3tHY+6xCXwPzaIN7ZLCunFSYNulbwm3aLIr+w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/efi: Reduce ifdefary in efi_exit_boot()
Message-Id: <E1wAyHS-008yG0-25@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 22:55:22 +0000

commit c16b0e5273ea6012e5b497368967075bef541496
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 9 11:30:30 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    xen/efi: Reduce ifdefary in efi_exit_boot()
    
    Use IS_ENABLED() rather than #ifdef to give the compiler visibility into the
    block, which in turn removes the #ifdef from the variable block.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/common/efi/boot.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 0ddc7bfd12..b44762878b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1335,9 +1335,7 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *Syste
     EFI_STATUS status;
     UINTN info_size = 0, map_key;
     bool retry;
-#ifdef CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP
     unsigned int i;
-#endif
 
     efi_bs->GetMemoryMap(&info_size, NULL, &map_key,
                          &efi_mdesc_size, &mdesc_ver);
@@ -1371,31 +1369,33 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *Syste
     if ( EFI_ERROR(status) )
         PrintErrMesg(L"Cannot exit boot services", status);
 
-#ifdef CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP
-    for ( i = 0; i < efi_memmap_size; i += efi_mdesc_size )
+    if ( IS_ENABLED(CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP) )
     {
-        EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i;
+        for ( i = 0; i < efi_memmap_size; i += efi_mdesc_size )
+        {
+            EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i;
 
-        /*
-         * Runtime services regions are always mapped here.
-         * Attributes may be adjusted in efi_init_memory().
-         */
-        if ( (desc->Attribute & EFI_MEMORY_RUNTIME) ||
-             desc->Type == EfiRuntimeServicesCode ||
-             desc->Type == EfiRuntimeServicesData )
-            desc->VirtualStart = desc->PhysicalStart;
-        else
-            desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
-    }
-    status = efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size,
-                                          mdesc_ver, efi_memmap);
-    if ( status != EFI_SUCCESS )
-    {
-        printk(XENLOG_ERR "EFI: SetVirtualAddressMap() failed (%#lx), disabling runtime services\n",
-               status);
-        __clear_bit(EFI_RS, &efi_flags);
+            /*
+             * Runtime services regions are always mapped here.
+             * Attributes may be adjusted in efi_init_memory().
+             */
+            if ( (desc->Attribute & EFI_MEMORY_RUNTIME) ||
+                 desc->Type == EfiRuntimeServicesCode ||
+                 desc->Type == EfiRuntimeServicesData )
+                desc->VirtualStart = desc->PhysicalStart;
+            else
+                desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
+        }
+        status = efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size,
+                                              mdesc_ver, efi_memmap);
+        if ( status != EFI_SUCCESS )
+        {
+            printk(XENLOG_ERR
+                   "EFI: SetVirtualAddressMap() failed (%#lx), disabling runtime services\n",
+                   status);
+            __clear_bit(EFI_RS, &efi_flags);
+        }
     }
-#endif
 
     /* Adjust pointers into EFI. */
     efi_ct = (const void *)efi_ct + DIRECTMAP_VIRT_START;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 09 22:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Apr 2026 22:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278189.1563127 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wAyHd-0004tZ-T3; Thu, 09 Apr 2026 22:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278189.1563127; Thu, 09 Apr 2026 22: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 1wAyHd-0004tR-Q9; Thu, 09 Apr 2026 22:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1278189;
 Thu, 09 Apr 2026 22:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wAyHc-0004tK-QE
 for xen-changelog@lists.xenproject.org; Thu, 09 Apr 2026 22:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyHc-000qI1-3D
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wAyHc-008yHC-2N
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Apr 2026 22: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=w+ZTYlxP+WBnmgbKBhxY02My+djXaVbt8Mq/6p4uOo4=; b=MMjKYeZtwP6IXZwT3KAviTUHzR
	YkOC/JyANuVH0FPqGRT6+kB/PnrTEsy/M/LDoHiOLSfKQRWd4+L/sC0aQQT+itlINRI28w9RjD+4g
	xCa2s2m+rxFquHcKvBehPPWwVYsANlAgmHSBjVYOHewfLnA95jPUClSsmhTyHIe3dMQ0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: Check supported features even for PVH dom0
Message-Id: <E1wAyHc-008yHC-2N@xenbits.xenproject.org>
Date: Thu, 09 Apr 2026 22:55:32 +0000

commit 44429b69319975f25d3762629b40fecdd4e3e554
Author:     Frediano Ziglio <freddy77@gmail.com>
AuthorDate: Wed Apr 8 13:55:14 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 9 21:04:58 2026 +0100

    xen/x86: Check supported features even for PVH dom0
    
    The supported features ELF notes was tested only if the dom0 was
    PV. Factor out a function to check ELF notes and reuse it even
    for PVH.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/dom0_build.c             | 12 ++++++++++++
 xen/arch/x86/hvm/dom0_build.c         |  3 +++
 xen/arch/x86/include/asm/dom0_build.h |  2 ++
 xen/arch/x86/pv/dom0_build.c          | 10 ++--------
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 864dd9e53e..80308ca9af 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -320,6 +320,18 @@ unsigned long __init dom0_paging_pages(const struct domain *d,
     return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
 }
 
+int __init initdom_check_parms(
+    const struct domain *d, const struct elf_dom_parms *parms)
+{
+    if ( parms->elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE &&
+         is_hardware_domain(d) && !test_bit(XENFEAT_dom0, parms->f_supported) )
+    {
+        printk("Kernel does not support Dom0 operation\n");
+        return -EINVAL;
+    }
+
+    return 0;
+}
 
 /*
  * If allocation isn't specified, reserve 1/16th of available memory for
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index d69a83b089..aa06cdb2f7 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -692,6 +692,9 @@ static int __init pvh_load_kernel(
         return -EINVAL;
     }
 
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
+
     /* Copy the OS image and free temporary buffer. */
     elf.dest_base = (void *)(parms.virt_kstart - parms.virt_base);
     elf.dest_size = parms.virt_kend - parms.virt_kstart;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index ff021c24af..1332f18cc6 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -8,6 +8,8 @@
 
 extern unsigned int dom0_memflags;
 
+int initdom_check_parms(const struct domain *d,
+                        const struct elf_dom_parms *parms);
 unsigned long dom0_compute_nr_pages(struct domain *d,
                                     struct elf_dom_parms *parms,
                                     unsigned long initrd_len);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 075a3646c2..12d8ba744a 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -494,14 +494,8 @@ static int __init dom0_construct(const struct boot_domain *bd)
         return -EINVAL;
     }
 
-    if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE )
-    {
-        if ( !pv_shim && !test_bit(XENFEAT_dom0, parms.f_supported) )
-        {
-            printk("Kernel does not support Dom0 operation\n");
-            return -EINVAL;
-        }
-    }
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
 
     nr_pages = dom0_compute_nr_pages(d, &parms, initrd_len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 10:22:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 10:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278680.1563437 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wB8zz-0002Xx-Er; Fri, 10 Apr 2026 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278680.1563437; Fri, 10 Apr 2026 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 1wB8zz-0002Xo-C8; Fri, 10 Apr 2026 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1278680;
 Fri, 10 Apr 2026 10:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wB8zy-0002Xi-I0
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 10:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB8zy-002H3A-0y
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB8zy-00AarO-0A
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6VCo4yIikvxj+Y/yUCYVFiiyOWfJmKUjKpsSFfTia3o=; b=5qOSO1T93h0aIMEHq/gJmGxDjr
	gRmKxdMHf/0WgTmob7Z1UIbC0oYIwd+WKp6pIHISBUPewY1E6OKT7PZn2DNbYfTw8t1EGcJfPDZzI
	8Dfv3rf3HAMKwI0xQ/celEMjK2IeZfS8fd7SfUTC4fOIQ74UjsfVH2oThlP+arIXStEM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Fix off-by-one in iomem_deny_access() calls
Message-Id: <E1wB8zy-00AarO-0A@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 10:22:02 +0000

commit f25fe2452b821270ac62c2ee4f6dd4dea9ad3298
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Apr 9 13:39:32 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 10:31:04 2026 +0200

    xen/arm: Fix off-by-one in iomem_deny_access() calls
    
    iomem_deny_access() wraps rangeset_remove_range() which takes inclusive
    endpoints.  All call sites in the GIC and ACPI code pass 'mfn + nr' (or
    'mfn + 1' for single-page regions) as the end parameter, which causes
    one extra page beyond each region to be denied.
    
    For single-page regions, use 'mfn' as the end (denying exactly one page).
    For all multi-page regions, use 'mfn + nr - 1'.
    
    This matches the correct pattern used elsewhere, e.g. in device.c.
    
    Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
    Fixes: 66158be465 ("ARM: ITS: Deny hardware domain access to ITS")
    Fixes: 97e9875646 ("arm/acpi: Permit MMIO access of Xen unused devices for Dom0")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 xen/arch/arm/acpi/domain_build.c | 2 +-
 xen/arch/arm/gic-v2.c            | 8 ++++----
 xen/arch/arm/gic-v3-its.c        | 2 +-
 xen/arch/arm/gic-v3.c            | 8 ++++----
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 5a117001ef..249d899c33 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -48,7 +48,7 @@ static int __init acpi_iomem_deny_access(struct domain *d)
     {
         mfn = spcr->serial_port.address >> PAGE_SHIFT;
         /* Deny MMIO access for UART */
-        rc = iomem_deny_access(d, mfn, mfn + 1);
+        rc = iomem_deny_access(d, mfn, mfn);
         if ( rc )
             return rc;
     }
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index b23e72a3d0..014f955967 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -1079,23 +1079,23 @@ static int gicv2_iomem_deny_access(struct domain *d)
     unsigned long mfn, nr;
 
     mfn = dbase >> PAGE_SHIFT;
-    rc = iomem_deny_access(d, mfn, mfn + 1);
+    rc = iomem_deny_access(d, mfn, mfn);
     if ( rc )
         return rc;
 
     mfn = hbase >> PAGE_SHIFT;
-    rc = iomem_deny_access(d, mfn, mfn + 1);
+    rc = iomem_deny_access(d, mfn, mfn);
     if ( rc )
         return rc;
 
     mfn = cbase >> PAGE_SHIFT;
     nr = DIV_ROUND_UP(csize, PAGE_SIZE);
-    rc = iomem_deny_access(d, mfn, mfn + nr);
+    rc = iomem_deny_access(d, mfn, mfn + nr - 1);
     if ( rc )
         return rc;
 
     mfn = vbase >> PAGE_SHIFT;
-    return iomem_deny_access(d, mfn, mfn + nr);
+    return iomem_deny_access(d, mfn, mfn + nr - 1);
 }
 
 #ifdef CONFIG_ACPI
diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 9ba068c46f..e38aa87117 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -1009,7 +1009,7 @@ int gicv3_its_deny_access(struct domain *d)
     {
         mfn = paddr_to_pfn(its_data->addr);
         nr = PFN_UP(its_data->size);
-        rc = iomem_deny_access(d, mfn, mfn + nr);
+        rc = iomem_deny_access(d, mfn, mfn + nr - 1);
         if ( rc )
         {
             printk("iomem_deny_access failed for %lx:%lx \r\n", mfn, nr);
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index bc07f97c16..b3e104ea4a 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1602,7 +1602,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
 
     mfn = dbase >> PAGE_SHIFT;
     nr = PFN_UP(SZ_64K);
-    rc = iomem_deny_access(d, mfn, mfn + nr);
+    rc = iomem_deny_access(d, mfn, mfn + nr - 1);
     if ( rc )
         return rc;
 
@@ -1614,7 +1614,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     {
         mfn = gicv3.rdist_regions[i].base >> PAGE_SHIFT;
         nr = PFN_UP(gicv3.rdist_regions[i].size);
-        rc = iomem_deny_access(d, mfn, mfn + nr);
+        rc = iomem_deny_access(d, mfn, mfn + nr - 1);
         if ( rc )
             return rc;
     }
@@ -1623,7 +1623,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     {
         mfn = cbase >> PAGE_SHIFT;
         nr = PFN_UP(csize);
-        rc = iomem_deny_access(d, mfn, mfn + nr);
+        rc = iomem_deny_access(d, mfn, mfn + nr - 1);
         if ( rc )
             return rc;
     }
@@ -1632,7 +1632,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     {
         mfn = vbase >> PAGE_SHIFT;
         nr = PFN_UP(csize);
-        return iomem_deny_access(d, mfn, mfn + nr);
+        return iomem_deny_access(d, mfn, mfn + nr - 1);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 10:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278681.1563441 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wB909-0002Zh-G4; Fri, 10 Apr 2026 10:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278681.1563441; Fri, 10 Apr 2026 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 1wB909-0002ZZ-DS; Fri, 10 Apr 2026 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1278681;
 Fri, 10 Apr 2026 10:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wB908-0002ZR-79
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 10:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB908-002H3G-1I
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB908-00Aati-0T
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T8DVjuqDRNBFy6Mg6OkwO3MM+K1vDcqIZI7T/WxGvY8=; b=tH7N5VLHa7LpTxZVraiREITxDE
	P5fdVchJx/cX+bxmhO2ME9Gf49AruJbqi52I4LT/Hfio5XPCpiO5uwoLvArI3mC2qmRiOmdj4L7t7
	QbjjIMxv/Lid4WnRnck7dcVJROHxpWdq48DGX6Q1JqnmdueQ2c1V31mxwWcQEG9svATc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
Message-Id: <E1wB908-00Aati-0T@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 10:22:12 +0000

commit 9af54b65a4272e438d6b8508eb8d0749506856c3
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Apr 9 13:39:34 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 10:31:31 2026 +0200

    xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
    
    gicv3_iomem_deny_access() incorrectly uses csize (physical CPU
    interface size) instead of vsize (virtual CPU interface size) when
    calculating the number of pages to deny for the virtual CPU interface
    region at vbase.
    
    Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index b3e104ea4a..5641ee870f 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1631,7 +1631,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     if ( vbase != INVALID_PADDR )
     {
         mfn = vbase >> PAGE_SHIFT;
-        nr = PFN_UP(csize);
+        nr = PFN_UP(vsize);
         return iomem_deny_access(d, mfn, mfn + nr - 1);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 10:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 10:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278682.1563445 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wB90J-0002bt-HL; Fri, 10 Apr 2026 10:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278682.1563445; Fri, 10 Apr 2026 10: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 1wB90J-0002bl-Ep; Fri, 10 Apr 2026 10:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1278682;
 Fri, 10 Apr 2026 10:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wB90I-0002bd-A9
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 10:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB90I-002H3j-1Z
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB90I-00Aav6-0l
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ahj75ABUkeLRE70YgQOy0h/vHVAU59zBVetemkEktn4=; b=rXQG4izkp2b8A+xbsJlKG1+XtD
	MeuqucCYxR6uGCsclHvirG89hHxmQVuahuJwzmlFoXLnY5P9wMTOh1dyu+YfnSv287FyHueuNRHj/
	v1soKgC5t7cIYdUu18DeUBR/4bb/q3MLruiaTdZsVvaI3iCSVIQAeNiZgGLPHEqbtuQs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: llc-coloring: Fix off-by-one in parse_color_config()
Message-Id: <E1wB90I-00Aav6-0l@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 10:22:22 +0000

commit dc28f531e6a29a6fdd58f24073dfb48af06b8334
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Fri Apr 10 10:29:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 12:14:05 2026 +0200

    xen/common: llc-coloring: Fix off-by-one in parse_color_config()
    
    The check uses (*num_colors + (end - start + 1)) >= max_num_colors, which
    rejects a configuration where exactly max_num_colors colors are specified.
    For example, if max_num_colors is 4 and *num_colors is 0, a range "0-3"
    gives (end - start + 1) = 4, and (0 + 4) >= 4 is true, incorrectly
    returning -EINVAL.
    
    Fix this by switching the overflow condition to the state before commit
    cba8a584de17 that regressed the behavior (i.e. don't add 1).
    
    Fixes: cba8a584de17 ("llc-coloring: improve checking while parsing")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/common/llc-coloring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index eb7c72b240..6dc614739a 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -78,7 +78,7 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
 
         if ( end >= NR_LLC_COLORS || start > end ||
              (end - start) >= (UINT_MAX - *num_colors) ||
-             (*num_colors + (end - start + 1)) >= max_num_colors )
+             (*num_colors + (end - start)) >= max_num_colors )
             return -EINVAL;
 
         /* Colors are range checked in check_colors() */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 10:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 10:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278683.1563449 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wB90T-0002e8-Im; Fri, 10 Apr 2026 10:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278683.1563449; Fri, 10 Apr 2026 10: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 1wB90T-0002e0-G8; Fri, 10 Apr 2026 10:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1278683;
 Fri, 10 Apr 2026 10:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wB90S-0002du-D5
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 10:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB90S-002H3p-1r
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wB90S-00AawT-13
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FwS+7Zd+1meyfK2cvIKyatN41nikw0m5OE6fugEUNBQ=; b=ga/gq5pmXfdOqCKIBNuDV4o1sf
	xfQzPczfZE7jwkjxKefmpdBqh7nqcL7eUhp3y1pz052RVWTIBCT+u2xHdfxUrmNWU/+kV/GWzHz56
	sSd3MPhyKBzY/IRnwLlhs0fbOie7+XcioQlOTM61kvPMn1P0SZF903JYuH34D2jkG87o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: gic-v3: disable Group 1 before CPU power-down
Message-Id: <E1wB90S-00AawT-13@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 10:22:32 +0000

commit 18b718b6af3d38d8bed23439ec396fd4bde9b75d
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Fri Apr 10 09:47:45 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 12:14:05 2026 +0200

    xen/arm: gic-v3: disable Group 1 before CPU power-down
    
    gicv3_cpu_disable() currently writes 0 to ICC_CTLR_EL1. Unlike
    GICC_CTLR in the GICv2 path, ICC_CTLR_EL1 does not enable or disable
    physical Group 1 interrupt signalling, so this write only clears
    EOImode.
    
    The GICv3 power management rules require the physical group enables in
    the CPU interface to be cleared before the redistributor is driven into
    ProcessorSleep, otherwise behaviour is UNPREDICTABLE. Xen only enables
    Group 1 interrupts on this path, so disable the interface by clearing
    ICC_IGRPEN1_EL1 instead.
    
    This appears to be a copy of the GICv2 pattern where the enable control
    lives in CTLR, but for GICv3 the enable moved to ICC_IGRPEN1_EL1.
    
    Fixes: bc183a0235e ("xen/arm: Add support for GIC v3")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 5641ee870f..7f365cdbe9 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1028,7 +1028,7 @@ static int gicv3_cpu_init(void)
 
 static void gicv3_cpu_disable(void)
 {
-    WRITE_SYSREG(0, ICC_CTLR_EL1);
+    WRITE_SYSREG(0, ICC_IGRPEN1_EL1);
     isb();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 12:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 12:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278900.1563597 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBAhT-0008KA-LH; Fri, 10 Apr 2026 12:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278900.1563597; Fri, 10 Apr 2026 12: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 1wBAhT-0008K2-Id; Fri, 10 Apr 2026 12:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1278900;
 Fri, 10 Apr 2026 12:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBAhR-0008Jw-RO
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 12:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhR-002JCu-2e
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhR-00AqOs-1p
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h383jJKJkAfldqt1n1NvUTJG8L02YHAb8IJUONABsh8=; b=ijAPAEdQ2Q7a+7r3ulcKFBVkxH
	nghL778Wf8hSpIK2HthQjcSrIXxXPOgzHBIO0Hs7O2Po5lfYtieDIwxIKwkvnB3bqTDDJ8BgA5IHm
	TZulVowvpGstYteyw0CaJV9YIsNWy1/6N9GyoeZs7JhUc0J6MAT7hHrjZXWF0cPTGl3s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Fix off-by-one in iomem_deny_access() calls
Message-Id: <E1wBAhR-00AqOs-1p@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 12:11:01 +0000

commit f25fe2452b821270ac62c2ee4f6dd4dea9ad3298
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Apr 9 13:39:32 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 10:31:04 2026 +0200

    xen/arm: Fix off-by-one in iomem_deny_access() calls
    
    iomem_deny_access() wraps rangeset_remove_range() which takes inclusive
    endpoints.  All call sites in the GIC and ACPI code pass 'mfn + nr' (or
    'mfn + 1' for single-page regions) as the end parameter, which causes
    one extra page beyond each region to be denied.
    
    For single-page regions, use 'mfn' as the end (denying exactly one page).
    For all multi-page regions, use 'mfn + nr - 1'.
    
    This matches the correct pattern used elsewhere, e.g. in device.c.
    
    Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
    Fixes: 66158be465 ("ARM: ITS: Deny hardware domain access to ITS")
    Fixes: 97e9875646 ("arm/acpi: Permit MMIO access of Xen unused devices for Dom0")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 xen/arch/arm/acpi/domain_build.c | 2 +-
 xen/arch/arm/gic-v2.c            | 8 ++++----
 xen/arch/arm/gic-v3-its.c        | 2 +-
 xen/arch/arm/gic-v3.c            | 8 ++++----
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 5a117001ef..249d899c33 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -48,7 +48,7 @@ static int __init acpi_iomem_deny_access(struct domain *d)
     {
         mfn = spcr->serial_port.address >> PAGE_SHIFT;
         /* Deny MMIO access for UART */
-        rc = iomem_deny_access(d, mfn, mfn + 1);
+        rc = iomem_deny_access(d, mfn, mfn);
         if ( rc )
             return rc;
     }
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index b23e72a3d0..014f955967 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -1079,23 +1079,23 @@ static int gicv2_iomem_deny_access(struct domain *d)
     unsigned long mfn, nr;
 
     mfn = dbase >> PAGE_SHIFT;
-    rc = iomem_deny_access(d, mfn, mfn + 1);
+    rc = iomem_deny_access(d, mfn, mfn);
     if ( rc )
         return rc;
 
     mfn = hbase >> PAGE_SHIFT;
-    rc = iomem_deny_access(d, mfn, mfn + 1);
+    rc = iomem_deny_access(d, mfn, mfn);
     if ( rc )
         return rc;
 
     mfn = cbase >> PAGE_SHIFT;
     nr = DIV_ROUND_UP(csize, PAGE_SIZE);
-    rc = iomem_deny_access(d, mfn, mfn + nr);
+    rc = iomem_deny_access(d, mfn, mfn + nr - 1);
     if ( rc )
         return rc;
 
     mfn = vbase >> PAGE_SHIFT;
-    return iomem_deny_access(d, mfn, mfn + nr);
+    return iomem_deny_access(d, mfn, mfn + nr - 1);
 }
 
 #ifdef CONFIG_ACPI
diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 9ba068c46f..e38aa87117 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -1009,7 +1009,7 @@ int gicv3_its_deny_access(struct domain *d)
     {
         mfn = paddr_to_pfn(its_data->addr);
         nr = PFN_UP(its_data->size);
-        rc = iomem_deny_access(d, mfn, mfn + nr);
+        rc = iomem_deny_access(d, mfn, mfn + nr - 1);
         if ( rc )
         {
             printk("iomem_deny_access failed for %lx:%lx \r\n", mfn, nr);
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index bc07f97c16..b3e104ea4a 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1602,7 +1602,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
 
     mfn = dbase >> PAGE_SHIFT;
     nr = PFN_UP(SZ_64K);
-    rc = iomem_deny_access(d, mfn, mfn + nr);
+    rc = iomem_deny_access(d, mfn, mfn + nr - 1);
     if ( rc )
         return rc;
 
@@ -1614,7 +1614,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     {
         mfn = gicv3.rdist_regions[i].base >> PAGE_SHIFT;
         nr = PFN_UP(gicv3.rdist_regions[i].size);
-        rc = iomem_deny_access(d, mfn, mfn + nr);
+        rc = iomem_deny_access(d, mfn, mfn + nr - 1);
         if ( rc )
             return rc;
     }
@@ -1623,7 +1623,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     {
         mfn = cbase >> PAGE_SHIFT;
         nr = PFN_UP(csize);
-        rc = iomem_deny_access(d, mfn, mfn + nr);
+        rc = iomem_deny_access(d, mfn, mfn + nr - 1);
         if ( rc )
             return rc;
     }
@@ -1632,7 +1632,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     {
         mfn = vbase >> PAGE_SHIFT;
         nr = PFN_UP(csize);
-        return iomem_deny_access(d, mfn, mfn + nr);
+        return iomem_deny_access(d, mfn, mfn + nr - 1);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 12:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278901.1563601 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBAhd-0008Ly-Ml; Fri, 10 Apr 2026 12:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278901.1563601; Fri, 10 Apr 2026 12: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 1wBAhd-0008Lr-K1; Fri, 10 Apr 2026 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1278901;
 Fri, 10 Apr 2026 12:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBAhb-0008Ld-OT
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 12:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhb-002JD5-30
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhb-00AqPT-29
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1FcmsrujUn7ik3jTudrYEVNa/HWeAf9kawnIPoUvbQU=; b=CzX9G37moa6EaGL75TZoKJ0hGT
	cW9zKJeBHgUUOM0btGUIaQo1HEzGIDyV7Nv1vJwNylLEGqcB2Ch1Un4VpsvyKV4ry60xJIyg2fCUI
	6mHR7lh9Gc/LMFLdThIEPSgxo6TC7L2JLLiUEedGlTtvIUlo6bdeFrS8cA6o4BezidSw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
Message-Id: <E1wBAhb-00AqPT-29@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 12:11:11 +0000

commit 9af54b65a4272e438d6b8508eb8d0749506856c3
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Thu Apr 9 13:39:34 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 10:31:31 2026 +0200

    xen/arm: gic-v3: Use vsize instead of csize for virtual CPU interface
    
    gicv3_iomem_deny_access() incorrectly uses csize (physical CPU
    interface size) instead of vsize (virtual CPU interface size) when
    calculating the number of pages to deny for the virtual CPU interface
    region at vbase.
    
    Fixes: 8300b3377e ("arm/gic: Add a new callback to deny Dom0 access to GIC regions")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index b3e104ea4a..5641ee870f 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1631,7 +1631,7 @@ static int gicv3_iomem_deny_access(struct domain *d)
     if ( vbase != INVALID_PADDR )
     {
         mfn = vbase >> PAGE_SHIFT;
-        nr = PFN_UP(csize);
+        nr = PFN_UP(vsize);
         return iomem_deny_access(d, mfn, mfn + nr - 1);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 12:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278902.1563605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBAhn-0008O9-OM; Fri, 10 Apr 2026 12:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278902.1563605; Fri, 10 Apr 2026 12: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 1wBAhn-0008O2-Lh; Fri, 10 Apr 2026 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1278902;
 Fri, 10 Apr 2026 12:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBAhl-0008Nv-U8
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 12:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhm-002JDP-0L
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhl-00AqQ7-2U
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Dai0Q9ppAtjibbxfjbi+lBm1e38tcthqOgc0vin64wM=; b=W8phebcmQDsMv16QsknggfC785
	T1BKNpYuEXZLzO2LIxYc2Pdx5hTUlhtdjzFJOuj9v4wA7RTxN0k5ELfqgvk1ykDB+kDlSM7kpvrmm
	kwhsjuvDTQBocFzFFZgtWNyPb+LfaZRG07MYd5eKZsbcubQ9UGr/6YVOZdTz93uzJVCE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: llc-coloring: Fix off-by-one in parse_color_config()
Message-Id: <E1wBAhl-00AqQ7-2U@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 12:11:21 +0000

commit dc28f531e6a29a6fdd58f24073dfb48af06b8334
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Fri Apr 10 10:29:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 12:14:05 2026 +0200

    xen/common: llc-coloring: Fix off-by-one in parse_color_config()
    
    The check uses (*num_colors + (end - start + 1)) >= max_num_colors, which
    rejects a configuration where exactly max_num_colors colors are specified.
    For example, if max_num_colors is 4 and *num_colors is 0, a range "0-3"
    gives (end - start + 1) = 4, and (0 + 4) >= 4 is true, incorrectly
    returning -EINVAL.
    
    Fix this by switching the overflow condition to the state before commit
    cba8a584de17 that regressed the behavior (i.e. don't add 1).
    
    Fixes: cba8a584de17 ("llc-coloring: improve checking while parsing")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/common/llc-coloring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index eb7c72b240..6dc614739a 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -78,7 +78,7 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
 
         if ( end >= NR_LLC_COLORS || start > end ||
              (end - start) >= (UINT_MAX - *num_colors) ||
-             (*num_colors + (end - start + 1)) >= max_num_colors )
+             (*num_colors + (end - start)) >= max_num_colors )
             return -EINVAL;
 
         /* Colors are range checked in check_colors() */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 12:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 12:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1278903.1563609 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBAhx-0008QT-Pb; Fri, 10 Apr 2026 12:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1278903.1563609; Fri, 10 Apr 2026 12: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 1wBAhx-0008QL-N5; Fri, 10 Apr 2026 12:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1278903;
 Fri, 10 Apr 2026 12:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBAhw-0008QE-0G
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 12:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhw-002JDY-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12:11:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBAhv-00AqQY-34
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 12:11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FLcEsitmyu3VEbhgYYhy+tGIyP/fz4CnK2a8Am/gy2M=; b=ApOm/33lS0P07ut3T+KKTN7md0
	PTb+jeuD1oyBS7josTMA6YXy9MSUDsssFhn3HBmWx5BsxF1XdApCLRg8+ezmLGb0XB4ncM/qGqbon
	Usek6Ge0TStjHa+V+epetk8eKkXQFbdWvaYgN6uct02b4r56lGjiFosJUJMVJ1SbnzR4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gic-v3: disable Group 1 before CPU power-down
Message-Id: <E1wBAhv-00AqQY-34@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 12:11:31 +0000

commit 18b718b6af3d38d8bed23439ec396fd4bde9b75d
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Fri Apr 10 09:47:45 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 10 12:14:05 2026 +0200

    xen/arm: gic-v3: disable Group 1 before CPU power-down
    
    gicv3_cpu_disable() currently writes 0 to ICC_CTLR_EL1. Unlike
    GICC_CTLR in the GICv2 path, ICC_CTLR_EL1 does not enable or disable
    physical Group 1 interrupt signalling, so this write only clears
    EOImode.
    
    The GICv3 power management rules require the physical group enables in
    the CPU interface to be cleared before the redistributor is driven into
    ProcessorSleep, otherwise behaviour is UNPREDICTABLE. Xen only enables
    Group 1 interrupts on this path, so disable the interface by clearing
    ICC_IGRPEN1_EL1 instead.
    
    This appears to be a copy of the GICv2 pattern where the enable control
    lives in CTLR, but for GICv3 the enable moved to ICC_IGRPEN1_EL1.
    
    Fixes: bc183a0235e ("xen/arm: Add support for GIC v3")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 5641ee870f..7f365cdbe9 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1028,7 +1028,7 @@ static int gicv3_cpu_init(void)
 
 static void gicv3_cpu_disable(void)
 {
-    WRITE_SYSREG(0, ICC_CTLR_EL1);
+    WRITE_SYSREG(0, ICC_IGRPEN1_EL1);
     isb();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 14:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 14:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1279160.1563716 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBCZb-0004Rc-E2; Fri, 10 Apr 2026 14:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1279160.1563716; Fri, 10 Apr 2026 14: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 1wBCZb-0004RU-BX; Fri, 10 Apr 2026 14:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1279160;
 Fri, 10 Apr 2026 14:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBCZa-0004RO-Gp
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 14:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBCZa-002Lgc-1J
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 14:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBCZa-00B7sI-0T
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 14:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A1fnlXsNuRe0TS33MYpw7Xh5nAIVl8LfcnTwa2Heo8E=; b=zxbQb4mOX+e43IScszhOB1RlIv
	VuNwnCELV1AryV/Rc1EQqid9uDWERSdwkaR1v8WaxHnk+4PQR4cgLlZjWtgqIZ7NJquKJ8v9wH75c
	Ev6sZIHfXrXbg7Bnz9SKiA4mIwRSjiQ3bkw6p9AxQpQSddToLekZeWjQ+l6x6VOA4M9Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/uart: set a default baudrate if non specified neither found
Message-Id: <E1wBCZa-00B7sI-0T@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 14:11:02 +0000

commit 12e50da43d926cc5401c6ec1146cdcedaba23243
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 30 15:19:41 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 10 14:30:50 2026 +0200

    xen/uart: set a default baudrate if non specified neither found
    
    If the user has set baudrate as "auto" (use whatever was configured) but
    Xen cannot find any set baudrate use a default fallback baudrate of
    115200.
    
    Otherwise the console will very likely end up being non-functional, as
    further values are derived from the baudrate (like the transmit timeout),
    and using -1 will result in screwed parameters being derived from the
    baudrate.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/char/ns16550.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index a17a87de31..878da27f2e 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -346,9 +346,16 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         if ( divisor )
             uart->baud = uart->clock_hz / (divisor << 4);
         else
+        {
+            uart->baud = 115200;
             printk(XENLOG_ERR
                    "Automatic baud rate determination was requested,"
-                   " but a baud rate was not set up\n");
+                   " but a baud rate was not set up\n"
+                   "Setting baudrate to %u\n", uart->baud);
+            divisor = uart->clock_hz / (uart->baud << 4);
+            ns_write_reg(uart, UART_DLL, (uint8_t)divisor);
+            ns_write_reg(uart, UART_DLM, (uint8_t)(divisor >> 8));
+        }
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 14:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 14:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1279161.1563721 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBCZl-0004Ta-FW; Fri, 10 Apr 2026 14:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1279161.1563721; Fri, 10 Apr 2026 14: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 1wBCZl-0004TS-Cu; Fri, 10 Apr 2026 14:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1279161;
 Fri, 10 Apr 2026 14:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBCZk-0004TE-AU
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 14:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBCZk-002Lgp-1b
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 14:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBCZk-00B7vm-0n
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 14:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=32ffJqgXVNCUY2gih74r1REEA+5ytKl0dOjZNUvd3tY=; b=sMkkgqcOkWjJXHYt2HOj8f+d1S
	YZYS95I9+HkIshH2kxaj5/kZAAZFqnB7TE8qqac9xP/5yK6ijWfF+TToZ6e0kxfAcGh5zZIOt23wL
	rK9IXPbWdecla/sX7pqLzgk2l7ZiAUzwHoRV25YMSPqtIFGgDea2KZRGIOedY36L78t8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: do not kill calibration timer on suspend
Message-Id: <E1wBCZk-00B7vm-0n@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 14:11:12 +0000

commit 2d670d258b2e592d44deb5ee12e7c2ba1d79d8a9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Apr 10 10:46:39 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 10 14:31:10 2026 +0200

    x86/time: do not kill calibration timer on suspend
    
    A killed timer will ignore further set_timer() calls, and hence won't be
    re-armed unless it's initialized again.  Use stop_timer() instead of
    kill_timer() in time_suspend(), so that the set_timer() call in
    time_resume() successfully re-arms the timer.  Otherwise time calibration
    is no longer scheduled (and executed) after resuming from S3 suspend.
    
    Fixes: 6d90db1a2ca1 ("x86: rendezvous-based local time calibration")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index fed30a919d..4233ea507d 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2728,7 +2728,7 @@ int time_suspend(void)
     {
         cmos_utc_offset = -get_wallclock_time();
         cmos_utc_offset += get_sec();
-        kill_timer(&calibration_timer);
+        stop_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
         platform_time_calibration();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 16:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 16:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1279547.1563950 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBERk-0000TC-0t; Fri, 10 Apr 2026 16:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1279547.1563950; Fri, 10 Apr 2026 16: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 1wBERj-0000T4-UZ; Fri, 10 Apr 2026 16:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1279547;
 Fri, 10 Apr 2026 16:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBERi-0000Ss-5Y
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 16:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBERi-002Oai-0S
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 16:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBERh-00BLop-2s
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 16: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0hpyP/1bXkujwo5hdQDneQ+hE55EAeJBa83DqYZmORk=; b=YwwCeHjTG0m8ZWJk0URd6Uu+v1
	osNR8HJx2qIcq7XPUMX3qCJfKSVaFxzRPRFjo9fkO64TYkeZjYofxCUz1+AIXehz0707Hz891e48Z
	jw8c5XArgj9RGJhyUg3m/DK5wCtTi5YeHc9uQxPZ7dr5aqLk7DOQBlV/S0VdmQLgWbCo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/uart: set a default baudrate if non specified neither found
Message-Id: <E1wBERh-00BLop-2s@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 16:11:01 +0000

commit 12e50da43d926cc5401c6ec1146cdcedaba23243
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Mar 30 15:19:41 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 10 14:30:50 2026 +0200

    xen/uart: set a default baudrate if non specified neither found
    
    If the user has set baudrate as "auto" (use whatever was configured) but
    Xen cannot find any set baudrate use a default fallback baudrate of
    115200.
    
    Otherwise the console will very likely end up being non-functional, as
    further values are derived from the baudrate (like the transmit timeout),
    and using -1 will result in screwed parameters being derived from the
    baudrate.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/char/ns16550.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index a17a87de31..878da27f2e 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -346,9 +346,16 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         if ( divisor )
             uart->baud = uart->clock_hz / (divisor << 4);
         else
+        {
+            uart->baud = 115200;
             printk(XENLOG_ERR
                    "Automatic baud rate determination was requested,"
-                   " but a baud rate was not set up\n");
+                   " but a baud rate was not set up\n"
+                   "Setting baudrate to %u\n", uart->baud);
+            divisor = uart->clock_hz / (uart->baud << 4);
+            ns_write_reg(uart, UART_DLL, (uint8_t)divisor);
+            ns_write_reg(uart, UART_DLM, (uint8_t)(divisor >> 8));
+        }
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 10 16:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Apr 2026 16:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1279549.1563954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBERu-0000Ui-2r; Fri, 10 Apr 2026 16:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1279549.1563954; Fri, 10 Apr 2026 16:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wBERt-0000UZ-W5; Fri, 10 Apr 2026 16:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1279549;
 Fri, 10 Apr 2026 16:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wBERs-0000UL-2v
 for xen-changelog@lists.xenproject.org; Fri, 10 Apr 2026 16:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBERs-002Oaw-0p
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 16:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wBERr-00BLpe-3B
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Apr 2026 16: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Cq/v5NDYhrmyy99LqMzcVgcxWpSF5Rib4IBWdlBO1w8=; b=uAXBig+r1f97D3D79cTVjUyOWs
	AHyAW6mbtPcFF4dm/cq8NO1t6EL5BNbkVTq0Jna+v6Wil++yTSGExTWgCdDB6921aWZcjzsOtmqCH
	suUrkG7zC87I0KtaajE7K8a/dqDuIrrpfjnsdiv3aK+91YHI1QJIi+7LNCq1WSsLYpX4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: do not kill calibration timer on suspend
Message-Id: <E1wBERr-00BLpe-3B@xenbits.xenproject.org>
Date: Fri, 10 Apr 2026 16:11:11 +0000

commit 2d670d258b2e592d44deb5ee12e7c2ba1d79d8a9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Apr 10 10:46:39 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Apr 10 14:31:10 2026 +0200

    x86/time: do not kill calibration timer on suspend
    
    A killed timer will ignore further set_timer() calls, and hence won't be
    re-armed unless it's initialized again.  Use stop_timer() instead of
    kill_timer() in time_suspend(), so that the set_timer() call in
    time_resume() successfully re-arms the timer.  Otherwise time calibration
    is no longer scheduled (and executed) after resuming from S3 suspend.
    
    Fixes: 6d90db1a2ca1 ("x86: rendezvous-based local time calibration")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index fed30a919d..4233ea507d 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2728,7 +2728,7 @@ int time_suspend(void)
     {
         cmos_utc_offset = -get_wallclock_time();
         cmos_utc_offset += get_sec();
-        kill_timer(&calibration_timer);
+        stop_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
         platform_time_calibration();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 10:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 10:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283209.1565477 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDK1w-0005Wc-3x; Thu, 16 Apr 2026 10:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283209.1565477; Thu, 16 Apr 2026 10:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDK1w-0005WT-1F; Thu, 16 Apr 2026 10:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1283209;
 Thu, 16 Apr 2026 10:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDK1u-0005W4-Hw
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 10:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDK1u-004lW0-0d
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 10:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDK1u-005UEF-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 10:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=91qZTPVZ9tnClvOk+xQKC0SQudD2PReogN0FiYTgAao=; b=il12DwBvK9uYjK+ecb4rcKMeMg
	/vvEhNqXfrz5GLkYkJpEwT/bgMjrfxhjxr3iFPt7+gUybSW0HYkL8lQTv0UnGMKKrskUcetFL7KZ4
	ZSf+ZdtRh8lt8oVy4uMkuyvquB7HA2N4Wnxi2lKf+5w7EgRHiYkXEjMj7ByUC62Rue74=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: avoid multi-message-MSI check for HPET
Message-Id: <E1wDK1u-005UEF-0U@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 10:33:02 +0000

commit 3ba01239bfe626e2eea2c0faabae3165219dbb2c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 16 10:29:14 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 16 10:29:14 2026 +0200

    VT-d: avoid multi-message-MSI check for HPET
    
    Having this immediately below a PCI-dev vs HPET conditional is (mildly)
    confusing. Move that if() into the body of the earlier one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/intremap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index afa8eb3756..dd2788efd7 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -513,13 +513,13 @@ static int msi_msg_to_remap_entry(
 
         if ( rc )
             return rc;
+
+        if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
+            nr = msi_desc->msi.nvec;
     }
     else
         set_hpet_source_id(msi_desc->hpet_id, &new_ire);
 
-    if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
-        nr = msi_desc->msi.nvec;
-
     spin_lock_irqsave(&iommu->intremap.lock, flags);
 
     if ( msg == NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 10:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 10:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283210.1565481 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDK26-0005Y7-5H; Thu, 16 Apr 2026 10:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283210.1565481; Thu, 16 Apr 2026 10:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDK26-0005Xz-2b; Thu, 16 Apr 2026 10:33:14 +0000
Received: by outflank-mailman (input) for mailman id 1283210;
 Thu, 16 Apr 2026 10:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDK24-0005Xa-E8
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 10:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDK24-004lW4-0x
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 10:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDK24-005UEi-0o
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 10:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kMp8kbGaqN4eDZvAyYvCNED423QbPHYzkyk/VYkhOD0=; b=p1yuL5DCa07tITk0t//41yjgXs
	G4qAUIGStDIvBz1kQ0OnbO7mYOUCHF/5N2wiI3wapcgfQnEpiWbuYEAKylpFLQF5a2FAuB7qL+uM4
	5s37mhrO7S+JFilrWd89Vsc883OP43gZ10N6UOk3j3hdymu6SacrhzTW7rgBnrjFXNb4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/APIC: handle overflow in TMICT calculation
Message-Id: <E1wDK24-005UEi-0o@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 10:33:12 +0000

commit 4f14d97a620c3a005ad0604ae47ee6091281cda0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 16 10:29:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 16 10:29:54 2026 +0200

    x86/APIC: handle overflow in TMICT calculation
    
    With an expiry value on the order of 10 hours, and with a bus scale value
    of 256k (as supplied by qemu), the (signed) multiplication will be UB. As
    we've checked that the value is positive, we mean unsigned multiplication
    anyway. Yet let's play safe against even larger expiry and bus scale
    values, leveraging the compiler builtin that there is for this purpose.
    
    While there also drop the stray cast from the actual TMICT write.
    
    Fixes: 9062553a0dc1 ("added time and accurate timer support")
    Fixes: b95beb185810 ("x86: Clean up APIC local timer handling")
    Reported-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/x86/apic.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index d69ef9e16a..176f1498e3 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1224,10 +1224,16 @@ int reprogram_timer(s_time_t timeout)
     }
 
     if ( timeout && ((expire = timeout - NOW()) > 0) )
-        apic_tmict = min_t(uint64_t, (bus_scale * expire) >> BUS_SCALE_SHIFT,
-                           UINT32_MAX);
+    {
+        unsigned long product;
+
+        apic_tmict = UINT32_MAX;
+        if ( !__builtin_umull_overflow(bus_scale, expire, &product) &&
+             (product >>= BUS_SCALE_SHIFT) < apic_tmict )
+            apic_tmict = product;
+    }
 
-    apic_write(APIC_TMICT, (unsigned long)apic_tmict);
+    apic_write(APIC_TMICT, apic_tmict);
 
     return apic_tmict || !timeout;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 10:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 10:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283211.1565485 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDK2G-0005aV-6h; Thu, 16 Apr 2026 10:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283211.1565485; Thu, 16 Apr 2026 10:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDK2G-0005aN-3w; Thu, 16 Apr 2026 10:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1283211;
 Thu, 16 Apr 2026 10:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDK2E-0005a2-EA
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 10:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDK2E-004lWC-1F
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 10:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDK2E-005UGC-18
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yxtgaPeI8uPGd0nBtfYusIFWC8fxV6cgTkGO31S1TIc=; b=NwYqqCh7dinW1ur96G13XUSKEo
	tjQAWMo/+Wsu02u7m/k1vdv8OGsA2QytWrhK88i/UvHNOpm17+gBEDFkW1K49LA2t0IY/P6fh350D
	Yo4mniwiSeuSHMbR22vjs6w+QdsRE6k3e9cvBedPk7dQ6P58Pdb1Nijr1e7Ra7gNEN1Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: channel handling in hpet_broadcast_resume()
Message-Id: <E1wDK2E-005UGC-18@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 10:33:22 +0000

commit c4d51191954c53590767c26e501e6dadf923bc47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 16 10:44:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 16 10:44:16 2026 +0200

    x86/HPET: channel handling in hpet_broadcast_resume()
    
    The per-channel ENABLE bit is to solely be driven by hpet_enable_channel()
    and hpet_msi_{,un}mask(). It doesn't need setting immediately. Except for
    the (possible) channel put in legacy mode we don't do so during boot
    either.
    
    Instead reset ->arch.cpu_mask, to avoid msi_compose_msg() yielding an
    all-zero message (when the passed in CPU mask has no online CPUs). Nothing
    would later call msi_compose_msg() / hpet_msi_write(), and hence nothing
    would later produce a well-formed message template in
    hpet_events[].msi.msg.
    
    Fixes: 15aa6c67486c ("amd iommu: use base platform MSI implementation")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1ea8ae4574..e9d6cf2c52 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -685,12 +685,18 @@ void hpet_broadcast_resume(void)
     for ( i = 0; i < n; i++ )
     {
         if ( hpet_events[i].msi.irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
+        {
+            struct irq_desc *desc = irq_to_desc(hpet_events[i].msi.irq);
+
+            cpumask_copy(desc->arch.cpu_mask, cpumask_of(smp_processor_id()));
+
+            __hpet_setup_msi_irq(desc);
+        }
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
+        cfg |= HPET_TN_32BIT;
         if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
             cfg |= HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 11:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 11:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283265.1565542 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDL8d-0007lL-6x; Thu, 16 Apr 2026 11:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283265.1565542; Thu, 16 Apr 2026 11: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 1wDL8d-0007lB-3X; Thu, 16 Apr 2026 11:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1283265;
 Thu, 16 Apr 2026 11:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDL8c-0007l3-0p
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 11:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDL8b-004moe-2z
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDL8b-005Yuc-2e
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=USh0iVjRJ/upMz/3zEeg7esOVR8Pu8bJA9gAp5/Mbk8=; b=p6KhYyrq4XtgTb11lGzG9rbhyf
	zMOSwWcWgv6Mjdv2KfHj/rlVuyqbNWqRc6MMzYBgCjQetNSF2sTUUNMqa4fCBjlMaKwGSafs5XeVF
	H1uoOtQXrac0Q6+Q3b1ucM4sQPr7rDbs62HDnn6E5aTysxhvWr0HLRdyFrUE6LCBRxLY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: avoid multi-message-MSI check for HPET
Message-Id: <E1wDL8b-005Yuc-2e@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 11:44:01 +0000

commit 3ba01239bfe626e2eea2c0faabae3165219dbb2c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 16 10:29:14 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 16 10:29:14 2026 +0200

    VT-d: avoid multi-message-MSI check for HPET
    
    Having this immediately below a PCI-dev vs HPET conditional is (mildly)
    confusing. Move that if() into the body of the earlier one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/intremap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index afa8eb3756..dd2788efd7 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -513,13 +513,13 @@ static int msi_msg_to_remap_entry(
 
         if ( rc )
             return rc;
+
+        if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
+            nr = msi_desc->msi.nvec;
     }
     else
         set_hpet_source_id(msi_desc->hpet_id, &new_ire);
 
-    if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
-        nr = msi_desc->msi.nvec;
-
     spin_lock_irqsave(&iommu->intremap.lock, flags);
 
     if ( msg == NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 11:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283266.1565543 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDL8n-0007ni-7I; Thu, 16 Apr 2026 11:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283266.1565543; Thu, 16 Apr 2026 11: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 1wDL8n-0007na-4n; Thu, 16 Apr 2026 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1283266;
 Thu, 16 Apr 2026 11:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDL8m-0007nP-1g
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 11:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDL8m-004mow-02
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDL8l-005YwM-39
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IiVS+fTuw6CaX6PykxUuwNyLxTl5RJ8gEtCW5zpGiiM=; b=PP4zONSSGXnkBkuYPEfI7+TSzh
	BiiVCs8R6i1PTeFq/xRlHa/MTfZ858wSuqXCj7yNo7oMOy+/w214e7N89IsW42NuxBB7s6Zpam42V
	Q4bNZXsitkpIxzSPT+LTtNfIHtTIpLcZ6SzxSFSQtmbyIqf8kCcwQkBApSdLHCoTwTn4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/APIC: handle overflow in TMICT calculation
Message-Id: <E1wDL8l-005YwM-39@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 11:44:11 +0000

commit 4f14d97a620c3a005ad0604ae47ee6091281cda0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 16 10:29:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 16 10:29:54 2026 +0200

    x86/APIC: handle overflow in TMICT calculation
    
    With an expiry value on the order of 10 hours, and with a bus scale value
    of 256k (as supplied by qemu), the (signed) multiplication will be UB. As
    we've checked that the value is positive, we mean unsigned multiplication
    anyway. Yet let's play safe against even larger expiry and bus scale
    values, leveraging the compiler builtin that there is for this purpose.
    
    While there also drop the stray cast from the actual TMICT write.
    
    Fixes: 9062553a0dc1 ("added time and accurate timer support")
    Fixes: b95beb185810 ("x86: Clean up APIC local timer handling")
    Reported-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/x86/apic.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index d69ef9e16a..176f1498e3 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1224,10 +1224,16 @@ int reprogram_timer(s_time_t timeout)
     }
 
     if ( timeout && ((expire = timeout - NOW()) > 0) )
-        apic_tmict = min_t(uint64_t, (bus_scale * expire) >> BUS_SCALE_SHIFT,
-                           UINT32_MAX);
+    {
+        unsigned long product;
+
+        apic_tmict = UINT32_MAX;
+        if ( !__builtin_umull_overflow(bus_scale, expire, &product) &&
+             (product >>= BUS_SCALE_SHIFT) < apic_tmict )
+            apic_tmict = product;
+    }
 
-    apic_write(APIC_TMICT, (unsigned long)apic_tmict);
+    apic_write(APIC_TMICT, apic_tmict);
 
     return apic_tmict || !timeout;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 11:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283267.1565548 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDL8x-0007q0-8r; Thu, 16 Apr 2026 11:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283267.1565548; Thu, 16 Apr 2026 11: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 1wDL8x-0007ps-6B; Thu, 16 Apr 2026 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1283267;
 Thu, 16 Apr 2026 11:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDL8w-0007pm-5s
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 11:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDL8w-004mp2-0V
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDL8w-005Yzg-0C
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EVdVneoi9iOkY51dEoSLCb3bfw8u+vW2Q7XLEoPhWjs=; b=Hm6C7DyrkZ8BsfOJzTcxTifiOM
	UkNaPvTwgnUbrLnoqxr9u/JEXyTfdpRsCtHnQT6MzQmRNdSKDnkp6GeFFoCJ19T19oPpRQMxS2SmF
	NGlX0W2j2nsDIAiH5f2P6sXk70yPnVSxSb9vVEELFUzpzQlOhR669Cxwe0OzkArR3Oyk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: channel handling in hpet_broadcast_resume()
Message-Id: <E1wDL8w-005Yzg-0C@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 11:44:22 +0000

commit c4d51191954c53590767c26e501e6dadf923bc47
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 16 10:44:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 16 10:44:16 2026 +0200

    x86/HPET: channel handling in hpet_broadcast_resume()
    
    The per-channel ENABLE bit is to solely be driven by hpet_enable_channel()
    and hpet_msi_{,un}mask(). It doesn't need setting immediately. Except for
    the (possible) channel put in legacy mode we don't do so during boot
    either.
    
    Instead reset ->arch.cpu_mask, to avoid msi_compose_msg() yielding an
    all-zero message (when the passed in CPU mask has no online CPUs). Nothing
    would later call msi_compose_msg() / hpet_msi_write(), and hence nothing
    would later produce a well-formed message template in
    hpet_events[].msi.msg.
    
    Fixes: 15aa6c67486c ("amd iommu: use base platform MSI implementation")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1ea8ae4574..e9d6cf2c52 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -685,12 +685,18 @@ void hpet_broadcast_resume(void)
     for ( i = 0; i < n; i++ )
     {
         if ( hpet_events[i].msi.irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
+        {
+            struct irq_desc *desc = irq_to_desc(hpet_events[i].msi.irq);
+
+            cpumask_copy(desc->arch.cpu_mask, cpumask_of(smp_processor_id()));
+
+            __hpet_setup_msi_irq(desc);
+        }
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
+        cfg |= HPET_TN_32BIT;
         if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
             cfg |= HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 15:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 15:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283659.1565820 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDOMx-0000kE-51; Thu, 16 Apr 2026 15:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283659.1565820; Thu, 16 Apr 2026 15: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 1wDOMx-0000k6-2S; Thu, 16 Apr 2026 15:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1283659;
 Thu, 16 Apr 2026 15:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDOMw-0000k0-DU
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 15:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDOMw-004qz2-0k
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 15:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDOMw-005mqJ-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 15:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DZrs32xgKSaVjcWdVSH3XZbNUGvbJjs0D+lbYVqitZ8=; b=ENj+ZWaUGq4hDjxthfXxFCxM8L
	1cEhSLyk79MCbiBMZMwYtUOR8qMJScBjZhmBx5ST8hIXajgC0cUnflAosTieJS++Hg2xr/d+hHCIJ
	dFzKnEcuz20BdNuh15sVaZw1eVe+stwmpvBWBM7sgx/gX8Rj8ySxQRZ4XXHDfD+ZFf+w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: use native TSC scaling factors when TSC is not scaled
Message-Id: <E1wDOMw-005mqJ-0b@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 15:11:02 +0000

commit 305c6b901a44aa6e16d3bf7d104d7c08331d1731
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 14 09:13:33 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Apr 16 15:28:32 2026 +0200

    x86/time: use native TSC scaling factors when TSC is not scaled
    
    When running HVM guest in native TSC mode avoid using the recalculated vTSC
    scaling factors based on the cpu_khz value.  Using the kHz based frequency
    leads to the TSC scaling values possibly not being the same as the ones
    used by the per CPU cpu_time->tsc_scale field, which introduces skew
    between the guest and Xen's calculations of the system time.
    
    On a 2gHz system, where the frequency is possibly detected as 1999999999Hz
    (note this is a worse-case scenario), the cpu_khz variable will be set to
    1999999kHz, and hence 999Hz cycles will be not accounted for per second.
    Over a second (the time synchronization period), this leads to a skew of:
    
    cycles * 1 / (Hz freq) = 999 / 1999999999 = 499,5ns
    
    So far this has gone unnoticed because the time synchronization rendezvous
    forces the update of the tsc_timestamp and system_time fields in the vCPU
    time info area, and hence the skew only accumulates up to the rendezvous
    period.  Attempting to remove the rendezvous causes the skew to grow
    unbounded.
    
    Fix by using the native TSC scaling values (as used by Xen) when the guest
    TSC is not scaled.
    
    Fixes: eab8a90be723 ("x86/time: scale host TSC in pvclock properly")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/time.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 4233ea507d..244277c0a9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1710,17 +1710,25 @@ static void collect_time_info(const struct vcpu *v,
     else
     {
         if ( is_hvm_domain(d) && hvm_tsc_scaling_supported )
-        {
             tsc_stamp            = hvm_scale_tsc(d, t->stamp.local_tsc);
-            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
-            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
-        }
         else
-        {
             tsc_stamp            = t->stamp.local_tsc;
+
+        /*
+         * HVM guests using the native TSC ratio should use the same per-CPU
+         * scaling factors as Xen.  This ensures time keeping is always in sync
+         * between Xen and the guest.
+         */
+        if ( tsc_stamp == t->stamp.local_tsc )
+        {
             u->tsc_to_system_mul = t->tsc_scale.mul_frac;
             u->tsc_shift         = t->tsc_scale.shift;
         }
+        else
+        {
+            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
     }
 
     u->tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 15:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 15:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283660.1565825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDON7-0000mN-6h; Thu, 16 Apr 2026 15:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283660.1565825; Thu, 16 Apr 2026 15: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 1wDON7-0000mF-3p; Thu, 16 Apr 2026 15:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1283660;
 Thu, 16 Apr 2026 15:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDON6-0000m9-Bh
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 15:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDON6-004qz9-12
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 15:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDON6-005mqu-0w
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 15:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NT5lA+2jT+ePW1kZJmI2oQSW3BYKMzSN1yZmrpi44N4=; b=rVRwjyFsA0897OaEYB0QJeVFgx
	5TTaZ7o0IER4xm3MGim28mVjkWsPfEAKhLNv5zrPWOAuNUNYU4cbllPiMcdoYXx4Tpk4rArHdqVXZ
	MP5KIZ3+vpP5KS7C1vYTB4p8Rz9NtN6ypGuk2ccQTLySh+tmCyCm9rEKGZTLZihLd2y8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/cpu: round cpu_khz calculations
Message-Id: <E1wDON6-005mqu-0w@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 15:11:12 +0000

commit 986707b461eb56d75f55581dd1c8e2633f814795
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 14 09:38:55 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Apr 16 15:28:32 2026 +0200

    xen/cpu: round cpu_khz calculations
    
    All arches truncate the cpu_khz without taking into account the less
    significant digits.  Instead use DIV_ROUND() when scaling from Hz to kHz
    to get as more accurate kHz value.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/time.c   | 4 ++--
 xen/arch/riscv/time.c | 2 +-
 xen/arch/x86/time.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index a12912a106..6955b2788f 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -118,7 +118,7 @@ static void __init preinit_dt_xen_time(void)
     res = dt_property_read_u32(timer, "clock-frequency", &rate);
     if ( res )
     {
-        cpu_khz = rate / 1000;
+        cpu_khz = DIV_ROUND(rate, 1000);
         validate_timer_frequency();
         timer_dt_clock_frequency = rate;
     }
@@ -136,7 +136,7 @@ void __init preinit_xen_time(void)
 
     if ( !cpu_khz )
     {
-        cpu_khz = (READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK) / 1000;
+        cpu_khz = DIV_ROUND(READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK, 1000);
         validate_timer_frequency();
     }
 
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 7efa76fdbc..698ab49d12 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -40,7 +40,7 @@ static void __init preinit_dt_xen_time(void)
     if ( !dt_property_read_u32(timer, "timebase-frequency", &rate) )
         panic("Unable to find clock frequency\n");
 
-    cpu_khz = rate / 1000;
+    cpu_khz = DIV_ROUND(rate, 1000);
 }
 
 int reprogram_timer(s_time_t timeout)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 244277c0a9..008d9e97d9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2642,7 +2642,7 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
-    cpu_khz = tmp / 1000;
+    cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 16:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 16:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283773.1565902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDPJ1-0005ba-7q; Thu, 16 Apr 2026 16:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283773.1565902; Thu, 16 Apr 2026 16: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 1wDPJ1-0005bS-4P; Thu, 16 Apr 2026 16:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1283773;
 Thu, 16 Apr 2026 16:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDPIz-0005bI-V2
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 16:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDPIz-004sWK-2i
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 16:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDPIz-005r3T-2Z
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 16: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ugDEIQ/t4/mEQYA0kDJ0NaI0CMlPfDUwJCbSH+TCOVg=; b=spAw3WmKZOgs7okpNDdpzUiWPi
	nGnKyfTXItdkkq0DFah6nxIeByYS8e8nQazISWx/6+b8jbiuw0zxxkHAXczYvIAO7/cK8MAvbkG/4
	fRJZvONOjXigPaAEg7dZpNNqUOFiafGQ4qZ2qMiDZs+eA37ga7vm7E7fu8owHMtasfEQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: use native TSC scaling factors when TSC is not scaled
Message-Id: <E1wDPIz-005r3T-2Z@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 16:11:01 +0000

commit 305c6b901a44aa6e16d3bf7d104d7c08331d1731
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 14 09:13:33 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Apr 16 15:28:32 2026 +0200

    x86/time: use native TSC scaling factors when TSC is not scaled
    
    When running HVM guest in native TSC mode avoid using the recalculated vTSC
    scaling factors based on the cpu_khz value.  Using the kHz based frequency
    leads to the TSC scaling values possibly not being the same as the ones
    used by the per CPU cpu_time->tsc_scale field, which introduces skew
    between the guest and Xen's calculations of the system time.
    
    On a 2gHz system, where the frequency is possibly detected as 1999999999Hz
    (note this is a worse-case scenario), the cpu_khz variable will be set to
    1999999kHz, and hence 999Hz cycles will be not accounted for per second.
    Over a second (the time synchronization period), this leads to a skew of:
    
    cycles * 1 / (Hz freq) = 999 / 1999999999 = 499,5ns
    
    So far this has gone unnoticed because the time synchronization rendezvous
    forces the update of the tsc_timestamp and system_time fields in the vCPU
    time info area, and hence the skew only accumulates up to the rendezvous
    period.  Attempting to remove the rendezvous causes the skew to grow
    unbounded.
    
    Fix by using the native TSC scaling values (as used by Xen) when the guest
    TSC is not scaled.
    
    Fixes: eab8a90be723 ("x86/time: scale host TSC in pvclock properly")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/time.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 4233ea507d..244277c0a9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1710,17 +1710,25 @@ static void collect_time_info(const struct vcpu *v,
     else
     {
         if ( is_hvm_domain(d) && hvm_tsc_scaling_supported )
-        {
             tsc_stamp            = hvm_scale_tsc(d, t->stamp.local_tsc);
-            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
-            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
-        }
         else
-        {
             tsc_stamp            = t->stamp.local_tsc;
+
+        /*
+         * HVM guests using the native TSC ratio should use the same per-CPU
+         * scaling factors as Xen.  This ensures time keeping is always in sync
+         * between Xen and the guest.
+         */
+        if ( tsc_stamp == t->stamp.local_tsc )
+        {
             u->tsc_to_system_mul = t->tsc_scale.mul_frac;
             u->tsc_shift         = t->tsc_scale.shift;
         }
+        else
+        {
+            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
     }
 
     u->tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 16 16:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Apr 2026 16:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283775.1565904 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDPJB-0005eI-8H; Thu, 16 Apr 2026 16:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283775.1565904; Thu, 16 Apr 2026 16: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 1wDPJB-0005eA-5m; Thu, 16 Apr 2026 16:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1283775;
 Thu, 16 Apr 2026 16:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDPJ9-0005dt-Vc
 for xen-changelog@lists.xenproject.org; Thu, 16 Apr 2026 16:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDPJ9-004sWe-33
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 16:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDPJ9-005r4U-2u
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Apr 2026 16: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/XNrWVa0weET3b+OPe2LeNgpEZQgbogAF7hxNiLIG2U=; b=Yg8wcAS9263e2zjmlHdjfsGiB/
	qCc9iODYpQ0Z1VisxLVTJMMmqX2Fb3Qp5/WVSSjNEZopzmEk4qFzHBPw6CL5+Ae090G/zvA0ISpna
	KeXMVpKHUI9d8F53ryrmvNM4GuF+jARbdABRYAh39RIMgwtWzpgsPHvm3yLdMLc+ZvXw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/cpu: round cpu_khz calculations
Message-Id: <E1wDPJ9-005r4U-2u@xenbits.xenproject.org>
Date: Thu, 16 Apr 2026 16:11:11 +0000

commit 986707b461eb56d75f55581dd1c8e2633f814795
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 14 09:38:55 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Apr 16 15:28:32 2026 +0200

    xen/cpu: round cpu_khz calculations
    
    All arches truncate the cpu_khz without taking into account the less
    significant digits.  Instead use DIV_ROUND() when scaling from Hz to kHz
    to get as more accurate kHz value.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/time.c   | 4 ++--
 xen/arch/riscv/time.c | 2 +-
 xen/arch/x86/time.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index a12912a106..6955b2788f 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -118,7 +118,7 @@ static void __init preinit_dt_xen_time(void)
     res = dt_property_read_u32(timer, "clock-frequency", &rate);
     if ( res )
     {
-        cpu_khz = rate / 1000;
+        cpu_khz = DIV_ROUND(rate, 1000);
         validate_timer_frequency();
         timer_dt_clock_frequency = rate;
     }
@@ -136,7 +136,7 @@ void __init preinit_xen_time(void)
 
     if ( !cpu_khz )
     {
-        cpu_khz = (READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK) / 1000;
+        cpu_khz = DIV_ROUND(READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK, 1000);
         validate_timer_frequency();
     }
 
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 7efa76fdbc..698ab49d12 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -40,7 +40,7 @@ static void __init preinit_dt_xen_time(void)
     if ( !dt_property_read_u32(timer, "timebase-frequency", &rate) )
         panic("Unable to find clock frequency\n");
 
-    cpu_khz = rate / 1000;
+    cpu_khz = DIV_ROUND(rate, 1000);
 }
 
 int reprogram_timer(s_time_t timeout)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 244277c0a9..008d9e97d9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2642,7 +2642,7 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
-    cpu_khz = tmp / 1000;
+    cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 07:00:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 07:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283971.1565936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDdBL-0007iR-5O; Fri, 17 Apr 2026 07:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283971.1565936; Fri, 17 Apr 2026 07:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDdBL-0007hu-1t; Fri, 17 Apr 2026 07:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1283971;
 Fri, 17 Apr 2026 07:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDdBK-0007ZK-LK
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 07:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDdBK-006HKo-1B
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 07:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDdBK-006wgy-0y
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+4NoGiBfzx2TtZFGEKcH/zMvS0lLbyVUvTjuvSI2prI=; b=4G+YDF35uoFTRbFjkC2GVG9U6J
	acKyUWka2FXcLkcmwCyc0Xu/vMNJTucTsJCHP5cJyk/F3dFn5AUnoM6LZirpC0ETosR24Nt2mb62J
	Y5Vls/QgPNGq0+ufCo0fZL1vQ74SeEbTeCUNgGWF7vme5iX5p7Os1cf7Qf59UkvxXshE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: Extend eclair-ARM64-allcode and mark as gating
Message-Id: <E1wDdBK-006wgy-0y@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 07:00:02 +0000

commit 9e5dc44ef519cb9547f5a3ad51a96e61aec4f699
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 14 13:16:56 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 17 08:37:19 2026 +0200

    automation: Extend eclair-ARM64-allcode and mark as gating
    
    Extend the job by enabling static memory, static shared memory and early
    printk features. Given no more regressions for clean rules, mark as
    gating.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/gitlab-ci/analyze.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index 4e9af9d602..b3f99f472d 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -149,7 +149,11 @@ eclair-ARM64-allcode:
       CONFIG_STACK_PROTECTOR=y
       CONFIG_UNSUPPORTED=y
       CONFIG_VM_EVENT=y
-  allow_failure: true
+      CONFIG_STATIC_MEMORY=y
+      CONFIG_STATIC_SHM=y
+      CONFIG_EARLY_UART_CHOICE_PL011=y
+      CONFIG_EARLY_UART_BASE_ADDRESS=0x0
+  allow_failure: false
 
 eclair-ARM64-testing:
   extends: eclair-ARM64-allcode
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 08:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 08:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284021.1565966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDeI3-0001Sx-1p; Fri, 17 Apr 2026 08:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284021.1565966; Fri, 17 Apr 2026 08: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 1wDeI2-0001Sn-VG; Fri, 17 Apr 2026 08:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1284021;
 Fri, 17 Apr 2026 08:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDeI2-0001SX-GB
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 08:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDeI2-006J6p-0r
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 08:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDeI2-0072sx-0i
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 08:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gm3CPXU4NPtja3TnyelodWE3xLyvyPjkiI1YxDzTwh8=; b=wFLFadImywnA7Nc/+Eeuy5NndN
	x5ktf2lOrrOR8BpgzMOKMa+yQwy2XVB7naJtEvkmJModgWWYgG2YolGvZhAXmRGPlSdFG6lrsjPVE
	LO8dTe64rz4d6yXRIPlWFHr4sUN/PHCYPit74xBLPVawRCJM2ur8K58akDcDeYubnYB4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Extend eclair-ARM64-allcode and mark as gating
Message-Id: <E1wDeI2-0072sx-0i@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 08:11:02 +0000

commit 9e5dc44ef519cb9547f5a3ad51a96e61aec4f699
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 14 13:16:56 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Apr 17 08:37:19 2026 +0200

    automation: Extend eclair-ARM64-allcode and mark as gating
    
    Extend the job by enabling static memory, static shared memory and early
    printk features. Given no more regressions for clean rules, mark as
    gating.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/gitlab-ci/analyze.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index 4e9af9d602..b3f99f472d 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -149,7 +149,11 @@ eclair-ARM64-allcode:
       CONFIG_STACK_PROTECTOR=y
       CONFIG_UNSUPPORTED=y
       CONFIG_VM_EVENT=y
-  allow_failure: true
+      CONFIG_STATIC_MEMORY=y
+      CONFIG_STATIC_SHM=y
+      CONFIG_EARLY_UART_CHOICE_PL011=y
+      CONFIG_EARLY_UART_BASE_ADDRESS=0x0
+  allow_failure: false
 
 eclair-ARM64-testing:
   extends: eclair-ARM64-allcode
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 17:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 17:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284688.1566324 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDmtH-00021G-Ii; Fri, 17 Apr 2026 17:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284688.1566324; Fri, 17 Apr 2026 17: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 1wDmtH-000218-G4; Fri, 17 Apr 2026 17:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1284688;
 Fri, 17 Apr 2026 17:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDmtF-000212-LJ
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 17:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtF-006Tjz-1v
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtF-007imB-1i
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GUwHLUS6w8cAP2nG/AxKKZqCIbgo/fhHGljFm/iWsCc=; b=z/bVwPVDBkrxzake231gAgNcFm
	+L3mywH23h6rvhRo5J3Au8mf1qLp71uLeRnhLLs3jdWMk0QTjnsqmoil1R3j9rqVN+s5H+pDEe6GV
	LUi/n26wGAsLXQsQ0wr1iITw/5P2bILjijIe+C+tCoZ56lT7akbzUpJnwB1XgvtdoN2w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mkelf32: Actually pad load segment to 2 MiB boundary
Message-Id: <E1wDmtF-007imB-1i@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 17:22:01 +0000

commit 5416c455f656af9ff3ed7f26dcd5cbf70b254f23
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Apr 17 11:54:24 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:15:54 2026 +0100

    x86/mkelf32: Actually pad load segment to 2 MiB boundary
    
    Fix the code which tries to pad the load segment to 2 MiB but only pads
    it to a 1 MiB boundary.
    
    This manifests as a page fault while scrubbing RAM during boot on certain
    systems.
    
    Xen fails to mark itself as reserved in the E820 (due to spanning multiple
    regions), but does restrict the permissions in the directmap.  The region of
    RAM containing Xen is handed to physical memory manager as available for use,
    and scrubbing hit the directmap protections.
    
    Fixes: 4fb075201f54 ("x86/mkelf32: pad load segment to 2Mb boundary")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 373ba4ddd5..469d1ba0af 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -345,7 +345,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 20) - 1) & (-1U << 20);
+    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 17:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 17:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284689.1566328 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDmtR-00022q-K7; Fri, 17 Apr 2026 17:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284689.1566328; Fri, 17 Apr 2026 17: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 1wDmtR-00022g-HR; Fri, 17 Apr 2026 17:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1284689;
 Fri, 17 Apr 2026 17:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDmtP-00022W-OR
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 17:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtP-006TkG-2L
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtP-007iok-26
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9ib9b5WldgFgZFQNdFldTQ03n57KwfRCI0Hs+0SR0Gs=; b=Bt+YzA0oGvzX2sfRe2OAVz5nWC
	BY7hnqPUMbv/ck3NO2E4zQjsbi64OYZilSJPLS9k094ug3V5kIBqhRiPkb+yz/sdSQ0kJpuMGWpDu
	nb83nNkWRb3HOf5Gye3RLsya7pLv52BLWu+aSCia7cdKWlCI31k9pYZBSIHpM62000ek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDmtP-007iok-26@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 17:22:11 +0000

commit 99912d346009fda1e7fb1510c9501fbab17e92a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:15:54 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 45b55b7a8c..712734a6e7 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -947,6 +947,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsr(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->family == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    val = rdmsr(MSR_AMD64_FP_CFG);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsr(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1019,6 +1055,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	uint64_t value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index b92a278611..ad1c6c97f8 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -431,6 +431,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 17:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 17:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284690.1566331 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDmtb-00027X-LB; Fri, 17 Apr 2026 17:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284690.1566331; Fri, 17 Apr 2026 17: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 1wDmtb-00027P-Ik; Fri, 17 Apr 2026 17:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1284690;
 Fri, 17 Apr 2026 17:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDmta-00026r-1J
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 17:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtZ-006Tkg-3D
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtZ-007iqG-33
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l92pGmqcC2UeFGflpNvh2jp0fuhXq1onRw4w7WtcnK0=; b=51sMhkkxpVjc3Z1q7visuTkPsJ
	CJ+n9n5CsBWapyQsFfE/KrlWWPuD+VJQ3XcrJrznSpjJM4SMCIhbFUvdwF1Doz2G2mXLnwKHfUnYh
	nScFC7EBjWk0LzJ9C/Y3giV3UW6klqJ4UARN5b90DsyO9wVW9oGvKwKTUZvPBHyfGYyk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDmtZ-007iqG-33@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 17:22:21 +0000

commit 90b20547b756a5cf9b0fec9fb0de5b361e8bf4c3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:17:25 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 8c55d233f3..1bb0766ebf 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1048,6 +1048,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->family == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    val = rdmsr(MSR_AMD64_FP_CFG);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsr(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1120,6 +1156,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	uint64_t value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index df52587c85..6c5b2569e1 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -428,6 +428,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 17:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 17:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284691.1566336 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDmtl-00029S-Mx; Fri, 17 Apr 2026 17:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284691.1566336; Fri, 17 Apr 2026 17: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 1wDmtl-00029K-K2; Fri, 17 Apr 2026 17:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1284691;
 Fri, 17 Apr 2026 17:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDmtk-00029B-9O
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 17:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtk-006Tkl-0q
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtk-007ir3-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GdARV/nN7iW8Wl7U9C7/iernn/49kxRLamtwFR+AfK8=; b=dRTl01d9ov6V/76SB5rzqdq7eI
	P+gKtzScyz+LAnvvcKJK0QqIWxIFdzQ0QXjGKfiMan+xQDbblIlknSRHuBSmNKkp4BGECt+ZQvlD+
	SvPpDczPK54UKw38GTubnoHFgXTVplQPCaMFwpIoGIq+NmtLiYJxdaX4BEt8EtWxSq/E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDmtk-007ir3-0j@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 17:22:32 +0000

commit c403cf9e742a20e0aadbe04c1ab0ce9621184037
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:17:53 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index d5069a7ec1..43883e04db 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -982,6 +982,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1055,6 +1091,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	unsigned long long value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 6f2c3147e3..70e5f09a2d 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -411,6 +411,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 17:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 17:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284692.1566341 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDmtv-0002BT-Oh; Fri, 17 Apr 2026 17:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284692.1566341; Fri, 17 Apr 2026 17: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 1wDmtv-0002BL-LN; Fri, 17 Apr 2026 17:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1284692;
 Fri, 17 Apr 2026 17:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDmtu-0002BD-HN
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 17:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtu-006Tkq-1d
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmtu-007isM-1X
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fxCZKjyOLOVZYgWq+4xtlT0MooUh3cxqmalc4JqL8jg=; b=IV9SYqqKk7KxXtbkbJeriaIPmM
	fXGoPFWQRz0YbLu0Fyb6s62a9Z48lUeOCrRQHGcHV/y8SqB3XgR3Y0ZmCVsUd4FlyzTOAOzBgvtjo
	gK2wHQrgi2bfKr5WOwEbg02+8nzlKJdSB4XorvryzDPlVz/KnCCiYbPtA9XGaKzOgtqM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDmtu-007isM-1X@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 17:22:42 +0000

commit 60a2c34900373ded0c81dbb7367792178b6c33b9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:18:11 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ebeed00941..12876de1df 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -982,6 +982,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1055,6 +1091,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	unsigned long long value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 6f2c3147e3..70e5f09a2d 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -411,6 +411,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 17:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 17:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284693.1566344 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDmu6-0002DU-PS; Fri, 17 Apr 2026 17:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284693.1566344; Fri, 17 Apr 2026 17:22: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 1wDmu6-0002DK-Mj; Fri, 17 Apr 2026 17:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1284693;
 Fri, 17 Apr 2026 17:22:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDmu4-0002D9-PM
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 17:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmu4-006Tl2-2R
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmu4-007itY-2L
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y0mJ3/xMrSqutrHaihm1KioqLYHIk81lKR9RAR/2PJU=; b=2tXD3LzkmvsrDxi4xhvqmKQrCB
	/oD7v6w+ut/o9lGKmmeUYM4MRIAUua3HfxxWcd68jr/QbopPHa9abwCR4Rv20laGlSnnnxua77UAz
	l4cdzKSELzv0FWpP2GdcncXHZYE1oO+I1I5jCB3dTtFF8lLmvlg401aAG1L8li/Nr0vc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDmu4-007itY-2L@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 17:22:52 +0000

commit 9f070ec7885693af289add01cdf4a4d7918a3f34
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:18:28 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 38 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 39 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index c448997be5..43cd3ae9ba 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1009,6 +1009,42 @@ static void cf_check fam17_disable_c6(void *arg)
 	wrmsrl(MSR_AMD_CSTATE_CFG, val & mask);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
@@ -1053,6 +1089,8 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	unsigned long long value;
 
+	amd_init_fp_cfg(c);
+
 	/* Disable TLB flush filter by setting HWCR.FFDIS on K8
 	 * bit 6 of msr C001_0015
 	 *
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index c9f980cd57..516ee26d70 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -411,6 +411,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
+#define MSR_AMD64_FP_CFG		0xc0011028
 #define MSR_AMD64_DE_CFG		0xc0011029
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102c
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 17:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 17:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284695.1566349 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDmuG-0002FZ-RE; Fri, 17 Apr 2026 17:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284695.1566349; Fri, 17 Apr 2026 17:23: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 1wDmuG-0002FR-O4; Fri, 17 Apr 2026 17:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1284695;
 Fri, 17 Apr 2026 17:23:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDmuF-0002FE-1R
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 17:23:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmuF-006TlM-02
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDmuE-007iue-39
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AcwK3diJYNwzm5ZYwaG+BURjDP1Q+Dz0j0u9a8FboLo=; b=0lqwdBuwvm9Yg6/eBgCw134ZAK
	P47Rq2nIT9HYjXwyxMZcU6lajC941uMm7wDzIhCBd0SgrMXcf9QbqB+mXPqiis+fNk6/M6RVyYjq4
	nSkpo92mJbGJCSVT8PvIuZhqY2WwugSXYyhL/R3PD44e6W9xcqOVBc0wYfxPPpttR00g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDmuE-007iue-39@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 17:23:02 +0000

commit 57d0c0cdde8ad6c8d54251827edc7689347e6a3e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:18:46 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 38 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 39 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 2838725bab..3312d896dd 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -982,6 +982,42 @@ static void cf_check fam17_disable_c6(void *arg)
 	wrmsrl(MSR_AMD_CSTATE_CFG, val & mask);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 static void amd_check_erratum_1485(void)
 {
 	uint64_t val, chickenbit = (1 << 5);
@@ -1009,6 +1045,8 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	unsigned long long value;
 
+	amd_init_fp_cfg(c);
+
 	/* Disable TLB flush filter by setting HWCR.FFDIS on K8
 	 * bit 6 of msr C001_0015
 	 *
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 521079191a..bed0ab7b21 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -386,6 +386,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
+#define MSR_AMD64_FP_CFG		0xc0011028
 #define MSR_AMD64_DE_CFG		0xc0011029
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102c
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 18:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 18:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284721.1566351 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDnei-00084a-2G; Fri, 17 Apr 2026 18:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284721.1566351; Fri, 17 Apr 2026 18:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDneh-00084S-Vw; Fri, 17 Apr 2026 18:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1284721;
 Fri, 17 Apr 2026 18:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDnef-00084M-V2
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 18:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDnef-006Ugp-2o
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 18:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDnef-007mTv-2d
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 18: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WBTp60uPVEVGRnaFRRSY7BpcXyMi7MHZWN4lNS/HwRI=; b=F2bBase93rCD1gErPeepR0Q7rb
	YCPJqjwAv36Ys69rQJo5VUodYAbFcQTRxyEFfY2zt41KlflSp5i+OwtZGurMU5dpgVaxK5PtDrTAX
	fdzihGTl3yfUhoerI8iIHAto/EmDWiIJ4yMKe3W55B0gHvWQfXmYELUHn74sxTUkQl88=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDnef-007mTv-2d@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 18:11:01 +0000

commit 57d0c0cdde8ad6c8d54251827edc7689347e6a3e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:18:46 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 38 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 39 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 2838725bab..3312d896dd 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -982,6 +982,42 @@ static void cf_check fam17_disable_c6(void *arg)
 	wrmsrl(MSR_AMD_CSTATE_CFG, val & mask);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 static void amd_check_erratum_1485(void)
 {
 	uint64_t val, chickenbit = (1 << 5);
@@ -1009,6 +1045,8 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	unsigned long long value;
 
+	amd_init_fp_cfg(c);
+
 	/* Disable TLB flush filter by setting HWCR.FFDIS on K8
 	 * bit 6 of msr C001_0015
 	 *
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 521079191a..bed0ab7b21 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -386,6 +386,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
+#define MSR_AMD64_FP_CFG		0xc0011028
 #define MSR_AMD64_DE_CFG		0xc0011029
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102c
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 19:33:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 19:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284742.1566356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDow3-00009V-GV; Fri, 17 Apr 2026 19:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284742.1566356; Fri, 17 Apr 2026 19: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 1wDow3-00009N-DT; Fri, 17 Apr 2026 19:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1284742;
 Fri, 17 Apr 2026 19:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDow1-00009H-Ny
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 19:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDow1-006W4G-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 19:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDow1-007qwb-23
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 19: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QZP4HUtKEZ6S3qNACJEpJp5mRla0CwC+4ah/Fyv9AZA=; b=vFZQQeKmLlndnIqmGnhFdSWw76
	D7TexCUAvX8ndDL4iviMY9DQxpaeZ8IkiyeaKMdLy94W1pEYJmmrjIpYSPCeAtakNuaN2rukWIRsd
	Pn0EcFkvhTwHO5Md20F/23p8WqbXAV+F2rATvwirO7Y/522o1pHd7cVVbL4ocQDHX0Mk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mkelf32: Actually pad load segment to 2 MiB boundary
Message-Id: <E1wDow1-007qwb-23@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 19:33:01 +0000

commit 5416c455f656af9ff3ed7f26dcd5cbf70b254f23
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Apr 17 11:54:24 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:15:54 2026 +0100

    x86/mkelf32: Actually pad load segment to 2 MiB boundary
    
    Fix the code which tries to pad the load segment to 2 MiB but only pads
    it to a 1 MiB boundary.
    
    This manifests as a page fault while scrubbing RAM during boot on certain
    systems.
    
    Xen fails to mark itself as reserved in the E820 (due to spanning multiple
    regions), but does restrict the permissions in the directmap.  The region of
    RAM containing Xen is handed to physical memory manager as available for use,
    and scrubbing hit the directmap protections.
    
    Fixes: 4fb075201f54 ("x86/mkelf32: pad load segment to 2Mb boundary")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 373ba4ddd5..469d1ba0af 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -345,7 +345,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 20) - 1) & (-1U << 20);
+    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Apr 17 19:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Apr 2026 19:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284743.1566359 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wDowC-0000BC-HV; Fri, 17 Apr 2026 19:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284743.1566359; Fri, 17 Apr 2026 19: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 1wDowC-0000B5-Es; Fri, 17 Apr 2026 19:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1284743;
 Fri, 17 Apr 2026 19:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wDowB-0000Av-QN
 for xen-changelog@lists.xenproject.org; Fri, 17 Apr 2026 19:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDowB-006W4L-2Y
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 19:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wDowB-007qx0-2O
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Apr 2026 19: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uNQJMOQSwhoxFcAgc/dtpr9RfpOQyohUMlpz0oaa3Uk=; b=YvTxKCnw43tBsFgpk2FCgdDPNO
	Kbm9yqUkRSpE3+XrYziULE6VimYo+WhO0FcTgXkKTPRQg85MaoYz0pyTbdkUld4HpotI2BFU+gFHL
	Ypumukog25UW4giJAfkLUlFYb0fo5sZnKABFhpUZ8R8BOVOBB7DQ70y/JAbzr1eaVgso=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wDowB-007qx0-2O@xenbits.xenproject.org>
Date: Fri, 17 Apr 2026 19:33:11 +0000

commit 99912d346009fda1e7fb1510c9501fbab17e92a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:15:54 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 45b55b7a8c..712734a6e7 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -947,6 +947,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsr(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->family == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    val = rdmsr(MSR_AMD64_FP_CFG);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsr(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1019,6 +1055,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	uint64_t value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index b92a278611..ad1c6c97f8 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -431,6 +431,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 05:55:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 05:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285411.1566436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEhb4-0003Fl-Jp; Mon, 20 Apr 2026 05:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285411.1566436; Mon, 20 Apr 2026 05: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 1wEhb4-0003Fc-Ge; Mon, 20 Apr 2026 05:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1285411;
 Mon, 20 Apr 2026 05:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEhb3-0003FG-Pr
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 05:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEhb3-00AzT6-2H
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 05:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEhb3-00CViU-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 05: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=K4k6U35dzt0Vtra14SCR5v8+tedfnC10dvVzng6DNyw=; b=6vqQyYfTfCsTctEq5RlE9QkW8Y
	qO8Tx4CtK/mFJ+H00SVS+DOzMWyCKYIAYnwi6TzITUq26YLKnX7eawFUHJIRJc1c74OW2k9UB73Ef
	LaoaxF9runjDHN8HQjQi3LRzXOMjz3QUbFcNhbf8FSuWjmmsAhtirm97kd9ERXbTZo54=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wEhb3-00CViU-1v@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 05:55:01 +0000

commit 90b20547b756a5cf9b0fec9fb0de5b361e8bf4c3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:17:25 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 8c55d233f3..1bb0766ebf 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1048,6 +1048,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->family == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    val = rdmsr(MSR_AMD64_FP_CFG);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsr(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1120,6 +1156,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	uint64_t value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index df52587c85..6c5b2569e1 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -428,6 +428,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 05:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 05:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285412.1566440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEhbE-0003HO-KS; Mon, 20 Apr 2026 05:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285412.1566440; Mon, 20 Apr 2026 05: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 1wEhbE-0003HG-Hw; Mon, 20 Apr 2026 05:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1285412;
 Mon, 20 Apr 2026 05:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEhbE-0003HA-0N
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 05:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEhbD-00AzTQ-38
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 05:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEhbD-00CVjS-30
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 05: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Tn5xlDRYnCzugONsehgmQLUjoADRflNifddNMpxmnL0=; b=o1rhRO089THDLMV1rPz4lkEPVr
	uaaHagXIPwB89OV7VkTLymcLpuNPcrBQWyuQsbDpeMqUDG2hsgitvw95eZzHPApD2ucozcGUr8eAF
	cCFqg0gbJIGdynMZ/kEnGYehCnjacD5x6D8I5yZVtWfObhfDqTeEOWu2TJhYjN8RAXIA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wEhbD-00CVjS-30@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 05:55:11 +0000

commit c403cf9e742a20e0aadbe04c1ab0ce9621184037
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:17:53 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index d5069a7ec1..43883e04db 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -982,6 +982,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1055,6 +1091,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	unsigned long long value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 6f2c3147e3..70e5f09a2d 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -411,6 +411,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 06:11:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 06:11:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285413.1566443 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEhqY-0005Xj-Kg; Mon, 20 Apr 2026 06:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285413.1566443; Mon, 20 Apr 2026 06: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 1wEhqY-0005Xc-Hy; Mon, 20 Apr 2026 06:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1285413;
 Mon, 20 Apr 2026 06:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEhqX-0005XW-FG
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 06:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEhqX-00AzsD-19
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 06:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEhqX-00CWZL-12
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qvtcsuwZL7FYROZHrI6734SxafAivcH6TkUvcLVI7vw=; b=Ud+/FTzrzvdJRe0kkuT29yhg/u
	XrtOvdkGl4nqhQjya5aZww35VPqwhYArIGOAYJhTvuzWqaFpmYGev2vknbGFcF5+A9/kzPOO/82wT
	vZtVRb+DMJK0MSYgB0uu2at4SooUsVhjmS3aZyJRJmZhMFaMrxGV/7Wadxz0l2iBdPgE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wEhqX-00CWZL-12@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 06:11:01 +0000

commit 9f070ec7885693af289add01cdf4a4d7918a3f34
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:18:28 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 38 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 39 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index c448997be5..43cd3ae9ba 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1009,6 +1009,42 @@ static void cf_check fam17_disable_c6(void *arg)
 	wrmsrl(MSR_AMD_CSTATE_CFG, val & mask);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
@@ -1053,6 +1089,8 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	unsigned long long value;
 
+	amd_init_fp_cfg(c);
+
 	/* Disable TLB flush filter by setting HWCR.FFDIS on K8
 	 * bit 6 of msr C001_0015
 	 *
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index c9f980cd57..516ee26d70 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -411,6 +411,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
+#define MSR_AMD64_FP_CFG		0xc0011028
 #define MSR_AMD64_DE_CFG		0xc0011029
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102c
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:00:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285600.1566587 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElQB-00065q-0y; Mon, 20 Apr 2026 10:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285600.1566587; Mon, 20 Apr 2026 10:00:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElQA-00065V-UC; Mon, 20 Apr 2026 10:00:02 +0000
Received: by outflank-mailman (input) for mailman id 1285600;
 Mon, 20 Apr 2026 10:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElQA-0005uY-6d
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElQA-00B4PS-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElQA-00Cjwa-07
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=510KnQtZlpRinBvLkT2Z0WvHL3RGRntxYJYMotg5G40=; b=1kbKZDJRbncifb5wEw4xtw/Z98
	kAmsnMR1Cc80481lbd0w6D1Qkuz9qeF28ykckoPiR6O+mfNSsRTKqU1W1aAXEpphWAnuFe+FQPQjN
	x5/46+CPvTfXG5MUdOvfsImT0Gg3goT8vgpIUqJL/5/hlvTzJVe+6ROHPUWeSZY1AWAI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/amd: Mitigate AMD-SN-7053 / FP-DSS
Message-Id: <E1wElQA-00Cjwa-07@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:00:02 +0000

commit 60a2c34900373ded0c81dbb7367792178b6c33b9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Apr 10 21:55:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Apr 17 18:18:11 2026 +0100

    x86/amd: Mitigate AMD-SN-7053 / FP-DSS
    
    This is XSA-488 / CVE-2025-54505
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 99912d346009fda1e7fb1510c9501fbab17e92a0)
---
 xen/arch/x86/cpu/amd.c               | 37 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/msr-index.h |  1 +
 2 files changed, 38 insertions(+)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ebeed00941..12876de1df 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -982,6 +982,42 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_DE_CFG, val | new);
 }
 
+static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
+{
+    uint64_t val, new = 0;
+
+    /* If virtualised, we won't have mutable access even if we can read it. */
+    if ( cpu_has_hypervisor )
+        return;
+
+    /*
+     * On Zen1, mitigate SB-7053 / FP-DSS Floating Point Divider State
+     * Sampling by setting bit 9 as instructed.
+     */
+    if ( c->x86 == 0x17 && is_zen1_uarch() )
+        new |= 1 << 9;
+
+    /*
+     * Avoid reading FP_CFG if we don't intend to change anything.  The
+     * register doesn't exist on all families.
+     */
+    if ( !new )
+        return;
+
+    rdmsrl(MSR_AMD64_FP_CFG, val);
+
+    if ( (val & new) == new )
+        return;
+
+    /*
+     * FP_CFG is a Core-scoped MSR, and this write is racy.  However, both
+     * threads calculate the new value from state which expected to be
+     * consistent across CPUs and unrelated to the old value, so the result
+     * should be consistent.
+     */
+    wrmsrl(MSR_AMD64_FP_CFG, val | new);
+}
+
 void __init amd_init_lfence_dispatch(void)
 {
     struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -1055,6 +1091,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	unsigned long long value;
 
 	amd_init_de_cfg(c);
+	amd_init_fp_cfg(c);
 
 	if (c == &boot_cpu_data)
 		amd_init_lfence_dispatch(); /* Needs amd_init_de_cfg() */
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index 6f2c3147e3..70e5f09a2d 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -411,6 +411,7 @@
 #define MSR_AMD64_LS_CFG		0xc0011020U
 #define MSR_AMD64_IC_CFG		0xc0011021U
 #define MSR_AMD64_DC_CFG		0xc0011022U
+#define MSR_AMD64_FP_CFG		0xc0011028U
 #define MSR_AMD64_DE_CFG		0xc0011029U
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102cU
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:33:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285623.1566610 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElw7-0002qB-Ks; Mon, 20 Apr 2026 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285623.1566610; Mon, 20 Apr 2026 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 1wElw7-0002q3-Hc; Mon, 20 Apr 2026 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1285623;
 Mon, 20 Apr 2026 10:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElw6-0002px-OR
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElw6-00B53j-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElw6-00ClkN-25
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X28A8Hvj5lBI0UP0meWKGZvYJ3DhpbY8dBtAPl0hF9c=; b=Yf4dBrLLwPTRBR5ZaO6J06mJAj
	cbf8reL21RCCaYne6nZceks1O0C401Yj2wwuRNhEo24jbrOnhGAHId9O7QNgSEntau54cXMeeOaqx
	ClXE3QSTQL3XJPkYcLKsp3pFnNgPSGW2NB/4ttJKSkt46pVNcglks1aaRnKF3gEbLl2c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] update Xen version to 4.21.2-pre
Message-Id: <E1wElw6-00ClkN-25@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:33:02 +0000

commit fa82d4f5cc9766ba6ed74e378cd69493a2f9fa28
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:19:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:19:00 2026 +0200

    update Xen version to 4.21.2-pre
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index d808267ce1..8ffa719ab9 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    = 21
-export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285624.1566613 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElwH-0002sN-Lv; Mon, 20 Apr 2026 10:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285624.1566613; Mon, 20 Apr 2026 10: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 1wElwH-0002sC-Iz; Mon, 20 Apr 2026 10:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1285624;
 Mon, 20 Apr 2026 10:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElwG-0002s6-SG
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwG-00B543-2Y
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwG-00Cll7-2O
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Y80bVLbSKD+X/P4PuBBzTJRuqWx5c2RMMiB7P4vIOY8=; b=JuE+4B1QIMxboQRSk5ZGdPK1Hq
	+xuCt8YhRP84+m2sNc/lML4OS5RB6w4R7BtCm1Jw/PIfEPFWN+s/otSIrGRcNx0KSXEPTc0Lpp5+X
	699baESWs5BxUO/SVb4jsGKm0HDJ/QMBgSjZ/g22QRWaLqCpM29mTyFJHqaOfbCY1+0Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] arinc653: overwrite entire .dom_handle[] for Dom0 slots
Message-Id: <E1wElwG-00Cll7-2O@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:33:12 +0000

commit d174a86aaf3f019307f52a81df5e1fd32de44e86
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:19:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:19:52 2026 +0200

    arinc653: overwrite entire .dom_handle[] for Dom0 slots
    
    When that code still lived in a653sched_init(), it was redundant with the
    earlier memset() / xzalloc(). Once moved, the full structure field needs
    setting, as dom_handle_cmp() uses memcmp() and arinc653_sched_set() may
    have clobbered entries. Rather than implying the handle to be all zero,
    copy the handle out of the domain structure.
    
    Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 2a0ee29f5e6441b3c977ae8862842fd7c4da79d3
    master date: 2026-03-26 10:47:08 +0100
---
 xen/common/sched/arinc653.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 8a4f4259d8..bde15eb7e1 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -420,7 +420,9 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
 
         if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
         {
-            sched_priv->schedule[entry].dom_handle[0] = '\0';
+            memcpy(sched_priv->schedule[entry].dom_handle,
+                   unit->domain->handle,
+                   sizeof(sched_priv->schedule->dom_handle));
             sched_priv->schedule[entry].unit_id = unit->unit_id;
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285625.1566617 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElwR-0002uS-NJ; Mon, 20 Apr 2026 10:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285625.1566617; Mon, 20 Apr 2026 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 1wElwR-0002uK-KN; Mon, 20 Apr 2026 10:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1285625;
 Mon, 20 Apr 2026 10:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElwQ-0002uD-Tf
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwQ-00B54C-2r
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwQ-00ClmB-2j
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0fx/Z0F52L91lbw4ay7ZCKh/MKX6wOhiW9S7qUytVdw=; b=W7N3mdefTjHgFJ5A8AMszH7mTW
	mOZDnJkUxDpF2MFBR57iNNdHVSF/wE28L/pW40wzYodX94qXLWfF5eimjO8S+r8NiPQKxJ3J31MME
	ffq4KORrohPtjicVS+MhZHvgnN/zfGidlwpAvTQUAQFvJFAEQ6pAfguDMoZY9fOEA33w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] arinc653: avoid array overrun
Message-Id: <E1wElwQ-00ClmB-2j@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:33:22 +0000

commit 646bcc17cea3d4d25348cd794a666c51f813c804
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:20:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:20:23 2026 +0200

    arinc653: avoid array overrun
    
    Incrementing ->sched_index between bounds check and array access may
    result in accessing one past the array when that is fully filled
    (->num_schedule_entries == ARINC653_MAX_DOMAINS_PER_SCHEDULE).
    
    Fixes: 22787f2e107c ("ARINC 653 scheduler")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 5a1121633f2ae97d96d3e66472cf373a6caa3d51
    master date: 2026-03-26 10:47:41 +0100
---
 xen/common/sched/arinc653.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index bde15eb7e1..c35bfbd04e 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -552,12 +552,9 @@ a653sched_do_schedule(
 
     /* Switch minor frame or find correct minor frame after a miss */
     while ( (now >= sched_priv->next_switch_time) &&
-        (sched_priv->sched_index < sched_priv->num_schedule_entries) )
-    {
-        sched_priv->sched_index++;
+            (++sched_priv->sched_index < sched_priv->num_schedule_entries) )
         sched_priv->next_switch_time +=
             sched_priv->schedule[sched_priv->sched_index].runtime;
-    }
 
     /*
      * If we exhausted the domains in the schedule and still have time left
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285626.1566621 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElwb-0002ww-Qo; Mon, 20 Apr 2026 10:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285626.1566621; Mon, 20 Apr 2026 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 1wElwb-0002wo-N7; Mon, 20 Apr 2026 10:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1285626;
 Mon, 20 Apr 2026 10:33:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElwb-0002wi-0K
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:33:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwa-00B54G-39
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwa-00Cln5-32
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yKM3mJFNfKNJjzJ3tj7+zirkO/Tyd2Azvz6hkGdfX5U=; b=qaEvZh2XL8ftJSjZXVwK4yHjJ1
	cxl3/mvcTchojMVMObHJtJ6nelm/4kh5SxX6rTLhsS1yVCNRRoGfhbnwEE0/nHWrF7qhvRC4i4J8r
	cJ3n5UCPHcPeNdNgwodfq7GEYMq7sJmRqir76rBL0iDj9nT3CHJlngw2rKrP1KXXf02Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] arinc653: remove idle period in default schedule
Message-Id: <E1wElwa-00Cln5-32@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:33:32 +0000

commit aaa03d41be02cd947fb5e6acde2c3eaa8a179e88
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Apr 20 12:20:41 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:20:41 2026 +0200

    arinc653: remove idle period in default schedule
    
    By initializing major_frame in a653sched_init(), an idle period was
    inadvertently introduced into the default schedule. Account for the
    initial value of major_frame when populating the default schedule.
    
    Fixes: f2927d8343ae ("xen/arinc653: fix delay in the start of major frame")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 6d412c059982d821260055eaa43417b3245b2050
    master date: 2026-03-26 10:49:11 +0100
---
 xen/common/sched/arinc653.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index c35bfbd04e..19249f6464 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -427,7 +427,8 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
 
-            sched_priv->major_frame += DEFAULT_TIMESLICE;
+            if ( entry )
+                sched_priv->major_frame += DEFAULT_TIMESLICE;
             ++sched_priv->num_schedule_entries;
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285627.1566624 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElwm-0002z1-R2; Mon, 20 Apr 2026 10:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285627.1566624; Mon, 20 Apr 2026 10:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElwm-0002yt-OV; Mon, 20 Apr 2026 10:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1285627;
 Mon, 20 Apr 2026 10:33:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElwl-0002ym-4p
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:33:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwl-00B54K-0N
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwl-00Clnb-05
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AMM7/Suu/lN3+34NeOt5wfQYFpwP/ok1wHsQJV/j7VM=; b=BOqynVhiG0bmgnbp68huRuFRsN
	KtffqaGIqMAjWYXnmkevC4yyKRlCE8BYTqrUhN2cRRQ/GFuoi5tniIr2U9mpYiRNG9aZBV0LALvfQ
	FUFH8hwxEtVKR2/Fv/4CUYpRgj76sz9lv28+xL0adZpQB26wxdlVO///Q3Ct6SBuSrMc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/uart: report an error if the device type is not supported
Message-Id: <E1wElwl-00Clnb-05@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:33:43 +0000

commit b3c4a20a15ae90e1f1e7c2bf22a1b56eb293d4d1
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:21:35 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:21:35 2026 +0200

    xen/uart: report an error if the device type is not supported
    
    When using key pairs for the uart configuration (com1 and com2 command line
    options), report an error if the passed device=<type> is not recognized
    instead of silently ignoring it.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 550ee7c198010c297d74b69e07d95a26358eadbd
    master date: 2026-03-27 14:52:40 +0100
---
 xen/drivers/char/ns16550.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index df7fff7f81..d384f1c69d 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1674,6 +1674,8 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
                 pci_uart_config(uart, 0, uart - ns16550_com);
                 dev_set = true;
             }
+            else
+                PARSE_ERR_RET("Unknown device type %s\n", param_value);
             break;
 
         case port_bdf:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285628.1566629 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElww-000310-Sh; Mon, 20 Apr 2026 10:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285628.1566629; Mon, 20 Apr 2026 10:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElww-00030s-Q0; Mon, 20 Apr 2026 10:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1285628;
 Mon, 20 Apr 2026 10:33:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElwv-00030k-7B
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:33:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwv-00B54S-0d
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElwv-00Cloe-0X
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O0bTLYmsGe1KeA29U8K1ZxLTsuCayx6/esrP17UjKNY=; b=HXez/VdSVn1GaL83qPUKdKx9Dc
	DGmonFxMC6LCH9GwlWw576Ade+o0ENaPU7ORg+ZKU6FM2wRhPgvkJgdr3TKmmNxdpL8Sp1LmXR/vu
	D+HEGO8RtknCFuYTYuf7SBsyCGkg3rRzr38LNE7WhJVhG5aoGo/x6esmjRr6ue6kDv7g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] libacpi: Pass missing --dm_version to mk_dsdt
Message-Id: <E1wElwv-00Cloe-0X@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:33:53 +0000

commit 8482a1ce08663467ca52434769a71a25b0ab8798
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:22:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:22:24 2026 +0200

    libacpi: Pass missing --dm_version to mk_dsdt
    
    Commit 19ab8356abe4 ("tools: remove support for running a guest with
    qemu-traditional") made passing --dm_version to mk_dsdt mandatory on
    x86 but didn't fix all the invocations of it.
    
    The previous default was qemu-xen-traditional so with that removed set
    the dm_version to qemu-xen for this invocation.
    
    Without this change, Xen fails to build on x86 when using
    --enable-rombios.
    
    Fixes: 19ab8356abe4 ("tools: remove support for running a guest with qemu-traditional")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ea12f9d257353ddec8a2fe8da42d11636de3dacb
    master date: 2026-03-27 18:56:42 +0000
---
 tools/libacpi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index b21a64c6b4..193ec78672 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -51,7 +51,7 @@ $(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl  $(MK_DSDT)
 	# Remove last bracket
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
 	cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
-	$(MK_DSDT) --debug=$(debug) --maxcpu $*  >> $@.$(TMP_SUFFIX)
+	$(MK_DSDT) --debug=$(debug) --maxcpu $* --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 
 $(ACPI_BUILD_DIR)/dsdt_pvh.asl: dsdt_acpi_info.asl $(MK_DSDT)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285629.1566633 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElx6-00032z-U2; Mon, 20 Apr 2026 10:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285629.1566633; Mon, 20 Apr 2026 10:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElx6-00032q-RS; Mon, 20 Apr 2026 10:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1285629;
 Mon, 20 Apr 2026 10:34:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElx5-00032k-A8
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:34:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElx5-00B54h-0v
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElx5-00Clpj-0o
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A4Ssy18eLe6VfceDpqRbmgPBk5dx38umJL6afQA2SAs=; b=i6mfii1cOE7WQRsXuHmmvF5ZGr
	i99QfXVw9pcnhUL3hRXM6NhRdKQWcJc1rUSeQ9PyMGCdXnP3EaKqfc9S2PLnnTpLueOg44nNHCZHd
	aMf+Lnl/yYnGXC2J0mXxHpsKWlpzYj85LD2ikhQC/1OlOZ3sIqh1S/IJIMIVRbu01yYY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
Message-Id: <E1wElx5-00Clpj-0o@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:34:03 +0000

commit a011ca9e08393737e89557573f88453ea39bbed6
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:23:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:23:22 2026 +0200

    xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
    
    Auto-discovered serial PCI devices when using dev=amt|pci won't get
    ->ps_bdf_enable, and as such some of the logic (like making sure the
    respective BARs are enabled) won't be applied to them.
    
    Fix by unconditionally setting ->ps_bdf_enable for all PCI serial devices,
    and removing the special case that was done in some places by checking
    whether the ->bar was set.  This also allows simplifying the logic in
    pci_serial_early_init().
    
    Fixes: 9738db88f68f ("xen: Automatically find serial port on PCI/PCIe and AMT devices.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4bf33360623d9d59c8e7a49b70308c1b58d4d772
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index d384f1c69d..45ac089193 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -283,7 +283,10 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
-    if ( uart->bar && uart->io_base >= 0x10000 )
+    if ( !uart->ps_bdf_enable )
+        return;
+
+    if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
@@ -291,9 +294,6 @@ static void pci_serial_early_init(struct ns16550 *uart)
         return;
     }
 
-    if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
-        return;
-
     if ( uart->pb_bdf_enable )
         pci_conf_write16(PCI_SBDF(0, uart->pb_bdf[0], uart->pb_bdf[1],
                                   uart->pb_bdf[2]),
@@ -440,7 +440,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
         unsigned int, 1, (bits * uart->fifo_size * 1000) / uart->baud);
 
 #ifdef NS16550_PCI
-    if ( uart->bar || uart->ps_bdf_enable )
+    if ( uart->ps_bdf_enable )
     {
         if ( uart->param && uart->param->mmio &&
              rangeset_add_range(mmio_ro_ranges, PFN_DOWN(uart->io_base),
@@ -1338,6 +1338,7 @@ pci_uart_config(struct ns16550 *uart, bool skip_amt, unsigned int idx)
                 uart->ps_bdf[0] = b;
                 uart->ps_bdf[1] = d;
                 uart->ps_bdf[2] = f;
+                uart->ps_bdf_enable = true;
                 uart->bar_idx = bar_idx;
                 uart->bar = bar;
                 uart->bar64 = bar_64;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:34:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285630.1566638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElxG-00035N-Vw; Mon, 20 Apr 2026 10:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285630.1566638; Mon, 20 Apr 2026 10:34:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElxG-00035F-Ss; Mon, 20 Apr 2026 10:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1285630;
 Mon, 20 Apr 2026 10:34:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElxF-000358-Cx
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:34:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxF-00B559-1C
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxF-00ClrE-16
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Tuj2C195Gt8LlQsJDlQeqMAP3JXIBLAPZY/brdACFzc=; b=0lAxg1p5gV9yIL98D0YW7Fr6H9
	YYfkeWCXuCXyNC7vqOEepgQDbVg2navvYUj4VwMKvfEyd4ZieIe2YZ6cT/cDaBOpaORQBkxhd4s5C
	5m48WE6QKa1aLPv5qqrMN//fxyfDI9G8xJu1MyzkgWiQ6qV30T0XIkry0n684Kqp4UAk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/uart: be more careful with changes to the PCI command register
Message-Id: <E1wElxF-00ClrE-16@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:34:13 +0000

commit 761aba980ab70b9abe408b5834f02367eff0e64d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:23:51 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:23:51 2026 +0200

    xen/uart: be more careful with changes to the PCI command register
    
    Read the existing PCI command register and only add the required bits to
    it, as to avoid clearing bits that might be possibly set by the firmware
    already, which might put the device into a non-working state.
    
    Xen being the owner of the PCI device it's legitimately allowed to change
    command registers bits.  Be careful however in case buggy devices require
    certain command register bits to be enabled, while not strictly required
    from Xen's usage.
    
    Fixes: f2ff5d6628b3 ("ns16550: enable PCI serial card usage")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ebf543972560e45b838def3a54859331cc92c970
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 45ac089193..293fc74d63 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -283,14 +283,19 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
+    uint16_t cmd;
+
     if ( !uart->ps_bdf_enable )
         return;
 
+    cmd = pci_conf_read16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
+                                  uart->ps_bdf[2]), PCI_COMMAND);
+
     if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
-                         PCI_COMMAND, PCI_COMMAND_MEMORY);
+                         PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
         return;
     }
 
@@ -307,7 +312,7 @@ static void pci_serial_early_init(struct ns16550 *uart)
                      uart->io_base | PCI_BASE_ADDRESS_SPACE_IO);
     pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                               uart->ps_bdf[2]),
-                     PCI_COMMAND, PCI_COMMAND_IO);
+                     PCI_COMMAND, cmd | PCI_COMMAND_IO);
 #endif
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:34:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285631.1566641 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElxR-00037N-0a; Mon, 20 Apr 2026 10:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285631.1566641; Mon, 20 Apr 2026 10:34:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElxQ-00037F-UH; Mon, 20 Apr 2026 10:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1285631;
 Mon, 20 Apr 2026 10:34:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElxP-000378-Fb
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:34:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxP-00B55D-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxP-00Cls1-1N
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a6IPrLo6hxCD1ckuR6I6i4qBjJvog3PIo31FVuUjDok=; b=rFMIypyr9AhFrDVYNDu+lbIJ7a
	fd//00PmelHZjhWngKjq5BoyMs0CburBDjti5UVqnwy6kEzOkhpgNNaWPS4aea1lXrL9oelcCxJMN
	innfrcfyLNkT991h1Y02aFucLBCPIOiZoYVewokiNZVDVQjc3Dovne6CDmSKMUsnZOqU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/fpu: Initialise FTW in xstate_alloc_save_area()
Message-Id: <E1wElxP-00Cls1-1N@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:34:23 +0000

commit e2981e073fa9a8f073e3c1c767685ba69c3d813c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 20 12:25:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:25:10 2026 +0200

    x86/fpu: Initialise FTW in xstate_alloc_save_area()
    
    Right now, xstate_alloc_save_area() leaves both XSTATE_BV and FTW clear.  This
    causes a difference in behaviour between FXRSTOR and XRSTOR.
    
    Switch to using using XSTATE's idea of initial configuration which will behave
    the same even on pre-XSAVE hardware.  Expand the comment to explain why.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 639de2aafa437fd50abc16a46c8a8dd0d0e9e6a7
    master date: 2026-03-30 15:48:13 +0100
---
 xen/arch/x86/xstate.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index e990abc9d1..defe9b3f0c 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -550,11 +550,22 @@ int xstate_alloc_save_area(struct vcpu *v)
         return -ENOMEM;
 
     /*
-     * Set the memory image to default values, but don't force the context
-     * to be loaded from memory (i.e. keep save_area->xsave_hdr.xstate_bv
-     * clear).
+     * We're creating a vCPU, so conceptually we should be choosing the
+     * architectural #RESET values.
+     *
+     * However for historical reasons of configuring the external
+     * co-processor, FCW's #RESET state is different to what F(N)INIT and
+     * XSTATE consider the "initial configuration".
+     *
+     * Guests won't care about the difference; all software tends to executes
+     * FNINIT very early during setup.
+     *
+     * Use XSTATE's idea of initial configuration.  This allows XSTATE_BV to
+     * remain clear and for CPUs to use the INIT optimisation where
+     * applicable.
      */
     save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.ftw = FXSAVE_FTW_RESET;
     save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
 
     v->arch.xsave_area = save_area;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:34:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285632.1566644 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElxb-00039L-28; Mon, 20 Apr 2026 10:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285632.1566644; Mon, 20 Apr 2026 10:34: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 1wElxa-00039E-Vd; Mon, 20 Apr 2026 10:34:34 +0000
Received: by outflank-mailman (input) for mailman id 1285632;
 Mon, 20 Apr 2026 10:34:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElxZ-000398-IV
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:34:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxZ-00B55H-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxZ-00Clt0-1e
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SM+Nhwtso3rzFzVsHjOyUOGUaDdVRL47N97jdNIiblY=; b=x2IreC2k/u0Ml8+uLkiOEPWFr9
	Tb+ItQyHsyp7XHMZwgfarMIK8aikp5fVFvTnkuYd4f7aN7dJIeFdMuLWeiZ59ViryWEVjEPK9b3lZ
	1a39JtcqYpUj130uujEweWGczjKpGId4OcphDOYDJKcinr4ilSPgs2XYPGoH+E6XdDXM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] EFI: avoid OOB config file reads
Message-Id: <E1wElxZ-00Clt0-1e@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:34:33 +0000

commit feb99494bf594c953214aa65aab23b99c1fa794f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:25:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:25:29 2026 +0200

    EFI: avoid OOB config file reads
    
    The message emitted by pre_parse() pretty clearly states the original
    intention. Yet what it said wasn't done, and would have been unfriendly to
    the user. Hence accesses past the allocated buffer were possible. Insert a
    terminating NUL immediately past the data read, to then drop the no longer
    applicable message.
    
    NB: The iscntrl() check of just the last byte is more strict than what
    pre_parse() would accept without issuing its prior message, yet I'd like
    to keep the new logic reasonably simple. Config files shouldn't be huge,
    and we shouldn't be _that_ short of memory (or we'd fail elsewhere pretty
    soon).
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: df75f77092c1cc47f3ed5be86cf6c04e732f3f80
    master date: 2026-04-07 08:59:15 +0200
---
 xen/common/efi/boot.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 2047d58e39..2181cf0b0c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -833,8 +833,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     what = L"Allocation";
     file->addr = min(1UL << (32 + PAGE_SHIFT),
                      HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
+    /* For config files allocate an extra byte to put a NUL there. */
     ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
-                                PFN_UP(size), &file->addr);
+                                PFN_UP(size + (file == &cfg)), &file->addr);
     if ( EFI_ERROR(ret) )
         goto fail;
 
@@ -853,6 +854,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
 
     efi_arch_flush_dcache_area(file->ptr, file->size);
 
+    if ( file == &cfg )
+        file->str[file->size] = 0;
+
     return true;
 
  fail:
@@ -878,6 +882,23 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
 
     file->ptr = ptr;
 
+    /* For cfg file, if necessary allocate space to put an extra NUL there. */
+    if ( file == &cfg && file->size && !iscntrl(file->str[file->size - 1]) )
+    {
+        EFI_PHYSICAL_ADDRESS addr;
+        EFI_STATUS ret = efi_bs->AllocatePages(AllocateMaxAddress,
+                                               EfiLoaderData,
+                                               PFN_UP(file->size + 1), &addr);
+
+        if ( EFI_ERROR(ret) )
+            return false;
+
+        memcpy((void *)addr, ptr, file->size);
+        file->addr = addr;
+        file->need_to_free = true;
+        file->str[file->size] = 0;
+    }
+
     handle_file_info(name, file, options);
 
     return true;
@@ -906,9 +927,6 @@ static void __init pre_parse(const struct file *file)
         else
             start = 0;
     }
-    if ( file->size && end[-1] )
-         PrintStr(L"No newline at end of config file,"
-                   " last line will be ignored.\r\n");
 }
 
 static void __init init_secure_boot_mode(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:34:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:34:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285633.1566649 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElxl-0003Bt-5W; Mon, 20 Apr 2026 10:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285633.1566649; Mon, 20 Apr 2026 10:34: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 1wElxl-0003Bk-2n; Mon, 20 Apr 2026 10:34:45 +0000
Received: by outflank-mailman (input) for mailman id 1285633;
 Mon, 20 Apr 2026 10:34:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElxj-0003Bd-LF
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:34:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxj-00B55N-22
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxj-00CltN-1w
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I8d/3v4eds1bJ5LlrRFJyQ2H6GqHONSKgdrQJnWzA48=; b=croRYfS/1xiufP3nEoPwrxsz11
	zwPv0q0Liwvi6JkoBhoyMemUMSvrgm6b73UnJeOCcwgI8aaZ3LEAVVd4QJpHUAKsPrllKTF9SmuS+
	AjzaWJlRO+kyfOnpHXAVdMM2KeReevITgI2KZrJD84UgqvnyoMMG6gwRNa9nrF/G5fQw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] llc-coloring: improve checking while parsing
Message-Id: <E1wElxj-00CltN-1w@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:34:43 +0000

commit c9ba169b934d1e4cd733cfb23b48bace040cd097
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:25:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:25:55 2026 +0200

    llc-coloring: improve checking while parsing
    
    We can easily avoid the risk of wrapping UINT_MAX <-> 0 by applying a
    check against the compile-time-constant maximum number of colors.
    
    Additionally the overflow checks suffered from an off-by-1, as the parsed
    ranges are inclusive (e.g. end == start being possible, requiring 1 array
    slot, while availability of 0 slots was checked in that case).
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    xen/common: llc-coloring: Fix off-by-one in parse_color_config()
    
    The check uses (*num_colors + (end - start + 1)) >= max_num_colors, which
    rejects a configuration where exactly max_num_colors colors are specified.
    For example, if max_num_colors is 4 and *num_colors is 0, a range "0-3"
    gives (end - start + 1) = 4, and (0 + 4) >= 4 is true, incorrectly
    returning -EINVAL.
    
    Fix this by switching the overflow condition to the state before commit
    cba8a584de17 that regressed the behavior (i.e. don't add 1).
    
    Fixes: cba8a584de17 ("llc-coloring: improve checking while parsing")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    master commit: cba8a584de171c8c4510709c2edc9f1cf86b21ab
    master date: 2026-04-07 13:52:44 +0200
    master commit: dc28f531e6a29a6fdd58f24073dfb48af06b8334
    master date: 2026-04-10 12:14:05 +0200
---
 xen/common/llc-coloring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 77a54beed1..bc79730656 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -76,7 +76,8 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         else                /* Single value */
             end = start;
 
-        if ( start > end || (end - start) > (UINT_MAX - *num_colors) ||
+        if ( end >= NR_LLC_COLORS || start > end ||
+             (end - start) >= (UINT_MAX - *num_colors) ||
              (*num_colors + (end - start)) >= max_num_colors )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:34:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:34:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285634.1566653 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElxv-0003Dw-6u; Mon, 20 Apr 2026 10:34:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285634.1566653; Mon, 20 Apr 2026 10:34: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 1wElxv-0003Do-47; Mon, 20 Apr 2026 10:34:55 +0000
Received: by outflank-mailman (input) for mailman id 1285634;
 Mon, 20 Apr 2026 10:34:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElxt-0003Di-Nx
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:34:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxt-00B55R-2I
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElxt-00CluJ-2C
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H/30gdNvvbQ/OozeD7CgZneOFlpLjJgDK7kPK/J6Ols=; b=gKdrZ8IHN/Jx3hD+24UDkdgE/n
	OKBmIrMRAIz/To0O9fvGmvalX7Y4s/fGPGy2I3qS3AVdp47uD3BYkC2uU5WvzqIF8KcuODCaBrjKB
	n5s2lIJNFQ+jr39b5rQOZ+94Xn/UDulOZeAyXCRjWIy5FSnyTQao7UyYqgUikQJbCkxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] ns16550: harden name/value pair parsing
Message-Id: <E1wElxt-00CluJ-2C@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:34:53 +0000

commit f35f0ac0c8bcdc695b6dda9c585f1de61bdd0d80
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:26:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:26:09 2026 +0200

    ns16550: harden name/value pair parsing
    
    strsep(), unless passed a 1st argument which itself points at a NULL
    pointer, won't return NULL. Instead if the separator(s) looked for isn't
    found, that pointed-to field would be updated to hold NULL. Hence the
    important check in get_token() is for token to be non-NULL after the call
    (which get_token()'s callers rely upon), while the checking of param_name
    is left there just in case.
    
    Fixes: 97fd49a7e074 ("ns16550: add support for UART parameters to be specifed with name-value pairs")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b27d3b45c75cf378f06ed72758c034a5d0f8d560
    master date: 2026-04-07 13:53:49 +0200
---
 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 293fc74d63..96e837afe8 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1472,7 +1472,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
     unsigned int i;
 
     param_name = strsep(&token, "=");
-    if ( param_name == NULL )
+    if ( !param_name || !token )
         return num_serial_params;
 
     /* Linear search for the parameter. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:35:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285635.1566657 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEly5-0003G1-8K; Mon, 20 Apr 2026 10:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285635.1566657; Mon, 20 Apr 2026 10:35: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 1wEly5-0003Fs-5b; Mon, 20 Apr 2026 10:35:05 +0000
Received: by outflank-mailman (input) for mailman id 1285635;
 Mon, 20 Apr 2026 10:35:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEly3-0003Fl-Qb
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:35:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEly3-00B55g-2Z
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEly3-00ClvA-2T
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KFS605RYDDVLHheXPbPxyk9PEcw5xgX6Q6SPFu3ioIA=; b=xVCSUA7L0sKecPaynEUpx0Fvxa
	jZnIgmPkX4VJ3wl6A1TCO6iF90qm92sV6wBjQ5DbzqUjYgYNVaL594nQczrz5U0wN+UOs4Fja3XIN
	+VXDRXmEC3xsJnU7AXcO3BH75MlvOQjv7ohVAnnj57uc21x6yhUUg+1AQ2Jq+gHliNBI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] ns16550: harden positional parsing
Message-Id: <E1wEly3-00ClvA-2T@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:35:03 +0000

commit afb919ff6ae38f797c162bf1c5d7b3d5abbd5e32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:26:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:26:25 2026 +0200

    ns16550: harden positional parsing
    
    Advancing past a character without knowing whether that's the NUL char is
    at risk of reading beyond the buffer.
    
    Fixes: 25de1f692059 ("Allow arch-specific defaults to be specified for ns16550")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 2c43b5611ffbe35611dd391c949f7cb15e1b29e7
    master date: 2026-04-07 13:54:19 +0200
---
 xen/drivers/char/ns16550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 96e837afe8..1f95618cf6 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1547,6 +1547,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
     {
         uart->data_bits = simple_strtoul(conf, &conf, 10);
 
+        if ( !*conf )
+            PARSE_ERR_RET("bad DPS setting");
+
         uart->parity = parse_parity_char(*conf);
 
         uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:35:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:35:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285636.1566660 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElyF-0003IK-9X; Mon, 20 Apr 2026 10:35:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285636.1566660; Mon, 20 Apr 2026 10:35: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 1wElyF-0003IC-6w; Mon, 20 Apr 2026 10:35:15 +0000
Received: by outflank-mailman (input) for mailman id 1285636;
 Mon, 20 Apr 2026 10:35:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElyD-0003I6-T3
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:35:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyD-00B564-2p
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyD-00ClyY-2j
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=od41XRhriAqJXwH+DV0Og+UioIlVAx5uT/tX3ipaqf0=; b=Z+xPfVYOk8TDUKxePXB7R8DJSq
	VznlAvshkxkfrXh6kNTno1sP5EIzlC5zdppevZAaZdVj5DYL+bxbvlRnSHK5VqvtyO8WuPwPCwN4t
	+OeQ5GTvIdjPkDeYXtzaa8xfkV9p/n6U661ZtvVVZdd3nfZ+bW7OOZlVs2Io1Nr6tFps=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] video/vesa: harden font height parsing
Message-Id: <E1wElyD-00ClyY-2j@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:35:13 +0000

commit 8f3dcdcf9f2522bd438b8f02ace6c64c8761a28d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:26:39 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:26:39 2026 +0200

    video/vesa: harden font height parsing
    
    We should not prematurely increment the pointer, to avoid inadvertently
    skipping a NUL terminator.
    
    Fixes: 6d9199bd0f22 ("x86-64: enable hypervisor output on VESA frame buffer")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3bcce461a33a8c0c0721543638ce375178d90006
    master date: 2026-04-07 13:54:37 +0200
---
 xen/drivers/video/vesa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 70feca21ac..f6c6afd40c 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -31,8 +31,8 @@ static unsigned int __initdata vram_remap;
 static unsigned int __initdata font_height;
 static int __init cf_check parse_font_height(const char *s)
 {
-    if ( simple_strtoul(s, &s, 10) == 8 && (*s++ == 'x') )
-        font_height = simple_strtoul(s, &s, 10);
+    if ( simple_strtoul(s, &s, 10) == 8 && (*s == 'x') )
+        font_height = simple_strtoul(s + 1, &s, 10);
     if ( *s != '\0' )
         font_height = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:35:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:35:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285637.1566665 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElyP-0003KM-Au; Mon, 20 Apr 2026 10:35:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285637.1566665; Mon, 20 Apr 2026 10:35: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 1wElyP-0003KE-8E; Mon, 20 Apr 2026 10:35:25 +0000
Received: by outflank-mailman (input) for mailman id 1285637;
 Mon, 20 Apr 2026 10:35:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElyN-0003K7-W6
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:35:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyN-00B588-36
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyN-00ClzC-30
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qKGt7EW//rh/AlD/Ww5lvtD2cZltutjCzJvpbT5ND1w=; b=F119ZSYdc9MfpvcML1/EKJm7fN
	YWcyzy6a3Ffkmp0qEMuRjLi+JSWQj+S94BxcDwsmruIlh0DSU3/deZZHP2GA82wUo0IT6W3DkYzXI
	oWIhWmFEjhYGarfX5l4jdWpECcYToHIHeDm4Jh7x8SMkn089RfDFoH+eEEVhHjkyXYgI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/x86: Check supported features even for PVH dom0
Message-Id: <E1wElyN-00ClzC-30@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:35:23 +0000

commit b2352be9415987e1d20281d8a9a8577600b417a4
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Mon Apr 20 12:27:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:27:00 2026 +0200

    xen/x86: Check supported features even for PVH dom0
    
    The supported features ELF notes was tested only if the dom0 was
    PV. Factor out a function to check ELF notes and reuse it even
    for PVH.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 44429b69319975f25d3762629b40fecdd4e3e554
    master date: 2026-04-09 21:04:58 +0100
---
 xen/arch/x86/dom0_build.c             | 12 ++++++++++++
 xen/arch/x86/hvm/dom0_build.c         |  3 +++
 xen/arch/x86/include/asm/dom0_build.h |  2 ++
 xen/arch/x86/pv/dom0_build.c          | 10 ++--------
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 0b467fd4a4..a32ad2739f 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -320,6 +320,18 @@ unsigned long __init dom0_paging_pages(const struct domain *d,
     return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
 }
 
+int __init initdom_check_parms(
+    const struct domain *d, const struct elf_dom_parms *parms)
+{
+    if ( parms->elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE &&
+         is_hardware_domain(d) && !test_bit(XENFEAT_dom0, parms->f_supported) )
+    {
+        printk("Kernel does not support Dom0 operation\n");
+        return -EINVAL;
+    }
+
+    return 0;
+}
 
 /*
  * If allocation isn't specified, reserve 1/16th of available memory for
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 6849e8c010..66199678e8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -692,6 +692,9 @@ static int __init pvh_load_kernel(
         return -EINVAL;
     }
 
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
+
     /* Copy the OS image and free temporary buffer. */
     elf.dest_base = (void *)(parms.virt_kstart - parms.virt_base);
     elf.dest_size = parms.virt_kend - parms.virt_kstart;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index ff021c24af..1332f18cc6 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -8,6 +8,8 @@
 
 extern unsigned int dom0_memflags;
 
+int initdom_check_parms(const struct domain *d,
+                        const struct elf_dom_parms *parms);
 unsigned long dom0_compute_nr_pages(struct domain *d,
                                     struct elf_dom_parms *parms,
                                     unsigned long initrd_len);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index f9bbbea2ff..37729091df 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -494,14 +494,8 @@ static int __init dom0_construct(const struct boot_domain *bd)
         return -EINVAL;
     }
 
-    if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE )
-    {
-        if ( !pv_shim && !test_bit(XENFEAT_dom0, parms.f_supported) )
-        {
-            printk("Kernel does not support Dom0 operation\n");
-            return -EINVAL;
-        }
-    }
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
 
     nr_pages = dom0_compute_nr_pages(d, &parms, initrd_len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:35:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:35:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285638.1566668 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElyZ-0003MN-CC; Mon, 20 Apr 2026 10:35:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285638.1566668; Mon, 20 Apr 2026 10:35: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 1wElyZ-0003MF-9h; Mon, 20 Apr 2026 10:35:35 +0000
Received: by outflank-mailman (input) for mailman id 1285638;
 Mon, 20 Apr 2026 10:35:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElyY-0003M9-2Z
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:35:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyY-00B58C-08
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyY-00Cm0d-03
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Lzi5/7ZFibwcENKba7YRSj34jqsavwbgCcG7UaLZdaM=; b=W/QttgWI98MLDSTSK4cSh1ZwI9
	k0+bq7qnWYNZpqUQVFphCS3AlYjauAC11QVDWSygjvQHFydtTJqCwzupbRT0yfop5HsdBui1gsVVY
	0jNavWA6BA8/JumOmYG/q85MZyFYVLBpwudM8XnWet++LzfcWw3QEecaSvxg5pNk0zBg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/uart: set a default baudrate if non specified neither found
Message-Id: <E1wElyY-00Cm0d-03@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:35:34 +0000

commit 6b8be120c8dd4f4c08718d6887625146077cd837
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:27:26 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:27:26 2026 +0200

    xen/uart: set a default baudrate if non specified neither found
    
    If the user has set baudrate as "auto" (use whatever was configured) but
    Xen cannot find any set baudrate use a default fallback baudrate of
    115200.
    
    Otherwise the console will very likely end up being non-functional, as
    further values are derived from the baudrate (like the transmit timeout),
    and using -1 will result in screwed parameters being derived from the
    baudrate.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    master commit: 12e50da43d926cc5401c6ec1146cdcedaba23243
    master date: 2026-04-10 14:30:50 +0200
---
 xen/drivers/char/ns16550.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 1f95618cf6..df554001bc 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -355,9 +355,16 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         if ( divisor )
             uart->baud = uart->clock_hz / (divisor << 4);
         else
+        {
+            uart->baud = 115200;
             printk(XENLOG_ERR
                    "Automatic baud rate determination was requested,"
-                   " but a baud rate was not set up\n");
+                   " but a baud rate was not set up\n"
+                   "Setting baudrate to %u\n", uart->baud);
+            divisor = uart->clock_hz / (uart->baud << 4);
+            ns_write_reg(uart, UART_DLL, (uint8_t)divisor);
+            ns_write_reg(uart, UART_DLM, (uint8_t)(divisor >> 8));
+        }
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:35:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:35:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285639.1566673 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElyj-0003Or-Dk; Mon, 20 Apr 2026 10:35:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285639.1566673; Mon, 20 Apr 2026 10:35: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 1wElyj-0003Oj-BD; Mon, 20 Apr 2026 10:35:45 +0000
Received: by outflank-mailman (input) for mailman id 1285639;
 Mon, 20 Apr 2026 10:35:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElyi-0003Oc-54
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:35:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyi-00B58O-0Q
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElyi-00Cm12-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+3T91cH78AztlY0/mamLG4eB3DWhptKvgtcb4K0i6HQ=; b=zvrIyWfNKIiUfLyew9+Kqytp4e
	UnNP8BLSJGUuIRJxjSpgmqHAqkdJvgDM92xrOdrLZ06XHE2pywltDpIbFhm57VTPJwDfYT71XRoy6
	5WWybJRq8uhHBagjb9gwxj0lzgG0ZqtHUdgslpRPNwP8MckeT79HPoVffvkHuLS4YlXs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/time: do not kill calibration timer on suspend
Message-Id: <E1wElyi-00Cm12-0J@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:35:44 +0000

commit 9c79644d359b24eadb2af1d40c5b2fa49e2bfc5a
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:27:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:27:45 2026 +0200

    x86/time: do not kill calibration timer on suspend
    
    A killed timer will ignore further set_timer() calls, and hence won't be
    re-armed unless it's initialized again.  Use stop_timer() instead of
    kill_timer() in time_suspend(), so that the set_timer() call in
    time_resume() successfully re-arms the timer.  Otherwise time calibration
    is no longer scheduled (and executed) after resuming from S3 suspend.
    
    Fixes: 6d90db1a2ca1 ("x86: rendezvous-based local time calibration")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: 2d670d258b2e592d44deb5ee12e7c2ba1d79d8a9
    master date: 2026-04-10 14:31:10 +0200
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 3b451525a9..bb36038e0c 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2720,7 +2720,7 @@ int time_suspend(void)
     {
         cmos_utc_offset = -get_wallclock_time();
         cmos_utc_offset += get_sec();
-        kill_timer(&calibration_timer);
+        stop_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
         platform_time_calibration();
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:35:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:35:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285640.1566676 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElyt-0003Qr-F8; Mon, 20 Apr 2026 10:35:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285640.1566676; Mon, 20 Apr 2026 10:35:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElyt-0003Qj-CU; Mon, 20 Apr 2026 10:35:55 +0000
Received: by outflank-mailman (input) for mailman id 1285640;
 Mon, 20 Apr 2026 10:35:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElys-0003Qd-7a
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:35:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElys-00B58U-0g
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElys-00Cm20-0b
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:35: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XIobnv7CxyjnEEiw5sSlk9OMsO/gCi33IWTtXcgADgI=; b=QbGa7NTsa91kGCCFgN3Sj9Pm14
	55Q+wBGIvvQvrGeZzgmlH1eLK1O7bTLdIu/zN/Kpnq2PtONtg+3zEZAQYEOmn15O3pTIjythGDBc/
	1t7+dCJ7yzxLGuuNSBkdB1UTbdA9ZMaAIl5qRFtoI6n9JhV9oYGa3A9brgLAOCsQw0v8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/APIC: handle overflow in TMICT calculation
Message-Id: <E1wElys-00Cm20-0b@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:35:54 +0000

commit 76b359a8784c15455da5374ece9f7b09358d5ccf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:28:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:28:16 2026 +0200

    x86/APIC: handle overflow in TMICT calculation
    
    With an expiry value on the order of 10 hours, and with a bus scale value
    of 256k (as supplied by qemu), the (signed) multiplication will be UB. As
    we've checked that the value is positive, we mean unsigned multiplication
    anyway. Yet let's play safe against even larger expiry and bus scale
    values, leveraging the compiler builtin that there is for this purpose.
    
    While there also drop the stray cast from the actual TMICT write.
    
    Fixes: 9062553a0dc1 ("added time and accurate timer support")
    Fixes: b95beb185810 ("x86: Clean up APIC local timer handling")
    Reported-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 4f14d97a620c3a005ad0604ae47ee6091281cda0
    master date: 2026-04-16 10:29:54 +0200
---
 xen/arch/x86/apic.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7747718600..a3e5ecdfbc 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1224,10 +1224,16 @@ int reprogram_timer(s_time_t timeout)
     }
 
     if ( timeout && ((expire = timeout - NOW()) > 0) )
-        apic_tmict = min_t(uint64_t, (bus_scale * expire) >> BUS_SCALE_SHIFT,
-                           UINT32_MAX);
+    {
+        unsigned long product;
+
+        apic_tmict = UINT32_MAX;
+        if ( !__builtin_umull_overflow(bus_scale, expire, &product) &&
+             (product >>= BUS_SCALE_SHIFT) < apic_tmict )
+            apic_tmict = product;
+    }
 
-    apic_write(APIC_TMICT, (unsigned long)apic_tmict);
+    apic_write(APIC_TMICT, apic_tmict);
 
     return apic_tmict || !timeout;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:36:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:36:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285641.1566681 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElz3-0003TM-IV; Mon, 20 Apr 2026 10:36:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285641.1566681; Mon, 20 Apr 2026 10:36:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElz3-0003TE-Fu; Mon, 20 Apr 2026 10:36:05 +0000
Received: by outflank-mailman (input) for mailman id 1285641;
 Mon, 20 Apr 2026 10:36:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElz2-0003T7-A9
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:36:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElz2-00B58m-0v
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElz2-00Cm42-0q
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xD98NOyrsKEX2pAdBgPWSvMQO2YkKfQ3Edck1CiRx/o=; b=UQQXzIPTgQC01GDMRK+rwRzfG2
	m5Dr1BKiv5wK8ljhF1ksbU0jguDEFrKqiO5QKFiCyRguzqjy4lTuQ/I75cN6GDyB5RVhOh322s5py
	uC1Cv1LFO56m83sBY0jZWyNEY4hoRLX2wIvKiDEb7S6cyKSzCDB/elG2J3ieDmXuOSzM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/HPET: channel handling in hpet_broadcast_resume()
Message-Id: <E1wElz2-00Cm42-0q@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:36:04 +0000

commit 2d1a11a50dcfede32e3ad4a577371df73312385d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:28:35 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:28:35 2026 +0200

    x86/HPET: channel handling in hpet_broadcast_resume()
    
    The per-channel ENABLE bit is to solely be driven by hpet_enable_channel()
    and hpet_msi_{,un}mask(). It doesn't need setting immediately. Except for
    the (possible) channel put in legacy mode we don't do so during boot
    either.
    
    Instead reset ->arch.cpu_mask, to avoid msi_compose_msg() yielding an
    all-zero message (when the passed in CPU mask has no online CPUs). Nothing
    would later call msi_compose_msg() / hpet_msi_write(), and hence nothing
    would later produce a well-formed message template in
    hpet_events[].msi.msg.
    
    Fixes: 15aa6c67486c ("amd iommu: use base platform MSI implementation")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c4d51191954c53590767c26e501e6dadf923bc47
    master date: 2026-04-16 10:44:16 +0200
---
 xen/arch/x86/hpet.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index a69abe2650..918fab774d 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -705,12 +705,18 @@ void hpet_broadcast_resume(void)
     for ( i = 0; i < n; i++ )
     {
         if ( hpet_events[i].msi.irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
+        {
+            struct irq_desc *desc = irq_to_desc(hpet_events[i].msi.irq);
+
+            cpumask_copy(desc->arch.cpu_mask, cpumask_of(smp_processor_id()));
+
+            __hpet_setup_msi_irq(desc);
+        }
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
+        cfg |= HPET_TN_32BIT;
         if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
             cfg |= HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:36:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:36:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285642.1566685 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElzD-0003Vf-Ju; Mon, 20 Apr 2026 10:36:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285642.1566685; Mon, 20 Apr 2026 10:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElzD-0003VX-HD; Mon, 20 Apr 2026 10:36:15 +0000
Received: by outflank-mailman (input) for mailman id 1285642;
 Mon, 20 Apr 2026 10:36:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElzC-0003VR-Cs
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:36:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElzC-00B59A-1C
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElzC-00Cm4e-17
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=P0v/iRH6W6sUQf821PKyZkyTQEOXJnWuTUVH9rfypY0=; b=U0paq/VIHiF57Gaa2LbNzZVOH3
	aVuiQdOai5J4NQMSh16wjbP3qAcm832rhjcGbA7qI+Xfnf2mw1lwrh9mEtgl6Pbg3zAgoqo090xnS
	P4C1dk8sVJ1MEoovyc/hkgtQ7XZefDPd0HIls+sBXYxOAtZVRme7dWCTtyoBPOsKgmyk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/time: use native TSC scaling factors when TSC is not scaled
Message-Id: <E1wElzC-00Cm4e-17@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:36:14 +0000

commit 27748a734393c1c6ec44aacacc6736749fbe72bf
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:28:50 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:28:50 2026 +0200

    x86/time: use native TSC scaling factors when TSC is not scaled
    
    When running HVM guest in native TSC mode avoid using the recalculated vTSC
    scaling factors based on the cpu_khz value.  Using the kHz based frequency
    leads to the TSC scaling values possibly not being the same as the ones
    used by the per CPU cpu_time->tsc_scale field, which introduces skew
    between the guest and Xen's calculations of the system time.
    
    On a 2gHz system, where the frequency is possibly detected as 1999999999Hz
    (note this is a worse-case scenario), the cpu_khz variable will be set to
    1999999kHz, and hence 999Hz cycles will be not accounted for per second.
    Over a second (the time synchronization period), this leads to a skew of:
    
    cycles * 1 / (Hz freq) = 999 / 1999999999 = 499,5ns
    
    So far this has gone unnoticed because the time synchronization rendezvous
    forces the update of the tsc_timestamp and system_time fields in the vCPU
    time info area, and hence the skew only accumulates up to the rendezvous
    period.  Attempting to remove the rendezvous causes the skew to grow
    unbounded.
    
    Fix by using the native TSC scaling values (as used by Xen) when the guest
    TSC is not scaled.
    
    Fixes: eab8a90be723 ("x86/time: scale host TSC in pvclock properly")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 305c6b901a44aa6e16d3bf7d104d7c08331d1731
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/x86/time.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bb36038e0c..d9f7772ab4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1702,17 +1702,25 @@ static void collect_time_info(const struct vcpu *v,
     else
     {
         if ( is_hvm_domain(d) && hvm_tsc_scaling_supported )
-        {
             tsc_stamp            = hvm_scale_tsc(d, t->stamp.local_tsc);
-            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
-            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
-        }
         else
-        {
             tsc_stamp            = t->stamp.local_tsc;
+
+        /*
+         * HVM guests using the native TSC ratio should use the same per-CPU
+         * scaling factors as Xen.  This ensures time keeping is always in sync
+         * between Xen and the guest.
+         */
+        if ( tsc_stamp == t->stamp.local_tsc )
+        {
             u->tsc_to_system_mul = t->tsc_scale.mul_frac;
             u->tsc_shift         = t->tsc_scale.shift;
         }
+        else
+        {
+            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
     }
 
     u->tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:36:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:36:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285643.1566688 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElzN-0003Xf-L7; Mon, 20 Apr 2026 10:36:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285643.1566688; Mon, 20 Apr 2026 10: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 1wElzN-0003XX-Ia; Mon, 20 Apr 2026 10:36:25 +0000
Received: by outflank-mailman (input) for mailman id 1285643;
 Mon, 20 Apr 2026 10:36:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElzM-0003XQ-Fx
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:36:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElzM-00B59F-1V
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElzM-00Cm9L-1O
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PgxOSHKwLdzU7lmM0C+c4RjNVGWDzxCw4nkzshpn/5E=; b=vKwAhcKyAXjz2e8eVaY/9eo8iz
	5FVvzyvEy5EaE95P5ISIOZzcK1mhNtlnz+Y5KyeH4c1FJHkvMv/7wPSXmdo3rXjczq6Tt7Lkvb/g2
	sWY86PEvgsAOcDQr2qWZicQs+DfU0gMn6P0SHOWOyRNhJG7N1uTQvhnG/KmsnpYq1dgc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/cpu: round cpu_khz calculations
Message-Id: <E1wElzM-00Cm9L-1O@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:36:24 +0000

commit 54db249531ac2bf2ea37d8b9d4fcf2ba06d2bc75
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:29:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:29:10 2026 +0200

    xen/cpu: round cpu_khz calculations
    
    All arches truncate the cpu_khz without taking into account the less
    significant digits.  Instead use DIV_ROUND() when scaling from Hz to kHz
    to get as more accurate kHz value.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 986707b461eb56d75f55581dd1c8e2633f814795
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/arm/time.c   | 4 ++--
 xen/arch/riscv/time.c | 2 +-
 xen/arch/x86/time.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index e74d30d258..61536081eb 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -128,7 +128,7 @@ static void __init preinit_dt_xen_time(void)
     res = dt_property_read_u32(timer, "clock-frequency", &rate);
     if ( res )
     {
-        cpu_khz = rate / 1000;
+        cpu_khz = DIV_ROUND(rate, 1000);
         validate_timer_frequency();
         timer_dt_clock_frequency = rate;
     }
@@ -146,7 +146,7 @@ void __init preinit_xen_time(void)
 
     if ( !cpu_khz )
     {
-        cpu_khz = (READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK) / 1000;
+        cpu_khz = DIV_ROUND(READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK, 1000);
         validate_timer_frequency();
     }
 
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index e962f8518d..4391488a73 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -36,7 +36,7 @@ static void __init preinit_dt_xen_time(void)
     if ( !dt_property_read_u32(timer, "timebase-frequency", &rate) )
         panic("Unable to find clock frequency\n");
 
-    cpu_khz = rate / 1000;
+    cpu_khz = DIV_ROUND(rate, 1000);
 }
 
 void __init preinit_xen_time(void)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index d9f7772ab4..0bae4ff339 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2634,7 +2634,7 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
-    cpu_khz = tmp / 1000;
+    cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:36:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:36:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285644.1566693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wElzX-0003Zf-MY; Mon, 20 Apr 2026 10:36:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285644.1566693; Mon, 20 Apr 2026 10: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 1wElzX-0003ZX-Jx; Mon, 20 Apr 2026 10:36:35 +0000
Received: by outflank-mailman (input) for mailman id 1285644;
 Mon, 20 Apr 2026 10:36:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wElzW-0003ZP-Ic
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:36:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElzW-00B59J-1m
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wElzW-00CmAk-1h
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:36:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kNpnL1Smg3LZ1OMLWBMvAuTnIK7i4I47rwJvZ3dvCQQ=; b=5EjU1pY0MPh2yVp8eHCEk3YnMG
	Z/ZMk/OWxDt3zfUbEkgmQAvH2ofUXm/vbatwj3lKsdOZ2yHQB8F8IQo9TRJS6dfLdtYouzrvTBMKe
	+obGTeCFp0Ple/fnYRJOsdaXKilSKlUDR3Uac/2ZMikr5ix4oI8BhVEVvf5Uv1HJheGg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/mkelf32: Actually pad load segment to 2 MiB boundary
Message-Id: <E1wElzW-00CmAk-1h@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:36:34 +0000

commit 17a78430548b577aed026199c5ebd17918131246
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:29:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:29:31 2026 +0200

    x86/mkelf32: Actually pad load segment to 2 MiB boundary
    
    Fix the code which tries to pad the load segment to 2 MiB but only pads
    it to a 1 MiB boundary.
    
    This manifests as a page fault while scrubbing RAM during boot on certain
    systems.
    
    Xen fails to mark itself as reserved in the E820 (due to spanning multiple
    regions), but does restrict the permissions in the directmap.  The region of
    RAM containing Xen is handed to physical memory manager as available for use,
    and scrubbing hit the directmap protections.
    
    Fixes: 4fb075201f54 ("x86/mkelf32: pad load segment to 2Mb boundary")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5416c455f656af9ff3ed7f26dcd5cbf70b254f23
    master date: 2026-04-17 18:15:54 +0100
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 373ba4ddd5..469d1ba0af 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -345,7 +345,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 20) - 1) & (-1U << 20);
+    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285645.1566698 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm6l-0004kQ-8P; Mon, 20 Apr 2026 10:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285645.1566698; Mon, 20 Apr 2026 10: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 1wEm6l-0004kI-4w; Mon, 20 Apr 2026 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1285645;
 Mon, 20 Apr 2026 10:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm6k-0004kC-8A
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm6k-00B5H0-0U
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm6k-00CnJP-0L
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CbtJCA4Yjc7LG0wHAiCao2mHt6N/mBbDrqjNOiD7K9w=; b=sULelikNE2Y1hUn0kRxDU7VTlN
	WYmIZ96x1V7OGVAFjAwJQw3rdO551/xmrEa8rhHm3kM/wpkxAKZV1yoCwxdw5yqv81Raq7txQUDc8
	QCM2rjET3JuIM8eYr2+p9YlLn1mzKVMlnJOPxC7z8xMAjsJqDvV3y23vdvXX8VNnWJY4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] update Xen version to 4.20.4-pre
Message-Id: <E1wEm6k-00CnJP-0L@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:44:02 +0000

commit 556887054c0705a3f854918f5644af302d386cc3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:32:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:32:24 2026 +0200

    update Xen version to 4.20.4-pre
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 90f493d74f..3e4d636a15 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    = 20
-export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285646.1566701 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm6v-0004mQ-9H; Mon, 20 Apr 2026 10:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285646.1566701; Mon, 20 Apr 2026 10: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 1wEm6v-0004mG-6S; Mon, 20 Apr 2026 10:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1285646;
 Mon, 20 Apr 2026 10:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm6u-0004m4-AU
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm6u-00B5HO-0l
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm6u-00CnKd-0f
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hDhtME5a1QlpBSKIPSvj5B1pe3w5ai8RlAQmCdhElxw=; b=3r1+abCbaOAAjuljciSAuLVDG2
	IMJOa1kmRCK3Ux5a8Eldzr3eo08DOuElSehH+LXwfyvR+RENX6k8iuSWamoFC0ZeDvHsnAfD6naOH
	+Xd3Lq2a1cZH9zA5J3gqEA4BILrS4FLVkvtQM8bV4pFqJRMETjJ6/do8/qdaRJ5hpWf8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] arinc653: overwrite entire .dom_handle[] for Dom0 slots
Message-Id: <E1wEm6u-00CnKd-0f@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:44:12 +0000

commit b96452cf853330bcec1494b2c0ab0cf672e03eb0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:32:47 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:32:47 2026 +0200

    arinc653: overwrite entire .dom_handle[] for Dom0 slots
    
    When that code still lived in a653sched_init(), it was redundant with the
    earlier memset() / xzalloc(). Once moved, the full structure field needs
    setting, as dom_handle_cmp() uses memcmp() and arinc653_sched_set() may
    have clobbered entries. Rather than implying the handle to be all zero,
    copy the handle out of the domain structure.
    
    Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 2a0ee29f5e6441b3c977ae8862842fd7c4da79d3
    master date: 2026-03-26 10:47:08 +0100
---
 xen/common/sched/arinc653.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 246ca9b742..bedd6d4007 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -418,7 +418,9 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
 
         if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
         {
-            sched_priv->schedule[entry].dom_handle[0] = '\0';
+            memcpy(sched_priv->schedule[entry].dom_handle,
+                   unit->domain->handle,
+                   sizeof(sched_priv->schedule->dom_handle));
             sched_priv->schedule[entry].unit_id = unit->unit_id;
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285647.1566705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm75-0004om-AO; Mon, 20 Apr 2026 10:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285647.1566705; Mon, 20 Apr 2026 10: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 1wEm75-0004oe-7p; Mon, 20 Apr 2026 10:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1285647;
 Mon, 20 Apr 2026 10:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm74-0004oW-BU
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm74-00B5Hc-13
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm74-00CnLx-0w
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hGEt8gHYDzl8zHbYTpRfCBtdoIVmCVAlUOAFHBKTs/g=; b=Q0DcZaYxGQd63H/PVNccr1MZ+u
	8ABTXBTqn5jzXggBYC8mDw3AM5vP6iePtF3bg+iSXa89sbkuhHPUyq/uFHl26QIh1HKDU5IMxXFXS
	hdVxGNaIgu+/frm4KeKwGBfWVyq9QVQCSZZGj+b5cYNP3L49tjEdKK2ummSC2r/Rg/P8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] arinc653: avoid array overrun
Message-Id: <E1wEm74-00CnLx-0w@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:44:22 +0000

commit f1826fa6ebe273b17980573208b705e270689474
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:33:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:33:18 2026 +0200

    arinc653: avoid array overrun
    
    Incrementing ->sched_index between bounds check and array access may
    result in accessing one past the array when that is fully filled
    (->num_schedule_entries == ARINC653_MAX_DOMAINS_PER_SCHEDULE).
    
    Fixes: 22787f2e107c ("ARINC 653 scheduler")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 5a1121633f2ae97d96d3e66472cf373a6caa3d51
    master date: 2026-03-26 10:47:41 +0100
---
 xen/common/sched/arinc653.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index bedd6d4007..0cc565f2c8 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -550,12 +550,9 @@ a653sched_do_schedule(
 
     /* Switch minor frame or find correct minor frame after a miss */
     while ( (now >= sched_priv->next_switch_time) &&
-        (sched_priv->sched_index < sched_priv->num_schedule_entries) )
-    {
-        sched_priv->sched_index++;
+            (++sched_priv->sched_index < sched_priv->num_schedule_entries) )
         sched_priv->next_switch_time +=
             sched_priv->schedule[sched_priv->sched_index].runtime;
-    }
 
     /*
      * If we exhausted the domains in the schedule and still have time left
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285648.1566710 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm7F-0004qk-CU; Mon, 20 Apr 2026 10:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285648.1566710; Mon, 20 Apr 2026 10: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 1wEm7F-0004qd-9D; Mon, 20 Apr 2026 10:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1285648;
 Mon, 20 Apr 2026 10:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm7E-0004qX-Ef
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7E-00B5Hi-1N
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7E-00CnNA-1E
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1NWj/9Ts0ys5RLcJpNQgs8XDM+rqgz+vlYWJw3AxTz8=; b=xtmmQNtTqFy8cdXDz3JSisq9Kx
	TSV29PD5NBxaEvgJl884HbvTkdIBKEgb7yiWntaH5IgPtiKnD1e6Y+E8kmC6TgKe3O7NZmoDYq6Gt
	ioyZUE/W3AOsoykTYB/WGm/N/GXFYvvlrzeq3gXJago5OA2ylKCwlj/wfol9bJEwVANc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] arinc653: remove idle period in default schedule
Message-Id: <E1wEm7E-00CnNA-1E@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:44:32 +0000

commit 36366ff7d31dcbc1a935e217a478ccd986f7fc66
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Apr 20 12:33:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:33:36 2026 +0200

    arinc653: remove idle period in default schedule
    
    By initializing major_frame in a653sched_init(), an idle period was
    inadvertently introduced into the default schedule. Account for the
    initial value of major_frame when populating the default schedule.
    
    Fixes: f2927d8343ae ("xen/arinc653: fix delay in the start of major frame")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 6d412c059982d821260055eaa43417b3245b2050
    master date: 2026-03-26 10:49:11 +0100
---
 xen/common/sched/arinc653.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 0cc565f2c8..1b0ed2f9dd 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -425,7 +425,8 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
 
-            sched_priv->major_frame += DEFAULT_TIMESLICE;
+            if ( entry )
+                sched_priv->major_frame += DEFAULT_TIMESLICE;
             ++sched_priv->num_schedule_entries;
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285649.1566714 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm7P-0004tH-Em; Mon, 20 Apr 2026 10:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285649.1566714; Mon, 20 Apr 2026 10: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 1wEm7P-0004t8-C2; Mon, 20 Apr 2026 10:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1285649;
 Mon, 20 Apr 2026 10:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm7O-0004t1-I2
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7O-00B5Hq-1f
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7O-00CnOZ-1X
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lxKaQrrmtmNHrcrAu/dE7HYVsdnYUNQHlBMz5hbT1ik=; b=bXlvk5IV7ms/AIQpFfzexRxMkB
	wjMjMsfZeTwEI9nauaNcZFdlFXaseXl6UUdTn00VVd57Bw/dfWw/ozgJSBP+kKim1V6MXc7rfqOjf
	vVt3g9eYPTzefGq+ZBjFFixoA3Y5VXlgDOIARtWC3QqHka2I49beVBDje9DOMsfLljsQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/uart: report an error if the device type is not supported
Message-Id: <E1wEm7O-00CnOZ-1X@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:44:42 +0000

commit ce40b0be7a712ae0079a43ab481b1bc91ba8a34d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:33:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:33:55 2026 +0200

    xen/uart: report an error if the device type is not supported
    
    When using key pairs for the uart configuration (com1 and com2 command line
    options), report an error if the passed device=<type> is not recognized
    instead of silently ignoring it.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 550ee7c198010c297d74b69e07d95a26358eadbd
    master date: 2026-03-27 14:52:40 +0100
---
 xen/drivers/char/ns16550.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index eaeb0e09d0..77acc188d9 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1656,6 +1656,8 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
                 pci_uart_config(uart, 0, uart - ns16550_com);
                 dev_set = true;
             }
+            else
+                PARSE_ERR_RET("Unknown device type %s\n", param_value);
             break;
 
         case port_bdf:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:44:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285650.1566717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm7Z-0004vN-Fr; Mon, 20 Apr 2026 10:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285650.1566717; Mon, 20 Apr 2026 10: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 1wEm7Z-0004vF-DO; Mon, 20 Apr 2026 10:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1285650;
 Mon, 20 Apr 2026 10:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm7Y-0004v9-Kc
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7Y-00B5I4-1x
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7Y-00CnQR-1r
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yZBPIgOsbboPHc6jc8STdjdOMoe19RLIDp8fSwgFYUA=; b=pokAfdk5E+41sIGfRXRMMiEWei
	4uwsCz/rple0zoGrdp/+TfrBMTgPm9JfYpEPNvq5D5rutu81VcpjnBBcTxiWJ63MXK3qMSHplhmCj
	px5+8Xj1TiI4jb8xjhFYGBiAkLdr2Ve48XbDBkxhNuyDyAw0Ztg0pm5Z73RbXKlynTWs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] libacpi: Pass missing --dm_version to mk_dsdt
Message-Id: <E1wEm7Y-00CnQR-1r@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:44:52 +0000

commit c1a7c617f1165ac7c5f0241da3e8889ca6ff38ba
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:34:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:34:17 2026 +0200

    libacpi: Pass missing --dm_version to mk_dsdt
    
    Commit 19ab8356abe4 ("tools: remove support for running a guest with
    qemu-traditional") made passing --dm_version to mk_dsdt mandatory on
    x86 but didn't fix all the invocations of it.
    
    The previous default was qemu-xen-traditional so with that removed set
    the dm_version to qemu-xen for this invocation.
    
    Without this change, Xen fails to build on x86 when using
    --enable-rombios.
    
    Fixes: 19ab8356abe4 ("tools: remove support for running a guest with qemu-traditional")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ea12f9d257353ddec8a2fe8da42d11636de3dacb
    master date: 2026-03-27 18:56:42 +0000
---
 tools/libacpi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index b21a64c6b4..193ec78672 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -51,7 +51,7 @@ $(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl  $(MK_DSDT)
 	# Remove last bracket
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
 	cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
-	$(MK_DSDT) --debug=$(debug) --maxcpu $*  >> $@.$(TMP_SUFFIX)
+	$(MK_DSDT) --debug=$(debug) --maxcpu $* --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 
 $(ACPI_BUILD_DIR)/dsdt_pvh.asl: dsdt_acpi_info.asl $(MK_DSDT)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:45:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285651.1566720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm7j-0004xQ-HY; Mon, 20 Apr 2026 10:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285651.1566720; Mon, 20 Apr 2026 10: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 1wEm7j-0004xI-Em; Mon, 20 Apr 2026 10:45:03 +0000
Received: by outflank-mailman (input) for mailman id 1285651;
 Mon, 20 Apr 2026 10:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm7i-0004x7-NK
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7i-00B5IW-2F
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7i-00CnRS-29
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1h6wvl+e593prR/groR9SrbycsB/MRCzH7kxXZu0vDk=; b=Au/a31yzMwuEpA6dDnSjoigJg1
	ozmIetn9juupzFeTdZYVmcsvwGgWTb5WRhcz/QCnT83q5FNv06FDpX1yeNlXdHCXhZjNBbWZrwyg7
	8DlRsKQDhDhgKENpA0zDCkoIjZnfUWGTaNXAHCDD0i185nskFgPtNsfwQe3PTylGGDOI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
Message-Id: <E1wEm7i-00CnRS-29@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:45:02 +0000

commit c2cb923ed7680b8ca7d5754a961635ecffff3c59
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:34:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:34:34 2026 +0200

    xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
    
    Auto-discovered serial PCI devices when using dev=amt|pci won't get
    ->ps_bdf_enable, and as such some of the logic (like making sure the
    respective BARs are enabled) won't be applied to them.
    
    Fix by unconditionally setting ->ps_bdf_enable for all PCI serial devices,
    and removing the special case that was done in some places by checking
    whether the ->bar was set.  This also allows simplifying the logic in
    pci_serial_early_init().
    
    Fixes: 9738db88f68f ("xen: Automatically find serial port on PCI/PCIe and AMT devices.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4bf33360623d9d59c8e7a49b70308c1b58d4d772
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 77acc188d9..1dce415cb2 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -273,7 +273,10 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
-    if ( uart->bar && uart->io_base >= 0x10000 )
+    if ( !uart->ps_bdf_enable )
+        return;
+
+    if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
@@ -281,9 +284,6 @@ static void pci_serial_early_init(struct ns16550 *uart)
         return;
     }
 
-    if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
-        return;
-
     if ( uart->pb_bdf_enable )
         pci_conf_write16(PCI_SBDF(0, uart->pb_bdf[0], uart->pb_bdf[1],
                                   uart->pb_bdf[2]),
@@ -428,7 +428,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
         unsigned int, 1, (bits * uart->fifo_size * 1000) / uart->baud);
 
 #ifdef NS16550_PCI
-    if ( uart->bar || uart->ps_bdf_enable )
+    if ( uart->ps_bdf_enable )
     {
         if ( uart->param && uart->param->mmio &&
              rangeset_add_range(mmio_ro_ranges, PFN_DOWN(uart->io_base),
@@ -1320,6 +1320,7 @@ pci_uart_config(struct ns16550 *uart, bool skip_amt, unsigned int idx)
                 uart->ps_bdf[0] = b;
                 uart->ps_bdf[1] = d;
                 uart->ps_bdf[2] = f;
+                uart->ps_bdf_enable = true;
                 uart->bar_idx = bar_idx;
                 uart->bar = bar;
                 uart->bar64 = bar_64;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:45:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285652.1566724 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm7t-0004zh-IZ; Mon, 20 Apr 2026 10:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285652.1566724; Mon, 20 Apr 2026 10: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 1wEm7t-0004zZ-G4; Mon, 20 Apr 2026 10:45:13 +0000
Received: by outflank-mailman (input) for mailman id 1285652;
 Mon, 20 Apr 2026 10:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm7s-0004zS-Pp
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7s-00B5Iv-2U
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm7s-00CnUq-2Q
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kLjcHHhfjQxxOcC0ej1Ob+Ix9rr+BtdHFIYZrKOfcy4=; b=KKPHX6chFLOjNLQyrybaYt3BiC
	2SyJJipX6Z9ugItoUKK4z3LmF3uuDWAqhcwcP7F/24V3oUdhIkaBbCEMGms8E//uc1SEfHF8cj98e
	41jzMky9ffSzz5DUBx9MUIoX7ptiTWH1v1ZNbnn3bpmdKtQU1kRZDBn3Rbz2ZUlf7eAk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/uart: be more careful with changes to the PCI command register
Message-Id: <E1wEm7s-00CnUq-2Q@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:45:12 +0000

commit 0359ff3565b40f8692c9a986d6d04a61b03e6d4f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:34:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:34:52 2026 +0200

    xen/uart: be more careful with changes to the PCI command register
    
    Read the existing PCI command register and only add the required bits to
    it, as to avoid clearing bits that might be possibly set by the firmware
    already, which might put the device into a non-working state.
    
    Xen being the owner of the PCI device it's legitimately allowed to change
    command registers bits.  Be careful however in case buggy devices require
    certain command register bits to be enabled, while not strictly required
    from Xen's usage.
    
    Fixes: f2ff5d6628b3 ("ns16550: enable PCI serial card usage")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ebf543972560e45b838def3a54859331cc92c970
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 1dce415cb2..9507af299f 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -273,14 +273,19 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
+    uint16_t cmd;
+
     if ( !uart->ps_bdf_enable )
         return;
 
+    cmd = pci_conf_read16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
+                                  uart->ps_bdf[2]), PCI_COMMAND);
+
     if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
-                         PCI_COMMAND, PCI_COMMAND_MEMORY);
+                         PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
         return;
     }
 
@@ -297,7 +302,7 @@ static void pci_serial_early_init(struct ns16550 *uart)
                      uart->io_base | PCI_BASE_ADDRESS_SPACE_IO);
     pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                               uart->ps_bdf[2]),
-                     PCI_COMMAND, PCI_COMMAND_IO);
+                     PCI_COMMAND, cmd | PCI_COMMAND_IO);
 #endif
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:45:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285653.1566729 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm83-00051m-KP; Mon, 20 Apr 2026 10:45:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285653.1566729; Mon, 20 Apr 2026 10: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 1wEm83-00051c-HO; Mon, 20 Apr 2026 10:45:23 +0000
Received: by outflank-mailman (input) for mailman id 1285653;
 Mon, 20 Apr 2026 10:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm82-00051U-Sa
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm82-00B5L1-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm82-00CnW9-2f
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uMOd1WXyDsJmrGK33DUO5M1FozKhEKNlXpqnOIBnZto=; b=qTzwpfZFI0q0/XsRNgbRgOq8is
	F8XBoRTvfm1lKh/RTyO/RdgjaI3Dyy74eRpDF5J7dLt1mY3t6+Xn8XrRO/Uhb11iMVYsdZOP1WHIj
	CXFn2rXojEABcF3y9pEKp2eqqHGiacgqJjqHG2ZRMO4Z+Qupdf/2pskDFpVGXKsGiwsA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/fpu: Initialise FTW in xstate_alloc_save_area()
Message-Id: <E1wEm82-00CnW9-2f@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:45:22 +0000

commit 140d981b2a498c682b65017ab4b70b2dc21e15e1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 20 12:35:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:13 2026 +0200

    x86/fpu: Initialise FTW in xstate_alloc_save_area()
    
    Right now, xstate_alloc_save_area() leaves both XSTATE_BV and FTW clear.  This
    causes a difference in behaviour between FXRSTOR and XRSTOR.
    
    Switch to using using XSTATE's idea of initial configuration which will behave
    the same even on pre-XSAVE hardware.  Expand the comment to explain why.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 639de2aafa437fd50abc16a46c8a8dd0d0e9e6a7
    master date: 2026-03-30 15:48:13 +0100
---
 xen/arch/x86/xstate.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index af9e345a7a..de29853f3c 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -542,11 +542,22 @@ int xstate_alloc_save_area(struct vcpu *v)
         return -ENOMEM;
 
     /*
-     * Set the memory image to default values, but don't force the context
-     * to be loaded from memory (i.e. keep save_area->xsave_hdr.xstate_bv
-     * clear).
+     * We're creating a vCPU, so conceptually we should be choosing the
+     * architectural #RESET values.
+     *
+     * However for historical reasons of configuring the external
+     * co-processor, FCW's #RESET state is different to what F(N)INIT and
+     * XSTATE consider the "initial configuration".
+     *
+     * Guests won't care about the difference; all software tends to executes
+     * FNINIT very early during setup.
+     *
+     * Use XSTATE's idea of initial configuration.  This allows XSTATE_BV to
+     * remain clear and for CPUs to use the INIT optimisation where
+     * applicable.
      */
     save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.ftw = FXSAVE_FTW_RESET;
     save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
 
     v->arch.xsave_area = save_area;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:45:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285654.1566733 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8D-00053i-La; Mon, 20 Apr 2026 10:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285654.1566733; Mon, 20 Apr 2026 10: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 1wEm8D-00053b-Ir; Mon, 20 Apr 2026 10:45:33 +0000
Received: by outflank-mailman (input) for mailman id 1285654;
 Mon, 20 Apr 2026 10:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm8C-00053V-VT
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:45:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8C-00B5L9-33
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8C-00CnWz-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pgNgt+WM6+doXmpdrX1R/qceTxPK9TQI0apaPnEhFnQ=; b=3y0pxPX0a5YCJBya7DG+C/vlXI
	vQ/bEI9uAfWahg7Oe/vGs9w3kxln9YeOBXBznIBPLxJlszD+Wl62TlT34fyjd0PT4FNkBD/HFkT3o
	Zc2Sy6LB/csn1kQMpGZsEi0rzGXhXg73Riw2sZXs7EZPpF5EZ7++JacmgtwkpJ8XDzP0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] EFI: avoid OOB config file reads
Message-Id: <E1wEm8C-00CnWz-2x@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:45:32 +0000

commit 05b8f716aa3273eb6daa8340f95e3936078ea8c7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:35:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:31 2026 +0200

    EFI: avoid OOB config file reads
    
    The message emitted by pre_parse() pretty clearly states the original
    intention. Yet what it said wasn't done, and would have been unfriendly to
    the user. Hence accesses past the allocated buffer were possible. Insert a
    terminating NUL immediately past the data read, to then drop the no longer
    applicable message.
    
    NB: The iscntrl() check of just the last byte is more strict than what
    pre_parse() would accept without issuing its prior message, yet I'd like
    to keep the new logic reasonably simple. Config files shouldn't be huge,
    and we shouldn't be _that_ short of memory (or we'd fail elsewhere pretty
    soon).
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: df75f77092c1cc47f3ed5be86cf6c04e732f3f80
    master date: 2026-04-07 08:59:15 +0200
---
 xen/common/efi/boot.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index b09890cb8f..c2db9afd63 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -774,8 +774,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     {
         file->addr = min(1UL << (32 + PAGE_SHIFT),
                          HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
+        /* For config files allocate an extra byte to put a NUL there. */
         ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
-                                    PFN_UP(size), &file->addr);
+                                    PFN_UP(size + (file == &cfg)), &file->addr);
     }
     if ( EFI_ERROR(ret) )
         what = what ?: L"Allocation";
@@ -804,6 +805,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
 
     efi_arch_flush_dcache_area(file->ptr, file->size);
 
+    if ( file == &cfg )
+        file->str[file->size] = 0;
+
     return true;
 }
 
@@ -819,6 +823,23 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
 
     file->ptr = ptr;
 
+    /* For cfg file, if necessary allocate space to put an extra NUL there. */
+    if ( file == &cfg && file->size && !iscntrl(file->str[file->size - 1]) )
+    {
+        EFI_PHYSICAL_ADDRESS addr;
+        EFI_STATUS ret = efi_bs->AllocatePages(AllocateMaxAddress,
+                                               EfiLoaderData,
+                                               PFN_UP(file->size + 1), &addr);
+
+        if ( EFI_ERROR(ret) )
+            return false;
+
+        memcpy((void *)addr, ptr, file->size);
+        file->addr = addr;
+        file->need_to_free = true;
+        file->str[file->size] = 0;
+    }
+
     handle_file_info(name, file, options);
 
     return true;
@@ -847,9 +868,6 @@ static void __init pre_parse(const struct file *file)
         else
             start = 0;
     }
-    if ( file->size && end[-1] )
-         PrintStr(L"No newline at end of config file,"
-                   " last line will be ignored.\r\n");
 }
 
 static void __init efi_init(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:45:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:45:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285655.1566737 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8N-00055l-NM; Mon, 20 Apr 2026 10:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285655.1566737; Mon, 20 Apr 2026 10:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8N-00055d-KR; Mon, 20 Apr 2026 10:45:43 +0000
Received: by outflank-mailman (input) for mailman id 1285655;
 Mon, 20 Apr 2026 10:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm8N-00055W-1a
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8N-00B5LJ-04
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8M-00CnXm-3D
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ExDLA5cyFnF/USme+SM6OMTrswseTV8+wQj/z6Ef8fo=; b=uv+6frCOVJQUm2Ds9WJWhil1TX
	JZ75tuRg1AnrglCVnxcEUncoRaVJisZGGkfIkkBJlQ1zkagQb6QT/33epxPuCcKLD+PG0QVpiH7u2
	GdxE9cGr7ioZsAqj3L27L9T8FaxpbaSwupLjp8uBdCfv/MU0iLaMrHryc+2x+h2WTfW0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] llc-coloring: improve checking while parsing
Message-Id: <E1wEm8M-00CnXm-3D@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:45:42 +0000

commit eb2c288ae12edd6e8cee7497847f9e81dfd9a4cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:35:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:48 2026 +0200

    llc-coloring: improve checking while parsing
    
    We can easily avoid the risk of wrapping UINT_MAX <-> 0 by applying a
    check against the compile-time-constant maximum number of colors.
    
    Additionally the overflow checks suffered from an off-by-1, as the parsed
    ranges are inclusive (e.g. end == start being possible, requiring 1 array
    slot, while availability of 0 slots was checked in that case).
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    xen/common: llc-coloring: Fix off-by-one in parse_color_config()
    
    The check uses (*num_colors + (end - start + 1)) >= max_num_colors, which
    rejects a configuration where exactly max_num_colors colors are specified.
    For example, if max_num_colors is 4 and *num_colors is 0, a range "0-3"
    gives (end - start + 1) = 4, and (0 + 4) >= 4 is true, incorrectly
    returning -EINVAL.
    
    Fix this by switching the overflow condition to the state before commit
    cba8a584de17 that regressed the behavior (i.e. don't add 1).
    
    Fixes: cba8a584de17 ("llc-coloring: improve checking while parsing")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    master commit: cba8a584de171c8c4510709c2edc9f1cf86b21ab
    master date: 2026-04-07 13:52:44 +0200
    master commit: dc28f531e6a29a6fdd58f24073dfb48af06b8334
    master date: 2026-04-10 12:14:05 +0200
---
 xen/common/llc-coloring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index a572f77a09..778092fe1f 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -76,7 +76,8 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         else                /* Single value */
             end = start;
 
-        if ( start > end || (end - start) > (UINT_MAX - *num_colors) ||
+        if ( end >= NR_LLC_COLORS || start > end ||
+             (end - start) >= (UINT_MAX - *num_colors) ||
              (*num_colors + (end - start)) >= max_num_colors )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:45:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:45:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285656.1566740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8X-00058F-RG; Mon, 20 Apr 2026 10:45:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285656.1566740; Mon, 20 Apr 2026 10:45: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 1wEm8X-000587-Od; Mon, 20 Apr 2026 10:45:53 +0000
Received: by outflank-mailman (input) for mailman id 1285656;
 Mon, 20 Apr 2026 10:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm8X-000581-4R
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8X-00B5LN-0M
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8X-00CnYa-0F
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:45:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nBWL7KXAEhOpcdHC43R9cJw+GzUsqxIEIW5jIbSADkQ=; b=qbPsFGuN1avhWWAFmWu5UAj3kv
	UCQJ/GB7UXs25AlLqmlngYHNEzf16ssgBezoNILErGieXDvQG+gAVOoshKDSM2xn2PZKiSIoyAGu/
	PLQOTeWxp4T2ShJNIZyv/5f8ukRv8cjUOvalOSrmcJ9wABtn8RwDDqg26MbXHBYoqAw0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] ns16550: harden name/value pair parsing
Message-Id: <E1wEm8X-00CnYa-0F@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:45:53 +0000

commit 928144f39f9195794e4aec147144238b242d49a7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:35:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:56 2026 +0200

    ns16550: harden name/value pair parsing
    
    strsep(), unless passed a 1st argument which itself points at a NULL
    pointer, won't return NULL. Instead if the separator(s) looked for isn't
    found, that pointed-to field would be updated to hold NULL. Hence the
    important check in get_token() is for token to be non-NULL after the call
    (which get_token()'s callers rely upon), while the checking of param_name
    is left there just in case.
    
    Fixes: 97fd49a7e074 ("ns16550: add support for UART parameters to be specifed with name-value pairs")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b27d3b45c75cf378f06ed72758c034a5d0f8d560
    master date: 2026-04-07 13:53:49 +0200
---
 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 9507af299f..ea35caf034 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1454,7 +1454,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
     unsigned int i;
 
     param_name = strsep(&token, "=");
-    if ( param_name == NULL )
+    if ( !param_name || !token )
         return num_serial_params;
 
     /* Linear search for the parameter. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:46:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285657.1566745 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8i-0005AH-Sa; Mon, 20 Apr 2026 10:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285657.1566745; Mon, 20 Apr 2026 10:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8i-0005A9-Pz; Mon, 20 Apr 2026 10:46:04 +0000
Received: by outflank-mailman (input) for mailman id 1285657;
 Mon, 20 Apr 2026 10:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm8h-0005A2-6z
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8h-00B5Lm-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8h-00Cna0-0X
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UyzooMZRNKoYL0KDQ8u4KJabOFRrcWIfvhq8ArlCigA=; b=U2EMfk3OAcZSUQmEtdD5Z6OQ5s
	Y9t9r5AXp/I/ys4v6zUQHRdtAd8WAksIw/jRQh59pp7vOz/+2QSylsKj/ieTZWIYoJTJAs1W4hGQj
	jXrpKUyRw3IkjFPuZlRYErFVpWW3EpPxmpGVwHnAw6MnoDb4zWL7ac/3hd1ocGhiwbWQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] ns16550: harden positional parsing
Message-Id: <E1wEm8h-00Cna0-0X@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:46:03 +0000

commit 491f6618b54f124fe10e22b8b96ed40e7c8d5635
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:36:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:36:19 2026 +0200

    ns16550: harden positional parsing
    
    Advancing past a character without knowing whether that's the NUL char is
    at risk of reading beyond the buffer.
    
    Fixes: 25de1f692059 ("Allow arch-specific defaults to be specified for ns16550")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 2c43b5611ffbe35611dd391c949f7cb15e1b29e7
    master date: 2026-04-07 13:54:19 +0200
---
 xen/drivers/char/ns16550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index ea35caf034..b443714c10 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1529,6 +1529,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
     {
         uart->data_bits = simple_strtoul(conf, &conf, 10);
 
+        if ( !*conf )
+            PARSE_ERR_RET("bad DPS setting");
+
         uart->parity = parse_parity_char(*conf);
 
         uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:46:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285658.1566749 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8s-0005Cb-UC; Mon, 20 Apr 2026 10:46:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285658.1566749; Mon, 20 Apr 2026 10:46:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm8s-0005CS-RS; Mon, 20 Apr 2026 10:46:14 +0000
Received: by outflank-mailman (input) for mailman id 1285658;
 Mon, 20 Apr 2026 10:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm8r-0005CM-9c
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8r-00B5MF-0s
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm8r-00CnaS-0m
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QVE9TupXucd3r0hoxU4C6eMmBYnwaBo4qfip4p508I0=; b=xFXQ/kT/kC4WWhMFgWHWnUjgl0
	akphrv/+I7+kELbKEzN3XgEtEMhVhpTyyMsb9jJEmVBfz4h+ySRt3e+rrW8hyQTphnjxLyN5mSOAu
	wFCTMndt4XQTnp+U5hjK4CAL+sXDMb6S+GjbIhKZn1LketND+U9ZXHDaWWiBq2tC5ajg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] video/vesa: harden font height parsing
Message-Id: <E1wEm8r-00CnaS-0m@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:46:13 +0000

commit 16489085bd8052cbae02b5fd18437847bd33f532
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:36:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:36:32 2026 +0200

    video/vesa: harden font height parsing
    
    We should not prematurely increment the pointer, to avoid inadvertently
    skipping a NUL terminator.
    
    Fixes: 6d9199bd0f22 ("x86-64: enable hypervisor output on VESA frame buffer")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3bcce461a33a8c0c0721543638ce375178d90006
    master date: 2026-04-07 13:54:37 +0200
---
 xen/drivers/video/vesa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 70feca21ac..f6c6afd40c 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -31,8 +31,8 @@ static unsigned int __initdata vram_remap;
 static unsigned int __initdata font_height;
 static int __init cf_check parse_font_height(const char *s)
 {
-    if ( simple_strtoul(s, &s, 10) == 8 && (*s++ == 'x') )
-        font_height = simple_strtoul(s, &s, 10);
+    if ( simple_strtoul(s, &s, 10) == 8 && (*s == 'x') )
+        font_height = simple_strtoul(s + 1, &s, 10);
     if ( *s != '\0' )
         font_height = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:46:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:46:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285659.1566753 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm92-0005Ea-VI; Mon, 20 Apr 2026 10:46:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285659.1566753; Mon, 20 Apr 2026 10:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm92-0005ES-Sm; Mon, 20 Apr 2026 10:46:24 +0000
Received: by outflank-mailman (input) for mailman id 1285659;
 Mon, 20 Apr 2026 10:46:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm91-0005EL-Cc
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm91-00B5MR-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm91-00Cnbv-13
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i1yjYgUQzzmpJcs9JBFBXFyN039pZR5trxO7oY0D3HM=; b=qMUsoeDK49rCbJs0Yavt1iu7Gz
	fTtijjfDb+7n4ZQYjLaqCWYiD21DO1G9gZT8jj3xSfqHQtV6P6hnmekQK7051pH2B7Xwi7D1nGrJS
	rm86zL/BO7pcQ2Qs5ppnMn/jAABz62Akq7wV7FusTyJDBhsIosiX2JXWJ85hLjX0iZzU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/x86: Check supported features even for PVH dom0
Message-Id: <E1wEm91-00Cnbv-13@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:46:23 +0000

commit 1f067a8e6a80cbb6102b4d5acd83fdb1c298aae2
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Mon Apr 20 12:36:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:36:52 2026 +0200

    xen/x86: Check supported features even for PVH dom0
    
    The supported features ELF notes was tested only if the dom0 was
    PV. Factor out a function to check ELF notes and reuse it even
    for PVH.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 44429b69319975f25d3762629b40fecdd4e3e554
    master date: 2026-04-09 21:04:58 +0100
---
 xen/arch/x86/dom0_build.c             | 12 ++++++++++++
 xen/arch/x86/hvm/dom0_build.c         |  3 +++
 xen/arch/x86/include/asm/dom0_build.h |  2 ++
 xen/arch/x86/pv/dom0_build.c          | 10 ++--------
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8191d90a22..5692fab0bc 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -319,6 +319,18 @@ unsigned long __init dom0_paging_pages(const struct domain *d,
     return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
 }
 
+int __init initdom_check_parms(
+    const struct domain *d, const struct elf_dom_parms *parms)
+{
+    if ( parms->elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE &&
+         is_hardware_domain(d) && !test_bit(XENFEAT_dom0, parms->f_supported) )
+    {
+        printk("Kernel does not support Dom0 operation\n");
+        return -EINVAL;
+    }
+
+    return 0;
+}
 
 /*
  * If allocation isn't specified, reserve 1/16th of available memory for
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index c6f8af9a96..6ab2ff5ec8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -690,6 +690,9 @@ static int __init pvh_load_kernel(
         return -EINVAL;
     }
 
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
+
     /* Copy the OS image and free temporary buffer. */
     elf.dest_base = (void *)(parms.virt_kstart - parms.virt_base);
     elf.dest_size = parms.virt_kend - parms.virt_kstart;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 2d67b17213..c362dc3771 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -8,6 +8,8 @@
 
 extern unsigned int dom0_memflags;
 
+int initdom_check_parms(const struct domain *d,
+                        const struct elf_dom_parms *parms);
 unsigned long dom0_compute_nr_pages(struct domain *d,
                                     struct elf_dom_parms *parms,
                                     unsigned long initrd_len);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index f54d1da5c6..5bc59b48a5 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -502,14 +502,8 @@ static int __init dom0_construct(struct boot_info *bi, struct domain *d)
         return -EINVAL;
     }
 
-    if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE )
-    {
-        if ( !pv_shim && !test_bit(XENFEAT_dom0, parms.f_supported) )
-        {
-            printk("Kernel does not support Dom0 operation\n");
-            return -EINVAL;
-        }
-    }
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
 
     nr_pages = dom0_compute_nr_pages(d, &parms, initrd_len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:46:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285660.1566757 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9D-0005Ga-0M; Mon, 20 Apr 2026 10:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285660.1566757; Mon, 20 Apr 2026 10:46:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9C-0005GS-U6; Mon, 20 Apr 2026 10:46:34 +0000
Received: by outflank-mailman (input) for mailman id 1285660;
 Mon, 20 Apr 2026 10:46:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm9B-0005GL-FB
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:46:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9B-00B5Mc-1R
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9B-00Cncw-1L
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xzRysfvuEyGdMYqK8OBeohLdcSe6ev+vqLv27rnNyqc=; b=hRkkj2C9g1U2YYXBBlZlqqvhfx
	vdbBLTwph598dtESKsh0RvoOK4rG0pnbaQAdzoH+16WvRijmXBYZv11b8TQYuobyiJdIECOn/bPrJ
	cxUVGVlCv7SOH2Qdi/zWpUvCQdMnKtxYuPdiMbyRSvVxd+Uf0G/GYaFe3zFFYLmI4JHg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/uart: set a default baudrate if non specified neither found
Message-Id: <E1wEm9B-00Cncw-1L@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:46:33 +0000

commit 92d668bf89c109b0fca60c018ef01d260e01f11a
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:37:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:37:12 2026 +0200

    xen/uart: set a default baudrate if non specified neither found
    
    If the user has set baudrate as "auto" (use whatever was configured) but
    Xen cannot find any set baudrate use a default fallback baudrate of
    115200.
    
    Otherwise the console will very likely end up being non-functional, as
    further values are derived from the baudrate (like the transmit timeout),
    and using -1 will result in screwed parameters being derived from the
    baudrate.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    master commit: 12e50da43d926cc5401c6ec1146cdcedaba23243
    master date: 2026-04-10 14:30:50 +0200
---
 xen/drivers/char/ns16550.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index b443714c10..6089558aae 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -345,9 +345,16 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         if ( divisor )
             uart->baud = uart->clock_hz / (divisor << 4);
         else
+        {
+            uart->baud = 115200;
             printk(XENLOG_ERR
                    "Automatic baud rate determination was requested,"
-                   " but a baud rate was not set up\n");
+                   " but a baud rate was not set up\n"
+                   "Setting baudrate to %u\n", uart->baud);
+            divisor = uart->clock_hz / (uart->baud << 4);
+            ns_write_reg(uart, UART_DLL, (uint8_t)divisor);
+            ns_write_reg(uart, UART_DLM, (uint8_t)(divisor >> 8));
+        }
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:46:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285661.1566761 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9N-0005Ig-20; Mon, 20 Apr 2026 10:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285661.1566761; Mon, 20 Apr 2026 10:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9M-0005IW-VQ; Mon, 20 Apr 2026 10:46:44 +0000
Received: by outflank-mailman (input) for mailman id 1285661;
 Mon, 20 Apr 2026 10:46:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm9L-0005IP-Hv
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:46:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9L-00B5Mo-1h
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9L-00Cndj-1c
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C2m/Wjn65M4zMu8c9+br7RCy5gJhsaiQT6yRPz2C1H0=; b=XMNPJ4SvxJ8CrxfJhzXtC9GzZg
	Z2w2fkseLi6AsMEEYtacmC/gfS6qbMv9/iRhfWDdmVU5hLsOAqI9ZFl9w6it7C/1rC9KJCjjok9Cy
	VvnI4346BEeg69velNJoWC6TfjFRZRaz0JRJAZpx2FD63fzSN8gl5hm+xMtl7a75bt4s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/time: do not kill calibration timer on suspend
Message-Id: <E1wEm9L-00Cndj-1c@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:46:43 +0000

commit c6d16eb5336508b7c436488800d912fa910db38c
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:37:35 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:37:35 2026 +0200

    x86/time: do not kill calibration timer on suspend
    
    A killed timer will ignore further set_timer() calls, and hence won't be
    re-armed unless it's initialized again.  Use stop_timer() instead of
    kill_timer() in time_suspend(), so that the set_timer() call in
    time_resume() successfully re-arms the timer.  Otherwise time calibration
    is no longer scheduled (and executed) after resuming from S3 suspend.
    
    Fixes: 6d90db1a2ca1 ("x86: rendezvous-based local time calibration")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: 2d670d258b2e592d44deb5ee12e7c2ba1d79d8a9
    master date: 2026-04-10 14:31:10 +0200
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 3b451525a9..bb36038e0c 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2720,7 +2720,7 @@ int time_suspend(void)
     {
         cmos_utc_offset = -get_wallclock_time();
         cmos_utc_offset += get_sec();
-        kill_timer(&calibration_timer);
+        stop_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
         platform_time_calibration();
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:46:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285662.1566765 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9X-0005Ke-3B; Mon, 20 Apr 2026 10:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285662.1566765; Mon, 20 Apr 2026 10:46:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9X-0005KW-0U; Mon, 20 Apr 2026 10:46:55 +0000
Received: by outflank-mailman (input) for mailman id 1285662;
 Mon, 20 Apr 2026 10:46:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm9V-0005KP-KY
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:46:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9V-00B5Mw-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9V-00Cneq-1s
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:46:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=esov32whpyzWrC5hn1vDjB9pD8w20YDHhaQch+rRpZM=; b=F9cp7nPPbYWMur6sl6IIXTnPiD
	tt0xy4lS7FRoCQS0ZSriHn7eV2DSVbtlTQTAgg8fBU57A/r+gkZO98HKmmHmmzSvaQbW0ZIX+6gJ8
	QC4ismgfYy98DMB8i+v8xOVl370ntwOq7T9tTmcTWpPHVWUjCoNLrXXE2xTo+8210524=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/APIC: handle overflow in TMICT calculation
Message-Id: <E1wEm9V-00Cneq-1s@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:46:53 +0000

commit d5c70a51bfbe95e54fb7c78c8ef31cf43d10c5b1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:37:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:37:56 2026 +0200

    x86/APIC: handle overflow in TMICT calculation
    
    With an expiry value on the order of 10 hours, and with a bus scale value
    of 256k (as supplied by qemu), the (signed) multiplication will be UB. As
    we've checked that the value is positive, we mean unsigned multiplication
    anyway. Yet let's play safe against even larger expiry and bus scale
    values, leveraging the compiler builtin that there is for this purpose.
    
    While there also drop the stray cast from the actual TMICT write.
    
    Fixes: 9062553a0dc1 ("added time and accurate timer support")
    Fixes: b95beb185810 ("x86: Clean up APIC local timer handling")
    Reported-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 4f14d97a620c3a005ad0604ae47ee6091281cda0
    master date: 2026-04-16 10:29:54 +0200
---
 xen/arch/x86/apic.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7a0920d11c..daf597ed44 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1311,10 +1311,21 @@ int reprogram_timer(s_time_t timeout)
     }
 
     if ( timeout && ((expire = timeout - NOW()) > 0) )
-        apic_tmict = min_t(uint64_t, (bus_scale * expire) >> BUS_SCALE_SHIFT,
-                           UINT32_MAX);
+    {
+        unsigned long product;
+        bool overflow;
+
+        apic_tmict = UINT32_MAX;
+        asm ( "mul %[expire]\n\t"
+              ASM_FLAG_OUT(, "setc %[cf]")
+              : "=a" (product), [cf] ASM_FLAG_OUT("=@ccc", "=qm") (overflow)
+              : "0" ((unsigned long)bus_scale), [expire] "r" (expire) );
+        if ( !overflow &&
+             (product >>= BUS_SCALE_SHIFT) < apic_tmict )
+            apic_tmict = product;
+    }
 
-    apic_write(APIC_TMICT, (unsigned long)apic_tmict);
+    apic_write(APIC_TMICT, apic_tmict);
 
     return apic_tmict || !timeout;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:47:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:47:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285663.1566769 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9h-0005Mh-4x; Mon, 20 Apr 2026 10:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285663.1566769; Mon, 20 Apr 2026 10:47:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9h-0005MZ-1v; Mon, 20 Apr 2026 10:47:05 +0000
Received: by outflank-mailman (input) for mailman id 1285663;
 Mon, 20 Apr 2026 10:47:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm9f-0005MS-NB
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:47:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9f-00B5NH-2D
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9f-00Cnfs-28
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2p+XwynDOfybQP5s0JNWAXFuqacKy2uzi5XQj64dEYo=; b=OGGLJI8Z1X1CIgQsR4xyjXHqZ2
	PSSUVNkSgCZYsfPRmS3ByC1opBsQIYzCopfWJOT/fvDuL186tD2wteHFebyUqFUaATwBrduX6LunK
	8L3IYOfwEsNS+nOw4O8QPaGJByGiNIxSZqLm38fIy5lsqcBl163j2ts7dJfRkMniNq5Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/HPET: channel handling in hpet_broadcast_resume()
Message-Id: <E1wEm9f-00Cnfs-28@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:47:03 +0000

commit be6b618fd7f7501d437d6c218794f640166d769c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:38:15 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:38:15 2026 +0200

    x86/HPET: channel handling in hpet_broadcast_resume()
    
    The per-channel ENABLE bit is to solely be driven by hpet_enable_channel()
    and hpet_msi_{,un}mask(). It doesn't need setting immediately. Except for
    the (possible) channel put in legacy mode we don't do so during boot
    either.
    
    Instead reset ->arch.cpu_mask, to avoid msi_compose_msg() yielding an
    all-zero message (when the passed in CPU mask has no online CPUs). Nothing
    would later call msi_compose_msg() / hpet_msi_write(), and hence nothing
    would later produce a well-formed message template in
    hpet_events[].msi.msg.
    
    Fixes: 15aa6c67486c ("amd iommu: use base platform MSI implementation")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c4d51191954c53590767c26e501e6dadf923bc47
    master date: 2026-04-16 10:44:16 +0200
---
 xen/arch/x86/hpet.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index fe714ca12c..958f04fad6 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -701,12 +701,18 @@ void hpet_broadcast_resume(void)
     for ( i = 0; i < n; i++ )
     {
         if ( hpet_events[i].msi.irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
+        {
+            struct irq_desc *desc = irq_to_desc(hpet_events[i].msi.irq);
+
+            cpumask_copy(desc->arch.cpu_mask, cpumask_of(smp_processor_id()));
+
+            __hpet_setup_msi_irq(desc);
+        }
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
+        cfg |= HPET_TN_32BIT;
         if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
             cfg |= HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:47:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285664.1566773 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9r-0005PT-80; Mon, 20 Apr 2026 10:47:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285664.1566773; Mon, 20 Apr 2026 10:47:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEm9r-0005PM-5C; Mon, 20 Apr 2026 10:47:15 +0000
Received: by outflank-mailman (input) for mailman id 1285664;
 Mon, 20 Apr 2026 10:47:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm9p-0005PG-Pk
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:47:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9p-00B5Np-2U
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9p-00CngT-2O
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WZwcwXZhNXUzqR6DijmSNG0aMolvKDeH7GIrbVDuw2s=; b=gDeqAW3Di58GtTB+mVOQEhCozW
	bb7UpAKEFjOlWVpzq8hPs+rV661q5gW6Y7ANSuJ3Mni2DhCFonwO9NNw1kaO8RkddFuHsgOk7QPd5
	zng3GKkTQnSZU8gRiV5tin3HXEfVW7zp7m5guIGTOT9dlsTATVMFgw/T81kLVa+GHp3o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/time: use native TSC scaling factors when TSC is not scaled
Message-Id: <E1wEm9p-00CngT-2O@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:47:13 +0000

commit ef5c706f62eb249752b184d158194473859ef05b
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:38:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:38:31 2026 +0200

    x86/time: use native TSC scaling factors when TSC is not scaled
    
    When running HVM guest in native TSC mode avoid using the recalculated vTSC
    scaling factors based on the cpu_khz value.  Using the kHz based frequency
    leads to the TSC scaling values possibly not being the same as the ones
    used by the per CPU cpu_time->tsc_scale field, which introduces skew
    between the guest and Xen's calculations of the system time.
    
    On a 2gHz system, where the frequency is possibly detected as 1999999999Hz
    (note this is a worse-case scenario), the cpu_khz variable will be set to
    1999999kHz, and hence 999Hz cycles will be not accounted for per second.
    Over a second (the time synchronization period), this leads to a skew of:
    
    cycles * 1 / (Hz freq) = 999 / 1999999999 = 499,5ns
    
    So far this has gone unnoticed because the time synchronization rendezvous
    forces the update of the tsc_timestamp and system_time fields in the vCPU
    time info area, and hence the skew only accumulates up to the rendezvous
    period.  Attempting to remove the rendezvous causes the skew to grow
    unbounded.
    
    Fix by using the native TSC scaling values (as used by Xen) when the guest
    TSC is not scaled.
    
    Fixes: eab8a90be723 ("x86/time: scale host TSC in pvclock properly")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 305c6b901a44aa6e16d3bf7d104d7c08331d1731
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/x86/time.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bb36038e0c..d9f7772ab4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1702,17 +1702,25 @@ static void collect_time_info(const struct vcpu *v,
     else
     {
         if ( is_hvm_domain(d) && hvm_tsc_scaling_supported )
-        {
             tsc_stamp            = hvm_scale_tsc(d, t->stamp.local_tsc);
-            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
-            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
-        }
         else
-        {
             tsc_stamp            = t->stamp.local_tsc;
+
+        /*
+         * HVM guests using the native TSC ratio should use the same per-CPU
+         * scaling factors as Xen.  This ensures time keeping is always in sync
+         * between Xen and the guest.
+         */
+        if ( tsc_stamp == t->stamp.local_tsc )
+        {
             u->tsc_to_system_mul = t->tsc_scale.mul_frac;
             u->tsc_shift         = t->tsc_scale.shift;
         }
+        else
+        {
+            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
     }
 
     u->tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:47:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:47:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285665.1566776 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEmA1-0005T4-9F; Mon, 20 Apr 2026 10:47:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285665.1566776; Mon, 20 Apr 2026 10:47:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEmA1-0005Sw-6i; Mon, 20 Apr 2026 10:47:25 +0000
Received: by outflank-mailman (input) for mailman id 1285665;
 Mon, 20 Apr 2026 10:47:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEm9z-0005Sp-SL
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:47:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9z-00B5O3-2k
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEm9z-00Cngt-2f
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9hbSlp2w2SGet0xwz17QPBvJXmf46ns20uRbFQSndbM=; b=emzzdBn4lPqRqnUVZlSq9k+DVr
	xEXqZOyJVuTMQROMpzVawoKVNqKaL1LCM36579o4ZVBXxbJsYXZEbPbxAsd2+HwPTFdH9nwxVVnTy
	JPmYxfn3+BO+sWwKMRfp0CmBCK8F8ZNe9wvWYnB/5JE1Y/WOYGqvQUhETPq6eCiJjo2I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/cpu: round cpu_khz calculations
Message-Id: <E1wEm9z-00Cngt-2f@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:47:23 +0000

commit 57db4b630312efff5eb0a643476b26d70957d104
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:38:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:38:52 2026 +0200

    xen/cpu: round cpu_khz calculations
    
    All arches truncate the cpu_khz without taking into account the less
    significant digits.  Instead use DIV_ROUND() when scaling from Hz to kHz
    to get as more accurate kHz value.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 986707b461eb56d75f55581dd1c8e2633f814795
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/arm/time.c | 4 ++--
 xen/arch/x86/time.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index e74d30d258..61536081eb 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -128,7 +128,7 @@ static void __init preinit_dt_xen_time(void)
     res = dt_property_read_u32(timer, "clock-frequency", &rate);
     if ( res )
     {
-        cpu_khz = rate / 1000;
+        cpu_khz = DIV_ROUND(rate, 1000);
         validate_timer_frequency();
         timer_dt_clock_frequency = rate;
     }
@@ -146,7 +146,7 @@ void __init preinit_xen_time(void)
 
     if ( !cpu_khz )
     {
-        cpu_khz = (READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK) / 1000;
+        cpu_khz = DIV_ROUND(READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK, 1000);
         validate_timer_frequency();
     }
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index d9f7772ab4..0bae4ff339 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2634,7 +2634,7 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
-    cpu_khz = tmp / 1000;
+    cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 10:47:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 10:47:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285666.1566781 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEmAB-0005Y1-Aa; Mon, 20 Apr 2026 10:47:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285666.1566781; Mon, 20 Apr 2026 10:47:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEmAB-0005Xt-81; Mon, 20 Apr 2026 10:47:35 +0000
Received: by outflank-mailman (input) for mailman id 1285666;
 Mon, 20 Apr 2026 10:47:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEmA9-0005Xm-Ur
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 10:47:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEmA9-00B5OA-30
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEmA9-00CnhF-2v
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 10:47:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bEbpsltWwMVLO4P6tAJuJBUkQdxlagxQ89ubwvxHurA=; b=igVglljlV11HZi5LWayp1AbCDq
	2mdifXPNJd4VxdPkOsI8nBM/9j2CrvLPIuVMb/v87pF5s65Wgk9eQ5Ru0CV025sdNQfXWP5nLqTHJ
	hEFi7laTUeBb10TUhYynmEQCe6IMM1rD1fXb/G5DpKlCOjMCT6ltyugXPxt5xfXPWwi8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/mkelf32: Actually pad load segment to 2 MiB boundary
Message-Id: <E1wEmA9-00CnhF-2v@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 10:47:33 +0000

commit ad5d9554482739052a4a70711b21e48c02a515d1
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:39:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:39:07 2026 +0200

    x86/mkelf32: Actually pad load segment to 2 MiB boundary
    
    Fix the code which tries to pad the load segment to 2 MiB but only pads
    it to a 1 MiB boundary.
    
    This manifests as a page fault while scrubbing RAM during boot on certain
    systems.
    
    Xen fails to mark itself as reserved in the E820 (due to spanning multiple
    regions), but does restrict the permissions in the directmap.  The region of
    RAM containing Xen is handed to physical memory manager as available for use,
    and scrubbing hit the directmap protections.
    
    Fixes: 4fb075201f54 ("x86/mkelf32: pad load segment to 2Mb boundary")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5416c455f656af9ff3ed7f26dcd5cbf70b254f23
    master date: 2026-04-17 18:15:54 +0100
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 373ba4ddd5..469d1ba0af 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -345,7 +345,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 20) - 1) & (-1U << 20);
+    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285698.1566812 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn2p-0005Gi-QY; Mon, 20 Apr 2026 11:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285698.1566812; Mon, 20 Apr 2026 11: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 1wEn2p-0005Ga-Ny; Mon, 20 Apr 2026 11:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1285698;
 Mon, 20 Apr 2026 11:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn2o-0005GU-G0
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn2o-00B6RE-1H
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn2o-00Cqtk-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ssqWuHxMbmbC1JS+JzslMqiRxJiA40bqPQ9mJVtJnho=; b=q5Jqm2QnwV+jdaTN2vhpxYXpDw
	lNFGmXqdrolna9TnBxEuoRxYDzt1GGgl6hkI2Ogkubp9OQnit0CcsCXS6gEry9+DipWuzOBnfHQRp
	dwoMexQknJ/Uvkd5JvBa3YPJdGjFye09BCMlSWWd3iYj3Dlsb07RoNI8JenVrBr5R0Ag=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] update Xen version to 4.21.2-pre
Message-Id: <E1wEn2o-00Cqtk-1A@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:44:02 +0000

commit fa82d4f5cc9766ba6ed74e378cd69493a2f9fa28
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:19:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:19:00 2026 +0200

    update Xen version to 4.21.2-pre
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index d808267ce1..8ffa719ab9 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    = 21
-export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:44:18 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285699.1566817 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn2z-0005J4-SJ; Mon, 20 Apr 2026 11:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285699.1566817; Mon, 20 Apr 2026 11: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 1wEn2z-0005Is-PO; Mon, 20 Apr 2026 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1285699;
 Mon, 20 Apr 2026 11:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn2y-0005Ii-HE
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn2y-00B6Re-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn2y-00CqvP-1S
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xLsmrd0z4uhDwuXn2Isi80Q1zHlS71iStALCu/a/GaQ=; b=kfwjPJ+MkWq+1J+JkVy7cvfbKB
	gOi9BHKcASiAOdKmmU6rfiFKBODx/sANmsqK0diFDDjD2qqqXmoQgCTKEhL9n5fSjyzb5pOnriQxW
	0KIR0jnv8BBYuoFQsM+xUtmDdrJtmXVESrhHj8+PnzEntkLaP/wQw305mhjd3A0yj+CA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] arinc653: overwrite entire .dom_handle[] for Dom0 slots
Message-Id: <E1wEn2y-00CqvP-1S@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:44:12 +0000

commit d174a86aaf3f019307f52a81df5e1fd32de44e86
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:19:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:19:52 2026 +0200

    arinc653: overwrite entire .dom_handle[] for Dom0 slots
    
    When that code still lived in a653sched_init(), it was redundant with the
    earlier memset() / xzalloc(). Once moved, the full structure field needs
    setting, as dom_handle_cmp() uses memcmp() and arinc653_sched_set() may
    have clobbered entries. Rather than implying the handle to be all zero,
    copy the handle out of the domain structure.
    
    Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 2a0ee29f5e6441b3c977ae8862842fd7c4da79d3
    master date: 2026-03-26 10:47:08 +0100
---
 xen/common/sched/arinc653.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 8a4f4259d8..bde15eb7e1 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -420,7 +420,9 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
 
         if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
         {
-            sched_priv->schedule[entry].dom_handle[0] = '\0';
+            memcpy(sched_priv->schedule[entry].dom_handle,
+                   unit->domain->handle,
+                   sizeof(sched_priv->schedule->dom_handle));
             sched_priv->schedule[entry].unit_id = unit->unit_id;
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285700.1566820 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn39-0005LG-TN; Mon, 20 Apr 2026 11:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285700.1566820; Mon, 20 Apr 2026 11: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 1wEn39-0005L8-Qg; Mon, 20 Apr 2026 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1285700;
 Mon, 20 Apr 2026 11:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn38-0005Ky-MB
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn38-00B6Rk-27
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn38-00CqwT-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n9togfqlZQQU8gqUHHMX7RXIxKI0N2rjuePojZynJ+U=; b=jY0dn2UqilntgOS7TwS6XdeUz+
	XGDTvGTFT8CNitwYi0RgXnAOPSSCPaE8pcrAqSY8ic1tojfwn1SuiFmTjQY7fHHrMJAQn8W1lF9yn
	Z0aGIcVCwA7YFUuFrXDUs0Xww8rt7/E3oL1+8E3mWrclbMbvaQwhFDFH1QSywcNX/Rdk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] arinc653: avoid array overrun
Message-Id: <E1wEn38-00CqwT-1l@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:44:22 +0000

commit 646bcc17cea3d4d25348cd794a666c51f813c804
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:20:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:20:23 2026 +0200

    arinc653: avoid array overrun
    
    Incrementing ->sched_index between bounds check and array access may
    result in accessing one past the array when that is fully filled
    (->num_schedule_entries == ARINC653_MAX_DOMAINS_PER_SCHEDULE).
    
    Fixes: 22787f2e107c ("ARINC 653 scheduler")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 5a1121633f2ae97d96d3e66472cf373a6caa3d51
    master date: 2026-03-26 10:47:41 +0100
---
 xen/common/sched/arinc653.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index bde15eb7e1..c35bfbd04e 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -552,12 +552,9 @@ a653sched_do_schedule(
 
     /* Switch minor frame or find correct minor frame after a miss */
     while ( (now >= sched_priv->next_switch_time) &&
-        (sched_priv->sched_index < sched_priv->num_schedule_entries) )
-    {
-        sched_priv->sched_index++;
+            (++sched_priv->sched_index < sched_priv->num_schedule_entries) )
         sched_priv->next_switch_time +=
             sched_priv->schedule[sched_priv->sched_index].runtime;
-    }
 
     /*
      * If we exhausted the domains in the schedule and still have time left
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285701.1566825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn3J-0005NS-V9; Mon, 20 Apr 2026 11:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285701.1566825; Mon, 20 Apr 2026 11: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 1wEn3J-0005NK-S4; Mon, 20 Apr 2026 11:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1285701;
 Mon, 20 Apr 2026 11:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn3I-0005NB-R3
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3I-00B6Rq-2c
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3I-00Cqy2-2H
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WzaPlQlkhtxNWZQTYptCqYIYr6BSNuIA+rMgQP/42o4=; b=nUxp85r9PswfYYjOoC8KB74BT9
	Rpi5VRWA07pgStT5+iJvw8i5nTBDwl5MIgxSjrYMW7bGNXYp6e3f5HOe4+g2qOVpIxQOKbm0SSE8z
	VV7hXodQABMV+1f5v8LMr5Sqh6iu/GpCFoHlRlIe8c7ypPg7myvnF7IWpw1eicETQxrE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] arinc653: remove idle period in default schedule
Message-Id: <E1wEn3I-00Cqy2-2H@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:44:32 +0000

commit aaa03d41be02cd947fb5e6acde2c3eaa8a179e88
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Apr 20 12:20:41 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:20:41 2026 +0200

    arinc653: remove idle period in default schedule
    
    By initializing major_frame in a653sched_init(), an idle period was
    inadvertently introduced into the default schedule. Account for the
    initial value of major_frame when populating the default schedule.
    
    Fixes: f2927d8343ae ("xen/arinc653: fix delay in the start of major frame")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 6d412c059982d821260055eaa43417b3245b2050
    master date: 2026-03-26 10:49:11 +0100
---
 xen/common/sched/arinc653.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index c35bfbd04e..19249f6464 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -427,7 +427,8 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
 
-            sched_priv->major_frame += DEFAULT_TIMESLICE;
+            if ( entry )
+                sched_priv->major_frame += DEFAULT_TIMESLICE;
             ++sched_priv->num_schedule_entries;
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285702.1566827 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn3T-0005Pd-W6; Mon, 20 Apr 2026 11:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285702.1566827; Mon, 20 Apr 2026 11: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 1wEn3T-0005PV-TU; Mon, 20 Apr 2026 11:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1285702;
 Mon, 20 Apr 2026 11:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn3S-0005PO-Tr
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3S-00B6Rw-2s
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3S-00Cqz8-2m
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DsYBrVnnrV5cm3b+6TjBUzr9b8AvUJ4GxmLKcgMVSFg=; b=rmgXyaQbk8/LHC2nWjRqs9qnqU
	LVmQN0iTTvTQPK6oCt8o3RZmvtGqbxR1Xt0Hu+N3sp5GSmbzegqMpqbXnRT9mX+ni0GOW49WSFAVS
	F999iaazXWoaNScJdKCwx4y2pLvVDEwK3AsKAkfa1ZJOt77PEXCTXaYPlvz+JNjKM7vU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/uart: report an error if the device type is not supported
Message-Id: <E1wEn3S-00Cqz8-2m@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:44:42 +0000

commit b3c4a20a15ae90e1f1e7c2bf22a1b56eb293d4d1
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:21:35 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:21:35 2026 +0200

    xen/uart: report an error if the device type is not supported
    
    When using key pairs for the uart configuration (com1 and com2 command line
    options), report an error if the passed device=<type> is not recognized
    instead of silently ignoring it.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 550ee7c198010c297d74b69e07d95a26358eadbd
    master date: 2026-03-27 14:52:40 +0100
---
 xen/drivers/char/ns16550.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index df7fff7f81..d384f1c69d 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1674,6 +1674,8 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
                 pci_uart_config(uart, 0, uart - ns16550_com);
                 dev_set = true;
             }
+            else
+                PARSE_ERR_RET("Unknown device type %s\n", param_value);
             break;
 
         case port_bdf:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285703.1566831 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn3e-0005SE-3K; Mon, 20 Apr 2026 11:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285703.1566831; Mon, 20 Apr 2026 11:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn3e-0005S6-0q; Mon, 20 Apr 2026 11:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1285703;
 Mon, 20 Apr 2026 11:44:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn3d-0005S0-1U
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:44:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3d-00B6S2-03
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3c-00Cr0L-32
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BPCNvy3wA7VcBSBNBkiSC/ml4QQ+AaQh79+9DTBXvuE=; b=UkeOrsfQI7XrABwFl7N1U33234
	LREhQt9pGwsgwvlRMLFdzfRQq/oJCDhWU3omjAqZpyDnKyZRHZdyh+JE+uYAEJAUK0Xpx1ih5IjFd
	vtB4p/BXumfkT+akGgd3X235ZWbXZfC78MBK9Ahs79XCKE6UB7DaOzC6Fyec519VDTdU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] libacpi: Pass missing --dm_version to mk_dsdt
Message-Id: <E1wEn3c-00Cr0L-32@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:44:52 +0000

commit 8482a1ce08663467ca52434769a71a25b0ab8798
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:22:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:22:24 2026 +0200

    libacpi: Pass missing --dm_version to mk_dsdt
    
    Commit 19ab8356abe4 ("tools: remove support for running a guest with
    qemu-traditional") made passing --dm_version to mk_dsdt mandatory on
    x86 but didn't fix all the invocations of it.
    
    The previous default was qemu-xen-traditional so with that removed set
    the dm_version to qemu-xen for this invocation.
    
    Without this change, Xen fails to build on x86 when using
    --enable-rombios.
    
    Fixes: 19ab8356abe4 ("tools: remove support for running a guest with qemu-traditional")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ea12f9d257353ddec8a2fe8da42d11636de3dacb
    master date: 2026-03-27 18:56:42 +0000
---
 tools/libacpi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index b21a64c6b4..193ec78672 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -51,7 +51,7 @@ $(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl  $(MK_DSDT)
 	# Remove last bracket
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
 	cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
-	$(MK_DSDT) --debug=$(debug) --maxcpu $*  >> $@.$(TMP_SUFFIX)
+	$(MK_DSDT) --debug=$(debug) --maxcpu $* --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 
 $(ACPI_BUILD_DIR)/dsdt_pvh.asl: dsdt_acpi_info.asl $(MK_DSDT)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285704.1566836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn3o-0005UI-4r; Mon, 20 Apr 2026 11:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285704.1566836; Mon, 20 Apr 2026 11:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn3o-0005UA-2G; Mon, 20 Apr 2026 11:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1285704;
 Mon, 20 Apr 2026 11:45:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn3n-0005U3-4J
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:45:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3n-00B6SU-0L
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3n-00Cr1Q-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H3Dqe3ch9yNJ+aiRa14gNg/Q5gTpsdX0p1ztukbHePE=; b=WwSUE3tvCaedtU2Dj7TKV1+PvM
	IOyEkTJn6Pn/1Kq3+H4Q8WeSgQmWFktkg9majob38ViknfjTHo93SGLG5x2rmXYm1gyDMzqFQ7oy4
	XQhO6ljb4nM6vDB88VuxMw/+6K7vqA392TzKmsCSXGH4HeqBUpJMwlyRdCBLqwl7NeNQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
Message-Id: <E1wEn3n-00Cr1Q-0E@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:45:03 +0000

commit a011ca9e08393737e89557573f88453ea39bbed6
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:23:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:23:22 2026 +0200

    xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
    
    Auto-discovered serial PCI devices when using dev=amt|pci won't get
    ->ps_bdf_enable, and as such some of the logic (like making sure the
    respective BARs are enabled) won't be applied to them.
    
    Fix by unconditionally setting ->ps_bdf_enable for all PCI serial devices,
    and removing the special case that was done in some places by checking
    whether the ->bar was set.  This also allows simplifying the logic in
    pci_serial_early_init().
    
    Fixes: 9738db88f68f ("xen: Automatically find serial port on PCI/PCIe and AMT devices.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4bf33360623d9d59c8e7a49b70308c1b58d4d772
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index d384f1c69d..45ac089193 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -283,7 +283,10 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
-    if ( uart->bar && uart->io_base >= 0x10000 )
+    if ( !uart->ps_bdf_enable )
+        return;
+
+    if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
@@ -291,9 +294,6 @@ static void pci_serial_early_init(struct ns16550 *uart)
         return;
     }
 
-    if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
-        return;
-
     if ( uart->pb_bdf_enable )
         pci_conf_write16(PCI_SBDF(0, uart->pb_bdf[0], uart->pb_bdf[1],
                                   uart->pb_bdf[2]),
@@ -440,7 +440,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
         unsigned int, 1, (bits * uart->fifo_size * 1000) / uart->baud);
 
 #ifdef NS16550_PCI
-    if ( uart->bar || uart->ps_bdf_enable )
+    if ( uart->ps_bdf_enable )
     {
         if ( uart->param && uart->param->mmio &&
              rangeset_add_range(mmio_ro_ranges, PFN_DOWN(uart->io_base),
@@ -1338,6 +1338,7 @@ pci_uart_config(struct ns16550 *uart, bool skip_amt, unsigned int idx)
                 uart->ps_bdf[0] = b;
                 uart->ps_bdf[1] = d;
                 uart->ps_bdf[2] = f;
+                uart->ps_bdf_enable = true;
                 uart->bar_idx = bar_idx;
                 uart->bar = bar;
                 uart->bar64 = bar_64;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285705.1566841 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn3y-0005Wb-6q; Mon, 20 Apr 2026 11:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285705.1566841; Mon, 20 Apr 2026 11: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 1wEn3y-0005WT-3f; Mon, 20 Apr 2026 11:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1285705;
 Mon, 20 Apr 2026 11:45:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn3x-0005WM-74
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:45:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3x-00B6Sq-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn3x-00Cr1x-0W
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bTkJfa8dsVS0jqo397Ro30o9f/sYC5Xiurk7tqIcq1s=; b=OuntXRNrdMPb17HYMhQoaib0Qq
	S1J4/8H85Db2zGJkSbsJdpD6VHSUNOeAuK48jfiCwzyQC6Z3OlzacOEzM1HayYXxG1SwXB/d4MQVj
	YUGm+SkWB4Pt2CeWWfjPVzlbkpKozJtg1Kz9+yHFBX5FEk2Bs77I+4VwXQnRexoT+aeY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/uart: be more careful with changes to the PCI command register
Message-Id: <E1wEn3x-00Cr1x-0W@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:45:13 +0000

commit 761aba980ab70b9abe408b5834f02367eff0e64d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:23:51 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:23:51 2026 +0200

    xen/uart: be more careful with changes to the PCI command register
    
    Read the existing PCI command register and only add the required bits to
    it, as to avoid clearing bits that might be possibly set by the firmware
    already, which might put the device into a non-working state.
    
    Xen being the owner of the PCI device it's legitimately allowed to change
    command registers bits.  Be careful however in case buggy devices require
    certain command register bits to be enabled, while not strictly required
    from Xen's usage.
    
    Fixes: f2ff5d6628b3 ("ns16550: enable PCI serial card usage")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ebf543972560e45b838def3a54859331cc92c970
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 45ac089193..293fc74d63 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -283,14 +283,19 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
+    uint16_t cmd;
+
     if ( !uart->ps_bdf_enable )
         return;
 
+    cmd = pci_conf_read16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
+                                  uart->ps_bdf[2]), PCI_COMMAND);
+
     if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
-                         PCI_COMMAND, PCI_COMMAND_MEMORY);
+                         PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
         return;
     }
 
@@ -307,7 +312,7 @@ static void pci_serial_early_init(struct ns16550 *uart)
                      uart->io_base | PCI_BASE_ADDRESS_SPACE_IO);
     pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                               uart->ps_bdf[2]),
-                     PCI_COMMAND, PCI_COMMAND_IO);
+                     PCI_COMMAND, cmd | PCI_COMMAND_IO);
 #endif
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285706.1566844 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn48-0005Ye-7n; Mon, 20 Apr 2026 11:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285706.1566844; Mon, 20 Apr 2026 11:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn48-0005YW-4y; Mon, 20 Apr 2026 11:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1285706;
 Mon, 20 Apr 2026 11:45:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn47-0005YO-AF
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:45:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn47-00B6Ut-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn47-00Cr4N-0n
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tldCDQG1ABVoT9ATzMS9aNpq+kQYBlmb2Dtizf7PZTM=; b=7K8ZaZK5VgvELrg09T1Eh7yUuH
	+u4ziX3Qdl6iN6wk0Lf7ol/gVi33BR4o4uzktOhAeQiqNmJkzIXhVTLqU/XohTPgrYlaLEVingdey
	EHwizmFHhgf85HiGLuP5GqHlqJUcyPlKcOCuhom/YS7cTHMr1ZK5K752QKkO3PRDXC7k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/fpu: Initialise FTW in xstate_alloc_save_area()
Message-Id: <E1wEn47-00Cr4N-0n@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:45:23 +0000

commit e2981e073fa9a8f073e3c1c767685ba69c3d813c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 20 12:25:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:25:10 2026 +0200

    x86/fpu: Initialise FTW in xstate_alloc_save_area()
    
    Right now, xstate_alloc_save_area() leaves both XSTATE_BV and FTW clear.  This
    causes a difference in behaviour between FXRSTOR and XRSTOR.
    
    Switch to using using XSTATE's idea of initial configuration which will behave
    the same even on pre-XSAVE hardware.  Expand the comment to explain why.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 639de2aafa437fd50abc16a46c8a8dd0d0e9e6a7
    master date: 2026-03-30 15:48:13 +0100
---
 xen/arch/x86/xstate.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index e990abc9d1..defe9b3f0c 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -550,11 +550,22 @@ int xstate_alloc_save_area(struct vcpu *v)
         return -ENOMEM;
 
     /*
-     * Set the memory image to default values, but don't force the context
-     * to be loaded from memory (i.e. keep save_area->xsave_hdr.xstate_bv
-     * clear).
+     * We're creating a vCPU, so conceptually we should be choosing the
+     * architectural #RESET values.
+     *
+     * However for historical reasons of configuring the external
+     * co-processor, FCW's #RESET state is different to what F(N)INIT and
+     * XSTATE consider the "initial configuration".
+     *
+     * Guests won't care about the difference; all software tends to executes
+     * FNINIT very early during setup.
+     *
+     * Use XSTATE's idea of initial configuration.  This allows XSTATE_BV to
+     * remain clear and for CPUs to use the INIT optimisation where
+     * applicable.
      */
     save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.ftw = FXSAVE_FTW_RESET;
     save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
 
     v->arch.xsave_area = save_area;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:45:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:45:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285707.1566848 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4J-0005ag-9F; Mon, 20 Apr 2026 11:45:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285707.1566848; Mon, 20 Apr 2026 11:45:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4J-0005aY-6M; Mon, 20 Apr 2026 11:45:35 +0000
Received: by outflank-mailman (input) for mailman id 1285707;
 Mon, 20 Apr 2026 11:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn4H-0005aS-Du
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:45:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4H-00B6Ux-1I
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4H-00Cr64-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TecdHNkl29RB8Eeos4E98FJlhnY1k1njCQ2tnlOuP4I=; b=1VuPB1yHylx9jI2D0VL74utE90
	+TSxl5WXxFs8plXmjz4/R3lQ57BlPw8xe+K02o6cNI0nx3+N0269b1B8JUsjzwjAjo/7JaBpO9ljc
	SSUIgge4xlKrIzL8KKDW2y/9RrAQvfUdcIcQv109jAi+Z9MhBNGD+29vuD6nk85Ydu1I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] EFI: avoid OOB config file reads
Message-Id: <E1wEn4H-00Cr64-1A@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:45:33 +0000

commit feb99494bf594c953214aa65aab23b99c1fa794f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:25:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:25:29 2026 +0200

    EFI: avoid OOB config file reads
    
    The message emitted by pre_parse() pretty clearly states the original
    intention. Yet what it said wasn't done, and would have been unfriendly to
    the user. Hence accesses past the allocated buffer were possible. Insert a
    terminating NUL immediately past the data read, to then drop the no longer
    applicable message.
    
    NB: The iscntrl() check of just the last byte is more strict than what
    pre_parse() would accept without issuing its prior message, yet I'd like
    to keep the new logic reasonably simple. Config files shouldn't be huge,
    and we shouldn't be _that_ short of memory (or we'd fail elsewhere pretty
    soon).
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: df75f77092c1cc47f3ed5be86cf6c04e732f3f80
    master date: 2026-04-07 08:59:15 +0200
---
 xen/common/efi/boot.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 2047d58e39..2181cf0b0c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -833,8 +833,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     what = L"Allocation";
     file->addr = min(1UL << (32 + PAGE_SHIFT),
                      HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
+    /* For config files allocate an extra byte to put a NUL there. */
     ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
-                                PFN_UP(size), &file->addr);
+                                PFN_UP(size + (file == &cfg)), &file->addr);
     if ( EFI_ERROR(ret) )
         goto fail;
 
@@ -853,6 +854,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
 
     efi_arch_flush_dcache_area(file->ptr, file->size);
 
+    if ( file == &cfg )
+        file->str[file->size] = 0;
+
     return true;
 
  fail:
@@ -878,6 +882,23 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
 
     file->ptr = ptr;
 
+    /* For cfg file, if necessary allocate space to put an extra NUL there. */
+    if ( file == &cfg && file->size && !iscntrl(file->str[file->size - 1]) )
+    {
+        EFI_PHYSICAL_ADDRESS addr;
+        EFI_STATUS ret = efi_bs->AllocatePages(AllocateMaxAddress,
+                                               EfiLoaderData,
+                                               PFN_UP(file->size + 1), &addr);
+
+        if ( EFI_ERROR(ret) )
+            return false;
+
+        memcpy((void *)addr, ptr, file->size);
+        file->addr = addr;
+        file->need_to_free = true;
+        file->str[file->size] = 0;
+    }
+
     handle_file_info(name, file, options);
 
     return true;
@@ -906,9 +927,6 @@ static void __init pre_parse(const struct file *file)
         else
             start = 0;
     }
-    if ( file->size && end[-1] )
-         PrintStr(L"No newline at end of config file,"
-                   " last line will be ignored.\r\n");
 }
 
 static void __init init_secure_boot_mode(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:45:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:45:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285708.1566852 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4T-0005ci-AE; Mon, 20 Apr 2026 11:45:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285708.1566852; Mon, 20 Apr 2026 11:45:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4T-0005ca-7g; Mon, 20 Apr 2026 11:45:45 +0000
Received: by outflank-mailman (input) for mailman id 1285708;
 Mon, 20 Apr 2026 11:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn4R-0005cT-HD
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4R-00B6V3-1d
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4R-00Cr80-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=49zoB4LUOVRbqRwnPgL7AgLYj8PF0S6E7vg2tu6ThHo=; b=zyyjyuQgkjHL+le9xc+W734AWB
	xwXHWDul2Oc5vx+LZVwmsvK5RL3DzmZTX4NMSIR9xjUc0d/Mp+UtdTj90wNCZZDCLUp1duO/OlyRy
	ICcv26sjxvdZxAlJRx7zIPkoLhutELR/OitPwjK1jgnKq3Z1IUSCTVI4qLlBPKcAFdBQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] llc-coloring: improve checking while parsing
Message-Id: <E1wEn4R-00Cr80-1T@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:45:43 +0000

commit c9ba169b934d1e4cd733cfb23b48bace040cd097
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:25:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:25:55 2026 +0200

    llc-coloring: improve checking while parsing
    
    We can easily avoid the risk of wrapping UINT_MAX <-> 0 by applying a
    check against the compile-time-constant maximum number of colors.
    
    Additionally the overflow checks suffered from an off-by-1, as the parsed
    ranges are inclusive (e.g. end == start being possible, requiring 1 array
    slot, while availability of 0 slots was checked in that case).
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    xen/common: llc-coloring: Fix off-by-one in parse_color_config()
    
    The check uses (*num_colors + (end - start + 1)) >= max_num_colors, which
    rejects a configuration where exactly max_num_colors colors are specified.
    For example, if max_num_colors is 4 and *num_colors is 0, a range "0-3"
    gives (end - start + 1) = 4, and (0 + 4) >= 4 is true, incorrectly
    returning -EINVAL.
    
    Fix this by switching the overflow condition to the state before commit
    cba8a584de17 that regressed the behavior (i.e. don't add 1).
    
    Fixes: cba8a584de17 ("llc-coloring: improve checking while parsing")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    master commit: cba8a584de171c8c4510709c2edc9f1cf86b21ab
    master date: 2026-04-07 13:52:44 +0200
    master commit: dc28f531e6a29a6fdd58f24073dfb48af06b8334
    master date: 2026-04-10 12:14:05 +0200
---
 xen/common/llc-coloring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 77a54beed1..bc79730656 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -76,7 +76,8 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         else                /* Single value */
             end = start;
 
-        if ( start > end || (end - start) > (UINT_MAX - *num_colors) ||
+        if ( end >= NR_LLC_COLORS || start > end ||
+             (end - start) >= (UINT_MAX - *num_colors) ||
              (*num_colors + (end - start)) >= max_num_colors )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:45:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:45:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285709.1566857 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4d-0005el-Ce; Mon, 20 Apr 2026 11:45:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285709.1566857; Mon, 20 Apr 2026 11:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4d-0005ec-91; Mon, 20 Apr 2026 11:45:55 +0000
Received: by outflank-mailman (input) for mailman id 1285709;
 Mon, 20 Apr 2026 11:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn4b-0005eV-Kd
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4b-00B6VB-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4b-00CrA1-1o
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:45:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bjxM4tGCYLjUfKbvA2WCLNLcJoIhtB/B3PkDncNLpLA=; b=ezNBXWCOr4pD/x0v+MaXE1mid3
	5llkZNRq7D4WMmQEDFLPMoS12fP8HpT3nUq/DgTcr0Q6FDsqjTKadqdjnVbliX0lyqjYfYtxZQ0ps
	otdyZGf9FecUk/puvO0xcY13gUf0UtGJ49ZqJvZFsFMR9O59Wkui0wh95DnBurVE3Lrw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] ns16550: harden name/value pair parsing
Message-Id: <E1wEn4b-00CrA1-1o@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:45:53 +0000

commit f35f0ac0c8bcdc695b6dda9c585f1de61bdd0d80
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:26:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:26:09 2026 +0200

    ns16550: harden name/value pair parsing
    
    strsep(), unless passed a 1st argument which itself points at a NULL
    pointer, won't return NULL. Instead if the separator(s) looked for isn't
    found, that pointed-to field would be updated to hold NULL. Hence the
    important check in get_token() is for token to be non-NULL after the call
    (which get_token()'s callers rely upon), while the checking of param_name
    is left there just in case.
    
    Fixes: 97fd49a7e074 ("ns16550: add support for UART parameters to be specifed with name-value pairs")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b27d3b45c75cf378f06ed72758c034a5d0f8d560
    master date: 2026-04-07 13:53:49 +0200
---
 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 293fc74d63..96e837afe8 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1472,7 +1472,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
     unsigned int i;
 
     param_name = strsep(&token, "=");
-    if ( param_name == NULL )
+    if ( !param_name || !token )
         return num_serial_params;
 
     /* Linear search for the parameter. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:46:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:46:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285710.1566860 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4n-0005hG-Ei; Mon, 20 Apr 2026 11:46:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285710.1566860; Mon, 20 Apr 2026 11:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4n-0005h9-CB; Mon, 20 Apr 2026 11:46:05 +0000
Received: by outflank-mailman (input) for mailman id 1285710;
 Mon, 20 Apr 2026 11:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn4l-0005h2-NL
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4l-00B6VS-2F
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4l-00CrBA-29
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=As/uj/Fd/WuoP6TKaSKHZMiRzC8BDFXkhLCSsFiFD4I=; b=zxV6UTRFBezZkX2NQoC16xP00b
	sRvDkLh4hLq+egEMWA7O1X2QDkrqaNMJYLZzwFC9FvmTu2uRg/3xDlN5fQIv3q0JKMvlNZKVdIzH1
	4/HTV6OQmOn6Ekoh9R1In3qJKDLkKq85BvCSPvX8snf+7jjxfUF0pfYTdDiQ2WwytAlg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] ns16550: harden positional parsing
Message-Id: <E1wEn4l-00CrBA-29@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:46:03 +0000

commit afb919ff6ae38f797c162bf1c5d7b3d5abbd5e32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:26:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:26:25 2026 +0200

    ns16550: harden positional parsing
    
    Advancing past a character without knowing whether that's the NUL char is
    at risk of reading beyond the buffer.
    
    Fixes: 25de1f692059 ("Allow arch-specific defaults to be specified for ns16550")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 2c43b5611ffbe35611dd391c949f7cb15e1b29e7
    master date: 2026-04-07 13:54:19 +0200
---
 xen/drivers/char/ns16550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 96e837afe8..1f95618cf6 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1547,6 +1547,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
     {
         uart->data_bits = simple_strtoul(conf, &conf, 10);
 
+        if ( !*conf )
+            PARSE_ERR_RET("bad DPS setting");
+
         uart->parity = parse_parity_char(*conf);
 
         uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:46:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:46:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285711.1566864 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4x-0005jc-GN; Mon, 20 Apr 2026 11:46:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285711.1566864; Mon, 20 Apr 2026 11:46:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn4x-0005jU-De; Mon, 20 Apr 2026 11:46:15 +0000
Received: by outflank-mailman (input) for mailman id 1285711;
 Mon, 20 Apr 2026 11:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn4v-0005jN-Px
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4v-00B6Vs-2V
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn4v-00CrCJ-2P
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zOejkXYDFryJADkym2+sE0cuuT234Wsv6gkl95xIVkU=; b=Bpv4zgaSYJrdbDOcmN3neJYPoD
	uwLRLt6OwMvu4vpfP1GHna6tDJp8USqkqjnIXvyLXJCkA+Q+pdzurkj1wDlZUnhQgQDsoJJlLqWVX
	MB5IkvNCT1qc4DfjHYGZxY8gLTNIanb460A0bqoMppuo+6+UTHPAO2z5M6UdWqEmdDYw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] video/vesa: harden font height parsing
Message-Id: <E1wEn4v-00CrCJ-2P@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:46:13 +0000

commit 8f3dcdcf9f2522bd438b8f02ace6c64c8761a28d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:26:39 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:26:39 2026 +0200

    video/vesa: harden font height parsing
    
    We should not prematurely increment the pointer, to avoid inadvertently
    skipping a NUL terminator.
    
    Fixes: 6d9199bd0f22 ("x86-64: enable hypervisor output on VESA frame buffer")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3bcce461a33a8c0c0721543638ce375178d90006
    master date: 2026-04-07 13:54:37 +0200
---
 xen/drivers/video/vesa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 70feca21ac..f6c6afd40c 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -31,8 +31,8 @@ static unsigned int __initdata vram_remap;
 static unsigned int __initdata font_height;
 static int __init cf_check parse_font_height(const char *s)
 {
-    if ( simple_strtoul(s, &s, 10) == 8 && (*s++ == 'x') )
-        font_height = simple_strtoul(s, &s, 10);
+    if ( simple_strtoul(s, &s, 10) == 8 && (*s == 'x') )
+        font_height = simple_strtoul(s + 1, &s, 10);
     if ( *s != '\0' )
         font_height = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:46:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:46:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285712.1566867 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn57-0005lc-HQ; Mon, 20 Apr 2026 11:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285712.1566867; Mon, 20 Apr 2026 11:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn57-0005lU-Ex; Mon, 20 Apr 2026 11:46:25 +0000
Received: by outflank-mailman (input) for mailman id 1285712;
 Mon, 20 Apr 2026 11:46:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn55-0005lN-SW
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn55-00B6Vx-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn55-00CrCz-2h
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oROufJBdX16u7ZYUVRZJlMdL0ht2aL9uKDb+j25xIFo=; b=q/YeKOGEcGbnA3YxbTQgeQIvQ8
	vOMZZbBfteOB+8UwBPxTtZObrndDUUljRIF69HP8nW26gEYJZ8JKhIyyhyVS5+HwzeLD+ShfJluOt
	0pLkjE4E6qNBO1rna1g4NpQAr/ORvH0XSwLI1+VXRnd6KJA08B+06NuaiAgdRAf7A474=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/x86: Check supported features even for PVH dom0
Message-Id: <E1wEn55-00CrCz-2h@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:46:23 +0000

commit b2352be9415987e1d20281d8a9a8577600b417a4
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Mon Apr 20 12:27:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:27:00 2026 +0200

    xen/x86: Check supported features even for PVH dom0
    
    The supported features ELF notes was tested only if the dom0 was
    PV. Factor out a function to check ELF notes and reuse it even
    for PVH.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 44429b69319975f25d3762629b40fecdd4e3e554
    master date: 2026-04-09 21:04:58 +0100
---
 xen/arch/x86/dom0_build.c             | 12 ++++++++++++
 xen/arch/x86/hvm/dom0_build.c         |  3 +++
 xen/arch/x86/include/asm/dom0_build.h |  2 ++
 xen/arch/x86/pv/dom0_build.c          | 10 ++--------
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 0b467fd4a4..a32ad2739f 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -320,6 +320,18 @@ unsigned long __init dom0_paging_pages(const struct domain *d,
     return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
 }
 
+int __init initdom_check_parms(
+    const struct domain *d, const struct elf_dom_parms *parms)
+{
+    if ( parms->elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE &&
+         is_hardware_domain(d) && !test_bit(XENFEAT_dom0, parms->f_supported) )
+    {
+        printk("Kernel does not support Dom0 operation\n");
+        return -EINVAL;
+    }
+
+    return 0;
+}
 
 /*
  * If allocation isn't specified, reserve 1/16th of available memory for
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 6849e8c010..66199678e8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -692,6 +692,9 @@ static int __init pvh_load_kernel(
         return -EINVAL;
     }
 
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
+
     /* Copy the OS image and free temporary buffer. */
     elf.dest_base = (void *)(parms.virt_kstart - parms.virt_base);
     elf.dest_size = parms.virt_kend - parms.virt_kstart;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index ff021c24af..1332f18cc6 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -8,6 +8,8 @@
 
 extern unsigned int dom0_memflags;
 
+int initdom_check_parms(const struct domain *d,
+                        const struct elf_dom_parms *parms);
 unsigned long dom0_compute_nr_pages(struct domain *d,
                                     struct elf_dom_parms *parms,
                                     unsigned long initrd_len);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index f9bbbea2ff..37729091df 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -494,14 +494,8 @@ static int __init dom0_construct(const struct boot_domain *bd)
         return -EINVAL;
     }
 
-    if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE )
-    {
-        if ( !pv_shim && !test_bit(XENFEAT_dom0, parms.f_supported) )
-        {
-            printk("Kernel does not support Dom0 operation\n");
-            return -EINVAL;
-        }
-    }
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
 
     nr_pages = dom0_compute_nr_pages(d, &parms, initrd_len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:46:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285713.1566871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5H-0005nc-In; Mon, 20 Apr 2026 11:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285713.1566871; Mon, 20 Apr 2026 11:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5H-0005nU-GF; Mon, 20 Apr 2026 11:46:35 +0000
Received: by outflank-mailman (input) for mailman id 1285713;
 Mon, 20 Apr 2026 11:46:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn5F-0005nN-VE
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:46:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5F-00B6W3-32
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5F-00CrDL-2w
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VFAOWNRAKYlzt7djy9V4mjc6rKIBcBtiimJP5ynV08k=; b=pqKHBvhN5uz/iOfQXhD3E1zB56
	UbgmfdIf5hAcRc5Isfi3SpmOMf2t8qT7hRMVyYFcP4s7XA1/kvXeXl0MbCzi8dPDFMrxjx6WcPI7W
	xWih6vrCj9paUl3BBLZ/YqepyQOpdNyxwQmPiqCaOZsqy39I4aygqlZvY5yzhInY6cJU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/uart: set a default baudrate if non specified neither found
Message-Id: <E1wEn5F-00CrDL-2w@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:46:33 +0000

commit 6b8be120c8dd4f4c08718d6887625146077cd837
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:27:26 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:27:26 2026 +0200

    xen/uart: set a default baudrate if non specified neither found
    
    If the user has set baudrate as "auto" (use whatever was configured) but
    Xen cannot find any set baudrate use a default fallback baudrate of
    115200.
    
    Otherwise the console will very likely end up being non-functional, as
    further values are derived from the baudrate (like the transmit timeout),
    and using -1 will result in screwed parameters being derived from the
    baudrate.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    master commit: 12e50da43d926cc5401c6ec1146cdcedaba23243
    master date: 2026-04-10 14:30:50 +0200
---
 xen/drivers/char/ns16550.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 1f95618cf6..df554001bc 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -355,9 +355,16 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         if ( divisor )
             uart->baud = uart->clock_hz / (divisor << 4);
         else
+        {
+            uart->baud = 115200;
             printk(XENLOG_ERR
                    "Automatic baud rate determination was requested,"
-                   " but a baud rate was not set up\n");
+                   " but a baud rate was not set up\n"
+                   "Setting baudrate to %u\n", uart->baud);
+            divisor = uart->clock_hz / (uart->baud << 4);
+            ns_write_reg(uart, UART_DLL, (uint8_t)divisor);
+            ns_write_reg(uart, UART_DLM, (uint8_t)(divisor >> 8));
+        }
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:46:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285714.1566876 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5R-0005pf-K6; Mon, 20 Apr 2026 11:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285714.1566876; Mon, 20 Apr 2026 11:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5R-0005pX-Ha; Mon, 20 Apr 2026 11:46:45 +0000
Received: by outflank-mailman (input) for mailman id 1285714;
 Mon, 20 Apr 2026 11:46:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn5Q-0005pP-1b
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:46:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5Q-00B6W9-05
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5P-00CrDs-3D
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=erzY+NvOJkyFNOR4yzW/ZQgn9WurH6mQ5D/UBmDBwQI=; b=Z8m4wsEy7e01HGg6/ccJS0yLdW
	Z79jNjKy02bN/d5XPeOHeiOfX3YkshRBCKqSxPO0tiI2PaSMdKvWbbHSoXfuD2VrY+5Rb6rLkIo1h
	fwPo+thEJhoPFPyocYqiyYHA5PfRcJFqFD6P7LrQyy1QM1J7HhUq98SnG3MGYpUAU1lc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/time: do not kill calibration timer on suspend
Message-Id: <E1wEn5P-00CrDs-3D@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:46:43 +0000

commit 9c79644d359b24eadb2af1d40c5b2fa49e2bfc5a
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:27:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:27:45 2026 +0200

    x86/time: do not kill calibration timer on suspend
    
    A killed timer will ignore further set_timer() calls, and hence won't be
    re-armed unless it's initialized again.  Use stop_timer() instead of
    kill_timer() in time_suspend(), so that the set_timer() call in
    time_resume() successfully re-arms the timer.  Otherwise time calibration
    is no longer scheduled (and executed) after resuming from S3 suspend.
    
    Fixes: 6d90db1a2ca1 ("x86: rendezvous-based local time calibration")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: 2d670d258b2e592d44deb5ee12e7c2ba1d79d8a9
    master date: 2026-04-10 14:31:10 +0200
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 3b451525a9..bb36038e0c 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2720,7 +2720,7 @@ int time_suspend(void)
     {
         cmos_utc_offset = -get_wallclock_time();
         cmos_utc_offset += get_sec();
-        kill_timer(&calibration_timer);
+        stop_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
         platform_time_calibration();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:46:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285715.1566881 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5b-0005rj-M2; Mon, 20 Apr 2026 11:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285715.1566881; Mon, 20 Apr 2026 11:46:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5b-0005ra-Ir; Mon, 20 Apr 2026 11:46:55 +0000
Received: by outflank-mailman (input) for mailman id 1285715;
 Mon, 20 Apr 2026 11:46:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn5a-0005rU-4T
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:46:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5a-00B6WD-0M
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5a-00CrEb-0G
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:46:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=b1in57eA37bzWeJ3DHJWNDAPvAXaQL0qPFY6XbT9SpY=; b=cH9RdZrtZJde80QVsFCPbJZnNt
	G1wRKlFyxI2k8rEd9BaoqhWjZwM2uLnLVT/CBmeL9C7aq7uGP2Etwvr0c0HUMs/oTBLtgD3SB7jp6
	pxy7K4I7O/tqeIx5rcga+UtbLsaEoU85p6QmsENMBvq2AvICPkpuhkhzZXgbP0SIwet0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/APIC: handle overflow in TMICT calculation
Message-Id: <E1wEn5a-00CrEb-0G@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:46:54 +0000

commit 76b359a8784c15455da5374ece9f7b09358d5ccf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:28:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:28:16 2026 +0200

    x86/APIC: handle overflow in TMICT calculation
    
    With an expiry value on the order of 10 hours, and with a bus scale value
    of 256k (as supplied by qemu), the (signed) multiplication will be UB. As
    we've checked that the value is positive, we mean unsigned multiplication
    anyway. Yet let's play safe against even larger expiry and bus scale
    values, leveraging the compiler builtin that there is for this purpose.
    
    While there also drop the stray cast from the actual TMICT write.
    
    Fixes: 9062553a0dc1 ("added time and accurate timer support")
    Fixes: b95beb185810 ("x86: Clean up APIC local timer handling")
    Reported-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 4f14d97a620c3a005ad0604ae47ee6091281cda0
    master date: 2026-04-16 10:29:54 +0200
---
 xen/arch/x86/apic.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7747718600..a3e5ecdfbc 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1224,10 +1224,16 @@ int reprogram_timer(s_time_t timeout)
     }
 
     if ( timeout && ((expire = timeout - NOW()) > 0) )
-        apic_tmict = min_t(uint64_t, (bus_scale * expire) >> BUS_SCALE_SHIFT,
-                           UINT32_MAX);
+    {
+        unsigned long product;
+
+        apic_tmict = UINT32_MAX;
+        if ( !__builtin_umull_overflow(bus_scale, expire, &product) &&
+             (product >>= BUS_SCALE_SHIFT) < apic_tmict )
+            apic_tmict = product;
+    }
 
-    apic_write(APIC_TMICT, (unsigned long)apic_tmict);
+    apic_write(APIC_TMICT, apic_tmict);
 
     return apic_tmict || !timeout;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:47:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:47:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285716.1566884 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5l-0005tl-Mv; Mon, 20 Apr 2026 11:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285716.1566884; Mon, 20 Apr 2026 11:47:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5l-0005te-KD; Mon, 20 Apr 2026 11:47:05 +0000
Received: by outflank-mailman (input) for mailman id 1285716;
 Mon, 20 Apr 2026 11:47:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn5k-0005tX-73
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:47:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5k-00B6WU-0d
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5k-00CrFG-0X
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MgZIOcRJEPSc9B64hoD239dmjCzgQyBrwTjV91ASmx8=; b=3eDljWou6Ox8qwkewnUxGvxF/M
	vSwd4HHVLvgeRR+kZzFJX1DPYGg36/sgI7BTQCmGviIStuzh75biVm7EJS9M3QHomH+FbvkMvgI0l
	7gHQeAo7Naed9fYuBT7OjdrceQXsLzYih8e4Xep2x/oD6gYZUtE2LWWDQQudl8HIEuyc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/HPET: channel handling in hpet_broadcast_resume()
Message-Id: <E1wEn5k-00CrFG-0X@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:47:04 +0000

commit 2d1a11a50dcfede32e3ad4a577371df73312385d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:28:35 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:28:35 2026 +0200

    x86/HPET: channel handling in hpet_broadcast_resume()
    
    The per-channel ENABLE bit is to solely be driven by hpet_enable_channel()
    and hpet_msi_{,un}mask(). It doesn't need setting immediately. Except for
    the (possible) channel put in legacy mode we don't do so during boot
    either.
    
    Instead reset ->arch.cpu_mask, to avoid msi_compose_msg() yielding an
    all-zero message (when the passed in CPU mask has no online CPUs). Nothing
    would later call msi_compose_msg() / hpet_msi_write(), and hence nothing
    would later produce a well-formed message template in
    hpet_events[].msi.msg.
    
    Fixes: 15aa6c67486c ("amd iommu: use base platform MSI implementation")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c4d51191954c53590767c26e501e6dadf923bc47
    master date: 2026-04-16 10:44:16 +0200
---
 xen/arch/x86/hpet.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index a69abe2650..918fab774d 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -705,12 +705,18 @@ void hpet_broadcast_resume(void)
     for ( i = 0; i < n; i++ )
     {
         if ( hpet_events[i].msi.irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
+        {
+            struct irq_desc *desc = irq_to_desc(hpet_events[i].msi.irq);
+
+            cpumask_copy(desc->arch.cpu_mask, cpumask_of(smp_processor_id()));
+
+            __hpet_setup_msi_irq(desc);
+        }
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
+        cfg |= HPET_TN_32BIT;
         if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
             cfg |= HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:47:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:47:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285717.1566887 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5v-0005wm-Oc; Mon, 20 Apr 2026 11:47:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285717.1566887; Mon, 20 Apr 2026 11:47:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn5v-0005wf-Li; Mon, 20 Apr 2026 11:47:15 +0000
Received: by outflank-mailman (input) for mailman id 1285717;
 Mon, 20 Apr 2026 11:47:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn5u-0005vo-A1
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:47:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5u-00B6Wr-0u
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn5u-00CrFu-0o
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KzdOfyVAEGYtV9DE1CxLOtGijVzbwxMzV7la1uy892k=; b=22leD2xJ1O8Y1RtWCTt2AzjwSI
	MtBR2RmklboHGQYQa/aTP6OH9aCLX/dCDyEvU+E1kXx4anYGmal02ndq1pcUeRTeqKWmiNNoTTnfi
	WHf4gCTagWa4hI3/7RH/nbJvc4RxsgYS2qep0pA5n0C7WicNnFxAdVZUSygj2UJJlVyw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/time: use native TSC scaling factors when TSC is not scaled
Message-Id: <E1wEn5u-00CrFu-0o@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:47:14 +0000

commit 27748a734393c1c6ec44aacacc6736749fbe72bf
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:28:50 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:28:50 2026 +0200

    x86/time: use native TSC scaling factors when TSC is not scaled
    
    When running HVM guest in native TSC mode avoid using the recalculated vTSC
    scaling factors based on the cpu_khz value.  Using the kHz based frequency
    leads to the TSC scaling values possibly not being the same as the ones
    used by the per CPU cpu_time->tsc_scale field, which introduces skew
    between the guest and Xen's calculations of the system time.
    
    On a 2gHz system, where the frequency is possibly detected as 1999999999Hz
    (note this is a worse-case scenario), the cpu_khz variable will be set to
    1999999kHz, and hence 999Hz cycles will be not accounted for per second.
    Over a second (the time synchronization period), this leads to a skew of:
    
    cycles * 1 / (Hz freq) = 999 / 1999999999 = 499,5ns
    
    So far this has gone unnoticed because the time synchronization rendezvous
    forces the update of the tsc_timestamp and system_time fields in the vCPU
    time info area, and hence the skew only accumulates up to the rendezvous
    period.  Attempting to remove the rendezvous causes the skew to grow
    unbounded.
    
    Fix by using the native TSC scaling values (as used by Xen) when the guest
    TSC is not scaled.
    
    Fixes: eab8a90be723 ("x86/time: scale host TSC in pvclock properly")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 305c6b901a44aa6e16d3bf7d104d7c08331d1731
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/x86/time.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bb36038e0c..d9f7772ab4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1702,17 +1702,25 @@ static void collect_time_info(const struct vcpu *v,
     else
     {
         if ( is_hvm_domain(d) && hvm_tsc_scaling_supported )
-        {
             tsc_stamp            = hvm_scale_tsc(d, t->stamp.local_tsc);
-            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
-            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
-        }
         else
-        {
             tsc_stamp            = t->stamp.local_tsc;
+
+        /*
+         * HVM guests using the native TSC ratio should use the same per-CPU
+         * scaling factors as Xen.  This ensures time keeping is always in sync
+         * between Xen and the guest.
+         */
+        if ( tsc_stamp == t->stamp.local_tsc )
+        {
             u->tsc_to_system_mul = t->tsc_scale.mul_frac;
             u->tsc_shift         = t->tsc_scale.shift;
         }
+        else
+        {
+            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
     }
 
     u->tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:47:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:47:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285718.1566893 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn65-00060E-SB; Mon, 20 Apr 2026 11:47:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285718.1566893; Mon, 20 Apr 2026 11:47:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn65-000604-PG; Mon, 20 Apr 2026 11:47:25 +0000
Received: by outflank-mailman (input) for mailman id 1285718;
 Mon, 20 Apr 2026 11:47:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn64-0005zt-Cj
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:47:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn64-00B6X0-1B
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn64-00CrGG-16
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Fm8bmql9WhjxczkTwRySH4y1PJQQv1v1PFlr6GUs0ek=; b=I8XG1m/BntptG1733a0CCa28+Q
	JaD12pIylWY/liqHVVRin5ArapaKum1AFA6tkeeF3IwwWAdYew078Mpsx8S/FufbAgGEEnVTJZpu/
	dOikYlpl2Dsg10vaOzq2vo9X85unyWnqnrDFREEN+k5XoeV5DV7KSsCr5lt67vYDFc8o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/cpu: round cpu_khz calculations
Message-Id: <E1wEn64-00CrGG-16@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:47:24 +0000

commit 54db249531ac2bf2ea37d8b9d4fcf2ba06d2bc75
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:29:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:29:10 2026 +0200

    xen/cpu: round cpu_khz calculations
    
    All arches truncate the cpu_khz without taking into account the less
    significant digits.  Instead use DIV_ROUND() when scaling from Hz to kHz
    to get as more accurate kHz value.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 986707b461eb56d75f55581dd1c8e2633f814795
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/arm/time.c   | 4 ++--
 xen/arch/riscv/time.c | 2 +-
 xen/arch/x86/time.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index e74d30d258..61536081eb 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -128,7 +128,7 @@ static void __init preinit_dt_xen_time(void)
     res = dt_property_read_u32(timer, "clock-frequency", &rate);
     if ( res )
     {
-        cpu_khz = rate / 1000;
+        cpu_khz = DIV_ROUND(rate, 1000);
         validate_timer_frequency();
         timer_dt_clock_frequency = rate;
     }
@@ -146,7 +146,7 @@ void __init preinit_xen_time(void)
 
     if ( !cpu_khz )
     {
-        cpu_khz = (READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK) / 1000;
+        cpu_khz = DIV_ROUND(READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK, 1000);
         validate_timer_frequency();
     }
 
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index e962f8518d..4391488a73 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -36,7 +36,7 @@ static void __init preinit_dt_xen_time(void)
     if ( !dt_property_read_u32(timer, "timebase-frequency", &rate) )
         panic("Unable to find clock frequency\n");
 
-    cpu_khz = rate / 1000;
+    cpu_khz = DIV_ROUND(rate, 1000);
 }
 
 void __init preinit_xen_time(void)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index d9f7772ab4..0bae4ff339 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2634,7 +2634,7 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
-    cpu_khz = tmp / 1000;
+    cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 11:47:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 11:47:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285719.1566896 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEn6E-00063P-TX; Mon, 20 Apr 2026 11:47:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285719.1566896; Mon, 20 Apr 2026 11:47: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 1wEn6E-00063H-QZ; Mon, 20 Apr 2026 11:47:34 +0000
Received: by outflank-mailman (input) for mailman id 1285719;
 Mon, 20 Apr 2026 11:47:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEn6E-00063A-FB
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 11:47:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn6E-00B6X6-1R
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEn6E-00CrGn-1M
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 11:47:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iCzIU7qNm7uf605I55DUgoZ1QMvodN7yC5pkIhuMK7E=; b=NEfv5uV4kTOD4UsD6q3rMcLr0b
	A4EEZsatgNkh49zzLkvCLsHJabB1haYDeieIve/R37EavdUfPNPaZG2klOd2Akn1A4oQUxq+GyXA8
	F4xnVUh0S4Oz8SBKqnpycE26h7Nq90wig2y6oF838Jo6qzMNPcFOwkFPDLaliQQ6HAZc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/mkelf32: Actually pad load segment to 2 MiB boundary
Message-Id: <E1wEn6E-00CrGn-1M@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 11:47:34 +0000

commit 17a78430548b577aed026199c5ebd17918131246
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:29:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:29:31 2026 +0200

    x86/mkelf32: Actually pad load segment to 2 MiB boundary
    
    Fix the code which tries to pad the load segment to 2 MiB but only pads
    it to a 1 MiB boundary.
    
    This manifests as a page fault while scrubbing RAM during boot on certain
    systems.
    
    Xen fails to mark itself as reserved in the E820 (due to spanning multiple
    regions), but does restrict the permissions in the directmap.  The region of
    RAM containing Xen is handed to physical memory manager as available for use,
    and scrubbing hit the directmap protections.
    
    Fixes: 4fb075201f54 ("x86/mkelf32: pad load segment to 2Mb boundary")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5416c455f656af9ff3ed7f26dcd5cbf70b254f23
    master date: 2026-04-17 18:15:54 +0100
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 373ba4ddd5..469d1ba0af 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -345,7 +345,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 20) - 1) & (-1U << 20);
+    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285742.1566918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnSx-0002Eg-0Z; Mon, 20 Apr 2026 12:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285742.1566918; Mon, 20 Apr 2026 12: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 1wEnSw-0002EX-U2; Mon, 20 Apr 2026 12:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1285742;
 Mon, 20 Apr 2026 12:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnSw-0002ER-0N
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnSv-00B7FC-34
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnSv-00CsKb-2w
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qIuNDB8xmoefO5a8u30wu/S2V7nLADnT/TfrUY6E5QE=; b=LYUm5W0rZBjfEHRNd54SJdm+A5
	NP18OyxACrrrmRBEVDCnd4mBdSVuwh7rq/x9lL6tJpMFf8Y8iMfFVKyDvBjC5NeupRw2DLgEGsl4H
	NOT3f1/X3LT0pnzgK9QHnMt6+GnMRKuvG/xmd7v6vwAvQ4x/gWoVw2ExsAfiNdhmTYTw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] update Xen version to 4.20.4-pre
Message-Id: <E1wEnSv-00CsKb-2w@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:11:01 +0000

commit 556887054c0705a3f854918f5644af302d386cc3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:32:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:32:24 2026 +0200

    update Xen version to 4.20.4-pre
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 90f493d74f..3e4d636a15 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    = 20
-export XEN_EXTRAVERSION ?= .3$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285743.1566922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnT7-0002HL-2C; Mon, 20 Apr 2026 12:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285743.1566922; Mon, 20 Apr 2026 12: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 1wEnT6-0002HD-VN; Mon, 20 Apr 2026 12:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1285743;
 Mon, 20 Apr 2026 12:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnT6-0002Gc-2P
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnT6-00B7G4-08
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnT6-00CsLg-00
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mLwM6UeyhAgxxIxanJEYzI84yCGO/XenoUzZTafs7OM=; b=NTrxgblszR2fpOQIcMKlCiEqhG
	RDKMJQaqNtD0qmCu9DXuYKPuV1Uy0CGJhC9bcq025prQb5wUcRhaJSPoubL2GU3KqXMwYasQJ+XQ9
	7VVN4m44W9UQlcePplBaTKWmPVzL6BuV7wjdf5EB6aemvbzuqQZq8AfO/trIioR53RA4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] arinc653: overwrite entire .dom_handle[] for Dom0 slots
Message-Id: <E1wEnT6-00CsLg-00@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:11:12 +0000

commit b96452cf853330bcec1494b2c0ab0cf672e03eb0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:32:47 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:32:47 2026 +0200

    arinc653: overwrite entire .dom_handle[] for Dom0 slots
    
    When that code still lived in a653sched_init(), it was redundant with the
    earlier memset() / xzalloc(). Once moved, the full structure field needs
    setting, as dom_handle_cmp() uses memcmp() and arinc653_sched_set() may
    have clobbered entries. Rather than implying the handle to be all zero,
    copy the handle out of the domain structure.
    
    Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 2a0ee29f5e6441b3c977ae8862842fd7c4da79d3
    master date: 2026-03-26 10:47:08 +0100
---
 xen/common/sched/arinc653.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 246ca9b742..bedd6d4007 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -418,7 +418,9 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
 
         if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
         {
-            sched_priv->schedule[entry].dom_handle[0] = '\0';
+            memcpy(sched_priv->schedule[entry].dom_handle,
+                   unit->domain->handle,
+                   sizeof(sched_priv->schedule->dom_handle));
             sched_priv->schedule[entry].unit_id = unit->unit_id;
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285744.1566925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnTH-0002JL-2u; Mon, 20 Apr 2026 12:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285744.1566925; Mon, 20 Apr 2026 12: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 1wEnTH-0002JD-0P; Mon, 20 Apr 2026 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1285744;
 Mon, 20 Apr 2026 12:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnTG-0002J7-5H
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTG-00B7GE-0Q
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTG-00CsMg-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fOsLAZ8cr16wqGXNp+P0RJvgsYTCDC8y1XzO8YCQmeM=; b=U3ivfPYBekFTEsRX1DKiISBsqM
	3Q4GOw+oyfNjS8ExgsBb89WeKcMrf+8+9uLakZo0jtuCjlx0EM0jch7o1ubrBByuTvlCS1fOoEFji
	e4Iy7Eu11NnxR4/mfBhjg6Xp753IjuforSuzBA8pR2QIhKMrWNuRD2saqQpr1gqIWSaQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] arinc653: avoid array overrun
Message-Id: <E1wEnTG-00CsMg-0J@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:11:22 +0000

commit f1826fa6ebe273b17980573208b705e270689474
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:33:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:33:18 2026 +0200

    arinc653: avoid array overrun
    
    Incrementing ->sched_index between bounds check and array access may
    result in accessing one past the array when that is fully filled
    (->num_schedule_entries == ARINC653_MAX_DOMAINS_PER_SCHEDULE).
    
    Fixes: 22787f2e107c ("ARINC 653 scheduler")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart@stew.dk>
    master commit: 5a1121633f2ae97d96d3e66472cf373a6caa3d51
    master date: 2026-03-26 10:47:41 +0100
---
 xen/common/sched/arinc653.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index bedd6d4007..0cc565f2c8 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -550,12 +550,9 @@ a653sched_do_schedule(
 
     /* Switch minor frame or find correct minor frame after a miss */
     while ( (now >= sched_priv->next_switch_time) &&
-        (sched_priv->sched_index < sched_priv->num_schedule_entries) )
-    {
-        sched_priv->sched_index++;
+            (++sched_priv->sched_index < sched_priv->num_schedule_entries) )
         sched_priv->next_switch_time +=
             sched_priv->schedule[sched_priv->sched_index].runtime;
-    }
 
     /*
      * If we exhausted the domains in the schedule and still have time left
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285745.1566930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnTR-0002LN-4g; Mon, 20 Apr 2026 12:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285745.1566930; Mon, 20 Apr 2026 12: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 1wEnTR-0002LE-1n; Mon, 20 Apr 2026 12:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1285745;
 Mon, 20 Apr 2026 12:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnTQ-0002L7-81
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTQ-00B7GX-0i
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTQ-00CsN6-0b
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aMdk5kp7z6HU+jK184L0rF94Rkl4NYe79HlTcp/tTJI=; b=WsJJGrneEv0T9U53YNCNoKTnTG
	MV3yFMjvakFfJnJWK89UtKzHTdTragfLBUoMX5H93j+LN8F+b9fZdAbzmWcbGxbRGeB2a5vDZJpTE
	OI2wHHpvlUIREbTOQdnANAFw/YokKXAVOT3DH1oYgM2jGqH5Qm6agChm2fGMENeBWZFg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] arinc653: remove idle period in default schedule
Message-Id: <E1wEnTQ-00CsN6-0b@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:11:32 +0000

commit 36366ff7d31dcbc1a935e217a478ccd986f7fc66
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Apr 20 12:33:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:33:36 2026 +0200

    arinc653: remove idle period in default schedule
    
    By initializing major_frame in a653sched_init(), an idle period was
    inadvertently introduced into the default schedule. Account for the
    initial value of major_frame when populating the default schedule.
    
    Fixes: f2927d8343ae ("xen/arinc653: fix delay in the start of major frame")
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: 6d412c059982d821260055eaa43417b3245b2050
    master date: 2026-03-26 10:49:11 +0100
---
 xen/common/sched/arinc653.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 0cc565f2c8..1b0ed2f9dd 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -425,7 +425,8 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
             sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
             sched_priv->schedule[entry].unit = unit;
 
-            sched_priv->major_frame += DEFAULT_TIMESLICE;
+            if ( entry )
+                sched_priv->major_frame += DEFAULT_TIMESLICE;
             ++sched_priv->num_schedule_entries;
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285746.1566933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnTb-0002NP-5e; Mon, 20 Apr 2026 12:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285746.1566933; Mon, 20 Apr 2026 12: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 1wEnTb-0002NH-36; Mon, 20 Apr 2026 12:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1285746;
 Mon, 20 Apr 2026 12:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnTa-0002NB-BH
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTa-00B7Gc-0z
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTa-00CsNl-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FMQJOCdfmBJW8f8xiPOO/72XMgW3KlUOfVIB0+/KiO4=; b=Ui1EJAmyjxyZn2zcWkSLXEDVzA
	cdFLjCsyocrO+krP58+eRkVwFPgs0MIbPa052P8zVrrWdtqZho45DunOtwjmPKyew4+YWfeAV+72K
	lvplFkGlAAVD1YLCg4Ek7VQhexA5wdg1kvVopbnhIS5MomYiL4u+ZeJA01WcZPei6zm4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/uart: report an error if the device type is not supported
Message-Id: <E1wEnTa-00CsNl-0t@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:11:42 +0000

commit ce40b0be7a712ae0079a43ab481b1bc91ba8a34d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:33:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:33:55 2026 +0200

    xen/uart: report an error if the device type is not supported
    
    When using key pairs for the uart configuration (com1 and com2 command line
    options), report an error if the passed device=<type> is not recognized
    instead of silently ignoring it.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 550ee7c198010c297d74b69e07d95a26358eadbd
    master date: 2026-03-27 14:52:40 +0100
---
 xen/drivers/char/ns16550.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index eaeb0e09d0..77acc188d9 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1656,6 +1656,8 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
                 pci_uart_config(uart, 0, uart - ns16550_com);
                 dev_set = true;
             }
+            else
+                PARSE_ERR_RET("Unknown device type %s\n", param_value);
             break;
 
         case port_bdf:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285747.1566938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnTm-0002PS-7Q; Mon, 20 Apr 2026 12:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285747.1566938; Mon, 20 Apr 2026 12:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnTm-0002PG-4P; Mon, 20 Apr 2026 12:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1285747;
 Mon, 20 Apr 2026 12:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnTk-0002P9-Dr
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTk-00B7Gg-1I
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTk-00CsOQ-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E6tsZ9B+gC49YllVhY9qHip25dvX9ELoqRkII22qGVc=; b=fXFfOoHPLahH88UjcxYP0Yljkb
	DKe/s/GHTMnCetkbJNtpeB/vdhjASJRWz6BwkzoRlHZHXdbFGEV+/b4tq3fb5z/zfyPenUJ+R2TgW
	s4egL0drJrMr8/AMlwuPnj6OCA1FAX9qJegFtX+MyqBWKSl8sG5xGbp6Dd4AQQZ+uE10=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] libacpi: Pass missing --dm_version to mk_dsdt
Message-Id: <E1wEnTk-00CsOQ-1A@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:11:52 +0000

commit c1a7c617f1165ac7c5f0241da3e8889ca6ff38ba
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:34:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:34:17 2026 +0200

    libacpi: Pass missing --dm_version to mk_dsdt
    
    Commit 19ab8356abe4 ("tools: remove support for running a guest with
    qemu-traditional") made passing --dm_version to mk_dsdt mandatory on
    x86 but didn't fix all the invocations of it.
    
    The previous default was qemu-xen-traditional so with that removed set
    the dm_version to qemu-xen for this invocation.
    
    Without this change, Xen fails to build on x86 when using
    --enable-rombios.
    
    Fixes: 19ab8356abe4 ("tools: remove support for running a guest with qemu-traditional")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ea12f9d257353ddec8a2fe8da42d11636de3dacb
    master date: 2026-03-27 18:56:42 +0000
---
 tools/libacpi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index b21a64c6b4..193ec78672 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -51,7 +51,7 @@ $(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl  $(MK_DSDT)
 	# Remove last bracket
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
 	cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
-	$(MK_DSDT) --debug=$(debug) --maxcpu $*  >> $@.$(TMP_SUFFIX)
+	$(MK_DSDT) --debug=$(debug) --maxcpu $* --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 
 $(ACPI_BUILD_DIR)/dsdt_pvh.asl: dsdt_acpi_info.asl $(MK_DSDT)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:12:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285748.1566941 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnTw-0002RT-8O; Mon, 20 Apr 2026 12:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285748.1566941; Mon, 20 Apr 2026 12:12:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnTw-0002RJ-5j; Mon, 20 Apr 2026 12:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1285748;
 Mon, 20 Apr 2026 12:12:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnTu-0002RC-GW
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:12:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTu-00B7H0-1Y
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnTu-00CsPV-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EyYAM1q345wDxwno0ddn11WyDaabtH0le91CJZ+gThM=; b=1yOgHnc5l4ws88g1q/X7IkAmcB
	da+yPcuKbBa5HqnKcAz7v2NI/qk0klr4MuFdPWraPu/cg+GuRtQghkLYU/HvJsTIcILuYVHA6/swk
	M148yR9f1RtaY3HJSI1V7wfCKQUiUWvP7H6VyA3ZjYKSasi9TEMIJ26ywMUEula81GMY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
Message-Id: <E1wEnTu-00CsPV-1T@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:12:02 +0000

commit c2cb923ed7680b8ca7d5754a961635ecffff3c59
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:34:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:34:34 2026 +0200

    xen/uart: uniformly set ->ps_bdf_enable for all PCI serial devices
    
    Auto-discovered serial PCI devices when using dev=amt|pci won't get
    ->ps_bdf_enable, and as such some of the logic (like making sure the
    respective BARs are enabled) won't be applied to them.
    
    Fix by unconditionally setting ->ps_bdf_enable for all PCI serial devices,
    and removing the special case that was done in some places by checking
    whether the ->bar was set.  This also allows simplifying the logic in
    pci_serial_early_init().
    
    Fixes: 9738db88f68f ("xen: Automatically find serial port on PCI/PCIe and AMT devices.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4bf33360623d9d59c8e7a49b70308c1b58d4d772
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 77acc188d9..1dce415cb2 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -273,7 +273,10 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
-    if ( uart->bar && uart->io_base >= 0x10000 )
+    if ( !uart->ps_bdf_enable )
+        return;
+
+    if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
@@ -281,9 +284,6 @@ static void pci_serial_early_init(struct ns16550 *uart)
         return;
     }
 
-    if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
-        return;
-
     if ( uart->pb_bdf_enable )
         pci_conf_write16(PCI_SBDF(0, uart->pb_bdf[0], uart->pb_bdf[1],
                                   uart->pb_bdf[2]),
@@ -428,7 +428,7 @@ static void __init cf_check ns16550_init_postirq(struct serial_port *port)
         unsigned int, 1, (bits * uart->fifo_size * 1000) / uart->baud);
 
 #ifdef NS16550_PCI
-    if ( uart->bar || uart->ps_bdf_enable )
+    if ( uart->ps_bdf_enable )
     {
         if ( uart->param && uart->param->mmio &&
              rangeset_add_range(mmio_ro_ranges, PFN_DOWN(uart->io_base),
@@ -1320,6 +1320,7 @@ pci_uart_config(struct ns16550 *uart, bool skip_amt, unsigned int idx)
                 uart->ps_bdf[0] = b;
                 uart->ps_bdf[1] = d;
                 uart->ps_bdf[2] = f;
+                uart->ps_bdf_enable = true;
                 uart->bar_idx = bar_idx;
                 uart->bar = bar;
                 uart->bar64 = bar_64;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:12:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285749.1566946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnU6-0002Tl-9x; Mon, 20 Apr 2026 12:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285749.1566946; Mon, 20 Apr 2026 12:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnU6-0002Td-7N; Mon, 20 Apr 2026 12:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1285749;
 Mon, 20 Apr 2026 12:12:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnU4-0002TW-JK
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:12:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnU4-00B7HR-1q
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnU4-00CsQ4-1j
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UkcT+D4MYmHjydOwC14calzxvQ3mTdjXyyB3JpeXTcw=; b=mNaNDOh5DvpDB/x/Myq7wUgzOH
	0/+nGNxUgjpWdG2JrTn3/6Q1wikd7A43lrwSRJZqRGr6khnhszsBNNRCUV2o75Gtc6BfyoAQVkoEo
	4NUO7c6R5dJQzljDuAYefGZbqtrKfRcv9RUuEgDeEkP78i3KtDkNr1Irp+yAHboSqw0M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/uart: be more careful with changes to the PCI command register
Message-Id: <E1wEnU4-00CsQ4-1j@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:12:12 +0000

commit 0359ff3565b40f8692c9a986d6d04a61b03e6d4f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:34:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:34:52 2026 +0200

    xen/uart: be more careful with changes to the PCI command register
    
    Read the existing PCI command register and only add the required bits to
    it, as to avoid clearing bits that might be possibly set by the firmware
    already, which might put the device into a non-working state.
    
    Xen being the owner of the PCI device it's legitimately allowed to change
    command registers bits.  Be careful however in case buggy devices require
    certain command register bits to be enabled, while not strictly required
    from Xen's usage.
    
    Fixes: f2ff5d6628b3 ("ns16550: enable PCI serial card usage")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: ebf543972560e45b838def3a54859331cc92c970
    master date: 2026-03-30 16:43:14 +0200
---
 xen/drivers/char/ns16550.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 1dce415cb2..9507af299f 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -273,14 +273,19 @@ static int cf_check ns16550_getc(struct serial_port *port, char *pc)
 static void pci_serial_early_init(struct ns16550 *uart)
 {
 #ifdef NS16550_PCI
+    uint16_t cmd;
+
     if ( !uart->ps_bdf_enable )
         return;
 
+    cmd = pci_conf_read16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
+                                  uart->ps_bdf[2]), PCI_COMMAND);
+
     if ( uart->io_base >= 0x10000 )
     {
         pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                   uart->ps_bdf[2]),
-                         PCI_COMMAND, PCI_COMMAND_MEMORY);
+                         PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
         return;
     }
 
@@ -297,7 +302,7 @@ static void pci_serial_early_init(struct ns16550 *uart)
                      uart->io_base | PCI_BASE_ADDRESS_SPACE_IO);
     pci_conf_write16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                               uart->ps_bdf[2]),
-                     PCI_COMMAND, PCI_COMMAND_IO);
+                     PCI_COMMAND, cmd | PCI_COMMAND_IO);
 #endif
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:12:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285750.1566950 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUG-0002Xr-D4; Mon, 20 Apr 2026 12:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285750.1566950; Mon, 20 Apr 2026 12:12:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUG-0002Xj-AH; Mon, 20 Apr 2026 12:12:24 +0000
Received: by outflank-mailman (input) for mailman id 1285750;
 Mon, 20 Apr 2026 12:12:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnUE-0002Xb-MO
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:12:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUE-00B7Hb-29
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUE-00CsQX-21
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M+pbL9SgQE59yi1RzlOp1V4nVrVyqb8cuWaliIi7EOQ=; b=TqcD8ZfYTOnMR4uFmlcw30n//s
	If2wOZdZpE2udNyAbxuzAp9FhKFqis+4lEaikARB3r+Swto6B8u0uvT565rDT7ncm5ywfP1Orb3a1
	mvoSlWL4ckSHQBzhdg86dmnVKJgIqWM5MxBCqEAhJo19BZOlQTCcnmn/JX0n76zRjnlM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/fpu: Initialise FTW in xstate_alloc_save_area()
Message-Id: <E1wEnUE-00CsQX-21@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:12:22 +0000

commit 140d981b2a498c682b65017ab4b70b2dc21e15e1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 20 12:35:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:13 2026 +0200

    x86/fpu: Initialise FTW in xstate_alloc_save_area()
    
    Right now, xstate_alloc_save_area() leaves both XSTATE_BV and FTW clear.  This
    causes a difference in behaviour between FXRSTOR and XRSTOR.
    
    Switch to using using XSTATE's idea of initial configuration which will behave
    the same even on pre-XSAVE hardware.  Expand the comment to explain why.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 639de2aafa437fd50abc16a46c8a8dd0d0e9e6a7
    master date: 2026-03-30 15:48:13 +0100
---
 xen/arch/x86/xstate.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index af9e345a7a..de29853f3c 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -542,11 +542,22 @@ int xstate_alloc_save_area(struct vcpu *v)
         return -ENOMEM;
 
     /*
-     * Set the memory image to default values, but don't force the context
-     * to be loaded from memory (i.e. keep save_area->xsave_hdr.xstate_bv
-     * clear).
+     * We're creating a vCPU, so conceptually we should be choosing the
+     * architectural #RESET values.
+     *
+     * However for historical reasons of configuring the external
+     * co-processor, FCW's #RESET state is different to what F(N)INIT and
+     * XSTATE consider the "initial configuration".
+     *
+     * Guests won't care about the difference; all software tends to executes
+     * FNINIT very early during setup.
+     *
+     * Use XSTATE's idea of initial configuration.  This allows XSTATE_BV to
+     * remain clear and for CPUs to use the INIT optimisation where
+     * applicable.
      */
     save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.ftw = FXSAVE_FTW_RESET;
     save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
 
     v->arch.xsave_area = save_area;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:12:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285751.1566954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUQ-0002Zs-Eu; Mon, 20 Apr 2026 12:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285751.1566954; Mon, 20 Apr 2026 12:12:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUQ-0002Zl-Bq; Mon, 20 Apr 2026 12:12:34 +0000
Received: by outflank-mailman (input) for mailman id 1285751;
 Mon, 20 Apr 2026 12:12:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnUO-0002Ze-P2
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:12:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUO-00B7Hh-2Q
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUO-00CsQv-2K
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mzre5Gs3wcMHG0a3GyyD9CxgRF6yDdZTZpmgL3qia8s=; b=NvWmIETVdB/qbUj065bydVUtx4
	1t2V3O//Yse1AlIOlCvA1fKyti3mCqArxIWdjS7erfnTBlXCRWvLV86lbyeJJhExDnaZaX0vFBSRa
	RM2WiUSwc67syHydZK0UMNkYEBc8sMicSOHS2vJgQGEVwueC/O+jyoRLx2fq3/e+jW7s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] EFI: avoid OOB config file reads
Message-Id: <E1wEnUO-00CsQv-2K@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:12:32 +0000

commit 05b8f716aa3273eb6daa8340f95e3936078ea8c7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:35:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:31 2026 +0200

    EFI: avoid OOB config file reads
    
    The message emitted by pre_parse() pretty clearly states the original
    intention. Yet what it said wasn't done, and would have been unfriendly to
    the user. Hence accesses past the allocated buffer were possible. Insert a
    terminating NUL immediately past the data read, to then drop the no longer
    applicable message.
    
    NB: The iscntrl() check of just the last byte is more strict than what
    pre_parse() would accept without issuing its prior message, yet I'd like
    to keep the new logic reasonably simple. Config files shouldn't be huge,
    and we shouldn't be _that_ short of memory (or we'd fail elsewhere pretty
    soon).
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: df75f77092c1cc47f3ed5be86cf6c04e732f3f80
    master date: 2026-04-07 08:59:15 +0200
---
 xen/common/efi/boot.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index b09890cb8f..c2db9afd63 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -774,8 +774,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     {
         file->addr = min(1UL << (32 + PAGE_SHIFT),
                          HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
+        /* For config files allocate an extra byte to put a NUL there. */
         ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
-                                    PFN_UP(size), &file->addr);
+                                    PFN_UP(size + (file == &cfg)), &file->addr);
     }
     if ( EFI_ERROR(ret) )
         what = what ?: L"Allocation";
@@ -804,6 +805,9 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
 
     efi_arch_flush_dcache_area(file->ptr, file->size);
 
+    if ( file == &cfg )
+        file->str[file->size] = 0;
+
     return true;
 }
 
@@ -819,6 +823,23 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
 
     file->ptr = ptr;
 
+    /* For cfg file, if necessary allocate space to put an extra NUL there. */
+    if ( file == &cfg && file->size && !iscntrl(file->str[file->size - 1]) )
+    {
+        EFI_PHYSICAL_ADDRESS addr;
+        EFI_STATUS ret = efi_bs->AllocatePages(AllocateMaxAddress,
+                                               EfiLoaderData,
+                                               PFN_UP(file->size + 1), &addr);
+
+        if ( EFI_ERROR(ret) )
+            return false;
+
+        memcpy((void *)addr, ptr, file->size);
+        file->addr = addr;
+        file->need_to_free = true;
+        file->str[file->size] = 0;
+    }
+
     handle_file_info(name, file, options);
 
     return true;
@@ -847,9 +868,6 @@ static void __init pre_parse(const struct file *file)
         else
             start = 0;
     }
-    if ( file->size && end[-1] )
-         PrintStr(L"No newline at end of config file,"
-                   " last line will be ignored.\r\n");
 }
 
 static void __init efi_init(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:12:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:12:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285752.1566958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUa-0002bv-G1; Mon, 20 Apr 2026 12:12:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285752.1566958; Mon, 20 Apr 2026 12:12:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUa-0002bm-DJ; Mon, 20 Apr 2026 12:12:44 +0000
Received: by outflank-mailman (input) for mailman id 1285752;
 Mon, 20 Apr 2026 12:12:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnUY-0002bf-Rn
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:12:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUY-00B7Hq-2g
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUY-00CsRI-2a
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bTSK2eul8Ga7+gHG7PJty4/mwQDTmrfDf4XknMHuPd4=; b=3YifhxbcE4mFVAE2NalQ1AEg6w
	Q+lJMFuDsE0xgYe1sGamqEIbklapUn4CRuPjqJT6t3VdDUywbdaS2NitF1JTrBQDj53+acqyCH9bB
	NAVdw2Kgn4jOvOe1Yo6yw3l8rLZcGeEXl/+8FV/1QStda/TQ2GkisRH1fZC4ACaYN5o8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] llc-coloring: improve checking while parsing
Message-Id: <E1wEnUY-00CsRI-2a@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:12:42 +0000

commit eb2c288ae12edd6e8cee7497847f9e81dfd9a4cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:35:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:48 2026 +0200

    llc-coloring: improve checking while parsing
    
    We can easily avoid the risk of wrapping UINT_MAX <-> 0 by applying a
    check against the compile-time-constant maximum number of colors.
    
    Additionally the overflow checks suffered from an off-by-1, as the parsed
    ranges are inclusive (e.g. end == start being possible, requiring 1 array
    slot, while availability of 0 slots was checked in that case).
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    xen/common: llc-coloring: Fix off-by-one in parse_color_config()
    
    The check uses (*num_colors + (end - start + 1)) >= max_num_colors, which
    rejects a configuration where exactly max_num_colors colors are specified.
    For example, if max_num_colors is 4 and *num_colors is 0, a range "0-3"
    gives (end - start + 1) = 4, and (0 + 4) >= 4 is true, incorrectly
    returning -EINVAL.
    
    Fix this by switching the overflow condition to the state before commit
    cba8a584de17 that regressed the behavior (i.e. don't add 1).
    
    Fixes: cba8a584de17 ("llc-coloring: improve checking while parsing")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    master commit: cba8a584de171c8c4510709c2edc9f1cf86b21ab
    master date: 2026-04-07 13:52:44 +0200
    master commit: dc28f531e6a29a6fdd58f24073dfb48af06b8334
    master date: 2026-04-10 12:14:05 +0200
---
 xen/common/llc-coloring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index a572f77a09..778092fe1f 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -76,7 +76,8 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         else                /* Single value */
             end = start;
 
-        if ( start > end || (end - start) > (UINT_MAX - *num_colors) ||
+        if ( end >= NR_LLC_COLORS || start > end ||
+             (end - start) >= (UINT_MAX - *num_colors) ||
              (*num_colors + (end - start)) >= max_num_colors )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:12:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:12:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285753.1566961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUk-0002dv-HN; Mon, 20 Apr 2026 12:12:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285753.1566961; Mon, 20 Apr 2026 12:12:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUk-0002dn-Ej; Mon, 20 Apr 2026 12:12:54 +0000
Received: by outflank-mailman (input) for mailman id 1285753;
 Mon, 20 Apr 2026 12:12:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnUi-0002dg-UT
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:12:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUi-00B7I0-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUi-00CsRv-2r
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:12:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hV5vT5nbXqEKMk6nga+OsZ10CslrDtS7fJwMIxR3NMo=; b=QfuurJX7/0XZpI8Ap++0SJlUK/
	SR5fOrP5bOW/Y97mq296M9u9fC2KaSpBf8/OP9niUX5Od0/umUJVoMlRLv7/ALcsLvkFqi4nDzRbs
	AQVzJ53OB4hMDtCbmPxne+8VQ6kar4GyxVpbCK0KHClsI99FCJ6sIHp4WrFQQ37NjnYM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] ns16550: harden name/value pair parsing
Message-Id: <E1wEnUi-00CsRv-2r@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:12:52 +0000

commit 928144f39f9195794e4aec147144238b242d49a7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:35:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:35:56 2026 +0200

    ns16550: harden name/value pair parsing
    
    strsep(), unless passed a 1st argument which itself points at a NULL
    pointer, won't return NULL. Instead if the separator(s) looked for isn't
    found, that pointed-to field would be updated to hold NULL. Hence the
    important check in get_token() is for token to be non-NULL after the call
    (which get_token()'s callers rely upon), while the checking of param_name
    is left there just in case.
    
    Fixes: 97fd49a7e074 ("ns16550: add support for UART parameters to be specifed with name-value pairs")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b27d3b45c75cf378f06ed72758c034a5d0f8d560
    master date: 2026-04-07 13:53:49 +0200
---
 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 9507af299f..ea35caf034 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1454,7 +1454,7 @@ static enum __init serial_param_type get_token(char *token, char **value)
     unsigned int i;
 
     param_name = strsep(&token, "=");
-    if ( param_name == NULL )
+    if ( !param_name || !token )
         return num_serial_params;
 
     /* Linear search for the parameter. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:13:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:13:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285754.1566966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUu-0002fv-If; Mon, 20 Apr 2026 12:13:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285754.1566966; Mon, 20 Apr 2026 12:13:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnUu-0002fn-GC; Mon, 20 Apr 2026 12:13:04 +0000
Received: by outflank-mailman (input) for mailman id 1285754;
 Mon, 20 Apr 2026 12:13:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnUt-0002fg-1O
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:13:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUt-00B7IH-03
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnUs-00CsSR-38
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MPxjMqvD7QIIcJ14bMkDqxoDdLc6RPw1Zng3blbgq+I=; b=4FtGaq8oUQL9s+aczo+vzQ4PqF
	wWFDg668D2/1FqPCYBez2NULOXcrKIVkHBpVk37ZtWnbGMLhK6rvkd3ukBdO1oXimLzrlfZzAbK5M
	jeEyCzXJ7sXn/CX/mrCmrjLvqzaPlQhNlgJ7ynFYaG12u5ypigMcDRRX33WNifc6POWw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] ns16550: harden positional parsing
Message-Id: <E1wEnUs-00CsSR-38@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:13:02 +0000

commit 491f6618b54f124fe10e22b8b96ed40e7c8d5635
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:36:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:36:19 2026 +0200

    ns16550: harden positional parsing
    
    Advancing past a character without knowing whether that's the NUL char is
    at risk of reading beyond the buffer.
    
    Fixes: 25de1f692059 ("Allow arch-specific defaults to be specified for ns16550")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 2c43b5611ffbe35611dd391c949f7cb15e1b29e7
    master date: 2026-04-07 13:54:19 +0200
---
 xen/drivers/char/ns16550.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index ea35caf034..b443714c10 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1529,6 +1529,9 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
     {
         uart->data_bits = simple_strtoul(conf, &conf, 10);
 
+        if ( !*conf )
+            PARSE_ERR_RET("bad DPS setting");
+
         uart->parity = parse_parity_char(*conf);
 
         uart->stop_bits = simple_strtoul(conf + 1, &conf, 10);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:13:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:13:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285755.1566970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnV4-0002iI-K7; Mon, 20 Apr 2026 12:13:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285755.1566970; Mon, 20 Apr 2026 12:13:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnV4-0002iA-HX; Mon, 20 Apr 2026 12:13:14 +0000
Received: by outflank-mailman (input) for mailman id 1285755;
 Mon, 20 Apr 2026 12:13:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnV3-0002i2-41
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:13:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnV3-00B7If-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnV3-00CsT0-0D
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bCq0cMQcQTSQezQBXM1j15g5FnGJcmWlW9IKcFDO/R4=; b=O1dRU1K9R1Igv+4x9ADXDgkROf
	igXu7JAju5KxtvYKp6zMPbIxCPOp/oNI3EmzNy9opErZ40cQLvyHslEn14y/1yyAtljKIT/CPfRy+
	a6bx6dsjIa6S2s8+AfMuWpYvvNp4fLA92CilGFr2uuintm7Or9ELoUdLZgSVk6U00HTo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] video/vesa: harden font height parsing
Message-Id: <E1wEnV3-00CsT0-0D@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:13:13 +0000

commit 16489085bd8052cbae02b5fd18437847bd33f532
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:36:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:36:32 2026 +0200

    video/vesa: harden font height parsing
    
    We should not prematurely increment the pointer, to avoid inadvertently
    skipping a NUL terminator.
    
    Fixes: 6d9199bd0f22 ("x86-64: enable hypervisor output on VESA frame buffer")
    Reported-by: Kamil Frankowicz <kamil.frankowicz@cert.pl>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 3bcce461a33a8c0c0721543638ce375178d90006
    master date: 2026-04-07 13:54:37 +0200
---
 xen/drivers/video/vesa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 70feca21ac..f6c6afd40c 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -31,8 +31,8 @@ static unsigned int __initdata vram_remap;
 static unsigned int __initdata font_height;
 static int __init cf_check parse_font_height(const char *s)
 {
-    if ( simple_strtoul(s, &s, 10) == 8 && (*s++ == 'x') )
-        font_height = simple_strtoul(s, &s, 10);
+    if ( simple_strtoul(s, &s, 10) == 8 && (*s == 'x') )
+        font_height = simple_strtoul(s + 1, &s, 10);
     if ( *s != '\0' )
         font_height = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:13:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:13:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285756.1566973 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVE-0002kL-LI; Mon, 20 Apr 2026 12:13:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285756.1566973; Mon, 20 Apr 2026 12:13:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVE-0002kE-Ip; Mon, 20 Apr 2026 12:13:24 +0000
Received: by outflank-mailman (input) for mailman id 1285756;
 Mon, 20 Apr 2026 12:13:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnVD-0002k8-6m
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:13:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVD-00B7Im-0a
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVD-00CsTq-0V
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=R6YofzalXjXcCIEyDT1Iu5Vef6UeNHYAiWFX+mYvwHU=; b=D0O/mmlDiy47NYsoTCIuHFsR7l
	udpAxUJt112uvxozXjy+XSmYzvb5liBAcARM7JXx/XLQUvfXIaoR4v3GCpiPVqcIoiWBsBpXdZuPR
	kHYXA8JyOPFgS0fqrGDAO7W9pebzFYQUHH2POOcFHX0ZgFWgkH8HG7841m73/xSws/5A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/x86: Check supported features even for PVH dom0
Message-Id: <E1wEnVD-00CsTq-0V@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:13:23 +0000

commit 1f067a8e6a80cbb6102b4d5acd83fdb1c298aae2
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Mon Apr 20 12:36:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:36:52 2026 +0200

    xen/x86: Check supported features even for PVH dom0
    
    The supported features ELF notes was tested only if the dom0 was
    PV. Factor out a function to check ELF notes and reuse it even
    for PVH.
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 44429b69319975f25d3762629b40fecdd4e3e554
    master date: 2026-04-09 21:04:58 +0100
---
 xen/arch/x86/dom0_build.c             | 12 ++++++++++++
 xen/arch/x86/hvm/dom0_build.c         |  3 +++
 xen/arch/x86/include/asm/dom0_build.h |  2 ++
 xen/arch/x86/pv/dom0_build.c          | 10 ++--------
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8191d90a22..5692fab0bc 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -319,6 +319,18 @@ unsigned long __init dom0_paging_pages(const struct domain *d,
     return DIV_ROUND_UP(memkb, 1024) << (20 - PAGE_SHIFT);
 }
 
+int __init initdom_check_parms(
+    const struct domain *d, const struct elf_dom_parms *parms)
+{
+    if ( parms->elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE &&
+         is_hardware_domain(d) && !test_bit(XENFEAT_dom0, parms->f_supported) )
+    {
+        printk("Kernel does not support Dom0 operation\n");
+        return -EINVAL;
+    }
+
+    return 0;
+}
 
 /*
  * If allocation isn't specified, reserve 1/16th of available memory for
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index c6f8af9a96..6ab2ff5ec8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -690,6 +690,9 @@ static int __init pvh_load_kernel(
         return -EINVAL;
     }
 
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
+
     /* Copy the OS image and free temporary buffer. */
     elf.dest_base = (void *)(parms.virt_kstart - parms.virt_base);
     elf.dest_size = parms.virt_kend - parms.virt_kstart;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 2d67b17213..c362dc3771 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -8,6 +8,8 @@
 
 extern unsigned int dom0_memflags;
 
+int initdom_check_parms(const struct domain *d,
+                        const struct elf_dom_parms *parms);
 unsigned long dom0_compute_nr_pages(struct domain *d,
                                     struct elf_dom_parms *parms,
                                     unsigned long initrd_len);
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index f54d1da5c6..5bc59b48a5 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -502,14 +502,8 @@ static int __init dom0_construct(struct boot_info *bi, struct domain *d)
         return -EINVAL;
     }
 
-    if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE )
-    {
-        if ( !pv_shim && !test_bit(XENFEAT_dom0, parms.f_supported) )
-        {
-            printk("Kernel does not support Dom0 operation\n");
-            return -EINVAL;
-        }
-    }
+    if ( (rc = initdom_check_parms(d, &parms)) != 0 )
+        return rc;
 
     nr_pages = dom0_compute_nr_pages(d, &parms, initrd_len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:13:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:13:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285757.1566978 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVO-0002mq-Oj; Mon, 20 Apr 2026 12:13:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285757.1566978; Mon, 20 Apr 2026 12:13:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVO-0002mj-M9; Mon, 20 Apr 2026 12:13:34 +0000
Received: by outflank-mailman (input) for mailman id 1285757;
 Mon, 20 Apr 2026 12:13:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnVN-0002mc-9L
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:13:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVN-00B7Is-0q
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVN-00CsUC-0l
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Bm/tbgWXqEHdovyihJhUpnMzFZ7D7ChB2WC2ibGW+DM=; b=6cfYAFwGuDJbHg3mjVqeUHVwrt
	Pdh5hscDyclSt0HFOtyVOB/5TH8lL6UEy5Pjw9STVpYskQw1uXlX9M+ViqiOO4p7aYwnyWn8y6Ftk
	qmYOVx9R9JD1+sKE0i0HMe4Z7/lgU/qg4vN3/xhyfuSro1vXIT+wkb9uPVS7xf5er7KI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/uart: set a default baudrate if non specified neither found
Message-Id: <E1wEnVN-00CsUC-0l@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:13:33 +0000

commit 92d668bf89c109b0fca60c018ef01d260e01f11a
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:37:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:37:12 2026 +0200

    xen/uart: set a default baudrate if non specified neither found
    
    If the user has set baudrate as "auto" (use whatever was configured) but
    Xen cannot find any set baudrate use a default fallback baudrate of
    115200.
    
    Otherwise the console will very likely end up being non-functional, as
    further values are derived from the baudrate (like the transmit timeout),
    and using -1 will result in screwed parameters being derived from the
    baudrate.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    master commit: 12e50da43d926cc5401c6ec1146cdcedaba23243
    master date: 2026-04-10 14:30:50 +0200
---
 xen/drivers/char/ns16550.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index b443714c10..6089558aae 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -345,9 +345,16 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         if ( divisor )
             uart->baud = uart->clock_hz / (divisor << 4);
         else
+        {
+            uart->baud = 115200;
             printk(XENLOG_ERR
                    "Automatic baud rate determination was requested,"
-                   " but a baud rate was not set up\n");
+                   " but a baud rate was not set up\n"
+                   "Setting baudrate to %u\n", uart->baud);
+            divisor = uart->clock_hz / (uart->baud << 4);
+            ns_write_reg(uart, UART_DLL, (uint8_t)divisor);
+            ns_write_reg(uart, UART_DLM, (uint8_t)(divisor >> 8));
+        }
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:13:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:13:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285758.1566983 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVY-0002oz-Qd; Mon, 20 Apr 2026 12:13:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285758.1566983; Mon, 20 Apr 2026 12:13:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVY-0002or-Nb; Mon, 20 Apr 2026 12:13:44 +0000
Received: by outflank-mailman (input) for mailman id 1285758;
 Mon, 20 Apr 2026 12:13:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnVX-0002oj-C0
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:13:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVX-00B7Iy-17
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVX-00CsUb-11
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AJ446Owru+ox+36zYY7qXgISVlNKo1dF7CD47kGLkWY=; b=A24ISBDQGJ39NC3H25EDuh4o0m
	Ol3ozfaA6XEFgQQBnfN6Alo0HWrijQRh7UwKpfqFRaFacUBwzLc1xoqxDz2PGjG/GhxoiLNXUVqgw
	/WR9/Gaye+HN/MbBr/sdsHH1oRiuCmKA25oDw1foruGCbsqeDxXIrshfLIavD92v1Trg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/time: do not kill calibration timer on suspend
Message-Id: <E1wEnVX-00CsUb-11@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:13:43 +0000

commit c6d16eb5336508b7c436488800d912fa910db38c
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:37:35 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:37:35 2026 +0200

    x86/time: do not kill calibration timer on suspend
    
    A killed timer will ignore further set_timer() calls, and hence won't be
    re-armed unless it's initialized again.  Use stop_timer() instead of
    kill_timer() in time_suspend(), so that the set_timer() call in
    time_resume() successfully re-arms the timer.  Otherwise time calibration
    is no longer scheduled (and executed) after resuming from S3 suspend.
    
    Fixes: 6d90db1a2ca1 ("x86: rendezvous-based local time calibration")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: 2d670d258b2e592d44deb5ee12e7c2ba1d79d8a9
    master date: 2026-04-10 14:31:10 +0200
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 3b451525a9..bb36038e0c 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2720,7 +2720,7 @@ int time_suspend(void)
     {
         cmos_utc_offset = -get_wallclock_time();
         cmos_utc_offset += get_sec();
-        kill_timer(&calibration_timer);
+        stop_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
         platform_time_calibration();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:13:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:13:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285759.1566986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVi-0002r6-RZ; Mon, 20 Apr 2026 12:13:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285759.1566986; Mon, 20 Apr 2026 12:13: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 1wEnVi-0002qz-Ot; Mon, 20 Apr 2026 12:13:54 +0000
Received: by outflank-mailman (input) for mailman id 1285759;
 Mon, 20 Apr 2026 12:13:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnVh-0002qs-Eb
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:13:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVh-00B7J6-1N
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVh-00CsV1-1H
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lMv0UFvr/a/TcUtK0VUk03/0BMCxbnziz/B+5TPM7gk=; b=VrV2Q5HzVby3+287+90OVxTlAw
	WTeQLP/7Nb6BtbaHgInfIwMEaCYSu5DDdHIK0+Z1cSHJs8CtwW4fcMfl6Iw/y63gFn+5rH0UTWpJo
	4d9G5mLuO3GFp9ArKVj0/3v2rV8p8E+OIhj/aL7ComorY+kxc5BDH4D8Y4/MzvTh6bsU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/APIC: handle overflow in TMICT calculation
Message-Id: <E1wEnVh-00CsV1-1H@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:13:53 +0000

commit d5c70a51bfbe95e54fb7c78c8ef31cf43d10c5b1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:37:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:37:56 2026 +0200

    x86/APIC: handle overflow in TMICT calculation
    
    With an expiry value on the order of 10 hours, and with a bus scale value
    of 256k (as supplied by qemu), the (signed) multiplication will be UB. As
    we've checked that the value is positive, we mean unsigned multiplication
    anyway. Yet let's play safe against even larger expiry and bus scale
    values, leveraging the compiler builtin that there is for this purpose.
    
    While there also drop the stray cast from the actual TMICT write.
    
    Fixes: 9062553a0dc1 ("added time and accurate timer support")
    Fixes: b95beb185810 ("x86: Clean up APIC local timer handling")
    Reported-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 4f14d97a620c3a005ad0604ae47ee6091281cda0
    master date: 2026-04-16 10:29:54 +0200
---
 xen/arch/x86/apic.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7a0920d11c..daf597ed44 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1311,10 +1311,21 @@ int reprogram_timer(s_time_t timeout)
     }
 
     if ( timeout && ((expire = timeout - NOW()) > 0) )
-        apic_tmict = min_t(uint64_t, (bus_scale * expire) >> BUS_SCALE_SHIFT,
-                           UINT32_MAX);
+    {
+        unsigned long product;
+        bool overflow;
+
+        apic_tmict = UINT32_MAX;
+        asm ( "mul %[expire]\n\t"
+              ASM_FLAG_OUT(, "setc %[cf]")
+              : "=a" (product), [cf] ASM_FLAG_OUT("=@ccc", "=qm") (overflow)
+              : "0" ((unsigned long)bus_scale), [expire] "r" (expire) );
+        if ( !overflow &&
+             (product >>= BUS_SCALE_SHIFT) < apic_tmict )
+            apic_tmict = product;
+    }
 
-    apic_write(APIC_TMICT, (unsigned long)apic_tmict);
+    apic_write(APIC_TMICT, apic_tmict);
 
     return apic_tmict || !timeout;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:14:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:14:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285760.1566990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnVs-0002t7-St; Mon, 20 Apr 2026 12:14:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285760.1566990; Mon, 20 Apr 2026 12:14: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 1wEnVs-0002sz-QN; Mon, 20 Apr 2026 12:14:04 +0000
Received: by outflank-mailman (input) for mailman id 1285760;
 Mon, 20 Apr 2026 12:14:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnVr-0002st-HN
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:14:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVr-00B7JL-1c
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnVr-00CsW5-1X
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=k/DK+iGGCJgXMhJvIeQqA3UP9i280s/vnjUwFaTksOQ=; b=1WLQzUmXPnO6T8UWcNhYGosQzd
	dT2YfHAOuXWnWzLRhzF9MHznw9wiaRTvOj2WBiAynzof8am5oMr5uWHnn75U7YfM5qzXIZmEEes3h
	FlCwC61Vn9DzFE/YD6UjtAgrE1TlxvMe72IyRqY5Zl/f5jAWC3CTrpyjwaqF/KMcEqKI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/HPET: channel handling in hpet_broadcast_resume()
Message-Id: <E1wEnVr-00CsW5-1X@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:14:03 +0000

commit be6b618fd7f7501d437d6c218794f640166d769c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 12:38:15 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:38:15 2026 +0200

    x86/HPET: channel handling in hpet_broadcast_resume()
    
    The per-channel ENABLE bit is to solely be driven by hpet_enable_channel()
    and hpet_msi_{,un}mask(). It doesn't need setting immediately. Except for
    the (possible) channel put in legacy mode we don't do so during boot
    either.
    
    Instead reset ->arch.cpu_mask, to avoid msi_compose_msg() yielding an
    all-zero message (when the passed in CPU mask has no online CPUs). Nothing
    would later call msi_compose_msg() / hpet_msi_write(), and hence nothing
    would later produce a well-formed message template in
    hpet_events[].msi.msg.
    
    Fixes: 15aa6c67486c ("amd iommu: use base platform MSI implementation")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c4d51191954c53590767c26e501e6dadf923bc47
    master date: 2026-04-16 10:44:16 +0200
---
 xen/arch/x86/hpet.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index fe714ca12c..958f04fad6 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -701,12 +701,18 @@ void hpet_broadcast_resume(void)
     for ( i = 0; i < n; i++ )
     {
         if ( hpet_events[i].msi.irq >= 0 )
-            __hpet_setup_msi_irq(irq_to_desc(hpet_events[i].msi.irq));
+        {
+            struct irq_desc *desc = irq_to_desc(hpet_events[i].msi.irq);
+
+            cpumask_copy(desc->arch.cpu_mask, cpumask_of(smp_processor_id()));
+
+            __hpet_setup_msi_irq(desc);
+        }
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
         cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
-        cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
+        cfg |= HPET_TN_32BIT;
         if ( !(hpet_events[i].flags & HPET_EVT_LEGACY) )
             cfg |= HPET_TN_FSB;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:14:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:14:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285761.1566996 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnW2-0002vV-Uv; Mon, 20 Apr 2026 12:14:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285761.1566996; Mon, 20 Apr 2026 12:14: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 1wEnW2-0002vN-Rg; Mon, 20 Apr 2026 12:14:14 +0000
Received: by outflank-mailman (input) for mailman id 1285761;
 Mon, 20 Apr 2026 12:14:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnW1-0002vG-Ji
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:14:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnW1-00B7Jn-1s
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnW1-00CsWY-1o
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ky83EjxcUDNe0NPQAnI+Mjq0nKEfQ8LtktQQHE9W7KE=; b=HP5AOBUg1yIDYDCGO2hyaRSHUs
	g89ESlGBxLma7K3wyZBz3IPoKuYJlhU21RFUx0YiooTn1H1fHLzxCK5Opy/HoyM1nkIVGvf6eNmvh
	PzeSUqf2j6j99UFkaXHHLKRkFhH9+N3T/Uj3CvUsoSqEmd0Oq84KV3gUyBc1t71ux1Hk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/time: use native TSC scaling factors when TSC is not scaled
Message-Id: <E1wEnW1-00CsWY-1o@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:14:13 +0000

commit ef5c706f62eb249752b184d158194473859ef05b
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:38:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:38:31 2026 +0200

    x86/time: use native TSC scaling factors when TSC is not scaled
    
    When running HVM guest in native TSC mode avoid using the recalculated vTSC
    scaling factors based on the cpu_khz value.  Using the kHz based frequency
    leads to the TSC scaling values possibly not being the same as the ones
    used by the per CPU cpu_time->tsc_scale field, which introduces skew
    between the guest and Xen's calculations of the system time.
    
    On a 2gHz system, where the frequency is possibly detected as 1999999999Hz
    (note this is a worse-case scenario), the cpu_khz variable will be set to
    1999999kHz, and hence 999Hz cycles will be not accounted for per second.
    Over a second (the time synchronization period), this leads to a skew of:
    
    cycles * 1 / (Hz freq) = 999 / 1999999999 = 499,5ns
    
    So far this has gone unnoticed because the time synchronization rendezvous
    forces the update of the tsc_timestamp and system_time fields in the vCPU
    time info area, and hence the skew only accumulates up to the rendezvous
    period.  Attempting to remove the rendezvous causes the skew to grow
    unbounded.
    
    Fix by using the native TSC scaling values (as used by Xen) when the guest
    TSC is not scaled.
    
    Fixes: eab8a90be723 ("x86/time: scale host TSC in pvclock properly")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 305c6b901a44aa6e16d3bf7d104d7c08331d1731
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/x86/time.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bb36038e0c..d9f7772ab4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1702,17 +1702,25 @@ static void collect_time_info(const struct vcpu *v,
     else
     {
         if ( is_hvm_domain(d) && hvm_tsc_scaling_supported )
-        {
             tsc_stamp            = hvm_scale_tsc(d, t->stamp.local_tsc);
-            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
-            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
-        }
         else
-        {
             tsc_stamp            = t->stamp.local_tsc;
+
+        /*
+         * HVM guests using the native TSC ratio should use the same per-CPU
+         * scaling factors as Xen.  This ensures time keeping is always in sync
+         * between Xen and the guest.
+         */
+        if ( tsc_stamp == t->stamp.local_tsc )
+        {
             u->tsc_to_system_mul = t->tsc_scale.mul_frac;
             u->tsc_shift         = t->tsc_scale.shift;
         }
+        else
+        {
+            u->tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            u->tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
     }
 
     u->tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:14:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:14:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285762.1566997 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnWB-0002xW-VT; Mon, 20 Apr 2026 12:14:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285762.1566997; Mon, 20 Apr 2026 12:14: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 1wEnWB-0002xP-Sz; Mon, 20 Apr 2026 12:14:23 +0000
Received: by outflank-mailman (input) for mailman id 1285762;
 Mon, 20 Apr 2026 12:14:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnWB-0002xJ-MA
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:14:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnWB-00B7Jr-28
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnWB-00CsWu-23
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0TwytlCfUZAPdZI22xNR7OnJ5joBpqCl4B0Q2As4Y50=; b=aTS+e6ekOY1uOfn00j9rwtEa+X
	DfXF0S+L+j7+zF70cbRsFykpfsGPrFCEeX20jCT38irmGeTWE1rRARumBuTW4tLzJxVQyWhRegyxO
	rAb12fZrYzT/r3Ws1LWzfBv1xZD18i/HoyPBAAj0K4ByLFPf6Fd3MUeLw0F1/vpi25E4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/cpu: round cpu_khz calculations
Message-Id: <E1wEnWB-00CsWu-23@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:14:23 +0000

commit 57db4b630312efff5eb0a643476b26d70957d104
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Apr 20 12:38:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:38:52 2026 +0200

    xen/cpu: round cpu_khz calculations
    
    All arches truncate the cpu_khz without taking into account the less
    significant digits.  Instead use DIV_ROUND() when scaling from Hz to kHz
    to get as more accurate kHz value.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 986707b461eb56d75f55581dd1c8e2633f814795
    master date: 2026-04-16 15:28:32 +0200
---
 xen/arch/arm/time.c | 4 ++--
 xen/arch/x86/time.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index e74d30d258..61536081eb 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -128,7 +128,7 @@ static void __init preinit_dt_xen_time(void)
     res = dt_property_read_u32(timer, "clock-frequency", &rate);
     if ( res )
     {
-        cpu_khz = rate / 1000;
+        cpu_khz = DIV_ROUND(rate, 1000);
         validate_timer_frequency();
         timer_dt_clock_frequency = rate;
     }
@@ -146,7 +146,7 @@ void __init preinit_xen_time(void)
 
     if ( !cpu_khz )
     {
-        cpu_khz = (READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK) / 1000;
+        cpu_khz = DIV_ROUND(READ_SYSREG(CNTFRQ_EL0) & CNTFRQ_MASK, 1000);
         validate_timer_frequency();
     }
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index d9f7772ab4..0bae4ff339 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2634,7 +2634,7 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
-    cpu_khz = tmp / 1000;
+    cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 12:14:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 12:14:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285763.1567002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEnWN-0002zZ-0h; Mon, 20 Apr 2026 12:14:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285763.1567002; Mon, 20 Apr 2026 12:14: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 1wEnWM-0002zR-UL; Mon, 20 Apr 2026 12:14:34 +0000
Received: by outflank-mailman (input) for mailman id 1285763;
 Mon, 20 Apr 2026 12:14:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEnWL-0002zL-Oj
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 12:14:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnWL-00B7Jx-2N
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEnWL-00CsXG-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 12:14: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9kFqlxNavoCIbPNpn7sIaplIxf84ZHiOW1AI/F5GXY0=; b=6U8olv04CgyZy+eztF8aq3KyHo
	1N66eKcYKqdQ1jbj00JeVZo4M9XqnR+uIvI+rvmVYHk7UJvIexrxBh7Nm33XAtiFa+ziZbtdJwE4d
	010x4o2Aw06sN5o1RZXz3qPnSykqXYHfLQoTx2NLdjUUb2z50Nt5eosCXTGXMfxtsF4I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/mkelf32: Actually pad load segment to 2 MiB boundary
Message-Id: <E1wEnWL-00CsXG-2J@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 12:14:33 +0000

commit ad5d9554482739052a4a70711b21e48c02a515d1
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Apr 20 12:39:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 12:39:07 2026 +0200

    x86/mkelf32: Actually pad load segment to 2 MiB boundary
    
    Fix the code which tries to pad the load segment to 2 MiB but only pads
    it to a 1 MiB boundary.
    
    This manifests as a page fault while scrubbing RAM during boot on certain
    systems.
    
    Xen fails to mark itself as reserved in the E820 (due to spanning multiple
    regions), but does restrict the permissions in the directmap.  The region of
    RAM containing Xen is handed to physical memory manager as available for use,
    and scrubbing hit the directmap protections.
    
    Fixes: 4fb075201f54 ("x86/mkelf32: pad load segment to 2Mb boundary")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 5416c455f656af9ff3ed7f26dcd5cbf70b254f23
    master date: 2026-04-17 18:15:54 +0100
---
 xen/arch/x86/boot/mkelf32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 373ba4ddd5..469d1ba0af 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -345,7 +345,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 20) - 1) & (-1U << 20);
+    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 15:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 15:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1286291.1567384 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEqn6-0001Ah-1N; Mon, 20 Apr 2026 15:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1286291.1567384; Mon, 20 Apr 2026 15:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEqn5-0001AZ-Ul; Mon, 20 Apr 2026 15:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1286291;
 Mon, 20 Apr 2026 15:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEqn3-0001A7-UZ
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 15:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEqn3-00BBHE-2r
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 15:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEqn3-00D3wZ-2f
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 15:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UprtzvQFFnC8Zn2iKXaLViUesKeZKLQW+WR7eH0dgKU=; b=SrrpGwAvIhXgRpnWJhU1iOoiCt
	ysE7uvv0lUtlec8hFAeBtHmUx2ISs/zVASl+TmWWPCaqo/m8jCBf1ohEDKEhH5EmvfvdVJBTQ99WF
	vgmt+RsDGxNGVez2aUiZh++K3URcQGG98ke4V4E9gsl+M8WLbQpGEgeJ+J0mVKVcMRAo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] Revert "libacpi: Pass missing --dm_version to mk_dsdt"
Message-Id: <E1wEqn3-00D3wZ-2f@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 15:44:01 +0000

commit 5f7054258c6937b74aee411f16db5eb54ce9fda1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 17:31:14 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 17:31:14 2026 +0200

    Revert "libacpi: Pass missing --dm_version to mk_dsdt"
    
    This reverts commit c1a7c617f1165ac7c5f0241da3e8889ca6ff38ba. It
    shouldn't have been backported to anything earlier than 4.21.
---
 tools/libacpi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index 193ec78672..b21a64c6b4 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -51,7 +51,7 @@ $(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl  $(MK_DSDT)
 	# Remove last bracket
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
 	cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
-	$(MK_DSDT) --debug=$(debug) --maxcpu $* --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
+	$(MK_DSDT) --debug=$(debug) --maxcpu $*  >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 
 $(ACPI_BUILD_DIR)/dsdt_pvh.asl: dsdt_acpi_info.asl $(MK_DSDT)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Apr 20 19:00:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Apr 2026 19:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1286447.1567499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEtql-0007Sf-I6; Mon, 20 Apr 2026 19:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1286447.1567499; Mon, 20 Apr 2026 19:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wEtql-0007SG-FO; Mon, 20 Apr 2026 19:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1286447;
 Mon, 20 Apr 2026 19:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wEtqk-00076h-25
 for xen-changelog@lists.xenproject.org; Mon, 20 Apr 2026 19:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEtqj-00BFLH-2T
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 19:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wEtqj-00DO7w-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Apr 2026 19:00:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=19b+QBXaoJYQ1Jt4nkb8U/vTFvPm47w2JL6jecEebcI=; b=eGMhthvrcKHTYo3UagN1qerQzh
	pYYfrR0KCWUnBxsU+kzT1R9u0WLr2v68iwzoz2x9QCvWQActaoMEpRHyL5AIibfLDFiYOybRMapZ2
	5MO/VNug/xXN5CcW15IevYubr+CJtY55SamGI+2zBPd6FF5KWWFEiFoyZB4urk/QGYMY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] Revert "libacpi: Pass missing --dm_version to mk_dsdt"
Message-Id: <E1wEtqj-00DO7w-2J@xenbits.xenproject.org>
Date: Mon, 20 Apr 2026 19:00:01 +0000

commit 5f7054258c6937b74aee411f16db5eb54ce9fda1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 20 17:31:14 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 20 17:31:14 2026 +0200

    Revert "libacpi: Pass missing --dm_version to mk_dsdt"
    
    This reverts commit c1a7c617f1165ac7c5f0241da3e8889ca6ff38ba. It
    shouldn't have been backported to anything earlier than 4.21.
---
 tools/libacpi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
index 193ec78672..b21a64c6b4 100644
--- a/tools/libacpi/Makefile
+++ b/tools/libacpi/Makefile
@@ -51,7 +51,7 @@ $(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl  $(MK_DSDT)
 	# Remove last bracket
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
 	cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
-	$(MK_DSDT) --debug=$(debug) --maxcpu $* --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
+	$(MK_DSDT) --debug=$(debug) --maxcpu $*  >> $@.$(TMP_SUFFIX)
 	mv -f $@.$(TMP_SUFFIX) $@
 
 $(ACPI_BUILD_DIR)/dsdt_pvh.asl: dsdt_acpi_info.asl $(MK_DSDT)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 09:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 09:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288766.1568997 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF7ot-0000BY-Fi; Tue, 21 Apr 2026 09:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288766.1568997; Tue, 21 Apr 2026 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 1wF7ot-0000BQ-D5; Tue, 21 Apr 2026 09:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1288766;
 Tue, 21 Apr 2026 09:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF7or-0000BG-Nr
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 09:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7or-00Cfnb-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7or-00E2Qq-27
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/AhUOo1CnbAmJOkMawAHwwGafA/yaYRgZ/K9ioN78Hw=; b=g82dzIlXwJZZjLb4M5XV56XZm7
	x6eEBJ6r58qTBXo+0mC4vxro8XribzBwT0ES9VC9f6DEUKP7BhR+++MWsLkHRm8sHjTsM8H54tchR
	E8PVTlmb2dHQm3I6qYQY216DmL/KDPDrSQ/zvV0qM53spOr0cX2/WjiSdyqxRSwCu37I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs: clarify Xenstore watch depth feature
Message-Id: <E1wF7or-00E2Qq-27@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 09:55:01 +0000

commit fbcf400e72023ca068e1b728ce59c3e3b487bddb
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:04:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 09:04:48 2026 +0200

    docs: clarify Xenstore watch depth feature
    
    Make it explicit that for watching the @releaseDomain/<domid> special
    node, the XENSTORE_SERVER_FEATURE_WATCHDEPTH is needed.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/misc/xenstore.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 4eccbc2f7f..192d13264b 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -266,7 +266,8 @@ WATCH			<wpath>|<token>|[<depth>|]?
 	decimal value of 0 or larger): it denotes the directory levels
 	below <wpath> to consider for a match ("0" would not match for
 	a child of <wpath>, "1" would match only for a direct child,
-	etc.).
+	etc.).  The depth specification is possible only, if the
+	XENSTORE_SERVER_FEATURE_WATCHDEPTH feature is available.
 
 	<wpath> can be a <path> to watch or @<wspecial>.  In the
 	latter case <wspecial> may have any syntax but it matches
@@ -284,6 +285,8 @@ WATCH			<wpath>|<token>|[<depth>|]?
 	values are not supported.
 	For @releaseDomain it is possible to watch only for a specific
 	domain by specifying @releaseDomain/<domid> for the path.
+	This requires the XENSTORE_SERVER_FEATURE_WATCHDEPTH to be
+	available.
 
 	When a watch is first set up it is triggered once straight
 	away, with <path> equal to <wpath>.  Watches may be triggered
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 09:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 09:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288767.1569002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF7p2-0000DC-HX; Tue, 21 Apr 2026 09:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288767.1569002; Tue, 21 Apr 2026 09: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 1wF7p2-0000D4-EP; Tue, 21 Apr 2026 09:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1288767;
 Tue, 21 Apr 2026 09:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF7p1-0000Ct-R4
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 09:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7p1-00Cfnq-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7p1-00E2RC-2Q
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rl7rTL2Oi7z+ynFfFA6pDjfR7onhJJUxTzUe4AodHqM=; b=5XhmOabGwylQ4cCqki441i2BLI
	mUUrPvN9bKX7Bk1lqTzM1GYzDv971jvM20/b+UiJPqMVsCPcj2Q8mQNolh9i1XDZHI1+9EOLM5bcM
	JXj2xx17ANzZ2RUm519wmPvnztUKxWn0GXSjK9R+K842KM8ncQ918VRMLM2rmjYsR6TA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arinc653: don't assume Dom0 is the control domain
Message-Id: <E1wF7p1-00E2RC-2Q@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 09:55:11 +0000

commit 80f0d304a529d9f50923001dbfe5792060177a1b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 21 09:05:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 09:05:25 2026 +0200

    arinc653: don't assume Dom0 is the control domain
    
    Leaving aside highly disaggregated environments, the control domain is
    what will invoke XEN_SYSCTL_SCHEDOP_putinfo. Its vCPU-s therefore need to
    be able to run unconditionally, not those of the domain with ID 0 (which
    may not exist at all).
    
    Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/common/sched/arinc653.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 19249f6464..d8a5380557 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -411,10 +411,10 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
     spin_lock_irqsave(&sched_priv->lock, flags);
 
     /*
-     * Add every one of dom0's units to the schedule, as long as there are
-     * slots available.
+     * Add every one of the control domain's units to the schedule, as long as
+     * there are slots available.
      */
-    if ( unit->domain->domain_id == 0 )
+    if ( is_control_domain(unit->domain) && !is_idle_domain(unit->domain) )
     {
         entry = sched_priv->num_schedule_entries;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 09:55:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 09:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288768.1569005 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF7pC-0000G6-Ia; Tue, 21 Apr 2026 09:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288768.1569005; Tue, 21 Apr 2026 09: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 1wF7pC-0000Fy-Fo; Tue, 21 Apr 2026 09:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1288768;
 Tue, 21 Apr 2026 09:55:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF7pB-0000Fr-Ta
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 09:55:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7pB-00Cfoe-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7pB-00E2Ud-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nWfVkDFBxAM51KooWtcbbLwpmHUZBLxCEL/PdsoelgI=; b=mVbnO4JHKsaLRsmzonckOmj0M6
	ybOCn4JEli2Uj31sLHd0SztJbtcWUDD3nm4561MtRCRTq4plOU+CXtN0y/KoDuggvGleOb1c+GSvR
	lTRKBeF5OtMvf25rJaJ9SnOCzCDwKikb2XZUOfivqPgv9SjInkJiMLPvRKgMZmfFqQqg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: implement get_page_from_gfn()
Message-Id: <E1wF7pB-00E2Ud-2j@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 09:55:21 +0000

commit a9d885388ef160266cff81cbd55b733721d36387
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 21 09:05:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 09:05:52 2026 +0200

    xen/riscv: implement get_page_from_gfn()
    
    The function is implemented out-of-line rather than as a static inline,
    to avoid header ordering issues where struct domain is incomplete when
    asm/p2m.h is included, leading to build failures:
      In file included from ./arch/riscv/include/asm/domain.h:10,
                       from ./include/xen/domain.h:16,
                       from ./include/xen/sched.h:11,
                       from ./include/xen/event.h:12,
                       from common/cpu.c:3:
      ./arch/riscv/include/asm/p2m.h: In function 'get_page_from_gfn':
      ./arch/riscv/include/asm/p2m.h:50:33: error: invalid use of undefined type 'struct domain'
         50 | #define p2m_get_hostp2m(d) (&(d)->arch.p2m)
            |                                 ^~
      ./arch/riscv/include/asm/p2m.h:180:38: note: in expansion of macro 'p2m_get_hostp2m'
        180 |         return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
            |                                      ^~~~~~~~~~~~~~~
      make[2]: *** [Rules.mk:253: common/cpu.o] Error 1
      make[1]: *** [build.mk:72: common] Error 2
      make: *** [Makefile:623: xen] Error 2
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/p2m.h |  8 ++------
 xen/arch/riscv/p2m.c             | 13 +++++++++++++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 60f27f9b34..54ea67990f 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -164,12 +164,8 @@ typedef unsigned int p2m_query_t;
 #define P2M_ALLOC    (1u<<0)   /* Populate PoD and paged-out entries */
 #define P2M_UNSHARE  (1u<<1)   /* Break CoW sharing */
 
-static inline struct page_info *get_page_from_gfn(
-    struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
-{
-    BUG_ON("unimplemented");
-    return NULL;
-}
+struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
+                                    p2m_type_t *t, p2m_query_t q);
 
 static inline void memory_type_changed(struct domain *d)
 {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 89e5db606f..adcf292a70 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1534,3 +1534,16 @@ void p2m_handle_vmenter(void)
      * won't be reused until need_flush is set to true.
      */
 }
+
+struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
+                                    p2m_type_t *t, p2m_query_t q)
+{
+    /*
+     * System domains are domains which don't have p2m translation tables,
+     * so they can't use p2m_get_page_from_gfn() and extra care should be
+     * taken for them.
+     */
+    ASSERT(!is_system_domain(d));
+
+    return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 09:55:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 09:55:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288769.1569009 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF7pM-0000IB-K0; Tue, 21 Apr 2026 09:55:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288769.1569009; Tue, 21 Apr 2026 09: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 1wF7pM-0000I2-HJ; Tue, 21 Apr 2026 09:55:32 +0000
Received: by outflank-mailman (input) for mailman id 1288769;
 Tue, 21 Apr 2026 09:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF7pM-0000Hw-0X
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 09:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7pL-00CfqF-37
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09:55:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF7pL-00E2V7-31
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 09:55:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PbVtViA+igJmQzfvhDPAOIsT4zh34XefxcyGzNkY3FA=; b=mTFYUtLEESF4r7UxFT8PaSlYQ5
	jxrHai7HWv9lvdJXVJLQ1eWC2kRYDijkC9JsspnDTIIQCmSvniD8nkgoV5yAJ48vP5RPC59CTlpMI
	M2hi1qhLLnFTIaGdkMrM9G46fOBDUxEW/QAVobOyCq+yK129ivZKLc7//vO2TIUwsHNY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenpm: Add get-core-temp subcommand
Message-Id: <E1wF7pL-00E2V7-31@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 09:55:31 +0000

commit edb657887a602b36239c20485bac724db0a81811
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Apr 21 10:03:06 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 10:03:06 2026 +0200

    xenpm: Add get-core-temp subcommand
    
    get-core-temp allows querying the per-core CPU temperature and
    per-package one on processors that supports Digital Temperature Sensors
    (most Intel processors; as usual Dom0 drivers cannot work due to
    misalignment between Dom0 vCPU and pCPUs).
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md       |   2 +
 tools/misc/xenpm.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 122 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47b6021ce7..bb41d89997 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      mitigate (by rate-limiting) the system wide impact of an HVM guest
      misusing atomic instructions.
    - Support for CPIO microcode in discrete multiboot modules.
+   - Introduce get-core-temp command to xenpm to query CPU temperatures on
+     Intel platforms.
 
  - On Arm:
    - Support for guest suspend and resume to/from RAM via vPSCI.
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index e4902d2e82..87107bd6c6 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -32,11 +32,14 @@
 
 #include <xen-tools/common-macros.h>
 
+#include <xen/asm/msr-index.h>
+
 #define MAX_PKG_RESIDENCIES 12
 #define MAX_CORE_RESIDENCIES 8
 
 static xc_interface *xc_handle;
 static unsigned int max_cpu_nr;
+static xc_physinfo_t physinfo;
 
 /* help message */
 void show_help(void)
@@ -93,6 +96,7 @@ void show_help(void)
             "                                           units default to \"us\" if unspecified.\n"
             "                                           truncates un-representable values.\n"
             "                                           0 lets the hardware decide.\n"
+            " get-core-temp          [cpuid]      get CPU temperature for <cpuid> or all (Intel only)\n"
             " start [seconds]                     start collect Cx/Px statistics,\n"
             "                                     output after CTRL-C or SIGINT or several seconds.\n"
             " enable-turbo-mode     [cpuid]       enable Turbo Mode for processors that support it.\n"
@@ -1354,6 +1358,121 @@ void enable_turbo_mode(int argc, char *argv[])
                 errno, strerror(errno));
 }
 
+static int fetch_dts_temp(xc_interface *xch, uint32_t cpu, bool package, int *temp)
+{
+    xc_resource_entry_t entries[] = {
+        { .idx = package ? MSR_PACKAGE_THERM_STATUS : MSR_IA32_THERM_STATUS },
+        { .idx = MSR_TEMPERATURE_TARGET },
+    };
+    struct xc_resource_op ops = {
+        .cpu = cpu,
+        .entries = entries,
+        .nr_entries = ARRAY_SIZE(entries),
+    };
+    int tjmax;
+
+    int ret = xc_resource_op(xch, 1, &ops);
+
+    switch ( ret )
+    {
+    case 0:
+        /* This CPU isn't online or can't query this MSR */
+        errno = ENODATA;
+        return -1;
+
+    case 1:
+    {
+        /*
+         * The CPU doesn't support MSR_TEMPERATURE_TARGET, we assume it's 100
+         * which is correct aside a few selected Atom CPUs. Check Linux
+         * kernel's coretemp.c for more information.
+         */
+        static bool has_reported_once = false;
+
+        if ( !has_reported_once )
+        {
+            fprintf(stderr, "MSR_TEMPERATURE_TARGET is not supported, assume "
+                            "tjmax = 100, readings may be incorrect.\n");
+            has_reported_once = true;
+        }
+
+        tjmax = 100;
+        break;
+    }
+
+    case 2:
+        tjmax = (entries[1].val >> 16) & 0xff;
+        break;
+
+    default:
+        if ( ret > 0 )
+        {
+            fprintf(stderr, "Got unexpected xc_resource_op return value: %d", ret);
+            errno = EINVAL;
+        }
+        return -1;
+    }
+
+    *temp = tjmax - ((entries[0].val >> 16) & 0xff);
+    return 0;
+}
+
+static void get_core_temp(int argc, char *argv[])
+{
+    int temp = -1, cpu = -1;
+    unsigned int socket;
+    bool has_data = false;
+
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpu);
+
+    if ( cpu != -1 )
+    {
+        if ( fetch_dts_temp(xc_handle, cpu, false, &temp) )
+        {
+            fprintf(stderr, "Unable to fetch temperature (%d - %s)\n",
+                    errno, strerror(errno));
+            exit(EXIT_FAILURE);
+        }
+        else
+            printf("CPU%d: %d°C\n", cpu, temp);
+        return;
+    }
+
+    /* Per socket measurement */
+    for ( socket = 0, cpu = 0; cpu < max_cpu_nr;
+          socket++, cpu += physinfo.cores_per_socket * physinfo.threads_per_core )
+    {
+        if ( fetch_dts_temp(xc_handle, cpu, true, &temp) )
+        {
+            fprintf(stderr,
+                    "[Package%u] Unable to fetch temperature (%d - %s)\n",
+                    cpu, errno, strerror(errno));
+            /* CPU may not support package temperatures, but still support DTS */
+            break;
+        }
+
+        has_data = true;
+        printf("Package%u: %d°C\n", socket, temp);
+    }
+
+    for ( cpu = 0; cpu < max_cpu_nr; cpu += physinfo.threads_per_core )
+    {
+        if ( fetch_dts_temp(xc_handle, cpu, false, &temp) )
+        {
+            fprintf(stderr, "[CPU%d] Unable to fetch temperature (%d - %s)\n",
+                    cpu, errno, strerror(errno));
+            continue;
+        }
+
+        has_data = true;
+        printf("CPU%d: %d°C\n", cpu, temp);
+    }
+
+    if ( !has_data )
+        exit(EXIT_FAILURE);
+}
+
 void disable_turbo_mode(int argc, char *argv[])
 {
     int cpuid = -1;
@@ -1618,12 +1737,12 @@ struct {
     { "set-max-cstate", set_max_cstate_func},
     { "enable-turbo-mode", enable_turbo_mode },
     { "disable-turbo-mode", disable_turbo_mode },
+    { "get-core-temp", get_core_temp },
 };
 
 int main(int argc, char *argv[])
 {
     int i, ret = 0;
-    xc_physinfo_t physinfo;
     int nr_matches = 0;
     int matches_main_options[ARRAY_SIZE(main_options)];
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 10:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 10:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288885.1569112 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF8kx-0006vt-A9; Tue, 21 Apr 2026 10:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288885.1569112; Tue, 21 Apr 2026 10: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 1wF8kx-0006vl-7g; Tue, 21 Apr 2026 10:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1288885;
 Tue, 21 Apr 2026 10:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF8kv-0006va-Qj
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 10:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8kv-00CguB-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8kv-00E5Ft-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bd3fSuIu4KsHwAlngQ8o6yYwGqXqXevjwmLR6Sdu0ug=; b=MZOb6cHnx1BB404ogP2zSQFbdS
	fvEkt3qbnX6jKMP+Rp3pYDrlwnPdS0Vgnx79NJV9N+MvSARRMGRsONtafzZQ1sFiIt/micbUeKjnw
	RZwiq1ldmSxM7u9lPmcWe7MsDhl/19W/mwOJTJGUt+2uVwQCvWrkQ4IEOCdRkKxLwrWQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs: clarify Xenstore watch depth feature
Message-Id: <E1wF8kv-00E5Ft-2F@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 10:55:01 +0000

commit fbcf400e72023ca068e1b728ce59c3e3b487bddb
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:04:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 09:04:48 2026 +0200

    docs: clarify Xenstore watch depth feature
    
    Make it explicit that for watching the @releaseDomain/<domid> special
    node, the XENSTORE_SERVER_FEATURE_WATCHDEPTH is needed.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/misc/xenstore.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 4eccbc2f7f..192d13264b 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -266,7 +266,8 @@ WATCH			<wpath>|<token>|[<depth>|]?
 	decimal value of 0 or larger): it denotes the directory levels
 	below <wpath> to consider for a match ("0" would not match for
 	a child of <wpath>, "1" would match only for a direct child,
-	etc.).
+	etc.).  The depth specification is possible only, if the
+	XENSTORE_SERVER_FEATURE_WATCHDEPTH feature is available.
 
 	<wpath> can be a <path> to watch or @<wspecial>.  In the
 	latter case <wspecial> may have any syntax but it matches
@@ -284,6 +285,8 @@ WATCH			<wpath>|<token>|[<depth>|]?
 	values are not supported.
 	For @releaseDomain it is possible to watch only for a specific
 	domain by specifying @releaseDomain/<domid> for the path.
+	This requires the XENSTORE_SERVER_FEATURE_WATCHDEPTH to be
+	available.
 
 	When a watch is first set up it is triggered once straight
 	away, with <path> equal to <wpath>.  Watches may be triggered
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 10:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 10:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288886.1569116 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF8l7-0006xi-Bc; Tue, 21 Apr 2026 10:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288886.1569116; Tue, 21 Apr 2026 10: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 1wF8l7-0006xa-90; Tue, 21 Apr 2026 10:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1288886;
 Tue, 21 Apr 2026 10:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF8l5-0006xL-UV
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 10:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8l5-00CguF-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8l5-00E5GF-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uMHcX4IGzoPAuTSIDhmd2ZufHMlaSVU9xDSjvYuABTs=; b=z+5AmTSPwUbMAgq2hW/Wh2tidY
	PTI7BNYHFD/QpJ4yvMF9jbdS+IXC50wjLEbM5DRJkEZQaG0pJM5cmARhsnrXyAmp+i8TWL4P/Q8tW
	+uYmqttz5/2wJbSlt7bvMc9kdBwfqZGE2rx6wSHGZtgEUSKSopbHhhY0dCD/LssHbioU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arinc653: don't assume Dom0 is the control domain
Message-Id: <E1wF8l5-00E5GF-2Z@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 10:55:11 +0000

commit 80f0d304a529d9f50923001dbfe5792060177a1b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 21 09:05:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 09:05:25 2026 +0200

    arinc653: don't assume Dom0 is the control domain
    
    Leaving aside highly disaggregated environments, the control domain is
    what will invoke XEN_SYSCTL_SCHEDOP_putinfo. Its vCPU-s therefore need to
    be able to run unconditionally, not those of the domain with ID 0 (which
    may not exist at all).
    
    Fixes: 9f0c658baedc ("arinc: add cpu-pool support to scheduler")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/common/sched/arinc653.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 19249f6464..d8a5380557 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -411,10 +411,10 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
     spin_lock_irqsave(&sched_priv->lock, flags);
 
     /*
-     * Add every one of dom0's units to the schedule, as long as there are
-     * slots available.
+     * Add every one of the control domain's units to the schedule, as long as
+     * there are slots available.
      */
-    if ( unit->domain->domain_id == 0 )
+    if ( is_control_domain(unit->domain) && !is_idle_domain(unit->domain) )
     {
         entry = sched_priv->num_schedule_entries;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 10:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 10:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288887.1569120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF8lH-00070c-Er; Tue, 21 Apr 2026 10:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288887.1569120; Tue, 21 Apr 2026 10: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 1wF8lH-00070U-C7; Tue, 21 Apr 2026 10:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1288887;
 Tue, 21 Apr 2026 10:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF8lG-000708-34
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 10:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8lG-00Cgv3-00
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8lF-00E5IV-35
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6t0yvFNWRsomdDF48FHPQFDOR4T4ZpzsqlEriP1ct+E=; b=XigEWklQ4bT4eFp4qNTu0DqA81
	5zt8nRZO+RxPb49cyJkHTKSTGqujyhDXXkX71UYREybhwvfGPTnjFI81jjcc3IBvRGi51ADORq2Mk
	Rqs+kWr9GWD7WM8mF2HeGjSWZwI5ZovzsygM78ZqGq5R539UPb5ncC8kHjqUB77kWjOU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: implement get_page_from_gfn()
Message-Id: <E1wF8lF-00E5IV-35@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 10:55:21 +0000

commit a9d885388ef160266cff81cbd55b733721d36387
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Apr 21 09:05:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 09:05:52 2026 +0200

    xen/riscv: implement get_page_from_gfn()
    
    The function is implemented out-of-line rather than as a static inline,
    to avoid header ordering issues where struct domain is incomplete when
    asm/p2m.h is included, leading to build failures:
      In file included from ./arch/riscv/include/asm/domain.h:10,
                       from ./include/xen/domain.h:16,
                       from ./include/xen/sched.h:11,
                       from ./include/xen/event.h:12,
                       from common/cpu.c:3:
      ./arch/riscv/include/asm/p2m.h: In function 'get_page_from_gfn':
      ./arch/riscv/include/asm/p2m.h:50:33: error: invalid use of undefined type 'struct domain'
         50 | #define p2m_get_hostp2m(d) (&(d)->arch.p2m)
            |                                 ^~
      ./arch/riscv/include/asm/p2m.h:180:38: note: in expansion of macro 'p2m_get_hostp2m'
        180 |         return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
            |                                      ^~~~~~~~~~~~~~~
      make[2]: *** [Rules.mk:253: common/cpu.o] Error 1
      make[1]: *** [build.mk:72: common] Error 2
      make: *** [Makefile:623: xen] Error 2
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/p2m.h |  8 ++------
 xen/arch/riscv/p2m.c             | 13 +++++++++++++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 60f27f9b34..54ea67990f 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -164,12 +164,8 @@ typedef unsigned int p2m_query_t;
 #define P2M_ALLOC    (1u<<0)   /* Populate PoD and paged-out entries */
 #define P2M_UNSHARE  (1u<<1)   /* Break CoW sharing */
 
-static inline struct page_info *get_page_from_gfn(
-    struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
-{
-    BUG_ON("unimplemented");
-    return NULL;
-}
+struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
+                                    p2m_type_t *t, p2m_query_t q);
 
 static inline void memory_type_changed(struct domain *d)
 {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 89e5db606f..adcf292a70 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1534,3 +1534,16 @@ void p2m_handle_vmenter(void)
      * won't be reused until need_flush is set to true.
      */
 }
+
+struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
+                                    p2m_type_t *t, p2m_query_t q)
+{
+    /*
+     * System domains are domains which don't have p2m translation tables,
+     * so they can't use p2m_get_page_from_gfn() and extra care should be
+     * taken for them.
+     */
+    ASSERT(!is_system_domain(d));
+
+    return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 10:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 10:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288888.1569124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF8lR-00072c-G8; Tue, 21 Apr 2026 10:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288888.1569124; Tue, 21 Apr 2026 10: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 1wF8lR-00072U-Da; Tue, 21 Apr 2026 10:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1288888;
 Tue, 21 Apr 2026 10:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF8lQ-00072N-44
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 10:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8lQ-00Cgwc-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF8lQ-00E5Ks-0B
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dGBCXhIY8XUbSgqqjiyTtdPFtcuFVEyV7dneZ/oF6m4=; b=UEzCY/ScUJUMpj0xlJIgW588oi
	MDY8NV+Yf/gf3Cl+oGJxIFPk0mJ/KMah5DW4dOATpcLLs6SiAPUIiDB/JVj0euebxhANyH+zOJPz2
	pAbHsG42YHDkaUQSB2PEP5IybkrCdkkuQQKvsJ1LkvcD6MJBBbBX64s7p0cDhNE0gSWQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenpm: Add get-core-temp subcommand
Message-Id: <E1wF8lQ-00E5Ks-0B@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 10:55:32 +0000

commit edb657887a602b36239c20485bac724db0a81811
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Apr 21 10:03:06 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 10:03:06 2026 +0200

    xenpm: Add get-core-temp subcommand
    
    get-core-temp allows querying the per-core CPU temperature and
    per-package one on processors that supports Digital Temperature Sensors
    (most Intel processors; as usual Dom0 drivers cannot work due to
    misalignment between Dom0 vCPU and pCPUs).
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md       |   2 +
 tools/misc/xenpm.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 122 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47b6021ce7..bb41d89997 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      mitigate (by rate-limiting) the system wide impact of an HVM guest
      misusing atomic instructions.
    - Support for CPIO microcode in discrete multiboot modules.
+   - Introduce get-core-temp command to xenpm to query CPU temperatures on
+     Intel platforms.
 
  - On Arm:
    - Support for guest suspend and resume to/from RAM via vPSCI.
diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index e4902d2e82..87107bd6c6 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -32,11 +32,14 @@
 
 #include <xen-tools/common-macros.h>
 
+#include <xen/asm/msr-index.h>
+
 #define MAX_PKG_RESIDENCIES 12
 #define MAX_CORE_RESIDENCIES 8
 
 static xc_interface *xc_handle;
 static unsigned int max_cpu_nr;
+static xc_physinfo_t physinfo;
 
 /* help message */
 void show_help(void)
@@ -93,6 +96,7 @@ void show_help(void)
             "                                           units default to \"us\" if unspecified.\n"
             "                                           truncates un-representable values.\n"
             "                                           0 lets the hardware decide.\n"
+            " get-core-temp          [cpuid]      get CPU temperature for <cpuid> or all (Intel only)\n"
             " start [seconds]                     start collect Cx/Px statistics,\n"
             "                                     output after CTRL-C or SIGINT or several seconds.\n"
             " enable-turbo-mode     [cpuid]       enable Turbo Mode for processors that support it.\n"
@@ -1354,6 +1358,121 @@ void enable_turbo_mode(int argc, char *argv[])
                 errno, strerror(errno));
 }
 
+static int fetch_dts_temp(xc_interface *xch, uint32_t cpu, bool package, int *temp)
+{
+    xc_resource_entry_t entries[] = {
+        { .idx = package ? MSR_PACKAGE_THERM_STATUS : MSR_IA32_THERM_STATUS },
+        { .idx = MSR_TEMPERATURE_TARGET },
+    };
+    struct xc_resource_op ops = {
+        .cpu = cpu,
+        .entries = entries,
+        .nr_entries = ARRAY_SIZE(entries),
+    };
+    int tjmax;
+
+    int ret = xc_resource_op(xch, 1, &ops);
+
+    switch ( ret )
+    {
+    case 0:
+        /* This CPU isn't online or can't query this MSR */
+        errno = ENODATA;
+        return -1;
+
+    case 1:
+    {
+        /*
+         * The CPU doesn't support MSR_TEMPERATURE_TARGET, we assume it's 100
+         * which is correct aside a few selected Atom CPUs. Check Linux
+         * kernel's coretemp.c for more information.
+         */
+        static bool has_reported_once = false;
+
+        if ( !has_reported_once )
+        {
+            fprintf(stderr, "MSR_TEMPERATURE_TARGET is not supported, assume "
+                            "tjmax = 100, readings may be incorrect.\n");
+            has_reported_once = true;
+        }
+
+        tjmax = 100;
+        break;
+    }
+
+    case 2:
+        tjmax = (entries[1].val >> 16) & 0xff;
+        break;
+
+    default:
+        if ( ret > 0 )
+        {
+            fprintf(stderr, "Got unexpected xc_resource_op return value: %d", ret);
+            errno = EINVAL;
+        }
+        return -1;
+    }
+
+    *temp = tjmax - ((entries[0].val >> 16) & 0xff);
+    return 0;
+}
+
+static void get_core_temp(int argc, char *argv[])
+{
+    int temp = -1, cpu = -1;
+    unsigned int socket;
+    bool has_data = false;
+
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpu);
+
+    if ( cpu != -1 )
+    {
+        if ( fetch_dts_temp(xc_handle, cpu, false, &temp) )
+        {
+            fprintf(stderr, "Unable to fetch temperature (%d - %s)\n",
+                    errno, strerror(errno));
+            exit(EXIT_FAILURE);
+        }
+        else
+            printf("CPU%d: %d°C\n", cpu, temp);
+        return;
+    }
+
+    /* Per socket measurement */
+    for ( socket = 0, cpu = 0; cpu < max_cpu_nr;
+          socket++, cpu += physinfo.cores_per_socket * physinfo.threads_per_core )
+    {
+        if ( fetch_dts_temp(xc_handle, cpu, true, &temp) )
+        {
+            fprintf(stderr,
+                    "[Package%u] Unable to fetch temperature (%d - %s)\n",
+                    cpu, errno, strerror(errno));
+            /* CPU may not support package temperatures, but still support DTS */
+            break;
+        }
+
+        has_data = true;
+        printf("Package%u: %d°C\n", socket, temp);
+    }
+
+    for ( cpu = 0; cpu < max_cpu_nr; cpu += physinfo.threads_per_core )
+    {
+        if ( fetch_dts_temp(xc_handle, cpu, false, &temp) )
+        {
+            fprintf(stderr, "[CPU%d] Unable to fetch temperature (%d - %s)\n",
+                    cpu, errno, strerror(errno));
+            continue;
+        }
+
+        has_data = true;
+        printf("CPU%d: %d°C\n", cpu, temp);
+    }
+
+    if ( !has_data )
+        exit(EXIT_FAILURE);
+}
+
 void disable_turbo_mode(int argc, char *argv[])
 {
     int cpuid = -1;
@@ -1618,12 +1737,12 @@ struct {
     { "set-max-cstate", set_max_cstate_func},
     { "enable-turbo-mode", enable_turbo_mode },
     { "disable-turbo-mode", disable_turbo_mode },
+    { "get-core-temp", get_core_temp },
 };
 
 int main(int argc, char *argv[])
 {
     int i, ret = 0;
-    xc_physinfo_t physinfo;
     int nr_matches = 0;
     int matches_main_options[ARRAY_SIZE(main_options)];
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 12:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 12:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288942.1569164 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wF9wV-0004Y8-Kt; Tue, 21 Apr 2026 12:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288942.1569164; Tue, 21 Apr 2026 12: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 1wF9wV-0004Y0-Hu; Tue, 21 Apr 2026 12:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1288942;
 Tue, 21 Apr 2026 12:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wF9wU-0004Xu-Ca
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 12:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF9wU-00CiF6-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 12:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wF9wU-00E8S8-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 12:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2QYgdXt+eP/kO291sQjMqsKbyH70QiNcdoGvBVIwE4U=; b=WQOhKTsSOYGBpQOmlKvHTUjbHI
	aaFHCIUO73bMZ1l0YT0cljl4pWT3sgYBAjAqxla/KwMvF42XzFR/9xg8lguF6oIBfuPIPSwzazRiI
	NjnHkxh+tbivCxFJZEJG8oK0N04tTl3Z5RU7f2dg7PH7ZXMg/fK4bCdYIx4n8TV6UPzY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: allow domU to get own features
Message-Id: <E1wF9wU-00E8S8-0f@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 12:11:02 +0000

commit cb8972017cf33a39a0027e582f7ae7731fa33d52
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 11:52:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 12:06:09 2026 +0200

    tools/xenstored: allow domU to get own features
    
    Expand the XS_GET_FEATURE command to allow an unprivileged domain to
    read its own available features. While this information is available
    via the related field in the shared page used for communication with
    Xenstore, user land components of the domU would need special support
    in the related kernel driver to obtain that data. With supporting the
    XS_GET_FEATURE for that purpose, only an up to date libxenstore is
    needed.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/misc/xenstore.txt   |  9 +++++----
 tools/xenstored/core.c   |  3 +--
 tools/xenstored/domain.c | 16 +++++++++++-----
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 192d13264b..dba6471387 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -430,13 +430,14 @@ SET_FEATURE		<domid>|<value>|
 	to set a bit for a feature not being supported by the running
 	Xenstore will be denied. Providing no <domid> with the
 	GET_FEATURE command will return the features which are supported
-	by Xenstore.
+	by Xenstore for the domain issuing the command.
 
 	SET_FEATURE for a domain will be rejected after the INTRODUCE
-	command for this domain has been sent to xenstored.
+	command for this domain has been sent to xenstored. This has the
+	effect that dom0 will always have all supported features enabled.
 
-	xenstored prevents the use of GET_FEATURE and SET_FEATURE other
-	than by dom0.
+	xenstored prevents the use of GET_FEATURE with a domid specified
+	and SET_FEATURE other than by dom0.
 
 GET_QUOTA		[[<domid>|]<quota>|]	<value>|
 SET_QUOTA		[<domid>|]<quota>|<value>|
diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 4786a2a82e..807a8e6710 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2031,8 +2031,7 @@ static struct {
 	    { "SET_TARGET",    do_set_target,   XS_FLAG_PRIV },
 	[XS_RESET_WATCHES]     = { "RESET_WATCHES",     do_reset_watches },
 	[XS_DIRECTORY_PART]    = { "DIRECTORY_PART",    send_directory_part },
-	[XS_GET_FEATURE]       =
-	    { "GET_FEATURE",   do_get_feature,  XS_FLAG_PRIV },
+	[XS_GET_FEATURE]       = { "GET_FEATURE",       do_get_feature },
 	[XS_SET_FEATURE]       =
 	    { "SET_FEATURE",   do_set_feature,  XS_FLAG_PRIV },
 	[XS_GET_QUOTA]         =
diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 1684f6dee7..b0b339f569 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -1323,10 +1323,17 @@ int do_get_feature(const void *ctx, struct connection *conn,
 	char *result;
 
 	n_args = get_strings(in, vec, ARRAY_SIZE(vec));
-	if (n_args > 1)
-		return EINVAL;
 
-	if (n_args == 1) {
+	if (!n_args) {
+		features = conn->domain ? conn->domain->features
+					: XENSTORE_FEATURES;
+	} else {
+		if (domain_is_unprivileged(conn))
+			return EACCES;
+
+		if (n_args > 1)
+			return EINVAL;
+
 		domid = parse_domid(vec[0]);
 		if (errno)
 			return errno;
@@ -1334,8 +1341,7 @@ int do_get_feature(const void *ctx, struct connection *conn,
 		if (!domain)
 			return ENOENT;
 		features = domain->features;
-	} else
-		features = XENSTORE_FEATURES;
+	}
 
 	result = talloc_asprintf(ctx, "%u", features);
 	if (!result)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 12:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 12:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288957.1569177 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFASS-00012G-2K; Tue, 21 Apr 2026 12:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288957.1569177; Tue, 21 Apr 2026 12:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFASR-000128-W0; Tue, 21 Apr 2026 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1288957;
 Tue, 21 Apr 2026 12:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFASQ-000122-An
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFASQ-00Cilf-0u
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFASQ-00EA7X-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 12:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RmkkO6JuUOFHOelIG9OQ2iYvvPz6D+gvPkEmAKsZGgE=; b=gibFGlbtD5BTpN6SzjjPoEx8cN
	gM9MtF2a9gaRgXYwqkVUMWgBle4MX8PURkH/RDPIa8QJUFiZewMz67mBp7uHTVdEWWQvf8WxZR8SI
	ekVlS9D1+THJKa/7cAkpZKQU2ZNp8XZBTqFVoNJmm6TcB57yVzEAS98EH6faC0sSfyXs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/apic: Fix asm() constraints in TMICT calculation
Message-Id: <E1wFASQ-00EA7X-0n@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 12:44:02 +0000

commit 207e11f04f0f26120c5aedb916cdf5aeac751e74
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 20 18:17:35 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 21 13:33:30 2026 +0100

    x86/apic: Fix asm() constraints in TMICT calculation
    
    The encoded MUL is 64 bits, so writes %rdx too.  At a minimum, this needs
    expressing as a clobber.
    
    Also fix a logical disconnect between 'overflow' being the carry flag not the
    overflow flag.  CF and OF are always the same for MUL instructions, but update
    the variable name to match the flag being checked.
    
    Fixes: d5c70a51bfbe ("x86/APIC: handle overflow in TMICT calculation")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/apic.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index daf597ed44..bee3785eb0 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1313,14 +1313,15 @@ int reprogram_timer(s_time_t timeout)
     if ( timeout && ((expire = timeout - NOW()) > 0) )
     {
         unsigned long product;
-        bool overflow;
+        bool carry;
 
         apic_tmict = UINT32_MAX;
         asm ( "mul %[expire]\n\t"
               ASM_FLAG_OUT(, "setc %[cf]")
-              : "=a" (product), [cf] ASM_FLAG_OUT("=@ccc", "=qm") (overflow)
-              : "0" ((unsigned long)bus_scale), [expire] "r" (expire) );
-        if ( !overflow &&
+              : "=&a" (product), [cf] ASM_FLAG_OUT("=@ccc", "=qm") (carry)
+              : "0" ((unsigned long)bus_scale), [expire] "r" (expire)
+              : "rdx" );
+        if ( !carry &&
              (product >>= BUS_SCALE_SHIFT) < apic_tmict )
             apic_tmict = product;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 13:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1288959.1569185 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFAsZ-0005eP-Sh; Tue, 21 Apr 2026 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1288959.1569185; Tue, 21 Apr 2026 13:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFAsZ-0005eH-Q0; Tue, 21 Apr 2026 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1288959;
 Tue, 21 Apr 2026 13:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFAsY-0005eB-Ct
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 13:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFAsY-00CjGh-0v
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFAsY-00EB4u-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 13:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7us4DyXaZqGsmE9yoFnpOUI1j9fZ5p786DA4g+dxDlw=; b=ZCSn0H4FlWvYe4YDvRnhoM2lnP
	fmhtYBZoL5x8YaaYboSCdkKfynH4Qu7QzKimNEVf4Ty1NyNXFAM01QBC8OyRJWWYZfHmNsiOjKkEI
	gmmxPAeFEey0b+Ukt1gV9LjqsoUgLuZiRa4Q9vsORhcJYJ7Gk3ddzFd3vyvYYKhCZUaE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: allow domU to get own features
Message-Id: <E1wFAsY-00EB4u-0j@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 13:11:02 +0000

commit cb8972017cf33a39a0027e582f7ae7731fa33d52
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 11:52:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 21 12:06:09 2026 +0200

    tools/xenstored: allow domU to get own features
    
    Expand the XS_GET_FEATURE command to allow an unprivileged domain to
    read its own available features. While this information is available
    via the related field in the shared page used for communication with
    Xenstore, user land components of the domU would need special support
    in the related kernel driver to obtain that data. With supporting the
    XS_GET_FEATURE for that purpose, only an up to date libxenstore is
    needed.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/misc/xenstore.txt   |  9 +++++----
 tools/xenstored/core.c   |  3 +--
 tools/xenstored/domain.c | 16 +++++++++++-----
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index 192d13264b..dba6471387 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -430,13 +430,14 @@ SET_FEATURE		<domid>|<value>|
 	to set a bit for a feature not being supported by the running
 	Xenstore will be denied. Providing no <domid> with the
 	GET_FEATURE command will return the features which are supported
-	by Xenstore.
+	by Xenstore for the domain issuing the command.
 
 	SET_FEATURE for a domain will be rejected after the INTRODUCE
-	command for this domain has been sent to xenstored.
+	command for this domain has been sent to xenstored. This has the
+	effect that dom0 will always have all supported features enabled.
 
-	xenstored prevents the use of GET_FEATURE and SET_FEATURE other
-	than by dom0.
+	xenstored prevents the use of GET_FEATURE with a domid specified
+	and SET_FEATURE other than by dom0.
 
 GET_QUOTA		[[<domid>|]<quota>|]	<value>|
 SET_QUOTA		[<domid>|]<quota>|<value>|
diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 4786a2a82e..807a8e6710 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2031,8 +2031,7 @@ static struct {
 	    { "SET_TARGET",    do_set_target,   XS_FLAG_PRIV },
 	[XS_RESET_WATCHES]     = { "RESET_WATCHES",     do_reset_watches },
 	[XS_DIRECTORY_PART]    = { "DIRECTORY_PART",    send_directory_part },
-	[XS_GET_FEATURE]       =
-	    { "GET_FEATURE",   do_get_feature,  XS_FLAG_PRIV },
+	[XS_GET_FEATURE]       = { "GET_FEATURE",       do_get_feature },
 	[XS_SET_FEATURE]       =
 	    { "SET_FEATURE",   do_set_feature,  XS_FLAG_PRIV },
 	[XS_GET_QUOTA]         =
diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 1684f6dee7..b0b339f569 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -1323,10 +1323,17 @@ int do_get_feature(const void *ctx, struct connection *conn,
 	char *result;
 
 	n_args = get_strings(in, vec, ARRAY_SIZE(vec));
-	if (n_args > 1)
-		return EINVAL;
 
-	if (n_args == 1) {
+	if (!n_args) {
+		features = conn->domain ? conn->domain->features
+					: XENSTORE_FEATURES;
+	} else {
+		if (domain_is_unprivileged(conn))
+			return EACCES;
+
+		if (n_args > 1)
+			return EINVAL;
+
 		domid = parse_domid(vec[0]);
 		if (errno)
 			return errno;
@@ -1334,8 +1341,7 @@ int do_get_feature(const void *ctx, struct connection *conn,
 		if (!domain)
 			return ENOENT;
 		features = domain->features;
-	} else
-		features = XENSTORE_FEATURES;
+	}
 
 	result = talloc_asprintf(ctx, "%u", features);
 	if (!result)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 21 13:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Apr 2026 13:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289000.1569234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFBZA-0005oZ-20; Tue, 21 Apr 2026 13:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289000.1569234; Tue, 21 Apr 2026 13: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 1wFBZ9-0005oS-VE; Tue, 21 Apr 2026 13:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1289000;
 Tue, 21 Apr 2026 13:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFBZ8-0005na-9S
 for xen-changelog@lists.xenproject.org; Tue, 21 Apr 2026 13:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFBZ8-00CjzB-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 13:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFBZ8-00EDKq-0N
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4Dz+QbMsvrii6nalM6MjoIhJbXtsN8w8693NRKv5Ef4=; b=SbHKnvjBSQHm16C6AwkbNtyUEw
	r8ZddXomeeyNbjeVV5hLdeyE0W5MjIV0SLRuWogRt122svWAmCpD9QLgDfCP6kwR3fZTTVTtINJT6
	wRH0KM6xKpFKMbC3yIOlEWCr7xypUQiHer9OCQr2uv3+W5B2IsaQ+FraxDHyvacdmdqI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/apic: Fix asm() constraints in TMICT calculation
Message-Id: <E1wFBZ8-00EDKq-0N@xenbits.xenproject.org>
Date: Tue, 21 Apr 2026 13:55:02 +0000

commit 207e11f04f0f26120c5aedb916cdf5aeac751e74
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Apr 20 18:17:35 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 21 13:33:30 2026 +0100

    x86/apic: Fix asm() constraints in TMICT calculation
    
    The encoded MUL is 64 bits, so writes %rdx too.  At a minimum, this needs
    expressing as a clobber.
    
    Also fix a logical disconnect between 'overflow' being the carry flag not the
    overflow flag.  CF and OF are always the same for MUL instructions, but update
    the variable name to match the flag being checked.
    
    Fixes: d5c70a51bfbe ("x86/APIC: handle overflow in TMICT calculation")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/apic.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index daf597ed44..bee3785eb0 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1313,14 +1313,15 @@ int reprogram_timer(s_time_t timeout)
     if ( timeout && ((expire = timeout - NOW()) > 0) )
     {
         unsigned long product;
-        bool overflow;
+        bool carry;
 
         apic_tmict = UINT32_MAX;
         asm ( "mul %[expire]\n\t"
               ASM_FLAG_OUT(, "setc %[cf]")
-              : "=a" (product), [cf] ASM_FLAG_OUT("=@ccc", "=qm") (overflow)
-              : "0" ((unsigned long)bus_scale), [expire] "r" (expire) );
-        if ( !overflow &&
+              : "=&a" (product), [cf] ASM_FLAG_OUT("=@ccc", "=qm") (carry)
+              : "0" ((unsigned long)bus_scale), [expire] "r" (expire)
+              : "rdx" );
+        if ( !carry &&
              (product >>= BUS_SCALE_SHIFT) < apic_tmict )
             apic_tmict = product;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289979.1569634 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSqR-0002nH-GF; Wed, 22 Apr 2026 08:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289979.1569634; Wed, 22 Apr 2026 08:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSqR-0002n9-DS; Wed, 22 Apr 2026 08:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1289979;
 Wed, 22 Apr 2026 08:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSqQ-0002n3-4v
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqQ-00ED35-0E
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqP-00F7ol-38
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V/AjUeem3t0vz6kkE3tjTLGRWqTnw5Z+rJ08uzIGcrI=; b=5roJ4aQAOk7GbxyXk4u3K3BBH5
	u38HZ+lnMcDdSfu7O8q/QV81bBt+BfAkBrLk6r1fXvMHXh+oQyV4Cd4BLfSg/GCGEs3yiNvnc07vA
	ptBHEKtH6gjYPO0Sx+r8PP70b4gOb/56QE+TY8iLPtEwmTehAo6UKhH/DRXPkKdvDHdg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/store: add support to use watches with a depth parameter
Message-Id: <E1wFSqP-00F7ol-38@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:22:01 +0000

commit 27d908e74edcc7145dd0be61f8aa5978fd42df63
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:57:44 2026 +0200

    tools/libs/store: add support to use watches with a depth parameter
    
    Add a new xs_watch_depth() function to libxenstore allowing to limit
    the scope of a Xenstore watch. It can be used only in case Xenstore is
    supporting the XENSTORE_SERVER_FEATURE_WATCHDEPTH feature.
    
    For convenience add a xs_watch_try_depth() wrapper, which will call
    xs_watch_depth() if supported and xs_watch() otherwise.
    
    Cache the supported features of Xenstore in order not having to get
    them from Xenstore for each call of one of the new functions.
    
    While touching xs.c fix a whitespace issue there.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/man/xl.cfg.5.pod.in         |   6 +++
 tools/include/xenstore.h         |  16 ++++++
 tools/libs/store/libxenstore.map |   2 +
 tools/libs/store/xs.c            | 102 ++++++++++++++++++++++++++++++++++-----
 xen/include/public/io/xs_wire.h  |   2 +
 5 files changed, 116 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3aac0bc4fb..2f77016ecf 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -740,6 +740,12 @@ Xenstore is capable to reconnect to a guest.
 Xenstore will present an error value in case it disconnects due to an error
 condition.
 
+=item B<0x00000004>
+
+Xenstore supports to set watches with a limited depth (depth 0 matches
+only the watched node, depth 1 matches the node and its direct children,
+etc.).
+
 =back
 
 The features supported by the running Xenstore instance can be retrieved
diff --git a/tools/include/xenstore.h b/tools/include/xenstore.h
index bf6d767a22..9422ed5657 100644
--- a/tools/include/xenstore.h
+++ b/tools/include/xenstore.h
@@ -177,6 +177,22 @@ bool xs_set_permissions(struct xs_handle *h, xs_transaction_t t,
  */
 bool xs_watch(struct xs_handle *h, const char *path, const char *token);
 
+/* Same as xs_watch(), but with limiting the matching for modified
+ * children to a specified depth (depth 0 only matches the node itself,
+ * depth 1 will additionally match direct children of the node, etc.).
+ * Only supported if the XENSTORE_SERVER_FEATURE_WATCHDEPTH (4) is set
+ * in the returned features of xs_get_features_supported().
+ */
+bool xs_watch_depth(struct xs_handle *h, const char *path, const char *token,
+		    unsigned int depth);
+
+/* If supported, same as xs_watch_depth(), use xs_watch() otherwise.
+ * As a result watches might trigger for nodes below the watched path, too.
+ * Not to be used for special watches!
+ */
+bool xs_watch_try_depth(struct xs_handle *h, const char *path,
+			const char *token, unsigned int depth);
+
 /* Return the FD to poll on to see if a watch has fired. */
 int xs_fileno(struct xs_handle *h);
 
diff --git a/tools/libs/store/libxenstore.map b/tools/libs/store/libxenstore.map
index a08ddd549f..7067068998 100644
--- a/tools/libs/store/libxenstore.map
+++ b/tools/libs/store/libxenstore.map
@@ -52,4 +52,6 @@ VERS_4.2 {
 		xs_set_global_quota;
 		xs_get_domain_quota;
 		xs_set_domain_quota;
+		xs_watch_depth;
+		xs_watch_try_depth;
 } VERS_4.1;
diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index 06462445e0..cb3508a86a 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -984,16 +984,8 @@ bool xs_restrict(struct xs_handle *h, unsigned domid)
 	return false;
 }
 
-/* Watch a node for changes (poll on fd to detect, or call read_watch()).
- * When the node (or any child) changes, fd will become readable.
- * Token is returned when watch is read, to allow matching.
- * Returns false on failure.
- */
-bool xs_watch(struct xs_handle *h, const char *path, const char *token)
+static bool xs_watch_helper(struct xs_handle *h)
 {
-	struct xsd_sockmsg msg = { .type = XS_WATCH };
-	struct iovec iov[3];
-
 #ifdef USE_PTHREAD
 #define DEFAULT_THREAD_STACKSIZE (16 * 1024)
 /* NetBSD doesn't have PTHREAD_STACK_MIN. */
@@ -1001,8 +993,8 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 # define PTHREAD_STACK_MIN 0
 #endif
 
-#define READ_THREAD_STACKSIZE 					\
-	((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ? 	\
+#define READ_THREAD_STACKSIZE					\
+	((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ?	\
 	 PTHREAD_STACK_MIN : DEFAULT_THREAD_STACKSIZE)
 
 	/* We dynamically create a reader thread on demand. */
@@ -1050,16 +1042,89 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 	mutex_unlock(&h->request_mutex);
 #endif
 
+	return true;
+}
+
+/* Watch a node for changes (poll on fd to detect, or call read_watch()).
+ * When the node (or any child) changes, fd will become readable.
+ * Token is returned when watch is read, to allow matching.
+ * Returns false on failure.
+ */
+bool xs_watch(struct xs_handle *h, const char *path, const char *token)
+{
+	struct xsd_sockmsg msg = { .type = XS_WATCH };
+	struct iovec iov[3];
+
+	if (!xs_watch_helper(h))
+		return false;
+
+	iov[0].iov_base = &msg;
+	iov[0].iov_len  = sizeof(msg);
+	iov[1].iov_base = (void *)path;
+	iov[1].iov_len  = strlen(path) + 1;
+	iov[2].iov_base = (void *)token;
+	iov[2].iov_len  = strlen(token) + 1;
+
+	return xs_bool(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL));
+}
+
+/* Same as xs_watch(), but with limiting the matching for modified
+ * children to a specified depth (depth 0 only matches the node itself,
+ * depth 1 will additionally match direct children of the node, etc.).
+ * Only supported if the XENSTORE_SERVER_FEATURE_WATCHDEPTH (4) is set
+ * in the returned features of xs_get_features_supported().
+ */
+bool xs_watch_depth(struct xs_handle *h, const char *path, const char *token,
+		    unsigned int depth)
+{
+	struct xsd_sockmsg msg = { .type = XS_WATCH };
+	struct iovec iov[4];
+	char depthstr[MAX_STRLEN(depth)];
+	static bool depth_supported;
+
+	if (!xs_watch_helper(h))
+		return false;
+
+	if (!depth_supported) {
+		unsigned int features;
+
+		if (!xs_get_features_supported(h, &features))
+			return false;
+		if (!(features & XENSTORE_SERVER_FEATURE_WATCHDEPTH))
+			return false;
+		depth_supported = true;
+	}
+
+	snprintf(depthstr, sizeof(depthstr), "%u", depth);
+
 	iov[0].iov_base = &msg;
 	iov[0].iov_len  = sizeof(msg);
 	iov[1].iov_base = (void *)path;
 	iov[1].iov_len  = strlen(path) + 1;
 	iov[2].iov_base = (void *)token;
 	iov[2].iov_len  = strlen(token) + 1;
+	iov[3].iov_base = depthstr;
+	iov[3].iov_len = strlen(depthstr) + 1;
 
 	return xs_bool(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL));
 }
 
+/* If supported, same as xs_watch_depth(), use xs_watch() otherwise.
+ * As a result watches might trigger for nodes below the watched path, too.
+ * Not to be used for special watches!
+ */
+bool xs_watch_try_depth(struct xs_handle *h, const char *path,
+			const char *token, unsigned int depth)
+{
+	unsigned int features;
+
+	if (xs_get_features_supported(h, &features) &&
+	    (features & XENSTORE_SERVER_FEATURE_WATCHDEPTH) &&
+	    xs_watch_depth(h, path, token, depth))
+		return true;
+
+	return xs_watch(h, path, token);
+}
 
 /* Clear the pipe token if there are no more pending watchs.
  * We suppose the watch_mutex is already taken.
@@ -1420,13 +1485,26 @@ static bool xs_uint(char *reply, unsigned int *uintval)
 
 bool xs_get_features_supported(struct xs_handle *h, unsigned int *features)
 {
+	static unsigned int own_features = 0;
+	static bool features_valid = false;
 	struct xsd_sockmsg msg = { .type = XS_GET_FEATURE };
 	struct iovec iov[1];
 
+	if (features_valid) {
+		*features = own_features;
+		return true;
+	}
+
 	iov[0].iov_base = &msg;
 	iov[0].iov_len  = sizeof(msg);
 
-	return xs_uint(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL), features);
+	if (!xs_uint(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL), &own_features))
+		return false;
+
+	features_valid = true;
+	*features = own_features;
+
+	return true;
 }
 
 bool xs_get_features_domain(struct xs_handle *h, unsigned int domid,
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index d2e2b8b9eb..2e763bc877 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -124,6 +124,8 @@ struct xenstore_domain_interface {
 #define XENSTORE_SERVER_FEATURE_RECONNECTION 1
 /* The presence of the "error" field in the ring page */
 #define XENSTORE_SERVER_FEATURE_ERROR        2
+/* The XS_WATCH command can be used with a <depth> parameter */
+#define XENSTORE_SERVER_FEATURE_WATCHDEPTH   4
 
 /* Valid values for the connection field */
 #define XENSTORE_CONNECTED 0 /* the steady-state */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289980.1569637 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSqb-0002p5-HU; Wed, 22 Apr 2026 08:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289980.1569637; Wed, 22 Apr 2026 08:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSqb-0002oy-Es; Wed, 22 Apr 2026 08:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1289980;
 Wed, 22 Apr 2026 08:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSqa-0002oq-6b
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqa-00ED3H-0Y
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqa-00F7pP-0P
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JnV+f/7+S/cDyIrE3HLCnEIjzA71n+uitCaK0i+jUoo=; b=RFz1suamvxqvveX7SdVYStxuyN
	uRBLXWxgRiau3Xb1evwp14d+qGIOKNDqBoDV6R3LNkP88IYPca/qwmqdtt54y8lfyrFDdsyFNLFBt
	krxJ1IpCMsLwq0v4FHKl9Vb4h8/vtL0TFh8es/QiOEKPSy3UW1i6O0kIpIxQYUEK6fHg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: add depth information to watches
Message-Id: <E1wFSqa-00F7pP-0P@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:22:12 +0000

commit db98de120cb829f1827b8056df3b53f440b95186
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:06 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:13 2026 +0200

    tools/xenstored: add depth information to watches
    
    Add the depth for matching subdirectories of a watch to the watch
    handling. A depth value of -1 is used for the current model of no
    limit.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/lu.c    |   3 ++
 tools/xenstored/watch.c | 110 +++++++++++++++++++++++++++++++++---------------
 tools/xenstored/watch.h |   1 +
 3 files changed, 81 insertions(+), 33 deletions(-)

diff --git a/tools/xenstored/lu.c b/tools/xenstored/lu.c
index eaffdbc69e..7d9f086a59 100644
--- a/tools/xenstored/lu.c
+++ b/tools/xenstored/lu.c
@@ -183,6 +183,9 @@ void lu_read_state(void)
 		case XS_STATE_TYPE_WATCH:
 			read_state_watch(ctx, state.buf);
 			break;
+		case XS_STATE_TYPE_WATCH_EXT:
+			read_state_watch_ext(ctx, state.buf);
+			break;
 		case XS_STATE_TYPE_TA:
 			xprintf("live-update: ignore transaction record\n");
 			break;
diff --git a/tools/xenstored/watch.c b/tools/xenstored/watch.c
index becb9c339d..42e24d3201 100644
--- a/tools/xenstored/watch.c
+++ b/tools/xenstored/watch.c
@@ -39,26 +39,35 @@ struct watch
 	/* Offset into path for skipping prefix (used for relative paths). */
 	unsigned int prefix_len;
 
+	int depth;	/* -1: no depth limit. */
 	char *token;
 	char *node;
 };
 
 /* Is child a subnode of parent, or equal? */
-static bool is_child(const char *child, const char *parent)
+static bool is_child(const char *child, const char *parent, int depth)
 {
-	unsigned int len = strlen(parent);
-
-	/*
-	 * / should really be "" for this algorithm to work, but that's a
-	 * usability nightmare.
-	 */
-	if (streq(parent, "/"))
-		return true;
+	unsigned int len = strlen(parent);	/* len == 1 if parent is "/". */
+	unsigned int sub_levels = (len == 1) ? 1 : 0;
 
 	if (strncmp(child, parent, len) != 0)
 		return false;
 
-	return child[len] == '/' || child[len] == '\0';
+	if (child[len] != '/' && child[len] != '\0' && len > 1)
+		return false;
+
+	if (depth < 0 || child[len] == '\0')
+		return true;
+
+	while (sub_levels <= depth) {
+		if (child[len] == '\0')
+			return true;
+		if (child[len] == '/')
+			sub_levels++;
+		len++;
+	}
+
+	return false;
 }
 
 static const char *get_watch_path(const struct watch *watch, const char *name)
@@ -145,7 +154,7 @@ void fire_watches(struct connection *conn, const void *ctx, const char *name,
 						   get_watch_path(watch, name),
 						   watch->token);
 			} else {
-				if (is_child(name, watch->node))
+				if (is_child(name, watch->node, watch->depth))
 					send_event(req, i,
 						   get_watch_path(watch, name),
 						   watch->token);
@@ -170,7 +179,7 @@ static int check_watch_path(struct connection *conn, const void *ctx,
 }
 
 static struct watch *add_watch(struct connection *conn, const char *path,
-			       const char *token, bool relative,
+			       const char *token, int depth, bool relative,
 			       bool no_quota_check)
 {
 	struct watch *watch;
@@ -178,6 +187,7 @@ static struct watch *add_watch(struct connection *conn, const char *path,
 	watch = talloc(conn, struct watch);
 	if (!watch)
 		goto nomem;
+	watch->depth = depth;
 	watch->node = talloc_strdup(watch, path);
 	watch->token = talloc_strdup(watch, token);
 	if (!watch->node || !watch->token)
@@ -204,6 +214,7 @@ int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 {
 	struct watch *watch;
 	const char *vec[2];
+	int depth = -1;
 	bool relative;
 
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
@@ -223,7 +234,7 @@ int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 	if (domain_quota_add_exceeds(conn->domain, ACC_WATCH, 1))
 		return ENOSPC;
 
-	watch = add_watch(conn, vec[0], vec[1], relative, false);
+	watch = add_watch(conn, vec[0], vec[1], depth, relative, false);
 	if (!watch)
 		return errno;
 
@@ -287,28 +298,47 @@ const char *dump_state_watches(FILE *fp, struct connection *conn,
 	const char *ret = NULL;
 	struct watch *watch;
 	struct xs_state_watch sw;
+	struct xs_state_watch_ext swe;
 	struct xs_state_record_header head;
 	const char *path;
-
-	head.type = XS_STATE_TYPE_WATCH;
+	size_t path_len, token_len;
 
 	list_for_each_entry(watch, &conn->watches, list) {
-		head.length = sizeof(sw);
-
-		sw.conn_id = conn_id;
 		path = get_watch_path(watch, watch->node);
-		sw.path_length = strlen(path) + 1;
-		sw.token_length = strlen(watch->token) + 1;
-		head.length += sw.path_length + sw.token_length;
+		path_len = strlen(path) + 1;
+		token_len = strlen(watch->token) + 1;
+
+		if (watch->depth >= 0) {
+			head.type = XS_STATE_TYPE_WATCH_EXT;
+			head.length = sizeof(swe);
+			swe.conn_id = conn_id;
+			swe.path_length = path_len;
+			swe.token_length = token_len;
+			swe.depth = watch->depth;
+		} else {
+			head.type = XS_STATE_TYPE_WATCH;
+			head.length = sizeof(sw);
+			sw.conn_id = conn_id;
+			sw.path_length = path_len;
+			sw.token_length = token_len;
+		}
+
+		head.length += path_len + token_len;
 		head.length = ROUNDUP(head.length, 3);
 		if (fwrite(&head, sizeof(head), 1, fp) != 1)
 			return "Dump watch state error";
-		if (fwrite(&sw, sizeof(sw), 1, fp) != 1)
-			return "Dump watch state error";
 
-		if (fwrite(path, sw.path_length, 1, fp) != 1)
+		if (watch->depth >= 0) {
+			if (fwrite(&swe, sizeof(sw), 1, fp) != 1)
+				return "Dump watch state ext error";
+		} else {
+			if (fwrite(&sw, sizeof(sw), 1, fp) != 1)
+				return "Dump watch state error";
+		}
+
+		if (fwrite(path, path_len, 1, fp) != 1)
 			return "Dump watch path error";
-		if (fwrite(watch->token, sw.token_length, 1, fp) != 1)
+		if (fwrite(watch->token, token_len, 1, fp) != 1)
 			return "Dump watch token error";
 
 		ret = dump_state_align(fp);
@@ -319,27 +349,41 @@ const char *dump_state_watches(FILE *fp, struct connection *conn,
 	return ret;
 }
 
-void read_state_watch(const void *ctx, const void *state)
+static void process_state_watch(const void *ctx, unsigned int conn_id,
+				const char *path, const char *token,
+				int depth)
 {
-	const struct xs_state_watch *sw = state;
 	struct connection *conn;
-	const char *path, *token;
 	bool relative;
 
-	conn = get_connection_by_id(sw->conn_id);
+	conn = get_connection_by_id(conn_id);
 	if (!conn)
 		barf("connection not found for read watch");
 
-	path = (char *)sw->data;
-	token = path + sw->path_length;
-
 	/* Don't check success, we want the relative information only. */
 	check_watch_path(conn, ctx, &path, &relative);
 	if (!path)
 		barf("allocation error for read watch");
 
-	if (!add_watch(conn, path, token, relative, true))
+	if (!add_watch(conn, path, token, depth, relative, true))
 		barf("error adding watch");
+
+}
+
+void read_state_watch(const void *ctx, const void *state)
+{
+	const struct xs_state_watch *sw = state;
+
+	process_state_watch(ctx, sw->conn_id, (char *)sw->data,
+			    (char *)sw->data + sw->path_length, -1);
+}
+
+void read_state_watch_ext(const void *ctx, const void *state)
+{
+	const struct xs_state_watch_ext *swe = state;
+
+	process_state_watch(ctx, swe->conn_id, (char *)swe->data,
+			    (char *)swe->data + swe->path_length, swe->depth);
 }
 
 /*
diff --git a/tools/xenstored/watch.h b/tools/xenstored/watch.h
index d9ac6a334a..afdfdc6b2f 100644
--- a/tools/xenstored/watch.h
+++ b/tools/xenstored/watch.h
@@ -37,5 +37,6 @@ const char *dump_state_watches(FILE *fp, struct connection *conn,
 			       unsigned int conn_id);
 
 void read_state_watch(const void *ctx, const void *state);
+void read_state_watch_ext(const void *ctx, const void *state);
 
 #endif /* _XENSTORED_WATCH_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289981.1569642 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSql-0002tO-K8; Wed, 22 Apr 2026 08:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289981.1569642; Wed, 22 Apr 2026 08: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 1wFSql-0002tG-Hc; Wed, 22 Apr 2026 08:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1289981;
 Wed, 22 Apr 2026 08:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSqk-0002t7-9n
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqk-00ED3V-0s
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqk-00F7pn-0j
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mjz2RmT6YX5YpFtr+2n/PFdr1jaIBsHNFlhOclYMXgc=; b=FRRaCQuOkV1heiW3MAXY6sA21F
	mW92Drq2WNlFg1WK6DlP+gm23oG89gDHhuYkLde+InU8j2P4shwnvnm1nE+uxPbcDfH7PD4MpEhRz
	jHmotqXAjKrNjqh5qFxiPthMUyEqj+bokQJwYP0LqkDHc4GjRhuC2CgZiMRAXvjWhwN4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: add depth handling to XS_WATCH
Message-Id: <E1wFSqk-00F7pn-0j@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:22:22 +0000

commit 7d96cab925159e05a2404d16a5aea0af05db6fba
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:18 2026 +0200

    tools/xenstored: add depth handling to XS_WATCH
    
    In case XENSTORE_SERVER_FEATURE_WATCHDEPTH is set, allow XS_WATCH to
    have "depth" as 3rd parameter.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/domain.c |  8 ++++++++
 tools/xenstored/domain.h |  2 ++
 tools/xenstored/watch.c  | 11 +++++++++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index b0b339f569..7f2fa16cf2 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -390,6 +390,14 @@ void wrl_apply_debit_trans_commit(struct connection *conn)
 	wrl_apply_debit_actual(conn->domain);
 }
 
+bool feature_available(const struct connection *conn, unsigned int feature)
+{
+	if (!conn->domain)
+		return XENSTORE_FEATURES & feature;
+
+	return conn->domain->features & feature;
+}
+
 static unsigned int domain_get_soft_quota(struct domain *d, enum accitem what)
 {
 	if (d && d->acc[what].val[Q_IDX_SOFT] != Q_VAL_DISABLED)
diff --git a/tools/xenstored/domain.h b/tools/xenstored/domain.h
index ca38b5e0ea..b1cfb5cd82 100644
--- a/tools/xenstored/domain.h
+++ b/tools/xenstored/domain.h
@@ -188,4 +188,6 @@ struct hashtable *domain_check_acc_init(void);
 void domain_check_acc_add(const struct node *node, struct hashtable *domains);
 void domain_check_acc(struct hashtable *domains);
 
+bool feature_available(const struct connection *conn, unsigned int feature);
+
 #endif /* _XENSTORED_DOMAIN_H */
diff --git a/tools/xenstored/watch.c b/tools/xenstored/watch.c
index 42e24d3201..860c219f29 100644
--- a/tools/xenstored/watch.c
+++ b/tools/xenstored/watch.c
@@ -213,11 +213,18 @@ static struct watch *add_watch(struct connection *conn, const char *path,
 int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 {
 	struct watch *watch;
-	const char *vec[2];
+	const char *vec[3];
+	unsigned int n_pars;
 	int depth = -1;
 	bool relative;
 
-	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
+	n_pars = get_strings(in, vec, ARRAY_SIZE(vec));
+	if (n_pars == 3 &&
+	    feature_available(conn, XENSTORE_SERVER_FEATURE_WATCHDEPTH)) {
+		depth = atoi(vec[2]);
+		if (depth < 0)
+			return EINVAL;
+	} else if (n_pars != 2)
 		return EINVAL;
 
 	errno = check_watch_path(conn, ctx, &(vec[0]), &relative);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289982.1569646 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSqv-0002vO-LY; Wed, 22 Apr 2026 08:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289982.1569646; Wed, 22 Apr 2026 08: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 1wFSqv-0002vG-Iw; Wed, 22 Apr 2026 08:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1289982;
 Wed, 22 Apr 2026 08:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSqu-0002vA-Ch
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqu-00ED3a-1A
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSqu-00F7qU-14
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+lar9+JBCF4hdOdpLySEGAjtBY+5f6o6VF2RdyAdicc=; b=LAnsVIFhwScfa63ahICZbEv7pu
	qkpDKT8k38jfIVzL5Ejqx9WFC0hzXlwdy9C0jTkf3Dpa463mdGhuk925z3i90uOeJVhWTtPF8bMy5
	MebaXNH7jxLuOxXvk4lp+XFnWaigq6fNj8uAi6ohFCGMJEMfFZr0MSmFVfhBsOi/L4S4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: replace the fire_watches() exact parameter
Message-Id: <E1wFSqu-00F7qU-14@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:22:32 +0000

commit d58175d7f6f9560f178651f08098bad747a12d66
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:23 2026 +0200

    tools/xenstored: replace the fire_watches() exact parameter
    
    Today fire_watches() has the boolean "exact" parameter specifying how
    the matching of the modified node with registered watches is to be
    handled (only the exact node name is matching or all nodes being
    in the subtree beneath the watched node).
    
    For the handling of <special-watch>/<domid> watch events 2 additional
    matching possibility needs to be added, as those events should only
    be delivered to clients having requested such events, either by
    watching <special-watch> with the depth=1 parameter, or by directly
    watching for <special-watch>/<domid>, while the traditional special
    watch events should NOT delivered to those watchers.
    
    For this purpose rename the "exact" parameter to "match" and make it
    an enum with four possible values.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/core.c        | 12 ++++++------
 tools/xenstored/transaction.c | 14 ++++++++------
 tools/xenstored/transaction.h |  4 +++-
 tools/xenstored/watch.c       | 42 ++++++++++++++++++++++++++++++------------
 tools/xenstored/watch.h       |  9 ++++++++-
 5 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 807a8e6710..f92fca6e9e 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -1613,7 +1613,7 @@ static int do_write(const void *ctx, struct connection *conn,
 			return errno;
 	}
 
-	fire_watches(conn, ctx, name, node, false, NULL);
+	fire_watches(conn, ctx, name, node, MATCH_SUBTREE, NULL);
 	send_ack(conn, XS_WRITE);
 
 	return 0;
@@ -1637,7 +1637,7 @@ static int do_mkdir(const void *ctx, struct connection *conn,
 		node = create_node(conn, ctx, name, NULL, 0);
 		if (!node)
 			return errno;
-		fire_watches(conn, ctx, name, node, false, NULL);
+		fire_watches(conn, ctx, name, node, MATCH_SUBTREE, NULL);
 	}
 	send_ack(conn, XS_MKDIR);
 
@@ -1683,7 +1683,7 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 		       struct node *node, void *arg)
 {
 	const char *root = arg;
-	bool watch_exact;
+	enum watch_match watch_match;
 	int ret;
 	const char *db_name;
 
@@ -1703,8 +1703,8 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	 * This fine as we are single threaded and the next possible read will
 	 * be handled only after the node has been really removed.
 	*/
-	watch_exact = strcmp(root, node->name);
-	fire_watches(conn, ctx, node->name, node, watch_exact, NULL);
+	watch_match = strcmp(root, node->name) ? MATCH_EXACT : MATCH_SUBTREE;
+	fire_watches(conn, ctx, node->name, node, watch_match, NULL);
 
 	return WALK_TREE_RM_CHILDENTRY;
 }
@@ -1858,7 +1858,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (write_node(conn, node, NODE_MODIFY, false))
 		return errno;
 
-	fire_watches(conn, ctx, name, node, false, &old_perms);
+	fire_watches(conn, ctx, name, node, MATCH_SUBTREE, &old_perms);
 	send_ack(conn, XS_SET_PERMS);
 
 	return 0;
diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 47cd6ecd3c..ec5b122a3f 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -134,7 +134,7 @@ struct accessed_node
 
 	/* Watch event flags. */
 	bool fire_watch;
-	bool watch_exact;
+	enum watch_match watch_match;
 };
 
 struct transaction
@@ -327,8 +327,10 @@ err:
  * A watch event should be fired for a node modified inside a transaction.
  * Set the corresponding information. A non-exact event is replacing an exact
  * one, but not the other way round.
+ * No special watch handling needed here, so MATCH_DEPTH is no issue.
  */
-void queue_watches(struct connection *conn, const char *name, bool watch_exact)
+void queue_watches(struct connection *conn, const char *name,
+		   enum watch_match watch_match)
 {
 	struct accessed_node *i;
 
@@ -340,9 +342,9 @@ void queue_watches(struct connection *conn, const char *name, bool watch_exact)
 
 	if (!i->fire_watch) {
 		i->fire_watch = true;
-		i->watch_exact = watch_exact;
-	} else if (!watch_exact) {
-		i->watch_exact = false;
+		i->watch_match = watch_match;
+	} else if (watch_match == MATCH_SUBTREE) {
+		i->watch_match = MATCH_SUBTREE;
 	}
 }
 
@@ -419,7 +421,7 @@ static int finalize_transaction(struct connection *conn,
 				db_delete(conn, i->node, NULL);
 		}
 		if (i->fire_watch)
-			fire_watches(conn, trans, i->node, NULL, i->watch_exact,
+			fire_watches(conn, trans, i->node, NULL, i->watch_match,
 				     i->perms.p ? &i->perms : NULL);
 
 		list_del(&i->list);
diff --git a/tools/xenstored/transaction.h b/tools/xenstored/transaction.h
index 90435b4fc9..b4f5f757e2 100644
--- a/tools/xenstored/transaction.h
+++ b/tools/xenstored/transaction.h
@@ -18,6 +18,7 @@
 #ifndef _XENSTORED_TRANSACTION_H
 #define _XENSTORED_TRANSACTION_H
 #include "core.h"
+#include "watch.h"
 
 enum node_access_type {
     NODE_ACCESS_READ,
@@ -44,7 +45,8 @@ int __must_check access_node(struct connection *conn, struct node *node,
                              enum node_access_type type, const char **db_name);
 
 /* Queue watches for a modified node. */
-void queue_watches(struct connection *conn, const char *name, bool watch_exact);
+void queue_watches(struct connection *conn, const char *name,
+		   enum watch_match watch_match);
 
 /* Prepend the transaction to name if appropriate. */
 const char *transaction_prepend(struct connection *conn, const char *name);
diff --git a/tools/xenstored/watch.c b/tools/xenstored/watch.c
index 860c219f29..a9a06e9e48 100644
--- a/tools/xenstored/watch.c
+++ b/tools/xenstored/watch.c
@@ -128,7 +128,8 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
  * watch event, too.
  */
 void fire_watches(struct connection *conn, const void *ctx, const char *name,
-		  const struct node *node, bool exact, struct node_perms *perms)
+		  const struct node *node, enum watch_match match,
+		  struct node_perms *perms)
 {
 	struct connection *i;
 	struct buffered_data *req;
@@ -136,7 +137,7 @@ void fire_watches(struct connection *conn, const void *ctx, const char *name,
 
 	/* During transactions, don't fire watches, but queue them. */
 	if (conn && conn->transaction) {
-		queue_watches(conn, name, exact);
+		queue_watches(conn, name, match);
 		return;
 	}
 
@@ -148,17 +149,34 @@ void fire_watches(struct connection *conn, const void *ctx, const char *name,
 			continue;
 
 		list_for_each_entry(watch, &i->watches, list) {
-			if (exact) {
-				if (streq(name, watch->node))
-					send_event(req, i,
-						   get_watch_path(watch, name),
-						   watch->token);
-			} else {
-				if (is_child(name, watch->node, watch->depth))
-					send_event(req, i,
-						   get_watch_path(watch, name),
-						   watch->token);
+			bool send = false;
+
+			switch (match) {
+			case MATCH_EXACT:
+				send = streq(name, watch->node);
+				break;
+
+			case MATCH_SUBTREE:
+				send = is_child(name, watch->node,
+						watch->depth);
+				break;
+
+			case MATCH_DEPTH:
+				send = streq(name, watch->node) ||
+				       (watch->depth > 0 &&
+					is_child(name, watch->node,
+						 watch->depth));
+				break;
+
+			case MATCH_NODEPTH:
+				send = streq(name, watch->node) &&
+				       watch->depth < 0;
+				break;
 			}
+
+			if (send)
+				send_event(req, i, get_watch_path(watch, name),
+					   watch->token);
 		}
 	}
 }
diff --git a/tools/xenstored/watch.h b/tools/xenstored/watch.h
index afdfdc6b2f..692343389f 100644
--- a/tools/xenstored/watch.h
+++ b/tools/xenstored/watch.h
@@ -27,8 +27,15 @@ int do_unwatch(const void *ctx, struct connection *conn,
 	       struct buffered_data *in);
 
 /* Fire all watches: !exact means all the children are affected (ie. rm). */
+enum watch_match {
+	MATCH_EXACT,
+	MATCH_SUBTREE,
+	MATCH_DEPTH,	/* watches with depth > 0, MATCH_SUBTREE semantics */
+	MATCH_NODEPTH	/* watches with no depth, MATCH_EXACT semantics */
+};
+
 void fire_watches(struct connection *conn, const void *tmp, const char *name,
-		  const struct node *node, bool exact,
+		  const struct node *node, enum watch_match match,
 		  struct node_perms *perms);
 
 void conn_delete_all_watches(struct connection *conn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289983.1569650 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSr5-0002y9-Mr; Wed, 22 Apr 2026 08:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289983.1569650; Wed, 22 Apr 2026 08: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 1wFSr5-0002y1-KI; Wed, 22 Apr 2026 08:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1289983;
 Wed, 22 Apr 2026 08:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSr4-0002xt-FR
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSr4-00ED3g-1S
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSr4-00F7qs-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TkjhCSNIuQLB5jka15qrCqGBsc15ibz51+/HT2wC+RQ=; b=40FmdoQb72ECU61m1raL+imbLC
	snqazdJqrVopWN3ekiMhR/JxR+Xd85Td+XiI02ApwApR7/gL6YJ2yXEXJ8AoOU8Gyxo7tu0NWsWFo
	eLx1H2puOwXvBPqBaIh9p9wrwAh97cSr1rOeFY8gA+DV1VaNWSw/mwXFutCB67jIpJsg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: expand special watch handling with depth feature
Message-Id: <E1wFSr4-00F7qs-1M@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:22:42 +0000

commit 8032c10dbb102f61e13ed34896bf684a47d319e2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:28 2026 +0200

    tools/xenstored: expand special watch handling with depth feature
    
    With XENSTORE_SERVER_FEATURE_WATCHDEPTH available, special watch
    handling needs to be extended:
    
    - when a special watch is set with depth = 1, the domid is added to
      the watch event
    
    - it is possible to watch for @releaseDomain/<domid>
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/domain.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 7f2fa16cf2..a5258dae6d 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -616,7 +616,12 @@ static void domain_tree_remove(struct domain *domain)
 	walk_node_tree(domain, NULL, "@introduceDomain", &walkfuncs, domain);
 }
 
-static void fire_special_watches(const char *name)
+#define WATCH_NODOM	1	/* Fire watches without <domid> extension. */
+#define WATCH_DOM	2	/* Fire watches with <domid> extension. */
+#define WATCH_BOTH	(WATCH_NODOM | WATCH_DOM)
+
+static void fire_special_watches(const char *name, unsigned int domid,
+				 unsigned int watchdom_flag)
 {
 	void *ctx = talloc_new(NULL);
 	const struct node *node;
@@ -626,9 +631,19 @@ static void fire_special_watches(const char *name)
 
 	node = read_node_const(NULL, ctx, name);
 
-	if (node)
-		fire_watches(NULL, ctx, name, node, true, NULL);
-	else
+	if (node) {
+		if (watchdom_flag & WATCH_NODOM)
+			fire_watches(NULL, ctx, name, node, MATCH_NODEPTH,
+				     NULL);
+		if (watchdom_flag & WATCH_DOM) {
+			char name_dom[24]; /* max. "@introduceDomain/domid" */
+
+			snprintf(name_dom, sizeof(name_dom),
+				 "%s/%u", name, domid);
+			fire_watches(NULL, ctx, name_dom, node, MATCH_DEPTH,
+				     NULL);
+		}
+	} else
 		log("special node %s not found\n", name);
 
 	talloc_free(ctx);
@@ -653,7 +668,7 @@ static int destroy_domain(void *_domain)
 	if (domain->interface)
 		unmap_interface(domain->domid, domain->interface);
 
-	fire_special_watches("@releaseDomain");
+	fire_special_watches("@releaseDomain", domain->domid, WATCH_BOTH);
 
 	wrl_domain_destroy(domain);
 
@@ -681,6 +696,8 @@ static int do_check_domain(struct domain *domain, bool *notify,
 		if ((state & XENMANAGE_GETDOMSTATE_STATE_SHUTDOWN)
 		    && !domain->shutdown) {
 			domain->shutdown = true;
+			fire_special_watches("@releaseDomain", domain->domid,
+					     WATCH_DOM);
 			*notify = true;
 		}
 		if (!(state & XENMANAGE_GETDOMSTATE_STATE_DEAD))
@@ -723,7 +740,7 @@ void check_domains(void)
 		;
 
 	if (notify)
-		fire_special_watches("@releaseDomain");
+		fire_special_watches("@releaseDomain", 0, WATCH_NODOM);
 }
 
 static struct domain *find_domain_struct(unsigned int domid)
@@ -747,7 +764,7 @@ static void do_check_domains(void)
 	}
 
 	if (notify)
-		fire_special_watches("@releaseDomain");
+		fire_special_watches("@releaseDomain", 0, WATCH_NODOM);
 }
 
 /* We scan all domains rather than use the information given here. */
@@ -1112,7 +1129,8 @@ static struct domain *introduce_domain(const void *ctx,
 		talloc_steal(domain->conn, domain);
 
 		if (!is_priv_domain && !restore)
-			fire_special_watches("@introduceDomain");
+			fire_special_watches("@introduceDomain", domid,
+					     WATCH_BOTH);
 	} else {
 		/* Use XS_INTRODUCE for recreating the xenbus event-channel. */
 		if (domain->port)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:22:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289984.1569655 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSrF-00030C-PK; Wed, 22 Apr 2026 08:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289984.1569655; Wed, 22 Apr 2026 08: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 1wFSrF-000302-Ld; Wed, 22 Apr 2026 08:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1289984;
 Wed, 22 Apr 2026 08:22:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSrE-0002zu-I1
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrE-00ED4E-1i
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrE-00F7rM-1c
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3uO3bYcnk+oJUB8dXZzs9YnfvDC+It+1rczHEbCSm2E=; b=qiA5mkE1e2iBIn92/TXPPbAzYi
	bWdjFnABbgf1hcAxo5u5U6eGmuLtevFi3gatGYpo5hKxk2zgRGGM7d0K0JVfJn8e7WkpEQ51rwdrL
	7Jl+JUiBSNdx33+1KKbqRTGdYRSs1olBpUZeYSnOzta1OCweyHPC//oDBdPm7jwlAVbc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: make XENSTORE_SERVER_FEATURE_WATCHDEPTH available
Message-Id: <E1wFSrE-00F7rM-1c@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:22:52 +0000

commit 7e7723ea07809a71e7a06396af6dff87496902d3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:41 2026 +0200

    tools/xenstored: make XENSTORE_SERVER_FEATURE_WATCHDEPTH available
    
    Add XENSTORE_SERVER_FEATURE_WATCHDEPTH to the available features now
    that all needed support has been added.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index a5258dae6d..00875d6b5c 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -43,7 +43,8 @@
 #include <mini-os/xenbus.h>
 #endif
 
-#define XENSTORE_FEATURES	XENSTORE_SERVER_FEATURE_ERROR
+#define XENSTORE_FEATURES	(XENSTORE_SERVER_FEATURE_ERROR |	\
+				 XENSTORE_SERVER_FEATURE_WATCHDEPTH)
 
 static xenmanage_handle *xm_handle;
 xengnttab_handle **xgt_handle;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:23:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289985.1569658 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSrP-00032c-Pe; Wed, 22 Apr 2026 08:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289985.1569658; Wed, 22 Apr 2026 08: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 1wFSrP-00032U-My; Wed, 22 Apr 2026 08:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1289985;
 Wed, 22 Apr 2026 08:23:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSrO-00032N-Kk
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:23:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrO-00ED4e-1z
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrO-00F7rw-1t
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+25MpUqkUp/OBkm6oBAgxHZp7DAH+qVEIw8fyq5MOBc=; b=bfha4Im1Y71OPuUMnAke/NwWPD
	NMGL8HU+zbRt2iSFrPsL7LssaQJlResSUivkyjC3Se14WdvA+gjnQg43RKSzc8Xl/dl1BjeJjLtXa
	kcmiCvVdGSUOejxbt07YJpa5C6t3MrA7YpDzB8MurjsZ8NOqZs0FxAboW8fVS3wIX20Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xs-clients: support depth with xenstore-watch
Message-Id: <E1wFSrO-00F7rw-1t@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:23:02 +0000

commit 464b7f4f267f978302f2758bb6dad3f56fef30d3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:11 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:59:03 2026 +0200

    tools/xs-clients: support depth with xenstore-watch
    
    Add a "-d <depth>" parameter to xenstore-watch, allowing to specify
    the depth parameter of the XS_WATCH command.
    
    Using "-d" without support of depth by xenstored will refuse to set
    the watch(es).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/man/xenstore-watch.1.pod      |  9 +++++++++
 tools/xs-clients/xenstore_client.c | 19 +++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/docs/man/xenstore-watch.1.pod b/docs/man/xenstore-watch.1.pod
index de28d380b7..716c5521bc 100644
--- a/docs/man/xenstore-watch.1.pod
+++ b/docs/man/xenstore-watch.1.pod
@@ -17,6 +17,15 @@ event happening.
 
 Show the usage information for xenstore-watch and exit the program.
 
+=item B<-d> B<depth>
+
+Limit the number of sub-directories below the specified I<PATH>s to be
+watched. A B<depth> of 0 will watch only the specified nodes, a B<depth>
+of 1 will watch the specified nodes and their direct children, etc.
+
+Using this option requires xenstored to support the Xenstore watch depth
+feature. In case it is not supported, the B<-d> usage will be rejected.
+
 =item B<-n> B<NR>
 
 Stop waiting after having received B<NR> watch events.
diff --git a/tools/xs-clients/xenstore_client.c b/tools/xs-clients/xenstore_client.c
index 9a25704b91..4a14cb334f 100644
--- a/tools/xs-clients/xenstore_client.c
+++ b/tools/xs-clients/xenstore_client.c
@@ -445,7 +445,7 @@ do_watch(struct xs_handle *xsh, int max_events)
 static int
 perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh,
         xs_transaction_t xth, int prefix, int tidy, int upto, int recurse, int nr_watches,
-        int raw)
+        int raw, int depth)
 {
     switch (mode) {
     case MODE_ls:
@@ -627,8 +627,11 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
             for (; argv[optind]; optind++) {
                 const char *w = argv[optind];
 
-                if (!xs_watch(xsh, w, w))
+                if (depth < 0 && !xs_watch(xsh, w, w))
                     errx(1, "Unable to add watch on %s\n", w);
+                if (depth >= 0 && !xs_watch_depth(xsh, w, w, depth))
+                    errx(1, "Unable to add watch on %s with depth %d\n", w,
+                         depth);
             }
             do_watch(xsh, nr_watches);
         }
@@ -676,6 +679,7 @@ main(int argc, char **argv)
     int nr_watches = -1;
     int transaction;
     int raw = 0;
+    int depth = -1;
     struct winsize ws;
     enum mode mode;
 
@@ -709,10 +713,11 @@ main(int argc, char **argv)
 	    {"recurse", 0, 0, 'r'}, /* MODE_chmod */
 	    {"number",  1, 0, 'n'}, /* MODE_watch */
 	    {"raw",     0, 0, 'R'}, /* MODE_read || MODE_write */
+	    {"depth",   1, 0, 'd'}, /* MODE_watch */
 	    {0, 0, 0, 0}
 	};
 
-	c = getopt_long(argc - switch_argv, argv + switch_argv, "hfspturn:R",
+	c = getopt_long(argc - switch_argv, argv + switch_argv, "hfspturn:Rd:",
 			long_options, &index);
 	if (c == -1)
 	    break;
@@ -766,6 +771,12 @@ main(int argc, char **argv)
 	    else
 		usage(1, mode, switch_argv, argv[0]);
 	    break;
+	case 'd':
+	    if ( mode == MODE_watch )
+		depth = atoi(optarg);
+	    else
+		usage(1, mode, switch_argv, argv[0]);
+	    break;
 	}
     }
 
@@ -819,7 +830,7 @@ again:
 	    errx(1, "couldn't start transaction");
     }
 
-    ret = perform(mode, optind, argc - switch_argv, argv + switch_argv, xsh, xth, prefix, tidy, upto, recurse, nr_watches, raw);
+    ret = perform(mode, optind, argc - switch_argv, argv + switch_argv, xsh, xth, prefix, tidy, upto, recurse, nr_watches, raw, depth);
 
     if (transaction && !xs_transaction_end(xsh, xth, ret)) {
 	if (ret == 0 && errno == EAGAIN) {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:23:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:23:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289986.1569662 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSrZ-00035c-S9; Wed, 22 Apr 2026 08:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289986.1569662; Wed, 22 Apr 2026 08:23:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSrZ-00035U-Pb; Wed, 22 Apr 2026 08:23:13 +0000
Received: by outflank-mailman (input) for mailman id 1289986;
 Wed, 22 Apr 2026 08:23:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSrY-00035N-O4
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:23:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrY-00ED4l-2J
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrY-00F7sK-2A
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:23: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TOuW22ggtvVNbo0Ju3eCGotidNvZRmpfbAYVsaXmtDA=; b=q9NotPLq+Jgv/+VN4viqpHZP8B
	IyjY9TwlJZ+9MH09pG7dj2dQZVynq5DPExASsRbt4Y2kjTx/YvBYRYAfzvLsby/Vz+1oBg1RVGTU2
	mKBK1y8DHN5+0jWlrifQXsHv71Drs+M3i49UAj0IWIiKxdgDpP/74O4XmvtXIFIkituU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] include: move KB() etc to macros.h
Message-Id: <E1wFSrY-00F7sK-2A@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:23:12 +0000

commit 51074cf2c1544a2a294e86b81b4cf4b682aa1471
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 22 08:59:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:59:53 2026 +0200

    include: move KB() etc to macros.h
    
    Allow them to be used by build tools which don't include config.h. (They
    also don't really fit into config.h, as there's nothing "configuration"
    related about them.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/efi/relocs-dummy.S | 1 +
 xen/include/xen/config.h        | 4 ----
 xen/include/xen/macros.h        | 4 ++++
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/efi/relocs-dummy.S b/xen/arch/x86/efi/relocs-dummy.S
index b95fa444da..1fef06ec53 100644
--- a/xen/arch/x86/efi/relocs-dummy.S
+++ b/xen/arch/x86/efi/relocs-dummy.S
@@ -1,3 +1,4 @@
+#include <xen/macros.h>
 
 	.section .reloc, "a", @progbits
 	.balign 4
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 33e6aafa40..dddc8e1920 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -82,10 +82,6 @@
 #define __force
 #define __bitwise
 
-#define KB(_kb)     (_AC(_kb, ULL) << 10)
-#define MB(_mb)     (_AC(_mb, ULL) << 20)
-#define GB(_gb)     (_AC(_gb, ULL) << 30)
-
 /* allow existing code to work with Kconfig variable */
 #define NR_CPUS CONFIG_NR_CPUS
 
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index acd451b335..e29cff791e 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -38,6 +38,10 @@
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
 
+#define KB(_kb)     (_AC(_kb, ULL) << 10)
+#define MB(_mb)     (_AC(_mb, ULL) << 20)
+#define GB(_gb)     (_AC(_gb, ULL) << 30)
+
 #ifndef __ASSEMBLER__
 
 /* Force a compilation error if condition is true */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:23:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289987.1569665 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSrj-000384-TR; Wed, 22 Apr 2026 08:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289987.1569665; Wed, 22 Apr 2026 08:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSrj-00037w-Qv; Wed, 22 Apr 2026 08:23:23 +0000
Received: by outflank-mailman (input) for mailman id 1289987;
 Wed, 22 Apr 2026 08:23:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSri-00037p-Qx
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:23:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSri-00ED4s-2b
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:23:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSri-00F7si-2U
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:23: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kAnOwxAeWjIuAIg/FBMk1pF4s+XpPIRL63NWCCdcwIc=; b=nUskp9tfgupxoZAFnMkusfpkHY
	7Y7/Y/u64YqIwAwLBRjz9Zbrb/kE/b3fDm9z0jiqOySNG7ABp8tclvQjstVG1vmJ0vmjU9FsHPU6K
	TWOp9QNHYi+BdT5koYPkw6LZNoyLWs6nByUC5/re5MXYgeYp6o1nup3YDsaLPH13lpTk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mkelf32: use xen/macros.h
Message-Id: <E1wFSri-00F7si-2U@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:23:22 +0000

commit f9af83450e51b37c659322d2297623dcf309b1e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 22 09:00:28 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 09:00:28 2026 +0200

    x86/mkelf32: use xen/macros.h
    
    Avoid open-coding macros we have readily available. Being able to use MB()
    there might have avoided the flaw corrected by 5416c455f656 ("x86/mkelf32:
    Actually pad load segment to 2 MiB boundary").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/mkelf32.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 469d1ba0af..ac5695c0e6 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -17,7 +17,9 @@
 #include <unistd.h>
 #include <inttypes.h>
 
+#include "../../../include/xen/const.h"
 #include "../../../include/xen/elfstructs.h"
+#include "../../../include/xen/macros.h"
 
 #define DYNAMICALLY_FILLED   0
 #define RAW_OFFSET         128
@@ -345,7 +347,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
+    mem_siz = ROUNDUP((uint32_t)in64_phdr.p_memsz, MB(2));
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 08:23:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 08:23:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1289988.1569670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFSrt-0003AV-Uq; Wed, 22 Apr 2026 08:23:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1289988.1569670; Wed, 22 Apr 2026 08:23: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 1wFSrt-0003AN-SJ; Wed, 22 Apr 2026 08:23:33 +0000
Received: by outflank-mailman (input) for mailman id 1289988;
 Wed, 22 Apr 2026 08:23:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFSrs-0003AH-Ti
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 08:23:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrs-00ED4w-2t
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:23:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFSrs-00F7t5-2n
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 08:23:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9fnpH77W5vyoZMYR9QaHGOylcQv42pQ2542YWeiRiZw=; b=6VAJcSG7hoH5gcC4jEnMdfkNOv
	74pyimt8Co2d+ejRLel9A65pssfq2Fi3JHVfiSjM9+ODTdjI2q5/ghG4kTygqAgu5Wxi27uAr5hck
	ocG0b2SHmxfcDdI/e92bxnA/AvgsDoLvGOdToKJj5P5gpTUCMgZPor/IZmZfx5kim2tg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: allow Xen to use SSTC while hiding it from guests
Message-Id: <E1wFSrs-00F7t5-2n@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 08:23:32 +0000

commit 25e03273069036f5b46e14bbdf396ac79805d07e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Apr 22 09:01:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 09:01:09 2026 +0200

    xen/riscv: allow Xen to use SSTC while hiding it from guests
    
    OpenSBI currently does not advertise the SSTC extension via the device
    tree, so if SSTC support is detected by Xen the riscv_isa bitmap is updated
    manually. Furthermore, removing the "sstc" string from riscv,isa is not
    a reliable way to disable SSTC, because OpenSBI probes support by
    attempting to access CSR_STIMECMP.
    
    Introduce a runtime probe in Xen to determine whether SSTC is available.
    The probe attempts to read CSR_STIMECMP using csr_read_safe(). If the
    access succeeds, SSTC is considered available; if a trap occurs, it is
    treated as unsupported.
    
    When SSTC is detected, Xen may use it internally to program timers.
    However, the extension is not exposed to guests because the required
    context switch handling for the SSTC CSRs is not yet implemented.
    
    Note: clearing RISCV_ISA_EXT_sstc from the DTS riscv,isa property is
    deferred to a follow-up patch. Also, the corresponding HENVCFG bit is
    not set so guests fall back to the SBI timer interface. Timer requests
    are then handled by Xen via the usual SBI interception path.
    
    Introduce set_xen_timer() to abstract how the timer is programmed,
    either via the SSTC extension or an SBI call.
    
    Drop sbi_set_timer() as it is more than enough to have only introduced
    set_xen_timer().
    
    Drop "SBI v0.2 TIME extension detected" message to avoid confusion
    which set timer function is really used.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/cpufeature.c                 | 18 +++++++++++++
 xen/arch/riscv/include/asm/cpufeature.h     |  1 +
 xen/arch/riscv/include/asm/csr.h            | 15 +++++++++++
 xen/arch/riscv/include/asm/riscv_encoding.h |  2 ++
 xen/arch/riscv/include/asm/sbi.h            | 18 -------------
 xen/arch/riscv/include/asm/time.h           |  3 +++
 xen/arch/riscv/sbi.c                        | 29 +++++++++++++++-----
 xen/arch/riscv/time.c                       | 42 ++++++++++++++++++-----------
 xen/arch/riscv/vtimer.c                     |  1 +
 9 files changed, 90 insertions(+), 39 deletions(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 03e27b037b..92235fdfd5 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -17,6 +17,7 @@
 #include <xen/sections.h>
 
 #include <asm/cpufeature.h>
+#include <asm/csr.h>
 
 #ifdef CONFIG_ACPI
 # error "cpufeature.c functions should be updated to support ACPI"
@@ -139,6 +140,7 @@ const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {
     RISCV_ISA_EXT_DATA(smaia),
     RISCV_ISA_EXT_DATA(smstateen),
     RISCV_ISA_EXT_DATA(ssaia),
+    RISCV_ISA_EXT_DATA(sstc),
     RISCV_ISA_EXT_DATA(svade),
     RISCV_ISA_EXT_DATA(svpbmt),
 };
@@ -483,6 +485,7 @@ void __init riscv_fill_hwcap(void)
     unsigned int i;
     const size_t req_extns_amount = ARRAY_SIZE(required_extensions);
     bool all_extns_available = true;
+    unsigned long tmp;
 
     riscv_fill_hwcap_from_isa_string();
 
@@ -495,6 +498,21 @@ void __init riscv_fill_hwcap(void)
         panic("HW capabilities parsing failed: %s\n", failure_msg);
     }
 
+    if ( csr_read_safe(CSR_STIMECMP, &tmp) )
+    {
+        dprintk(XENLOG_DEBUG,
+                "SSTC detected; supported for Xen use, but not for guests\n");
+
+        /*
+         * As there is no any guarantee that SSTC will be added to riscv,isa
+         * property by OpenSBI(it doesn't add it now) or whatever ran before
+         * Xen, it is needed to set this bit manually.
+         *
+         * Guest isolation is maintained by not setting ENVCFG_STCE in henvcfg.
+         */
+        __set_bit(RISCV_ISA_EXT_sstc, riscv_isa);
+    }
+
     for ( i = 0; i < req_extns_amount; i++ )
     {
         const struct riscv_isa_ext_data ext = required_extensions[i];
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index ef02a3e26d..0c48d57a03 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -38,6 +38,7 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_smaia,
     RISCV_ISA_EXT_smstateen,
     RISCV_ISA_EXT_ssaia,
+    RISCV_ISA_EXT_sstc,
     RISCV_ISA_EXT_svade,
     RISCV_ISA_EXT_svpbmt,
     RISCV_ISA_EXT_MAX
diff --git a/xen/arch/riscv/include/asm/csr.h b/xen/arch/riscv/include/asm/csr.h
index 27d4b7942f..888d6a2a86 100644
--- a/xen/arch/riscv/include/asm/csr.h
+++ b/xen/arch/riscv/include/asm/csr.h
@@ -32,6 +32,21 @@
                            : "memory" );                        \
 })
 
+#ifdef CONFIG_RISCV_32
+#define csr_write64(csr, val)       \
+({                                  \
+    uint64_t v_ = (val);            \
+    csr_write(csr, v_);             \
+    csr_write(csr ## H, v_ >> 32);  \
+})
+#else
+#define csr_write64(csr, val)       \
+({                                  \
+    csr_write(csr, val);            \
+    (void)csr ## H;                 \
+})
+#endif
+
 #define csr_swap(csr, val)                                      \
 ({                                                              \
     unsigned long __v = (unsigned long)(val);                   \
diff --git a/xen/arch/riscv/include/asm/riscv_encoding.h b/xen/arch/riscv/include/asm/riscv_encoding.h
index dd15731a86..03e186bcdb 100644
--- a/xen/arch/riscv/include/asm/riscv_encoding.h
+++ b/xen/arch/riscv/include/asm/riscv_encoding.h
@@ -395,6 +395,8 @@
 #define CSR_VSCAUSE			0x242
 #define CSR_VSTVAL			0x243
 #define CSR_VSIP			0x244
+#define CSR_VSTIMECMP		0x24d
+#define CSR_VSTIMECMPH		0x25d
 #define CSR_VSATP			0x280
 
 /* Virtual Interrupts and Interrupt Priorities (H-extension with AIA) */
diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index ed7af20028..1952868e96 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -13,7 +13,6 @@
 #define ASM__RISCV__SBI_H
 
 #include <xen/cpumask.h>
-#include <xen/sections.h>
 
 /* SBI-defined implementation ID */
 #define SBI_XEN_IMPID 7
@@ -139,23 +138,6 @@ int sbi_remote_hfence_gvma(const cpumask_t *cpu_mask, vaddr_t start,
 int sbi_remote_hfence_gvma_vmid(const cpumask_t *cpu_mask, vaddr_t start,
                                 size_t size, unsigned long vmid);
 
-/*
- * Programs the clock for next event at (or after) stime_value. stime_value is
- * in absolute time. This function must clear the pending timer interrupt bit
- * as well.
- *
- * If the supervisor wishes to clear the timer interrupt without scheduling the
- * next timer event, it can either request a timer interrupt infinitely far
- * into the future (i.e., (uint64_t)-1), or it can instead mask the timer
- * interrupt by clearing sie.STIE CSR bit.
- *
- * The stime_value parameter represents absolute time measured in ticks.
- *
- * This SBI call returns 0 upon success or an implementation specific negative
- * error code.
- */
-extern int (* __ro_after_init sbi_set_timer)(uint64_t stime_value);
-
 /*
  * Initialize SBI library
  *
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index be3875b998..4d68900151 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -4,6 +4,7 @@
 
 #include <xen/bug.h>
 #include <xen/muldiv64.h>
+#include <xen/sections.h>
 
 #include <asm/csr.h>
 
@@ -26,6 +27,8 @@ static inline cycles_t get_cycles(void)
 
 void preinit_xen_time(void);
 
+extern int (* __ro_after_init set_xen_timer)(uint64_t deadline);
+
 #endif /* ASM__RISCV__TIME_H */
 
 /*
diff --git a/xen/arch/riscv/sbi.c b/xen/arch/riscv/sbi.c
index b4a7ae6940..3576e26033 100644
--- a/xen/arch/riscv/sbi.c
+++ b/xen/arch/riscv/sbi.c
@@ -22,6 +22,7 @@
 
 #include <asm/processor.h>
 #include <asm/sbi.h>
+#include <asm/time.h>
 
 static unsigned long __ro_after_init sbi_spec_version = SBI_SPEC_VERSION_DEFAULT;
 
@@ -249,6 +250,21 @@ static int (* __ro_after_init sbi_rfence)(unsigned long fid,
                                           unsigned long arg4,
                                           unsigned long arg5);
 
+/*
+ * Programs the clock for next event at (or after) stime_value. stime_value is
+ * in absolute time. This function must clear the pending timer interrupt bit
+ * as well.
+ *
+ * If the supervisor wishes to clear the timer interrupt without scheduling the
+ * next timer event, it can either request a timer interrupt infinitely far
+ * into the future (i.e., (uint64_t)-1), or it can instead mask the timer
+ * interrupt by clearing sie.STIE CSR bit.
+ *
+ * The stime_value parameter represents absolute time measured in ticks.
+ *
+ * This SBI call returns 0 upon success or an implementation specific negative
+ * error code.
+ */
 static int cf_check sbi_set_timer_v02(uint64_t stime_value)
 {
     struct sbiret ret;
@@ -264,6 +280,10 @@ static int cf_check sbi_set_timer_v02(uint64_t stime_value)
     return sbi_err_map_xen_errno(ret.error);
 }
 
+/*
+ * Legacy SBI v0.1 SET_TIMER; functionally equivalent to sbi_set_timer_v02
+ * from Xen's perspective.
+ */
 static int cf_check sbi_set_timer_v01(uint64_t stime_value)
 {
     struct sbiret ret;
@@ -279,8 +299,6 @@ static int cf_check sbi_set_timer_v01(uint64_t stime_value)
     return sbi_err_map_xen_errno(ret.error);
 }
 
-int (* __ro_after_init sbi_set_timer)(uint64_t stime_value) = sbi_set_timer_v01;
-
 int sbi_remote_sfence_vma(const cpumask_t *cpu_mask, vaddr_t start,
                           size_t size)
 {
@@ -360,10 +378,9 @@ int __init sbi_init(void)
         }
 
         if ( sbi_probe_extension(SBI_EXT_TIME) > 0 )
-        {
-            sbi_set_timer = sbi_set_timer_v02;
-            dprintk(XENLOG_INFO, "SBI v0.2 TIME extension detected\n");
-        }
+            set_xen_timer = sbi_set_timer_v02;
+        else
+            set_xen_timer = sbi_set_timer_v01;
     }
     else
         panic("Ooops. SBI spec version 0.1 detected. Need to add support");
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 698ab49d12..8769709e52 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -7,12 +7,21 @@
 #include <xen/time.h>
 #include <xen/types.h>
 
+#include <asm/cpufeature.h>
 #include <asm/csr.h>
-#include <asm/sbi.h>
 
 unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */
 uint64_t __ro_after_init boot_clock_cycles;
 
+static int cf_check sstc_set_xen_timer(uint64_t deadline)
+{
+    csr_write64(CSR_STIMECMP, deadline);
+
+    return 0;
+}
+
+int (* __ro_after_init set_xen_timer)(uint64_t deadline);
+
 s_time_t get_s_time(void)
 {
     uint64_t ticks = get_cycles() - boot_clock_cycles;
@@ -61,20 +70,7 @@ int reprogram_timer(s_time_t timeout)
     if ( deadline <= now )
         return 0;
 
-    /*
-     * TODO: When the SSTC extension is supported, it would be preferable to
-     *       use the supervisor timer registers directly here for better
-     *       performance, since an SBI call and mode switch would no longer
-     *       be required.
-     *
-     *       This would also reduce reliance on a specific SBI implementation.
-     *       For example, it is not ideal to panic() if sbi_set_timer() returns
-     *       a non-zero value. Currently it can return 0 or -ENOSUPP, and
-     *       without SSTC we still need an implementation because only the
-     *       M-mode timer is available, and it can only be programmed in
-     *       M-mode.
-     */
-    if ( (rc = sbi_set_timer(deadline)) )
+    if ( (rc = set_xen_timer(deadline)) )
         panic("%s: timer wasn't set because: %d\n", __func__, rc);
 
     /* Enable timer interrupt */
@@ -91,4 +87,20 @@ void __init preinit_xen_time(void)
         panic("%s: ACPI isn't supported\n", __func__);
 
     boot_clock_cycles = get_cycles();
+
+    /* set_xen_timer must have been set by sbi_init() already */
+    ASSERT(set_xen_timer);
+
+    if ( riscv_isa_extension_available(NULL, RISCV_ISA_EXT_sstc) )
+    {
+        set_xen_timer = sstc_set_xen_timer;
+
+        /*
+         * A VS-timer interrupt becomes pending whenever the value of
+         * (time + htimedelta) is greater than or equal to vstimecmp CSR.
+         * Thereby to avoid spurious VS-timer irqs set vstimecmp CSR to
+         * ULONG_MAX.
+         */
+        csr_write64(CSR_STIMECMP, ULONG_MAX);
+    }
 }
diff --git a/xen/arch/riscv/vtimer.c b/xen/arch/riscv/vtimer.c
index afd8a53a73..d5a8dfcb2e 100644
--- a/xen/arch/riscv/vtimer.c
+++ b/xen/arch/riscv/vtimer.c
@@ -4,6 +4,7 @@
 #include <xen/sched.h>
 #include <xen/timer.h>
 
+#include <asm/cpufeature.h>
 #include <asm/vtimer.h>
 
 static void vtimer_expired(void *data)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290058.1569719 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTmV-0007Fm-4l; Wed, 22 Apr 2026 09:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290058.1569719; Wed, 22 Apr 2026 09:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTmV-0007Ff-1w; Wed, 22 Apr 2026 09:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1290058;
 Wed, 22 Apr 2026 09:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTmU-0007FZ-8i
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTmU-00EE7l-0Y
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTmU-00FAxI-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tYG89TnRMC5z9ADtWWK3oYkvFje+a647qH/Se/P6Bno=; b=3mGz+pnh+VWco2xZy29X8U0NXM
	hUsu0xhuk3aIkNPnmvRm0iAsDtBB3QYIXbpOqm+lduZ3ZFzQIsTgJ/urkiBm6lfu991/8Zxg3RB/I
	mPsGDnUnLmZyNLD3wJKRAJU+aal5Zo58GX10VxQt9NJmhI4S8Ia2yCkJtU+oPsgMrleI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/store: add support to use watches with a depth parameter
Message-Id: <E1wFTmU-00FAxI-0M@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:22:02 +0000

commit 27d908e74edcc7145dd0be61f8aa5978fd42df63
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:57:44 2026 +0200

    tools/libs/store: add support to use watches with a depth parameter
    
    Add a new xs_watch_depth() function to libxenstore allowing to limit
    the scope of a Xenstore watch. It can be used only in case Xenstore is
    supporting the XENSTORE_SERVER_FEATURE_WATCHDEPTH feature.
    
    For convenience add a xs_watch_try_depth() wrapper, which will call
    xs_watch_depth() if supported and xs_watch() otherwise.
    
    Cache the supported features of Xenstore in order not having to get
    them from Xenstore for each call of one of the new functions.
    
    While touching xs.c fix a whitespace issue there.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/man/xl.cfg.5.pod.in         |   6 +++
 tools/include/xenstore.h         |  16 ++++++
 tools/libs/store/libxenstore.map |   2 +
 tools/libs/store/xs.c            | 102 ++++++++++++++++++++++++++++++++++-----
 xen/include/public/io/xs_wire.h  |   2 +
 5 files changed, 116 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 3aac0bc4fb..2f77016ecf 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -740,6 +740,12 @@ Xenstore is capable to reconnect to a guest.
 Xenstore will present an error value in case it disconnects due to an error
 condition.
 
+=item B<0x00000004>
+
+Xenstore supports to set watches with a limited depth (depth 0 matches
+only the watched node, depth 1 matches the node and its direct children,
+etc.).
+
 =back
 
 The features supported by the running Xenstore instance can be retrieved
diff --git a/tools/include/xenstore.h b/tools/include/xenstore.h
index bf6d767a22..9422ed5657 100644
--- a/tools/include/xenstore.h
+++ b/tools/include/xenstore.h
@@ -177,6 +177,22 @@ bool xs_set_permissions(struct xs_handle *h, xs_transaction_t t,
  */
 bool xs_watch(struct xs_handle *h, const char *path, const char *token);
 
+/* Same as xs_watch(), but with limiting the matching for modified
+ * children to a specified depth (depth 0 only matches the node itself,
+ * depth 1 will additionally match direct children of the node, etc.).
+ * Only supported if the XENSTORE_SERVER_FEATURE_WATCHDEPTH (4) is set
+ * in the returned features of xs_get_features_supported().
+ */
+bool xs_watch_depth(struct xs_handle *h, const char *path, const char *token,
+		    unsigned int depth);
+
+/* If supported, same as xs_watch_depth(), use xs_watch() otherwise.
+ * As a result watches might trigger for nodes below the watched path, too.
+ * Not to be used for special watches!
+ */
+bool xs_watch_try_depth(struct xs_handle *h, const char *path,
+			const char *token, unsigned int depth);
+
 /* Return the FD to poll on to see if a watch has fired. */
 int xs_fileno(struct xs_handle *h);
 
diff --git a/tools/libs/store/libxenstore.map b/tools/libs/store/libxenstore.map
index a08ddd549f..7067068998 100644
--- a/tools/libs/store/libxenstore.map
+++ b/tools/libs/store/libxenstore.map
@@ -52,4 +52,6 @@ VERS_4.2 {
 		xs_set_global_quota;
 		xs_get_domain_quota;
 		xs_set_domain_quota;
+		xs_watch_depth;
+		xs_watch_try_depth;
 } VERS_4.1;
diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index 06462445e0..cb3508a86a 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -984,16 +984,8 @@ bool xs_restrict(struct xs_handle *h, unsigned domid)
 	return false;
 }
 
-/* Watch a node for changes (poll on fd to detect, or call read_watch()).
- * When the node (or any child) changes, fd will become readable.
- * Token is returned when watch is read, to allow matching.
- * Returns false on failure.
- */
-bool xs_watch(struct xs_handle *h, const char *path, const char *token)
+static bool xs_watch_helper(struct xs_handle *h)
 {
-	struct xsd_sockmsg msg = { .type = XS_WATCH };
-	struct iovec iov[3];
-
 #ifdef USE_PTHREAD
 #define DEFAULT_THREAD_STACKSIZE (16 * 1024)
 /* NetBSD doesn't have PTHREAD_STACK_MIN. */
@@ -1001,8 +993,8 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 # define PTHREAD_STACK_MIN 0
 #endif
 
-#define READ_THREAD_STACKSIZE 					\
-	((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ? 	\
+#define READ_THREAD_STACKSIZE					\
+	((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ?	\
 	 PTHREAD_STACK_MIN : DEFAULT_THREAD_STACKSIZE)
 
 	/* We dynamically create a reader thread on demand. */
@@ -1050,16 +1042,89 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 	mutex_unlock(&h->request_mutex);
 #endif
 
+	return true;
+}
+
+/* Watch a node for changes (poll on fd to detect, or call read_watch()).
+ * When the node (or any child) changes, fd will become readable.
+ * Token is returned when watch is read, to allow matching.
+ * Returns false on failure.
+ */
+bool xs_watch(struct xs_handle *h, const char *path, const char *token)
+{
+	struct xsd_sockmsg msg = { .type = XS_WATCH };
+	struct iovec iov[3];
+
+	if (!xs_watch_helper(h))
+		return false;
+
+	iov[0].iov_base = &msg;
+	iov[0].iov_len  = sizeof(msg);
+	iov[1].iov_base = (void *)path;
+	iov[1].iov_len  = strlen(path) + 1;
+	iov[2].iov_base = (void *)token;
+	iov[2].iov_len  = strlen(token) + 1;
+
+	return xs_bool(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL));
+}
+
+/* Same as xs_watch(), but with limiting the matching for modified
+ * children to a specified depth (depth 0 only matches the node itself,
+ * depth 1 will additionally match direct children of the node, etc.).
+ * Only supported if the XENSTORE_SERVER_FEATURE_WATCHDEPTH (4) is set
+ * in the returned features of xs_get_features_supported().
+ */
+bool xs_watch_depth(struct xs_handle *h, const char *path, const char *token,
+		    unsigned int depth)
+{
+	struct xsd_sockmsg msg = { .type = XS_WATCH };
+	struct iovec iov[4];
+	char depthstr[MAX_STRLEN(depth)];
+	static bool depth_supported;
+
+	if (!xs_watch_helper(h))
+		return false;
+
+	if (!depth_supported) {
+		unsigned int features;
+
+		if (!xs_get_features_supported(h, &features))
+			return false;
+		if (!(features & XENSTORE_SERVER_FEATURE_WATCHDEPTH))
+			return false;
+		depth_supported = true;
+	}
+
+	snprintf(depthstr, sizeof(depthstr), "%u", depth);
+
 	iov[0].iov_base = &msg;
 	iov[0].iov_len  = sizeof(msg);
 	iov[1].iov_base = (void *)path;
 	iov[1].iov_len  = strlen(path) + 1;
 	iov[2].iov_base = (void *)token;
 	iov[2].iov_len  = strlen(token) + 1;
+	iov[3].iov_base = depthstr;
+	iov[3].iov_len = strlen(depthstr) + 1;
 
 	return xs_bool(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL));
 }
 
+/* If supported, same as xs_watch_depth(), use xs_watch() otherwise.
+ * As a result watches might trigger for nodes below the watched path, too.
+ * Not to be used for special watches!
+ */
+bool xs_watch_try_depth(struct xs_handle *h, const char *path,
+			const char *token, unsigned int depth)
+{
+	unsigned int features;
+
+	if (xs_get_features_supported(h, &features) &&
+	    (features & XENSTORE_SERVER_FEATURE_WATCHDEPTH) &&
+	    xs_watch_depth(h, path, token, depth))
+		return true;
+
+	return xs_watch(h, path, token);
+}
 
 /* Clear the pipe token if there are no more pending watchs.
  * We suppose the watch_mutex is already taken.
@@ -1420,13 +1485,26 @@ static bool xs_uint(char *reply, unsigned int *uintval)
 
 bool xs_get_features_supported(struct xs_handle *h, unsigned int *features)
 {
+	static unsigned int own_features = 0;
+	static bool features_valid = false;
 	struct xsd_sockmsg msg = { .type = XS_GET_FEATURE };
 	struct iovec iov[1];
 
+	if (features_valid) {
+		*features = own_features;
+		return true;
+	}
+
 	iov[0].iov_base = &msg;
 	iov[0].iov_len  = sizeof(msg);
 
-	return xs_uint(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL), features);
+	if (!xs_uint(xs_talkv(h, iov, ARRAY_SIZE(iov), NULL), &own_features))
+		return false;
+
+	features_valid = true;
+	*features = own_features;
+
+	return true;
 }
 
 bool xs_get_features_domain(struct xs_handle *h, unsigned int domid,
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index d2e2b8b9eb..2e763bc877 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -124,6 +124,8 @@ struct xenstore_domain_interface {
 #define XENSTORE_SERVER_FEATURE_RECONNECTION 1
 /* The presence of the "error" field in the ring page */
 #define XENSTORE_SERVER_FEATURE_ERROR        2
+/* The XS_WATCH command can be used with a <depth> parameter */
+#define XENSTORE_SERVER_FEATURE_WATCHDEPTH   4
 
 /* Valid values for the connection field */
 #define XENSTORE_CONNECTED 0 /* the steady-state */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290060.1569722 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTmf-0007IK-7f; Wed, 22 Apr 2026 09:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290060.1569722; Wed, 22 Apr 2026 09: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 1wFTmf-0007IC-58; Wed, 22 Apr 2026 09:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1290060;
 Wed, 22 Apr 2026 09:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTme-0007I2-AU
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTme-00EE7t-0t
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTme-00FAy3-0j
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=65QSlS3DAnckRjg5dZnJW4fbKuxhUx1Q3NhW0Kzmats=; b=zES+qm+hWR0vLFOCfmnjbmMJ8B
	1C93csq9a8M8KzFRDcZeoaGX/kSKrbR6/vlOMMZUB1s9HbZMmPLXkNt1RLemy7ToOqXbwzqNfkfmm
	1yTooR2u1d6UWPikAVnZpDqBiLWzmeVwEpjKhMxAV8aXQ5faVF7EPeoQXlSO31rpGYt4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: add depth information to watches
Message-Id: <E1wFTme-00FAy3-0j@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:22:12 +0000

commit db98de120cb829f1827b8056df3b53f440b95186
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:06 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:13 2026 +0200

    tools/xenstored: add depth information to watches
    
    Add the depth for matching subdirectories of a watch to the watch
    handling. A depth value of -1 is used for the current model of no
    limit.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/lu.c    |   3 ++
 tools/xenstored/watch.c | 110 +++++++++++++++++++++++++++++++++---------------
 tools/xenstored/watch.h |   1 +
 3 files changed, 81 insertions(+), 33 deletions(-)

diff --git a/tools/xenstored/lu.c b/tools/xenstored/lu.c
index eaffdbc69e..7d9f086a59 100644
--- a/tools/xenstored/lu.c
+++ b/tools/xenstored/lu.c
@@ -183,6 +183,9 @@ void lu_read_state(void)
 		case XS_STATE_TYPE_WATCH:
 			read_state_watch(ctx, state.buf);
 			break;
+		case XS_STATE_TYPE_WATCH_EXT:
+			read_state_watch_ext(ctx, state.buf);
+			break;
 		case XS_STATE_TYPE_TA:
 			xprintf("live-update: ignore transaction record\n");
 			break;
diff --git a/tools/xenstored/watch.c b/tools/xenstored/watch.c
index becb9c339d..42e24d3201 100644
--- a/tools/xenstored/watch.c
+++ b/tools/xenstored/watch.c
@@ -39,26 +39,35 @@ struct watch
 	/* Offset into path for skipping prefix (used for relative paths). */
 	unsigned int prefix_len;
 
+	int depth;	/* -1: no depth limit. */
 	char *token;
 	char *node;
 };
 
 /* Is child a subnode of parent, or equal? */
-static bool is_child(const char *child, const char *parent)
+static bool is_child(const char *child, const char *parent, int depth)
 {
-	unsigned int len = strlen(parent);
-
-	/*
-	 * / should really be "" for this algorithm to work, but that's a
-	 * usability nightmare.
-	 */
-	if (streq(parent, "/"))
-		return true;
+	unsigned int len = strlen(parent);	/* len == 1 if parent is "/". */
+	unsigned int sub_levels = (len == 1) ? 1 : 0;
 
 	if (strncmp(child, parent, len) != 0)
 		return false;
 
-	return child[len] == '/' || child[len] == '\0';
+	if (child[len] != '/' && child[len] != '\0' && len > 1)
+		return false;
+
+	if (depth < 0 || child[len] == '\0')
+		return true;
+
+	while (sub_levels <= depth) {
+		if (child[len] == '\0')
+			return true;
+		if (child[len] == '/')
+			sub_levels++;
+		len++;
+	}
+
+	return false;
 }
 
 static const char *get_watch_path(const struct watch *watch, const char *name)
@@ -145,7 +154,7 @@ void fire_watches(struct connection *conn, const void *ctx, const char *name,
 						   get_watch_path(watch, name),
 						   watch->token);
 			} else {
-				if (is_child(name, watch->node))
+				if (is_child(name, watch->node, watch->depth))
 					send_event(req, i,
 						   get_watch_path(watch, name),
 						   watch->token);
@@ -170,7 +179,7 @@ static int check_watch_path(struct connection *conn, const void *ctx,
 }
 
 static struct watch *add_watch(struct connection *conn, const char *path,
-			       const char *token, bool relative,
+			       const char *token, int depth, bool relative,
 			       bool no_quota_check)
 {
 	struct watch *watch;
@@ -178,6 +187,7 @@ static struct watch *add_watch(struct connection *conn, const char *path,
 	watch = talloc(conn, struct watch);
 	if (!watch)
 		goto nomem;
+	watch->depth = depth;
 	watch->node = talloc_strdup(watch, path);
 	watch->token = talloc_strdup(watch, token);
 	if (!watch->node || !watch->token)
@@ -204,6 +214,7 @@ int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 {
 	struct watch *watch;
 	const char *vec[2];
+	int depth = -1;
 	bool relative;
 
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
@@ -223,7 +234,7 @@ int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 	if (domain_quota_add_exceeds(conn->domain, ACC_WATCH, 1))
 		return ENOSPC;
 
-	watch = add_watch(conn, vec[0], vec[1], relative, false);
+	watch = add_watch(conn, vec[0], vec[1], depth, relative, false);
 	if (!watch)
 		return errno;
 
@@ -287,28 +298,47 @@ const char *dump_state_watches(FILE *fp, struct connection *conn,
 	const char *ret = NULL;
 	struct watch *watch;
 	struct xs_state_watch sw;
+	struct xs_state_watch_ext swe;
 	struct xs_state_record_header head;
 	const char *path;
-
-	head.type = XS_STATE_TYPE_WATCH;
+	size_t path_len, token_len;
 
 	list_for_each_entry(watch, &conn->watches, list) {
-		head.length = sizeof(sw);
-
-		sw.conn_id = conn_id;
 		path = get_watch_path(watch, watch->node);
-		sw.path_length = strlen(path) + 1;
-		sw.token_length = strlen(watch->token) + 1;
-		head.length += sw.path_length + sw.token_length;
+		path_len = strlen(path) + 1;
+		token_len = strlen(watch->token) + 1;
+
+		if (watch->depth >= 0) {
+			head.type = XS_STATE_TYPE_WATCH_EXT;
+			head.length = sizeof(swe);
+			swe.conn_id = conn_id;
+			swe.path_length = path_len;
+			swe.token_length = token_len;
+			swe.depth = watch->depth;
+		} else {
+			head.type = XS_STATE_TYPE_WATCH;
+			head.length = sizeof(sw);
+			sw.conn_id = conn_id;
+			sw.path_length = path_len;
+			sw.token_length = token_len;
+		}
+
+		head.length += path_len + token_len;
 		head.length = ROUNDUP(head.length, 3);
 		if (fwrite(&head, sizeof(head), 1, fp) != 1)
 			return "Dump watch state error";
-		if (fwrite(&sw, sizeof(sw), 1, fp) != 1)
-			return "Dump watch state error";
 
-		if (fwrite(path, sw.path_length, 1, fp) != 1)
+		if (watch->depth >= 0) {
+			if (fwrite(&swe, sizeof(sw), 1, fp) != 1)
+				return "Dump watch state ext error";
+		} else {
+			if (fwrite(&sw, sizeof(sw), 1, fp) != 1)
+				return "Dump watch state error";
+		}
+
+		if (fwrite(path, path_len, 1, fp) != 1)
 			return "Dump watch path error";
-		if (fwrite(watch->token, sw.token_length, 1, fp) != 1)
+		if (fwrite(watch->token, token_len, 1, fp) != 1)
 			return "Dump watch token error";
 
 		ret = dump_state_align(fp);
@@ -319,27 +349,41 @@ const char *dump_state_watches(FILE *fp, struct connection *conn,
 	return ret;
 }
 
-void read_state_watch(const void *ctx, const void *state)
+static void process_state_watch(const void *ctx, unsigned int conn_id,
+				const char *path, const char *token,
+				int depth)
 {
-	const struct xs_state_watch *sw = state;
 	struct connection *conn;
-	const char *path, *token;
 	bool relative;
 
-	conn = get_connection_by_id(sw->conn_id);
+	conn = get_connection_by_id(conn_id);
 	if (!conn)
 		barf("connection not found for read watch");
 
-	path = (char *)sw->data;
-	token = path + sw->path_length;
-
 	/* Don't check success, we want the relative information only. */
 	check_watch_path(conn, ctx, &path, &relative);
 	if (!path)
 		barf("allocation error for read watch");
 
-	if (!add_watch(conn, path, token, relative, true))
+	if (!add_watch(conn, path, token, depth, relative, true))
 		barf("error adding watch");
+
+}
+
+void read_state_watch(const void *ctx, const void *state)
+{
+	const struct xs_state_watch *sw = state;
+
+	process_state_watch(ctx, sw->conn_id, (char *)sw->data,
+			    (char *)sw->data + sw->path_length, -1);
+}
+
+void read_state_watch_ext(const void *ctx, const void *state)
+{
+	const struct xs_state_watch_ext *swe = state;
+
+	process_state_watch(ctx, swe->conn_id, (char *)swe->data,
+			    (char *)swe->data + swe->path_length, swe->depth);
 }
 
 /*
diff --git a/tools/xenstored/watch.h b/tools/xenstored/watch.h
index d9ac6a334a..afdfdc6b2f 100644
--- a/tools/xenstored/watch.h
+++ b/tools/xenstored/watch.h
@@ -37,5 +37,6 @@ const char *dump_state_watches(FILE *fp, struct connection *conn,
 			       unsigned int conn_id);
 
 void read_state_watch(const void *ctx, const void *state);
+void read_state_watch_ext(const void *ctx, const void *state);
 
 #endif /* _XENSTORED_WATCH_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290061.1569727 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTmp-0007M1-9N; Wed, 22 Apr 2026 09:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290061.1569727; Wed, 22 Apr 2026 09: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 1wFTmp-0007Lt-6U; Wed, 22 Apr 2026 09:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1290061;
 Wed, 22 Apr 2026 09:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTmo-0007Lk-Dk
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTmo-00EE85-1H
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTmo-00FAyP-15
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zyYlrR3EY3okqfgbi2rlBlW2hlHn1906Orq9VXPGNjA=; b=TZC2Kmh05KEsRQF98RuGkDZqBw
	Yvi4S97LYX8l4GIPwxjNcoDaiMakLSMH9c2ue3G5/3BUmrubUTuaF7YfSrELXi557Qnk84V0iEL2g
	EZlWyCL9XqmY0MCA5WcTU+fBzPgzNCcinVVQXA0F+6SbLJAVVLWzWdmwf0GoLgX1Vp84=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: add depth handling to XS_WATCH
Message-Id: <E1wFTmo-00FAyP-15@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:22:22 +0000

commit 7d96cab925159e05a2404d16a5aea0af05db6fba
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:18 2026 +0200

    tools/xenstored: add depth handling to XS_WATCH
    
    In case XENSTORE_SERVER_FEATURE_WATCHDEPTH is set, allow XS_WATCH to
    have "depth" as 3rd parameter.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/domain.c |  8 ++++++++
 tools/xenstored/domain.h |  2 ++
 tools/xenstored/watch.c  | 11 +++++++++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index b0b339f569..7f2fa16cf2 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -390,6 +390,14 @@ void wrl_apply_debit_trans_commit(struct connection *conn)
 	wrl_apply_debit_actual(conn->domain);
 }
 
+bool feature_available(const struct connection *conn, unsigned int feature)
+{
+	if (!conn->domain)
+		return XENSTORE_FEATURES & feature;
+
+	return conn->domain->features & feature;
+}
+
 static unsigned int domain_get_soft_quota(struct domain *d, enum accitem what)
 {
 	if (d && d->acc[what].val[Q_IDX_SOFT] != Q_VAL_DISABLED)
diff --git a/tools/xenstored/domain.h b/tools/xenstored/domain.h
index ca38b5e0ea..b1cfb5cd82 100644
--- a/tools/xenstored/domain.h
+++ b/tools/xenstored/domain.h
@@ -188,4 +188,6 @@ struct hashtable *domain_check_acc_init(void);
 void domain_check_acc_add(const struct node *node, struct hashtable *domains);
 void domain_check_acc(struct hashtable *domains);
 
+bool feature_available(const struct connection *conn, unsigned int feature);
+
 #endif /* _XENSTORED_DOMAIN_H */
diff --git a/tools/xenstored/watch.c b/tools/xenstored/watch.c
index 42e24d3201..860c219f29 100644
--- a/tools/xenstored/watch.c
+++ b/tools/xenstored/watch.c
@@ -213,11 +213,18 @@ static struct watch *add_watch(struct connection *conn, const char *path,
 int do_watch(const void *ctx, struct connection *conn, struct buffered_data *in)
 {
 	struct watch *watch;
-	const char *vec[2];
+	const char *vec[3];
+	unsigned int n_pars;
 	int depth = -1;
 	bool relative;
 
-	if (get_strings(in, vec, ARRAY_SIZE(vec)) != ARRAY_SIZE(vec))
+	n_pars = get_strings(in, vec, ARRAY_SIZE(vec));
+	if (n_pars == 3 &&
+	    feature_available(conn, XENSTORE_SERVER_FEATURE_WATCHDEPTH)) {
+		depth = atoi(vec[2]);
+		if (depth < 0)
+			return EINVAL;
+	} else if (n_pars != 2)
 		return EINVAL;
 
 	errno = check_watch_path(conn, ctx, &(vec[0]), &relative);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290062.1569731 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTn0-0007O5-AL; Wed, 22 Apr 2026 09:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290062.1569731; Wed, 22 Apr 2026 09:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTn0-0007Nx-7r; Wed, 22 Apr 2026 09:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1290062;
 Wed, 22 Apr 2026 09:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTmy-0007No-Gc
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTmy-00EE89-1Z
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTmy-00FAyl-1S
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BCmT+KjQV+W6qzJuZsfgwoNrUpi6lCBhzxMx6IwH71s=; b=0TJPu5GdQmmVmig0qH7DxceNrn
	lrKDwThMTB40elKzXaF5p/upPHRz6MSUGHw4U78aK9w8dBvlRjdA7jVH06OElVOkwO/qdkoV3j0y/
	OZcD10uwgvX0UB4yPrJwAlWj0EfEvdrG3lz+lSc1qFCTWP3ITNinqCbTHdyeEjuvdY1s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: replace the fire_watches() exact parameter
Message-Id: <E1wFTmy-00FAyl-1S@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:22:32 +0000

commit d58175d7f6f9560f178651f08098bad747a12d66
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:23 2026 +0200

    tools/xenstored: replace the fire_watches() exact parameter
    
    Today fire_watches() has the boolean "exact" parameter specifying how
    the matching of the modified node with registered watches is to be
    handled (only the exact node name is matching or all nodes being
    in the subtree beneath the watched node).
    
    For the handling of <special-watch>/<domid> watch events 2 additional
    matching possibility needs to be added, as those events should only
    be delivered to clients having requested such events, either by
    watching <special-watch> with the depth=1 parameter, or by directly
    watching for <special-watch>/<domid>, while the traditional special
    watch events should NOT delivered to those watchers.
    
    For this purpose rename the "exact" parameter to "match" and make it
    an enum with four possible values.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/core.c        | 12 ++++++------
 tools/xenstored/transaction.c | 14 ++++++++------
 tools/xenstored/transaction.h |  4 +++-
 tools/xenstored/watch.c       | 42 ++++++++++++++++++++++++++++++------------
 tools/xenstored/watch.h       |  9 ++++++++-
 5 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 807a8e6710..f92fca6e9e 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -1613,7 +1613,7 @@ static int do_write(const void *ctx, struct connection *conn,
 			return errno;
 	}
 
-	fire_watches(conn, ctx, name, node, false, NULL);
+	fire_watches(conn, ctx, name, node, MATCH_SUBTREE, NULL);
 	send_ack(conn, XS_WRITE);
 
 	return 0;
@@ -1637,7 +1637,7 @@ static int do_mkdir(const void *ctx, struct connection *conn,
 		node = create_node(conn, ctx, name, NULL, 0);
 		if (!node)
 			return errno;
-		fire_watches(conn, ctx, name, node, false, NULL);
+		fire_watches(conn, ctx, name, node, MATCH_SUBTREE, NULL);
 	}
 	send_ack(conn, XS_MKDIR);
 
@@ -1683,7 +1683,7 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 		       struct node *node, void *arg)
 {
 	const char *root = arg;
-	bool watch_exact;
+	enum watch_match watch_match;
 	int ret;
 	const char *db_name;
 
@@ -1703,8 +1703,8 @@ static int delnode_sub(const void *ctx, struct connection *conn,
 	 * This fine as we are single threaded and the next possible read will
 	 * be handled only after the node has been really removed.
 	*/
-	watch_exact = strcmp(root, node->name);
-	fire_watches(conn, ctx, node->name, node, watch_exact, NULL);
+	watch_match = strcmp(root, node->name) ? MATCH_EXACT : MATCH_SUBTREE;
+	fire_watches(conn, ctx, node->name, node, watch_match, NULL);
 
 	return WALK_TREE_RM_CHILDENTRY;
 }
@@ -1858,7 +1858,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (write_node(conn, node, NODE_MODIFY, false))
 		return errno;
 
-	fire_watches(conn, ctx, name, node, false, &old_perms);
+	fire_watches(conn, ctx, name, node, MATCH_SUBTREE, &old_perms);
 	send_ack(conn, XS_SET_PERMS);
 
 	return 0;
diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 47cd6ecd3c..ec5b122a3f 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -134,7 +134,7 @@ struct accessed_node
 
 	/* Watch event flags. */
 	bool fire_watch;
-	bool watch_exact;
+	enum watch_match watch_match;
 };
 
 struct transaction
@@ -327,8 +327,10 @@ err:
  * A watch event should be fired for a node modified inside a transaction.
  * Set the corresponding information. A non-exact event is replacing an exact
  * one, but not the other way round.
+ * No special watch handling needed here, so MATCH_DEPTH is no issue.
  */
-void queue_watches(struct connection *conn, const char *name, bool watch_exact)
+void queue_watches(struct connection *conn, const char *name,
+		   enum watch_match watch_match)
 {
 	struct accessed_node *i;
 
@@ -340,9 +342,9 @@ void queue_watches(struct connection *conn, const char *name, bool watch_exact)
 
 	if (!i->fire_watch) {
 		i->fire_watch = true;
-		i->watch_exact = watch_exact;
-	} else if (!watch_exact) {
-		i->watch_exact = false;
+		i->watch_match = watch_match;
+	} else if (watch_match == MATCH_SUBTREE) {
+		i->watch_match = MATCH_SUBTREE;
 	}
 }
 
@@ -419,7 +421,7 @@ static int finalize_transaction(struct connection *conn,
 				db_delete(conn, i->node, NULL);
 		}
 		if (i->fire_watch)
-			fire_watches(conn, trans, i->node, NULL, i->watch_exact,
+			fire_watches(conn, trans, i->node, NULL, i->watch_match,
 				     i->perms.p ? &i->perms : NULL);
 
 		list_del(&i->list);
diff --git a/tools/xenstored/transaction.h b/tools/xenstored/transaction.h
index 90435b4fc9..b4f5f757e2 100644
--- a/tools/xenstored/transaction.h
+++ b/tools/xenstored/transaction.h
@@ -18,6 +18,7 @@
 #ifndef _XENSTORED_TRANSACTION_H
 #define _XENSTORED_TRANSACTION_H
 #include "core.h"
+#include "watch.h"
 
 enum node_access_type {
     NODE_ACCESS_READ,
@@ -44,7 +45,8 @@ int __must_check access_node(struct connection *conn, struct node *node,
                              enum node_access_type type, const char **db_name);
 
 /* Queue watches for a modified node. */
-void queue_watches(struct connection *conn, const char *name, bool watch_exact);
+void queue_watches(struct connection *conn, const char *name,
+		   enum watch_match watch_match);
 
 /* Prepend the transaction to name if appropriate. */
 const char *transaction_prepend(struct connection *conn, const char *name);
diff --git a/tools/xenstored/watch.c b/tools/xenstored/watch.c
index 860c219f29..a9a06e9e48 100644
--- a/tools/xenstored/watch.c
+++ b/tools/xenstored/watch.c
@@ -128,7 +128,8 @@ static bool watch_permitted(struct connection *conn, const void *ctx,
  * watch event, too.
  */
 void fire_watches(struct connection *conn, const void *ctx, const char *name,
-		  const struct node *node, bool exact, struct node_perms *perms)
+		  const struct node *node, enum watch_match match,
+		  struct node_perms *perms)
 {
 	struct connection *i;
 	struct buffered_data *req;
@@ -136,7 +137,7 @@ void fire_watches(struct connection *conn, const void *ctx, const char *name,
 
 	/* During transactions, don't fire watches, but queue them. */
 	if (conn && conn->transaction) {
-		queue_watches(conn, name, exact);
+		queue_watches(conn, name, match);
 		return;
 	}
 
@@ -148,17 +149,34 @@ void fire_watches(struct connection *conn, const void *ctx, const char *name,
 			continue;
 
 		list_for_each_entry(watch, &i->watches, list) {
-			if (exact) {
-				if (streq(name, watch->node))
-					send_event(req, i,
-						   get_watch_path(watch, name),
-						   watch->token);
-			} else {
-				if (is_child(name, watch->node, watch->depth))
-					send_event(req, i,
-						   get_watch_path(watch, name),
-						   watch->token);
+			bool send = false;
+
+			switch (match) {
+			case MATCH_EXACT:
+				send = streq(name, watch->node);
+				break;
+
+			case MATCH_SUBTREE:
+				send = is_child(name, watch->node,
+						watch->depth);
+				break;
+
+			case MATCH_DEPTH:
+				send = streq(name, watch->node) ||
+				       (watch->depth > 0 &&
+					is_child(name, watch->node,
+						 watch->depth));
+				break;
+
+			case MATCH_NODEPTH:
+				send = streq(name, watch->node) &&
+				       watch->depth < 0;
+				break;
 			}
+
+			if (send)
+				send_event(req, i, get_watch_path(watch, name),
+					   watch->token);
 		}
 	}
 }
diff --git a/tools/xenstored/watch.h b/tools/xenstored/watch.h
index afdfdc6b2f..692343389f 100644
--- a/tools/xenstored/watch.h
+++ b/tools/xenstored/watch.h
@@ -27,8 +27,15 @@ int do_unwatch(const void *ctx, struct connection *conn,
 	       struct buffered_data *in);
 
 /* Fire all watches: !exact means all the children are affected (ie. rm). */
+enum watch_match {
+	MATCH_EXACT,
+	MATCH_SUBTREE,
+	MATCH_DEPTH,	/* watches with depth > 0, MATCH_SUBTREE semantics */
+	MATCH_NODEPTH	/* watches with no depth, MATCH_EXACT semantics */
+};
+
 void fire_watches(struct connection *conn, const void *tmp, const char *name,
-		  const struct node *node, bool exact,
+		  const struct node *node, enum watch_match match,
 		  struct node_perms *perms);
 
 void conn_delete_all_watches(struct connection *conn);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290063.1569734 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTnA-0007QN-C7; Wed, 22 Apr 2026 09:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290063.1569734; Wed, 22 Apr 2026 09:22: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 1wFTnA-0007QF-9E; Wed, 22 Apr 2026 09:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1290063;
 Wed, 22 Apr 2026 09:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTn8-0007Q8-K1
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTn8-00EE8I-1u
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTn8-00FAzB-1k
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PqWEcxjVb77QvOQNlAodmrWjiolboZXyTO9RV4apwJs=; b=aMKL9tEPDw5ClEuhcM/8aZx2Zj
	FylJsvamBZ1Aim6vp6kniSnmNogJHNUWrs09F73R0sjQZdLpzIcJtulj9Rz4tIT8WuvAfSPQgfnrR
	G2SImd+xnfvQewYr4+E6xfcHxiJgJGCJuevp3zm9bPAGl1iYchAWHzPPF0MCi/R9UJJE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: expand special watch handling with depth feature
Message-Id: <E1wFTn8-00FAzB-1k@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:22:42 +0000

commit 8032c10dbb102f61e13ed34896bf684a47d319e2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:28 2026 +0200

    tools/xenstored: expand special watch handling with depth feature
    
    With XENSTORE_SERVER_FEATURE_WATCHDEPTH available, special watch
    handling needs to be extended:
    
    - when a special watch is set with depth = 1, the domid is added to
      the watch event
    
    - it is possible to watch for @releaseDomain/<domid>
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/domain.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 7f2fa16cf2..a5258dae6d 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -616,7 +616,12 @@ static void domain_tree_remove(struct domain *domain)
 	walk_node_tree(domain, NULL, "@introduceDomain", &walkfuncs, domain);
 }
 
-static void fire_special_watches(const char *name)
+#define WATCH_NODOM	1	/* Fire watches without <domid> extension. */
+#define WATCH_DOM	2	/* Fire watches with <domid> extension. */
+#define WATCH_BOTH	(WATCH_NODOM | WATCH_DOM)
+
+static void fire_special_watches(const char *name, unsigned int domid,
+				 unsigned int watchdom_flag)
 {
 	void *ctx = talloc_new(NULL);
 	const struct node *node;
@@ -626,9 +631,19 @@ static void fire_special_watches(const char *name)
 
 	node = read_node_const(NULL, ctx, name);
 
-	if (node)
-		fire_watches(NULL, ctx, name, node, true, NULL);
-	else
+	if (node) {
+		if (watchdom_flag & WATCH_NODOM)
+			fire_watches(NULL, ctx, name, node, MATCH_NODEPTH,
+				     NULL);
+		if (watchdom_flag & WATCH_DOM) {
+			char name_dom[24]; /* max. "@introduceDomain/domid" */
+
+			snprintf(name_dom, sizeof(name_dom),
+				 "%s/%u", name, domid);
+			fire_watches(NULL, ctx, name_dom, node, MATCH_DEPTH,
+				     NULL);
+		}
+	} else
 		log("special node %s not found\n", name);
 
 	talloc_free(ctx);
@@ -653,7 +668,7 @@ static int destroy_domain(void *_domain)
 	if (domain->interface)
 		unmap_interface(domain->domid, domain->interface);
 
-	fire_special_watches("@releaseDomain");
+	fire_special_watches("@releaseDomain", domain->domid, WATCH_BOTH);
 
 	wrl_domain_destroy(domain);
 
@@ -681,6 +696,8 @@ static int do_check_domain(struct domain *domain, bool *notify,
 		if ((state & XENMANAGE_GETDOMSTATE_STATE_SHUTDOWN)
 		    && !domain->shutdown) {
 			domain->shutdown = true;
+			fire_special_watches("@releaseDomain", domain->domid,
+					     WATCH_DOM);
 			*notify = true;
 		}
 		if (!(state & XENMANAGE_GETDOMSTATE_STATE_DEAD))
@@ -723,7 +740,7 @@ void check_domains(void)
 		;
 
 	if (notify)
-		fire_special_watches("@releaseDomain");
+		fire_special_watches("@releaseDomain", 0, WATCH_NODOM);
 }
 
 static struct domain *find_domain_struct(unsigned int domid)
@@ -747,7 +764,7 @@ static void do_check_domains(void)
 	}
 
 	if (notify)
-		fire_special_watches("@releaseDomain");
+		fire_special_watches("@releaseDomain", 0, WATCH_NODOM);
 }
 
 /* We scan all domains rather than use the information given here. */
@@ -1112,7 +1129,8 @@ static struct domain *introduce_domain(const void *ctx,
 		talloc_steal(domain->conn, domain);
 
 		if (!is_priv_domain && !restore)
-			fire_special_watches("@introduceDomain");
+			fire_special_watches("@introduceDomain", domid,
+					     WATCH_BOTH);
 	} else {
 		/* Use XS_INTRODUCE for recreating the xenbus event-channel. */
 		if (domain->port)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290064.1569738 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTnK-0007Ss-F2; Wed, 22 Apr 2026 09:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290064.1569738; Wed, 22 Apr 2026 09:22: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 1wFTnK-0007Si-CD; Wed, 22 Apr 2026 09:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1290064;
 Wed, 22 Apr 2026 09:22:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTnI-0007Sa-Mm
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnI-00EE8l-2B
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnI-00FAzX-25
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f35j3M5x9pP1fzdf55Oru91tynOevWdMSJYutyFKNuc=; b=qApidXzpw0g5Jqmunld06xNeNc
	MxFB+lSctrWPdHtApPY4MRZpbNBAtuMspZoU/PD57VYa9Xl2giqHmPPxHEUMf+BgyKgfbQcLoIf/6
	dwhlDtlTciTrvWE79LQvho3cgd2l2UHTwH9KeW0C37YkVE/hlcGS8/yFjoedoIty95rU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: make XENSTORE_SERVER_FEATURE_WATCHDEPTH available
Message-Id: <E1wFTnI-00FAzX-25@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:22:52 +0000

commit 7e7723ea07809a71e7a06396af6dff87496902d3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:58:41 2026 +0200

    tools/xenstored: make XENSTORE_SERVER_FEATURE_WATCHDEPTH available
    
    Add XENSTORE_SERVER_FEATURE_WATCHDEPTH to the available features now
    that all needed support has been added.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index a5258dae6d..00875d6b5c 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -43,7 +43,8 @@
 #include <mini-os/xenbus.h>
 #endif
 
-#define XENSTORE_FEATURES	XENSTORE_SERVER_FEATURE_ERROR
+#define XENSTORE_FEATURES	(XENSTORE_SERVER_FEATURE_ERROR |	\
+				 XENSTORE_SERVER_FEATURE_WATCHDEPTH)
 
 static xenmanage_handle *xm_handle;
 xengnttab_handle **xgt_handle;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290065.1569744 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTnU-0007Uw-GZ; Wed, 22 Apr 2026 09:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290065.1569744; Wed, 22 Apr 2026 09:23: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 1wFTnU-0007Uo-DS; Wed, 22 Apr 2026 09:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1290065;
 Wed, 22 Apr 2026 09:23:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTnS-0007Ud-Pz
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:23:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnS-00EE93-2V
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnS-00FB0A-2M
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Dw3A+eg/cxKkYP3QaqOtEkGZ9cfAYYfR3e+1AuN4o6I=; b=h8pPSQ6wDOzld3IMGMRbgwe0Y8
	ego8LhX81XHiM0W4tMmCmKKXGgRES3Fiep1WnjZUinnbjALSKWygCFqaBRUS5EABQgS3ExiUhYyan
	KZU+cZhcVqVo3akDLNONOS6PNDcxT3ps2hkjDpgiQKtt3F3bUMWL0ibiGScrCMH1WjgI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xs-clients: support depth with xenstore-watch
Message-Id: <E1wFTnS-00FB0A-2M@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:23:02 +0000

commit 464b7f4f267f978302f2758bb6dad3f56fef30d3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:42:11 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:59:03 2026 +0200

    tools/xs-clients: support depth with xenstore-watch
    
    Add a "-d <depth>" parameter to xenstore-watch, allowing to specify
    the depth parameter of the XS_WATCH command.
    
    Using "-d" without support of depth by xenstored will refuse to set
    the watch(es).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 docs/man/xenstore-watch.1.pod      |  9 +++++++++
 tools/xs-clients/xenstore_client.c | 19 +++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/docs/man/xenstore-watch.1.pod b/docs/man/xenstore-watch.1.pod
index de28d380b7..716c5521bc 100644
--- a/docs/man/xenstore-watch.1.pod
+++ b/docs/man/xenstore-watch.1.pod
@@ -17,6 +17,15 @@ event happening.
 
 Show the usage information for xenstore-watch and exit the program.
 
+=item B<-d> B<depth>
+
+Limit the number of sub-directories below the specified I<PATH>s to be
+watched. A B<depth> of 0 will watch only the specified nodes, a B<depth>
+of 1 will watch the specified nodes and their direct children, etc.
+
+Using this option requires xenstored to support the Xenstore watch depth
+feature. In case it is not supported, the B<-d> usage will be rejected.
+
 =item B<-n> B<NR>
 
 Stop waiting after having received B<NR> watch events.
diff --git a/tools/xs-clients/xenstore_client.c b/tools/xs-clients/xenstore_client.c
index 9a25704b91..4a14cb334f 100644
--- a/tools/xs-clients/xenstore_client.c
+++ b/tools/xs-clients/xenstore_client.c
@@ -445,7 +445,7 @@ do_watch(struct xs_handle *xsh, int max_events)
 static int
 perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh,
         xs_transaction_t xth, int prefix, int tidy, int upto, int recurse, int nr_watches,
-        int raw)
+        int raw, int depth)
 {
     switch (mode) {
     case MODE_ls:
@@ -627,8 +627,11 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
             for (; argv[optind]; optind++) {
                 const char *w = argv[optind];
 
-                if (!xs_watch(xsh, w, w))
+                if (depth < 0 && !xs_watch(xsh, w, w))
                     errx(1, "Unable to add watch on %s\n", w);
+                if (depth >= 0 && !xs_watch_depth(xsh, w, w, depth))
+                    errx(1, "Unable to add watch on %s with depth %d\n", w,
+                         depth);
             }
             do_watch(xsh, nr_watches);
         }
@@ -676,6 +679,7 @@ main(int argc, char **argv)
     int nr_watches = -1;
     int transaction;
     int raw = 0;
+    int depth = -1;
     struct winsize ws;
     enum mode mode;
 
@@ -709,10 +713,11 @@ main(int argc, char **argv)
 	    {"recurse", 0, 0, 'r'}, /* MODE_chmod */
 	    {"number",  1, 0, 'n'}, /* MODE_watch */
 	    {"raw",     0, 0, 'R'}, /* MODE_read || MODE_write */
+	    {"depth",   1, 0, 'd'}, /* MODE_watch */
 	    {0, 0, 0, 0}
 	};
 
-	c = getopt_long(argc - switch_argv, argv + switch_argv, "hfspturn:R",
+	c = getopt_long(argc - switch_argv, argv + switch_argv, "hfspturn:Rd:",
 			long_options, &index);
 	if (c == -1)
 	    break;
@@ -766,6 +771,12 @@ main(int argc, char **argv)
 	    else
 		usage(1, mode, switch_argv, argv[0]);
 	    break;
+	case 'd':
+	    if ( mode == MODE_watch )
+		depth = atoi(optarg);
+	    else
+		usage(1, mode, switch_argv, argv[0]);
+	    break;
 	}
     }
 
@@ -819,7 +830,7 @@ again:
 	    errx(1, "couldn't start transaction");
     }
 
-    ret = perform(mode, optind, argc - switch_argv, argv + switch_argv, xsh, xth, prefix, tidy, upto, recurse, nr_watches, raw);
+    ret = perform(mode, optind, argc - switch_argv, argv + switch_argv, xsh, xth, prefix, tidy, upto, recurse, nr_watches, raw, depth);
 
     if (transaction && !xs_transaction_end(xsh, xth, ret)) {
 	if (ret == 0 && errno == EAGAIN) {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:23:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290066.1569747 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTne-0007X2-HP; Wed, 22 Apr 2026 09:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290066.1569747; Wed, 22 Apr 2026 09:23: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 1wFTne-0007Wu-Eq; Wed, 22 Apr 2026 09:23:14 +0000
Received: by outflank-mailman (input) for mailman id 1290066;
 Wed, 22 Apr 2026 09:23:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTnc-0007Wl-Sz
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:23:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnc-00EE97-2n
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnc-00FB0g-2f
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:23: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iJ50k0bdPJJL++vs+1s50LLouGd428ppouBBb9h+60c=; b=eVcazdG7hwZgtRDxrojWR/Y+WT
	uHwtGckaL3axwdjbict9LRzynfkNK/MDLVylpNd7vFUs2kApw6UuuYdhdNvyURCnEfHiHRQtv6/sF
	hkyrYNmqiFIp/96QW9v+1NuWSqCYrxdCqaAHNNg8t34noklEHwNgiEvOFFOJyLsjMQvU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] include: move KB() etc to macros.h
Message-Id: <E1wFTnc-00FB0g-2f@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:23:12 +0000

commit 51074cf2c1544a2a294e86b81b4cf4b682aa1471
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 22 08:59:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 08:59:53 2026 +0200

    include: move KB() etc to macros.h
    
    Allow them to be used by build tools which don't include config.h. (They
    also don't really fit into config.h, as there's nothing "configuration"
    related about them.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/efi/relocs-dummy.S | 1 +
 xen/include/xen/config.h        | 4 ----
 xen/include/xen/macros.h        | 4 ++++
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/efi/relocs-dummy.S b/xen/arch/x86/efi/relocs-dummy.S
index b95fa444da..1fef06ec53 100644
--- a/xen/arch/x86/efi/relocs-dummy.S
+++ b/xen/arch/x86/efi/relocs-dummy.S
@@ -1,3 +1,4 @@
+#include <xen/macros.h>
 
 	.section .reloc, "a", @progbits
 	.balign 4
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 33e6aafa40..dddc8e1920 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -82,10 +82,6 @@
 #define __force
 #define __bitwise
 
-#define KB(_kb)     (_AC(_kb, ULL) << 10)
-#define MB(_mb)     (_AC(_mb, ULL) << 20)
-#define GB(_gb)     (_AC(_gb, ULL) << 30)
-
 /* allow existing code to work with Kconfig variable */
 #define NR_CPUS CONFIG_NR_CPUS
 
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index acd451b335..e29cff791e 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -38,6 +38,10 @@
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
 
+#define KB(_kb)     (_AC(_kb, ULL) << 10)
+#define MB(_mb)     (_AC(_mb, ULL) << 20)
+#define GB(_gb)     (_AC(_gb, ULL) << 30)
+
 #ifndef __ASSEMBLER__
 
 /* Force a compilation error if condition is true */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:23:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290067.1569751 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTno-0007Z0-Is; Wed, 22 Apr 2026 09:23:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290067.1569751; Wed, 22 Apr 2026 09:23: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 1wFTno-0007Yt-G9; Wed, 22 Apr 2026 09:23:24 +0000
Received: by outflank-mailman (input) for mailman id 1290067;
 Wed, 22 Apr 2026 09:23:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTnm-0007Ym-Vs
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:23:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnm-00EE9I-36
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:23:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnm-00FB12-2z
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:23: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sKT3kSw5PpV7VELB8tPm7/5cgl9HrLA4BDlos+JMSIw=; b=danFvc88ryS4rXGiNlU40nrTZn
	n4sOWd3Lfh0hSUWFlYmEJKHppqHv0CqMfqKNQrr3l0M7d2uSHt7NHayqcWWy9TSdvDMQM8eE7Ajlk
	KBY/xF2esxCs11IGlmTMbL3sKvz543sdDKoE1UijLDZm9ODOGL23jYNq4FRfl+nys8ac=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mkelf32: use xen/macros.h
Message-Id: <E1wFTnm-00FB12-2z@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:23:22 +0000

commit f9af83450e51b37c659322d2297623dcf309b1e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 22 09:00:28 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 09:00:28 2026 +0200

    x86/mkelf32: use xen/macros.h
    
    Avoid open-coding macros we have readily available. Being able to use MB()
    there might have avoided the flaw corrected by 5416c455f656 ("x86/mkelf32:
    Actually pad load segment to 2 MiB boundary").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/boot/mkelf32.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c
index 469d1ba0af..ac5695c0e6 100644
--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -17,7 +17,9 @@
 #include <unistd.h>
 #include <inttypes.h>
 
+#include "../../../include/xen/const.h"
 #include "../../../include/xen/elfstructs.h"
+#include "../../../include/xen/macros.h"
 
 #define DYNAMICALLY_FILLED   0
 #define RAW_OFFSET         128
@@ -345,7 +347,7 @@ int main(int argc, char **argv)
      * the Xen image using 2M pages.  To avoid running into adjacent non-RAM
      * regions, pad the segment to the next 2M boundary.
      */
-    mem_siz = ((uint32_t)in64_phdr.p_memsz + (1U << 21) - 1) & (-1U << 21);
+    mem_siz = ROUNDUP((uint32_t)in64_phdr.p_memsz, MB(2));
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 09:23:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 09:23:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290068.1569755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFTny-0007b2-Kq; Wed, 22 Apr 2026 09:23:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290068.1569755; Wed, 22 Apr 2026 09:23: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 1wFTny-0007au-He; Wed, 22 Apr 2026 09:23:34 +0000
Received: by outflank-mailman (input) for mailman id 1290068;
 Wed, 22 Apr 2026 09:23:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFTnx-0007ao-2N
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 09:23:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnx-00EE9M-09
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:23:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFTnx-00FB1O-03
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 09:23: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nc65cAVvT9BRYT8gSlTh5lnwAd7QQOgwMAzqTfaE97s=; b=CFSUjY3leQce33IpFKNegqpb5d
	w9kInWlqswjbn7Z6UGqrqIHGMk/Iv3rssleUSQ5a4nQG7iUBaGUDLBi7yFU0N6Un25MPIG2Mgf4nL
	0XqoKLkmiQ/4HC1quCUeoadcIK08yseDuZ1nVf6Br6ebaV3xS/Y4Fp64DCvylgkIbORw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: allow Xen to use SSTC while hiding it from guests
Message-Id: <E1wFTnx-00FB1O-03@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 09:23:33 +0000

commit 25e03273069036f5b46e14bbdf396ac79805d07e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Apr 22 09:01:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 22 09:01:09 2026 +0200

    xen/riscv: allow Xen to use SSTC while hiding it from guests
    
    OpenSBI currently does not advertise the SSTC extension via the device
    tree, so if SSTC support is detected by Xen the riscv_isa bitmap is updated
    manually. Furthermore, removing the "sstc" string from riscv,isa is not
    a reliable way to disable SSTC, because OpenSBI probes support by
    attempting to access CSR_STIMECMP.
    
    Introduce a runtime probe in Xen to determine whether SSTC is available.
    The probe attempts to read CSR_STIMECMP using csr_read_safe(). If the
    access succeeds, SSTC is considered available; if a trap occurs, it is
    treated as unsupported.
    
    When SSTC is detected, Xen may use it internally to program timers.
    However, the extension is not exposed to guests because the required
    context switch handling for the SSTC CSRs is not yet implemented.
    
    Note: clearing RISCV_ISA_EXT_sstc from the DTS riscv,isa property is
    deferred to a follow-up patch. Also, the corresponding HENVCFG bit is
    not set so guests fall back to the SBI timer interface. Timer requests
    are then handled by Xen via the usual SBI interception path.
    
    Introduce set_xen_timer() to abstract how the timer is programmed,
    either via the SSTC extension or an SBI call.
    
    Drop sbi_set_timer() as it is more than enough to have only introduced
    set_xen_timer().
    
    Drop "SBI v0.2 TIME extension detected" message to avoid confusion
    which set timer function is really used.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/cpufeature.c                 | 18 +++++++++++++
 xen/arch/riscv/include/asm/cpufeature.h     |  1 +
 xen/arch/riscv/include/asm/csr.h            | 15 +++++++++++
 xen/arch/riscv/include/asm/riscv_encoding.h |  2 ++
 xen/arch/riscv/include/asm/sbi.h            | 18 -------------
 xen/arch/riscv/include/asm/time.h           |  3 +++
 xen/arch/riscv/sbi.c                        | 29 +++++++++++++++-----
 xen/arch/riscv/time.c                       | 42 ++++++++++++++++++-----------
 xen/arch/riscv/vtimer.c                     |  1 +
 9 files changed, 90 insertions(+), 39 deletions(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 03e27b037b..92235fdfd5 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -17,6 +17,7 @@
 #include <xen/sections.h>
 
 #include <asm/cpufeature.h>
+#include <asm/csr.h>
 
 #ifdef CONFIG_ACPI
 # error "cpufeature.c functions should be updated to support ACPI"
@@ -139,6 +140,7 @@ const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {
     RISCV_ISA_EXT_DATA(smaia),
     RISCV_ISA_EXT_DATA(smstateen),
     RISCV_ISA_EXT_DATA(ssaia),
+    RISCV_ISA_EXT_DATA(sstc),
     RISCV_ISA_EXT_DATA(svade),
     RISCV_ISA_EXT_DATA(svpbmt),
 };
@@ -483,6 +485,7 @@ void __init riscv_fill_hwcap(void)
     unsigned int i;
     const size_t req_extns_amount = ARRAY_SIZE(required_extensions);
     bool all_extns_available = true;
+    unsigned long tmp;
 
     riscv_fill_hwcap_from_isa_string();
 
@@ -495,6 +498,21 @@ void __init riscv_fill_hwcap(void)
         panic("HW capabilities parsing failed: %s\n", failure_msg);
     }
 
+    if ( csr_read_safe(CSR_STIMECMP, &tmp) )
+    {
+        dprintk(XENLOG_DEBUG,
+                "SSTC detected; supported for Xen use, but not for guests\n");
+
+        /*
+         * As there is no any guarantee that SSTC will be added to riscv,isa
+         * property by OpenSBI(it doesn't add it now) or whatever ran before
+         * Xen, it is needed to set this bit manually.
+         *
+         * Guest isolation is maintained by not setting ENVCFG_STCE in henvcfg.
+         */
+        __set_bit(RISCV_ISA_EXT_sstc, riscv_isa);
+    }
+
     for ( i = 0; i < req_extns_amount; i++ )
     {
         const struct riscv_isa_ext_data ext = required_extensions[i];
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index ef02a3e26d..0c48d57a03 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -38,6 +38,7 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_smaia,
     RISCV_ISA_EXT_smstateen,
     RISCV_ISA_EXT_ssaia,
+    RISCV_ISA_EXT_sstc,
     RISCV_ISA_EXT_svade,
     RISCV_ISA_EXT_svpbmt,
     RISCV_ISA_EXT_MAX
diff --git a/xen/arch/riscv/include/asm/csr.h b/xen/arch/riscv/include/asm/csr.h
index 27d4b7942f..888d6a2a86 100644
--- a/xen/arch/riscv/include/asm/csr.h
+++ b/xen/arch/riscv/include/asm/csr.h
@@ -32,6 +32,21 @@
                            : "memory" );                        \
 })
 
+#ifdef CONFIG_RISCV_32
+#define csr_write64(csr, val)       \
+({                                  \
+    uint64_t v_ = (val);            \
+    csr_write(csr, v_);             \
+    csr_write(csr ## H, v_ >> 32);  \
+})
+#else
+#define csr_write64(csr, val)       \
+({                                  \
+    csr_write(csr, val);            \
+    (void)csr ## H;                 \
+})
+#endif
+
 #define csr_swap(csr, val)                                      \
 ({                                                              \
     unsigned long __v = (unsigned long)(val);                   \
diff --git a/xen/arch/riscv/include/asm/riscv_encoding.h b/xen/arch/riscv/include/asm/riscv_encoding.h
index dd15731a86..03e186bcdb 100644
--- a/xen/arch/riscv/include/asm/riscv_encoding.h
+++ b/xen/arch/riscv/include/asm/riscv_encoding.h
@@ -395,6 +395,8 @@
 #define CSR_VSCAUSE			0x242
 #define CSR_VSTVAL			0x243
 #define CSR_VSIP			0x244
+#define CSR_VSTIMECMP		0x24d
+#define CSR_VSTIMECMPH		0x25d
 #define CSR_VSATP			0x280
 
 /* Virtual Interrupts and Interrupt Priorities (H-extension with AIA) */
diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index ed7af20028..1952868e96 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -13,7 +13,6 @@
 #define ASM__RISCV__SBI_H
 
 #include <xen/cpumask.h>
-#include <xen/sections.h>
 
 /* SBI-defined implementation ID */
 #define SBI_XEN_IMPID 7
@@ -139,23 +138,6 @@ int sbi_remote_hfence_gvma(const cpumask_t *cpu_mask, vaddr_t start,
 int sbi_remote_hfence_gvma_vmid(const cpumask_t *cpu_mask, vaddr_t start,
                                 size_t size, unsigned long vmid);
 
-/*
- * Programs the clock for next event at (or after) stime_value. stime_value is
- * in absolute time. This function must clear the pending timer interrupt bit
- * as well.
- *
- * If the supervisor wishes to clear the timer interrupt without scheduling the
- * next timer event, it can either request a timer interrupt infinitely far
- * into the future (i.e., (uint64_t)-1), or it can instead mask the timer
- * interrupt by clearing sie.STIE CSR bit.
- *
- * The stime_value parameter represents absolute time measured in ticks.
- *
- * This SBI call returns 0 upon success or an implementation specific negative
- * error code.
- */
-extern int (* __ro_after_init sbi_set_timer)(uint64_t stime_value);
-
 /*
  * Initialize SBI library
  *
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index be3875b998..4d68900151 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -4,6 +4,7 @@
 
 #include <xen/bug.h>
 #include <xen/muldiv64.h>
+#include <xen/sections.h>
 
 #include <asm/csr.h>
 
@@ -26,6 +27,8 @@ static inline cycles_t get_cycles(void)
 
 void preinit_xen_time(void);
 
+extern int (* __ro_after_init set_xen_timer)(uint64_t deadline);
+
 #endif /* ASM__RISCV__TIME_H */
 
 /*
diff --git a/xen/arch/riscv/sbi.c b/xen/arch/riscv/sbi.c
index b4a7ae6940..3576e26033 100644
--- a/xen/arch/riscv/sbi.c
+++ b/xen/arch/riscv/sbi.c
@@ -22,6 +22,7 @@
 
 #include <asm/processor.h>
 #include <asm/sbi.h>
+#include <asm/time.h>
 
 static unsigned long __ro_after_init sbi_spec_version = SBI_SPEC_VERSION_DEFAULT;
 
@@ -249,6 +250,21 @@ static int (* __ro_after_init sbi_rfence)(unsigned long fid,
                                           unsigned long arg4,
                                           unsigned long arg5);
 
+/*
+ * Programs the clock for next event at (or after) stime_value. stime_value is
+ * in absolute time. This function must clear the pending timer interrupt bit
+ * as well.
+ *
+ * If the supervisor wishes to clear the timer interrupt without scheduling the
+ * next timer event, it can either request a timer interrupt infinitely far
+ * into the future (i.e., (uint64_t)-1), or it can instead mask the timer
+ * interrupt by clearing sie.STIE CSR bit.
+ *
+ * The stime_value parameter represents absolute time measured in ticks.
+ *
+ * This SBI call returns 0 upon success or an implementation specific negative
+ * error code.
+ */
 static int cf_check sbi_set_timer_v02(uint64_t stime_value)
 {
     struct sbiret ret;
@@ -264,6 +280,10 @@ static int cf_check sbi_set_timer_v02(uint64_t stime_value)
     return sbi_err_map_xen_errno(ret.error);
 }
 
+/*
+ * Legacy SBI v0.1 SET_TIMER; functionally equivalent to sbi_set_timer_v02
+ * from Xen's perspective.
+ */
 static int cf_check sbi_set_timer_v01(uint64_t stime_value)
 {
     struct sbiret ret;
@@ -279,8 +299,6 @@ static int cf_check sbi_set_timer_v01(uint64_t stime_value)
     return sbi_err_map_xen_errno(ret.error);
 }
 
-int (* __ro_after_init sbi_set_timer)(uint64_t stime_value) = sbi_set_timer_v01;
-
 int sbi_remote_sfence_vma(const cpumask_t *cpu_mask, vaddr_t start,
                           size_t size)
 {
@@ -360,10 +378,9 @@ int __init sbi_init(void)
         }
 
         if ( sbi_probe_extension(SBI_EXT_TIME) > 0 )
-        {
-            sbi_set_timer = sbi_set_timer_v02;
-            dprintk(XENLOG_INFO, "SBI v0.2 TIME extension detected\n");
-        }
+            set_xen_timer = sbi_set_timer_v02;
+        else
+            set_xen_timer = sbi_set_timer_v01;
     }
     else
         panic("Ooops. SBI spec version 0.1 detected. Need to add support");
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 698ab49d12..8769709e52 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -7,12 +7,21 @@
 #include <xen/time.h>
 #include <xen/types.h>
 
+#include <asm/cpufeature.h>
 #include <asm/csr.h>
-#include <asm/sbi.h>
 
 unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */
 uint64_t __ro_after_init boot_clock_cycles;
 
+static int cf_check sstc_set_xen_timer(uint64_t deadline)
+{
+    csr_write64(CSR_STIMECMP, deadline);
+
+    return 0;
+}
+
+int (* __ro_after_init set_xen_timer)(uint64_t deadline);
+
 s_time_t get_s_time(void)
 {
     uint64_t ticks = get_cycles() - boot_clock_cycles;
@@ -61,20 +70,7 @@ int reprogram_timer(s_time_t timeout)
     if ( deadline <= now )
         return 0;
 
-    /*
-     * TODO: When the SSTC extension is supported, it would be preferable to
-     *       use the supervisor timer registers directly here for better
-     *       performance, since an SBI call and mode switch would no longer
-     *       be required.
-     *
-     *       This would also reduce reliance on a specific SBI implementation.
-     *       For example, it is not ideal to panic() if sbi_set_timer() returns
-     *       a non-zero value. Currently it can return 0 or -ENOSUPP, and
-     *       without SSTC we still need an implementation because only the
-     *       M-mode timer is available, and it can only be programmed in
-     *       M-mode.
-     */
-    if ( (rc = sbi_set_timer(deadline)) )
+    if ( (rc = set_xen_timer(deadline)) )
         panic("%s: timer wasn't set because: %d\n", __func__, rc);
 
     /* Enable timer interrupt */
@@ -91,4 +87,20 @@ void __init preinit_xen_time(void)
         panic("%s: ACPI isn't supported\n", __func__);
 
     boot_clock_cycles = get_cycles();
+
+    /* set_xen_timer must have been set by sbi_init() already */
+    ASSERT(set_xen_timer);
+
+    if ( riscv_isa_extension_available(NULL, RISCV_ISA_EXT_sstc) )
+    {
+        set_xen_timer = sstc_set_xen_timer;
+
+        /*
+         * A VS-timer interrupt becomes pending whenever the value of
+         * (time + htimedelta) is greater than or equal to vstimecmp CSR.
+         * Thereby to avoid spurious VS-timer irqs set vstimecmp CSR to
+         * ULONG_MAX.
+         */
+        csr_write64(CSR_STIMECMP, ULONG_MAX);
+    }
 }
diff --git a/xen/arch/riscv/vtimer.c b/xen/arch/riscv/vtimer.c
index afd8a53a73..d5a8dfcb2e 100644
--- a/xen/arch/riscv/vtimer.c
+++ b/xen/arch/riscv/vtimer.c
@@ -4,6 +4,7 @@
 #include <xen/sched.h>
 #include <xen/timer.h>
 
+#include <asm/cpufeature.h>
 #include <asm/vtimer.h>
 
 static void vtimer_expired(void *data)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 16:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 16:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290896.1570334 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFaVa-0004gV-S6; Wed, 22 Apr 2026 16:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290896.1570334; Wed, 22 Apr 2026 16: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 1wFaVa-0004gN-PY; Wed, 22 Apr 2026 16:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1290896;
 Wed, 22 Apr 2026 16:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFaVa-0004gH-4c
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 16:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFaVa-00EMaU-0A
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 16:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFaVa-00FVms-01
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qhRpmfkUXlHIp0NE3ljYRsnsoXIeRe2c7BJtItkJEAU=; b=DRLe2tK8aGPSNjgWScsFHKYCGW
	l64dp4NlS09ETy4FNnoDxBZaiftTXFS5YNMhpoFAnoS63FpgHz1lX303ANenV0A7sc8ybUZfISa1s
	u6l9ViR9IFP1BNWN8Qlmz1hZM17pqJ0OTD2it4vKTCYtd8F0Bv8ogfwQ3/Mxnmap9+WA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: introduce helper to detect per-domain L1 entries that need freeing
Message-Id: <E1wFaVa-00FVms-01@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 16:33:02 +0000

commit 0443b0ee4b72de63c523b566b90dfa52040767e9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Nov 27 10:55:12 2024 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 22 16:22:49 2026 +0200

    x86/mm: introduce helper to detect per-domain L1 entries that need freeing
    
    L1 present entries that require the underlying page to be freed have the
    _PAGE_AVAIL0 bit set, introduce a helper to unify the checking logic into a
    single place.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 4c404b6c13..b2b03da52b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -6204,6 +6204,12 @@ void __iomem *__init ioremap_wc(paddr_t pa, size_t len)
     return (void __force __iomem *)(va ? va + offs : NULL);
 }
 
+static bool perdomain_l1e_needs_freeing(l1_pgentry_t l1e)
+{
+    return (l1e_get_flags(l1e) & (_PAGE_PRESENT | _PAGE_AVAIL0)) ==
+           (_PAGE_PRESENT | _PAGE_AVAIL0);
+}
+
 int create_perdomain_mapping(struct domain *d, unsigned long va,
                              unsigned int nr, l1_pgentry_t **pl1tab,
                              struct page_info **ppg)
@@ -6356,9 +6362,7 @@ void destroy_perdomain_mapping(struct domain *d, unsigned long va,
 
                 for ( ; nr && i < L1_PAGETABLE_ENTRIES; --nr, ++i )
                 {
-                    if ( (l1e_get_flags(l1tab[i]) &
-                          (_PAGE_PRESENT | _PAGE_AVAIL0)) ==
-                         (_PAGE_PRESENT | _PAGE_AVAIL0) )
+                    if ( perdomain_l1e_needs_freeing(l1tab[i]) )
                         free_domheap_page(l1e_get_page(l1tab[i]));
                     l1tab[i] = l1e_empty();
                 }
@@ -6408,9 +6412,7 @@ void free_perdomain_mappings(struct domain *d)
                         unsigned int k;
 
                         for ( k = 0; k < L1_PAGETABLE_ENTRIES; ++k )
-                            if ( (l1e_get_flags(l1tab[k]) &
-                                  (_PAGE_PRESENT | _PAGE_AVAIL0)) ==
-                                 (_PAGE_PRESENT | _PAGE_AVAIL0) )
+                            if ( perdomain_l1e_needs_freeing(l1tab[k]) )
                                 free_domheap_page(l1e_get_page(l1tab[k]));
 
                         unmap_domain_page(l1tab);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 16:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 16:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1290897.1570338 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFaVk-0004iH-TT; Wed, 22 Apr 2026 16:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1290897.1570338; Wed, 22 Apr 2026 16: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 1wFaVk-0004i9-Qv; Wed, 22 Apr 2026 16:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1290897;
 Wed, 22 Apr 2026 16:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFaVk-0004hx-5R
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 16:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFaVk-00EMaY-0R
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 16:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFaVk-00FVnO-0K
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 16: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eJX6MowBYK6M4svrBkB3Lr/RPhU5q5txRyqCIBUVE64=; b=vOq2+4uO/g4sLAsOYTdmk6Z7Op
	vK5KcCirtvafMmU0hmNonhewHPOzQkkjQxfSIYqtpWAKvPXXF947fCmD0TP51KD/D3oBvXUG8x7HU
	w4ugj78MBwl+j72UnOgU4Ff+LIZe7HydymCg3sVFPQa1XvZYxdCSxShbx3sHRKiwNJUY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenpm: fix FreeBSD build
Message-Id: <E1wFaVk-00FVnO-0K@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 16:33:12 +0000

commit 1096f5f49e204aeae399f5bdd4a18b7a8d8ea8fc
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 21 17:25:12 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 22 16:23:46 2026 +0200

    tools/xenpm: fix FreeBSD build
    
    ENODATA is not defined on FreeBSD:
    
    xenpm.c:1380:17: error: use of undeclared identifier 'ENODATA'
     1380 |         errno = ENODATA;
          |                 ^
    1 error generated.
    
    Fixes: edb657887a60 ("xenpm: Add get-core-temp subcommand")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xenpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 87107bd6c6..ecb39c911d 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -1377,7 +1377,7 @@ static int fetch_dts_temp(xc_interface *xch, uint32_t cpu, bool package, int *te
     {
     case 0:
         /* This CPU isn't online or can't query this MSR */
-        errno = ENODATA;
+        errno = ENODEV;
         return -1;
 
     case 1:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 19:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 19:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1291059.1570384 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFcyU-0007g1-Kz; Wed, 22 Apr 2026 19:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1291059.1570384; Wed, 22 Apr 2026 19: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 1wFcyU-0007ft-IV; Wed, 22 Apr 2026 19:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1291059;
 Wed, 22 Apr 2026 19:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFcyT-0007fn-S7
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 19:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFcyT-00EPR2-2X
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 19:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFcyT-00Fiv7-2Q
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 19: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=r3An07oORG6FIl70B3frAQyGcHkO8F2wnfyC3X9l6ww=; b=F1niQgCwen9+5lSu86be/vdntU
	Gf6PqKHjJ3zezEkXw/PBs8WavVkvB//IW2hKPJl23W2mwNszJBMsqd1t/G5YoHF6VlZi7kWSm60uv
	x1yiq0E0RMdO2kg8iBjsu3oJsIUo7CP2NEiv6HNzJHnWTB9Ua3sd5k7hcCpGzU4+41CE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: introduce helper to detect per-domain L1 entries that need freeing
Message-Id: <E1wFcyT-00Fiv7-2Q@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 19:11:01 +0000

commit 0443b0ee4b72de63c523b566b90dfa52040767e9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Nov 27 10:55:12 2024 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 22 16:22:49 2026 +0200

    x86/mm: introduce helper to detect per-domain L1 entries that need freeing
    
    L1 present entries that require the underlying page to be freed have the
    _PAGE_AVAIL0 bit set, introduce a helper to unify the checking logic into a
    single place.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 4c404b6c13..b2b03da52b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -6204,6 +6204,12 @@ void __iomem *__init ioremap_wc(paddr_t pa, size_t len)
     return (void __force __iomem *)(va ? va + offs : NULL);
 }
 
+static bool perdomain_l1e_needs_freeing(l1_pgentry_t l1e)
+{
+    return (l1e_get_flags(l1e) & (_PAGE_PRESENT | _PAGE_AVAIL0)) ==
+           (_PAGE_PRESENT | _PAGE_AVAIL0);
+}
+
 int create_perdomain_mapping(struct domain *d, unsigned long va,
                              unsigned int nr, l1_pgentry_t **pl1tab,
                              struct page_info **ppg)
@@ -6356,9 +6362,7 @@ void destroy_perdomain_mapping(struct domain *d, unsigned long va,
 
                 for ( ; nr && i < L1_PAGETABLE_ENTRIES; --nr, ++i )
                 {
-                    if ( (l1e_get_flags(l1tab[i]) &
-                          (_PAGE_PRESENT | _PAGE_AVAIL0)) ==
-                         (_PAGE_PRESENT | _PAGE_AVAIL0) )
+                    if ( perdomain_l1e_needs_freeing(l1tab[i]) )
                         free_domheap_page(l1e_get_page(l1tab[i]));
                     l1tab[i] = l1e_empty();
                 }
@@ -6408,9 +6412,7 @@ void free_perdomain_mappings(struct domain *d)
                         unsigned int k;
 
                         for ( k = 0; k < L1_PAGETABLE_ENTRIES; ++k )
-                            if ( (l1e_get_flags(l1tab[k]) &
-                                  (_PAGE_PRESENT | _PAGE_AVAIL0)) ==
-                                 (_PAGE_PRESENT | _PAGE_AVAIL0) )
+                            if ( perdomain_l1e_needs_freeing(l1tab[k]) )
                                 free_domheap_page(l1e_get_page(l1tab[k]));
 
                         unmap_domain_page(l1tab);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 22 19:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Apr 2026 19:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1291061.1570389 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFcyf-0007hz-NK; Wed, 22 Apr 2026 19:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1291061.1570389; Wed, 22 Apr 2026 19: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 1wFcyf-0007hm-Jr; Wed, 22 Apr 2026 19:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1291061;
 Wed, 22 Apr 2026 19:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFcyd-0007hV-Th
 for xen-changelog@lists.xenproject.org; Wed, 22 Apr 2026 19:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFcyd-00EPRH-2r
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 19:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFcyd-00FivT-2i
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Apr 2026 19: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sRi0ELWMxWp8LG+PADiO9UFu/wwO8/4R5/VppO4Nnos=; b=ofxbt4Xuknj6SI59uXqadz4XqS
	PCETiDGl64Q1IV5L8SLA8anlfc553GyrgZ0QzD7MZEUqM0ihDT51VVD58A0SJhELKDM6I3SctWQ6Q
	E6CPB8l9Pf6VEuwqhJHkGKlIM6eeun0hdjXSLxU+SyXbOzBPXu02YfQaOXLLx1MzhsAg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenpm: fix FreeBSD build
Message-Id: <E1wFcyd-00FivT-2i@xenbits.xenproject.org>
Date: Wed, 22 Apr 2026 19:11:11 +0000

commit 1096f5f49e204aeae399f5bdd4a18b7a8d8ea8fc
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Apr 21 17:25:12 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Apr 22 16:23:46 2026 +0200

    tools/xenpm: fix FreeBSD build
    
    ENODATA is not defined on FreeBSD:
    
    xenpm.c:1380:17: error: use of undeclared identifier 'ENODATA'
     1380 |         errno = ENODATA;
          |                 ^
    1 error generated.
    
    Fixes: edb657887a60 ("xenpm: Add get-core-temp subcommand")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/misc/xenpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 87107bd6c6..ecb39c911d 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -1377,7 +1377,7 @@ static int fetch_dts_temp(xc_interface *xch, uint32_t cpu, bool package, int *te
     {
     case 0:
         /* This CPU isn't online or can't query this MSR */
-        errno = ENODATA;
+        errno = ENODEV;
         return -1;
 
     case 1:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 13:22:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 13:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292080.1570672 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFu0I-0006CT-VI; Thu, 23 Apr 2026 13:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292080.1570672; Thu, 23 Apr 2026 13: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 1wFu0I-0006CH-SQ; Thu, 23 Apr 2026 13:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1292080;
 Thu, 23 Apr 2026 13:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFu0I-0006CB-EQ
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 13:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFu0I-00Frij-1B
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 13:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFu0I-00GVMe-11
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 13:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VsCVaCGVLy0hf4hxwO7SgnMS4RiHDJKF/Wg5yuU1Odw=; b=O858M5soPLJgvMDFuiHhjuOiZh
	4jdoygWIO9+Mr6p6P3yACsV9gsZE5vWMU8UTpdgPaxkBVTSpM12iP6gCrpRNQjlddwyHqIdMZt/0H
	PH2DX6I7DzOGx3A2eDEeAcW1LI03AaAhUs+WXCNGoJcWBscWRadaWhPwKW77BArZrrFw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm64: flushtlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI
Message-Id: <E1wFu0I-00GVMe-11@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 13:22:02 +0000

commit 7c502d7591519135765b8041cbd1c70e56e5a0b9
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 14 10:11:24 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 23 15:12:32 2026 +0200

    xen/arm64: flushtlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI
    
    The ARM64_WORKAROUND_REPEAT_TLBI workaround is used to mitigate several
    errata where broadcast TLBI;DSB sequences don't provide all the
    architecturally required synchronization. The workaround performs more
    work than necessary, and can have significant overhead. This patch
    optimizes the workaround, as explained below.
    
    1. All relevant errata only affect the ordering and/or completion of
       memory accesses which have been translated by an invalidated TLB
       entry. The actual invalidation of TLB entries is unaffected.
    
    2. The existing workaround is applied to both broadcast and local TLB
       invalidation, whereas for all relevant errata it is only necessary to
       apply a workaround for broadcast invalidation.
    
    3. The existing workaround replaces every TLBI with a TLBI;DSB;TLBI
       sequence, whereas for all relevant errata it is only necessary to
       execute a single additional TLBI;DSB sequence after any number of
       TLBIs are completed by a DSB.
    
       For example, for a sequence of batched TLBIs:
    
           TLBI <op1>[, <arg1>]
           TLBI <op2>[, <arg2>]
           TLBI <op3>[, <arg3>]
           DSB ISH
    
       ... the existing workaround will expand this to:
    
           TLBI <op1>[, <arg1>]
           DSB ISH                  // additional
           TLBI <op1>[, <arg1>]     // additional
           TLBI <op2>[, <arg2>]
           DSB ISH                  // additional
           TLBI <op2>[, <arg2>]     // additional
           TLBI <op3>[, <arg3>]
           DSB ISH                  // additional
           TLBI <op3>[, <arg3>]     // additional
           DSB ISH
    
       ... whereas it is sufficient to have:
    
           TLBI <op1>[, <arg1>]
           TLBI <op2>[, <arg2>]
           TLBI <op3>[, <arg3>]
           DSB ISH
           TLBI <opX>[, <argX>]     // additional
           DSB ISH                  // additional
    
       Using a single additional TLBI and DSB at the end of the sequence can
       have significantly lower overhead as each DSB which completes a TLBI
       must synchronize with other PEs in the system, with potential
       performance effects both locally and system-wide.
    
    4. The existing workaround repeats each specific TLBI operation, whereas
       for all relevant errata it is sufficient for the additional TLBI to
       use *any* operation which will be broadcast, regardless of which
       translation regime or stage of translation the operation applies to.
    
       For example, for a single TLBI:
    
           TLBI ALLE2IS
           DSB ISH
    
       ... the existing workaround will expand this to:
    
           TLBI ALLE2IS
           DSB ISH
           TLBI ALLE2IS             // additional
           DSB ISH                  // additional
    
       ... whereas it is sufficient to have:
    
           TLBI ALLE2IS
           DSB ISH
           TLBI VALE1IS, XZR        // additional
           DSB ISH                  // additional
    
       As the additional TLBI doesn't have to match a specific earlier TLBI,
       the additional TLBI can be implemented in separate code, with no
       memory of the earlier TLBIs. The additional TLBI can also use a
       cheaper TLBI operation.
    
    5. The existing workaround is applied to both Stage-1 and Stage-2 TLB
       invalidation, whereas for all relevant errata it is only necessary to
       apply a workaround for Stage-1 invalidation.
    
       Architecturally, TLBI operations which invalidate only Stage-2
       information (e.g. IPAS2E1IS) are not required to invalidate TLB
       entries which combine information from Stage-1 and Stage-2
       translation table entries, and consequently may not complete memory
       accesses translated by those combined entries. In these cases,
       completion of memory accesses is only guaranteed after subsequent
       invalidation of Stage-1 information (e.g. VMALLE1IS).
    
    Rework the workaround logic as follows:
     - add TLB_HELPER_LOCAL() to be used for local TLB ops without a
       workaround,
     - modify TLB_HELPER() workaround to use tlbi vale2is, xzr as a second
       TLBI,
     - drop TLB_HELPER_VA(). It's used only by __flush_xen_tlb_one_local
       which is local and does not need workaround and by
       __flush_xen_tlb_one. In the latter case, since it's used in a loop,
       we don't need a workaround in the middle. Add __tlb_repeat_sync with
       a workaround to be used at the end after DSB and before final ISB,
     - TLBI VALE2IS passing XZR is used as an additional TLBI. While there is
       an identity mapping there, it's used very rarely. The performance
       impact is therefore negligible. If things change in the future, we
       can revisit the decision.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/include/asm/arm32/flushtlb.h |   3 +
 xen/arch/arm/include/asm/arm64/flushtlb.h | 108 ++++++++++++++++++------------
 xen/arch/arm/include/asm/flushtlb.h       |   1 +
 xen/arch/arm/include/asm/mmu/layout.h     |   4 ++
 4 files changed, 75 insertions(+), 41 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/flushtlb.h b/xen/arch/arm/include/asm/arm32/flushtlb.h
index 61c25a3189..5483be08fb 100644
--- a/xen/arch/arm/include/asm/arm32/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm32/flushtlb.h
@@ -57,6 +57,9 @@ static inline void __flush_xen_tlb_one(vaddr_t va)
     asm volatile(STORE_CP32(0, TLBIMVAHIS) : : "r" (va) : "memory");
 }
 
+/* Only for ARM64_WORKAROUND_REPEAT_TLBI */
+static inline void __tlb_repeat_sync(void) {}
+
 #endif /* __ASM_ARM_ARM32_FLUSHTLB_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/arm/include/asm/arm64/flushtlb.h b/xen/arch/arm/include/asm/arm64/flushtlb.h
index 3b99c11b50..1606b26bf2 100644
--- a/xen/arch/arm/include/asm/arm64/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm64/flushtlb.h
@@ -12,9 +12,14 @@
  * ARM64_WORKAROUND_REPEAT_TLBI:
  * Modification of the translation table for a virtual address might lead to
  * read-after-read ordering violation.
- * The workaround repeats TLBI+DSB ISH operation for all the TLB flush
- * operations. While this is strictly not necessary, we don't want to
- * take any risk.
+ * The workaround repeats TLBI+DSB ISH operation for broadcast TLB flush
+ * operations. The workaround is not needed for local operations.
+ *
+ * It is sufficient for the additional TLBI to use *any* operation which will
+ * be broadcast, regardless of which translation regime or stage of translation
+ * the operation applies to. TLBI VALE2IS is used passing XZR. While there is
+ * an identity mapping there, it's only used during suspend/resume, CPU on/off,
+ * so the impact (performance if any) is negligible.
  *
  * For Xen page-tables the ISB will discard any instructions fetched
  * from the old mappings.
@@ -26,69 +31,90 @@
  * Note that for local TLB flush, using non-shareable (nsh) is sufficient
  * (see D5-4929 in ARM DDI 0487H.a). Although, the memory barrier in
  * for the workaround is left as inner-shareable to match with Linux
- * v6.1-rc8.
+ * v6.19.
  */
-#define TLB_HELPER(name, tlbop, sh)              \
+#define TLB_HELPER_LOCAL(name, tlbop)            \
 static inline void name(void)                    \
 {                                                \
     asm_inline volatile (                        \
-        "dsb  "  # sh  "st;"                     \
+        "dsb  nshst;"                            \
         "tlbi "  # tlbop  ";"                    \
-        ALTERNATIVE(                             \
-            "nop; nop;",                         \
-            "dsb  ish;"                          \
-            "tlbi "  # tlbop  ";",               \
-            ARM64_WORKAROUND_REPEAT_TLBI,        \
-            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
-        "dsb  "  # sh  ";"                       \
+        "dsb  nsh;"                              \
         "isb;"                                   \
         : : : "memory");                         \
 }
 
-/*
- * FLush TLB by VA. This will likely be used in a loop, so the caller
- * is responsible to use the appropriate memory barriers before/after
- * the sequence.
- *
- * See above about the ARM64_WORKAROUND_REPEAT_TLBI sequence.
- */
-#define TLB_HELPER_VA(name, tlbop)               \
-static inline void name(vaddr_t va)              \
-{                                                \
-    asm_inline volatile (                        \
-        "tlbi "  # tlbop  ", %0;"                \
-        ALTERNATIVE(                             \
-            "nop; nop;",                         \
-            "dsb  ish;"                          \
-            "tlbi "  # tlbop  ", %0;",           \
-            ARM64_WORKAROUND_REPEAT_TLBI,        \
-            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
-        : : "r" (va >> PAGE_SHIFT) : "memory");  \
+#define TLB_HELPER(name, tlbop)                       \
+static inline void name(void)                         \
+{                                                     \
+    asm_inline volatile (                             \
+        "dsb  ishst;"                                 \
+        "tlbi "  # tlbop  ";"                         \
+        ALTERNATIVE(                                  \
+            "nop; nop;",                              \
+            "dsb  ish;"                               \
+            "tlbi vale2is, xzr;",                     \
+            ARM64_WORKAROUND_REPEAT_TLBI,             \
+            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI)      \
+        "dsb  ish;"                                   \
+        "isb;"                                        \
+        : : : "memory"); \
 }
 
 /* Flush local TLBs, current VMID only. */
-TLB_HELPER(flush_guest_tlb_local, vmalls12e1, nsh)
+TLB_HELPER_LOCAL(flush_guest_tlb_local, vmalls12e1)
 
 /* Flush innershareable TLBs, current VMID only */
-TLB_HELPER(flush_guest_tlb, vmalls12e1is, ish)
+TLB_HELPER(flush_guest_tlb, vmalls12e1is)
 
 /* Flush local TLBs, all VMIDs, non-hypervisor mode */
-TLB_HELPER(flush_all_guests_tlb_local, alle1, nsh)
+TLB_HELPER_LOCAL(flush_all_guests_tlb_local, alle1)
 
 /* Flush innershareable TLBs, all VMIDs, non-hypervisor mode */
-TLB_HELPER(flush_all_guests_tlb, alle1is, ish)
+TLB_HELPER(flush_all_guests_tlb, alle1is)
 
 /* Flush all hypervisor mappings from the TLB of the local processor. */
-TLB_HELPER(flush_xen_tlb_local, alle2, nsh)
+TLB_HELPER_LOCAL(flush_xen_tlb_local, alle2)
+
+#undef TLB_HELPER_LOCAL
+#undef TLB_HELPER
+
+/*
+ * FLush TLB by VA. This will likely be used in a loop, so the caller
+ * is responsible to use the appropriate memory barriers before/after
+ * the sequence.
+ */
 
 /* Flush TLB of local processor for address va. */
-TLB_HELPER_VA(__flush_xen_tlb_one_local, vae2)
+static inline void __flush_xen_tlb_one_local(vaddr_t va)
+{
+    asm_inline volatile (
+        "tlbi vae2, %0" : : "r" (va >> PAGE_SHIFT) : "memory");
+}
 
 /* Flush TLB of all processors in the inner-shareable domain for address va. */
-TLB_HELPER_VA(__flush_xen_tlb_one, vae2is)
+static inline void __flush_xen_tlb_one(vaddr_t va)
+{
+    asm_inline volatile (
+        "tlbi vae2is, %0" : : "r" (va >> PAGE_SHIFT) : "memory");
+}
 
-#undef TLB_HELPER
-#undef TLB_HELPER_VA
+/*
+ * ARM64_WORKAROUND_REPEAT_TLBI:
+ * For all relevant erratas it is only necessary to execute a single
+ * additional TLBI;DSB sequence after any number of TLBIs are completed by DSB.
+ */
+static inline void __tlb_repeat_sync(void)
+{
+    asm_inline volatile (
+        ALTERNATIVE(
+            "nop; nop;",
+            "tlbi vale2is, xzr;"
+            "dsb  ish;",
+            ARM64_WORKAROUND_REPEAT_TLBI,
+            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI)
+        : : : "memory");
+}
 
 #endif /* __ASM_ARM_ARM64_FLUSHTLB_H__ */
 /*
diff --git a/xen/arch/arm/include/asm/flushtlb.h b/xen/arch/arm/include/asm/flushtlb.h
index e45fb6d97b..c292c3c00d 100644
--- a/xen/arch/arm/include/asm/flushtlb.h
+++ b/xen/arch/arm/include/asm/flushtlb.h
@@ -65,6 +65,7 @@ static inline void flush_xen_tlb_range_va(vaddr_t va,
         va += PAGE_SIZE;
     }
     dsb(ish); /* Ensure the TLB invalidation has completed */
+    __tlb_repeat_sync();
     isb();
 }
 
diff --git a/xen/arch/arm/include/asm/mmu/layout.h b/xen/arch/arm/include/asm/mmu/layout.h
index 19c0ec63a5..feafc14ebf 100644
--- a/xen/arch/arm/include/asm/mmu/layout.h
+++ b/xen/arch/arm/include/asm/mmu/layout.h
@@ -23,6 +23,10 @@
  *
  *  Reserved to identity map Xen
  *
+ *  Note: As part of ARM64_WORKAROUND_REPEAT_TLBI, VA 0 is used for an extra
+ *  TLBI operation given its rare use (only identity mapping) and thus
+ *  negligible performance impact.
+ *
  * 0x00000a0000000000 - 0x00000a7fffffffff (512GB, L0 slot [20])
  *  (Relative offsets)
  *   0  -   2M   Unmapped
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 13:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 13:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292081.1570676 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFu0T-0006Dx-0m; Thu, 23 Apr 2026 13:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292081.1570676; Thu, 23 Apr 2026 13: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 1wFu0S-0006Dm-Tw; Thu, 23 Apr 2026 13:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1292081;
 Thu, 23 Apr 2026 13:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFu0S-0006DX-G7
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 13:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFu0S-00Frip-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFu0S-00GVNK-1M
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 13:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mwx9fkpiZR7LDctbpEZ8JEzmdukHMxn6l7bzqRlQ+KA=; b=akJ4FxQ+WcuuJtJaehPRJtLVRz
	k1E/TJZXi0/7BgApOiM0kNNm3e7I767lJQvuTTVGGK/vl4jBDSGPlTTP4EoOw0LmfkyFHXePAtV+y
	bTcMAc8kNAHlxJuf6H5WRPWBHc1C2aOOui7SXPKriyJsh8W4dODgpYUwZ5LzSTE/VPB0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm64/insn: Avoid undefined behaviour in branch offset decode
Message-Id: <E1wFu0S-00GVNK-1M@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 13:22:12 +0000

commit 65a99a4063ccac92237f6d2cd45cb94b5574baa9
Author:     Edgar E. Iglesias <edgar.iglesias@amd.com>
AuthorDate: Wed Apr 22 18:45:06 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 23 15:12:32 2026 +0200

    arm64/insn: Avoid undefined behaviour in branch offset decode
    
    Branch offset decoding sign-extends the immediate by shifting it left into
    bit 31 and back. Perform the left shift in uint32_t and cast to int32_t
    only for the final right shift to avoid UBSAN failures on negative offsets.
    
    Fixes: 6dbf3f0e3074 ("xen/arm: arm64: Add helpers to decode and encode branch instructions")
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/insn.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/arm64/insn.c b/xen/arch/arm/arm64/insn.c
index 81f7914610..6b97a84ba7 100644
--- a/xen/arch/arm/arm64/insn.c
+++ b/xen/arch/arm/arm64/insn.c
@@ -225,22 +225,22 @@ u32 __kprobes aarch64_insn_gen_nop(void)
  */
 int32_t aarch64_get_branch_offset(uint32_t insn)
 {
-	int32_t imm;
+	uint32_t imm;
 
 	if (aarch64_insn_is_b(insn) || aarch64_insn_is_bl(insn)) {
 		imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_26, insn);
-		return (imm << 6) >> 4;
+		return (int32_t)(imm << 6) >> 4;
 	}
 
 	if (aarch64_insn_is_cbz(insn) || aarch64_insn_is_cbnz(insn) ||
 	    aarch64_insn_is_bcond(insn)) {
 		imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_19, insn);
-		return (imm << 13) >> 11;
+		return (int32_t)(imm << 13) >> 11;
 	}
 
 	if (aarch64_insn_is_tbz(insn) || aarch64_insn_is_tbnz(insn)) {
 		imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_14, insn);
-		return (imm << 18) >> 16;
+		return (int32_t)(imm << 18) >> 16;
 	}
 
 	/* Unhandled instruction */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 13:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 13:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292082.1570680 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFu0d-0006Hl-1v; Thu, 23 Apr 2026 13:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292082.1570680; Thu, 23 Apr 2026 13: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 1wFu0c-0006Hd-VG; Thu, 23 Apr 2026 13:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1292082;
 Thu, 23 Apr 2026 13:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFu0c-0006HQ-JR
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 13:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFu0c-00FrjF-1o
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFu0c-00GVNh-1g
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 13:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RAKs+ogB472OhJyXafw/meyPy6J5rwyEq3agxFW4gQs=; b=5kdsVtcJ9X0aGZxcUHy4DJiQ8B
	mJsxxwwAkUxz9syyyx8kARl8q7TMJq2y6gYJhaHmjFEtWJJmVnzZphF4lAC9nK/do4CkFBMr0X7ag
	6/D4juhZNtSMs8N3UMzgE8UggIUItMFdj9lfs5+W5V3vhxBrstTvesLjaN1EG8t58kAM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: fix build with clang/ATfE
Message-Id: <E1wFu0c-00GVNh-1g@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 13:22:22 +0000

commit b89ecb4dd455683eb1d544146d464ca909558151
Author:     Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue Apr 21 08:13:35 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 23 15:12:32 2026 +0200

    xen/arm: ffa: fix build with clang/ATfE
    
    Clang 22.x.x or Arm Toolchain for Embedded 22.x.x reports:
    
    In file included from arch/arm/tee/ffa.c:75:
    arch/arm/tee/ffa_private.h:439:17: error: 'used' attribute ignored on a non-definition declaration [-Werror,-Wignored-attributes]
      439 | extern uint32_t __ro_after_init ffa_fw_version;
          |                 ^
    
    There is a fix for clang 16 in the git history:
    a1a1e2b7dc4f ("xen/arm: ffa: fix build with clang")
    which was broken by the following commit:
    a90376c6adbc ("xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors")
    
    Remove __ro_after_init from the extern declaration of ffa_fw_version.
    The attribute is already present on the definition in ffa.c, which is
    sufficient and correct.
    
    Fixes: a90376c6adbc ("xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors")
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index c291f32b56..e16bc0d83d 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -436,7 +436,7 @@ struct ffa_ctx {
 };
 
 extern DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
-extern uint32_t __ro_after_init ffa_fw_version;
+extern uint32_t ffa_fw_version;
 
 extern struct list_head ffa_ctx_head;
 extern rwlock_t ffa_ctx_list_rwlock;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 15:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 15:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292323.1570805 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwDi-0000va-TP; Thu, 23 Apr 2026 15:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292323.1570805; Thu, 23 Apr 2026 15:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwDi-0000vS-Qb; Thu, 23 Apr 2026 15:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1292323;
 Thu, 23 Apr 2026 15:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFwDi-0000vM-9B
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 15:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwDi-00FuHR-0m
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwDi-00GeFt-0c
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=g8W9lNA8Y7rNLOTbGr9AD7+QdecEP75R2SxFS42geXY=; b=WP+jaYhf+PpG9M9Dd2d3O7PCd/
	p1uKGuQil/eIxghUIAjt42tczVW9x28IrZYfxwdts3k65/2c582JY0WayddnDL/nGrgVzdleNyMFi
	/r+xXMYWVS0+a3YGiGMNTb+8BovJ2fnNpwGzC3Q271/Lfj3jVdZQ2Ln5z+ktfDejJtcU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] install.sh: Preserve symlinks in destination file system
Message-Id: <E1wFwDi-00GeFt-0c@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 15:44:02 +0000

commit 5c248e8dbb2fef73b7e8bbdb46813ed5a75d2897
Author:     Thierry Escande <thierry.escande@vates.tech>
AuthorDate: Thu Mar 19 16:50:52 2026 +0000
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    install.sh: Preserve symlinks in destination file system
    
    In various distros (i.e. Debian), /lib is a symbolic link. The tar
    command in install.sh replaces the /lib symlink with a directory and
    results in a non-functioning system. This has been introduced by the
    installation of the systemd watchdog sleep script in /lib/systemd.
    
    This patch adds the tar option --dereference (-h for short) to preserve
    symlinks when extracting the dist archive.
    
    Fixes: e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on suspend/resume")
    Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Tested-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install.sh b/install.sh
index 3e11c4d46f..1d74541320 100644
--- a/install.sh
+++ b/install.sh
@@ -27,7 +27,7 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
+(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xhf -
 rm -rf "$tmp"
 
 echo "All done."
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 15:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 15:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292324.1570808 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwDs-0000xT-UU; Thu, 23 Apr 2026 15:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292324.1570808; Thu, 23 Apr 2026 15:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwDs-0000xL-S0; Thu, 23 Apr 2026 15:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1292324;
 Thu, 23 Apr 2026 15:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFwDs-0000xF-FY
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 15:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwDs-00FuHW-1T
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwDs-00GeHP-0x
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+WLRPYlM5CrHfnO9tDLog2rNl3NM0E0bG8NfmnKkOfw=; b=qUB6I+6wUU3c9/1gpMSaWoir9j
	CqIv2KgAV/aZx82J10kCheClaHZHpInmwBHcFjhjgF3yaV+jeJjH+V56IdTzm9B75jLhCkFHnBvCP
	Hg702G0fqJt003H758NZP+fvJHdUX0xUwaEyf7zjipx1b+hL2VCzPREY60ixvgfPixzs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: remove unneeded check in create_node()
Message-Id: <E1wFwDs-00GeHP-0x@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 15:44:12 +0000

commit 7273bac8ae131e1ee161631afc466ba31c7fc85e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:15:10 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    tools/xenstored: remove unneeded check in create_node()
    
    create_node() is called only for issued xenstore commands. This means
    that the "conn" parameter is never NULL.
    
    Remove checking whether "conn" is not NULL.
    
    Coverity ID: 1690859
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index f92fca6e9e..6d82111e29 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -1524,7 +1524,7 @@ static struct node *create_node(struct connection *conn, const void *ctx,
 	if (!node)
 		return NULL;
 
-	if (conn && conn->transaction)
+	if (conn->transaction)
 		ta_node_created(conn->transaction);
 
 	node->data = data;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 15:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 15:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292326.1570813 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwE3-0000zi-Vx; Thu, 23 Apr 2026 15:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292326.1570813; Thu, 23 Apr 2026 15:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwE3-0000za-TS; Thu, 23 Apr 2026 15:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1292326;
 Thu, 23 Apr 2026 15:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFwE2-0000zU-IQ
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 15:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwE2-00FuHs-1k
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwE2-00GeJ8-1d
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TZHo1pL80S4flUHctOed10t4FJr37ZrIzCUTVjI5N/M=; b=jnyTWNG9ny4C4sHqVenmAK6oML
	JLege2oRCJIPGtNTaDdhHxxU8oYqFt85rlZ57Zpdpma7dk9Rv3OiyA3w4yHzZKcjmUhZeLBCj/WaZ
	UKb7Xm4DZhkObSmCb5L8BHppHGpGViiwEuZiMVJYzJAYZiTqiYhMOyrfo79ZYF+G4A8k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: upload tests-junit.xml as a normal artifact too
Message-Id: <E1wFwE2-00GeJ8-1d@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 15:44:22 +0000

commit a1ad2c2d81a306ded81826670636b6196de670cb
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Wed Apr 1 01:24:50 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    CI: upload tests-junit.xml as a normal artifact too
    
    This allows checking the file if gitlab can't parse it for some reason.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 275c01c19f..e189a774e9 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -151,6 +151,7 @@
     paths:
       - smoke.serial
       - '*.log'
+      - tests-junit.xml
     when: always
   rules:
     - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $QUBES_JOBS == "true"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 15:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 15:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292327.1570817 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwEE-00012C-2F; Thu, 23 Apr 2026 15:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292327.1570817; Thu, 23 Apr 2026 15:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwED-000124-W3; Thu, 23 Apr 2026 15:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1292327;
 Thu, 23 Apr 2026 15:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFwEC-00011x-LK
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 15:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwEC-00FuHz-22
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwEC-00GeKk-1u
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XR3qwdl0d7zKy8FVh3/O3gKBV92+MxBxxRz8Sc9szOY=; b=Gw2qf7msUv+8CYvYlD4Cwhdf3b
	KySc9tkKMkqzqdzFam6k2BANMRTYJNOLDqmcq260W8c0ngiHumO0prdtFYMrAsCWnxKZ7Yr1HD/26
	PL4PDH0RbTZrimR/K7jS3DMKkijRNC7huT5CZ+eQb/DEeldcdyOar5V8DZztAnGihHio=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: make test-artifacts repo/branch/job customizable
Message-Id: <E1wFwEC-00GeKk-1u@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 15:44:32 +0000

commit 48b6cd64dcf2d55a6288ca68b6cfeb6af132c182
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Wed Apr 1 01:24:51 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    CI: make test-artifacts repo/branch/job customizable
    
    Allow choosing which artifacts branch and job to use for Linux. This
    allows running the same tests for different Linux versions, without
    duplicating a lot of yaml sections.
    
    Similarly, make the repo path itself configurable too. The main purpose
    is to ensure the test pipeline triggered from any repo will fetch linux
    artifact from the right repo. But with a minor change of using that
    variable for rootfs and microcode artifacts too, it allows testing
    test-artifacts repo changes without needing to modify gitlab-ci.yml in
    xen.git at all.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 .gitlab-ci.yml                 | 12 ++++++++++++
 automation/gitlab-ci/test.yaml | 24 ++++++++++++------------
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 64bed300a6..2124e3a79e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,18 @@ variables:
   SELECTED_JOBS_ONLY:
     description: "Regex to select only some jobs, must be enclosed with /. For example /job1|job2/"
     value: "/.*/"
+  ARTIFACTS_REPO:
+    description: "Path to the test-artifacts repo"
+    value: xen-project/hardware/test-artifacts
+  ARTIFACTS_BRANCH:
+    description: "Branch in test-artifacts to use"
+    value: master
+  LINUX_JOB_X86_64:
+    description: "Job name in test-artifacts to use for Linux x86_64"
+    value: linux-6.6.56-x86_64
+  LINUX_JOB_ARM64:
+    description: "Job name in test-artifacts to use for Linux arm64"
+    value: linux-6.6.86-arm64
 
 workflow:
   name: "$CI_PIPELINE_SCHEDULE_DESCRIPTION"
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index e189a774e9..8770c523e2 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -6,27 +6,27 @@
     when: on_success
 
 .arm64-test-needs: &arm64-test-needs
-  - project: xen-project/hardware/test-artifacts
-    job: linux-6.6.86-arm64
-    ref: master
-  - project: xen-project/hardware/test-artifacts
+  - project: $ARTIFACTS_REPO
+    job: $LINUX_JOB_ARM64
+    ref: $ARTIFACTS_BRANCH
+  - project: $ARTIFACTS_REPO
     job: alpine-3.18-arm64-rootfs
-    ref: master
+    ref: $ARTIFACTS_BRANCH
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
   - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
-  - project: xen-project/hardware/test-artifacts
-    job: linux-6.6.56-x86_64
-    ref: master
-  - project: xen-project/hardware/test-artifacts
+  - project: $ARTIFACTS_REPO
+    job: $LINUX_JOB_X86_64
+    ref: $ARTIFACTS_BRANCH
+  - project: $ARTIFACTS_REPO
     job: alpine-3.18-x86_64-rootfs
-    ref: master
-  - project: xen-project/hardware/test-artifacts
+    ref: $ARTIFACTS_BRANCH
+  - project: $ARTIFACTS_REPO
     job: microcode-x86
-    ref: master
+    ref: $ARTIFACTS_BRANCH
 
 .qemu-arm64:
   extends: .test-jobs-common
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 15:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 15:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292328.1570821 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwEO-00014B-3s; Thu, 23 Apr 2026 15:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292328.1570821; Thu, 23 Apr 2026 15:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFwEO-000143-14; Thu, 23 Apr 2026 15:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1292328;
 Thu, 23 Apr 2026 15:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFwEM-00013x-Nx
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 15:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwEM-00FuI5-2J
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFwEM-00GeNE-2C
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 15:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XYwbw24qzmE1tXofVLtTNr0FdBpdt7PtZ5KXPSoRYdU=; b=b2fYCuauBAddGFLKz24pTsRRGC
	1avHMJX/UgiHcpeDeaRz0aynVO/r6yMa0gpKL2UCXjuWWarOfEBskKr9HdaPCeLDIwTICvqMGPCBc
	vp65Rn0bhrTFyG9N3Jhk7V45f00mt0dvEGNx0jCwgTBTv6Auc5W+MwsdDzFYERMQxw1w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: introduce BUILD_FOR_TESTS_ONLY
Message-Id: <E1wFwEM-00GeNE-2C@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 15:44:42 +0000

commit a183f7fbe7aa70e1acd25d59bfabc52cd0d711fb
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Wed Apr 1 01:24:52 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    CI: introduce BUILD_FOR_TESTS_ONLY
    
    When the variable is set, only build jobs that are used in tests are
    scheduled. This saves a lot of time, for example when scheduling a test
    pipeline with alternative linux branch.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 .gitlab-ci.yml                  |  2 ++
 automation/gitlab-ci/build.yaml | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2124e3a79e..f42a9abeaa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,8 @@ variables:
   SELECTED_JOBS_ONLY:
     description: "Regex to select only some jobs, must be enclosed with /. For example /job1|job2/"
     value: "/.*/"
+  BUILD_FOR_TESTS_ONLY:
+    description: "Include only build jobs necessary for running tests"
   ARTIFACTS_REPO:
     description: "Path to the test-artifacts repo"
     value: xen-project/hardware/test-artifacts
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index b69bad9202..eff96beaa5 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -12,6 +12,14 @@
       - '*/*.log'
     when: always
   needs: []
+  rules:
+    - if: $BUILD_FOR_TESTS_ONLY
+      when: never
+    - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY
+      when: on_success
+
+# override BUILD_FOR_TESTS_ONLY exclusion
+.build-test-tpl: &build-test
   rules:
     - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY
       when: on_success
@@ -296,11 +304,13 @@ qemu-system-aarch64-6.0.0-arm32-export:
 
 alpine-3.18-gcc:
   extends: .gcc-x86-64-build
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18
 
 alpine-3.18-gcc-debug:
   extends: .gcc-x86-64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18
     BUILD_QEMU_XEN: y
@@ -315,16 +325,19 @@ alpine-3.18-gcc-debug:
 
 debian-13-x86_64-gcc-debug:
   extends: .gcc-x86-64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-x86_64
 
 debian-13-x86_64-clang-debug:
   extends: .clang-x86-64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-x86_64
 
 debian-13-ppc64le-gcc-debug:
   extends: .gcc-ppc64le-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-ppc64le
     KBUILD_DEFCONFIG: ppc64_defconfig
@@ -335,6 +348,7 @@ debian-13-ppc64le-gcc-debug:
 
 debian-13-riscv64-gcc-debug:
   extends: .gcc-riscv64-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-riscv64
     KBUILD_DEFCONFIG: tiny64_defconfig
@@ -347,12 +361,14 @@ debian-13-riscv64-gcc-debug:
 
 debian-bookworm-gcc-arm32:
   extends: .gcc-arm32-cross-build
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
 
 debian-bookworm-gcc-arm32-debug:
   extends: .gcc-arm32-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
@@ -366,6 +382,7 @@ debian-bookworm-gcc-arm32-randconfig:
 
 debian-bookworm-gcc-arm32-debug-staticmem:
   extends: .gcc-arm32-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
@@ -376,6 +393,7 @@ debian-bookworm-gcc-arm32-debug-staticmem:
 
 debian-bookworm-gcc-arm32-debug-earlyprintk:
   extends: .gcc-arm32-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
@@ -407,11 +425,13 @@ debian-bookworm-gcc-debug-arm64:
 
 alpine-3.18-gcc-arm64:
   extends: .gcc-arm64-build
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
 
 alpine-3.18-gcc-debug-arm64:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -426,6 +446,7 @@ alpine-3.18-gcc-arm64-randconfig:
 
 alpine-3.18-gcc-debug-arm64-staticmem:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -435,6 +456,7 @@ alpine-3.18-gcc-debug-arm64-staticmem:
 
 alpine-3.18-gcc-debug-arm64-static-shared-mem:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -444,6 +466,7 @@ alpine-3.18-gcc-debug-arm64-static-shared-mem:
 
 alpine-3.18-gcc-debug-arm64-boot-cpupools:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -451,6 +474,7 @@ alpine-3.18-gcc-debug-arm64-boot-cpupools:
 
 alpine-3.18-gcc-debug-arm64-earlyprintk:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292503.1570914 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxkZ-00067q-9L; Thu, 23 Apr 2026 17:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292503.1570914; Thu, 23 Apr 2026 17: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 1wFxkZ-00067i-6a; Thu, 23 Apr 2026 17:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1292503;
 Thu, 23 Apr 2026 17:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxkY-00067c-0v
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxkX-00FwXP-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxkX-00GrgI-2a
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MY2c8R9HuXSCk3MUXJeHRwIJkwpp4TGtDEtm7zImF8E=; b=dCKrQ2G4g1AwTm4D/kegMYZ7oc
	4LOhc3m2aGn0CD6I9Y0c9lu7UtzC8DRs6QVq4JZzcgqj2+q07/qkKtgHgZQdMIceXeJtuHr01WPqM
	R7qQiuZVeMCH3zwyuiS40Sv4XpJhJbnDP4sLoEJUuNHU9SyIO3dHjAzSd8Hmuy6iEvFA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm64: flushtlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI
Message-Id: <E1wFxkX-00GrgI-2a@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:22:01 +0000

commit 7c502d7591519135765b8041cbd1c70e56e5a0b9
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Apr 14 10:11:24 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 23 15:12:32 2026 +0200

    xen/arm64: flushtlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI
    
    The ARM64_WORKAROUND_REPEAT_TLBI workaround is used to mitigate several
    errata where broadcast TLBI;DSB sequences don't provide all the
    architecturally required synchronization. The workaround performs more
    work than necessary, and can have significant overhead. This patch
    optimizes the workaround, as explained below.
    
    1. All relevant errata only affect the ordering and/or completion of
       memory accesses which have been translated by an invalidated TLB
       entry. The actual invalidation of TLB entries is unaffected.
    
    2. The existing workaround is applied to both broadcast and local TLB
       invalidation, whereas for all relevant errata it is only necessary to
       apply a workaround for broadcast invalidation.
    
    3. The existing workaround replaces every TLBI with a TLBI;DSB;TLBI
       sequence, whereas for all relevant errata it is only necessary to
       execute a single additional TLBI;DSB sequence after any number of
       TLBIs are completed by a DSB.
    
       For example, for a sequence of batched TLBIs:
    
           TLBI <op1>[, <arg1>]
           TLBI <op2>[, <arg2>]
           TLBI <op3>[, <arg3>]
           DSB ISH
    
       ... the existing workaround will expand this to:
    
           TLBI <op1>[, <arg1>]
           DSB ISH                  // additional
           TLBI <op1>[, <arg1>]     // additional
           TLBI <op2>[, <arg2>]
           DSB ISH                  // additional
           TLBI <op2>[, <arg2>]     // additional
           TLBI <op3>[, <arg3>]
           DSB ISH                  // additional
           TLBI <op3>[, <arg3>]     // additional
           DSB ISH
    
       ... whereas it is sufficient to have:
    
           TLBI <op1>[, <arg1>]
           TLBI <op2>[, <arg2>]
           TLBI <op3>[, <arg3>]
           DSB ISH
           TLBI <opX>[, <argX>]     // additional
           DSB ISH                  // additional
    
       Using a single additional TLBI and DSB at the end of the sequence can
       have significantly lower overhead as each DSB which completes a TLBI
       must synchronize with other PEs in the system, with potential
       performance effects both locally and system-wide.
    
    4. The existing workaround repeats each specific TLBI operation, whereas
       for all relevant errata it is sufficient for the additional TLBI to
       use *any* operation which will be broadcast, regardless of which
       translation regime or stage of translation the operation applies to.
    
       For example, for a single TLBI:
    
           TLBI ALLE2IS
           DSB ISH
    
       ... the existing workaround will expand this to:
    
           TLBI ALLE2IS
           DSB ISH
           TLBI ALLE2IS             // additional
           DSB ISH                  // additional
    
       ... whereas it is sufficient to have:
    
           TLBI ALLE2IS
           DSB ISH
           TLBI VALE1IS, XZR        // additional
           DSB ISH                  // additional
    
       As the additional TLBI doesn't have to match a specific earlier TLBI,
       the additional TLBI can be implemented in separate code, with no
       memory of the earlier TLBIs. The additional TLBI can also use a
       cheaper TLBI operation.
    
    5. The existing workaround is applied to both Stage-1 and Stage-2 TLB
       invalidation, whereas for all relevant errata it is only necessary to
       apply a workaround for Stage-1 invalidation.
    
       Architecturally, TLBI operations which invalidate only Stage-2
       information (e.g. IPAS2E1IS) are not required to invalidate TLB
       entries which combine information from Stage-1 and Stage-2
       translation table entries, and consequently may not complete memory
       accesses translated by those combined entries. In these cases,
       completion of memory accesses is only guaranteed after subsequent
       invalidation of Stage-1 information (e.g. VMALLE1IS).
    
    Rework the workaround logic as follows:
     - add TLB_HELPER_LOCAL() to be used for local TLB ops without a
       workaround,
     - modify TLB_HELPER() workaround to use tlbi vale2is, xzr as a second
       TLBI,
     - drop TLB_HELPER_VA(). It's used only by __flush_xen_tlb_one_local
       which is local and does not need workaround and by
       __flush_xen_tlb_one. In the latter case, since it's used in a loop,
       we don't need a workaround in the middle. Add __tlb_repeat_sync with
       a workaround to be used at the end after DSB and before final ISB,
     - TLBI VALE2IS passing XZR is used as an additional TLBI. While there is
       an identity mapping there, it's used very rarely. The performance
       impact is therefore negligible. If things change in the future, we
       can revisit the decision.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/include/asm/arm32/flushtlb.h |   3 +
 xen/arch/arm/include/asm/arm64/flushtlb.h | 108 ++++++++++++++++++------------
 xen/arch/arm/include/asm/flushtlb.h       |   1 +
 xen/arch/arm/include/asm/mmu/layout.h     |   4 ++
 4 files changed, 75 insertions(+), 41 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/flushtlb.h b/xen/arch/arm/include/asm/arm32/flushtlb.h
index 61c25a3189..5483be08fb 100644
--- a/xen/arch/arm/include/asm/arm32/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm32/flushtlb.h
@@ -57,6 +57,9 @@ static inline void __flush_xen_tlb_one(vaddr_t va)
     asm volatile(STORE_CP32(0, TLBIMVAHIS) : : "r" (va) : "memory");
 }
 
+/* Only for ARM64_WORKAROUND_REPEAT_TLBI */
+static inline void __tlb_repeat_sync(void) {}
+
 #endif /* __ASM_ARM_ARM32_FLUSHTLB_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/arm/include/asm/arm64/flushtlb.h b/xen/arch/arm/include/asm/arm64/flushtlb.h
index 3b99c11b50..1606b26bf2 100644
--- a/xen/arch/arm/include/asm/arm64/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm64/flushtlb.h
@@ -12,9 +12,14 @@
  * ARM64_WORKAROUND_REPEAT_TLBI:
  * Modification of the translation table for a virtual address might lead to
  * read-after-read ordering violation.
- * The workaround repeats TLBI+DSB ISH operation for all the TLB flush
- * operations. While this is strictly not necessary, we don't want to
- * take any risk.
+ * The workaround repeats TLBI+DSB ISH operation for broadcast TLB flush
+ * operations. The workaround is not needed for local operations.
+ *
+ * It is sufficient for the additional TLBI to use *any* operation which will
+ * be broadcast, regardless of which translation regime or stage of translation
+ * the operation applies to. TLBI VALE2IS is used passing XZR. While there is
+ * an identity mapping there, it's only used during suspend/resume, CPU on/off,
+ * so the impact (performance if any) is negligible.
  *
  * For Xen page-tables the ISB will discard any instructions fetched
  * from the old mappings.
@@ -26,69 +31,90 @@
  * Note that for local TLB flush, using non-shareable (nsh) is sufficient
  * (see D5-4929 in ARM DDI 0487H.a). Although, the memory barrier in
  * for the workaround is left as inner-shareable to match with Linux
- * v6.1-rc8.
+ * v6.19.
  */
-#define TLB_HELPER(name, tlbop, sh)              \
+#define TLB_HELPER_LOCAL(name, tlbop)            \
 static inline void name(void)                    \
 {                                                \
     asm_inline volatile (                        \
-        "dsb  "  # sh  "st;"                     \
+        "dsb  nshst;"                            \
         "tlbi "  # tlbop  ";"                    \
-        ALTERNATIVE(                             \
-            "nop; nop;",                         \
-            "dsb  ish;"                          \
-            "tlbi "  # tlbop  ";",               \
-            ARM64_WORKAROUND_REPEAT_TLBI,        \
-            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
-        "dsb  "  # sh  ";"                       \
+        "dsb  nsh;"                              \
         "isb;"                                   \
         : : : "memory");                         \
 }
 
-/*
- * FLush TLB by VA. This will likely be used in a loop, so the caller
- * is responsible to use the appropriate memory barriers before/after
- * the sequence.
- *
- * See above about the ARM64_WORKAROUND_REPEAT_TLBI sequence.
- */
-#define TLB_HELPER_VA(name, tlbop)               \
-static inline void name(vaddr_t va)              \
-{                                                \
-    asm_inline volatile (                        \
-        "tlbi "  # tlbop  ", %0;"                \
-        ALTERNATIVE(                             \
-            "nop; nop;",                         \
-            "dsb  ish;"                          \
-            "tlbi "  # tlbop  ", %0;",           \
-            ARM64_WORKAROUND_REPEAT_TLBI,        \
-            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI) \
-        : : "r" (va >> PAGE_SHIFT) : "memory");  \
+#define TLB_HELPER(name, tlbop)                       \
+static inline void name(void)                         \
+{                                                     \
+    asm_inline volatile (                             \
+        "dsb  ishst;"                                 \
+        "tlbi "  # tlbop  ";"                         \
+        ALTERNATIVE(                                  \
+            "nop; nop;",                              \
+            "dsb  ish;"                               \
+            "tlbi vale2is, xzr;",                     \
+            ARM64_WORKAROUND_REPEAT_TLBI,             \
+            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI)      \
+        "dsb  ish;"                                   \
+        "isb;"                                        \
+        : : : "memory"); \
 }
 
 /* Flush local TLBs, current VMID only. */
-TLB_HELPER(flush_guest_tlb_local, vmalls12e1, nsh)
+TLB_HELPER_LOCAL(flush_guest_tlb_local, vmalls12e1)
 
 /* Flush innershareable TLBs, current VMID only */
-TLB_HELPER(flush_guest_tlb, vmalls12e1is, ish)
+TLB_HELPER(flush_guest_tlb, vmalls12e1is)
 
 /* Flush local TLBs, all VMIDs, non-hypervisor mode */
-TLB_HELPER(flush_all_guests_tlb_local, alle1, nsh)
+TLB_HELPER_LOCAL(flush_all_guests_tlb_local, alle1)
 
 /* Flush innershareable TLBs, all VMIDs, non-hypervisor mode */
-TLB_HELPER(flush_all_guests_tlb, alle1is, ish)
+TLB_HELPER(flush_all_guests_tlb, alle1is)
 
 /* Flush all hypervisor mappings from the TLB of the local processor. */
-TLB_HELPER(flush_xen_tlb_local, alle2, nsh)
+TLB_HELPER_LOCAL(flush_xen_tlb_local, alle2)
+
+#undef TLB_HELPER_LOCAL
+#undef TLB_HELPER
+
+/*
+ * FLush TLB by VA. This will likely be used in a loop, so the caller
+ * is responsible to use the appropriate memory barriers before/after
+ * the sequence.
+ */
 
 /* Flush TLB of local processor for address va. */
-TLB_HELPER_VA(__flush_xen_tlb_one_local, vae2)
+static inline void __flush_xen_tlb_one_local(vaddr_t va)
+{
+    asm_inline volatile (
+        "tlbi vae2, %0" : : "r" (va >> PAGE_SHIFT) : "memory");
+}
 
 /* Flush TLB of all processors in the inner-shareable domain for address va. */
-TLB_HELPER_VA(__flush_xen_tlb_one, vae2is)
+static inline void __flush_xen_tlb_one(vaddr_t va)
+{
+    asm_inline volatile (
+        "tlbi vae2is, %0" : : "r" (va >> PAGE_SHIFT) : "memory");
+}
 
-#undef TLB_HELPER
-#undef TLB_HELPER_VA
+/*
+ * ARM64_WORKAROUND_REPEAT_TLBI:
+ * For all relevant erratas it is only necessary to execute a single
+ * additional TLBI;DSB sequence after any number of TLBIs are completed by DSB.
+ */
+static inline void __tlb_repeat_sync(void)
+{
+    asm_inline volatile (
+        ALTERNATIVE(
+            "nop; nop;",
+            "tlbi vale2is, xzr;"
+            "dsb  ish;",
+            ARM64_WORKAROUND_REPEAT_TLBI,
+            CONFIG_ARM64_WORKAROUND_REPEAT_TLBI)
+        : : : "memory");
+}
 
 #endif /* __ASM_ARM_ARM64_FLUSHTLB_H__ */
 /*
diff --git a/xen/arch/arm/include/asm/flushtlb.h b/xen/arch/arm/include/asm/flushtlb.h
index e45fb6d97b..c292c3c00d 100644
--- a/xen/arch/arm/include/asm/flushtlb.h
+++ b/xen/arch/arm/include/asm/flushtlb.h
@@ -65,6 +65,7 @@ static inline void flush_xen_tlb_range_va(vaddr_t va,
         va += PAGE_SIZE;
     }
     dsb(ish); /* Ensure the TLB invalidation has completed */
+    __tlb_repeat_sync();
     isb();
 }
 
diff --git a/xen/arch/arm/include/asm/mmu/layout.h b/xen/arch/arm/include/asm/mmu/layout.h
index 19c0ec63a5..feafc14ebf 100644
--- a/xen/arch/arm/include/asm/mmu/layout.h
+++ b/xen/arch/arm/include/asm/mmu/layout.h
@@ -23,6 +23,10 @@
  *
  *  Reserved to identity map Xen
  *
+ *  Note: As part of ARM64_WORKAROUND_REPEAT_TLBI, VA 0 is used for an extra
+ *  TLBI operation given its rare use (only identity mapping) and thus
+ *  negligible performance impact.
+ *
  * 0x00000a0000000000 - 0x00000a7fffffffff (512GB, L0 slot [20])
  *  (Relative offsets)
  *   0  -   2M   Unmapped
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292504.1570919 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxkj-00069G-Ak; Thu, 23 Apr 2026 17:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292504.1570919; Thu, 23 Apr 2026 17: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 1wFxkj-000698-83; Thu, 23 Apr 2026 17:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1292504;
 Thu, 23 Apr 2026 17:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxki-00068o-0J
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxkh-00FwXV-39
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxkh-00Grh9-30
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iEy/59hgoitTgBJfiEvI3Cj6dtc6pgtk7RMMOYUqlNU=; b=hSOnayZQnFW8GISM4uErPbDsyU
	/sROabIAblXWHEpdTaxCJpcfqemMH4PMYC9KufFuj2QfZlwOfbGAwLnnJ7hiIgcoFWWiI0MSVZcUl
	yTnKZ/aaBNEYnD+c6A9lWmv/xsbTXHJbHArLV7VhTljy2q0KmhjTkCjYPORXl5PueLaM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm64/insn: Avoid undefined behaviour in branch offset decode
Message-Id: <E1wFxkh-00Grh9-30@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:22:11 +0000

commit 65a99a4063ccac92237f6d2cd45cb94b5574baa9
Author:     Edgar E. Iglesias <edgar.iglesias@amd.com>
AuthorDate: Wed Apr 22 18:45:06 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 23 15:12:32 2026 +0200

    arm64/insn: Avoid undefined behaviour in branch offset decode
    
    Branch offset decoding sign-extends the immediate by shifting it left into
    bit 31 and back. Perform the left shift in uint32_t and cast to int32_t
    only for the final right shift to avoid UBSAN failures on negative offsets.
    
    Fixes: 6dbf3f0e3074 ("xen/arm: arm64: Add helpers to decode and encode branch instructions")
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/insn.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/arm64/insn.c b/xen/arch/arm/arm64/insn.c
index 81f7914610..6b97a84ba7 100644
--- a/xen/arch/arm/arm64/insn.c
+++ b/xen/arch/arm/arm64/insn.c
@@ -225,22 +225,22 @@ u32 __kprobes aarch64_insn_gen_nop(void)
  */
 int32_t aarch64_get_branch_offset(uint32_t insn)
 {
-	int32_t imm;
+	uint32_t imm;
 
 	if (aarch64_insn_is_b(insn) || aarch64_insn_is_bl(insn)) {
 		imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_26, insn);
-		return (imm << 6) >> 4;
+		return (int32_t)(imm << 6) >> 4;
 	}
 
 	if (aarch64_insn_is_cbz(insn) || aarch64_insn_is_cbnz(insn) ||
 	    aarch64_insn_is_bcond(insn)) {
 		imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_19, insn);
-		return (imm << 13) >> 11;
+		return (int32_t)(imm << 13) >> 11;
 	}
 
 	if (aarch64_insn_is_tbz(insn) || aarch64_insn_is_tbnz(insn)) {
 		imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_14, insn);
-		return (imm << 18) >> 16;
+		return (int32_t)(imm << 18) >> 16;
 	}
 
 	/* Unhandled instruction */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292505.1570922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxkt-0006DU-DG; Thu, 23 Apr 2026 17:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292505.1570922; Thu, 23 Apr 2026 17: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 1wFxkt-0006DM-Ao; Thu, 23 Apr 2026 17:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1292505;
 Thu, 23 Apr 2026 17:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxks-0006DC-3S
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxks-00FwXv-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxks-00Grhv-05
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZnBORhFHvhkQCKX/hLNZwsrQ2TDxwzryvs7iYVvQ2zQ=; b=g3PC6aLgLeTBkIjw5364YY2Min
	GbQe1KxIuICINYgYo1CUat9mYX006Cyn7vNoTZsKPWEe7/RQmg6nwXdu7a8WdSui/hB4h1GldA8fM
	D3RW8e4w4h0WSEF2VYfvlB0prpoVF67O4rizAodnXzvkokJiAGkL6QR1GphaPxAFjN2E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: fix build with clang/ATfE
Message-Id: <E1wFxks-00Grhv-05@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:22:22 +0000

commit b89ecb4dd455683eb1d544146d464ca909558151
Author:     Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue Apr 21 08:13:35 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Apr 23 15:12:32 2026 +0200

    xen/arm: ffa: fix build with clang/ATfE
    
    Clang 22.x.x or Arm Toolchain for Embedded 22.x.x reports:
    
    In file included from arch/arm/tee/ffa.c:75:
    arch/arm/tee/ffa_private.h:439:17: error: 'used' attribute ignored on a non-definition declaration [-Werror,-Wignored-attributes]
      439 | extern uint32_t __ro_after_init ffa_fw_version;
          |                 ^
    
    There is a fix for clang 16 in the git history:
    a1a1e2b7dc4f ("xen/arm: ffa: fix build with clang")
    which was broken by the following commit:
    a90376c6adbc ("xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors")
    
    Remove __ro_after_init from the extern declaration of ffa_fw_version.
    The attribute is already present on the definition in ffa.c, which is
    sufficient and correct.
    
    Fixes: a90376c6adbc ("xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors")
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/tee/ffa_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index c291f32b56..e16bc0d83d 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -436,7 +436,7 @@ struct ffa_ctx {
 };
 
 extern DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
-extern uint32_t __ro_after_init ffa_fw_version;
+extern uint32_t ffa_fw_version;
 
 extern struct list_head ffa_ctx_head;
 extern rwlock_t ffa_ctx_list_rwlock;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292507.1570927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxl3-0006Fv-Em; Thu, 23 Apr 2026 17:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292507.1570927; Thu, 23 Apr 2026 17: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 1wFxl3-0006Fn-C9; Thu, 23 Apr 2026 17:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1292507;
 Thu, 23 Apr 2026 17:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxl2-0006Fb-8X
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxl2-00FwY2-0l
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxl2-00Grm1-0O
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s7kNPweq4EYp9lOreo1ncGnMjOLTzoarzJI4FAQHYXc=; b=yQbA8owZM7XNHNTQWN+QdzX5hL
	Byn5+6N3TLQnTKBwmd/Z6VeyTNhq2UpmjabPp4vYO5bV2l9ua2ZdLCqw0veYpI3cdfjWwsUxDfKxf
	Imxh8h5aVNF7s8b80olTQBuG2LGkf4mTNbr5PZ2WBnHUongeuhJbFoiDgxjZ9wgS8+Qo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] install.sh: Preserve symlinks in destination file system
Message-Id: <E1wFxl2-00Grm1-0O@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:22:32 +0000

commit 5c248e8dbb2fef73b7e8bbdb46813ed5a75d2897
Author:     Thierry Escande <thierry.escande@vates.tech>
AuthorDate: Thu Mar 19 16:50:52 2026 +0000
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    install.sh: Preserve symlinks in destination file system
    
    In various distros (i.e. Debian), /lib is a symbolic link. The tar
    command in install.sh replaces the /lib symlink with a directory and
    results in a non-functioning system. This has been introduced by the
    installation of the systemd watchdog sleep script in /lib/systemd.
    
    This patch adds the tar option --dereference (-h for short) to preserve
    symlinks when extracting the dist archive.
    
    Fixes: e54a6cd6a1f3 ("systemd: Add hooks to stop/start xen-watchdog on suspend/resume")
    Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Tested-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install.sh b/install.sh
index 3e11c4d46f..1d74541320 100644
--- a/install.sh
+++ b/install.sh
@@ -27,7 +27,7 @@ tmp="`mktemp -d`"
 echo "Installing Xen from '$src' to '$dst'..."
 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
 
-(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
+(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xhf -
 rm -rf "$tmp"
 
 echo "All done."
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292508.1570931 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxlD-0006Hu-GD; Thu, 23 Apr 2026 17:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292508.1570931; Thu, 23 Apr 2026 17: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 1wFxlD-0006Hm-DX; Thu, 23 Apr 2026 17:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1292508;
 Thu, 23 Apr 2026 17:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxlC-0006Hf-BV
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlC-00FwY9-13
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlC-00Grmf-0v
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mp6/XO0MEhdZKsaN+zNYIHQRt9rfhJnYXpdo9ATojCo=; b=PVvbbaMWuYK5Ev32avcTpb+hed
	5wkZbClNnhq4b/S9XfUcjrqJil/YxnD1rwNkBvkiimf8lYAJ1WyrQ+a8qXmZQH3h7EEOwgqc9Fpnh
	pIPEVksNejW7Jpln3gjYhufpZktXKyHj4Zrwymst0s4vmj24VM9WFIricEr1+wSvC0nM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: remove unneeded check in create_node()
Message-Id: <E1wFxlC-00Grmf-0v@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:22:42 +0000

commit 7273bac8ae131e1ee161631afc466ba31c7fc85e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 21 09:15:10 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    tools/xenstored: remove unneeded check in create_node()
    
    create_node() is called only for issued xenstore commands. This means
    that the "conn" parameter is never NULL.
    
    Remove checking whether "conn" is not NULL.
    
    Coverity ID: 1690859
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index f92fca6e9e..6d82111e29 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -1524,7 +1524,7 @@ static struct node *create_node(struct connection *conn, const void *ctx,
 	if (!node)
 		return NULL;
 
-	if (conn && conn->transaction)
+	if (conn->transaction)
 		ta_node_created(conn->transaction);
 
 	node->data = data;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:22:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292509.1570935 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxlN-0006Jt-HU; Thu, 23 Apr 2026 17:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292509.1570935; Thu, 23 Apr 2026 17: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 1wFxlN-0006Jl-Er; Thu, 23 Apr 2026 17:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1292509;
 Thu, 23 Apr 2026 17:22:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxlM-0006Jf-Fp
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlM-00FwYK-1J
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlM-00GrnE-1D
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=K57FTtizoPK7yqWwjN4zapv2+RBv5WMr1ACwd079OIg=; b=zJvcDd9Aw+jn1d+rNMdS0pURPR
	kG/1PelqpPxgLlviQp7k51rkoBcySW33ZpnkNoyamrLq0fpEdQxgWhfhPA9SHVVjdlYYcCwgvp34h
	HD7vJIuj/mgE2L/zzv5q35kpdG6eyE7M2VQ4sZXHV//qs7e1fnn6JGJETDqLRSQskRlc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: upload tests-junit.xml as a normal artifact too
Message-Id: <E1wFxlM-00GrnE-1D@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:22:52 +0000

commit a1ad2c2d81a306ded81826670636b6196de670cb
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Wed Apr 1 01:24:50 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    CI: upload tests-junit.xml as a normal artifact too
    
    This allows checking the file if gitlab can't parse it for some reason.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 275c01c19f..e189a774e9 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -151,6 +151,7 @@
     paths:
       - smoke.serial
       - '*.log'
+      - tests-junit.xml
     when: always
   rules:
     - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY && $QUBES_JOBS == "true"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:23:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292510.1570939 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxlX-0006MA-JB; Thu, 23 Apr 2026 17:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292510.1570939; Thu, 23 Apr 2026 17: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 1wFxlX-0006M2-GD; Thu, 23 Apr 2026 17:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1292510;
 Thu, 23 Apr 2026 17:23:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxlW-0006Lw-Ia
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:23:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlW-00FwYg-1l
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlW-00Grow-1U
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0+q/YmmJnpIUyLCEV+TtV/RxYdSq+Y7o0hNUDQB7RzU=; b=ri+uCGE1YFZzsQU5jOyRrLWrt5
	vMHv89JPYJAkDBpiNxL742+0ZnqAcFPkFTP0lcKJHzHHsPqeBpPxuLvXmybLx3UAnkhI5HMJ+JLHQ
	/sm0Vc43HyUErzc4przpPs4aVzgFT2NtgcK/IrMLAcIB4WcedCeiqW8hvF4m2hA5RusM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: make test-artifacts repo/branch/job customizable
Message-Id: <E1wFxlW-00Grow-1U@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:23:02 +0000

commit 48b6cd64dcf2d55a6288ca68b6cfeb6af132c182
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Wed Apr 1 01:24:51 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    CI: make test-artifacts repo/branch/job customizable
    
    Allow choosing which artifacts branch and job to use for Linux. This
    allows running the same tests for different Linux versions, without
    duplicating a lot of yaml sections.
    
    Similarly, make the repo path itself configurable too. The main purpose
    is to ensure the test pipeline triggered from any repo will fetch linux
    artifact from the right repo. But with a minor change of using that
    variable for rootfs and microcode artifacts too, it allows testing
    test-artifacts repo changes without needing to modify gitlab-ci.yml in
    xen.git at all.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 .gitlab-ci.yml                 | 12 ++++++++++++
 automation/gitlab-ci/test.yaml | 24 ++++++++++++------------
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 64bed300a6..2124e3a79e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,18 @@ variables:
   SELECTED_JOBS_ONLY:
     description: "Regex to select only some jobs, must be enclosed with /. For example /job1|job2/"
     value: "/.*/"
+  ARTIFACTS_REPO:
+    description: "Path to the test-artifacts repo"
+    value: xen-project/hardware/test-artifacts
+  ARTIFACTS_BRANCH:
+    description: "Branch in test-artifacts to use"
+    value: master
+  LINUX_JOB_X86_64:
+    description: "Job name in test-artifacts to use for Linux x86_64"
+    value: linux-6.6.56-x86_64
+  LINUX_JOB_ARM64:
+    description: "Job name in test-artifacts to use for Linux arm64"
+    value: linux-6.6.86-arm64
 
 workflow:
   name: "$CI_PIPELINE_SCHEDULE_DESCRIPTION"
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index e189a774e9..8770c523e2 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -6,27 +6,27 @@
     when: on_success
 
 .arm64-test-needs: &arm64-test-needs
-  - project: xen-project/hardware/test-artifacts
-    job: linux-6.6.86-arm64
-    ref: master
-  - project: xen-project/hardware/test-artifacts
+  - project: $ARTIFACTS_REPO
+    job: $LINUX_JOB_ARM64
+    ref: $ARTIFACTS_BRANCH
+  - project: $ARTIFACTS_REPO
     job: alpine-3.18-arm64-rootfs
-    ref: master
+    ref: $ARTIFACTS_BRANCH
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
   - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
-  - project: xen-project/hardware/test-artifacts
-    job: linux-6.6.56-x86_64
-    ref: master
-  - project: xen-project/hardware/test-artifacts
+  - project: $ARTIFACTS_REPO
+    job: $LINUX_JOB_X86_64
+    ref: $ARTIFACTS_BRANCH
+  - project: $ARTIFACTS_REPO
     job: alpine-3.18-x86_64-rootfs
-    ref: master
-  - project: xen-project/hardware/test-artifacts
+    ref: $ARTIFACTS_BRANCH
+  - project: $ARTIFACTS_REPO
     job: microcode-x86
-    ref: master
+    ref: $ARTIFACTS_BRANCH
 
 .qemu-arm64:
   extends: .test-jobs-common
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Apr 23 17:23:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Apr 2026 17:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1292511.1570943 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wFxli-0006OF-KN; Thu, 23 Apr 2026 17:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1292511.1570943; Thu, 23 Apr 2026 17:23: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 1wFxli-0006O7-HZ; Thu, 23 Apr 2026 17:23:14 +0000
Received: by outflank-mailman (input) for mailman id 1292511;
 Thu, 23 Apr 2026 17:23:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wFxlg-0006Nz-Lk
 for xen-changelog@lists.xenproject.org; Thu, 23 Apr 2026 17:23:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlg-00FwYk-23
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wFxlg-00GrrN-1w
 for xen-changelog@lists.xenproject.org;
 Thu, 23 Apr 2026 17:23: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dEi99aB5IyYnAtJwC2CwpxvIFQVwNYHPTz74it4JKtg=; b=Je+SN1q+thqYCy657gnrXpRHsf
	7ZzbSFHVbrwUUCNXhfteWizGr7BhgvACWc2Q85mkUmeX0tW2pa8e6Ux4CpwJJ+pJ3b44ek6xXJ0k+
	yrsd+vyBKjvKsuFqhbRh9b3ltmaVmh/ZXssn68kFX6Ojmr7N5chAXjLcRb97OvFXa0LE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: introduce BUILD_FOR_TESTS_ONLY
Message-Id: <E1wFxlg-00GrrN-1w@xenbits.xenproject.org>
Date: Thu, 23 Apr 2026 17:23:12 +0000

commit a183f7fbe7aa70e1acd25d59bfabc52cd0d711fb
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Wed Apr 1 01:24:52 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Thu Apr 23 17:39:55 2026 +0200

    CI: introduce BUILD_FOR_TESTS_ONLY
    
    When the variable is set, only build jobs that are used in tests are
    scheduled. This saves a lot of time, for example when scheduling a test
    pipeline with alternative linux branch.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 .gitlab-ci.yml                  |  2 ++
 automation/gitlab-ci/build.yaml | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2124e3a79e..f42a9abeaa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,8 @@ variables:
   SELECTED_JOBS_ONLY:
     description: "Regex to select only some jobs, must be enclosed with /. For example /job1|job2/"
     value: "/.*/"
+  BUILD_FOR_TESTS_ONLY:
+    description: "Include only build jobs necessary for running tests"
   ARTIFACTS_REPO:
     description: "Path to the test-artifacts repo"
     value: xen-project/hardware/test-artifacts
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index b69bad9202..eff96beaa5 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -12,6 +12,14 @@
       - '*/*.log'
     when: always
   needs: []
+  rules:
+    - if: $BUILD_FOR_TESTS_ONLY
+      when: never
+    - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY
+      when: on_success
+
+# override BUILD_FOR_TESTS_ONLY exclusion
+.build-test-tpl: &build-test
   rules:
     - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY
       when: on_success
@@ -296,11 +304,13 @@ qemu-system-aarch64-6.0.0-arm32-export:
 
 alpine-3.18-gcc:
   extends: .gcc-x86-64-build
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18
 
 alpine-3.18-gcc-debug:
   extends: .gcc-x86-64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18
     BUILD_QEMU_XEN: y
@@ -315,16 +325,19 @@ alpine-3.18-gcc-debug:
 
 debian-13-x86_64-gcc-debug:
   extends: .gcc-x86-64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-x86_64
 
 debian-13-x86_64-clang-debug:
   extends: .clang-x86-64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-x86_64
 
 debian-13-ppc64le-gcc-debug:
   extends: .gcc-ppc64le-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-ppc64le
     KBUILD_DEFCONFIG: ppc64_defconfig
@@ -335,6 +348,7 @@ debian-13-ppc64le-gcc-debug:
 
 debian-13-riscv64-gcc-debug:
   extends: .gcc-riscv64-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:13-riscv64
     KBUILD_DEFCONFIG: tiny64_defconfig
@@ -347,12 +361,14 @@ debian-13-riscv64-gcc-debug:
 
 debian-bookworm-gcc-arm32:
   extends: .gcc-arm32-cross-build
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
 
 debian-bookworm-gcc-arm32-debug:
   extends: .gcc-arm32-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
@@ -366,6 +382,7 @@ debian-bookworm-gcc-arm32-randconfig:
 
 debian-bookworm-gcc-arm32-debug-staticmem:
   extends: .gcc-arm32-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
@@ -376,6 +393,7 @@ debian-bookworm-gcc-arm32-debug-staticmem:
 
 debian-bookworm-gcc-arm32-debug-earlyprintk:
   extends: .gcc-arm32-cross-build-debug
+  <<: *build-test
   variables:
     CONTAINER: debian:bookworm-arm64v8-arm32-gcc
     HYPERVISOR_ONLY: y
@@ -407,11 +425,13 @@ debian-bookworm-gcc-debug-arm64:
 
 alpine-3.18-gcc-arm64:
   extends: .gcc-arm64-build
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
 
 alpine-3.18-gcc-debug-arm64:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -426,6 +446,7 @@ alpine-3.18-gcc-arm64-randconfig:
 
 alpine-3.18-gcc-debug-arm64-staticmem:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -435,6 +456,7 @@ alpine-3.18-gcc-debug-arm64-staticmem:
 
 alpine-3.18-gcc-debug-arm64-static-shared-mem:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -444,6 +466,7 @@ alpine-3.18-gcc-debug-arm64-static-shared-mem:
 
 alpine-3.18-gcc-debug-arm64-boot-cpupools:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -451,6 +474,7 @@ alpine-3.18-gcc-debug-arm64-boot-cpupools:
 
 alpine-3.18-gcc-debug-arm64-earlyprintk:
   extends: .gcc-arm64-build-debug
+  <<: *build-test
   variables:
     CONTAINER: alpine:3.18-arm64v8
     EXTRA_XEN_CONFIG: |
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 07:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 07:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294675.1571363 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHGI7-0000gU-7e; Mon, 27 Apr 2026 07:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294675.1571363; Mon, 27 Apr 2026 07: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 1wHGI7-0000gN-4r; Mon, 27 Apr 2026 07:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1294675;
 Mon, 27 Apr 2026 07:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHGI5-0000gH-V9
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 07:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGI5-004Pto-2v
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGI5-004utW-2k
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xCn58b75KIfEeWhT6mmLR+qqvAUcnmo/7DAX+4PQ6kg=; b=IFZikfvteTL66nOBA4T1bA4sVF
	bJCli0i7iny9enNabgj2dfyd8bc3AF5Y73txP3hpfYroIoYdSU29uTD6wvLUIKomStym4xyKEefzP
	8fVUlQPxPxTHNZamA5IV+QhMSanFmky+TqrsOsHZxIhjmO80HT5ARpelXl39chN4gbO8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/drivers/char: fix SCIF IRQ registration failure propagation
Message-Id: <E1wHGI5-004utW-2k@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 07:22:01 +0000

commit d4873af5348386f8dee4a7bfa102b5443e1078dc
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:41 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char: fix SCIF IRQ registration failure propagation
    
    In scif_uart_init_postirq(), when setup_irq() returns an error the
    failure was only logged via dprintk() and execution continued,
    unconditionally writing TIE|RIE|REIE into the Serial Control Register
    (SCSCR). This armed all three hardware interrupt lines (TX FIFO empty,
    RX data ready, receive error) with no handler registered to service
    them. On platforms where the GIC receives these asserted lines, the
    result is either repeated spurious-interrupt warnings or an unhandled
    interrupt fault.
    
    The fix adds an early return inside the error branch. The
    interrupt-enable write to SCSCR is skipped entirely when no handler is
    registered.
    
    SCIF TX continues to operate correctly after this change. The Xen
    serial framework never calls serial_async_transmit() for SCIF, so
    port->txbuf is always NULL. This causes __serial_putc() to take the
    synchronous finite-capacity path, which polls the SCFSR_TDFE hardware
    flag directly and does not depend on the interrupt mechanism. RX
    wouldn't work if irq wasn't registered.
    
    As a secondary clean-up, the hardware error-flag clearing sequence is
    moved to before the setup_irq() call so that error bits accumulated
    since init_preirq() are cleared unconditionally, regardless of whether
    IRQ registration succeeds.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/scif-uart.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
index 888821a3b8..350d5f14b9 100644
--- a/xen/drivers/char/scif-uart.c
+++ b/xen/drivers/char/scif-uart.c
@@ -187,16 +187,20 @@ static void __init scif_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name    = "scif_uart";
     uart->irqaction.dev_id  = port;
 
-    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-        dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %d\n",
-                uart->irq);
-
     /* Clear all errors */
     if ( scif_readw(uart, params->status_reg) & params->error_mask )
         scif_writew(uart, params->status_reg, ~params->error_mask);
     if ( scif_readw(uart, params->overrun_reg) & params->overrun_mask )
         scif_writew(uart, params->overrun_reg, ~params->overrun_mask);
 
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+    {
+        dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %u\n",
+                uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
+
     /* Enable TX/RX and Error Interrupts  */
     scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) |
                 params->irq_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 07:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 07:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294676.1571368 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHGIH-0000iH-A9; Mon, 27 Apr 2026 07:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294676.1571368; Mon, 27 Apr 2026 07: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 1wHGIH-0000i9-6s; Mon, 27 Apr 2026 07:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1294676;
 Mon, 27 Apr 2026 07:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHGIG-0000hx-2v
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 07:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGIG-004Ptu-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGIF-004uuP-36
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3zxznURA9cK4xwZ9R2vttx0OU/j0411cUANWlMg74Rw=; b=6vz4KP6wtx4Z6g2yOY0xHAP2fz
	cMajB7WMjx4wy3KbbpYLBMDXGIB/GlWWsdXP32mMI5X0ASCV0OpXE7inrqA0Q1UCNJv3kAXpXnA1h
	HX/0jC2TyoHBjZGM/yvryXUI9vfKkKFawc5QGsCK8G4ImUAqaJAIiYaIvpCrf6jsVjr4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/drivers/char/pl011: fix IRQ registration failure propagation
Message-Id: <E1wHGIF-004uuP-36@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 07:22:11 +0000

commit 233d555df9795c0c12c1b54e0a7e96d9e485d374
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:41 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char/pl011: fix IRQ registration failure propagation
    
    In pl011_init_postirq(), two code paths could reach the
    interrupt-unmask write to IMSC without a handler being registered:
    
    - When no valid IRQ number was provided (uart->irq <= 0), the original
      positive-condition guard (if uart->irq > 0) skipped the irqaction
      setup but still fell through to the IMSC write, unmasking
      RTI|OEI|BEI|PEI|FEI|TXI|RXI with no handler installed.
    
    - When setup_irq() returned an error, only an error message was
      printed and execution continued to the IMSC write, arming all
      hardware interrupt lines with no handler to service them. On
      platforms where the GIC receives these asserted lines, the result
      is either repeated spurious-interrupt warnings or an unhandled
      interrupt fault.
    
    Restructure pl011_init_postirq() to use early returns: return
    immediately when no valid IRQ is provided, and return after logging
    the error when setup_irq() fails. The interrupt-enable write to IMSC
    is only reached when IRQ registration succeeds.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/pl011.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 5f9913367d..a336241033 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -150,18 +150,24 @@ static void __init pl011_init_postirq(struct serial_port *port)
     struct pl011 *uart = port->uart;
     int rc;
 
-    if ( uart->irq > 0 )
-    {
-        uart->irqaction.handler = pl011_interrupt;
-        uart->irqaction.name    = "pl011";
-        uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
-    }
+    /* Don't unmask interrupts if no valid irq was provided */
+    if ( uart->irq == 0 )
+        return;
+
+    uart->irqaction.handler = pl011_interrupt;
+    uart->irqaction.name    = "pl011";
+    uart->irqaction.dev_id  = port;
 
     /* Clear pending error interrupts */
     pl011_write(uart, ICR, OEI|BEI|PEI|FEI);
 
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+    {
+        printk("ERROR: Failed to allocate pl011 IRQ %u\n", uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
+
     /* Unmask interrupts */
     pl011_write(uart, IMSC, RTI|OEI|BEI|PEI|FEI|TXI|RXI);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 07:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 07:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294677.1571372 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHGIR-0000ls-BJ; Mon, 27 Apr 2026 07:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294677.1571372; Mon, 27 Apr 2026 07: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 1wHGIR-0000lk-8N; Mon, 27 Apr 2026 07:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1294677;
 Mon, 27 Apr 2026 07:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHGIQ-0000la-5a
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 07:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGIQ-004Pu6-0S
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGIQ-004uuy-0K
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D1yfBdMJZixCtXs2R1iJ9PlRqjpH52pwJ0xTAG5U0F0=; b=5gacx+dZ+uDAjENIHvxAvRta0m
	1hV9GFblb/O/sfKAyba/6cyt7sNTKr6G9auZjypy1PkH293RMf+JRQJWVFU6gDcu5D9g8oVtqxXCR
	LGuSfxkMIO+jfy34Y06LOYboeT8dxQtD9YU6l5DlS/DU3ZS/QmZXlwEdvx7L2Occpk28=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/drivers/char/cadence-uart: fix IRQ registration failure propagation
Message-Id: <E1wHGIQ-004uuy-0K@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 07:22:22 +0000

commit d075ab7f255a0cd50a778693a9c7743941b13eea
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:42 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char/cadence-uart: fix IRQ registration failure propagation
    
    In cuart_init_postirq(), two code paths could reach the
    interrupt-enable write to IER without a handler being registered:
    
    - When no valid IRQ number was provided (uart->irq <= 0), the original
      positive-condition guard (if uart->irq > 0) skipped the irqaction
      setup but still fell through to the IER write, enabling the receive
      data interrupt with no handler installed.
    
    - When setup_irq() returned an error, only an error message was
      printed and execution continued to the IER write, arming the
      receive hardware interrupt line with no handler to service it. On
      platforms where the GIC receives this asserted line, the result is
      either repeated spurious-interrupt warnings or an unhandled
      interrupt fault.
    
    Restructure cuart_init_postirq() to use early returns in both error
    paths.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/cadence-uart.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/char/cadence-uart.c b/xen/drivers/char/cadence-uart.c
index b2f379833f..0f1c3dd461 100644
--- a/xen/drivers/char/cadence-uart.c
+++ b/xen/drivers/char/cadence-uart.c
@@ -72,19 +72,25 @@ static void __init cuart_init_postirq(struct serial_port *port)
     struct cuart *uart = port->uart;
     int rc;
 
-    if ( uart->irq > 0 )
-    {
-        uart->irqaction.handler = cuart_interrupt;
-        uart->irqaction.name    = "cadence-uart";
-        uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate cadence-uart IRQ %d\n", uart->irq);
-    }
+    /* Don't unmask interrupts if no valid irq was provided */
+    if ( uart->irq == 0 )
+        return;
+
+    uart->irqaction.handler = cuart_interrupt;
+    uart->irqaction.name    = "cadence-uart";
+    uart->irqaction.dev_id  = port;
 
     /* Clear pending error interrupts */
     cuart_write(uart, R_UART_RTRIG, 1);
     cuart_write(uart, R_UART_CISR, ~0);
 
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+    {
+        printk("ERROR: Failed to allocate cadence-uart IRQ %u\n", uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
+
     /* Unmask interrupts */
     cuart_write(uart, R_UART_IDR, ~0);
     cuart_write(uart, R_UART_IER, UART_SR_INTR_RTRIG);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 07:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 07:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294678.1571376 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHGIc-0000nr-Cm; Mon, 27 Apr 2026 07:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294678.1571376; Mon, 27 Apr 2026 07:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHGIc-0000nj-9o; Mon, 27 Apr 2026 07:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1294678;
 Mon, 27 Apr 2026 07:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHGIa-0000nb-CH
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 07:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGIa-004PuU-0w
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHGIa-004uvj-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=05Ij/GqDuHiVHcOn/Bc1VUVytR2FeRMTZCsmtImK3M8=; b=D66UzNTdMqq9mOMsb5yXmjyj7o
	deNGglXhQFmlA3eeAmvynV2mBkbSVz9lvB+UwlXIB0oA8IGwAQMbhRQF2J2ce4xrMAid9YJFcYtkw
	xAe9uDFEbhOXHOTz4cNvJHPzoMa2lkarIc6WYCxPjMq+93z7+oeuInlrQ186Ia/VAycQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/drivers/char: fix exynos4210 IRQ registration failure propagation
Message-Id: <E1wHGIa-004uvj-0c@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 07:22:32 +0000

commit 046adc0e9421cdee352dc08016bb3bacedbafb40
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:42 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char: fix exynos4210 IRQ registration failure propagation
    
    In exynos4210_uart_init_postirq(), when setup_irq() returns an error
    the failure was only logged via dprintk() and execution continued,
    unconditionally clearing UINTM and setting UMCON_INT_EN. This enabled
    receive and transmit interrupt lines with no handler registered. On
    platforms where the GIC receives these asserted lines, the result is
    either repeated spurious-interrupt warnings or an unhandled interrupt
    fault.
    
    Add an early return in the setup_irq() error branch so that the
    interrupt-enable writes to UINTM and UMCON are skipped when IRQ
    registration fails.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/exynos4210-uart.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index 58901df554..7addc11c2c 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -199,8 +199,12 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port)
     uart->irqaction.dev_id  = port;
 
     if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-        dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
+    {
+        dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %u\n",
                 uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
 
     /* Unmask interrupts */
     exynos4210_write(uart, UINTM, ~UINTM_ALLI);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 08:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 08:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294703.1571389 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHHEB-0000MG-71; Mon, 27 Apr 2026 08:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294703.1571389; Mon, 27 Apr 2026 08:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHHEB-0000M8-4P; Mon, 27 Apr 2026 08:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1294703;
 Mon, 27 Apr 2026 08:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHHEA-0000M0-4t
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 08:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEA-004RUl-0K
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEA-004zCO-0B
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=w1DpbkfeCwCS3EfdWslvcvT/ILPxZflsGRlpLw8fjeY=; b=cKH4B2zyjKaOsXs/5MFOBRT+pW
	KLjTslxCmFivXQtMrNdUIEQrGzofPP2jFcHVPLFC3yPUBGI01jXTO5gDeNBqtHvWxqxvgbWBV44au
	OOniBnvrakSghBmQkmJYQrRiQbUVpWAwQN7M/PPk+jntCk3IZaVqhQoW0c52c/sptES8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/drivers/char: fix SCIF IRQ registration failure propagation
Message-Id: <E1wHHEA-004zCO-0B@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 08:22:02 +0000

commit d4873af5348386f8dee4a7bfa102b5443e1078dc
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:41 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char: fix SCIF IRQ registration failure propagation
    
    In scif_uart_init_postirq(), when setup_irq() returns an error the
    failure was only logged via dprintk() and execution continued,
    unconditionally writing TIE|RIE|REIE into the Serial Control Register
    (SCSCR). This armed all three hardware interrupt lines (TX FIFO empty,
    RX data ready, receive error) with no handler registered to service
    them. On platforms where the GIC receives these asserted lines, the
    result is either repeated spurious-interrupt warnings or an unhandled
    interrupt fault.
    
    The fix adds an early return inside the error branch. The
    interrupt-enable write to SCSCR is skipped entirely when no handler is
    registered.
    
    SCIF TX continues to operate correctly after this change. The Xen
    serial framework never calls serial_async_transmit() for SCIF, so
    port->txbuf is always NULL. This causes __serial_putc() to take the
    synchronous finite-capacity path, which polls the SCFSR_TDFE hardware
    flag directly and does not depend on the interrupt mechanism. RX
    wouldn't work if irq wasn't registered.
    
    As a secondary clean-up, the hardware error-flag clearing sequence is
    moved to before the setup_irq() call so that error bits accumulated
    since init_preirq() are cleared unconditionally, regardless of whether
    IRQ registration succeeds.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/scif-uart.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
index 888821a3b8..350d5f14b9 100644
--- a/xen/drivers/char/scif-uart.c
+++ b/xen/drivers/char/scif-uart.c
@@ -187,16 +187,20 @@ static void __init scif_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name    = "scif_uart";
     uart->irqaction.dev_id  = port;
 
-    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-        dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %d\n",
-                uart->irq);
-
     /* Clear all errors */
     if ( scif_readw(uart, params->status_reg) & params->error_mask )
         scif_writew(uart, params->status_reg, ~params->error_mask);
     if ( scif_readw(uart, params->overrun_reg) & params->overrun_mask )
         scif_writew(uart, params->overrun_reg, ~params->overrun_mask);
 
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+    {
+        dprintk(XENLOG_ERR, "Failed to allocated scif_uart IRQ %u\n",
+                uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
+
     /* Enable TX/RX and Error Interrupts  */
     scif_writew(uart, SCIF_SCSCR, scif_readw(uart, SCIF_SCSCR) |
                 params->irq_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 08:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 08:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294705.1571401 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHHEL-0000e3-ES; Mon, 27 Apr 2026 08:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294705.1571401; Mon, 27 Apr 2026 08:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHHEL-0000dx-Bm; Mon, 27 Apr 2026 08:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1294705;
 Mon, 27 Apr 2026 08:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHHEK-0000dP-7g
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 08:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEK-004RUw-0d
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEK-004zDc-0V
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E1X8pK1GVozG3PTLy7jMIW0fVwqib5zEls6yN7Rhb/w=; b=JO20Oyiez9M8jaFSjluykPMI9t
	E86UKu551FnKCo4xkydw05Z6EosdUg2zhytx04ELHiNRTcG7lsD0SO5XpgGdfjub4diIf68fBE97e
	MfG+rEhRa+aDPuLiOobpO2ZDFeIL8Oc3f5GPXUjqbXgyw/Z5v4cLPbB16EGtJ1J9GCVM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/drivers/char/pl011: fix IRQ registration failure propagation
Message-Id: <E1wHHEK-004zDc-0V@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 08:22:12 +0000

commit 233d555df9795c0c12c1b54e0a7e96d9e485d374
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:41 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char/pl011: fix IRQ registration failure propagation
    
    In pl011_init_postirq(), two code paths could reach the
    interrupt-unmask write to IMSC without a handler being registered:
    
    - When no valid IRQ number was provided (uart->irq <= 0), the original
      positive-condition guard (if uart->irq > 0) skipped the irqaction
      setup but still fell through to the IMSC write, unmasking
      RTI|OEI|BEI|PEI|FEI|TXI|RXI with no handler installed.
    
    - When setup_irq() returned an error, only an error message was
      printed and execution continued to the IMSC write, arming all
      hardware interrupt lines with no handler to service them. On
      platforms where the GIC receives these asserted lines, the result
      is either repeated spurious-interrupt warnings or an unhandled
      interrupt fault.
    
    Restructure pl011_init_postirq() to use early returns: return
    immediately when no valid IRQ is provided, and return after logging
    the error when setup_irq() fails. The interrupt-enable write to IMSC
    is only reached when IRQ registration succeeds.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/pl011.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 5f9913367d..a336241033 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -150,18 +150,24 @@ static void __init pl011_init_postirq(struct serial_port *port)
     struct pl011 *uart = port->uart;
     int rc;
 
-    if ( uart->irq > 0 )
-    {
-        uart->irqaction.handler = pl011_interrupt;
-        uart->irqaction.name    = "pl011";
-        uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
-    }
+    /* Don't unmask interrupts if no valid irq was provided */
+    if ( uart->irq == 0 )
+        return;
+
+    uart->irqaction.handler = pl011_interrupt;
+    uart->irqaction.name    = "pl011";
+    uart->irqaction.dev_id  = port;
 
     /* Clear pending error interrupts */
     pl011_write(uart, ICR, OEI|BEI|PEI|FEI);
 
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+    {
+        printk("ERROR: Failed to allocate pl011 IRQ %u\n", uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
+
     /* Unmask interrupts */
     pl011_write(uart, IMSC, RTI|OEI|BEI|PEI|FEI|TXI|RXI);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 08:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 08:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294708.1571405 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHHEV-0000n4-Fu; Mon, 27 Apr 2026 08:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294708.1571405; Mon, 27 Apr 2026 08: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 1wHHEV-0000mw-D7; Mon, 27 Apr 2026 08:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1294708;
 Mon, 27 Apr 2026 08:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHHEU-0000kH-AV
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 08:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEU-004RV6-0v
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEU-004zE8-0o
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BaseFSAZOvUHu4+0HJXx6xvKAz562WFrqCAXwRW6Pmw=; b=h2270VW9cXdvYzCZ9nInhhBMN6
	pr66cVmexNuCocy0u+kwPdMaOLotoWat+KakwBtmv80+iopYtJgHaN6WGiX6WGP5zJLTUWyuH2QCK
	6Feugab1jH8VlnTyLs/hdalgYK+/BnA1Q4kuulbq+xaq4dEl3sRX45QIwYpQr2e/g1eU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/drivers/char/cadence-uart: fix IRQ registration failure propagation
Message-Id: <E1wHHEU-004zE8-0o@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 08:22:22 +0000

commit d075ab7f255a0cd50a778693a9c7743941b13eea
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:42 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char/cadence-uart: fix IRQ registration failure propagation
    
    In cuart_init_postirq(), two code paths could reach the
    interrupt-enable write to IER without a handler being registered:
    
    - When no valid IRQ number was provided (uart->irq <= 0), the original
      positive-condition guard (if uart->irq > 0) skipped the irqaction
      setup but still fell through to the IER write, enabling the receive
      data interrupt with no handler installed.
    
    - When setup_irq() returned an error, only an error message was
      printed and execution continued to the IER write, arming the
      receive hardware interrupt line with no handler to service it. On
      platforms where the GIC receives this asserted line, the result is
      either repeated spurious-interrupt warnings or an unhandled
      interrupt fault.
    
    Restructure cuart_init_postirq() to use early returns in both error
    paths.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/cadence-uart.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/char/cadence-uart.c b/xen/drivers/char/cadence-uart.c
index b2f379833f..0f1c3dd461 100644
--- a/xen/drivers/char/cadence-uart.c
+++ b/xen/drivers/char/cadence-uart.c
@@ -72,19 +72,25 @@ static void __init cuart_init_postirq(struct serial_port *port)
     struct cuart *uart = port->uart;
     int rc;
 
-    if ( uart->irq > 0 )
-    {
-        uart->irqaction.handler = cuart_interrupt;
-        uart->irqaction.name    = "cadence-uart";
-        uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate cadence-uart IRQ %d\n", uart->irq);
-    }
+    /* Don't unmask interrupts if no valid irq was provided */
+    if ( uart->irq == 0 )
+        return;
+
+    uart->irqaction.handler = cuart_interrupt;
+    uart->irqaction.name    = "cadence-uart";
+    uart->irqaction.dev_id  = port;
 
     /* Clear pending error interrupts */
     cuart_write(uart, R_UART_RTRIG, 1);
     cuart_write(uart, R_UART_CISR, ~0);
 
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
+    {
+        printk("ERROR: Failed to allocate cadence-uart IRQ %u\n", uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
+
     /* Unmask interrupts */
     cuart_write(uart, R_UART_IDR, ~0);
     cuart_write(uart, R_UART_IER, UART_SR_INTR_RTRIG);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 08:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 08:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294712.1571410 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHHEf-0000uK-J3; Mon, 27 Apr 2026 08:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294712.1571410; Mon, 27 Apr 2026 08: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 1wHHEf-0000uD-GH; Mon, 27 Apr 2026 08:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1294712;
 Mon, 27 Apr 2026 08:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHHEe-0000tv-Cx
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 08:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEe-004RVT-1D
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHHEe-004zEc-15
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 08: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ufJhxkrCJ3C2WCogPJJhG7iPsLPP+n6/Mo9ICi8hwFQ=; b=rl65LX0OVaqewOgse4WPkyhTAT
	MKkTd1Ojt33Yt98ujuiFjGvmvj80L5aLDadfPsQCmVWqDZE6Jfs3e7d0zgZKNzEhgqR9Lne05l8l1
	9l8xCAkpYBpmYCEN330giyeEdk7eza18Ngw+shO+45LmWBgTE1hwSwWNshhM1qt/nb6o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/drivers/char: fix exynos4210 IRQ registration failure propagation
Message-Id: <E1wHHEe-004zEc-15@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 08:22:32 +0000

commit 046adc0e9421cdee352dc08016bb3bacedbafb40
Author:     Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
AuthorDate: Thu Apr 23 16:11:42 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 08:52:38 2026 +0200

    xen/drivers/char: fix exynos4210 IRQ registration failure propagation
    
    In exynos4210_uart_init_postirq(), when setup_irq() returns an error
    the failure was only logged via dprintk() and execution continued,
    unconditionally clearing UINTM and setting UMCON_INT_EN. This enabled
    receive and transmit interrupt lines with no handler registered. On
    platforms where the GIC receives these asserted lines, the result is
    either repeated spurious-interrupt warnings or an unhandled interrupt
    fault.
    
    Add an early return in the setup_irq() error branch so that the
    interrupt-enable writes to UINTM and UMCON are skipped when IRQ
    registration fails.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/drivers/char/exynos4210-uart.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index 58901df554..7addc11c2c 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -199,8 +199,12 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port)
     uart->irqaction.dev_id  = port;
 
     if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
-        dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
+    {
+        dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %u\n",
                 uart->irq);
+        /* Do not unmask interrupts if irq handler wasn't set */
+        return;
+    }
 
     /* Unmask interrupts */
     exynos4210_write(uart, UINTM, ~UINTM_ALLI);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 10:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 10:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294844.1571540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHJcF-0000mT-Fs; Mon, 27 Apr 2026 10:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294844.1571540; Mon, 27 Apr 2026 10: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 1wHJcF-0000mJ-Cu; Mon, 27 Apr 2026 10:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1294844;
 Mon, 27 Apr 2026 10:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHJcD-0000lY-NC
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 10:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHJcD-004UQe-27
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 10:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHJcD-005B5i-1z
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZvQsQmOYOFUHhcvi8SuVJJ95b3JondKQkn68PTPPZOo=; b=4oDEWeHT/1wLfxly8Mz4+kPDPt
	1wa8PY9ELBY3RULyHg1DNNlZM0ZUwc9/2UXqjRkpE53/ldqd9k/IYOouyvX1xLTHNKaZAQk1/5j1o
	9udl749M5Sn8wnwNVj1uxNpYDLaGJ+jhJsezQiRYEo/O8VmNv+pe7jToiQPFORMLE5RE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] device-tree: Improve hwdom memory allocation for DMA
Message-Id: <E1wHJcD-005B5i-1z@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 10:55:01 +0000

commit de99f32635552ee1126207ab3c1ad726a5f86a96
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Fri Apr 17 11:11:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 12:03:13 2026 +0200

    device-tree: Improve hwdom memory allocation for DMA
    
    When LLC coloring is enabled, the hardware domain gets memory from
    host free regions rather than the fixed guest RAM banks.  The previous
    code sorted these regions by descending size, which usually causes
    high-address memory to be allocated first.
    
    All allocated memory could reside above 4 GB leaving DMA non-functional
    for devices with limited addressing capabilities.
    
    Improve the handling as follows:
    - Sort free regions by ascending address instead of descending size,
      so low-memory banks are allocated first,
    - Skip banks smaller than 128 MB (or the total remaining allocation,
      whichever is less) until the first bank is placed, ensuring
      place_modules() has enough contiguous space,
    - Extract the hardware domain allocation path into its own function
      (allocate_hwdom_memory) for clarity.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/domain-build.c | 152 +++++++++++++++++++++-------------
 1 file changed, 96 insertions(+), 56 deletions(-)

diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index 540627b74e..c51520ebad 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -133,9 +133,9 @@ static int __init add_hwdom_free_regions(unsigned long s_gfn,
     e += 1;
     size = (e - start) & ~(SZ_2M - 1);
 
-    /* Find the insert position (descending order). */
-    for ( i = 0; i < free_regions->nr_banks ; i++ )
-        if ( size > free_regions->bank[i].size )
+    /* Find the insert position (ascending address order). */
+    for ( i = 0; i < free_regions->nr_banks; i++ )
+        if ( start < free_regions->bank[i].start )
             break;
 
     /* Move the other banks to make space. */
@@ -234,82 +234,123 @@ out:
     return res;
 }
 
-void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
+/*
+ * Allocate memory for the hardware domain using the host memory layout, when
+ * the domain is not direct mapped. The only case for this is when LLC coloring
+ * is enabled.
+ *
+ * Banks are sorted by ascending address from add_hwdom_free_regions(), so
+ * low memory banks are naturally allocated first (if any). This allows the
+ * hardware domain to have memory reachable by devices with limited DMA address
+ * capabilities (e.g. 32-bit DMA).
+ *
+ * The first bank allocated must be large enough for place_modules() to fit
+ * the kernel, DTB and initrd.
+ */
+static bool __init allocate_hwdom_memory(struct kernel_info *kinfo)
 {
+    const paddr_t min_bank_size =
+        min_t(paddr_t, kinfo->unassigned_mem, MB(128));
     struct membanks *mem = kernel_info_get_mem(kinfo);
-    unsigned int i, nr_banks = GUEST_RAM_BANKS;
-    struct membanks *hwdom_free_mem = NULL;
-
-    printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n",
-           /* Don't want format this as PRIpaddr (16 digit hex) */
-           (unsigned long)(kinfo->unassigned_mem >> 20), d);
+    unsigned int i, nr_banks;
+    struct membanks *hwdom_free_mem;
+    struct membanks *gnttab =
+        IS_ENABLED(CONFIG_GRANT_TABLE)
+        ? membanks_xzalloc(1, MEMORY)
+        : NULL;
 
-    mem->nr_banks = 0;
     /*
-     * Use host memory layout for hwdom. Only case for this is when LLC coloring
-     * is enabled.
+     * Exclude the following regions:
+     * 1) Remove reserved memory
+     * 2) Grant table assigned to hwdom
      */
-    if ( is_hardware_domain(d) )
-    {
-        struct membanks *gnttab =
-            IS_ENABLED(CONFIG_GRANT_TABLE)
-            ? membanks_xzalloc(1, MEMORY)
-            : NULL;
-        /*
-         * Exclude the following regions:
-         * 1) Remove reserved memory
-         * 2) Grant table assigned to hwdom
-         */
-        const struct membanks *mem_banks[] = {
-            bootinfo_get_reserved_mem(),
-            gnttab,
-        };
+    const struct membanks *mem_banks[] = {
+        bootinfo_get_reserved_mem(),
+        gnttab,
+    };
 
 #ifdef CONFIG_GRANT_TABLE
-        if ( !gnttab )
-            goto fail;
+    if ( !gnttab )
+        return false;
 
-        gnttab->nr_banks = 1;
-        gnttab->bank[0].start = kinfo->gnttab_start;
-        gnttab->bank[0].size = kinfo->gnttab_size;
+    gnttab->nr_banks = 1;
+    gnttab->bank[0].start = kinfo->gnttab_start;
+    gnttab->bank[0].size = kinfo->gnttab_size;
 #endif
 
-        hwdom_free_mem = membanks_xzalloc(NR_MEM_BANKS, MEMORY);
-        if ( !hwdom_free_mem )
-            goto fail;
-
-        if ( find_unallocated_memory(kinfo, mem_banks, ARRAY_SIZE(mem_banks),
-                                     hwdom_free_mem, add_hwdom_free_regions) )
-            goto fail;
+    hwdom_free_mem = membanks_xzalloc(NR_MEM_BANKS, MEMORY);
+    if ( !hwdom_free_mem )
+    {
+        xfree(gnttab);
+        return false;
+    }
 
-        nr_banks = hwdom_free_mem->nr_banks;
+    if ( find_unallocated_memory(kinfo, mem_banks, ARRAY_SIZE(mem_banks),
+                                 hwdom_free_mem, add_hwdom_free_regions) )
+    {
         xfree(gnttab);
+        xfree(hwdom_free_mem);
+        return false;
     }
 
-    for ( i = 0; kinfo->unassigned_mem > 0 && nr_banks > 0; i++, nr_banks-- )
+    xfree(gnttab);
+    nr_banks = hwdom_free_mem->nr_banks;
+
+    for ( i = 0; (kinfo->unassigned_mem > 0) && (i < nr_banks); i++ )
     {
-        paddr_t bank_start, bank_size;
+        paddr_t bank_size;
+
+        /*
+         * The first bank must be large enough for place_modules() to
+         * fit the kernel, DTB and initrd.  Skip small regions to avoid
+         * ending up with a tiny first bank.
+         */
+        if ( !mem->nr_banks && (hwdom_free_mem->bank[i].size < min_bank_size) )
+            continue;
 
-        if ( is_hardware_domain(d) )
+        bank_size = MIN(hwdom_free_mem->bank[i].size, kinfo->unassigned_mem);
+        if ( !allocate_bank_memory(kinfo,
+                                   gaddr_to_gfn(hwdom_free_mem->bank[i].start),
+                                   bank_size) )
         {
-            bank_start = hwdom_free_mem->bank[i].start;
-            bank_size = hwdom_free_mem->bank[i].size;
+            xfree(hwdom_free_mem);
+            return false;
         }
-        else
+    }
+
+    xfree(hwdom_free_mem);
+    return true;
+}
+
+void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
+{
+    struct membanks *mem = kernel_info_get_mem(kinfo);
+    unsigned int i;
+
+    printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n",
+           /* Don't want format this as PRIpaddr (16 digit hex) */
+           (unsigned long)(kinfo->unassigned_mem >> 20), d);
+
+    mem->nr_banks = 0;
+
+    if ( is_hardware_domain(d) )
+    {
+        if ( !allocate_hwdom_memory(kinfo) )
+            goto fail;
+    }
+    else
+    {
+        for ( i = 0; kinfo->unassigned_mem > 0 && i < GUEST_RAM_BANKS; i++ )
         {
             const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
             const uint64_t banksize[] = GUEST_RAM_BANK_SIZES;
+            paddr_t bank_size;
 
-            if ( i >= GUEST_RAM_BANKS )
+            bank_size = MIN(banksize[i], kinfo->unassigned_mem);
+            if ( !allocate_bank_memory(kinfo, gaddr_to_gfn(bankbase[i]),
+                                       bank_size) )
                 goto fail;
-
-            bank_start = bankbase[i];
-            bank_size = banksize[i];
         }
-
-        bank_size = MIN(bank_size, kinfo->unassigned_mem);
-        if ( !allocate_bank_memory(kinfo, gaddr_to_gfn(bank_start), bank_size) )
-            goto fail;
     }
 
     if ( kinfo->unassigned_mem )
@@ -326,7 +367,6 @@ void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
                (unsigned long)(mem->bank[i].size >> 20));
     }
 
-    xfree(hwdom_free_mem);
     return;
 
   fail:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 10:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 10:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294845.1571545 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHJcP-0000qw-Hq; Mon, 27 Apr 2026 10:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294845.1571545; Mon, 27 Apr 2026 10: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 1wHJcP-0000ql-EN; Mon, 27 Apr 2026 10:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1294845;
 Mon, 27 Apr 2026 10:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHJcN-0000qG-RH
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 10:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHJcN-004URE-2d
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 10:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHJcN-005B80-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 10: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H8XLEaQBDbibvi8vDMLV0UYru/BhUVH4+YS8IeQ/RUE=; b=DlHohxzwOwQm1NBN+/ObGUysjD
	QWEX99zn7LRxHhHeXJ/yxOQhOmKMGAPvCFKdmtPv+V11G206beD0B+C9W+zmmzTwzv5MyAOu6PJ8c
	LP9jeQ+i/QtPo/rEF3AoZq1x+P6YxedjiqynsWbMMb61MA41k93zujWQ99CvO4kzgbus=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/gicv3: Decode cacheability fields before comparing
Message-Id: <E1wHJcN-005B80-2J@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 10:55:11 +0000

commit 49e0ce5b3499dfa2b1c5b87d90b7f35fd5207c2b
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon Apr 27 10:37:31 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 12:04:01 2026 +0200

    arm/gicv3: Decode cacheability fields before comparing
    
    GITS_BASER_INNER_CACHEABILITY_MASK and
    GICR_PROPBASER_INNER_CACHEABILITY_MASK are shifted masks. Comparing the
    masked but unshifted values against GIC_BASER_CACHE_nC, which is an
    unshifted enum value, leads to incorrect detection of non-cacheable
    GITS_BASER tables and GICR_PROPBASER mappings.
    
    Use MASK_EXTR() to decode these cacheability fields before comparing
    against GIC_BASER_CACHE_nC, so the backing memory is flushed when
    required.
    
    Fixes: 05238012b86d ("ARM: GICv3 ITS: allocate device and collection table")
    Fixes: c9b939863c89 ("ARM: GICv3: allocate LPI pending and property table")
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v3-its.c | 3 ++-
 xen/arch/arm/gic-v3-lpi.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index e38aa87117..9005ce8ce5 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -496,7 +496,8 @@ retry:
         }
         attr = regc & BASER_ATTR_MASK;
     }
-    if ( (regc & GITS_BASER_INNER_CACHEABILITY_MASK) <= GIC_BASER_CACHE_nC )
+    if ( MASK_EXTR(regc, GITS_BASER_INNER_CACHEABILITY_MASK) <=
+         GIC_BASER_CACHE_nC )
         clean_and_invalidate_dcache_va_range(buffer, table_size);
 
     /* If the host accepted our page size, we are done. */
diff --git a/xen/arch/arm/gic-v3-lpi.c b/xen/arch/arm/gic-v3-lpi.c
index de5052e5cf..9ee338edc2 100644
--- a/xen/arch/arm/gic-v3-lpi.c
+++ b/xen/arch/arm/gic-v3-lpi.c
@@ -351,7 +351,8 @@ static int gicv3_lpi_set_proptable(void __iomem * rdist_base)
     }
 
     /* Remember that we have to flush the property table if non-cacheable. */
-    if ( (reg & GICR_PROPBASER_INNER_CACHEABILITY_MASK) <= GIC_BASER_CACHE_nC )
+    if ( MASK_EXTR(reg, GICR_PROPBASER_INNER_CACHEABILITY_MASK) <=
+         GIC_BASER_CACHE_nC )
     {
         lpi_data.flags |= LPI_PROPTABLE_NEEDS_FLUSHING;
         /* Update the redistributors knowledge about the attributes. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 11:55:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 11:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294856.1571557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHKYJ-00019H-Oz; Mon, 27 Apr 2026 11:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294856.1571557; Mon, 27 Apr 2026 11: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 1wHKYJ-000199-MA; Mon, 27 Apr 2026 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1294856;
 Mon, 27 Apr 2026 11:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHKYH-00018z-OM
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 11:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHKYH-004VT5-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 11:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHKYH-005EcS-24
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=whPAeULEOSB4/sPWJkE5dQiskd9zNk+TpIL/SILoQ+A=; b=4T4LUJubVV4x48uIQGXuPb9nmW
	ex7CZf9aLbZ+ZrwDmFLrbRNUO0aNiWo2XKUTBVTmktwMokCJlwYyEMa15DrCv1QyKglk4QAceFll2
	H6cjyQnCYkOPCHAjL4gas1lKWdQLBOD6EX0wLScvO54jp49hA38dUOQT7NavbNT5a01I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] device-tree: Improve hwdom memory allocation for DMA
Message-Id: <E1wHKYH-005EcS-24@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 11:55:01 +0000

commit de99f32635552ee1126207ab3c1ad726a5f86a96
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Fri Apr 17 11:11:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 12:03:13 2026 +0200

    device-tree: Improve hwdom memory allocation for DMA
    
    When LLC coloring is enabled, the hardware domain gets memory from
    host free regions rather than the fixed guest RAM banks.  The previous
    code sorted these regions by descending size, which usually causes
    high-address memory to be allocated first.
    
    All allocated memory could reside above 4 GB leaving DMA non-functional
    for devices with limited addressing capabilities.
    
    Improve the handling as follows:
    - Sort free regions by ascending address instead of descending size,
      so low-memory banks are allocated first,
    - Skip banks smaller than 128 MB (or the total remaining allocation,
      whichever is less) until the first bank is placed, ensuring
      place_modules() has enough contiguous space,
    - Extract the hardware domain allocation path into its own function
      (allocate_hwdom_memory) for clarity.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/domain-build.c | 152 +++++++++++++++++++++-------------
 1 file changed, 96 insertions(+), 56 deletions(-)

diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index 540627b74e..c51520ebad 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -133,9 +133,9 @@ static int __init add_hwdom_free_regions(unsigned long s_gfn,
     e += 1;
     size = (e - start) & ~(SZ_2M - 1);
 
-    /* Find the insert position (descending order). */
-    for ( i = 0; i < free_regions->nr_banks ; i++ )
-        if ( size > free_regions->bank[i].size )
+    /* Find the insert position (ascending address order). */
+    for ( i = 0; i < free_regions->nr_banks; i++ )
+        if ( start < free_regions->bank[i].start )
             break;
 
     /* Move the other banks to make space. */
@@ -234,82 +234,123 @@ out:
     return res;
 }
 
-void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
+/*
+ * Allocate memory for the hardware domain using the host memory layout, when
+ * the domain is not direct mapped. The only case for this is when LLC coloring
+ * is enabled.
+ *
+ * Banks are sorted by ascending address from add_hwdom_free_regions(), so
+ * low memory banks are naturally allocated first (if any). This allows the
+ * hardware domain to have memory reachable by devices with limited DMA address
+ * capabilities (e.g. 32-bit DMA).
+ *
+ * The first bank allocated must be large enough for place_modules() to fit
+ * the kernel, DTB and initrd.
+ */
+static bool __init allocate_hwdom_memory(struct kernel_info *kinfo)
 {
+    const paddr_t min_bank_size =
+        min_t(paddr_t, kinfo->unassigned_mem, MB(128));
     struct membanks *mem = kernel_info_get_mem(kinfo);
-    unsigned int i, nr_banks = GUEST_RAM_BANKS;
-    struct membanks *hwdom_free_mem = NULL;
-
-    printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n",
-           /* Don't want format this as PRIpaddr (16 digit hex) */
-           (unsigned long)(kinfo->unassigned_mem >> 20), d);
+    unsigned int i, nr_banks;
+    struct membanks *hwdom_free_mem;
+    struct membanks *gnttab =
+        IS_ENABLED(CONFIG_GRANT_TABLE)
+        ? membanks_xzalloc(1, MEMORY)
+        : NULL;
 
-    mem->nr_banks = 0;
     /*
-     * Use host memory layout for hwdom. Only case for this is when LLC coloring
-     * is enabled.
+     * Exclude the following regions:
+     * 1) Remove reserved memory
+     * 2) Grant table assigned to hwdom
      */
-    if ( is_hardware_domain(d) )
-    {
-        struct membanks *gnttab =
-            IS_ENABLED(CONFIG_GRANT_TABLE)
-            ? membanks_xzalloc(1, MEMORY)
-            : NULL;
-        /*
-         * Exclude the following regions:
-         * 1) Remove reserved memory
-         * 2) Grant table assigned to hwdom
-         */
-        const struct membanks *mem_banks[] = {
-            bootinfo_get_reserved_mem(),
-            gnttab,
-        };
+    const struct membanks *mem_banks[] = {
+        bootinfo_get_reserved_mem(),
+        gnttab,
+    };
 
 #ifdef CONFIG_GRANT_TABLE
-        if ( !gnttab )
-            goto fail;
+    if ( !gnttab )
+        return false;
 
-        gnttab->nr_banks = 1;
-        gnttab->bank[0].start = kinfo->gnttab_start;
-        gnttab->bank[0].size = kinfo->gnttab_size;
+    gnttab->nr_banks = 1;
+    gnttab->bank[0].start = kinfo->gnttab_start;
+    gnttab->bank[0].size = kinfo->gnttab_size;
 #endif
 
-        hwdom_free_mem = membanks_xzalloc(NR_MEM_BANKS, MEMORY);
-        if ( !hwdom_free_mem )
-            goto fail;
-
-        if ( find_unallocated_memory(kinfo, mem_banks, ARRAY_SIZE(mem_banks),
-                                     hwdom_free_mem, add_hwdom_free_regions) )
-            goto fail;
+    hwdom_free_mem = membanks_xzalloc(NR_MEM_BANKS, MEMORY);
+    if ( !hwdom_free_mem )
+    {
+        xfree(gnttab);
+        return false;
+    }
 
-        nr_banks = hwdom_free_mem->nr_banks;
+    if ( find_unallocated_memory(kinfo, mem_banks, ARRAY_SIZE(mem_banks),
+                                 hwdom_free_mem, add_hwdom_free_regions) )
+    {
         xfree(gnttab);
+        xfree(hwdom_free_mem);
+        return false;
     }
 
-    for ( i = 0; kinfo->unassigned_mem > 0 && nr_banks > 0; i++, nr_banks-- )
+    xfree(gnttab);
+    nr_banks = hwdom_free_mem->nr_banks;
+
+    for ( i = 0; (kinfo->unassigned_mem > 0) && (i < nr_banks); i++ )
     {
-        paddr_t bank_start, bank_size;
+        paddr_t bank_size;
+
+        /*
+         * The first bank must be large enough for place_modules() to
+         * fit the kernel, DTB and initrd.  Skip small regions to avoid
+         * ending up with a tiny first bank.
+         */
+        if ( !mem->nr_banks && (hwdom_free_mem->bank[i].size < min_bank_size) )
+            continue;
 
-        if ( is_hardware_domain(d) )
+        bank_size = MIN(hwdom_free_mem->bank[i].size, kinfo->unassigned_mem);
+        if ( !allocate_bank_memory(kinfo,
+                                   gaddr_to_gfn(hwdom_free_mem->bank[i].start),
+                                   bank_size) )
         {
-            bank_start = hwdom_free_mem->bank[i].start;
-            bank_size = hwdom_free_mem->bank[i].size;
+            xfree(hwdom_free_mem);
+            return false;
         }
-        else
+    }
+
+    xfree(hwdom_free_mem);
+    return true;
+}
+
+void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
+{
+    struct membanks *mem = kernel_info_get_mem(kinfo);
+    unsigned int i;
+
+    printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n",
+           /* Don't want format this as PRIpaddr (16 digit hex) */
+           (unsigned long)(kinfo->unassigned_mem >> 20), d);
+
+    mem->nr_banks = 0;
+
+    if ( is_hardware_domain(d) )
+    {
+        if ( !allocate_hwdom_memory(kinfo) )
+            goto fail;
+    }
+    else
+    {
+        for ( i = 0; kinfo->unassigned_mem > 0 && i < GUEST_RAM_BANKS; i++ )
         {
             const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
             const uint64_t banksize[] = GUEST_RAM_BANK_SIZES;
+            paddr_t bank_size;
 
-            if ( i >= GUEST_RAM_BANKS )
+            bank_size = MIN(banksize[i], kinfo->unassigned_mem);
+            if ( !allocate_bank_memory(kinfo, gaddr_to_gfn(bankbase[i]),
+                                       bank_size) )
                 goto fail;
-
-            bank_start = bankbase[i];
-            bank_size = banksize[i];
         }
-
-        bank_size = MIN(bank_size, kinfo->unassigned_mem);
-        if ( !allocate_bank_memory(kinfo, gaddr_to_gfn(bank_start), bank_size) )
-            goto fail;
     }
 
     if ( kinfo->unassigned_mem )
@@ -326,7 +367,6 @@ void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
                (unsigned long)(mem->bank[i].size >> 20));
     }
 
-    xfree(hwdom_free_mem);
     return;
 
   fail:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Apr 27 11:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Apr 2026 11:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1294857.1571560 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHKYT-0001Ar-QF; Mon, 27 Apr 2026 11:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1294857.1571560; Mon, 27 Apr 2026 11: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 1wHKYT-0001Aj-NY; Mon, 27 Apr 2026 11:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1294857;
 Mon, 27 Apr 2026 11:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHKYR-0001AT-T4
 for xen-changelog@lists.xenproject.org; Mon, 27 Apr 2026 11:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHKYR-004VT9-2k
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 11:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHKYR-005Ecz-2Q
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Apr 2026 11: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n7yemqW3XjlhiwqfFk0378VCUv8KB6zErnsMdEUHI6E=; b=WIuyGilabposH3xm4fTAgazAq/
	ZbGE4FuO2iEz75Us5o+9pE2qR7LEXFhMtODw01mezhFQ9MTfnyQZiLNVwfqT8a5oI9cHNeCeg1AGD
	ZJxSTZKKdSu68el/hsABmHDZSLLPdCs7SSaiArwaPl+/jg0ySiQj/9F/Ul4f6sHLTpq0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/gicv3: Decode cacheability fields before comparing
Message-Id: <E1wHKYR-005Ecz-2Q@xenbits.xenproject.org>
Date: Mon, 27 Apr 2026 11:55:11 +0000

commit 49e0ce5b3499dfa2b1c5b87d90b7f35fd5207c2b
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon Apr 27 10:37:31 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Apr 27 12:04:01 2026 +0200

    arm/gicv3: Decode cacheability fields before comparing
    
    GITS_BASER_INNER_CACHEABILITY_MASK and
    GICR_PROPBASER_INNER_CACHEABILITY_MASK are shifted masks. Comparing the
    masked but unshifted values against GIC_BASER_CACHE_nC, which is an
    unshifted enum value, leads to incorrect detection of non-cacheable
    GITS_BASER tables and GICR_PROPBASER mappings.
    
    Use MASK_EXTR() to decode these cacheability fields before comparing
    against GIC_BASER_CACHE_nC, so the backing memory is flushed when
    required.
    
    Fixes: 05238012b86d ("ARM: GICv3 ITS: allocate device and collection table")
    Fixes: c9b939863c89 ("ARM: GICv3: allocate LPI pending and property table")
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v3-its.c | 3 ++-
 xen/arch/arm/gic-v3-lpi.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index e38aa87117..9005ce8ce5 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -496,7 +496,8 @@ retry:
         }
         attr = regc & BASER_ATTR_MASK;
     }
-    if ( (regc & GITS_BASER_INNER_CACHEABILITY_MASK) <= GIC_BASER_CACHE_nC )
+    if ( MASK_EXTR(regc, GITS_BASER_INNER_CACHEABILITY_MASK) <=
+         GIC_BASER_CACHE_nC )
         clean_and_invalidate_dcache_va_range(buffer, table_size);
 
     /* If the host accepted our page size, we are done. */
diff --git a/xen/arch/arm/gic-v3-lpi.c b/xen/arch/arm/gic-v3-lpi.c
index de5052e5cf..9ee338edc2 100644
--- a/xen/arch/arm/gic-v3-lpi.c
+++ b/xen/arch/arm/gic-v3-lpi.c
@@ -351,7 +351,8 @@ static int gicv3_lpi_set_proptable(void __iomem * rdist_base)
     }
 
     /* Remember that we have to flush the property table if non-cacheable. */
-    if ( (reg & GICR_PROPBASER_INNER_CACHEABILITY_MASK) <= GIC_BASER_CACHE_nC )
+    if ( MASK_EXTR(reg, GICR_PROPBASER_INNER_CACHEABILITY_MASK) <=
+         GIC_BASER_CACHE_nC )
     {
         lpi_data.flags |= LPI_PROPTABLE_NEEDS_FLUSHING;
         /* Update the redistributors knowledge about the attributes. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296139.1572512 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnH-0006MS-FV; Tue, 28 Apr 2026 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296139.1572512; Tue, 28 Apr 2026 12:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnH-0006MK-D3; Tue, 28 Apr 2026 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1296139;
 Tue, 28 Apr 2026 12:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhnF-0006MD-TQ
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnF-0065Jl-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnF-006ozu-2h
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=L9Og1kE2VrbNjd1h5lQjBpSB8l7RjMfK1B9KJxb7O/0=; b=d6Cvw3WQrc/82E/VYwPF4EzQWA
	WE0RNqjpzb+gOUnepQ9u7cXv3yJC1ua5gN9KQYbLLCL7W2PzeOiW3orBJ9aOqQ61ahR8u6eVWEdMR
	SUx/HWHlHxlfuA0lxw/6TWLbIY+smZoN4Sc+7wL7DKvJktDWZOxRZ6en6ql1xjgMjk+8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHhnF-006ozu-2h@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:44:01 +0000

commit af9e77f5ff774a252a89039c281744de64db44bc
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:41:32 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296140.1572516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnR-0006O7-Gm; Tue, 28 Apr 2026 12:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296140.1572516; Tue, 28 Apr 2026 12:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnR-0006Nz-EL; Tue, 28 Apr 2026 12:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1296140;
 Tue, 28 Apr 2026 12:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhnQ-0006Nl-0R
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnP-0065Jq-38
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnP-006p2F-2z
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BEL8FmulFopeKsh94wou7mywQOSDatPNT4b5prXj65E=; b=N7scxM0ErWHqRNLi7OgtOmnYWC
	AmyhGdwWx7CQ7irr6sVda2MGOSbVAjHaWSVxon6YO2nxmeX9FooUT7KbQ8lY4iY7jaEpo6QNkJw39
	f2tBTrUE0UNAyGeR4UssJSlrZMhxLeChIRzPq9OU1/t4f7Fb33wHKMS4acSL+kePmiQE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHhnP-006p2F-2z@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:44:11 +0000

commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:41:32 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index ec5b122a3f..c6519164be 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -434,17 +434,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -525,10 +531,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -574,14 +576,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296141.1572520 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnb-0006Qm-IY; Tue, 28 Apr 2026 12:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296141.1572520; Tue, 28 Apr 2026 12:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnb-0006Qe-Ff; Tue, 28 Apr 2026 12:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1296141;
 Tue, 28 Apr 2026 12:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhna-0006QY-35
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhna-0065KO-0D
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhna-006p4V-06
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=scZN926f08RJnraohSVLW/iU1KU3sfVwrtW5f/zBnrA=; b=7Oy81dL+htpySSduBtp+gzZ7l6
	6hT7HtWXreIyLHC9QzeimQIi/GeGVS9MId5rpgD5bgZ5s/hYkICd2NN+oDp9WEMfY78L6ZwbNTTAi
	A9TepaMrQuVrnazOal1ZeNgV3vkeshmwcwqsqlUmMXg8b6xahCsLClNL9nUP6n5bt988=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] gnttab: split gnttab_map_frame()
Message-Id: <E1wHhna-006p4V-06@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:44:22 +0000

commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:41:32 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6df8b616e4..6eddbcf912 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -174,12 +174,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -281,10 +279,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index fddecdf978..f5f9c0ac45 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2009,11 +2009,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2095,19 +2093,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 592384514b..f516641eba 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4250,7 +4250,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4288,11 +4289,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 297d7669e9..afdba2045c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -60,8 +60,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -100,12 +105,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296142.1572524 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnl-0006Sl-Jg; Tue, 28 Apr 2026 12:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296142.1572524; Tue, 28 Apr 2026 12:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnl-0006Sd-H3; Tue, 28 Apr 2026 12:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1296142;
 Tue, 28 Apr 2026 12:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhnk-0006SX-GG
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnk-0065KS-1X
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnk-006p6W-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rT9ySAulyZZYgV0IROMVIjxhiTnqhoRD+FPkeX5WWBA=; b=o7s5RemJrbIRndMGbRvITut/Ym
	630Lt6DO1HA+yRZRUSgRSq45r4FDHiMGH+LftQ5dpCQuxmPRg1UsIG3Z+6CDsNUWVp8idff/U06Dk
	8qTu5UPEuR/KD1jE7XrMpxreDZoqvmk70mqqjkUrA4zrKxXJzSUDlxsmp5XLN059RL7A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHhnk-006p6W-1R@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:44:32 +0000

commit f732e91aa8dafb783257fc2d36e1e91ed759e63c
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:42:30 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296143.1572528 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnw-0006Ul-Ky; Tue, 28 Apr 2026 12:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296143.1572528; Tue, 28 Apr 2026 12:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhnw-0006Ud-IT; Tue, 28 Apr 2026 12:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1296143;
 Tue, 28 Apr 2026 12:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhnu-0006UX-Jl
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnu-0065KY-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhnu-006p8g-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zHgXtap2x/5D/zv166ZRORCUnRTDw4cQvYgbQ0uU7EQ=; b=dMoslZlzDJhy/CjG1rhH8wiU9n
	KKiXzOxOYq15Tjp9WuRDddTCccaNfYWHjbQWdZ6FcZYEHKqP8mj4cgQq6YbP8kXvxdxe2zWqnQojl
	Dx0mL0Ih4blVjNfLbtcnKZxQnk/uStv3tMIdjMokC78EtAx4SugQ0m3d2I01zeqSnUA4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHhnu-006p8g-1i@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:44:42 +0000

commit 43e32ae4f92899b6ebd6730d944f51ba55dd88ae
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:42:30 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296144.1572531 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHho6-0006Wo-Mb; Tue, 28 Apr 2026 12:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296144.1572531; Tue, 28 Apr 2026 12:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHho6-0006Wg-Jq; Tue, 28 Apr 2026 12:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1296144;
 Tue, 28 Apr 2026 12:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHho4-0006WZ-Mi
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHho4-0065Kc-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHho4-006pAr-23
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GN3roOesSIQiHf7bLhcqoFkYIdBn+6O3sttVDG+JfdY=; b=mhvidrzNETNc6Xo78KsHYNzaSx
	bRXEc7kRB+YUb7kGjAXQAJDYKo52On+IjerfoqUE+0LLN0Ux33XfOxNVsjwc0zpXaMjom+ztuibwn
	XSecM2Sb5Pu7XpcDIQcFZGsmy2n7eEUrYciP+ty3dJi0UO0MA0zWKlnf3P3WD1j8Rdn0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] gnttab: split gnttab_map_frame()
Message-Id: <E1wHho4-006pAr-23@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:44:52 +0000

commit 0d8b25d1fc17fbd1b3b82b318a8e8a8236b151b7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:42:30 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 3b05b46ee0..9281dc8330 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -129,12 +129,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -236,10 +234,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 743eb02e00..484bb83c41 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2004,11 +2004,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2090,19 +2088,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index cf131c43a1..f9e4bffdb1 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4248,7 +4248,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4286,11 +4287,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 297d7669e9..afdba2045c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -60,8 +60,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -100,12 +105,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296168.1572562 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhxv-0000Yr-VZ; Tue, 28 Apr 2026 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296168.1572562; Tue, 28 Apr 2026 12:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhxv-0000Yi-Ss; Tue, 28 Apr 2026 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1296168;
 Tue, 28 Apr 2026 12:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhxu-0000YW-Bf
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhxu-0065Ve-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhxu-006pok-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ueYD9TMLRLovocCAgozqc2OvoCF5sMCwn029Sx/+fEg=; b=CZqh5bry6K202fKZp+I3gOkm0x
	CpfuDE2+OM6oYG1UDKGWmFKT9XOsJoFam3eAiSlcekXJ219X1GaOAIoSREEW7mwzzLE6yGTpkmwx0
	apfQmw0U6EdIO7jypI0JPZKb0WjnuBdwDhSu+P3PU+E2sUJ/OOCZ6/nv5PNDJl0DllpA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHhxu-006pok-0r@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:55:02 +0000

commit 54ba668c46b657e2a1fb9f9ab01edce7440c31d8
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:43:55 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296169.1572565 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhy6-0000as-0m; Tue, 28 Apr 2026 12:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296169.1572565; Tue, 28 Apr 2026 12:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhy5-0000ak-UH; Tue, 28 Apr 2026 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1296169;
 Tue, 28 Apr 2026 12:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhy4-0000aW-Dz
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhy4-0065Vi-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhy4-006pqJ-19
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hglpGedGKritBd5auy3Htce0VxYKCtA0qCJSA9kELsc=; b=LMe+9k7NzCxq5YVP1mWj+gzZT9
	w5tqYnVnM2fo68KqN4s0xeVeQgzKskXfgi8HqulhjiJzb+Vnw3MiuYWdD+ULjCyBdGIX5W8/4m5vr
	uNsZWRff/7FT7im6n4ftYcv/0JNwtpKktqoFz/nEmuexbXYZnYEnObC3qyvRGDrD6b30=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHhy4-006pqJ-19@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:55:12 +0000

commit cf3a17428abe64e05e332a8165b5af014c5a108d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:43:55 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296170.1572571 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhyG-0000dT-2Y; Tue, 28 Apr 2026 12:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296170.1572571; Tue, 28 Apr 2026 12: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 1wHhyF-0000dJ-Vp; Tue, 28 Apr 2026 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1296170;
 Tue, 28 Apr 2026 12:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhyE-0000dC-Gv
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyE-0065XX-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyE-006puF-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q5c3IA4eCn/rOlHZViOOjY0S6Oux2gMoOga1qli77Nk=; b=ibAeaeWH8GmeDLQOmX6z9ArzsZ
	Dkn403cN+/tSuVUo1Gvm1/gbQFWgMpiIf6VQpjdbz3iL3raqS2Q8eUilpK/zbkZbbmcxXKLuu8Nhb
	Vc5XOmvr7FKa6M7JMsfPFxCKuPjojvzPsE3CPcLqmI8vtjMAecwWlGLW2nUXjfAc+oVc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] gnttab: split gnttab_map_frame()
Message-Id: <E1wHhyE-006puF-1U@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:55:22 +0000

commit 51e09058d589914ee46b8e996bd6e5d322c5cf32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:43:55 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index a56e20ba2b..4b391ac612 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -114,12 +114,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -221,10 +219,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index a317f67ec0..29f5c7c279 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1984,11 +1984,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2070,19 +2068,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 6c77867f8c..e0f306f268 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4242,7 +4242,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4280,11 +4281,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 50edfecfb6..a1db21e3fe 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -56,8 +56,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -96,12 +101,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296171.1572574 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhyQ-0000fe-3X; Tue, 28 Apr 2026 12:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296171.1572574; Tue, 28 Apr 2026 12: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 1wHhyQ-0000fU-0u; Tue, 28 Apr 2026 12:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1296171;
 Tue, 28 Apr 2026 12:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhyO-0000fO-UL
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyO-0065Xp-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyO-006pxa-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M0W2vs0jf5KSMBc0W6W2Babpf0495Dew2wcQQ6Uhg60=; b=iyVDbCyvsg3IpNcRZMWdS1p6ld
	P83nIKtCCH/Y1K5VnM8VE1DP1xgxRhzbhJrJc0d3g0CMlMDEd3fP1MAoHV9Mj1i13sIjVCnyXZsEq
	6NFsEjlk8org0wpiY8LFqbOGelTWpfHDKlzElj35F6FJZySV0vKa8QeeXRE1EVbBhI/g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHhyO-006pxa-2n@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:55:32 +0000

commit 7497e64a3c7f9737e85d1b4fe8277d7ce0391068
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:44:26 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296172.1572578 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhya-0000hp-4v; Tue, 28 Apr 2026 12:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296172.1572578; Tue, 28 Apr 2026 12: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 1wHhya-0000hg-2G; Tue, 28 Apr 2026 12:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1296172;
 Tue, 28 Apr 2026 12:55:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhyZ-0000hU-14
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:55:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyZ-0065Xt-00
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyY-006pyw-36
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DuZfwjICWkn4iqCuqqr9rmrlX98oVbjbZrqtPo00TOE=; b=ZOQWxbIlBPGmgg7kqJSbKbTkWv
	tTAcqlhkrEcM6fRRXlVzDoOJ+laeSuFPOA9kjAvPTWuwVMhOOc9bWCNWFZAm9ZBXC9Ax5IoecFMQO
	f8+LyB27bCSSgoinecUAzDb4clo6Ae03/pWagvlxnckVQhCAP4WW+00Zr85YTom3sytI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHhyY-006pyw-36@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:55:42 +0000

commit 308be67d74bbcd08e36492ea9709f3b8ddb923a0
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:44:26 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296173.1572582 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhyk-0000jv-6N; Tue, 28 Apr 2026 12:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296173.1572582; Tue, 28 Apr 2026 12: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 1wHhyk-0000jn-3Y; Tue, 28 Apr 2026 12:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1296173;
 Tue, 28 Apr 2026 12:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhyj-0000jh-40
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:55:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyj-0065Xy-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyj-006q0H-0D
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BPL6wzoAYbMwv0c6I7vLGR7o5CfqI9q6mk2QFn/JSRg=; b=xY8EaNY3dNmxJv/BWumScRGvTD
	MTiCeDxwkv70TDmjFIrzGBNEO54Cf4Rtjxc0boqPkgJwuWxH1dn2Ow387LgmHwUIGVqfaYs9N3t3c
	dPvRnXhpfe1nVJIqtixmhMaxwilnd1mXwllzV1pOWdIsKZltKD3ch05rKIEHYh3b9/1E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] gnttab: split gnttab_map_frame()
Message-Id: <E1wHhyj-006q0H-0D@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:55:53 +0000

commit 7bcc106db0121aaa91ac3d40157db9d287ecf89f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:44:26 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index def939172c..580b7a0327 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -154,12 +154,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -261,10 +259,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index a317f67ec0..29f5c7c279 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1984,11 +1984,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2070,19 +2068,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index ebe2d2a3ce..751b05efb6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4240,7 +4240,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4278,11 +4279,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 50edfecfb6..a1db21e3fe 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -56,8 +56,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -96,12 +101,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:56:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:56:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296174.1572586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhyv-0000mT-8z; Tue, 28 Apr 2026 12:56:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296174.1572586; Tue, 28 Apr 2026 12:56: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 1wHhyv-0000mL-6G; Tue, 28 Apr 2026 12:56:05 +0000
Received: by outflank-mailman (input) for mailman id 1296174;
 Tue, 28 Apr 2026 12:56:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhyt-0000mF-HO
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:56:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyt-0065YW-1e
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhyt-006q2S-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fgUzsQJb098U3rf6BbZaYHtkeZGUjANc6XLaVmWy2Ko=; b=0RBsh/WKEpJJtQw8uAZyRgvldA
	ghMhpUIEbrEgLv4GwbvDFlwqn+xkB/gXp9HUUJHNN0AVwOF36fQWaz/SInJcExQpsCDnTevAgOQxh
	L+Kb2VvQPcehquDmYfmZlBxrbelRuju/k25UFhDPRvGnagiNxGZElwTaAV8G1veaBr60=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHhyt-006q2S-1U@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:56:03 +0000

commit fcac0584a2273b986280987d943d9e9788ccd870
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:45:52 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:56:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:56:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296175.1572590 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhz5-0000og-Ah; Tue, 28 Apr 2026 12:56:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296175.1572590; Tue, 28 Apr 2026 12:56: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 1wHhz5-0000oZ-7s; Tue, 28 Apr 2026 12:56:15 +0000
Received: by outflank-mailman (input) for mailman id 1296175;
 Tue, 28 Apr 2026 12:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhz3-0000o7-KB
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhz3-0065Ya-1v
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhz3-006q3L-1o
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0/JfJ6NdCk1BEBfVPsAwqxfKUf8IHYotzDL8Cm6iDOk=; b=3EaSsfFVAx8TxKhSKHCw4cicwk
	XgSn0ksS/flhJbpkSWQYqgEyFxTeqnsyM/lAiFJCz8A7DyUMUeMUN4KCPZNDN8CJaOCV8saxzkjrY
	U7Ozb4NgGawNJtN6/9Gc6DrmYbC2L0kZk20hFCPTeWLhyBAnvnzpkuBpu/vp0bnoffJI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHhz3-006q3L-1o@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:56:13 +0000

commit 7f9ded38ed3142429396d7c1dba5dcfb308c8e55
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:45:52 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:56:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:56:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296176.1572595 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhzF-0000qm-D0; Tue, 28 Apr 2026 12:56:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296176.1572595; Tue, 28 Apr 2026 12:56: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 1wHhzF-0000qe-9T; Tue, 28 Apr 2026 12:56:25 +0000
Received: by outflank-mailman (input) for mailman id 1296176;
 Tue, 28 Apr 2026 12:56:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhzD-0000qX-Mv
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzD-0065Yf-2D
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzD-006q4B-28
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vZ6Gqjef6IlJ0qaG0O1Od8tmUSiSW9X9ZXfoIsE4b98=; b=c7I0eLlVn01eWtWjakZVIGDSI7
	5sh60vT4tRZ0QcsxHostNzR3sk2tkwaRcrmG0bMdhmHdiyKqyxIBEk91EQoQp50DAfAd4rDlMLbY8
	hLEEyVuKBNjB4ubg9zALUosoTFYpEdTdje//5/dmbfKUdaDvNYrL9EL5eZEdaQcHcUaE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] gnttab: split gnttab_map_frame()
Message-Id: <E1wHhzD-006q4B-28@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:56:23 +0000

commit dd781ac9bbfa0c74aff8ae9fd97d00410bda7d1c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:45:31 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:45:52 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 1ff67ff2b5..f2975d6670 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1372,12 +1372,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -1479,10 +1477,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8197e9ad45..511b251bc3 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2446,11 +2446,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gpfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gpfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2526,19 +2524,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gpfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 934924cbda..1b7ff1d316 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4237,7 +4237,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4275,11 +4276,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 85fe6b7b5e..ff19b3a53c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -53,8 +53,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -93,12 +98,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:56:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296177.1572598 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhzP-0000sk-DV; Tue, 28 Apr 2026 12:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296177.1572598; Tue, 28 Apr 2026 12: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 1wHhzP-0000sc-Ar; Tue, 28 Apr 2026 12:56:35 +0000
Received: by outflank-mailman (input) for mailman id 1296177;
 Tue, 28 Apr 2026 12:56:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhzO-0000sV-3g
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:56:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzO-0065Ym-0H
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:56:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzO-006q5J-0B
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:56: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hk56VPHVuly+e1uXAvUDq/AM8KF47+jg4DXZh5I39Wc=; b=EtM4y5BtKqh9UFbsYm/Nph+T8k
	UQ3B+YYcFnVL5dRgj3GT+m5CwDAYA/VoSAxf7rHWrxvhbhxcYKIwDC7Sz17GpDFjlgLQZp16ypZyB
	vXBbKo7gPQ/FEYYYEJwxk5439y2AoMBQ96so2p0VUUhfHn6IGnWI5+ezcuMmJVXn8QV0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHhzO-006q5J-0B@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:56:34 +0000

commit db0c7c98e2f39aa6d99fe767b52d8ca7d56fcfda
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:46:21 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:47:42 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 5dd965db15..c099a2eae6 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
 			if perms <> node.perms then
 				Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
 			Some { node with Node.perms }
-	) store.root
+	) store.root;
+	store.quota <- Quota.del store.quota domid
 
 type ops = {
 	store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:56:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:56:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296178.1572602 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhzZ-0000um-Eq; Tue, 28 Apr 2026 12:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296178.1572602; Tue, 28 Apr 2026 12: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 1wHhzZ-0000ue-CE; Tue, 28 Apr 2026 12:56:45 +0000
Received: by outflank-mailman (input) for mailman id 1296178;
 Tue, 28 Apr 2026 12:56:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhzY-0000uX-6F
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:56:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzY-0065Yq-0X
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:56:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzY-006q5f-0R
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EKDZhZg/2OZW+q+QfZgn9h0ZKA+QKRkrMmfXvQS1egM=; b=TbMAoTFTF+iSnH9Tp7gUxQ0nRA
	62M2az8F40ocsz1PFFkZJWOMydWmle+glf+j2YjLS625VUro1/S0HPajaLsALIWJ7EPtVtRL7n6S7
	KlGzD+zCkhywdNlNb+Q/wLbEhtZ6cMzUrW1XVOM6JUUWO0LYPTkZlmc+cspeKCZbJVl0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHhzY-006q5f-0R@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:56:44 +0000

commit 7985e875b9484723c81aed2b25aac9764fc60705
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 28 13:46:30 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:47:42 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstore/xenstored_transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 8ebd16aed2..64e1f7fdd2 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -445,6 +445,7 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 	TDB_DATA key;
 
@@ -453,12 +454,17 @@ static int destroy_transaction(void *_transaction)
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node) {
 			set_tdb_key(i->trans_name, &key);
-			do_tdb_delete(trans->conn, &key, NULL);
+			do_tdb_delete(conn, &key, NULL);
 		}
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	conn->transaction_started--;
+	if (!conn->transaction_started)
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -561,10 +567,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	conn->transaction_started--;
-	if (!conn->transaction_started)
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -646,15 +648,11 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
 	conn->transaction_started = 0;
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 12:56:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 12:56:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296179.1572605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHhzj-0000wm-G7; Tue, 28 Apr 2026 12:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296179.1572605; Tue, 28 Apr 2026 12: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 1wHhzj-0000we-DW; Tue, 28 Apr 2026 12:56:55 +0000
Received: by outflank-mailman (input) for mailman id 1296179;
 Tue, 28 Apr 2026 12:56:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHhzi-0000wX-9T
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 12:56:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzi-0065Yu-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12:56:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHhzi-006q6j-0l
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 12: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KCt0m4pbqKbdxdFDrW3mmWTgzik5cItwsHtiWDvGKb8=; b=jV9JHRKuqX486B+KLqbzg4cuRo
	i6HbDQv3aluWfIMWY0S3fzVuhwuEag32H/UIzeZFQycJS8jB89W8QDHoMrOVK4Vc3MxW/NV2U/m/m
	BJqpKJp+oY2RQAxmzzHW9FZ48mdUVhXy2l/Y7Jv1Nb/ELla5qbmNNCeKzM/SNaifXe38=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] gnttab: split gnttab_map_frame()
Message-Id: <E1wHhzi-006q6j-0l@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 12:56:54 +0000

commit 7dedada0193da974558d3501e15c93634b4c1d25
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:46:35 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:47:42 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6ccffeaea5..93313d55a8 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1333,12 +1333,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -1440,10 +1438,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 6412d83367..8734484725 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2446,11 +2446,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gpfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gpfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2528,19 +2526,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gpfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 62a8685cd5..cc7f2bd821 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4175,7 +4175,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4213,11 +4214,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 85fe6b7b5e..ff19b3a53c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -53,8 +53,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -93,12 +98,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 13:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 13:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296265.1572673 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHijL-0003OB-IE; Tue, 28 Apr 2026 13:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296265.1572673; Tue, 28 Apr 2026 13: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 1wHijL-0003O3-Fj; Tue, 28 Apr 2026 13:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1296265;
 Tue, 28 Apr 2026 13:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHijK-0003Nx-9D
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 13:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHijK-0066R9-0l
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHijK-006tog-0e
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kEfSFaDyZ5NeA+8iyVjKPUHVJK3XI2hx6g8JKUjnRm8=; b=1HI/J5z812sXlzoLUf1ODCThxL
	Dsa+7uUTWpFVd+2b0GNgYcJ2UJAGipffUpLQt9H7JIdM1r5K5EQxVO/njN8wuulGbJPBlvjocumoz
	QJ0UxFHIim1HkmLH0Yc2yOS13zMG/R+QYnNRAOHNXywEVLF8FCW1FWORLsBohypxX6ao=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHijK-006tog-0e@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 13:44:02 +0000

commit db0c7c98e2f39aa6d99fe767b52d8ca7d56fcfda
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:46:21 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:47:42 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 5dd965db15..c099a2eae6 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
 			if perms <> node.perms then
 				Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
 			Some { node with Node.perms }
-	) store.root
+	) store.root;
+	store.quota <- Quota.del store.quota domid
 
 type ops = {
 	store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 13:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 13:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296266.1572676 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHijV-0003QY-Jh; Tue, 28 Apr 2026 13:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296266.1572676; Tue, 28 Apr 2026 13: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 1wHijV-0003QQ-H6; Tue, 28 Apr 2026 13:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1296266;
 Tue, 28 Apr 2026 13:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHijU-0003QI-Eu
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 13:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHijU-0066RE-12
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHijU-006tpv-0v
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=L5mIi+tLSr/U27p+TtRGjBq9G71YnfsnTLwlFdo3DTs=; b=3pZb1UzwVzjoT4jp2DBpEUHcsi
	6TWTZsMhctfJQ6tG6/BAQg08Gy1gyaCepcy+xceU6xLmF6ieTXMU9QlHsIJNo3/69UDTIRgD4Raj6
	+4pHJYHvzyi6rDm6VTMq71t6SFepEf6Yhi7cYkOupga/hxk66ZkhiRKWqDcp84mmnkiU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHijU-006tpv-0v@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 13:44:12 +0000

commit 7985e875b9484723c81aed2b25aac9764fc60705
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Apr 28 13:46:30 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:47:42 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstore/xenstored_transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c
index 8ebd16aed2..64e1f7fdd2 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -445,6 +445,7 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 	TDB_DATA key;
 
@@ -453,12 +454,17 @@ static int destroy_transaction(void *_transaction)
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node) {
 			set_tdb_key(i->trans_name, &key);
-			do_tdb_delete(trans->conn, &key, NULL);
+			do_tdb_delete(conn, &key, NULL);
 		}
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	conn->transaction_started--;
+	if (!conn->transaction_started)
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -561,10 +567,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	conn->transaction_started--;
-	if (!conn->transaction_started)
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -646,15 +648,11 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
 	conn->transaction_started = 0;
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 13:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 13:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296268.1572682 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHijf-0003T4-Ll; Tue, 28 Apr 2026 13:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296268.1572682; Tue, 28 Apr 2026 13: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 1wHijf-0003Sw-IU; Tue, 28 Apr 2026 13:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1296268;
 Tue, 28 Apr 2026 13:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHije-0003Sq-Eb
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 13:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHije-0066RK-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHije-006tqv-1F
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IuieRtBZhfatuX2PEydo7M0yJ4j1kUgfWrMk2nl/ot4=; b=nod0HmqV6cD9UDrjTJsnldHLEk
	XIvHjbKKPB8NNVdNjGva89qnq+ZMSCGowCqiwT5Z1RCnqg36/dSWCAVFhriv1TnV6ZvuqivTN1oja
	mMKEWsd62nemTUAtTGNFalFHpQ47SxHRguhSQytlTUFmNk78NkIYp/TvP4sT2QzYujpw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] gnttab: split gnttab_map_frame()
Message-Id: <E1wHije-006tqv-1F@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 13:44:22 +0000

commit 7dedada0193da974558d3501e15c93634b4c1d25
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:46:35 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:47:42 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6ccffeaea5..93313d55a8 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1333,12 +1333,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -1440,10 +1438,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 6412d83367..8734484725 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2446,11 +2446,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gpfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gpfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2528,19 +2526,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gpfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 62a8685cd5..cc7f2bd821 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4175,7 +4175,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4213,11 +4214,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 85fe6b7b5e..ff19b3a53c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -53,8 +53,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -93,12 +98,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 13:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 13:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296270.1572685 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHity-00050O-Cv; Tue, 28 Apr 2026 13:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296270.1572685; Tue, 28 Apr 2026 13: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 1wHity-00050F-9v; Tue, 28 Apr 2026 13:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1296270;
 Tue, 28 Apr 2026 13:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHitx-000509-ML
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 13:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHitx-0066cE-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHitx-006uBF-1k
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Z5k+aU93qXaWH8/PvzJW7Iq8q07RwxxeDUNc08Nr+bc=; b=7JHw8caPHS0sOPk8XV1xFsRpDs
	7QDsA8dn/3Ol/74BDeKJ9C7TCO1K4qUEbbQcB5xvcJgX1RH8hqfibULGwQvcWg8nljsLYg7QvduGJ
	Y1OfscymtoSB9OdX5pcXXVdQDfKhwr+oopMg0mxzWWe1Aq5m2UbxhY6PkZGNDJ19cifc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHitx-006uBF-1k@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 13:55:01 +0000

commit af9e77f5ff774a252a89039c281744de64db44bc
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:41:32 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 13:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 13:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296271.1572689 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHiu8-00052G-EC; Tue, 28 Apr 2026 13:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296271.1572689; Tue, 28 Apr 2026 13: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 1wHiu8-000528-BU; Tue, 28 Apr 2026 13:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1296271;
 Tue, 28 Apr 2026 13:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHiu7-000521-Na
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 13:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHiu7-0066cI-2D
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHiu7-006uBn-24
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OsAQAZdOWwjwDbCNClW8t3kJIAr2KrbpwxSJm2I55Ww=; b=HlTOGeoPXeF0RwY080ck2uSYh4
	516cZGOghrvGl/Ri1l0RX7iI/qYBVuF6tBoXfthgAcnB6IvgpOQlEDYMO8CESsDeVeTQ2XY02sqJc
	aI8FI9BwBGNb8LfWBjnitEO54ZwG2e4FRgCPT01AMF8BJ6do0NaNylwL7dJrUOkHLqhQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHiu7-006uBn-24@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 13:55:11 +0000

commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:41:32 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index ec5b122a3f..c6519164be 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -434,17 +434,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -525,10 +531,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -574,14 +576,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 13:55:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 13:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296272.1572693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHiuI-00054j-FZ; Tue, 28 Apr 2026 13:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296272.1572693; Tue, 28 Apr 2026 13: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 1wHiuI-00054a-Cs; Tue, 28 Apr 2026 13:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1296272;
 Tue, 28 Apr 2026 13:55:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHiuH-00054U-Rz
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 13:55:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHiuH-0066d6-2h
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHiuH-006uD5-2Q
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 13: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SsSj7g69ml9yys0Oly00U+TdyAqv1DYW1CMs2vW9/xk=; b=a0G/0AOrMeilxiyVsEv/hMQ6oe
	gOISAJ/XrukzESDlfDPkIPFDFjDl4ACa/iNB+jvdUZWH6Fwai5sbnthOMPETMLFDZUAA4ybgJ3gyP
	Q3z5yztBqBFqX7z5Oh4D4b9/8omFpjJZp3yQHrzsYUNpeKWQdIE539t5Rdvk4pn1mVb0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] gnttab: split gnttab_map_frame()
Message-Id: <E1wHiuH-006uD5-2Q@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 13:55:21 +0000

commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:41:32 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6df8b616e4..6eddbcf912 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -174,12 +174,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -281,10 +279,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index fddecdf978..f5f9c0ac45 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2009,11 +2009,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2095,19 +2093,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 592384514b..f516641eba 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4250,7 +4250,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4288,11 +4289,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 297d7669e9..afdba2045c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -60,8 +60,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -100,12 +105,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 15:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 15:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296468.1572877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHkGB-0004fO-IQ; Tue, 28 Apr 2026 15:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296468.1572877; Tue, 28 Apr 2026 15: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 1wHkGB-0004fG-Fm; Tue, 28 Apr 2026 15:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1296468;
 Tue, 28 Apr 2026 15:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHkG9-0004fA-SZ
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 15:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHkG9-0068Er-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 15:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHkG9-006xnK-2c
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 15:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Fi76HfVKi0oBUQIuvYfWmMIFhC6DFdL1q3oooNgNtgo=; b=qOau5T9x5Rr9qJ1/mUyTUg8j4Q
	8okDaP8OVxnJiDmcIjkXY5XuBiys/VQj+iNJOBzz/5NW0v1tfkBZmLORZADchKzBZ3MCXuhSMuso6
	FD+ba8ys58GS8EyEHPjH+uAe1VMDQPgJBbFXAFqxGVXApY23TOibnLbiMa9aXGx2iTjo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHkG9-006xnK-2c@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 15:22:01 +0000

commit f732e91aa8dafb783257fc2d36e1e91ed759e63c
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:42:30 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 15:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 15:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296469.1572880 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHkGL-0004hA-Ja; Tue, 28 Apr 2026 15:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296469.1572880; Tue, 28 Apr 2026 15: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 1wHkGL-0004h2-H6; Tue, 28 Apr 2026 15:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1296469;
 Tue, 28 Apr 2026 15:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHkGJ-0004gs-VV
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 15:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHkGJ-0068F0-33
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 15:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHkGJ-006xo4-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 15:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5PUANP+fT0Dnm3ysiemhnpoIEW9ovIoH5NzG1l2Afpw=; b=Y1T/THXpN0L2cIYWGkHaOYYsMT
	jWF8MUkO+jGb778GByuDgreDLtE8MNRp3A8CpYqr9WtCn+mPCd1YwhhVkyKRKj0Gx6/RLEpFJjpe1
	jkldHkwpzJMccQI7MfZlo9/mRFO2ZYzRIcmA8X+LR/nRvkQzmWMh/XFiEtxkfRcXCNZI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHkGJ-006xo4-2u@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 15:22:11 +0000

commit 43e32ae4f92899b6ebd6730d944f51ba55dd88ae
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:42:30 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 15:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 15:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296470.1572885 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHkGV-0004lB-L8; Tue, 28 Apr 2026 15:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296470.1572885; Tue, 28 Apr 2026 15: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 1wHkGV-0004l3-IP; Tue, 28 Apr 2026 15:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1296470;
 Tue, 28 Apr 2026 15:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHkGU-0004kp-2T
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 15:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHkGU-0068FG-07
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 15:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHkGU-006xoQ-02
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 15:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jMmOnbassQeZpyVqX54LUFsr0FZxmxQa/w+hELX97TQ=; b=ZoaGtKuotphylZRuubYlXMG/qE
	M2EO6wJfmRueBie5xMa0wSLHeJP2xG/yASN7U7yyAuTBqCgn7g5LCPJoaDf1xjBClP1K+Cf55Ar1B
	M7GFCW8b/S9ymdjXxDBRAIbk8ZMFrU/BEKU/OrNyK6xCtjBb6QOKLWK9cJ/hmiNB/hLc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] gnttab: split gnttab_map_frame()
Message-Id: <E1wHkGU-006xoQ-02@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 15:22:22 +0000

commit 0d8b25d1fc17fbd1b3b82b318a8e8a8236b151b7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:42:30 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 3b05b46ee0..9281dc8330 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -129,12 +129,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -236,10 +234,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 743eb02e00..484bb83c41 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2004,11 +2004,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2090,19 +2088,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index cf131c43a1..f9e4bffdb1 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4248,7 +4248,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4286,11 +4287,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 297d7669e9..afdba2045c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -60,8 +60,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -100,12 +105,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 16:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 16:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296539.1572925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHlXX-0002WO-Aw; Tue, 28 Apr 2026 16:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296539.1572925; Tue, 28 Apr 2026 16: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 1wHlXX-0002WG-8Q; Tue, 28 Apr 2026 16:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1296539;
 Tue, 28 Apr 2026 16:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHlXV-0002WA-La
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 16:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHlXV-006APD-1p
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 16:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHlXV-0071YD-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 16: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KaKjQwCIxD/CNarKFpYrjkNeg2GnA/jqxX5O3zuy/ic=; b=Kq2rvZ4dwOkkk7UGcr7dyTA/5V
	usymaA52W9V3rqw+ILugcDUf1GF0WqOQmR1Mey6pKckVbyUkuT1K4RmurFkEW2QfACLHtagR/i9/z
	cHOA6/5mDGLHp1fgWfPpxVw2fFQyKozbFzYzu7k0zoggitBfpL6Zk4RkmD2j0EGrYsHw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHlXV-0071YD-1i@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 16:44:01 +0000

commit fcac0584a2273b986280987d943d9e9788ccd870
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:45:52 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 16:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 16:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296540.1572929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHlXh-0002Y8-CR; Tue, 28 Apr 2026 16:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296540.1572929; Tue, 28 Apr 2026 16:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHlXh-0002Y1-9i; Tue, 28 Apr 2026 16:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1296540;
 Tue, 28 Apr 2026 16:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHlXf-0002Xn-Mt
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 16:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHlXf-006APT-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 16:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHlXf-0071Zg-20
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 16: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=do7WrBXEW6RsgwBp29naB8ii/lj8RUnDM2xIWaIUqGM=; b=j5dgM8TfEnn8NmztDm5m5b77yR
	o39kQmPD+Ck7LEb7hRu/W1eruYsLJjXJY7BHwL9MhNkZRuowG/YUWpV4e6PQxdbNZU1IuP7Gmt/Dm
	+SDo1vwRkFaCDuqPjJpcDfGEijmIN6U4u5gvg4rrv9dkbWdKDf+RbCLwpM6nENTHHG/4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHlXf-0071Zg-20@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 16:44:11 +0000

commit 7f9ded38ed3142429396d7c1dba5dcfb308c8e55
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:45:52 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 16:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 16:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296541.1572933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHlXs-0002bA-ES; Tue, 28 Apr 2026 16:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296541.1572933; Tue, 28 Apr 2026 16:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHlXs-0002b2-BQ; Tue, 28 Apr 2026 16:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1296541;
 Tue, 28 Apr 2026 16:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHlXq-0002aT-Jo
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 16:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHlXq-006APZ-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 16:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHlXp-0071as-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 16:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=S6oCZVR4G23KMKAbBUdBRpNFOnUZ6OJqv6EPqVD/nr4=; b=BUY9Zn5nVL274erWniWashgGSB
	HlkR0izPBrym7i+E3XShhXKicLZ8/ow9S6h+Bhkfv8XYuO/q8B3CTViloS4AnwekDVfuRUvFajRNi
	/1OuRNpA71Ti44/g+Mloz+3WEpKjEDh5OGBpV7aGXcWXguLUbMr6nXCb5FcdMBjKKq98=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] gnttab: split gnttab_map_frame()
Message-Id: <E1wHlXp-0071as-2O@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 16:44:21 +0000

commit dd781ac9bbfa0c74aff8ae9fd97d00410bda7d1c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:45:31 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:45:52 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 1ff67ff2b5..f2975d6670 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1372,12 +1372,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -1479,10 +1477,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8197e9ad45..511b251bc3 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2446,11 +2446,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gpfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gpfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2526,19 +2524,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gpfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 934924cbda..1b7ff1d316 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4237,7 +4237,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4275,11 +4276,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 85fe6b7b5e..ff19b3a53c 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -53,8 +53,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -93,12 +98,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 17:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 17:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296634.1572956 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHmeF-00059n-T1; Tue, 28 Apr 2026 17:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296634.1572956; Tue, 28 Apr 2026 17: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 1wHmeF-00059d-Px; Tue, 28 Apr 2026 17:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1296634;
 Tue, 28 Apr 2026 17:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHmeE-00059T-ES
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 17:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHmeE-006Bcw-17
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 17:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHmeE-007Bau-0x
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 17:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JWaKpVfv5xMUz1w9X3/FxcCbJoEMOWbaflwpGsoPRoU=; b=xeJk3oNeuxqsPx+isazmMoVsXN
	ZDx29bPiK4WnjaXqpXA1DhVDF3T4SGLAd1TWFzjJNUUAR+R9H3H67/xoixjD7cFEj5wwpF6JOVU1+
	15QeUxl9K3wjAt9cIRYsJf527LCwli7ASWR0430g939zkl4ZztButGImzeNHk7O2AULU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHmeE-007Bau-0x@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 17:55:02 +0000

commit 54ba668c46b657e2a1fb9f9ab01edce7440c31d8
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:43:55 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 17:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 17:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296635.1572959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHmeP-0005BW-Tw; Tue, 28 Apr 2026 17:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296635.1572959; Tue, 28 Apr 2026 17: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 1wHmeP-0005BO-RJ; Tue, 28 Apr 2026 17:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1296635;
 Tue, 28 Apr 2026 17:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHmeO-0005B8-Fx
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 17:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHmeO-006Bd0-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 17:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHmeO-007BbK-1H
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 17:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i2uGafiEky/Da+KtaJTsSmqrvy96dDtaCIDpc1RfNT8=; b=IdNSMB1SAzh7EZDoL5HKpAGEXn
	NEKrmLY47j5Us7P5nHETrvGUEtWwPnS7XWfrzdhM1gqQTVw9yndn7ngIg1mp8I5K7g1Y4yZhVO3Cw
	uVZBwFNLdC6NNHOCDSJwcFY7XwIXYUqBVgY0YbZ5tsTrs3eGGt8pVxsa01huejf37W+o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHmeO-007BbK-1H@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 17:55:12 +0000

commit cf3a17428abe64e05e332a8165b5af014c5a108d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:43:55 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 17:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 17:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296636.1572963 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHmeZ-0005E1-VO; Tue, 28 Apr 2026 17:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296636.1572963; Tue, 28 Apr 2026 17: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 1wHmeZ-0005Du-Sk; Tue, 28 Apr 2026 17:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1296636;
 Tue, 28 Apr 2026 17:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHmeY-0005Dm-Ip
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 17:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHmeY-006Bep-1n
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 17:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHmeY-007Bcf-1e
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 17:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GUcfsk+SZhxMcxRebHX2/Jb7xv48ao3kKvh+fDXa1bU=; b=MzOL8Y/pFioXI/BbG/xJNoXKCC
	AL8Or8W3JF716VxcErFztQHL8/t1fWboyfwkLAAd4mUiAL+Qy8Q6+zz3PE6dNlyNg35v/IqZtFAPR
	6zKsLIqXZz7xG0wThmPyTlzuIViLz8nl+0IFdvTkxsb0TTQZMt3tGSpUetMQRnGylg5k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] gnttab: split gnttab_map_frame()
Message-Id: <E1wHmeY-007Bcf-1e@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 17:55:22 +0000

commit 51e09058d589914ee46b8e996bd6e5d322c5cf32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:43:55 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index a56e20ba2b..4b391ac612 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -114,12 +114,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -221,10 +219,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index a317f67ec0..29f5c7c279 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1984,11 +1984,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2070,19 +2068,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 6c77867f8c..e0f306f268 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4242,7 +4242,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4280,11 +4281,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 50edfecfb6..a1db21e3fe 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -56,8 +56,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -96,12 +101,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 18:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 18:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296757.1573016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHnF0-00051E-FO; Tue, 28 Apr 2026 18:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296757.1573016; Tue, 28 Apr 2026 18: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 1wHnF0-000516-Cu; Tue, 28 Apr 2026 18:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1296757;
 Tue, 28 Apr 2026 18:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHnEz-000510-Gj
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 18:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHnEz-006COp-1Y
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 18:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHnEz-007D2M-1Q
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 18: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Bv9BXmjdiaWZaRV63wozAmkiISepyeoAFPyeYiUJrWc=; b=iPelVvwpWgJfRv7sL6YQZ3/HWc
	bE4HSBdLlQS9kDnxLbPYIBpbg1mpO0heJY/V//8Pi8FmxtvinvWTveY8eBYpDSx0eW0GXDY7RpahN
	Hw4fM9flkmZ/4JNtfycK8lmlH0Fi10BbtSaAquakQ96RHiMze8y4BsHpJJL0osHaV4Iw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] tools/oxenstored: Reset quota when resetting permissions
Message-Id: <E1wHnEz-007D2M-1Q@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 18:33:01 +0000

commit 7497e64a3c7f9737e85d1b4fe8277d7ce0391068
Author:     Andrii Sultanov <andriy.sultanov@vates.tech>
AuthorDate: Tue Apr 28 13:41:16 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:44:26 2026 +0100

    tools/oxenstored: Reset quota when resetting permissions
    
    The quota object contains both limits and the current node usage counts.
    
    When a domain is torn down, the node data itself is cleaned up but the node
    usage counts are not.  A later domain reusing the same domid can create fewer
    nodes before being deemed to be over quota.
    
    Reset the count when the node permissions are cleaned up.
    
    This is XSA-483 / CVE-2026-23556.
    
    Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit af9e77f5ff774a252a89039c281744de64db44bc)
---
 tools/ocaml/xenstored/store.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml
index 9b8dd2812d..aa9204ead3 100644
--- a/tools/ocaml/xenstored/store.ml
+++ b/tools/ocaml/xenstored/store.ml
@@ -465,7 +465,8 @@ let reset_permissions store domid =
         if perms <> node.perms then
           Logging.debug "store|node" "Changed permissions for node %s" (Node.get_name node);
         Some { node with Node.perms }
-    ) store.root
+    ) store.root;
+  store.quota <- Quota.del store.quota domid
 
 type ops = {
   store: t;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 18:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 18:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296758.1573021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHnFA-00052v-HA; Tue, 28 Apr 2026 18:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296758.1573021; Tue, 28 Apr 2026 18: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 1wHnFA-00052l-EJ; Tue, 28 Apr 2026 18:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1296758;
 Tue, 28 Apr 2026 18:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHnF9-00052d-Jn
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 18:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHnF9-006COt-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 18:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHnF9-007D2o-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 18: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O3jYw9j0dE3NUI5A+83YbFviifNMwSuM1myQzBovG9g=; b=fiWu17Ydv8hMEO0wc3Q5QYthq+
	6n81+zLW9gfpFPwtNuv52O6RWb1jOVl1esekSiCaRXo8KP0E1WZBkq2um5lpmLPnXIb9QCxgZxgUo
	rFI3y18esg9pdYydJ4QX1UsjLjjr2peXHGYplgFOt3FoxAr9sQvyTnEtxN8iE2K4JtNA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] tools/xenstored: make conn_delete_all_transactions() idempotent
Message-Id: <E1wHnF9-007D2o-1j@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 18:33:11 +0000

commit 308be67d74bbcd08e36492ea9709f3b8ddb923a0
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Mar 16 15:06:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:44:26 2026 +0100

    tools/xenstored: make conn_delete_all_transactions() idempotent
    
    conn_delete_all_transactions() should be callable in any context,
    resetting ALL transaction related data.
    
    This includes number of active transactions and the transaction
    pointer in struct connection.
    
    So reset conn->trans to NULL in conn_delete_all_transactions() and
    do the cleanup for each transaction in destroy_transaction().
    
    This avoids triggering the assert() in conn_delete_all_transactions()
    in case e.g. ignore_connection() was called while an operation inside
    a transaction was performed, or XS_RESET_WATCHES was called in a
    transaction.
    
    This is XSA-484 / CVE-2026-23557.
    
    Reported-by: Andrii Sultanov <andriy.sultanov@vates.tech>
    Fixes: 1f9d04fb021c ("xenstored: allow guest to shutdown all its watches/transactions")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    (cherry picked from commit e88031d1fe5f5bbacc31b838c2a544de58c9bf45)
---
 tools/xenstored/transaction.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/xenstored/transaction.c b/tools/xenstored/transaction.c
index 167cd597fd..0825c48859 100644
--- a/tools/xenstored/transaction.c
+++ b/tools/xenstored/transaction.c
@@ -432,17 +432,23 @@ static int finalize_transaction(struct connection *conn,
 static int destroy_transaction(void *_transaction)
 {
 	struct transaction *trans = _transaction;
+	struct connection *conn = trans->conn;
 	struct accessed_node *i;
 
 	wrl_ntransactions--;
 	trace_destroy(trans, "transaction");
 	while ((i = list_top(&trans->accessed, struct accessed_node, list))) {
 		if (i->ta_node)
-			db_delete(trans->conn, i->trans_name, NULL);
+			db_delete(conn, i->trans_name, NULL);
 		list_del(&i->list);
 		talloc_free(i);
 	}
 
+	list_del(&trans->list);
+	domain_transaction_dec(conn);
+	if (list_empty(&conn->transaction_list))
+		conn->ta_start_time = 0;
+
 	return 0;
 }
 
@@ -523,10 +529,6 @@ int do_transaction_end(const void *ctx, struct connection *conn,
 		return ENOENT;
 
 	conn->transaction = NULL;
-	list_del(&trans->list);
-	domain_transaction_dec(conn);
-	if (list_empty(&conn->transaction_list))
-		conn->ta_start_time = 0;
 
 	chk_quota = trans->node_created && domain_is_unprivileged(conn);
 
@@ -572,14 +574,10 @@ void conn_delete_all_transactions(struct connection *conn)
 	struct transaction *trans;
 
 	while ((trans = list_top(&conn->transaction_list,
-				 struct transaction, list))) {
-		list_del(&trans->list);
+				 struct transaction, list)))
 		talloc_free(trans);
-	}
-
-	assert(conn->transaction == NULL);
 
-	conn->ta_start_time = 0;
+	conn->transaction = NULL;
 }
 
 int check_transactions(struct hashtable *hash)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Apr 28 18:33:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Apr 2026 18:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1296759.1573024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHnFK-00056b-II; Tue, 28 Apr 2026 18:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1296759.1573024; Tue, 28 Apr 2026 18:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHnFK-00056T-Fh; Tue, 28 Apr 2026 18:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1296759;
 Tue, 28 Apr 2026 18:33:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHnFJ-00056I-NM
 for xen-changelog@lists.xenproject.org; Tue, 28 Apr 2026 18:33:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHnFJ-006CP0-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 18:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHnFJ-007D3A-24
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Apr 2026 18: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M2jmSKMKDy14o2sTikwMxdjefPShRzmGYBqdaksaZ/o=; b=MjYoNrRAigo754665E/SgsJfRS
	wG/uXy6nfC83MlkVSC39hZdrOKL61rluQjYMa+w7CO+X9wDIOiFOxDL2VMhoyd65mXxPlVP3ac2h9
	qSaQXo5xcbKlWdIBrsMaBCYeQOskEWWbIgcFeUtit5a/IeXMJ3e3cXRA1PBsrR8QrCwU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] gnttab: split gnttab_map_frame()
Message-Id: <E1wHnFJ-007D3A-24@xenbits.xenproject.org>
Date: Tue, 28 Apr 2026 18:33:21 +0000

commit 7bcc106db0121aaa91ac3d40157db9d287ecf89f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 28 13:41:28 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Apr 28 13:44:26 2026 +0100

    gnttab: split gnttab_map_frame()
    
    If a domain tries to map status frames in parallel to switching grant
    table version from 2 to 1, the mapping operation may put in place P2M
    entries referencing MFNs which gnttab_unpopulate_status_frames() is in the
    process of freeing.
    
    Ideally we would refcount pages when entered into P2M tables, but that's a
    significant change. Extend the grant-table-locked region instead in
    xenmem_add_to_physmap_one() (being the sole caller of gnttab_map_frame()),
    such that a race with gnttab_unpopulate_status_frames() is no longer
    possible.
    
    This is XSA-486 / CVE-2026-23558.
    
    Fixes: 5ce8fafa947c ("Dynamic grant-table sizing")
    Fixes: a98dc13703e0 ("Introduce a grant_entry_v2 structure")
    Reported-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 02708d3b51b04aeeaa4b127637d7fec8d8c5b1d8)
---
 xen/arch/arm/mm.c             | 19 +++++++++++++++----
 xen/arch/x86/mm/p2m.c         | 25 ++++++++++++++++---------
 xen/common/grant_table.c      | 13 +++++++++++--
 xen/include/xen/grant_table.h | 15 +++++++++++----
 4 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index def939172c..580b7a0327 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -154,12 +154,10 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
 
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         t = p2m_ram_rw;
 
         break;
@@ -261,10 +259,23 @@ int xenmem_add_to_physmap_one(
      * to drop the reference we took earlier. In all other cases we need to
      * drop any reference we took earlier (perhaps indirectly).
      */
-    if ( space == XENMAPSPACE_gmfn_foreign ? rc : page != NULL )
+    switch ( space )
     {
+    default:
+        if ( page )
+            put_page(page);
+        break;
+
+    case XENMAPSPACE_grant_table:
+        gnttab_map_frame_end(d, mfn);
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        if ( !rc )
+            break;
         ASSERT(page != NULL);
         put_page(page);
+        break;
     }
 
     return rc;
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index a317f67ec0..29f5c7c279 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1984,11 +1984,9 @@ int xenmem_add_to_physmap_one(
         break;
 
     case XENMAPSPACE_grant_table:
-        rc = gnttab_map_frame(d, idx, gfn, &mfn);
+        rc = gnttab_map_frame_begin(d, idx, gfn, &mfn);
         if ( rc )
             return rc;
-        /* Need to take care of the reference obtained in gnttab_map_frame(). */
-        page = mfn_to_page(mfn);
         break;
 
     case XENMAPSPACE_gmfn:
@@ -2070,19 +2068,28 @@ int xenmem_add_to_physmap_one(
     put_gfn(d, gfn_x(gfn));
 
  put_both:
-    /*
-     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
-     * We also may need to transfer ownership of the page reference to our
-     * caller.
-     */
-    if ( space == XENMAPSPACE_gmfn )
+    switch ( space )
     {
+    case XENMAPSPACE_gmfn:
+        /*
+         * We took a ref of the gfn at the top.  We also may need to transfer
+         * ownership of the page reference to our caller.
+         */
         put_gfn(d, gmfn);
         if ( !rc && extra.ppage )
         {
             *extra.ppage = page;
             page = NULL;
         }
+        break;
+
+    case XENMAPSPACE_grant_table:
+        /*
+         * We (gnttab_map_frame_begin()) acquired a lock and took a ref of the
+         * page underlying the MFN at the top.
+         */
+        gnttab_map_frame_end(d, mfn);
+        break;
     }
 
     if ( page )
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index ebe2d2a3ce..751b05efb6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -4240,7 +4240,8 @@ int gnttab_acquire_resource(
     return rc;
 }
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
+int gnttab_map_frame_begin(
+    struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
 {
     int rc = 0;
     struct grant_table *gt = d->grant_table;
@@ -4278,11 +4279,19 @@ int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn, mfn_t *mfn)
             put_page(pg);
     }
 
-    grant_write_unlock(gt);
+    if ( rc )
+        grant_write_unlock(d->grant_table);
 
     return rc;
 }
 
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn)
+{
+    put_page(mfn_to_page(mfn));
+
+    grant_write_unlock(d->grant_table);
+}
+
 static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 50edfecfb6..a1db21e3fe 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -56,8 +56,13 @@ int gnttab_release_mappings(struct domain *d);
 int mem_sharing_gref_to_gfn(struct grant_table *gt, grant_ref_t ref,
                             gfn_t *gfn, uint16_t *status);
 
-int gnttab_map_frame(struct domain *d, unsigned long idx, gfn_t gfn,
-                     mfn_t *mfn);
+/*
+ * These need to be used as a pair, as the first (in the success case) returns
+ * with a lock and page reference held which the second needs to drop.
+ */
+int gnttab_map_frame_begin(struct domain *d, unsigned long idx, gfn_t gfn,
+                           mfn_t *mfn);
+void gnttab_map_frame_end(struct domain *d, mfn_t mfn);
 
 unsigned int gnttab_resource_max_frames(const struct domain *d, unsigned int id);
 
@@ -96,12 +101,14 @@ static inline int mem_sharing_gref_to_gfn(struct grant_table *gt,
     return -EINVAL;
 }
 
-static inline int gnttab_map_frame(struct domain *d, unsigned long idx,
-                                   gfn_t gfn, mfn_t *mfn)
+static inline int gnttab_map_frame_begin(struct domain *d, unsigned long idx,
+                                         gfn_t gfn, mfn_t *mfn)
 {
     return -EINVAL;
 }
 
+static inline void gnttab_map_frame_end(struct domain *d, mfn_t mfn) {}
+
 static inline unsigned int gnttab_resource_max_frames(
     const struct domain *d, unsigned int id)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:44:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297011.1573136 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyeQ-0003o0-Qq; Wed, 29 Apr 2026 06:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297011.1573136; Wed, 29 Apr 2026 06:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyeQ-0003ns-OF; Wed, 29 Apr 2026 06:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1297011;
 Wed, 29 Apr 2026 06:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyeQ-0003nm-6q
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyeQ-007XlO-0V
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyeQ-007hjo-0O
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sUanrm/fv88YwoWCF9SyNvv/do6yfOHRQcO4h5FlFLo=; b=oUqZwLhCZMq7jDqcH0XHVvULxV
	kWxKz/mOwKJozZ3l2mfBtjmiTpnaRlwP94HmubCmPaLI/NE/fYevbB07w36U1Pthi3FRxHZV+i0e0
	FqwzH1EBWD8DN87O8oSTK1U4tI7e+Q5usb57tTKFB8XgIPBatM3FrGmaoVUwoip1uYTc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dt-overlay: fix double-free of rangesets on attach failure
Message-Id: <E1wHyeQ-007hjo-0O@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:44:02 +0000

commit 8783601593fb4a9b7fb0c84c73da26087be48902
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: fix double-free of rangesets on attach failure
    
    handle_attach_overlay_nodes() destroys the IRQ and IOMEM rangesets on
    failure but leaves the pointers dangling in the tracker entry. A
    subsequent handle_remove_overlay_nodes() for the same overlay will call
    rangeset_consume_ranges() on freed memory followed by a second
    rangeset_destroy(), resulting in use-after-free and double-free.
    
    NULL the pointers after rangeset_destroy() so that remove_nodes() and
    handle_remove_overlay_nodes() skip the stale entries.
    
    Fixes: 4c733873b5c2 ("xen/arm: Add XEN_DOMCTL_dt_overlay and device attachment to domains")
    Reported-by: Gyujeong Jin <wlsrbwjd7232@gmail.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index d184186c01..6fa07dbf42 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -910,7 +910,9 @@ static long handle_attach_overlay_nodes(struct domain *d,
     if ( entry )
     {
         rangeset_destroy(entry->irq_ranges);
+        entry->irq_ranges = NULL;
         rangeset_destroy(entry->iomem_ranges);
+        entry->iomem_ranges = NULL;
     }
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297012.1573140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyea-0003pq-SA; Wed, 29 Apr 2026 06:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297012.1573140; Wed, 29 Apr 2026 06:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyea-0003pi-PY; Wed, 29 Apr 2026 06:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1297012;
 Wed, 29 Apr 2026 06:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyea-0003pc-94
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyea-007Xlj-0n
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyea-007hkx-0g
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3ds6MbPg5rJypLSpUe3mqYDHVdVepshmf7eNA0ApvLc=; b=LJbvV+r/hLik0mMwHpi/sjUXJl
	JxOiUdHgYWcclFhskKU2+dbr1XqjZsruCrabob9xS9jph+5xa88lIHrnd7gWHGQqftEPdNjMDB8I9
	Y909YZoI3uCUTTTeoNHxAblYH5mxffuZ+VjT+4De0kJsvNcD4U99i2ykIt0c1qx2OzPA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dt-overlay: fix rangeset leak and dead code in domctl path
Message-Id: <E1wHyea-007hkx-0g@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:44:12 +0000

commit ca3f5e85aa4ed8273537b31820e97b94efd667ef
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:56 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: fix rangeset leak and dead code in domctl path
    
    handle_attach_overlay_nodes() unconditionally creates new rangesets
    without checking whether they already exist from a prior attach. A
    repeated attach for the same overlay leaks the original pair. Reject the
    operation with -EEXIST if rangesets are already present.
    
    Also, dt_overlay_domctl() early-returns -EOPNOTSUPP for any operation
    other than ATTACH, making the if/else at the bottom unreachable. Remove
    the dead branch.
    
    Fixes: 4c733873b5c2 ("xen/arm: Add XEN_DOMCTL_dt_overlay and device attachment to domains")
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index 6fa07dbf42..3853e6e347 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -861,6 +861,13 @@ static long handle_attach_overlay_nodes(struct domain *d,
         goto out;
     }
 
+    if ( entry->irq_ranges || entry->iomem_ranges )
+    {
+        printk(XENLOG_ERR "Overlay is already attached\n");
+        spin_unlock(&overlay_lock);
+        return -EEXIST;
+    }
+
     entry->irq_ranges = rangeset_new(d, "Overlays: Interrupts", 0);
     if (entry->irq_ranges == NULL)
     {
@@ -991,10 +998,7 @@ long dt_overlay_domctl(struct domain *d, struct xen_domctl_dt_overlay *op)
         return -EFAULT;
     }
 
-    if ( op->overlay_op == XEN_DOMCTL_DT_OVERLAY_ATTACH )
-        ret = handle_attach_overlay_nodes(d, overlay_fdt, op->overlay_fdt_size);
-    else
-        ret = -EOPNOTSUPP;
+    ret = handle_attach_overlay_nodes(d, overlay_fdt, op->overlay_fdt_size);
 
     xfree(overlay_fdt);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:44:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:44:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297013.1573144 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyek-0003s7-TQ; Wed, 29 Apr 2026 06:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297013.1573144; Wed, 29 Apr 2026 06:44: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 1wHyek-0003rz-Qt; Wed, 29 Apr 2026 06:44:22 +0000
Received: by outflank-mailman (input) for mailman id 1297013;
 Wed, 29 Apr 2026 06:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyek-0003rt-Bl
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyek-007Xlp-15
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyek-007hm1-0y
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2vksmQFrofAB5r/KsjIK1q8zT8qGsbExdKLcPMmSTok=; b=iDFuD1YeDxhVBhcRMDaIcXaiTu
	q85vdbEmVVmaPYjH8KBWNHlhRr4NFGdyntJyJIu0mBxCLInhvIocLM9LK5dUppMUGAcDC9ONLON/9
	INVqV9F/HeRx6uSstf2Nu89qXfFlcminEzKTmsHUqdy+yWhatF40IyrZk5fF3pSqbtio=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dt-overlay: check overlay size before memcmp in tracker lookup
Message-Id: <E1wHyek-007hm1-0y@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:44:22 +0000

commit a7b7a50b33da3e38a2bea6120fcbf119945751b8
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:57 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: check overlay size before memcmp in tracker lookup
    
    find_track_entry_from_tracker() compares overlay_fdt_size bytes of the
    stored overlay against the input without verifying that the stored
    overlay is at least that large. If the input is larger, memcmp reads
    past the stored allocation. If smaller, a prefix match could falsely
    succeed.
    
    Compare fdt_totalsize() of the stored overlay against overlay_fdt_size
    first. Both values are validated by check_overlay_fdt() at their
    respective entry points, so no additional field in overlay_track is
    needed.
    
    Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index 3853e6e347..0eed1532a1 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -379,7 +379,8 @@ find_track_entry_from_tracker(const void *overlay_fdt,
      */
     list_for_each_entry_safe( entry, temp, &overlay_tracker, entry )
     {
-        if ( memcmp(entry->overlay_fdt, overlay_fdt, overlay_fdt_size) == 0 )
+        if ( (fdt_totalsize(entry->overlay_fdt) == overlay_fdt_size) &&
+             !memcmp(entry->overlay_fdt, overlay_fdt, overlay_fdt_size) )
         {
             found_entry = true;
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297014.1573149 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyev-0003uQ-V7; Wed, 29 Apr 2026 06:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297014.1573149; Wed, 29 Apr 2026 06: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 1wHyev-0003uI-SJ; Wed, 29 Apr 2026 06:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1297014;
 Wed, 29 Apr 2026 06:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyeu-0003uB-Ea
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyeu-007Xlt-1L
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyeu-007hn5-1F
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=73yu0Bjfp/qTmg4LMYT8oNnIhy+8TdI/fZhDBMzBoVA=; b=paUOdNJYheZzCqHl0HajEJPe9m
	MZKQYvax94wjGybOv6eje1mQcurOcjD0lh1Z7LPsasFG2QkpLKayspYkvApeIXKG+8Tl5pZIX7S/A
	9MhYaylmspAMFjaMDFEx54KLJdZx9+jKifs9SbTQP2a3/SD/rZCp35KFbudJ69AZQRT4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dt-overlay: fix silent success in dt_overlay_remove_node
Message-Id: <E1wHyeu-007hn5-1F@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:44:32 +0000

commit 62f3b2a86710279146724cb1bdab5e50bcc5b304
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:58 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: fix silent success in dt_overlay_remove_node
    
    dt_overlay_remove_node() silently returns 0 when the target node is not
    found in the parent's sibling list.  The loop simply exits without
    matching and falls through to "return 0", making the caller believe the
    node was successfully removed.
    
    Return -ENODEV after the loop when no match is found, and change the
    found-path from break to an explicit return 0 so the two outcomes are
    distinct.
    
    Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index 0eed1532a1..d3d4669718 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -125,11 +125,11 @@ static int dt_overlay_remove_node(struct dt_device_node *device_node)
             else
                 np->allnext = np->allnext->allnext;
 
-            break;
+            return 0;
         }
     }
 
-    return 0;
+    return -ENODEV;
 }
 
 static int dt_overlay_add_node(struct dt_device_node *device_node,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297015.1573152 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyf6-0003wN-0i; Wed, 29 Apr 2026 06:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297015.1573152; Wed, 29 Apr 2026 06:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyf5-0003wH-Tg; Wed, 29 Apr 2026 06:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1297015;
 Wed, 29 Apr 2026 06:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyf4-0003wA-Hq
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyf4-007Xm1-1e
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyf4-007hoa-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WynZms3AetN7XOnQlBLd26Sleh2vGZwL6pzjZ+10sHI=; b=PYZoLTZwJVeA72r8dRrBBE43eR
	obuTDmtsF9AY5JmQvLoBQKy3g4XLn0nM9sH1+p7AeVuruBAx/gipZi4g2DqLs3KOgIRI7VopNs5I2
	Xn0E1iTr+KlQW6HhU0SB3o3cNePGE4/PBM49t+y+bcxllawW9BNZ4TFvd0jXigYMgOkg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dt-overlay: attach resources for child nodes in overlay
Message-Id: <E1wHyf4-007hoa-1V@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:44:42 +0000

commit 9b1acd812487c3a5e34c5c82e124ca4b0aa60b7a
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:37:00 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: attach resources for child nodes in overlay
    
    handle_attach_overlay_nodes() only calls handle_device() on the
    top-level overlay nodes tracked in entry->nodes_address[].  Child nodes
    that have their own reg, interrupts, or iommus properties are never
    processed, so their IRQs are not routed, MMIO regions are not mapped,
    and IOMMU setup is skipped.
    
    Introduce handle_device_and_children() which recursively walks the
    subtree rooted at each overlay node and calls handle_device() on every
    descendant, ensuring all resources in the overlay are properly attached.
    
    Note that the attach error path has a pre-existing bug: on partial
    failure, the tracking rangesets are destroyed without first revoking the
    IRQ/MMIO permissions and IOMMU assignments that were already granted by
    the successful handle_device() calls.  Add a TODO comment to flag this.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index d3d4669718..f203e189f5 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -841,6 +841,30 @@ static long handle_add_overlay_nodes(void *overlay_fdt,
     return rc;
 }
 
+static int handle_device_and_children(struct domain *d,
+                                      struct dt_device_node *dev,
+                                      p2m_type_t p2mt,
+                                      struct rangeset *iomem_ranges,
+                                      struct rangeset *irq_ranges)
+{
+    int rc;
+    struct dt_device_node *child;
+
+    rc = handle_device(d, dev, p2mt, iomem_ranges, irq_ranges);
+    if ( rc )
+        return rc;
+
+    dt_for_each_child_node(dev, child)
+    {
+        rc = handle_device_and_children(d, child, p2mt,
+                                        iomem_ranges, irq_ranges);
+        if ( rc )
+            return rc;
+    }
+
+    return 0;
+}
+
 static long handle_attach_overlay_nodes(struct domain *d,
                                         const void *overlay_fdt,
                                         uint32_t overlay_fdt_size)
@@ -898,8 +922,9 @@ static long handle_attach_overlay_nodes(struct domain *d,
         }
 
         write_lock(&dt_host_lock);
-        rc = handle_device(d, overlay_node, p2m_mmio_direct_c,
-                           entry->iomem_ranges, entry->irq_ranges);
+        rc = handle_device_and_children(d, overlay_node, p2m_mmio_direct_c,
+                                        entry->iomem_ranges,
+                                        entry->irq_ranges);
         write_unlock(&dt_host_lock);
         if ( rc )
         {
@@ -915,6 +940,11 @@ static long handle_attach_overlay_nodes(struct domain *d,
  out:
     spin_unlock(&overlay_lock);
 
+    /*
+     * TODO: IRQ/MMIO permissions and IOMMU assignments granted by
+     * handle_device() before the failure are not revoked here.  We only
+     * destroy the tracking rangesets, leaking the actual grants.
+     */
     if ( entry )
     {
         rangeset_destroy(entry->irq_ranges);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297016.1573156 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyfG-0003yS-1Q; Wed, 29 Apr 2026 06:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297016.1573156; Wed, 29 Apr 2026 06:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyfF-0003yK-V1; Wed, 29 Apr 2026 06:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1297016;
 Wed, 29 Apr 2026 06:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyfE-0003yD-L1
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyfE-007Xm7-20
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyfE-007hq2-1q
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vz7rgjena0KjGO6fZ7vxHp8pNNSCaj14jpfZl1BUkW4=; b=E9BrgNDpLU1YRPcBbBMOj4Abq/
	2kZVlHw5b7WMKKIUqsNn0wC0VOxhRCLgNXRp90p8QG/TZdnPzontlJDTCxXUGlE5lIHxdU4IrGj0y
	7YRPURkhnsC4XNts6JGEB0uCc/2MS209q3FKAcmYE30hzXgSCrXX1VnH+5HBXsgvr144=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dt-overlay: support phandle-based targeting in overlay_get_nodes_info
Message-Id: <E1wHyfE-007hq2-1q@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:44:52 +0000

commit 16579c5503f91699f686307423ecf65ac628278b
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:59 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: support phandle-based targeting in overlay_get_nodes_info
    
    overlay_get_nodes_info() is called before fdt_overlay_apply() to extract
    target paths from the overlay. This fails for overlays using phandle-based
    targeting (target = <&label>) because DTC compiles these as unresolved
    fixups (target = <0xffffffff>), causing fdt_overlay_target_offset() to
    return -FDT_ERR_BADPHANDLE. Prior to this change users were forced to
    manually modify the dtbo (even for hwdom) to switch from target to
    target-phandle by manually inspecting also the host DTB.
    
    Introduce overlay_get_target_path() which directly handles the two
    targeting cases that occur before fixup resolution:
     - target-path: the string property is returned directly.
     - target = <&label>: the label is found in the overlay's __fixups__
       node, then resolved to a path via the base DTB's __symbols__ node.
    
    Libfdt fdt_for_each_property_offset() violates MISRA R20.7. Despite
    libfdt being excluded from the analysis, this causes ECLAIR scan to
    report a regression because the violation introduced by a macro is
    reported at the call site. Deviate R20.7 for libfdt.h.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |  2 +
 xen/common/device-tree/dt-overlay.c              | 65 +++++++++++++++++++++---
 2 files changed, 61 insertions(+), 6 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 30c3239069..1ceb65819e 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -629,8 +629,10 @@ of the IS_ENABLED or STATIC_IF/STATIC_IF_NOT macros, so it always receives a lit
 not in scope for compliance are allowed, as that is imported code."
 -file_tag+={gnu_efi_include, "^xen/include/efi/.*$"}
 -file_tag+={acpi_cpu_idle, "^xen/arch/x86/acpi/cpu_idle\\.c$"}
+-file_tag+={libfdt, "^xen/include/xen/libfdt/libfdt\\.h$"}
 -config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(file(gnu_efi_include)||any_exp(macro(^NextMemoryDescriptor$))))"}
 -config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(file(acpi_cpu_idle)))"}
+-config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(any_exp(file(libfdt))))"}
 -doc_end
 
 -doc_begin="To avoid compromising readability, the macros alternative_(v)?call[0-9] are allowed
diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index f203e189f5..fd171333c6 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -286,6 +286,63 @@ static unsigned int overlay_node_count(const void *overlay_fdt)
     return num_overlay_nodes;
 }
 
+/*
+ * Resolve the target path for an overlay fragment.
+ *
+ * This is called before fdt_overlay_apply(), so phandle-based targets
+ * (target = <&label>) are still unresolved (compiled as 0xffffffff by DTC).
+ * Handle the two cases that actually occur:
+ *  - target-path property: the path string is used directly,
+ *  - target = <&label>: the label is looked up in the overlay's __fixups__
+ *    node, then resolved to a path via the base DTB's __symbols__ node.
+ *
+ * Returns a pointer into the FDT on success, NULL on failure.
+ */
+static const char *overlay_get_target_path(const void *fdt, const void *fdto,
+                                           int fragment)
+{
+    const char *path, *fragment_name;
+    int fixups_off, symbols_off, property;
+    int fragment_name_len;
+
+    /* Try target-path first (string-based targeting) */
+    path = fdt_getprop(fdto, fragment, "target-path", NULL);
+    if ( path )
+        return path;
+
+    /* Phandle-based target: resolve via __fixups__ and __symbols__ */
+    fixups_off = fdt_path_offset(fdto, "/__fixups__");
+    if ( fixups_off < 0 )
+        return NULL;
+
+    symbols_off = fdt_path_offset(fdt, "/__symbols__");
+    if ( symbols_off < 0 )
+        return NULL;
+
+    fragment_name = fdt_get_name(fdto, fragment, &fragment_name_len);
+    if ( !fragment_name )
+        return NULL;
+
+    fdt_for_each_property_offset(property, fdto, fixups_off)
+    {
+        const char *val, *label, *p;
+        int val_len;
+
+        val = fdt_getprop_by_offset(fdto, property, &label, &val_len);
+        if ( !val || !val_len || (val[val_len - 1] != '\0') )
+            continue;
+
+        /* Match entries of the form "/<fragment_name>:target:0" */
+        for ( p = val; p < (val + val_len); p += (strlen(p) + 1) )
+            if ( p[0] == '/' &&
+                 !strncmp(p + 1, fragment_name, fragment_name_len) &&
+                 !strcmp(p + 1 + fragment_name_len, ":target:0") )
+                return fdt_getprop(fdt, symbols_off, label, NULL);
+    }
+
+    return NULL;
+}
+
 /*
  * overlay_get_nodes_info gets full name with path for all the nodes which
  * are in one level of __overlay__ tag. This is useful when checking node for
@@ -298,7 +355,6 @@ static int overlay_get_nodes_info(const void *fdto, char **nodes_full_path)
 
     fdt_for_each_subnode(fragment, fdto, 0)
     {
-        int target;
         int overlay;
         int subnode;
         const char *target_path;
@@ -307,11 +363,8 @@ static int overlay_get_nodes_info(const void *fdto, char **nodes_full_path)
         if ( overlay < 0 )
             continue;
 
-        target = fdt_overlay_target_offset(device_tree_flattened, fdto,
-                                           fragment, &target_path);
-        if ( target < 0 )
-            return target;
-
+        target_path = overlay_get_target_path(device_tree_flattened, fdto,
+                                              fragment);
         if ( target_path == NULL )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297017.1573159 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyfQ-00040V-2r; Wed, 29 Apr 2026 06:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297017.1573159; Wed, 29 Apr 2026 06:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyfQ-00040N-06; Wed, 29 Apr 2026 06:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1297017;
 Wed, 29 Apr 2026 06:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyfO-00040D-Nd
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyfO-007XmZ-2G
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyfO-007hr9-2B
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QNAxfBuYxblLnLr5sJ0sUCFDqJgYIaGysjUefQlZvSY=; b=ZrmUnX4oJgOTiAvQJOyaPZH7Ys
	7OOP3vjS6Nxst4wM6OmUWUmPDIzkv1sBFbV+9XrOA3Q8QhPQvIFEpyLTMVTp103XZR7yYXqql2Zx+
	m2k8wgUk+kGt4I5bqTlLJXrmiE9blSMN680QCZIwW4g16mkPJHBDnn3pCv2mCTMMMx84=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dom0less: introduce next_phandle in struct kernel_info
Message-Id: <E1wHyfO-007hr9-2B@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:45:02 +0000

commit a010efd323d252c13c814c528b2421c04626d6a2
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Apr 27 17:34:23 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:39:07 2026 +0200

    xen/dom0less: introduce next_phandle in struct kernel_info
    
    There are cases where it is necessary to know the next available phandle
    number in order to generate phandles for guest device nodes.
    
    When a partial FDT (pfdt) is provided, special care is needed during
    initialization of next_phandle, as the pfdt may already contain a dummy
    interrupt controller node with a phandle assigned to it. next_phandle
    must therefore be initialized to one past the highest phandle already
    present in the pfdt, to avoid collisions.
    
    Since next_phandle may be needed for the very first guest node generated,
    domain_handle_dtb_boot_module() is moved earlier in prepare_dtb_domU().
    The new call site also aligns better with the existing comment stating
    that domain_handle_dtb_boot_module() must be called before the rest of
    the device tree is generated.
    
    Introduce alloc_phandle() to ensure that phandles allocated for guest
    nodes do not overlap the Xen-reserved phandle range.  This helper will
    be used by subsequent patches (by RISC-V at the moment).
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/device-tree/dom0less-build.c | 43 ++++++++++++++++++++++++---------
 xen/include/xen/fdt-domain-build.h      |  6 +++++
 xen/include/xen/fdt-kernel.h            |  6 +++++
 3 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 840d14419d..9787ee2649 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -389,6 +389,24 @@ static int __init domain_handle_dtb_boot_module(struct domain *d,
     if ( res < 0 )
         goto out;
 
+    /*
+     * Find the highest phandle in the partial FDT so next_phandle starts
+     * above it, avoiding collisions with pfdt's own phandle assignments.
+     */
+    res = fdt_generate_phandle(pfdt, &kinfo->next_phandle);
+    if ( res )
+    {
+        res = (res == -FDT_ERR_NOPHANDLES) ? -EOVERFLOW : -EINVAL;
+        goto out;
+    }
+
+    if ( kinfo->next_phandle >= GUEST_PHANDLE_GIC )
+    {
+        dprintk(XENLOG_ERR, "Phandle allocation overlaps Xen reserved range\n");
+        res = -EOVERFLOW;
+        goto out;
+    }
+
     for ( node_next = fdt_first_subnode(pfdt, 0);
           node_next > 0;
           node_next = fdt_next_subnode(pfdt, node_next) )
@@ -459,6 +477,7 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     BUILD_BUG_ON(DOMU_DTB_SIZE > SZ_2M);
 
     kinfo->phandle_intc = GUEST_PHANDLE_GIC;
+    kinfo->next_phandle = 1;
 
 #ifdef CONFIG_GRANT_TABLE
     kinfo->gnttab_start = GUEST_GNTTAB_BASE;
@@ -499,6 +518,18 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     if ( ret )
         goto err;
 
+    /*
+     * domain_handle_dtb_boot_module() must be called before the rest of the
+     * device tree is generated because it sets phandle_intc and next_phandle,
+     * which subsequent node generation depends on.
+     */
+    if ( kinfo->dtb )
+    {
+        ret = domain_handle_dtb_boot_module(d, kinfo);
+        if ( ret )
+            goto err;
+    }
+
     ret = make_chosen_node(kinfo);
     if ( ret )
         goto err;
@@ -516,18 +547,6 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     if ( ret )
         goto err;
 
-    /*
-     * domain_handle_dtb_boot_module has to be called before the rest of
-     * the device tree is generated because it depends on the value of
-     * the field phandle_intc.
-     */
-    if ( kinfo->dtb )
-    {
-        ret = domain_handle_dtb_boot_module(d, kinfo);
-        if ( ret )
-            goto err;
-    }
-
     ret = make_intc_domU_node(kinfo);
     if ( ret )
         goto err;
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index 886a853816..fd2ba01ff0 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -63,6 +63,12 @@ int find_unallocated_memory(const struct kernel_info *kinfo,
                                       unsigned long e_gfn,
                                       void *data));
 
+/* Return 0 (invalid phandle) if the Xen-reserved range has been reached */
+static inline uint32_t alloc_phandle(struct kernel_info *kinfo)
+{
+    return kinfo->next_phandle >= GUEST_PHANDLE_GIC ? 0 : kinfo->next_phandle++;
+}
+
 #endif /* __XEN_FDT_DOMAIN_BUILD_H__ */
 
 /*
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 33a60597bb..4d0467bb39 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -44,6 +44,12 @@ struct kernel_info {
     /* Interrupt controller phandle */
     uint32_t phandle_intc;
 
+    /*
+     * Next free phandle for guest device nodes; do not access directly, use
+     * alloc_phandle().
+     */
+    uint32_t next_phandle;
+
     /* loader to use for this kernel */
     void (*load)(struct kernel_info *info);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 06:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 06:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297018.1573163 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHyfa-00042r-5F; Wed, 29 Apr 2026 06:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297018.1573163; Wed, 29 Apr 2026 06: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 1wHyfa-00042j-2j; Wed, 29 Apr 2026 06:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1297018;
 Wed, 29 Apr 2026 06:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHyfY-00042d-Qc
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 06:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyfY-007Xmy-2Y
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHyfY-007hrZ-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 06:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EXu18M2dU17KPIuGphzAQ4MUJGKzxOVjuYng529bUPY=; b=Vwah5zjTZEWL7EgXgbejeoV3zO
	6aEDsNvA2SAktzwDtVH6gn4/rHwbr9GU5d+fjNFKSJYvUgV2SqRSMq1hcxC0YtMD1a21BLYzjxH9W
	bznAZ8uxTze/53nb4l5kHn0UP3xkE8Z2/DOw8mfSWVFn7jm64WBJu2F06VGZHdfPhxs4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dom0less: pass kernel_info struct instead of fdt to make_cpus_node()
Message-Id: <E1wHyfY-007hrZ-2S@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 06:45:12 +0000

commit 526cb04bb68ca846485e991b819e456ecc9c62b5
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Apr 27 17:34:24 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:39:14 2026 +0200

    xen/dom0less: pass kernel_info struct instead of fdt to make_cpus_node()
    
    There are two reasons of this change:
    1. Align prototype with what other make_*_node() are passed.
    2. A follow-up RISC-V patch will call get_next_free_phandle() inside
       make_cpus_node(), requiring mutable access to kinfo->free_phandle.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c             | 5 +++--
 xen/common/device-tree/dom0less-build.c | 2 +-
 xen/include/xen/fdt-domain-build.h      | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 6c17a84b26..a3ff701023 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1163,7 +1163,7 @@ int __init make_psci_node(void *fdt)
     return res;
 }
 
-int __init make_cpus_node(const struct domain *d, void *fdt)
+int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
 {
     int res;
     const struct dt_device_node *cpus = dt_find_node_by_path("/cpus");
@@ -1177,6 +1177,7 @@ int __init make_cpus_node(const struct domain *d, void *fdt)
     /* Keep the compiler happy with -Og */
     bool clock_valid = false;
     uint64_t mpidr_aff;
+    void *fdt = kinfo->fdt;
 
     dt_dprintk("Create cpus node\n");
 
@@ -1625,7 +1626,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
         if ( res )
             return res;
 
-        res = make_cpus_node(d, kinfo->fdt);
+        res = make_cpus_node(d, kinfo);
         if ( res )
             return res;
 
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 9787ee2649..6d6882a34b 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -534,7 +534,7 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     if ( ret )
         goto err;
 
-    ret = make_cpus_node(d, kinfo->fdt);
+    ret = make_cpus_node(d, kinfo);
     if ( ret )
         goto err;
 
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index fd2ba01ff0..0d40d8cfa1 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -25,7 +25,7 @@ int construct_domain(struct domain *d, struct kernel_info *kinfo);
 int construct_hwdom(struct kernel_info *kinfo,
                     const struct dt_device_node *node);
 int make_chosen_node(const struct kernel_info *kinfo);
-int make_cpus_node(const struct domain *d, void *fdt);
+int make_cpus_node(const struct domain *d, struct kernel_info *kinfo);
 int make_hypervisor_node(struct domain *d, const struct kernel_info *kinfo,
                          int addrcells, int sizecells);
 int make_memory_node(const struct kernel_info *kinfo, int addrcells,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:55:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297062.1573186 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzl9-00067n-E1; Wed, 29 Apr 2026 07:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297062.1573186; Wed, 29 Apr 2026 07: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 1wHzl9-00067f-Ar; Wed, 29 Apr 2026 07:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1297062;
 Wed, 29 Apr 2026 07:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzl7-00067V-Sd
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzl7-007Yzk-2Y
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzl7-007mQo-2R
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/7pXVCltMEVBCrneboaQ4dAb/gqu7V/ZqzBBKGldTIs=; b=y+5NbSQRI9JRDd0XfTvIL0l2Lf
	oujCkf7c9l0J0uU6ISvdTJRzrJOL0ZPjw82Mfs7GCHFytdZMLYVtoSf2FdjwcdGlQ6SvT0cZpxp4X
	H1mFGKJ6pyXjh0N8sZByZuQ2ctbYpKFVUjqjuJ1TZxxerJeB20CXrU+zzFjxnUydQ+I0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dt-overlay: fix double-free of rangesets on attach failure
Message-Id: <E1wHzl7-007mQo-2R@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:55:01 +0000

commit 8783601593fb4a9b7fb0c84c73da26087be48902
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: fix double-free of rangesets on attach failure
    
    handle_attach_overlay_nodes() destroys the IRQ and IOMEM rangesets on
    failure but leaves the pointers dangling in the tracker entry. A
    subsequent handle_remove_overlay_nodes() for the same overlay will call
    rangeset_consume_ranges() on freed memory followed by a second
    rangeset_destroy(), resulting in use-after-free and double-free.
    
    NULL the pointers after rangeset_destroy() so that remove_nodes() and
    handle_remove_overlay_nodes() skip the stale entries.
    
    Fixes: 4c733873b5c2 ("xen/arm: Add XEN_DOMCTL_dt_overlay and device attachment to domains")
    Reported-by: Gyujeong Jin <wlsrbwjd7232@gmail.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index d184186c01..6fa07dbf42 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -910,7 +910,9 @@ static long handle_attach_overlay_nodes(struct domain *d,
     if ( entry )
     {
         rangeset_destroy(entry->irq_ranges);
+        entry->irq_ranges = NULL;
         rangeset_destroy(entry->iomem_ranges);
+        entry->iomem_ranges = NULL;
     }
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297063.1573190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzlI-00069S-FD; Wed, 29 Apr 2026 07:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297063.1573190; Wed, 29 Apr 2026 07: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 1wHzlI-00069I-CH; Wed, 29 Apr 2026 07:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1297063;
 Wed, 29 Apr 2026 07:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzlH-000698-Ta
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlH-007Z0I-2q
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlH-007mRG-2j
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=K/Eebxe4fhS5hBDHbydiTCJ8YK3F9KBbc0x6jHLDLIs=; b=WrEwQbmKTf4gfFHOp2OdAyN5zy
	JTMne+T9EGpp8LaQGUY1XhNZllggXbJZQ/N/E87ZsB9nhpI7xHRGOkQO/sGBEUb1nQSEpGJXf8ikJ
	/Qz4Osj4MDr0/vzn+sk0TyZUtHfFD8t26e7rYXba2U2sQ/hKUWHd5i9iG4N2R69hxHjc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dt-overlay: fix rangeset leak and dead code in domctl path
Message-Id: <E1wHzlH-007mRG-2j@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:55:11 +0000

commit ca3f5e85aa4ed8273537b31820e97b94efd667ef
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:56 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: fix rangeset leak and dead code in domctl path
    
    handle_attach_overlay_nodes() unconditionally creates new rangesets
    without checking whether they already exist from a prior attach. A
    repeated attach for the same overlay leaks the original pair. Reject the
    operation with -EEXIST if rangesets are already present.
    
    Also, dt_overlay_domctl() early-returns -EOPNOTSUPP for any operation
    other than ATTACH, making the if/else at the bottom unreachable. Remove
    the dead branch.
    
    Fixes: 4c733873b5c2 ("xen/arm: Add XEN_DOMCTL_dt_overlay and device attachment to domains")
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index 6fa07dbf42..3853e6e347 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -861,6 +861,13 @@ static long handle_attach_overlay_nodes(struct domain *d,
         goto out;
     }
 
+    if ( entry->irq_ranges || entry->iomem_ranges )
+    {
+        printk(XENLOG_ERR "Overlay is already attached\n");
+        spin_unlock(&overlay_lock);
+        return -EEXIST;
+    }
+
     entry->irq_ranges = rangeset_new(d, "Overlays: Interrupts", 0);
     if (entry->irq_ranges == NULL)
     {
@@ -991,10 +998,7 @@ long dt_overlay_domctl(struct domain *d, struct xen_domctl_dt_overlay *op)
         return -EFAULT;
     }
 
-    if ( op->overlay_op == XEN_DOMCTL_DT_OVERLAY_ATTACH )
-        ret = handle_attach_overlay_nodes(d, overlay_fdt, op->overlay_fdt_size);
-    else
-        ret = -EOPNOTSUPP;
+    ret = handle_attach_overlay_nodes(d, overlay_fdt, op->overlay_fdt_size);
 
     xfree(overlay_fdt);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:55:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297064.1573193 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzlS-0006CE-G9; Wed, 29 Apr 2026 07:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297064.1573193; Wed, 29 Apr 2026 07: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 1wHzlS-0006C6-De; Wed, 29 Apr 2026 07:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1297064;
 Wed, 29 Apr 2026 07:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzlS-0006C0-05
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlR-007Z16-38
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlR-007mRo-31
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aHxFWTdOwdxB2QClpSb/xBnx42MCVxyAl+81Z2Kgids=; b=ihUeXck/5MsV0ByhEtFEdK/m/J
	hfKWsQkiO4fW4OgvGg/OQ2GFrOqmgLYCCN8DlqThoPOT5QXj5yhNsStm+KGYx3HH/ogHsHkeaUHX1
	p7FxbYG8Z49URv0Hg9WC+t+3lFaKTGCelPHEKCI0N/QL41+mEIuPoQW4KN58sIstPQu4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dt-overlay: check overlay size before memcmp in tracker lookup
Message-Id: <E1wHzlR-007mRo-31@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:55:21 +0000

commit a7b7a50b33da3e38a2bea6120fcbf119945751b8
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:57 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: check overlay size before memcmp in tracker lookup
    
    find_track_entry_from_tracker() compares overlay_fdt_size bytes of the
    stored overlay against the input without verifying that the stored
    overlay is at least that large. If the input is larger, memcmp reads
    past the stored allocation. If smaller, a prefix match could falsely
    succeed.
    
    Compare fdt_totalsize() of the stored overlay against overlay_fdt_size
    first. Both values are validated by check_overlay_fdt() at their
    respective entry points, so no additional field in overlay_track is
    needed.
    
    Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index 3853e6e347..0eed1532a1 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -379,7 +379,8 @@ find_track_entry_from_tracker(const void *overlay_fdt,
      */
     list_for_each_entry_safe( entry, temp, &overlay_tracker, entry )
     {
-        if ( memcmp(entry->overlay_fdt, overlay_fdt, overlay_fdt_size) == 0 )
+        if ( (fdt_totalsize(entry->overlay_fdt) == overlay_fdt_size) &&
+             !memcmp(entry->overlay_fdt, overlay_fdt, overlay_fdt_size) )
         {
             found_entry = true;
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:55:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:55:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297065.1573198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzlc-0006EZ-Hc; Wed, 29 Apr 2026 07:55:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297065.1573198; Wed, 29 Apr 2026 07: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 1wHzlc-0006ER-Ew; Wed, 29 Apr 2026 07:55:32 +0000
Received: by outflank-mailman (input) for mailman id 1297065;
 Wed, 29 Apr 2026 07:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzlc-0006EK-2u
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlc-007Z2P-0C
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlc-007mSA-05
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IUvrP+vBVyWrntNmR0yKR5rQFoYrHjFSYHc9Iu33JUk=; b=Z4KAmLjfNQWcfF9m75xDqk06ol
	uxWzqACJy0O2njwrL6kLmxXquHFcIwJzAheHFTz0jKSKzG8aJtVkPLrCwmPnad49UPNNWoxw6E5zu
	s32OVFEmhi+xFaEgDPsHhnFu6auDu+Jpm34GFAJPiXxeA/Cb5btX40bD6UkFoCQocIa4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dt-overlay: fix silent success in dt_overlay_remove_node
Message-Id: <E1wHzlc-007mSA-05@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:55:32 +0000

commit 62f3b2a86710279146724cb1bdab5e50bcc5b304
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:58 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: fix silent success in dt_overlay_remove_node
    
    dt_overlay_remove_node() silently returns 0 when the target node is not
    found in the parent's sibling list.  The loop simply exits without
    matching and falls through to "return 0", making the caller believe the
    node was successfully removed.
    
    Return -ENODEV after the loop when no match is found, and change the
    found-path from break to an explicit return 0 so the two outcomes are
    distinct.
    
    Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index 0eed1532a1..d3d4669718 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -125,11 +125,11 @@ static int dt_overlay_remove_node(struct dt_device_node *device_node)
             else
                 np->allnext = np->allnext->allnext;
 
-            break;
+            return 0;
         }
     }
 
-    return 0;
+    return -ENODEV;
 }
 
 static int dt_overlay_add_node(struct dt_device_node *device_node,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:55:42 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297066.1573202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzlm-0006Gb-Iv; Wed, 29 Apr 2026 07:55:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297066.1573202; Wed, 29 Apr 2026 07: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 1wHzlm-0006GT-GK; Wed, 29 Apr 2026 07:55:42 +0000
Received: by outflank-mailman (input) for mailman id 1297066;
 Wed, 29 Apr 2026 07:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzlm-0006GN-5j
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlm-007Z2V-0T
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlm-007mSa-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5E/7xDmVQAJcFR/tgD8tOmkpQXckeGGwrgVCXcfcEr4=; b=cCjI3k/joWUs+UF6oAPSjRLKJ4
	AZNDO0/gfhQhV+HUNKBVMBuBr9K38ovfMHsVZ7hiwlWOaPn13hXHYA5p7kPz801EywP6yyZhggRZP
	ifMvWDff7b1YX5K4K5XmYRGYq3sPlYaaJTq9VIN1xf1dX3m1ZClSPVL6pZpxb58kfM7w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dt-overlay: attach resources for child nodes in overlay
Message-Id: <E1wHzlm-007mSa-0M@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:55:42 +0000

commit 9b1acd812487c3a5e34c5c82e124ca4b0aa60b7a
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:37:00 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: attach resources for child nodes in overlay
    
    handle_attach_overlay_nodes() only calls handle_device() on the
    top-level overlay nodes tracked in entry->nodes_address[].  Child nodes
    that have their own reg, interrupts, or iommus properties are never
    processed, so their IRQs are not routed, MMIO regions are not mapped,
    and IOMMU setup is skipped.
    
    Introduce handle_device_and_children() which recursively walks the
    subtree rooted at each overlay node and calls handle_device() on every
    descendant, ensuring all resources in the overlay are properly attached.
    
    Note that the attach error path has a pre-existing bug: on partial
    failure, the tracking rangesets are destroyed without first revoking the
    IRQ/MMIO permissions and IOMMU assignments that were already granted by
    the successful handle_device() calls.  Add a TODO comment to flag this.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dt-overlay.c | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index d3d4669718..f203e189f5 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -841,6 +841,30 @@ static long handle_add_overlay_nodes(void *overlay_fdt,
     return rc;
 }
 
+static int handle_device_and_children(struct domain *d,
+                                      struct dt_device_node *dev,
+                                      p2m_type_t p2mt,
+                                      struct rangeset *iomem_ranges,
+                                      struct rangeset *irq_ranges)
+{
+    int rc;
+    struct dt_device_node *child;
+
+    rc = handle_device(d, dev, p2mt, iomem_ranges, irq_ranges);
+    if ( rc )
+        return rc;
+
+    dt_for_each_child_node(dev, child)
+    {
+        rc = handle_device_and_children(d, child, p2mt,
+                                        iomem_ranges, irq_ranges);
+        if ( rc )
+            return rc;
+    }
+
+    return 0;
+}
+
 static long handle_attach_overlay_nodes(struct domain *d,
                                         const void *overlay_fdt,
                                         uint32_t overlay_fdt_size)
@@ -898,8 +922,9 @@ static long handle_attach_overlay_nodes(struct domain *d,
         }
 
         write_lock(&dt_host_lock);
-        rc = handle_device(d, overlay_node, p2m_mmio_direct_c,
-                           entry->iomem_ranges, entry->irq_ranges);
+        rc = handle_device_and_children(d, overlay_node, p2m_mmio_direct_c,
+                                        entry->iomem_ranges,
+                                        entry->irq_ranges);
         write_unlock(&dt_host_lock);
         if ( rc )
         {
@@ -915,6 +940,11 @@ static long handle_attach_overlay_nodes(struct domain *d,
  out:
     spin_unlock(&overlay_lock);
 
+    /*
+     * TODO: IRQ/MMIO permissions and IOMMU assignments granted by
+     * handle_device() before the failure are not revoked here.  We only
+     * destroy the tracking rangesets, leaking the actual grants.
+     */
     if ( entry )
     {
         rangeset_destroy(entry->irq_ranges);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:55:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297067.1573205 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzlx-0006Ia-KP; Wed, 29 Apr 2026 07:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297067.1573205; Wed, 29 Apr 2026 07: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 1wHzlx-0006IS-Hn; Wed, 29 Apr 2026 07:55:53 +0000
Received: by outflank-mailman (input) for mailman id 1297067;
 Wed, 29 Apr 2026 07:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzlw-0006IM-GS
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlw-007Z2Z-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzlw-007mTJ-0e
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gBsaMExWpwvMbkgM7BE0VskyERnyYq3Cw0EMCBE54F8=; b=gUSHwQfgi8uO4iB60+3dAEanOJ
	OjpJdQrfvzBeIOX0ISl9U1v6n/d7t6AbG+r7FzosWz8sTns2Zjk93m3jX8LD3KMDpNrzFzhurnyqi
	n17IK12VbHA4m4p2reidD4qcJFgqQJ2cchQDBqCtszS63/rDfAgQ4bVG7grCuvcpj650=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dt-overlay: support phandle-based targeting in overlay_get_nodes_info
Message-Id: <E1wHzlw-007mTJ-0e@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:55:52 +0000

commit 16579c5503f91699f686307423ecf65ac628278b
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Apr 15 13:36:59 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:37:58 2026 +0200

    xen/dt-overlay: support phandle-based targeting in overlay_get_nodes_info
    
    overlay_get_nodes_info() is called before fdt_overlay_apply() to extract
    target paths from the overlay. This fails for overlays using phandle-based
    targeting (target = <&label>) because DTC compiles these as unresolved
    fixups (target = <0xffffffff>), causing fdt_overlay_target_offset() to
    return -FDT_ERR_BADPHANDLE. Prior to this change users were forced to
    manually modify the dtbo (even for hwdom) to switch from target to
    target-phandle by manually inspecting also the host DTB.
    
    Introduce overlay_get_target_path() which directly handles the two
    targeting cases that occur before fixup resolution:
     - target-path: the string property is returned directly.
     - target = <&label>: the label is found in the overlay's __fixups__
       node, then resolved to a path via the base DTB's __symbols__ node.
    
    Libfdt fdt_for_each_property_offset() violates MISRA R20.7. Despite
    libfdt being excluded from the analysis, this causes ECLAIR scan to
    report a regression because the violation introduced by a macro is
    reported at the call site. Deviate R20.7 for libfdt.h.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl |  2 +
 xen/common/device-tree/dt-overlay.c              | 65 +++++++++++++++++++++---
 2 files changed, 61 insertions(+), 6 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 30c3239069..1ceb65819e 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -629,8 +629,10 @@ of the IS_ENABLED or STATIC_IF/STATIC_IF_NOT macros, so it always receives a lit
 not in scope for compliance are allowed, as that is imported code."
 -file_tag+={gnu_efi_include, "^xen/include/efi/.*$"}
 -file_tag+={acpi_cpu_idle, "^xen/arch/x86/acpi/cpu_idle\\.c$"}
+-file_tag+={libfdt, "^xen/include/xen/libfdt/libfdt\\.h$"}
 -config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(file(gnu_efi_include)||any_exp(macro(^NextMemoryDescriptor$))))"}
 -config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(file(acpi_cpu_idle)))"}
+-config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(any_exp(file(libfdt))))"}
 -doc_end
 
 -doc_begin="To avoid compromising readability, the macros alternative_(v)?call[0-9] are allowed
diff --git a/xen/common/device-tree/dt-overlay.c b/xen/common/device-tree/dt-overlay.c
index f203e189f5..fd171333c6 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -286,6 +286,63 @@ static unsigned int overlay_node_count(const void *overlay_fdt)
     return num_overlay_nodes;
 }
 
+/*
+ * Resolve the target path for an overlay fragment.
+ *
+ * This is called before fdt_overlay_apply(), so phandle-based targets
+ * (target = <&label>) are still unresolved (compiled as 0xffffffff by DTC).
+ * Handle the two cases that actually occur:
+ *  - target-path property: the path string is used directly,
+ *  - target = <&label>: the label is looked up in the overlay's __fixups__
+ *    node, then resolved to a path via the base DTB's __symbols__ node.
+ *
+ * Returns a pointer into the FDT on success, NULL on failure.
+ */
+static const char *overlay_get_target_path(const void *fdt, const void *fdto,
+                                           int fragment)
+{
+    const char *path, *fragment_name;
+    int fixups_off, symbols_off, property;
+    int fragment_name_len;
+
+    /* Try target-path first (string-based targeting) */
+    path = fdt_getprop(fdto, fragment, "target-path", NULL);
+    if ( path )
+        return path;
+
+    /* Phandle-based target: resolve via __fixups__ and __symbols__ */
+    fixups_off = fdt_path_offset(fdto, "/__fixups__");
+    if ( fixups_off < 0 )
+        return NULL;
+
+    symbols_off = fdt_path_offset(fdt, "/__symbols__");
+    if ( symbols_off < 0 )
+        return NULL;
+
+    fragment_name = fdt_get_name(fdto, fragment, &fragment_name_len);
+    if ( !fragment_name )
+        return NULL;
+
+    fdt_for_each_property_offset(property, fdto, fixups_off)
+    {
+        const char *val, *label, *p;
+        int val_len;
+
+        val = fdt_getprop_by_offset(fdto, property, &label, &val_len);
+        if ( !val || !val_len || (val[val_len - 1] != '\0') )
+            continue;
+
+        /* Match entries of the form "/<fragment_name>:target:0" */
+        for ( p = val; p < (val + val_len); p += (strlen(p) + 1) )
+            if ( p[0] == '/' &&
+                 !strncmp(p + 1, fragment_name, fragment_name_len) &&
+                 !strcmp(p + 1 + fragment_name_len, ":target:0") )
+                return fdt_getprop(fdt, symbols_off, label, NULL);
+    }
+
+    return NULL;
+}
+
 /*
  * overlay_get_nodes_info gets full name with path for all the nodes which
  * are in one level of __overlay__ tag. This is useful when checking node for
@@ -298,7 +355,6 @@ static int overlay_get_nodes_info(const void *fdto, char **nodes_full_path)
 
     fdt_for_each_subnode(fragment, fdto, 0)
     {
-        int target;
         int overlay;
         int subnode;
         const char *target_path;
@@ -307,11 +363,8 @@ static int overlay_get_nodes_info(const void *fdto, char **nodes_full_path)
         if ( overlay < 0 )
             continue;
 
-        target = fdt_overlay_target_offset(device_tree_flattened, fdto,
-                                           fragment, &target_path);
-        if ( target < 0 )
-            return target;
-
+        target_path = overlay_get_target_path(device_tree_flattened, fdto,
+                                              fragment);
         if ( target_path == NULL )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:56:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297068.1573210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzm7-0006L5-NV; Wed, 29 Apr 2026 07:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297068.1573210; Wed, 29 Apr 2026 07: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 1wHzm7-0006Ky-Ke; Wed, 29 Apr 2026 07:56:03 +0000
Received: by outflank-mailman (input) for mailman id 1297068;
 Wed, 29 Apr 2026 07:56:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzm6-0006Kr-JC
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:56:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzm6-007Z2q-1p
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzm6-007mVK-1h
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mQZ7WywWNlfw31iux5cJAGG3WbpHks619DUCTNBIa0s=; b=Ai1FbF4KinqESa52YscaAGEiJv
	BaMM8BIH8hOfMY1QwwjqNtVQQMLXY2cws/J/+iROJH+goiJM2Qdafpd10Sxjq6GgNRDBjA9TN69L1
	SEHrbz/fT6YLbBF0QnzxOUrkJnIlkOPyzlitutpC/NNASWkA6GWFsXuie3barugMZ9To=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dom0less: introduce next_phandle in struct kernel_info
Message-Id: <E1wHzm6-007mVK-1h@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:56:02 +0000

commit a010efd323d252c13c814c528b2421c04626d6a2
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Apr 27 17:34:23 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:39:07 2026 +0200

    xen/dom0less: introduce next_phandle in struct kernel_info
    
    There are cases where it is necessary to know the next available phandle
    number in order to generate phandles for guest device nodes.
    
    When a partial FDT (pfdt) is provided, special care is needed during
    initialization of next_phandle, as the pfdt may already contain a dummy
    interrupt controller node with a phandle assigned to it. next_phandle
    must therefore be initialized to one past the highest phandle already
    present in the pfdt, to avoid collisions.
    
    Since next_phandle may be needed for the very first guest node generated,
    domain_handle_dtb_boot_module() is moved earlier in prepare_dtb_domU().
    The new call site also aligns better with the existing comment stating
    that domain_handle_dtb_boot_module() must be called before the rest of
    the device tree is generated.
    
    Introduce alloc_phandle() to ensure that phandles allocated for guest
    nodes do not overlap the Xen-reserved phandle range.  This helper will
    be used by subsequent patches (by RISC-V at the moment).
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/device-tree/dom0less-build.c | 43 ++++++++++++++++++++++++---------
 xen/include/xen/fdt-domain-build.h      |  6 +++++
 xen/include/xen/fdt-kernel.h            |  6 +++++
 3 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 840d14419d..9787ee2649 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -389,6 +389,24 @@ static int __init domain_handle_dtb_boot_module(struct domain *d,
     if ( res < 0 )
         goto out;
 
+    /*
+     * Find the highest phandle in the partial FDT so next_phandle starts
+     * above it, avoiding collisions with pfdt's own phandle assignments.
+     */
+    res = fdt_generate_phandle(pfdt, &kinfo->next_phandle);
+    if ( res )
+    {
+        res = (res == -FDT_ERR_NOPHANDLES) ? -EOVERFLOW : -EINVAL;
+        goto out;
+    }
+
+    if ( kinfo->next_phandle >= GUEST_PHANDLE_GIC )
+    {
+        dprintk(XENLOG_ERR, "Phandle allocation overlaps Xen reserved range\n");
+        res = -EOVERFLOW;
+        goto out;
+    }
+
     for ( node_next = fdt_first_subnode(pfdt, 0);
           node_next > 0;
           node_next = fdt_next_subnode(pfdt, node_next) )
@@ -459,6 +477,7 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     BUILD_BUG_ON(DOMU_DTB_SIZE > SZ_2M);
 
     kinfo->phandle_intc = GUEST_PHANDLE_GIC;
+    kinfo->next_phandle = 1;
 
 #ifdef CONFIG_GRANT_TABLE
     kinfo->gnttab_start = GUEST_GNTTAB_BASE;
@@ -499,6 +518,18 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     if ( ret )
         goto err;
 
+    /*
+     * domain_handle_dtb_boot_module() must be called before the rest of the
+     * device tree is generated because it sets phandle_intc and next_phandle,
+     * which subsequent node generation depends on.
+     */
+    if ( kinfo->dtb )
+    {
+        ret = domain_handle_dtb_boot_module(d, kinfo);
+        if ( ret )
+            goto err;
+    }
+
     ret = make_chosen_node(kinfo);
     if ( ret )
         goto err;
@@ -516,18 +547,6 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     if ( ret )
         goto err;
 
-    /*
-     * domain_handle_dtb_boot_module has to be called before the rest of
-     * the device tree is generated because it depends on the value of
-     * the field phandle_intc.
-     */
-    if ( kinfo->dtb )
-    {
-        ret = domain_handle_dtb_boot_module(d, kinfo);
-        if ( ret )
-            goto err;
-    }
-
     ret = make_intc_domU_node(kinfo);
     if ( ret )
         goto err;
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index 886a853816..fd2ba01ff0 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -63,6 +63,12 @@ int find_unallocated_memory(const struct kernel_info *kinfo,
                                       unsigned long e_gfn,
                                       void *data));
 
+/* Return 0 (invalid phandle) if the Xen-reserved range has been reached */
+static inline uint32_t alloc_phandle(struct kernel_info *kinfo)
+{
+    return kinfo->next_phandle >= GUEST_PHANDLE_GIC ? 0 : kinfo->next_phandle++;
+}
+
 #endif /* __XEN_FDT_DOMAIN_BUILD_H__ */
 
 /*
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 33a60597bb..4d0467bb39 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -44,6 +44,12 @@ struct kernel_info {
     /* Interrupt controller phandle */
     uint32_t phandle_intc;
 
+    /*
+     * Next free phandle for guest device nodes; do not access directly, use
+     * alloc_phandle().
+     */
+    uint32_t next_phandle;
+
     /* loader to use for this kernel */
     void (*load)(struct kernel_info *info);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Apr 29 07:56:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Apr 2026 07:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1297069.1573213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wHzmH-0006NY-Oi; Wed, 29 Apr 2026 07:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1297069.1573213; Wed, 29 Apr 2026 07: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 1wHzmH-0006NQ-M6; Wed, 29 Apr 2026 07:56:13 +0000
Received: by outflank-mailman (input) for mailman id 1297069;
 Wed, 29 Apr 2026 07:56:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wHzmG-0006NE-ME
 for xen-changelog@lists.xenproject.org; Wed, 29 Apr 2026 07:56:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzmG-007Z3A-28
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wHzmG-007mVg-21
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Apr 2026 07: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=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X3Bpb6iC8g9ozhErPV7/3BN77JVdDHTh1l6Nk8Ggi58=; b=q3bMthogI29x1mvGVZOUng/nm9
	JDeYMUKawtfBNOYYy0LK7zh6d7mM3yoBoOTtVXy/Q7xWBBzETCD+x0o6RejM9n0iU+lwKefmlOsam
	NcM7RgOxO4OBmqfhBpW5gV4KQhunkfkeR36dNONlNyZ3BAzTqBtJuG0EckDhAR4qZ7e0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dom0less: pass kernel_info struct instead of fdt to make_cpus_node()
Message-Id: <E1wHzmG-007mVg-21@xenbits.xenproject.org>
Date: Wed, 29 Apr 2026 07:56:12 +0000

commit 526cb04bb68ca846485e991b819e456ecc9c62b5
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Apr 27 17:34:24 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Apr 29 07:39:14 2026 +0200

    xen/dom0less: pass kernel_info struct instead of fdt to make_cpus_node()
    
    There are two reasons of this change:
    1. Align prototype with what other make_*_node() are passed.
    2. A follow-up RISC-V patch will call get_next_free_phandle() inside
       make_cpus_node(), requiring mutable access to kinfo->free_phandle.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c             | 5 +++--
 xen/common/device-tree/dom0less-build.c | 2 +-
 xen/include/xen/fdt-domain-build.h      | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 6c17a84b26..a3ff701023 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1163,7 +1163,7 @@ int __init make_psci_node(void *fdt)
     return res;
 }
 
-int __init make_cpus_node(const struct domain *d, void *fdt)
+int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
 {
     int res;
     const struct dt_device_node *cpus = dt_find_node_by_path("/cpus");
@@ -1177,6 +1177,7 @@ int __init make_cpus_node(const struct domain *d, void *fdt)
     /* Keep the compiler happy with -Og */
     bool clock_valid = false;
     uint64_t mpidr_aff;
+    void *fdt = kinfo->fdt;
 
     dt_dprintk("Create cpus node\n");
 
@@ -1625,7 +1626,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
         if ( res )
             return res;
 
-        res = make_cpus_node(d, kinfo->fdt);
+        res = make_cpus_node(d, kinfo);
         if ( res )
             return res;
 
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 9787ee2649..6d6882a34b 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -534,7 +534,7 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     if ( ret )
         goto err;
 
-    ret = make_cpus_node(d, kinfo->fdt);
+    ret = make_cpus_node(d, kinfo);
     if ( ret )
         goto err;
 
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index fd2ba01ff0..0d40d8cfa1 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -25,7 +25,7 @@ int construct_domain(struct domain *d, struct kernel_info *kinfo);
 int construct_hwdom(struct kernel_info *kinfo,
                     const struct dt_device_node *node);
 int make_chosen_node(const struct kernel_info *kinfo);
-int make_cpus_node(const struct domain *d, void *fdt);
+int make_cpus_node(const struct domain *d, struct kernel_info *kinfo);
 int make_hypervisor_node(struct domain *d, const struct kernel_info *kinfo,
                          int addrcells, int sizecells);
 int make_memory_node(const struct kernel_info *kinfo, int addrcells,
--
generated by git-patchbot for /home/xen/git/xen.git#master


