From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 08:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 08:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136427.1472998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4bDq-0001u6-L0; Fri, 03 Oct 2025 08:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136427.1472998; Fri, 03 Oct 2025 08: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 1v4bDq-0001tw-Hw; Fri, 03 Oct 2025 08:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1136427;
 Fri, 03 Oct 2025 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 1v4bDq-0001tq-2E
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 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 1v4bDq-006eYx-04
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 08:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4bDp-00EeFM-37
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 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=we15hwetK3q/xA16KMkBdzN7zNl6sy9Vc2CHmq5LNRg=; b=Sm7JH1ESQVEize9mhcATYvLLhb
	na3VRCKvmI/3EOX177fJ0UIoFf4WS8wxIZLguifVXww3/c0djztfUXHjPEOnaM+CifX03ZTD6nLXk
	hs16BaNgg1nILVnWqc6d7lzco58fPtVLFWiSo86+jEhsjNQQqNT9Ab5dsPSx2A2EYIsc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
Message-Id: <E1v4bDp-00EeFM-37@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 08:33:01 +0000

commit db5a3c31a650d3fb0945f77f8ceda133412b5ce0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Oct 2 11:44:09 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 2 18:05:50 2025 +0200

    x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
    
    Reading from the E9 port if the emergency console is active should return
    0xe9 according to the documentation from Bochs:
    
    https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
    
    See `port_e9_hack` section description.
    
    Fix Xen so it also returns the port address.  OSes can use it to detect
    whether the emergency console is available or not.
    
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 23bd7f078a..0c60faa39d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -567,9 +567,15 @@ static int cf_check hvm_print_line(
 
     ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
 
-    /* Deny any input requests. */
-    if ( dir != IOREQ_WRITE )
-        return X86EMUL_UNHANDLEABLE;
+    if ( dir == IOREQ_READ )
+    {
+        /*
+         * According to Bochs documentation, reading from the E9 port should
+         * return 0xE9 if the "port E9 hack" is implemented.
+         */
+        *val = XEN_HVM_DEBUGCONS_IOPORT;
+        return X86EMUL_OKAY;
+    }
 
     if ( !is_console_printable(c) )
         return X86EMUL_OKAY;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 09:44:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 09:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136491.1473042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4cKZ-0003rz-5k; Fri, 03 Oct 2025 09:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136491.1473042; Fri, 03 Oct 2025 09:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4cKZ-0003rr-3F; Fri, 03 Oct 2025 09:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1136491;
 Fri, 03 Oct 2025 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 1v4cKX-0003rl-OV
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 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 1v4cKX-006g1M-2G
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 09:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4cKX-00Ense-27
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 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=xAsj0wUMhBN4JnEKPQlR/MaHAmwXyb0j9xijN6t+zYY=; b=6rfhA4Wvx8j/ZJEcp03r1vCjYX
	9OUMuGZQkWWwKRMNXJZoXhWxD0L1if5Y75iofEteAUKq4lsGF7NnOvhTKkrq4yh3zLyXwmdh5PkXN
	Wi9Uf+HhJMkktEgAnga+gShdjRY4cuhigSF53EhApanLb5ydmD6cORSLMXHScim1Q95I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
Message-Id: <E1v4cKX-00Ense-27@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 09:44:01 +0000

commit db5a3c31a650d3fb0945f77f8ceda133412b5ce0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Oct 2 11:44:09 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 2 18:05:50 2025 +0200

    x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
    
    Reading from the E9 port if the emergency console is active should return
    0xe9 according to the documentation from Bochs:
    
    https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
    
    See `port_e9_hack` section description.
    
    Fix Xen so it also returns the port address.  OSes can use it to detect
    whether the emergency console is available or not.
    
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 23bd7f078a..0c60faa39d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -567,9 +567,15 @@ static int cf_check hvm_print_line(
 
     ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
 
-    /* Deny any input requests. */
-    if ( dir != IOREQ_WRITE )
-        return X86EMUL_UNHANDLEABLE;
+    if ( dir == IOREQ_READ )
+    {
+        /*
+         * According to Bochs documentation, reading from the E9 port should
+         * return 0xE9 if the "port E9 hack" is implemented.
+         */
+        *val = XEN_HVM_DEBUGCONS_IOPORT;
+        return X86EMUL_OKAY;
+    }
 
     if ( !is_console_printable(c) )
         return X86EMUL_OKAY;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 14:44:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 14:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136607.1473106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4h0t-0006XY-Lu; Fri, 03 Oct 2025 14:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136607.1473106; Fri, 03 Oct 2025 14:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4h0t-0006XQ-JM; Fri, 03 Oct 2025 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1136607;
 Fri, 03 Oct 2025 14: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 1v4h0s-0006XK-1f
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 14: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 1v4h0r-006mBE-2s
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4h0r-00FR1Q-2l
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14: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=iSNUWvSRo177wHfC6wtXh+Brhx313p8WMf0xylGNJ7o=; b=hSGf2H0BZZ5654J7p+onbrtgQA
	hqf0A1GmV0n5Erl7dNDxTdR6Sn8r7zVEuBQ+t1JcGPDn8yuSuIJhkpmUItlYPR/kTVI4VC3JqA1BB
	5wu+RxVIdQ0AMTVLhXyU1avpWSudpkwANo1AgiaD/PMvBMdWMqlKALpwAtVeeE1+XCLw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs/xentop: Add documentation for physical CPU monitoring feature
Message-Id: <E1v4h0r-00FR1Q-2l@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 14:44:01 +0000

commit bfa14c7059f324f39abf0641fb4662662bddb730
Author:     Jahan Murudi <jahan.murudi.zg@renesas.com>
AuthorDate: Thu Sep 4 22:55:25 2025 +0530
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:02 2025 +0200

    docs/xentop: Add documentation for physical CPU monitoring feature
    
    Add man page documentation for the new '-p/--pcpus' flag that displays
    physical CPU utilization metrics. This provides hypervisor-level CPU
    usage insights alongside existing domain statistics.
    
    Changes include:
    - Add '-p' flag to SYNOPSIS section
    - Document '--pcpus' option with description
    - Maintain consistency with existing documentation style
    
    Signed-off-by: Jahan Murudi <jahan.murudi.zg@renesas.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/man/xentop.1.pod | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/docs/man/xentop.1.pod b/docs/man/xentop.1.pod
index 593a484ce7..db64ceb694 100644
--- a/docs/man/xentop.1.pod
+++ b/docs/man/xentop.1.pod
@@ -5,7 +5,7 @@ xentop - displays real-time information about a Xen system and domains
 =head1 SYNOPSIS
 
 B<xentop> [B<-h>] [B<-V>] [B<-d>SECONDS] [B<-n>] [B<-r>] [B<-v>] [B<-f>]
-[B<-b>] [B<-i>ITERATIONS] [B<-z>]
+[B<-b>] [B<-i>ITERATIONS] [B<-z>] [B<-p>]
 
 =head1 DESCRIPTION
 
@@ -61,6 +61,10 @@ maximum number of iterations xentop should produce before ending
 
 display dom0 first, ignoring interactive sorting
 
+=item B<-p>, B<--pcpus>
+
+display physical CPU utilization metrics
+
 =back
 
 =head1 INTERACTIVE COMMANDS
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 14:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 14:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136608.1473112 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4h13-0006ZS-Nu; Fri, 03 Oct 2025 14:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136608.1473112; Fri, 03 Oct 2025 14:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4h13-0006ZK-Kh; Fri, 03 Oct 2025 14:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1136608;
 Fri, 03 Oct 2025 14: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 1v4h12-0006Yx-0S
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 14: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 1v4h11-006mBJ-39
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4h11-00FR3S-33
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14: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=PAcgqzeaIGKCRoEXseRXbzojDMKOzS1afMyxuYHgYtk=; b=KhdZgt0Pl0Y+gNiedJBjW5EiaU
	uhIt8LwRELHS7HBqp2mz7RqtCAnii/6BEudO70QT2muXE4yGPYXOX5m4B6eU0GKOqY+Te7/Udg7Pb
	J1IGIwVJIpwhmqhRHwjXe6JFZhscZEeip2W22TAbBljJYL0Wdn8nTIIlXY6JHKDPKWno=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenconsole: Add connection flag
Message-Id: <E1v4h11-00FR3S-33@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 14:44:11 +0000

commit ddc2dd12644bcabcd10a5b3446f0397ef4e24f7c
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Aug 22 17:39:43 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:32 2025 +0200

    xenconsole: Add connection flag
    
    With hyperlaunch, a domU can start before its console ring is connected
    by xenconsoled.  With nothing emptying the ring, it can quickly fill
    during boot.  In domU_write_console(), __write_console() returns 0 when
    the ring is full.  This loops spins until xenconsoled starts emptying
    the ring:
    
            while (len) {
                    ssize_t sent = __write_console(cons, data, len);
    
                    if (sent < 0)
                            return sent;
    
                    data += sent;
                    len -= sent;
    
                    if (unlikely(len))
                            HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
            }
    
    The goal of this patch is to add a way for the frontend to know when a
    console is connected.  This patch adds a new flag to the end of the
    console ring structure.  It is used for the backend to indicate that it
    has connected and started servicing the page.
    
    The two values are
    XENCONSOLE_DISCONNECTED 1
    XENCONSOLE_CONNECTED    0
    
    XENCONSOLE_DISCONNECTED indicates to the guest that ring is
    disconnected, so it will not be serviced.  The guest can avoid writing
    into it in that case.  A domU can use console hypercalls and only
    transition to the ring when it is connected and won't fill and block.
    
    Once the backend (xenconsoled) maps and starts servicing the
    console, the flag will be set to XENCONSOLE_CONNECTED (0) to indicate
    the backend state to the frontend.
    
    The connected value as 0 will be match the default of a zero-ed console
    page.  Hyperlaunch can set the flag to XENCONSOLE_DISCONNECTED and let
    xenconsoled set to XENCONSOLE_CONNECTED.
    
    Old domU hvc_xen drivers won't check the flag.
    New domU hvc_xen running on a new xen/xenconsoled will work properly.
    New domU hvc_xen on old xen/xenconsoled should only see a 0 for the flag
    and behave as if connected.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/console/daemon/io.c       |  4 ++++
 xen/include/public/io/console.h | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index bb739bdb8c..43d4973c24 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -781,6 +781,10 @@ static int console_create_ring(struct console *con)
 		con->log_fd = create_console_log(con);
 
  out:
+	/* Mark the console connected. */
+	if (!err && con->interface)
+		con->interface->connection = XENCONSOLE_CONNECTED;
+
 	return err;
 }
 
diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h
index 4509b4b689..b9ebfaff3f 100644
--- a/xen/include/public/io/console.h
+++ b/xen/include/public/io/console.h
@@ -19,6 +19,19 @@ struct xencons_interface {
     char out[2048];
     XENCONS_RING_IDX in_cons, in_prod;
     XENCONS_RING_IDX out_cons, out_prod;
+/*
+ * Flag values signaling from backend to frontend whether the console is
+ * connected.  i.e. Whether it will be serviced and emptied.
+ *
+ * The flag starts as disconnected.
+ */
+#define XENCONSOLE_DISCONNECTED 1
+/*
+ * The flag is set to connected when the backend connects and the console
+ * will be serviced.
+ */
+#define XENCONSOLE_CONNECTED    0
+    uint8_t connection;
 };
 
 #ifdef XEN_WANT_FLEX_CONSOLE_RING
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 14:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 14:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136609.1473113 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4h1D-0006bX-Oe; Fri, 03 Oct 2025 14:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136609.1473113; Fri, 03 Oct 2025 14:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4h1D-0006bQ-M5; Fri, 03 Oct 2025 14:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1136609;
 Fri, 03 Oct 2025 14: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 1v4h1C-0006bI-3C
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 14: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 1v4h1C-006mBQ-0E
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4h1C-00FR7c-07
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WyYG79mq/NqLgJwS6M7GjCqelJiYZLUrqk3e4cK/AsQ=; b=jBXtPCmLLGDlaDyHhgHmjzFu9R
	Mb0/t0rDSSYlbxqBtw3FSif8hdHiA6Zo+uavOE/bhfhE7hZhMyjVorAho8X3NPsX27MoIGhRI21S7
	64DprCf0bCcl7CF4cjiFV3MpWAaQaj92HYN6TWvBNDteIXm9RKYLMLt+YYIDHeY4fq4M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libs/guest: Set console page to disconnected
Message-Id: <E1v4h1C-00FR7c-07@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 14:44:22 +0000

commit 971b7d5ecbcdbd3151c9cba1ca467c86ecb67e69
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Aug 22 17:39:44 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:32 2025 +0200

    libs/guest: Set console page to disconnected
    
    Initialize xencons_interface's connection field to
    XENCONSOLE_DISCONNECTED.  xenconsoled will mark the page as connected
    when it establishes the connection.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenguest.h       |  2 ++
 tools/libs/guest/xg_dom_arm.c  |  2 +-
 tools/libs/guest/xg_dom_boot.c | 20 ++++++++++++++++++++
 tools/libs/guest/xg_dom_x86.c  |  6 +++---
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index e01f494b77..1d5a6d3509 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -335,6 +335,8 @@ void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
                            xen_pfn_t count);
 int xc_dom_boot_image(struct xc_dom_image *dom);
 int xc_dom_compat_check(struct xc_dom_image *dom);
+int xc_dom_console_init(xc_interface *xch, uint32_t guest_domid,
+                        xen_pfn_t console_gfn);
 int xc_dom_gnttab_init(struct xc_dom_image *dom);
 int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
                        bool is_hvm,
diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 2fd8ee7ad4..c8d0918506 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -70,7 +70,7 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     dom->xenstore_pfn = base + XENSTORE_PFN_OFFSET;
     dom->vuart_gfn = base + VUART_PFN_OFFSET;
 
-    xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn);
+    xc_dom_console_init(dom->xch, dom->guest_domid, dom->console_pfn);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
     xc_clear_domain_page(dom->xch, dom->guest_domid, base + MEMACCESS_PFN_OFFSET);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->vuart_gfn);
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index 5c7e12221d..b5f248e642 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -34,6 +34,7 @@
 #include "xg_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
+#include <xen/io/console.h>
 
 /* ------------------------------------------------------------------------ */
 
@@ -427,6 +428,25 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
                               dom->console_domid, dom->xenstore_domid);
 }
 
+int xc_dom_console_init(xc_interface *xch,
+                        uint32_t domid,
+                        unsigned long dst_pfn)
+{
+    const size_t size = PAGE_SIZE;
+    struct xencons_interface *xencons = xc_map_foreign_range(
+        xch, domid, size, PROT_WRITE, dst_pfn);
+
+    if ( xencons == NULL )
+        return -1;
+
+    memset(xencons, 0, size);
+    xencons->connection = XENCONSOLE_DISCONNECTED;
+
+    munmap(xencons, size);
+    xc_domain_cacheflush(xch, domid, dst_pfn, 1);
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index cba01384ae..a82b481a12 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -587,8 +587,8 @@ static int alloc_magic_pages_pv(struct xc_dom_image *dom)
     dom->console_pfn = xc_dom_alloc_page(dom, "console");
     if ( dom->console_pfn == INVALID_PFN )
         return -1;
-    xc_clear_domain_page(dom->xch, dom->guest_domid,
-                         xc_dom_p2m(dom, dom->console_pfn));
+    xc_dom_console_init(dom->xch, dom->guest_domid,
+                        xc_dom_p2m(dom, dom->console_pfn));
 
     dom->alloc_bootstack = 1;
 
@@ -734,7 +734,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
                      special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
 
     dom->console_pfn = special_pfn(SPECIALPAGE_CONSOLE);
-    xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn);
+    xc_dom_console_init(dom->xch, dom->guest_domid, dom->console_pfn);
 
     dom->xenstore_pfn = special_pfn(SPECIALPAGE_XENSTORE);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 14:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 14:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136611.1473118 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4h1N-0006eK-QC; Fri, 03 Oct 2025 14:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136611.1473118; Fri, 03 Oct 2025 14: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 1v4h1N-0006eC-NV; Fri, 03 Oct 2025 14:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1136611;
 Fri, 03 Oct 2025 14: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 1v4h1M-0006dd-68
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 14: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 1v4h1M-006mBY-0W
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4h1M-00FR9v-0P
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 14:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uWNT/I5Vpqgfw1aPInrirbidbk0WWL3fulZxYlk7lAo=; b=y7hDQTM7A8anuVdmwDAjJwkNIk
	eV16eO0HrwvUS57mv1x5gaR6Ab5rYrux8STeUmSaWiYA0kVk92shUdd0/f7w6NhgF27Bdux4hY/JT
	OO8KYUIQvFGurP5yrH+nJozacsF2LjMhlNtvjAsNsMOdlWXLy0w2P5oko95ievUouhH8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libs/guest: Set console as disconnected on resume
Message-Id: <E1v4h1M-00FR9v-0P@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 14:44:32 +0000

commit b6fc307b0b00314d4e4460fcf8be2cd9e4ff8652
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Aug 22 17:39:45 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:32 2025 +0200

    libs/guest: Set console as disconnected on resume
    
    There is currently an asymmetry between HVM where the page is cleared
    and PV where the contents are restored.
    
    Add xc_dom_console_set_disconnected() to only set the connection flag
    for PV guests.
    
    xenconsoled is responsible for setting the console connected when it
    attaches.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenguest.h                 |  2 ++
 tools/libs/guest/xg_dom_boot.c           | 24 ++++++++++++++++++++----
 tools/libs/guest/xg_sr_restore_x86_hvm.c |  2 +-
 tools/libs/guest/xg_sr_restore_x86_pv.c  |  1 +
 4 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index 1d5a6d3509..c88958faa9 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -337,6 +337,8 @@ int xc_dom_boot_image(struct xc_dom_image *dom);
 int xc_dom_compat_check(struct xc_dom_image *dom);
 int xc_dom_console_init(xc_interface *xch, uint32_t guest_domid,
                         xen_pfn_t console_gfn);
+int xc_dom_console_set_disconnected(xc_interface *xch, uint32_t guest_domid,
+                                    xen_pfn_t console_gfn);
 int xc_dom_gnttab_init(struct xc_dom_image *dom);
 int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
                        bool is_hvm,
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index b5f248e642..f51b6a78c8 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -428,9 +428,10 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
                               dom->console_domid, dom->xenstore_domid);
 }
 
-int xc_dom_console_init(xc_interface *xch,
-                        uint32_t domid,
-                        unsigned long dst_pfn)
+static int dom_console_init(xc_interface *xch,
+                            uint32_t domid,
+                            unsigned long dst_pfn,
+                            bool clear)
 {
     const size_t size = PAGE_SIZE;
     struct xencons_interface *xencons = xc_map_foreign_range(
@@ -439,7 +440,8 @@ int xc_dom_console_init(xc_interface *xch,
     if ( xencons == NULL )
         return -1;
 
-    memset(xencons, 0, size);
+    if (clear)
+        memset(xencons, 0, size);
     xencons->connection = XENCONSOLE_DISCONNECTED;
 
     munmap(xencons, size);
@@ -447,6 +449,20 @@ int xc_dom_console_init(xc_interface *xch,
     return 0;
 }
 
+int xc_dom_console_init(xc_interface *xch,
+                        uint32_t domid,
+                        unsigned long dst_pfn)
+{
+    return dom_console_init(xch, domid, dst_pfn, true);
+}
+
+int xc_dom_console_set_disconnected(xc_interface *xch,
+                                    uint32_t domid,
+                                    unsigned long dst_pfn)
+{
+    return dom_console_init(xch, domid, dst_pfn, false);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/guest/xg_sr_restore_x86_hvm.c b/tools/libs/guest/xg_sr_restore_x86_hvm.c
index d6ea6f3012..a5d1511fde 100644
--- a/tools/libs/guest/xg_sr_restore_x86_hvm.c
+++ b/tools/libs/guest/xg_sr_restore_x86_hvm.c
@@ -62,7 +62,7 @@ static int handle_hvm_params(struct xc_sr_context *ctx,
         {
         case HVM_PARAM_CONSOLE_PFN:
             ctx->restore.console_gfn = entry->value;
-            xc_clear_domain_page(xch, ctx->domid, entry->value);
+            xc_dom_console_init(xch, ctx->domid, entry->value);
             break;
         case HVM_PARAM_STORE_PFN:
             ctx->restore.xenstore_gfn = entry->value;
diff --git a/tools/libs/guest/xg_sr_restore_x86_pv.c b/tools/libs/guest/xg_sr_restore_x86_pv.c
index 9cd6a88022..876748c11e 100644
--- a/tools/libs/guest/xg_sr_restore_x86_pv.c
+++ b/tools/libs/guest/xg_sr_restore_x86_pv.c
@@ -208,6 +208,7 @@ static int process_start_info(struct xc_sr_context *ctx,
         goto err;
     }
 
+    xc_dom_console_set_disconnected(xch, ctx->domid, mfn);
     ctx->restore.console_gfn = mfn;
     SET_FIELD(guest_start_info, console.domU.mfn, mfn, ctx->x86.pv.width);
     SET_FIELD(guest_start_info, console.domU.evtchn,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 15:55:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 15:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136689.1473172 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4i7b-0000wm-Q0; Fri, 03 Oct 2025 15:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136689.1473172; Fri, 03 Oct 2025 15: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 1v4i7b-0000we-NX; Fri, 03 Oct 2025 15:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1136689;
 Fri, 03 Oct 2025 15: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 1v4i7a-0000wY-0L
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 15: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 1v4i7Z-006nZg-32
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4i7Z-00Fb81-2v
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15: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=PDS/a4fDbVPU4zyXeb8whAEg8OeWyMgSFPhuWYvdnqQ=; b=OJmHwc2PBv9616658tPmBV8cl4
	nkUs+C8fscDJIyPipj/9b1tsn4fuRaB6ZkqhxpOZOnsxDxsH850JBtTYfBYSZTxYbhyJra5dYWaQp
	ZI/61trWBLf2Xj4M3/vtBS4ohTO1CWySky3+iIFQ+p/mYIi7FNMVlmNHWe9OW9hF6H6s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/xentop: Add documentation for physical CPU monitoring feature
Message-Id: <E1v4i7Z-00Fb81-2v@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 15:55:01 +0000

commit bfa14c7059f324f39abf0641fb4662662bddb730
Author:     Jahan Murudi <jahan.murudi.zg@renesas.com>
AuthorDate: Thu Sep 4 22:55:25 2025 +0530
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:02 2025 +0200

    docs/xentop: Add documentation for physical CPU monitoring feature
    
    Add man page documentation for the new '-p/--pcpus' flag that displays
    physical CPU utilization metrics. This provides hypervisor-level CPU
    usage insights alongside existing domain statistics.
    
    Changes include:
    - Add '-p' flag to SYNOPSIS section
    - Document '--pcpus' option with description
    - Maintain consistency with existing documentation style
    
    Signed-off-by: Jahan Murudi <jahan.murudi.zg@renesas.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/man/xentop.1.pod | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/docs/man/xentop.1.pod b/docs/man/xentop.1.pod
index 593a484ce7..db64ceb694 100644
--- a/docs/man/xentop.1.pod
+++ b/docs/man/xentop.1.pod
@@ -5,7 +5,7 @@ xentop - displays real-time information about a Xen system and domains
 =head1 SYNOPSIS
 
 B<xentop> [B<-h>] [B<-V>] [B<-d>SECONDS] [B<-n>] [B<-r>] [B<-v>] [B<-f>]
-[B<-b>] [B<-i>ITERATIONS] [B<-z>]
+[B<-b>] [B<-i>ITERATIONS] [B<-z>] [B<-p>]
 
 =head1 DESCRIPTION
 
@@ -61,6 +61,10 @@ maximum number of iterations xentop should produce before ending
 
 display dom0 first, ignoring interactive sorting
 
+=item B<-p>, B<--pcpus>
+
+display physical CPU utilization metrics
+
 =back
 
 =head1 INTERACTIVE COMMANDS
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 15:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 15:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136690.1473176 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4i7l-0000yS-S9; Fri, 03 Oct 2025 15:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136690.1473176; Fri, 03 Oct 2025 15: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 1v4i7l-0000yK-Op; Fri, 03 Oct 2025 15:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1136690;
 Fri, 03 Oct 2025 15: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 1v4i7k-0000y1-2m
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 15: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 1v4i7k-006nZl-09
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4i7j-00FbAM-3D
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15: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=imUpXw8hBhZRRe8WJ/KR5/rGS3wpz1RNm1gLdAPUmNI=; b=dEW+vnke6nRXXmx1YrYA5950Pp
	1BIaCpzp7GqnqgylEBHC9VmukC275l9Fx60uHNJihaBzU/9Medim2l2gJiLoCnmRRrVf9zACl44p3
	QrnOcF2tglSHMUcSbeO7hIleBC5QuHDOFdXdLDwvK7NXREzoFsS2zcHY+44dEqDgkoNw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenconsole: Add connection flag
Message-Id: <E1v4i7j-00FbAM-3D@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 15:55:11 +0000

commit ddc2dd12644bcabcd10a5b3446f0397ef4e24f7c
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Aug 22 17:39:43 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:32 2025 +0200

    xenconsole: Add connection flag
    
    With hyperlaunch, a domU can start before its console ring is connected
    by xenconsoled.  With nothing emptying the ring, it can quickly fill
    during boot.  In domU_write_console(), __write_console() returns 0 when
    the ring is full.  This loops spins until xenconsoled starts emptying
    the ring:
    
            while (len) {
                    ssize_t sent = __write_console(cons, data, len);
    
                    if (sent < 0)
                            return sent;
    
                    data += sent;
                    len -= sent;
    
                    if (unlikely(len))
                            HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
            }
    
    The goal of this patch is to add a way for the frontend to know when a
    console is connected.  This patch adds a new flag to the end of the
    console ring structure.  It is used for the backend to indicate that it
    has connected and started servicing the page.
    
    The two values are
    XENCONSOLE_DISCONNECTED 1
    XENCONSOLE_CONNECTED    0
    
    XENCONSOLE_DISCONNECTED indicates to the guest that ring is
    disconnected, so it will not be serviced.  The guest can avoid writing
    into it in that case.  A domU can use console hypercalls and only
    transition to the ring when it is connected and won't fill and block.
    
    Once the backend (xenconsoled) maps and starts servicing the
    console, the flag will be set to XENCONSOLE_CONNECTED (0) to indicate
    the backend state to the frontend.
    
    The connected value as 0 will be match the default of a zero-ed console
    page.  Hyperlaunch can set the flag to XENCONSOLE_DISCONNECTED and let
    xenconsoled set to XENCONSOLE_CONNECTED.
    
    Old domU hvc_xen drivers won't check the flag.
    New domU hvc_xen running on a new xen/xenconsoled will work properly.
    New domU hvc_xen on old xen/xenconsoled should only see a 0 for the flag
    and behave as if connected.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/console/daemon/io.c       |  4 ++++
 xen/include/public/io/console.h | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index bb739bdb8c..43d4973c24 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -781,6 +781,10 @@ static int console_create_ring(struct console *con)
 		con->log_fd = create_console_log(con);
 
  out:
+	/* Mark the console connected. */
+	if (!err && con->interface)
+		con->interface->connection = XENCONSOLE_CONNECTED;
+
 	return err;
 }
 
diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h
index 4509b4b689..b9ebfaff3f 100644
--- a/xen/include/public/io/console.h
+++ b/xen/include/public/io/console.h
@@ -19,6 +19,19 @@ struct xencons_interface {
     char out[2048];
     XENCONS_RING_IDX in_cons, in_prod;
     XENCONS_RING_IDX out_cons, out_prod;
+/*
+ * Flag values signaling from backend to frontend whether the console is
+ * connected.  i.e. Whether it will be serviced and emptied.
+ *
+ * The flag starts as disconnected.
+ */
+#define XENCONSOLE_DISCONNECTED 1
+/*
+ * The flag is set to connected when the backend connects and the console
+ * will be serviced.
+ */
+#define XENCONSOLE_CONNECTED    0
+    uint8_t connection;
 };
 
 #ifdef XEN_WANT_FLEX_CONSOLE_RING
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 15:55:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 15:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136691.1473180 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4i7u-00011Q-Um; Fri, 03 Oct 2025 15:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136691.1473180; Fri, 03 Oct 2025 15: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 1v4i7u-00011I-S8; Fri, 03 Oct 2025 15:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1136691;
 Fri, 03 Oct 2025 15: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 1v4i7u-000119-5B
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 15: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 1v4i7u-006nZp-0Q
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4i7u-00FbBR-0L
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15: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=O024Jt0lFhVHl1BSELrzzidF92QEGlxgZtXnkxqY4hI=; b=626cZegZyau0bw7uySPQ/NU95y
	KUaYzQQxNXGfHJSq6aEucSxmJehX0u7Qdr4lAZaZe5+zvFl+HBNrTsWX9gVQEx79GAKyUYKnyboV+
	pkfZE5man+z0QuzPpanBxbAZ470c+/J397dvAKAxWjFL7egtLFegmxT8gs8418Mlhrps=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libs/guest: Set console page to disconnected
Message-Id: <E1v4i7u-00FbBR-0L@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 15:55:22 +0000

commit 971b7d5ecbcdbd3151c9cba1ca467c86ecb67e69
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Aug 22 17:39:44 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:32 2025 +0200

    libs/guest: Set console page to disconnected
    
    Initialize xencons_interface's connection field to
    XENCONSOLE_DISCONNECTED.  xenconsoled will mark the page as connected
    when it establishes the connection.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenguest.h       |  2 ++
 tools/libs/guest/xg_dom_arm.c  |  2 +-
 tools/libs/guest/xg_dom_boot.c | 20 ++++++++++++++++++++
 tools/libs/guest/xg_dom_x86.c  |  6 +++---
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index e01f494b77..1d5a6d3509 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -335,6 +335,8 @@ void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
                            xen_pfn_t count);
 int xc_dom_boot_image(struct xc_dom_image *dom);
 int xc_dom_compat_check(struct xc_dom_image *dom);
+int xc_dom_console_init(xc_interface *xch, uint32_t guest_domid,
+                        xen_pfn_t console_gfn);
 int xc_dom_gnttab_init(struct xc_dom_image *dom);
 int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
                        bool is_hvm,
diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 2fd8ee7ad4..c8d0918506 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -70,7 +70,7 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     dom->xenstore_pfn = base + XENSTORE_PFN_OFFSET;
     dom->vuart_gfn = base + VUART_PFN_OFFSET;
 
-    xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn);
+    xc_dom_console_init(dom->xch, dom->guest_domid, dom->console_pfn);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
     xc_clear_domain_page(dom->xch, dom->guest_domid, base + MEMACCESS_PFN_OFFSET);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->vuart_gfn);
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index 5c7e12221d..b5f248e642 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -34,6 +34,7 @@
 #include "xg_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
+#include <xen/io/console.h>
 
 /* ------------------------------------------------------------------------ */
 
@@ -427,6 +428,25 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
                               dom->console_domid, dom->xenstore_domid);
 }
 
+int xc_dom_console_init(xc_interface *xch,
+                        uint32_t domid,
+                        unsigned long dst_pfn)
+{
+    const size_t size = PAGE_SIZE;
+    struct xencons_interface *xencons = xc_map_foreign_range(
+        xch, domid, size, PROT_WRITE, dst_pfn);
+
+    if ( xencons == NULL )
+        return -1;
+
+    memset(xencons, 0, size);
+    xencons->connection = XENCONSOLE_DISCONNECTED;
+
+    munmap(xencons, size);
+    xc_domain_cacheflush(xch, domid, dst_pfn, 1);
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index cba01384ae..a82b481a12 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -587,8 +587,8 @@ static int alloc_magic_pages_pv(struct xc_dom_image *dom)
     dom->console_pfn = xc_dom_alloc_page(dom, "console");
     if ( dom->console_pfn == INVALID_PFN )
         return -1;
-    xc_clear_domain_page(dom->xch, dom->guest_domid,
-                         xc_dom_p2m(dom, dom->console_pfn));
+    xc_dom_console_init(dom->xch, dom->guest_domid,
+                        xc_dom_p2m(dom, dom->console_pfn));
 
     dom->alloc_bootstack = 1;
 
@@ -734,7 +734,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
                      special_pfn(SPECIALPAGE_IDENT_PT) << PAGE_SHIFT);
 
     dom->console_pfn = special_pfn(SPECIALPAGE_CONSOLE);
-    xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn);
+    xc_dom_console_init(dom->xch, dom->guest_domid, dom->console_pfn);
 
     dom->xenstore_pfn = special_pfn(SPECIALPAGE_XENSTORE);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 03 15:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Oct 2025 15:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1136692.1473184 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v4i85-00013p-04; Fri, 03 Oct 2025 15:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1136692.1473184; Fri, 03 Oct 2025 15: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 1v4i84-00013g-TV; Fri, 03 Oct 2025 15:55:32 +0000
Received: by outflank-mailman (input) for mailman id 1136692;
 Fri, 03 Oct 2025 15: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 1v4i84-00013Y-8m
 for xen-changelog@lists.xenproject.org; Fri, 03 Oct 2025 15: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 1v4i84-006nZt-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v4i84-00FbC7-0d
 for xen-changelog@lists.xenproject.org;
 Fri, 03 Oct 2025 15: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=VgAFeHOEVbG1FDVepsdIMnF7FgF0YPdaUdYxeZ6Wyc8=; b=AOgxF0lgUCJWo/cDB6HkL3Xpgb
	gE58sBZYuiiYGQt4OSDqePWEuYwhMLd9siaVgoGzFmUtdfjLtwNNbqdxDa5Ado/Dn7W3WfBvdGbaQ
	dXA7UoyAhIyE5QwTuOuDFDt4jFxvzt5qnuD+RKCWFE6AFg0+bqgGkvvNRvRvR1ZZmGnE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libs/guest: Set console as disconnected on resume
Message-Id: <E1v4i84-00FbC7-0d@xenbits.xenproject.org>
Date: Fri, 03 Oct 2025 15:55:32 +0000

commit b6fc307b0b00314d4e4460fcf8be2cd9e4ff8652
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Aug 22 17:39:45 2025 -0400
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Fri Oct 3 15:50:32 2025 +0200

    libs/guest: Set console as disconnected on resume
    
    There is currently an asymmetry between HVM where the page is cleared
    and PV where the contents are restored.
    
    Add xc_dom_console_set_disconnected() to only set the connection flag
    for PV guests.
    
    xenconsoled is responsible for setting the console connected when it
    attaches.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenguest.h                 |  2 ++
 tools/libs/guest/xg_dom_boot.c           | 24 ++++++++++++++++++++----
 tools/libs/guest/xg_sr_restore_x86_hvm.c |  2 +-
 tools/libs/guest/xg_sr_restore_x86_pv.c  |  1 +
 4 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index 1d5a6d3509..c88958faa9 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -337,6 +337,8 @@ int xc_dom_boot_image(struct xc_dom_image *dom);
 int xc_dom_compat_check(struct xc_dom_image *dom);
 int xc_dom_console_init(xc_interface *xch, uint32_t guest_domid,
                         xen_pfn_t console_gfn);
+int xc_dom_console_set_disconnected(xc_interface *xch, uint32_t guest_domid,
+                                    xen_pfn_t console_gfn);
 int xc_dom_gnttab_init(struct xc_dom_image *dom);
 int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
                        bool is_hvm,
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index b5f248e642..f51b6a78c8 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -428,9 +428,10 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
                               dom->console_domid, dom->xenstore_domid);
 }
 
-int xc_dom_console_init(xc_interface *xch,
-                        uint32_t domid,
-                        unsigned long dst_pfn)
+static int dom_console_init(xc_interface *xch,
+                            uint32_t domid,
+                            unsigned long dst_pfn,
+                            bool clear)
 {
     const size_t size = PAGE_SIZE;
     struct xencons_interface *xencons = xc_map_foreign_range(
@@ -439,7 +440,8 @@ int xc_dom_console_init(xc_interface *xch,
     if ( xencons == NULL )
         return -1;
 
-    memset(xencons, 0, size);
+    if (clear)
+        memset(xencons, 0, size);
     xencons->connection = XENCONSOLE_DISCONNECTED;
 
     munmap(xencons, size);
@@ -447,6 +449,20 @@ int xc_dom_console_init(xc_interface *xch,
     return 0;
 }
 
+int xc_dom_console_init(xc_interface *xch,
+                        uint32_t domid,
+                        unsigned long dst_pfn)
+{
+    return dom_console_init(xch, domid, dst_pfn, true);
+}
+
+int xc_dom_console_set_disconnected(xc_interface *xch,
+                                    uint32_t domid,
+                                    unsigned long dst_pfn)
+{
+    return dom_console_init(xch, domid, dst_pfn, false);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/guest/xg_sr_restore_x86_hvm.c b/tools/libs/guest/xg_sr_restore_x86_hvm.c
index d6ea6f3012..a5d1511fde 100644
--- a/tools/libs/guest/xg_sr_restore_x86_hvm.c
+++ b/tools/libs/guest/xg_sr_restore_x86_hvm.c
@@ -62,7 +62,7 @@ static int handle_hvm_params(struct xc_sr_context *ctx,
         {
         case HVM_PARAM_CONSOLE_PFN:
             ctx->restore.console_gfn = entry->value;
-            xc_clear_domain_page(xch, ctx->domid, entry->value);
+            xc_dom_console_init(xch, ctx->domid, entry->value);
             break;
         case HVM_PARAM_STORE_PFN:
             ctx->restore.xenstore_gfn = entry->value;
diff --git a/tools/libs/guest/xg_sr_restore_x86_pv.c b/tools/libs/guest/xg_sr_restore_x86_pv.c
index 9cd6a88022..876748c11e 100644
--- a/tools/libs/guest/xg_sr_restore_x86_pv.c
+++ b/tools/libs/guest/xg_sr_restore_x86_pv.c
@@ -208,6 +208,7 @@ static int process_start_info(struct xc_sr_context *ctx,
         goto err;
     }
 
+    xc_dom_console_set_disconnected(xch, ctx->domid, mfn);
     ctx->restore.console_gfn = mfn;
     SET_FIELD(guest_start_info, console.domU.mfn, mfn, ctx->x86.pv.width);
     SET_FIELD(guest_start_info, console.domU.evtchn,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 11:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 11:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138129.1473891 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5jSh-0005iX-3L; Mon, 06 Oct 2025 11:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138129.1473891; Mon, 06 Oct 2025 11: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 1v5jSh-0005iP-0j; Mon, 06 Oct 2025 11:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1138129;
 Mon, 06 Oct 2025 11: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 1v5jSf-0005iJ-Fn
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 11: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 1v5jSf-00BmXz-1U
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 11:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5jSf-005nDs-1L
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 11: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=DM0LghgblT9F3nmvCjmAS3Vl6SQAFVogPLKDetjtVlI=; b=G+BlNiYNsVy168UNZ95z+TFGMj
	LjZqmrWK6YRx6HqnIejksiu4oyb4PFRG7Ic2/AWrSM/Hfh/LjsZt8j2MopF5BJpu4cPc3VopfDAGs
	K7jQHxd4OUG3rRnlZpYor4+ih6hBn7YGIq/ecRMNeNQC5+Gh53+EQb3rSVNLTJmmcogo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libs/guest: don't use unsigned long as type for PFNs
Message-Id: <E1v5jSf-005nDs-1L@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 11:33:01 +0000

commit fd67ca4e58c0a90aca21ea808b8297c65f7bb43b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 6 07:59:39 2025 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Oct 6 12:22:21 2025 +0100

    libs/guest: don't use unsigned long as type for PFNs
    
    Declarations of xc_dom_console_init() and
    xc_dom_console_set_disconnected() in libxenguest.h don't match their
    implementation in the library.
    
    Under arm32, xen_pfn_t is a uint64_t and wider than unsigned long.
    
    Use xen_pfn_t for GFNs in the library to fix that. At the same time
    change the parameter name of the implementation to console_gfn,
    matching the interface declaration in the header and reality (it is
    a GFN, not a PFN).
    
    Fixes: b6fc307b0b00 ("libs/guest: Set console as disconnected on resume")
    Fixes: 971b7d5ecbcd ("libs/guest: Set console page to disconnected")
    Reported-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 tools/libs/guest/xg_dom_boot.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index f51b6a78c8..420222cf37 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -430,12 +430,12 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
 
 static int dom_console_init(xc_interface *xch,
                             uint32_t domid,
-                            unsigned long dst_pfn,
+                            xen_pfn_t console_gfn,
                             bool clear)
 {
     const size_t size = PAGE_SIZE;
     struct xencons_interface *xencons = xc_map_foreign_range(
-        xch, domid, size, PROT_WRITE, dst_pfn);
+        xch, domid, size, PROT_WRITE, console_gfn);
 
     if ( xencons == NULL )
         return -1;
@@ -445,22 +445,22 @@ static int dom_console_init(xc_interface *xch,
     xencons->connection = XENCONSOLE_DISCONNECTED;
 
     munmap(xencons, size);
-    xc_domain_cacheflush(xch, domid, dst_pfn, 1);
+    xc_domain_cacheflush(xch, domid, console_gfn, 1);
     return 0;
 }
 
 int xc_dom_console_init(xc_interface *xch,
                         uint32_t domid,
-                        unsigned long dst_pfn)
+                        xen_pfn_t console_gfn)
 {
-    return dom_console_init(xch, domid, dst_pfn, true);
+    return dom_console_init(xch, domid, console_gfn, true);
 }
 
 int xc_dom_console_set_disconnected(xc_interface *xch,
                                     uint32_t domid,
-                                    unsigned long dst_pfn)
+                                    xen_pfn_t console_gfn)
 {
-    return dom_console_init(xch, domid, dst_pfn, false);
+    return dom_console_init(xch, domid, console_gfn, false);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 12:22:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 12:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138145.1473895 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5kE7-0002jL-GW; Mon, 06 Oct 2025 12:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138145.1473895; Mon, 06 Oct 2025 12: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 1v5kE7-0002jD-Dr; Mon, 06 Oct 2025 12:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1138145;
 Mon, 06 Oct 2025 12: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 1v5kE5-0002j7-IT
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 12: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 1v5kE5-00BnUs-1W
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 12:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5kE5-005tNm-1M
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 12: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=ZjCXL+sgWzOcbbA+o+0nHGJXdn/XJrDwp2CBV+zd1r4=; b=0BrwYjULkDRJj26Lwp+SPc6/O3
	7Mf6lGUa55Elmun+J/nqeWh0k9aQ1TiTDwMmJma4hQX9JjPDV8nDkye3ewGhcJKemvSwb3t3lfmC2
	C43xq2zienLLXrHEa8Z+LS4lRiPmb5GKEaNoP8cmHRDRa4M7F3TFH3HBBpM2qpQ2XED0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libs/guest: don't use unsigned long as type for PFNs
Message-Id: <E1v5kE5-005tNm-1M@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 12:22:01 +0000

commit fd67ca4e58c0a90aca21ea808b8297c65f7bb43b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 6 07:59:39 2025 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Oct 6 12:22:21 2025 +0100

    libs/guest: don't use unsigned long as type for PFNs
    
    Declarations of xc_dom_console_init() and
    xc_dom_console_set_disconnected() in libxenguest.h don't match their
    implementation in the library.
    
    Under arm32, xen_pfn_t is a uint64_t and wider than unsigned long.
    
    Use xen_pfn_t for GFNs in the library to fix that. At the same time
    change the parameter name of the implementation to console_gfn,
    matching the interface declaration in the header and reality (it is
    a GFN, not a PFN).
    
    Fixes: b6fc307b0b00 ("libs/guest: Set console as disconnected on resume")
    Fixes: 971b7d5ecbcd ("libs/guest: Set console page to disconnected")
    Reported-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 tools/libs/guest/xg_dom_boot.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index f51b6a78c8..420222cf37 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -430,12 +430,12 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)
 
 static int dom_console_init(xc_interface *xch,
                             uint32_t domid,
-                            unsigned long dst_pfn,
+                            xen_pfn_t console_gfn,
                             bool clear)
 {
     const size_t size = PAGE_SIZE;
     struct xencons_interface *xencons = xc_map_foreign_range(
-        xch, domid, size, PROT_WRITE, dst_pfn);
+        xch, domid, size, PROT_WRITE, console_gfn);
 
     if ( xencons == NULL )
         return -1;
@@ -445,22 +445,22 @@ static int dom_console_init(xc_interface *xch,
     xencons->connection = XENCONSOLE_DISCONNECTED;
 
     munmap(xencons, size);
-    xc_domain_cacheflush(xch, domid, dst_pfn, 1);
+    xc_domain_cacheflush(xch, domid, console_gfn, 1);
     return 0;
 }
 
 int xc_dom_console_init(xc_interface *xch,
                         uint32_t domid,
-                        unsigned long dst_pfn)
+                        xen_pfn_t console_gfn)
 {
-    return dom_console_init(xch, domid, dst_pfn, true);
+    return dom_console_init(xch, domid, console_gfn, true);
 }
 
 int xc_dom_console_set_disconnected(xc_interface *xch,
                                     uint32_t domid,
-                                    unsigned long dst_pfn)
+                                    xen_pfn_t console_gfn)
 {
-    return dom_console_init(xch, domid, dst_pfn, false);
+    return dom_console_init(xch, domid, console_gfn, false);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138188.1473928 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lKo-0003Zi-Qt; Mon, 06 Oct 2025 13:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138188.1473928; Mon, 06 Oct 2025 13: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 1v5lKo-0003Zb-OK; Mon, 06 Oct 2025 13:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1138188;
 Mon, 06 Oct 2025 13: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 1v5lKo-0003ZU-1z
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 13: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 1v5lKn-00Bp9i-2u
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lKn-0061Hb-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 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=r6eV33RmZfvcP+O/QSV2Ci9CnvMGGpHHMJkE5R9aHeo=; b=6q0natbvROmkllNRIG2lSmQ5v8
	HdlsH5bCY800s0OgmlEio0VoLmNcUVkJ/MapIpN8HlqkF/kCl+SS+bYV/ogSVX0SiUUCv7/3B06tO
	1/EQ8FnOBntRAASpPtJ0tWVaDMZftYM3AaN/snpxjQDVwlsyGeDqTbi4TkDXvqV9PwFM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/configure: Introduce deps on json-c lib for libxl
Message-Id: <E1v5lKn-0061Hb-2l@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:33:01 +0000

commit bb3da1c885ffe5c5262cb94ab118a1b570216254
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:49 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:28:43 2025 +0100

    tools/configure: Introduce deps on json-c lib for libxl
    
    To replace yajl.
    
    Introduce XEN_JSON_LIBS variable, to be able to remove "-lyajl" later.
    
    As a first step, the variable will have both or only -lyajl. Then
    commit "configure: Use json-c by default, fallback to yajl" will make
    a change to only have one or the other once the code is ready to build
    with only json-c.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 config/Tools.mk.in        |   1 +
 tools/config.h.in         |   3 ++
 tools/configure           | 107 +++++++++++++++++++++++++++++++++++++++++++++-
 tools/configure.ac        |   6 ++-
 tools/libs/light/Makefile |   4 +-
 tools/xl/Makefile         |   2 +-
 6 files changed, 117 insertions(+), 6 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index e47ac23d11..0037ad5a64 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -65,6 +65,7 @@ EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
 TINFO_LIBS          := @TINFO_LIBS@
 ARGP_LDFLAGS        := @argp_ldflags@
+XEN_JSON_LIBS       := @YAJL_LIBS@ @libjsonc_LIBS@
 
 FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
 
diff --git a/tools/config.h.in b/tools/config.h.in
index fe2a94cfc4..ed0042018d 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -27,6 +27,9 @@
 /* Define to 1 if you have the `fdt' library (-lfdt). */
 #undef HAVE_LIBFDT
 
+/* Use library json-c */
+#undef HAVE_LIBJSONC
+
 /* Define to 1 if you have the `lzma' library (-llzma). */
 #undef HAVE_LIBLZMA
 
diff --git a/tools/configure b/tools/configure
index 5abd44e21e..edd1701b2d 100755
--- a/tools/configure
+++ b/tools/configure
@@ -660,6 +660,9 @@ libnl
 LIBNL3_LIBS
 LIBNL3_CFLAGS
 argp_ldflags
+YAJL_LIBS
+libjsonc_LIBS
+libjsonc_CFLAGS
 PTHREAD_LIBS
 PTHREAD_LDFLAGS
 PTHREAD_CFLAGS
@@ -882,6 +885,8 @@ pixman_CFLAGS
 pixman_LIBS
 libzstd_CFLAGS
 libzstd_LIBS
+libjsonc_CFLAGS
+libjsonc_LIBS
 LIBNL3_CFLAGS
 LIBNL3_LIBS
 SYSTEMD_SLEEP_DIR'
@@ -1633,6 +1638,10 @@ Some influential environment variables:
               C compiler flags for libzstd, overriding pkg-config
   libzstd_LIBS
               linker flags for libzstd, overriding pkg-config
+  libjsonc_CFLAGS
+              C compiler flags for libjsonc, overriding pkg-config
+  libjsonc_LIBS
+              linker flags for libjsonc, overriding pkg-config
   LIBNL3_CFLAGS
               C compiler flags for LIBNL3, overriding pkg-config
   LIBNL3_LIBS linker flags for LIBNL3, overriding pkg-config
@@ -9624,6 +9633,99 @@ printf "%s\n" "$ax_cv_pthread_flags" >&6; }
 
 
 
+
+pkg_failed=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libjsonc" >&5
+printf %s "checking for libjsonc... " >&6; }
+
+if test -n "$libjsonc_CFLAGS"; then
+    pkg_cv_libjsonc_CFLAGS="$libjsonc_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$libjsonc_LIBS"; then
+    pkg_cv_libjsonc_LIBS="$libjsonc_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1`
+        else
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$libjsonc_PKG_ERRORS" >&5
+
+	as_fn_error $? "Package requirements (json-c) were not met:
+
+$libjsonc_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables libjsonc_CFLAGS
+and libjsonc_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+	{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables libjsonc_CFLAGS
+and libjsonc_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	libjsonc_CFLAGS=$pkg_cv_libjsonc_CFLAGS
+	libjsonc_LIBS=$pkg_cv_libjsonc_LIBS
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h
+
+fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 printf %s "checking for yajl_alloc in -lyajl... " >&6; }
 if test ${ac_cv_lib_yajl_yajl_alloc+y}
@@ -9661,9 +9763,10 @@ fi
 printf "%s\n" "$ac_cv_lib_yajl_yajl_alloc" >&6; }
 if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes
 then :
-  printf "%s\n" "#define HAVE_LIBYAJL 1" >>confdefs.h
+  YAJL_LIBS=-lyajl
+
 
-  LIBS="-lyajl $LIBS"
+printf "%s\n" "#define HAVE_LIBYAJL 1" >>confdefs.h
 
 else $as_nop
   as_fn_error $? "Could not find yajl" "$LINENO" 5
diff --git a/tools/configure.ac b/tools/configure.ac
index dada1c3b15..bb40b5b3f0 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -424,7 +424,11 @@ AC_SUBST([ZLIB_CFLAGS])
 AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
-AC_CHECK_LIB([yajl], [yajl_alloc], [],
+PKG_CHECK_MODULES([libjsonc], [json-c],
+    [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])])
+AC_CHECK_LIB([yajl], [yajl_alloc],
+   [AC_SUBST([YAJL_LIBS],[-lyajl])
+    AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' library (-lyajl).])],
     [AC_MSG_ERROR([Could not find yajl])])
 AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
 AC_CHECK_HEADER([argp.h], [
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index b690d92159..c05d89db33 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -166,7 +166,7 @@ LDLIBS-$(CONFIG_Linux) += -luuid
 LDLIBS-$(CONFIG_Linux) += -lrt
 LDLIBS-$(CONFIG_ARM) += -lfdt
 LDLIBS-y += $(PTHREAD_LIBS)
-LDLIBS-y += -lyajl
+LDLIBS-y += $(XEN_JSON_LIBS)
 LDLIBS += $(LDLIBS-y)
 
 $(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
@@ -246,7 +246,7 @@ libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS)
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
 
 test_%: test_%.o test_common.o libxenlight_test.so
-	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(XEN_JSON_LIBS) $(APPEND_LDFLAGS)
 
 libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index ad577cdd70..973ff0e1a2 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -33,7 +33,7 @@ $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs i
 all: xl
 
 xl: $(XL_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(XEN_JSON_LIBS) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:33:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138189.1473933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lKy-0003bP-ST; Mon, 06 Oct 2025 13:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138189.1473933; Mon, 06 Oct 2025 13: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 1v5lKy-0003bI-Po; Mon, 06 Oct 2025 13:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1138189;
 Mon, 06 Oct 2025 13: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 1v5lKy-0003bA-0r
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 13: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 1v5lKx-00Bp9u-3C
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lKx-0061Iv-35
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 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=CEDB7JIioXlUYX/VF26DMI2kUv+VU1UsrMD4Q4UsX7w=; b=w48PGeZ/so7UQiS3t/gHF0PvVs
	Qf1dLQoBCpE/byxvEaD9YZ5DKm/6LfEDZSLpam6cP1j2eUDTyiS7avty065O9wknfzAQMtapWRKzW
	kvCfGLie4Vazn37GRiaEzWaLeU/+yzJ1iBCXIWimrRnjRssIe/DixDWNb19Vp93VT5y8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: Convert libxl__json_parse() to use json-c
Message-Id: <E1v5lKx-0061Iv-35@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:33:11 +0000

commit 7e95dab9eb63669465634fe51612c612398aeb17
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:50 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:28:43 2025 +0100

    libxl: Convert libxl__json_parse() to use json-c
    
    This reuse the "json_callback_*" implemented for the yajl parser as
    they don't really need to be changed. It's just awkward to have to
    cast between `unsigned char` and `char.`
    
    Replace few strncpy() by memcpy() to let the compiler know we want to
    copy the string without the terminating nul, as we are adding it just
    after.
    
    Also, it should be possible to keep using YAJL parser when json-c
    library isn't available.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/include/libxl_json.h    |   4 ++
 tools/libs/light/libxl_json.c | 120 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/tools/include/libxl_json.h b/tools/include/libxl_json.h
index 3f97267eae..f0b4871e0e 100644
--- a/tools/include/libxl_json.h
+++ b/tools/include/libxl_json.h
@@ -42,6 +42,7 @@ yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p);
 #  define HAVE_YAJL_V2 1
 #endif
 
+#ifdef HAVE_LIBYAJL
 #ifdef HAVE_YAJL_V2
 
 typedef size_t libxl_yajl_length;
@@ -89,5 +90,8 @@ static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 }
 
 #endif /* !HAVE_YAJL_V2 */
+#else
+typedef size_t libxl_yajl_length;
+#endif /* !HAVE_LIBYAJL */
 
 #endif /* LIBXL_JSON_H */
diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index 9b8ef2cab9..44ee6e213f 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -16,7 +16,25 @@
 
 #include <math.h>
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+#define USE_LIBJSONC_PARSER
+#endif
+
+#ifdef HAVE_LIBYAJL
+#  ifndef USE_LIBJSONC_PARSER
+#    define USE_LIBYAJL_PARSER
+#  endif
+#endif
+
+
+#ifdef USE_LIBJSONC_PARSER
+#include <json-c/json_visit.h>
+#endif
+
+#ifdef USE_LIBYAJL_PARSER
 #include <yajl/yajl_parse.h>
+#endif
 #include <yajl/yajl_gen.h>
 
 #include "libxl_internal.h"
@@ -25,7 +43,9 @@
 
 typedef struct libxl__yajl_ctx {
     libxl__gc *gc;
+#ifdef USE_LIBYAJL_PARSER
     yajl_handle hand;
+#endif
     libxl__json_object *head;
     libxl__json_object *current;
 #ifdef DEBUG_ANSWER
@@ -33,7 +53,7 @@ typedef struct libxl__yajl_ctx {
 #endif
 } libxl__yajl_ctx;
 
-#ifdef DEBUG_ANSWER
+#if defined(DEBUG_ANSWER) && defined(USE_LIBYAJL_PARSER)
 #if YAJL_VERSION < 20000
 #  define DEBUG_GEN_ALLOC(ctx)                  \
     if ((ctx)->g == NULL) {                     \
@@ -759,7 +779,7 @@ error:
     obj = libxl__json_object_alloc(ctx->gc, JSON_NUMBER);
 
     t = libxl__zalloc(ctx->gc, len + 1);
-    strncpy(t, s, len);
+    memcpy(t, s, len);
     t[len] = 0;
 
     obj->u.string = t;
@@ -806,7 +826,7 @@ static int json_callback_map_key(void *opaque, const unsigned char *str,
 
     DEBUG_GEN_STRING(ctx, str, len);
 
-    strncpy(t, (const char *) str, len);
+    memcpy(t, (const char *) str, len);
     t[len] = 0;
 
     if (libxl__json_object_is_map(obj)) {
@@ -890,6 +910,7 @@ static int json_callback_end_array(void *opaque)
     return 1;
 }
 
+#ifdef USE_LIBYAJL_PARSER
 static yajl_callbacks callbacks = {
     json_callback_null,
     json_callback_boolean,
@@ -903,28 +924,111 @@ static yajl_callbacks callbacks = {
     json_callback_start_array,
     json_callback_end_array
 };
+#endif
 
 static void yajl_ctx_free(libxl__yajl_ctx *yajl_ctx)
 {
+#ifdef USE_LIBYAJL_PARSER
     if (yajl_ctx->hand) {
         yajl_free(yajl_ctx->hand);
         yajl_ctx->hand = NULL;
     }
+#endif
     DEBUG_GEN_FREE(yajl_ctx);
 }
 
+#ifdef USE_LIBJSONC_PARSER
+static int jso_visiter(json_object *jso,
+                       int flags,
+                       json_object *parent_jso,
+                       const char *jso_key,
+                       size_t *jso_index,
+                       void *userarg)
+{
+    enum json_type type;
+    int r;
+
+    if (jso_key && flags != JSON_C_VISIT_SECOND) {
+        json_callback_map_key(userarg, (const unsigned char*)jso_key, strlen(jso_key));
+    }
+    type = json_object_get_type(jso);
+    switch (type) {
+    case json_type_null:
+        r = json_callback_null(userarg);
+        break;
+    case json_type_boolean:
+        r = json_callback_boolean(userarg, json_object_get_boolean(jso));
+        break;
+    case json_type_int:
+    case json_type_double: {
+        // it might be better to use on of
+        // json_object_get_{int,int64,uint64,double} instead.
+        // but would need to replace json_callback_number().
+        const char *s = json_object_get_string(jso);
+        r = json_callback_number(userarg, s, strlen(s));
+        break;
+    }
+    case json_type_object:
+        if (flags != JSON_C_VISIT_SECOND) {
+            r = json_callback_start_map(userarg);
+        } else {
+            r = json_callback_end_map(userarg);
+        }
+        break;
+    case json_type_array:
+        if (flags != JSON_C_VISIT_SECOND) {
+            r = json_callback_start_array(userarg);
+        } else {
+            r = json_callback_end_array(userarg);
+        }
+        break;
+    case json_type_string: {
+        const char *s = json_object_get_string(jso);
+        const int len = json_object_get_string_len(jso);
+        r = json_callback_string(userarg, (const unsigned char*)s, len);
+        break;
+    }
+    default:
+        /* error */
+        r = 0;
+    }
+    if (r == 0)
+        return JSON_C_VISIT_RETURN_ERROR;
+    return JSON_C_VISIT_RETURN_CONTINUE;
+}
+#endif
+
 libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
 {
+#ifdef USE_LIBYAJL_PARSER
     yajl_status status;
+    unsigned char *str = NULL;
+#endif
     libxl__yajl_ctx yajl_ctx;
     libxl__json_object *o = NULL;
-    unsigned char *str = NULL;
+#ifdef USE_LIBJSONC_PARSER
+    json_object *jso;
+    enum json_tokener_error error;
+
+    jso = json_tokener_parse_verbose(s, &error);
+    if (!jso) {
+        LOG(ERROR, "json-c parse error: %s", json_tokener_error_desc(error));
+        goto out;
+    }
+#endif
 
     memset(&yajl_ctx, 0, sizeof (yajl_ctx));
     yajl_ctx.gc = gc;
 
     DEBUG_GEN_ALLOC(&yajl_ctx);
 
+#ifdef USE_LIBJSONC_PARSER
+    int r = json_c_visit(jso, 0, jso_visiter, &yajl_ctx);
+    if (r < 0) {
+        LOG(ERROR, "json_c_visit failed");
+        goto out;
+    }
+#elif defined(USE_LIBYAJL_PARSER)
     if (yajl_ctx.hand == NULL) {
         yajl_ctx.hand = libxl__yajl_alloc(&callbacks, NULL, &yajl_ctx);
     }
@@ -935,6 +1039,7 @@ libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
     status = yajl_complete_parse(yajl_ctx.hand);
     if (status != yajl_status_ok)
         goto out;
+#endif
 
     o = yajl_ctx.head;
 
@@ -943,13 +1048,20 @@ libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
     yajl_ctx.head = NULL;
 
     yajl_ctx_free(&yajl_ctx);
+#ifdef USE_LIBJSONC_PARSER
+    json_object_put(jso);
+#endif
     return o;
 
 out:
+#ifdef USE_LIBJSONC_PARSER
+    json_object_put(jso);
+#elif defined(USE_LIBYAJL_PARSER)
     str = yajl_get_error(yajl_ctx.hand, 1, (const unsigned char*)s, strlen(s));
 
     LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR, "yajl error: %s", str);
     yajl_free_error(yajl_ctx.hand, str);
+#endif
     yajl_ctx_free(&yajl_ctx);
     return NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:33:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138190.1473936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lL8-0003dz-UN; Mon, 06 Oct 2025 13:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138190.1473936; Mon, 06 Oct 2025 13: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 1v5lL8-0003dr-RJ; Mon, 06 Oct 2025 13:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1138190;
 Mon, 06 Oct 2025 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 1v5lL8-0003dj-46
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 13: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 1v5lL8-00BpA7-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lL8-0061Jr-0C
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MOraIAb8tMnb1EdeCqmTNwOE17KZW9RYJ3Sp/KcLcWA=; b=v4mMa8Sr3XOuQx+YgDwVplji4+
	8FYfS4WhK9xHydPKQ5DVn5VUCIsb3QUnzhpegBeAw+ShzVyce/7RzgqvUfGXJThd0OrznavHBqGzA
	xWUBNQWq2muCrT+ojs/wQ0hPMY2QsN4pNTn1ddwt4ZIhl06gHDvbvc1EiXLuHPhZJ8RA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: Convert libxl__json_object_to_yajl_gen to libxl__json_object_to_libjsonc_object
Message-Id: <E1v5lL8-0061Jr-0C@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:33:22 +0000

commit a6fd4a1c55dde987049b803a4ffc718484ca9524
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:51 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:44 2025 +0100

    libxl: Convert libxl__json_object_to_yajl_gen to libxl__json_object_to_libjsonc_object
    
    Convert yajl_gen to json_object from lib json-c.
    
    And make use of it in qmp_prepare_cmd(), which can be compiled with
    either lib.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/include/libxl_json.h        |   6 +++
 tools/libs/light/libxl_internal.h |   7 +++
 tools/libs/light/libxl_json.c     | 100 ++++++++++++++++++++++++++++++++++++++
 tools/libs/light/libxl_qmp.c      |  53 ++++++++++++++++++++
 4 files changed, 166 insertions(+)

diff --git a/tools/include/libxl_json.h b/tools/include/libxl_json.h
index f0b4871e0e..e2ef8151f0 100644
--- a/tools/include/libxl_json.h
+++ b/tools/include/libxl_json.h
@@ -15,12 +15,18 @@
 #ifndef LIBXL_JSON_H
 #define LIBXL_JSON_H
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+#endif
+
+#ifdef HAVE_LIBYAJL
 #include <yajl/yajl_gen.h>
 #include <yajl/yajl_parse.h>
 
 #ifdef HAVE_YAJL_YAJL_VERSION_H
 #  include <yajl/yajl_version.h>
 #endif
+#endif
 
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 062123eed4..5204cb8889 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -2234,9 +2234,16 @@ _hidden const libxl__json_object *libxl__json_map_get(const char *key,
  */
 _hidden libxl__json_object *libxl__json_object_alloc(libxl__gc *gc_opt,
                                                      libxl__json_node_type type);
+#ifdef HAVE_LIBJSONC
+_hidden int libxl__json_object_to_json_object(libxl__gc *gc,
+                                              json_object **jso_out,
+                                              const libxl__json_object *obj);
+#endif
+#ifdef HAVE_LIBYAJL
 _hidden yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc_opt,
                                                    yajl_gen hand,
                                                    const libxl__json_object *param);
+#endif
 _hidden void libxl__json_object_free(libxl__gc *gc_opt,
                                      libxl__json_object *obj);
 
diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index 44ee6e213f..75b383ee14 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -631,6 +631,105 @@ const libxl__json_object *libxl__json_map_get(const char *key,
     return NULL;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__json_object_to_json_object(libxl__gc *gc,
+                                      json_object **jso_out,
+                                      const libxl__json_object *obj)
+{
+    int idx = 0;
+    int rc, r;
+
+    switch (obj->type) {
+    case JSON_NULL:
+        *jso_out = json_object_new_null();
+        return 0;
+    case JSON_BOOL:
+        *jso_out = json_object_new_boolean(obj->u.b);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_INTEGER:
+        *jso_out = json_object_new_int64(obj->u.i);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_DOUBLE:
+        *jso_out = json_object_new_double(obj->u.d);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_NUMBER:
+        /*
+         * Use json_object_new_double_s() to rewrite the number exactly as
+         * we parsed it. When generating the JSON string the value `0` will
+         * be ignored and `obj->u.string` will be written instead.
+         */
+        *jso_out = json_object_new_double_s(0, obj->u.string);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_STRING:
+        *jso_out = json_object_new_string(obj->u.string);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_MAP: {
+        libxl__json_map_node *node = NULL;
+        json_object *map_root = json_object_new_object();
+        json_object *node_value;
+
+        for (idx = 0; idx < obj->u.map->count; idx++) {
+            if (flexarray_get(obj->u.map, idx, (void**)&node) != 0)
+                break;
+
+            rc = libxl__json_object_to_json_object(gc, &node_value, node->obj);
+            if (rc) {
+                json_object_put(map_root);
+                return rc;
+            }
+
+            r = json_object_object_add(map_root, node->map_key, node_value);
+            if (r < 0) {
+                json_object_put(node_value);
+                json_object_put(map_root);
+                return ERROR_FAIL;
+            }
+        }
+        *jso_out = map_root;
+        return 0;
+    }
+    case JSON_ARRAY: {
+        libxl__json_object *node = NULL;
+        json_object *array_root = json_object_new_array_ext(obj->u.array->count);
+        json_object *node_value;
+
+        for (idx = 0; idx < obj->u.array->count; idx++) {
+            if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
+                break;
+
+            rc = libxl__json_object_to_json_object(gc, &node_value, node);
+            if (rc) {
+                json_object_put(array_root);
+                return rc;
+            }
+            r = json_object_array_add(array_root, node_value);
+            if (r < 0) {
+                json_object_put(node_value);
+                json_object_put(array_root);
+                return ERROR_FAIL;
+            }
+        }
+        *jso_out = array_root;
+        return 0;
+    }
+    case JSON_ANY:
+    default:
+        /* JSON_ANY is not a valid value for obj->type. */
+        return ERROR_FAIL;
+    }
+}
+#endif
+#ifdef HAVE_LIBYAJL
 yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
                                            yajl_gen hand,
                                            const libxl__json_object *obj)
@@ -698,6 +797,7 @@ yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
     abort();
 #undef CONVERT_YAJL_GEN_TO_STATUS
 }
+#endif
 
 
 /*
diff --git a/tools/libs/light/libxl_qmp.c b/tools/libs/light/libxl_qmp.c
index 84740bd4b3..94b6fdb559 100644
--- a/tools/libs/light/libxl_qmp.c
+++ b/tools/libs/light/libxl_qmp.c
@@ -61,7 +61,11 @@
 
 #include <sys/un.h>
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+#elif defined(HAVE_LIBYAJL)
 #include <yajl/yajl_gen.h>
+#endif
 
 #include "xen_list.h"
 #include "libxl_internal.h"
@@ -481,13 +485,56 @@ static char *qmp_prepare_cmd(libxl__gc *gc, const char *cmd,
                              const libxl__json_object *args,
                              int id)
 {
+#ifdef HAVE_LIBJSONC
+    json_object *jso = NULL;
+    json_object *jso_value = NULL;
+    /* memory for 'buf' is owned by 'jso' */
+    const char *buf;
+    int rc, r;
+#elif defined(HAVE_LIBYAJL)
     yajl_gen hand = NULL;
     /* memory for 'buf' is owned by 'hand' */
     const unsigned char *buf;
     libxl_yajl_length len;
     yajl_gen_status s;
+#else
+#  error Missing JSON library
+#endif
     char *ret = NULL;
 
+#ifdef HAVE_LIBJSONC
+    jso = json_object_new_object();
+    if (!jso)
+        goto out;
+
+    jso_value = json_object_new_string(cmd);
+    if (!jso_value)
+        goto out;
+    r = json_object_object_add(jso, "execute", jso_value);
+    if (r < 0)
+        goto out;
+    jso_value = json_object_new_int(id);
+    if (!jso_value)
+        goto out;
+    r = json_object_object_add(jso, "id", jso_value);
+    if (r < 0)
+        goto out;
+    /* `jso_value` now part of `jso`, shouldn't free it anymore */
+    jso_value = NULL;
+    if (args) {
+        rc = libxl__json_object_to_json_object(gc, &jso_value, args);
+        if (rc)
+            goto out;
+        r = json_object_object_add(jso, "arguments", jso_value);
+        if (r < 0)
+            goto out;
+        jso_value = NULL;
+    }
+
+    buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN);
+    ret = libxl__sprintf(gc, "%s\r\n", buf);
+
+#elif defined(HAVE_LIBYAJL)
     hand = libxl_yajl_gen_alloc(NULL);
 
     if (!hand) {
@@ -516,9 +563,15 @@ static char *qmp_prepare_cmd(libxl__gc *gc, const char *cmd,
         goto out;
 
     ret = libxl__sprintf(gc, "%*.*s\r\n", (int)len, (int)len, buf);
+#endif
 
 out:
+#ifdef HAVE_LIBJSONC
+    json_object_put(jso_value);
+    json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
     yajl_gen_free(hand);
+#endif
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138191.1473941 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lLJ-0003gr-1m; Mon, 06 Oct 2025 13:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138191.1473941; Mon, 06 Oct 2025 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 1v5lLI-0003gk-Ux; Mon, 06 Oct 2025 13:33:32 +0000
Received: by outflank-mailman (input) for mailman id 1138191;
 Mon, 06 Oct 2025 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 1v5lLI-0003ge-7c
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 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 1v5lLI-00BpAI-0e
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lLI-0061Kj-0Y
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gbx4UWcEVBSkNVmSIRrrJdjvLsJ13DT56PmVDQnZefQ=; b=yjafDOY3UUeKi0eudRkSKZziMf
	68BQ9bqEn0fD8sOHgXkArsRqrlzKXoOzEw2XcRA2vgocd758xo4CN1OUR8P+IC423t0E232j54sH/
	1YEhusAyTlMaEUvVcZ+fh8SbkblbTgl8Lv+y8cWwzCXS+1a+c688u3k6uZOo5txpcO0E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: Convert libxl__object_to_json() to json-c
Message-Id: <E1v5lLI-0061Kj-0Y@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:33:32 +0000

commit f6c6f2679d49ee0a7663c087128524b60391b2dd
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:52 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:50 2025 +0100

    libxl: Convert libxl__object_to_json() to json-c
    
    - libxl changes:
    
    While doing so, we rename all "*_gen_json" function to "*_gen_jso" as
    they have different prototype. All the function pointer are been cast
    to (libxl__gen_json_callback) by "gentypes.py" when generating
    "*_to_json()" functions.
    
    We also introduce a few more "*_gen_jso" functions for "int" and
    "bool" because we can't use json_object_*() functions from json-c
    directly like it's done with yajl.
    
    To make the generation of _libxl_types*json.[ch] with both YAJL and
    json-c we add "--libjsonc" to gentypes.py so it can generate
    functions/types for both.
    
    Also introducing "jsonc_json_gen_fn" in the IDL, to be able to point
    to a different function when using json-c.
    
    Also, don't export any of the new *_gen_jso() function, at the cost of
    having "_hidden" macro in semi-public headers.
    
    - xl changes:
    
    Also, rework the implementation of printf_info() in `xl` to avoid
    using libxl_domain_config_gen_json() which isn't available without
    YAJL. The implementation using "json_object" call
    libxl_domain_config_to_json() which generate a plain string of JSON,
    which we parse to add it to our own json; this avoid a dependency on
    the json library used by libxl.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/include/libxl_json.h                |  17 ++
 tools/libs/light/Makefile                 |   2 +-
 tools/libs/light/gentypes.py              | 160 ++++++++++++++-
 tools/libs/light/idl.py                   |   7 +-
 tools/libs/light/libxl_cpuid.c            | 119 +++++++++++
 tools/libs/light/libxl_internal.h         |  16 +-
 tools/libs/light/libxl_json.c             | 316 ++++++++++++++++++++++++++++++
 tools/libs/light/libxl_types.idl          |   7 +-
 tools/libs/light/libxl_types_internal.idl |   3 +-
 tools/xl/xl_info.c                        | 102 +++++++++-
 10 files changed, 729 insertions(+), 20 deletions(-)

diff --git a/tools/include/libxl_json.h b/tools/include/libxl_json.h
index e2ef8151f0..c130e88a5e 100644
--- a/tools/include/libxl_json.h
+++ b/tools/include/libxl_json.h
@@ -28,6 +28,22 @@
 #endif
 #endif
 
+#ifdef HAVE_LIBJSONC
+#ifndef _hidden
+#define _hidden
+#endif
+_hidden int libxl__uint64_gen_jso(json_object **jso_r, uint64_t val);
+_hidden int libxl_defbool_gen_jso(json_object **jso_r, libxl_defbool *p);
+_hidden int libxl_uuid_gen_jso(json_object **jso_r, libxl_uuid *p);
+_hidden int libxl_mac_gen_jso(json_object **jso_r, libxl_mac *p);
+_hidden int libxl_bitmap_gen_jso(json_object **jso_r, libxl_bitmap *p);
+_hidden int libxl_cpuid_policy_list_gen_jso(json_object **jso_r,libxl_cpuid_policy_list *p);
+_hidden int libxl_string_list_gen_jso(json_object **jso_r,libxl_string_list *p);
+_hidden int libxl_key_value_list_gen_jso(json_object **jso_r, libxl_key_value_list *p);
+_hidden int libxl_hwcap_gen_jso(json_object **jso_r, libxl_hwcap *p);
+_hidden int libxl_ms_vm_genid_gen_jso(json_object **jso_r, libxl_ms_vm_genid *p);
+#endif
+#if defined(HAVE_LIBYAJL)
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
@@ -40,6 +56,7 @@ yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *p);
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
 yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p);
+#endif
 
 #include <_libxl_types_json.h>
 
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index c05d89db33..bc60c46558 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -226,7 +226,7 @@ testidl.o: $(XEN_INCLUDE)/libxl.h
 # This exploits the 'multi-target pattern rule' trick.
 # gentypes.py should be executed only once to make all the targets.
 _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
-	$(PYTHON) gentypes.py libxl_type$(*F).idl __libxl_type$(*F).h __libxl_type$(*F)_private.h \
+	$(PYTHON) gentypes.py $(if $(filter -ljson-c,$(XEN_JSON_LIBS)),--libjsonc) libxl_type$(*F).idl __libxl_type$(*F).h __libxl_type$(*F)_private.h \
 		__libxl_type$(*F)_json.h  __libxl_type$(*F).c
 	$(call move-if-changed,__libxl_type$(*F).h,_libxl_type$(*F).h)
 	$(call move-if-changed,__libxl_type$(*F)_private.h,_libxl_type$(*F)_private.h)
diff --git a/tools/libs/light/gentypes.py b/tools/libs/light/gentypes.py
index 3fe3873242..006bea170a 100644
--- a/tools/libs/light/gentypes.py
+++ b/tools/libs/light/gentypes.py
@@ -256,6 +256,30 @@ def libxl_C_type_member_init(ty, field):
     s += "\n"
     return s
 
+# For json-c gen_jso functions
+def libxl_C_type_gen_jso_map_key(f, parent, indent, scope_object, sub_scope_object):
+    s = ""
+    if isinstance(f.type, idl.KeyedUnion):
+        s += "switch (%s) {\n" % (parent + f.type.keyvar.name)
+        for x in f.type.fields:
+            v = f.type.keyvar.name + "." + x.name
+            s += "case %s:\n" % x.enumname
+            s += "    if (json_object_object_add(%s, \"%s\", %s)) {\n" % (scope_object, v, sub_scope_object)
+            s += "        json_object_put(%s);\n" % (sub_scope_object)
+            s += "        goto out;\n"
+            s += "    }\n"
+            s += "    break;\n"
+        s += "}\n"
+    else:
+        s += "if (json_object_object_add(%s, \"%s\", %s)) {\n" % (scope_object, f.name, sub_scope_object)
+        s += "    json_object_put(%s);\n" % (sub_scope_object)
+        s += "    goto out;\n"
+        s += "}\n"
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+# For YAJL gen_json functions
 def libxl_C_type_gen_map_key(f, parent, indent = ""):
     s = ""
     if isinstance(f.type, idl.KeyedUnion):
@@ -352,6 +376,86 @@ def get_default_expr(f, nparent, fexpr):
 
     return "%s" % fexpr
 
+# For json-c gen_json functions
+def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "jso"):
+    s = ""
+    if parent is None:
+        s += "json_object *jso;\n"
+        s += "int rc;\n"
+        sub_scope_object = "jso_sub_1"
+    else:
+        sub_scope_object = "jso_sub_%d" % (1+int(scope_object.removeprefix("jso_sub_")))
+
+    if isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    %s = json_object_new_array_ext(%s);\n" % (scope_object, parent + ty.lenvar.name)
+        s += "    if (!%s)\n" % (scope_object)
+        s += "        goto out;\n"
+        s += "    for (i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
+        s += "        json_object *%s;\n" % (sub_scope_object)
+        # remove some indent, it's over indented at least in one case libxl_vcpu_sched_params_gen_json
+        s += libxl_C_type_gen_jso(ty.elem_type, v+"[i]",
+                                   indent + "    ", parent, sub_scope_object)
+        s += "        if (json_object_array_add(%s, %s)) {\n" % (scope_object, sub_scope_object)
+        s += "            json_object_put(%s);\n" % (sub_scope_object)
+        s += "            goto out;\n"
+        s += "        }\n"
+        s += "    }\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Enumeration):
+        s += "rc = libxl__enum_gen_jso(&%s, %s_to_string(%s));\n" % (scope_object, ty.typename, ty.pass_arg(v, parent is None))
+        s += "if (rc)\n"
+        s += "    goto out;\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_gen_jso(f.type, fexpr, indent + "    ", nparent, scope_object)
+            else:
+                s += "    %s = json_object_new_object();\n" % (scope_object)
+                s += "    if (!%s)\n" % (scope_object)
+                s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_gen_fn is None):
+        s += "%s = json_object_new_object();\n" % (scope_object)
+        s += "if (!%s)\n" % (scope_object)
+        s += "    goto out;\n"
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            default_expr = get_default_expr(f, nparent, fexpr)
+            s += "if (%s) {\n" % default_expr
+            s += "    json_object *%s = NULL;\n" % (sub_scope_object)
+            s += libxl_C_type_gen_jso(f.type, fexpr, "    ", nparent, sub_scope_object)
+            s += libxl_C_type_gen_jso_map_key(f, nparent, "    ", scope_object, sub_scope_object)
+
+            s += "}\n"
+
+    else:
+        if ty.json_gen_fn is not None:
+            s += "rc = %s(&%s, %s);\n" % (ty.json_gen_fn, scope_object, ty.pass_arg(v, parent is None))
+            s += "if (rc)\n"
+            s += "    goto out;\n"
+
+    if parent is None:
+        s += "*jso_r = jso;\n"
+        s += "return 0;\n"
+        s += "out:\n"
+        s += "json_object_put(jso);\n"
+        s += "return ERROR_FAIL;\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+# For YAJL gen_json functions
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -426,9 +530,9 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
-def libxl_C_type_to_json(ty, v, indent = "    "):
+def libxl_C_type_to_json(ty, v, indent = "    ", fn_ptr_type="libxl__gen_json_callback", fn_suffix="_gen_json"):
     s = ""
-    gen = "(libxl__gen_json_callback)&%s_gen_json" % ty.typename
+    gen = "(%s)&%s%s" % (fn_ptr_type, ty.typename, fn_suffix)
     s += "return libxl__object_to_json(ctx, \"%s\", %s, (void *)%s);\n" % (ty.typename, gen, ty.pass_arg(v, passby=idl.PASS_BY_REFERENCE))
 
     if s != "":
@@ -589,14 +693,38 @@ def clean_header_define(header_path):
 
 
 if __name__ == '__main__':
+    opt_libjsonc = False
+    if len(sys.argv) == 7:
+        if sys.argv.pop(1) == "--libjsonc":
+            opt_libjsonc = True
     if len(sys.argv) != 6:
         print("Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>", file=sys.stderr)
         sys.exit(1)
 
     (_, idlname, header, header_private, header_json, impl) = sys.argv
 
+    # Overwrite `json_gen_fn` for standard types
+    if opt_libjsonc:
+        idl.bool.json_gen_fn = "libxl__boolean_gen_jso"
+        idl.size_t.json_gen_fn = "libxl__int_gen_jso"
+        idl.integer .json_gen_fn = "libxl__int_gen_jso"
+        idl.uint8.json_gen_fn = "libxl__int_gen_jso"
+        idl.uint16.json_gen_fn = "libxl__int_gen_jso"
+        idl.uint32.json_gen_fn = "libxl__int_gen_jso"
+        idl.uint64.json_gen_fn = "libxl__uint64_gen_jso"
+        idl.string.json_gen_fn = "libxl__string_gen_jso"
+
     (builtins,types) = idl.parse(idlname)
 
+    # Overwrite `json_gen_fn` with `jsonc_json_gen_fn` for types from the IDL
+    if opt_libjsonc:
+        for t in builtins:
+            if t.jsonc_json_gen_fn is not None:
+                t.json_gen_fn = t.jsonc_json_gen_fn
+        for t in types:
+            if t.jsonc_json_gen_fn is not None:
+                t.json_gen_fn = t.jsonc_json_gen_fn
+
     print("outputting libxl type definitions to %s" % header)
 
     f = open(header, "w")
@@ -665,7 +793,11 @@ if __name__ == '__main__':
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
     for ty in [ty for ty in types if ty.json_gen_fn is not None]:
-        f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        if opt_libjsonc:
+            # Always hide JSON generators base on json-c
+            f.write("%sint %s_gen_jso(json_object **jso_r, %s);\n" % ("_hidden ", ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        else:
+            f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
     f.write("""#endif /* %s */\n""" % header_json_define)
@@ -769,15 +901,25 @@ if __name__ == '__main__':
         f.write("\n")
 
     for ty in [t for t in types if t.json_gen_fn is not None]:
-        f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
-        f.write("{\n")
-        f.write(libxl_C_type_gen_json(ty, "p"))
-        f.write("}\n")
-        f.write("\n")
+        if opt_libjsonc:
+            f.write("int %s_gen_jso(json_object **jso_r, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("{\n")
+            f.write(libxl_C_type_gen_jso(ty, "p"))
+            f.write("}\n")
+            f.write("\n")
+        else:
+            f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("{\n")
+            f.write(libxl_C_type_gen_json(ty, "p"))
+            f.write("}\n")
+            f.write("\n")
 
         f.write("char *%s_to_json(libxl_ctx *ctx, %s)\n" % (ty.typename, ty.make_arg("p")))
         f.write("{\n")
-        f.write(libxl_C_type_to_json(ty, "p"))
+        if opt_libjsonc:
+            f.write(libxl_C_type_to_json(ty, "p", fn_ptr_type="libxl__gen_json_callback", fn_suffix="_gen_jso"))
+        else:
+            f.write(libxl_C_type_to_json(ty, "p", fn_ptr_type="libxl__gen_json_callback", fn_suffix="_gen_json"))
         f.write("}\n")
         f.write("\n")
 
diff --git a/tools/libs/light/idl.py b/tools/libs/light/idl.py
index d7367503b4..61c8e14004 100644
--- a/tools/libs/light/idl.py
+++ b/tools/libs/light/idl.py
@@ -79,6 +79,7 @@ class Type(object):
 
         if self.typename is not None and not self.private:
             self.json_gen_fn = kwargs.setdefault('json_gen_fn', self.typename + "_gen_json")
+            self.jsonc_json_gen_fn = kwargs.setdefault('jsonc_json_gen_fn', self.typename + "_gen_jso")
             self.json_parse_type = kwargs.setdefault('json_parse_type', "JSON_ANY")
             if self.namespace is not None:
                 self.json_parse_fn = kwargs.setdefault('json_parse_fn',
@@ -88,6 +89,7 @@ class Type(object):
                                                        self.typename + "_parse_json")
         else:
             self.json_gen_fn = kwargs.setdefault('json_gen_fn', None)
+            self.jsonc_json_gen_fn = kwargs.setdefault('jsonc_json_gen_fn', None)
             self.json_parse_type = kwargs.setdefault('json_parse_type', None)
             self.json_parse_fn = kwargs.setdefault('json_parse_fn', None)
 
@@ -142,6 +144,7 @@ class Number(Builtin):
         kwargs.setdefault('copy_fn', None)
         kwargs.setdefault('signed', False)
         kwargs.setdefault('json_gen_fn', "yajl_gen_integer")
+        kwargs.setdefault('jsonc_json_gen_fn', "libxl__int_gen_jso")
         kwargs.setdefault('json_parse_type', "JSON_INTEGER")
         # json_parse_fn might be overriden on specific type
         kwargs.setdefault('json_parse_fn', "libxl__int_parse_json")
@@ -290,6 +293,7 @@ void = Builtin("void *", namespace = None)
 bool = Builtin("bool", namespace = None,
                copy_fn=None,
                json_gen_fn = "yajl_gen_bool",
+               jsonc_json_gen_fn = "libxl__boolean_gen_jso",
                json_parse_type = "JSON_BOOL",
                json_parse_fn = "libxl__bool_parse_json",
                autogenerate_json = False)
@@ -301,10 +305,11 @@ integer = Number("int", namespace = None, signed = True)
 uint8 = UInt(8)
 uint16 = UInt(16)
 uint32 = UInt(32)
-uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json")
+uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json", jsonc_json_gen_fn = "libxl__uint64_gen_jso")
 
 string = Builtin("char *", namespace = None, copy_fn = "libxl_string_copy", dispose_fn = "free",
                  json_gen_fn = "libxl__string_gen_json",
+                 jsonc_json_gen_fn = "libxl__string_gen_jso",
                  json_parse_type = "JSON_STRING | JSON_NULL",
                  json_parse_fn = "libxl__string_parse_json",
                  autogenerate_json = False,
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index f738e17b19..8420b2465f 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -545,6 +545,124 @@ static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
  * }
  */
 
+#ifdef HAVE_LIBJSONC
+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, libxl_cpuid_policy_list *pl)
+{
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid *cpuid;
+    const struct xc_msr *msr;
+    json_object *jso_outer;
+    json_object *jso_array;
+    int i, j;
+    int r;
+    int rc = ERROR_FAIL;
+
+    jso_outer = json_object_new_object();
+    if (!jso_outer) goto out;
+
+    jso_array = json_object_new_array();
+    if (!jso_array) goto out;
+
+    r = json_object_object_add(jso_outer, "cpuid", jso_array);
+    if (r < 0) {
+        json_object_put(jso_array);
+        goto out;
+    }
+
+    if (policy == NULL || policy->cpuid == NULL) goto empty;
+    cpuid = policy->cpuid;
+
+    for (i = 0; cpuid[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
+        json_object *jso_inner;
+        jso_inner = json_object_new_object();
+        if (!jso_inner) goto out;
+
+        r = json_object_array_add(jso_array, jso_inner);
+        if (r < 0) {
+            json_object_put(jso_inner);
+            goto out;
+        }
+
+        for (j = 0; j < 2; j++) {
+            if (cpuid[i].input[j] != XEN_CPUID_INPUT_UNUSED) {
+                json_object *jso_value = json_object_new_int(cpuid[i].input[j]);
+                if (!jso_value) goto out;
+                r = json_object_object_add(jso_inner, input_names[j], jso_value);
+                if (r < 0) {
+                    json_object_put(jso_value);
+                    goto out;
+                }
+            }
+        }
+
+        for (j = 0; j < 4; j++) {
+            if (cpuid[i].policy[j] != NULL) {
+                json_object *jso_value = json_object_new_string_len(cpuid[i].policy[j], 32);
+                if (!jso_value) goto out;
+                r = json_object_object_add(jso_inner, policy_names[j], jso_value);
+                if (r < 0) {
+                    json_object_put(jso_value);
+                    goto out;
+                }
+            }
+        }
+    }
+
+empty:
+
+    jso_array = json_object_new_array();
+    if (!jso_array) goto out;
+
+    r = json_object_object_add(jso_outer, "msr", jso_array);
+    if (r < 0) {
+        json_object_put(jso_array);
+        goto out;
+    }
+
+    if (!policy || !policy->msr) goto done;
+    msr = policy->msr;
+
+    for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
+        json_object *jso_inner;
+        json_object *jso_value;
+
+        jso_inner = json_object_new_object();
+        if (!jso_inner) goto out;
+
+        r = json_object_array_add(jso_array, jso_inner);
+        if (r < 0) {
+            json_object_put(jso_inner);
+            goto out;
+        }
+
+        jso_value = json_object_new_int(msr[i].index);
+        if (!jso_value) goto out;
+        r = json_object_object_add(jso_inner, "index", jso_value);
+        if (r < 0) {
+            json_object_put(jso_value);
+            goto out;
+        }
+
+        jso_value = json_object_new_string_len(msr[i].policy, 64);
+        if (!jso_value) goto out;
+        r = json_object_object_add(jso_inner, "policy", jso_value);
+        if (r < 0) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+
+done:
+    *jso_r = jso_outer;
+    jso_outer = NULL;
+    rc = 0;
+out:
+    json_object_put(jso_outer);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pl)
 {
@@ -630,6 +748,7 @@ done:
 out:
     return s;
 }
+#endif
 
 int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         const libxl__json_object *o,
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 5204cb8889..b65e0064b9 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -1993,9 +1993,11 @@ _hidden char *libxl__cpupoolid_to_name(libxl__gc *gc, uint32_t poolid);
 _hidden int libxl__enum_from_string(const libxl_enum_string_table *t,
                                     const char *s, int *e) NN(2);
 
-_hidden yajl_gen_status libxl__string_gen_json(yajl_gen hand, const char *p);
-
+#ifdef HAVE_LIBJSONC
+typedef int (*libxl__gen_json_callback)(json_object **jso_r, void *);
+#elif defined(HAVE_LIBYAJL)
 typedef yajl_gen_status (*libxl__gen_json_callback)(yajl_gen hand, void *);
+#endif
 _hidden char *libxl__object_to_json(libxl_ctx *ctx, const char *type,
                                     libxl__gen_json_callback gen, void *p);
 
@@ -2084,11 +2086,21 @@ int libxl__recvmsg_fds(libxl__gc *gc, int carrier,
                        void *databuf, size_t datalen,
                        int nfds, int fds[], const char *what);
 
+#ifdef HAVE_LIBJSONC
+_hidden int libxl__enum_gen_jso(json_object **jso_r, const char *str);
+_hidden int libxl__int_gen_jso(json_object **jso_r, int i);
+_hidden int libxl__boolean_gen_jso(json_object **jso_r, bool b);
+_hidden int libxl__string_gen_jso(json_object **jso_r, const char *p);
+#endif
+
+#ifdef HAVE_LIBYAJL
 /* from libxl_json */
 #include <yajl/yajl_gen.h>
 
 _hidden yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str);
 _hidden yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str);
+_hidden yajl_gen_status libxl__string_gen_json(yajl_gen hand, const char *p);
+#endif
 
 typedef enum {
     JSON_NULL    = (1 << 0),
diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index 75b383ee14..eeda9c301d 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -19,12 +19,16 @@
 #ifdef HAVE_LIBJSONC
 #include <json-c/json.h>
 #define USE_LIBJSONC_PARSER
+#define USE_LIBJSONC_GEN
 #endif
 
 #ifdef HAVE_LIBYAJL
 #  ifndef USE_LIBJSONC_PARSER
 #    define USE_LIBYAJL_PARSER
 #  endif
+#  ifndef USE_LIBJSONC_GEN
+#    define USE_LIBYAJL_GEN
+#  endif
 #endif
 
 
@@ -35,7 +39,9 @@
 #ifdef USE_LIBYAJL_PARSER
 #include <yajl/yajl_parse.h>
 #endif
+#ifdef USE_LIBYAJL_GEN
 #include <yajl/yajl_gen.h>
+#endif
 
 #include "libxl_internal.h"
 
@@ -103,6 +109,21 @@ yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str)
     return yajl_gen_string(hand, (const unsigned char *)str, strlen(str));
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__enum_gen_jso(json_object **jso_r, const char *str)
+{
+    if (str) {
+        *jso_r = json_object_new_string(str);
+        if (!*jso_r)
+            return ERROR_FAIL;
+    } else {
+        *jso_r = json_object_new_null();
+    }
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str)
 {
     if (str)
@@ -110,15 +131,28 @@ yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str)
     else
         return yajl_gen_null(hand);
 }
+#endif
 
 /*
  * YAJL generators for builtin libxl types.
  */
+#ifdef HAVE_LIBJSONC
+int libxl_defbool_gen_jso(json_object **jso_r, libxl_defbool *db)
+{
+    *jso_r = json_object_new_string(libxl_defbool_to_string(*db));
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
                                        libxl_defbool *db)
 {
     return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
 }
+#endif
 
 int libxl__defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
                               libxl_defbool *p)
@@ -145,6 +179,16 @@ int libxl__defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__boolean_gen_jso(json_object **jso_r, bool b)
+{
+    *jso_r = json_object_new_boolean(b);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
 int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
                            bool *p)
 {
@@ -156,6 +200,19 @@ int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_uuid_gen_jso(json_object **jso_r, libxl_uuid *uuid)
+{
+    char buf[LIBXL_UUID_FMTLEN+1];
+    snprintf(buf, sizeof(buf), LIBXL_UUID_FMT, LIBXL_UUID_BYTES((*uuid)));
+    *jso_r = json_object_new_string_len(buf, LIBXL_UUID_FMTLEN);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
@@ -163,6 +220,7 @@ yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
     snprintf(buf, sizeof(buf), LIBXL_UUID_FMT, LIBXL_UUID_BYTES((*uuid)));
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_UUID_FMTLEN);
 }
+#endif
 
 int libxl__uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
                            libxl_uuid *p)
@@ -173,6 +231,39 @@ int libxl__uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return libxl_uuid_from_string(p, o->u.string);
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_bitmap_gen_jso(json_object **jso_r, libxl_bitmap *bitmap)
+{
+    json_object *jso;
+    int i;
+    int r;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array();
+    if (!jso) goto out;
+
+    libxl_for_each_bit(i, *bitmap) {
+        if (libxl_bitmap_test(bitmap, i)) {
+            json_object *jso_value = json_object_new_int(i);
+            if (!jso_value) goto out;
+            r = json_object_array_add(jso, jso_value);
+            if (r) {
+                json_object_put(jso_value);
+                goto out;
+            }
+        }
+    }
+
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand,
                                       libxl_bitmap *bitmap)
 {
@@ -192,6 +283,7 @@ yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand,
 out:
     return s;
 }
+#endif
 
 int libxl__bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
                             libxl_bitmap *p)
@@ -227,6 +319,42 @@ int libxl__bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_key_value_list_gen_jso(json_object **jso_r, libxl_key_value_list *pkvl)
+{
+    libxl_key_value_list kvl = *pkvl;
+    json_object *jso;
+    int i;
+
+    jso = json_object_new_object();
+    if (!jso) goto out;
+
+    if (!kvl) goto empty;
+
+    for (i = 0; kvl[i] != NULL; i += 2) {
+        json_object *jso_value;
+        if (kvl[i + 1]) {
+            jso_value = json_object_new_string(kvl[i+1]);
+            if (!jso_value) goto out;
+        } else {
+            jso_value = json_object_new_null();
+        }
+        int r = json_object_object_add(jso, kvl[i], jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+empty:
+    *jso_r = jso;
+    return 0;
+out:
+    json_object_put(jso);
+    return ERROR_FAIL;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *pkvl)
 {
@@ -253,6 +381,7 @@ empty:
 out:
     return s;
 }
+#endif
 
 int libxl__key_value_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
                                      libxl_key_value_list *p)
@@ -289,6 +418,39 @@ int libxl__key_value_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_string_list_gen_jso(json_object **jso_r, libxl_string_list *pl)
+{
+    libxl_string_list l = *pl;
+    json_object *jso;
+    int i;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array();
+    if (!jso) goto out;
+
+    if (!l) goto empty;
+
+    for (i = 0; l[i] != NULL; i++) {
+        json_object *jso_value = json_object_new_string(l[i]);
+        if (!jso_value) goto out;
+        int r = json_object_array_add(jso, jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+empty:
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *pl)
 {
     libxl_string_list l = *pl;
@@ -309,6 +471,7 @@ empty:
 out:
     return s;
 }
+#endif
 
 int libxl__string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
                                   libxl_string_list *p)
@@ -342,12 +505,26 @@ int libxl__string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_mac_gen_jso(json_object **jso_r, libxl_mac *mac)
+{
+    char buf[LIBXL_MAC_FMTLEN+1];
+    snprintf(buf, sizeof(buf), LIBXL_MAC_FMT, LIBXL_MAC_BYTES((*mac)));
+    *jso_r = json_object_new_string_len(buf, LIBXL_MAC_FMTLEN);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *mac)
 {
     char buf[LIBXL_MAC_FMTLEN+1];
     snprintf(buf, sizeof(buf), LIBXL_MAC_FMT, LIBXL_MAC_BYTES((*mac)));
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_MAC_FMTLEN);
 }
+#endif
 
 int libxl__mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
                           libxl_mac *p)
@@ -358,6 +535,36 @@ int libxl__mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return libxl__parse_mac(libxl__json_object_get_string(o), *p);
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_hwcap_gen_jso(json_object **jso_r, libxl_hwcap *p)
+{
+    json_object *jso;
+    int i;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array();
+    if (!jso) goto out;
+
+    for(i=0; i<4; i++) {
+        json_object *jso_value = json_object_new_int((*p)[i]);
+        if (!jso_value)
+            goto out;
+        int r = json_object_array_add(jso, jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand,
                                      libxl_hwcap *p)
 {
@@ -375,6 +582,7 @@ yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand,
 out:
     return s;
 }
+#endif
 
 int libxl__hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
                             libxl_hwcap *p)
@@ -397,6 +605,37 @@ int libxl__hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_ms_vm_genid_gen_jso(json_object **jso_r, libxl_ms_vm_genid *p)
+{
+    json_object *jso;
+    int i;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array_ext(LIBXL_MS_VM_GENID_LEN);
+    if (!jso) goto out;
+
+    for (i = 0; i < LIBXL_MS_VM_GENID_LEN; i++) {
+        json_object *jso_value = json_object_new_int(p->bytes[i]);
+        if (!jso_value)
+            goto out;
+        int r = json_object_array_add(jso, jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p)
 {
     yajl_gen_status s;
@@ -414,6 +653,7 @@ yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p)
 
     return yajl_gen_array_close(hand);
 }
+#endif
 
 int libxl__ms_vm_genid_parse_json(libxl__gc *gc, const libxl__json_object *o,
                                   libxl_ms_vm_genid *p)
@@ -436,6 +676,21 @@ int libxl__ms_vm_genid_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__string_gen_jso(json_object **jso_r, const char *p)
+{
+    if (p) {
+        *jso_r = json_object_new_string(p);
+        if (!*jso_r)
+            return ERROR_FAIL;
+    } else {
+        *jso_r = json_object_new_null();
+    }
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__string_gen_json(yajl_gen hand,
                                        const char *p)
 {
@@ -444,6 +699,7 @@ yajl_gen_status libxl__string_gen_json(yajl_gen hand,
     else
         return yajl_gen_null(hand);
 }
+#endif
 
 int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
                              char **p)
@@ -1166,6 +1422,7 @@ out:
     return NULL;
 }
 
+#ifdef USE_LIBYAJL_GEN
 static const char *yajl_gen_status_to_string(yajl_gen_status s)
 {
         switch (s) {
@@ -1190,7 +1447,43 @@ static const char *yajl_gen_status_to_string(yajl_gen_status s)
             return "unknown error";
         }
 }
+#endif
+
+#ifdef USE_LIBJSONC_GEN
+char *libxl__object_to_json(libxl_ctx *ctx, const char *type,
+                            libxl__gen_json_callback gen, void *p)
+{
+    const char *buf;
+    char *ret = NULL;
+    json_object *jso = NULL;
+    int rc;
+
+    rc = gen(&jso, p);
+    if (rc)
+        goto out;
+
+    buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PRETTY);
+    if (!buf)
+        goto out;
+    ret = strdup((const char *)buf);
+
+out:
+    json_object_put(jso);
+
+    if (rc) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "unable to convert %s to JSON representation. ",
+                   type);
+    } else if (!ret) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "unable to allocate space for to JSON representation of %s",
+                   type);
+    }
+
+    return ret;
+}
 
+#elif defined(USE_LIBYAJL_GEN)
 char *libxl__object_to_json(libxl_ctx *ctx, const char *type,
                             libxl__gen_json_callback gen, void *p)
 {
@@ -1229,6 +1522,7 @@ out:
 
     return ret;
 }
+#endif
 
 char *libxl__json_object_to_json(libxl__gc *gc,
                                  const libxl__json_object *args)
@@ -1262,6 +1556,17 @@ out:
     return ret;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__uint64_gen_jso(json_object **jso_r, uint64_t val)
+{
+    *jso_r = json_object_new_uint64(val);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val)
 {
     char *num;
@@ -1282,6 +1587,7 @@ yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val)
 out:
     return s;
 }
+#endif
 
 int libxl__object_from_json(libxl_ctx *ctx, const char *type,
                             libxl__json_parse_callback parse,
@@ -1313,6 +1619,16 @@ out:
     return rc;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__int_gen_jso(json_object **jso_r, int i)
+{
+    *jso_r = json_object_new_int(i);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
 int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
                           void *p)
 {
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index b53e013a44..d64a573ff3 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -7,9 +7,9 @@ namespace("libxl_")
 
 libxl_defbool = Builtin("defbool", json_parse_type="JSON_STRING", passby=PASS_BY_REFERENCE, copy_fn=None,
                         check_default_fn="libxl__defbool_is_default")
-libxl_domid = Builtin("domid", json_gen_fn = "yajl_gen_integer", json_parse_fn = "libxl__uint32_parse_json",
+libxl_domid = Builtin("domid", json_gen_fn = "yajl_gen_integer", jsonc_json_gen_fn = "libxl__uint64_gen_jso", json_parse_fn = "libxl__uint32_parse_json",
                       json_parse_type = "JSON_INTEGER", autogenerate_json = False, copy_fn=None)
-libxl_devid = Builtin("devid", json_gen_fn = "yajl_gen_integer", json_parse_fn = "libxl__int_parse_json",
+libxl_devid = Builtin("devid", json_gen_fn = "yajl_gen_integer", jsonc_json_gen_fn = "libxl__int_gen_jso", json_parse_fn = "libxl__int_parse_json",
                       json_parse_type = "JSON_INTEGER", autogenerate_json = False, signed = True, init_val="-1",
                       copy_fn=None)
 libxl_uuid = Builtin("uuid", json_parse_type="JSON_STRING", passby=PASS_BY_REFERENCE, check_default_fn="libxl_uuid_is_nil",
@@ -37,7 +37,8 @@ libxl_ms_vm_genid = Builtin("ms_vm_genid", passby=PASS_BY_REFERENCE, check_defau
 # Specific integer types
 #
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_gen_fn = "libxl__uint64_gen_json")
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT",
+             json_gen_fn = "libxl__uint64_gen_json", jsonc_json_gen_fn = "libxl__uint64_gen_jso")
 
 #
 # Constants / Enumerations
diff --git a/tools/libs/light/libxl_types_internal.idl b/tools/libs/light/libxl_types_internal.idl
index 0425e9b6b0..ab4ee92870 100644
--- a/tools/libs/light/libxl_types_internal.idl
+++ b/tools/libs/light/libxl_types_internal.idl
@@ -1,7 +1,8 @@
 namespace("libxl__")
 hidden(True)
 
-libxl_domid = Builtin("domid", namespace="libxl_", json_gen_fn = "yajl_gen_integer",
+libxl_domid = Builtin("domid", namespace="libxl_",
+                      json_gen_fn = "yajl_gen_integer", jsonc_json_gen_fn = "libxl__uint64_gen_jso",
 		      json_parse_fn = "libxl__uint32_parse_json", json_parse_type = "JSON_INTEGER",
 		      autogenerate_json = False, copy_fn = None)
 
diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 83a02f45fe..80a3b25aac 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -60,6 +60,48 @@ static int maybe_printf(const char *fmt, ...)
     return count;
 }
 
+
+#ifdef HAVE_LIBJSONC
+static int printf_info_one_json(json_object **jso_r, int domid,
+                                libxl_domain_config *d_config)
+{
+    json_object *jso = NULL;
+    json_object *jso_config = NULL;
+    enum json_tokener_error error;
+    char *s = NULL;
+    int r = EXIT_FAILURE;
+
+    s = libxl_domain_config_to_json(ctx, d_config);
+    jso_config = json_tokener_parse_verbose(s, &error);
+    if (!jso_config) {
+        fprintf(stderr, "fail to parse JSON from libxl_domain_config_to_json(): %s\n",
+                json_tokener_error_desc(error));
+        goto out;
+    }
+
+    jso = json_object_new_object();
+    if (domid != -1)
+        json_object_object_add(jso, "domid", json_object_new_int(domid));
+    else
+        json_object_object_add(jso, "domid", json_object_new_null());
+
+
+    json_object_object_add(jso, "config", jso_config);
+    jso_config = NULL;
+
+    *jso_r = jso;
+    jso = NULL;
+    r = EXIT_SUCCESS;
+
+out:
+    free(s);
+    json_object_put(jso);
+    json_object_put(jso_config);
+    return r;
+}
+
+#elif defined(HAVE_LIBYAJL)
+
 static yajl_gen_status printf_info_one_json(yajl_gen hand, int domid,
                                             libxl_domain_config *d_config)
 {
@@ -95,6 +137,7 @@ static yajl_gen_status printf_info_one_json(yajl_gen hand, int domid,
 out:
     return s;
 }
+#endif
 
 void printf_info(enum output_format output_format,
                  int domid,
@@ -103,6 +146,27 @@ void printf_info(enum output_format output_format,
     if (output_format == OUTPUT_FORMAT_SXP)
         return printf_info_sexp(domid, d_config, fh);
 
+#ifdef HAVE_LIBJSONC
+    int r;
+    const char *buf;
+    json_object *jso;
+
+    r = printf_info_one_json(&jso, domid, d_config);
+    if (r)
+        goto out;
+
+    buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PRETTY);
+    if (!buf)
+        goto out;
+
+    fputs(buf, fh);
+
+out:
+    json_object_put(jso);
+    flush_stream(fh);
+    return;
+
+#elif defined(HAVE_LIBYAJL)
     const char *buf;
     libxl_yajl_length len = 0;
     yajl_gen_status s;
@@ -132,6 +196,7 @@ out:
                 "unable to format domain config as JSON (YAJL:%d)\n", s);
 
     flush_stream(fh);
+#endif
 }
 
 static void output_xeninfo(void)
@@ -476,11 +541,20 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
 
     int i, rc;
 
+    const char *buf;
+#ifdef HAVE_LIBJSONC
+    json_object *jso = NULL;
+#elif defined(HAVE_LIBYAJL)
     yajl_gen hand = NULL;
     yajl_gen_status s;
-    const char *buf;
     libxl_yajl_length yajl_len = 0;
+#endif
 
+#ifdef HAVE_LIBJSONC
+    if (default_output_format == OUTPUT_FORMAT_JSON) {
+        jso = json_object_new_array();
+    }
+#elif defined(HAVE_LIBYAJL)
     if (default_output_format == OUTPUT_FORMAT_JSON) {
         hand = libxl_yajl_gen_alloc(NULL);
         if (!hand) {
@@ -493,6 +567,7 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
             goto out;
     } else
         s = yajl_gen_status_ok;
+#endif
 
     for (i = 0; i < nb_domain; i++) {
         libxl_domain_config_init(&d_config);
@@ -500,16 +575,32 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
                                                  &d_config, NULL);
         if (rc)
             continue;
-        if (default_output_format == OUTPUT_FORMAT_JSON)
+        if (default_output_format == OUTPUT_FORMAT_JSON) {
+#ifdef HAVE_LIBJSONC
+            json_object *jso_value;
+            rc = printf_info_one_json(&jso_value, info[i].domid, &d_config);
+            json_object_array_add(jso, jso_value);
+#elif defined(HAVE_LIBYAJL)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
-        else
+#endif
+        } else
             printf_info_sexp(info[i].domid, &d_config, stdout);
         libxl_domain_config_dispose(&d_config);
+#ifdef HAVE_LIBJSONC
+        if (rc)
+            goto out;
+#elif defined(HAVE_LIBYAJL)
         if (s != yajl_gen_status_ok)
             goto out;
+#endif
     }
 
     if (default_output_format == OUTPUT_FORMAT_JSON) {
+#ifdef HAVE_LIBJSONC
+        buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PRETTY);
+        if (!buf)
+            goto out;
+#elif defined(HAVE_LIBYAJL)
         s = yajl_gen_array_close(hand);
         if (s != yajl_gen_status_ok)
             goto out;
@@ -517,16 +608,21 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
         s = yajl_gen_get_buf(hand, (const unsigned char **)&buf, &yajl_len);
         if (s != yajl_gen_status_ok)
             goto out;
+#endif
 
         puts(buf);
     }
 
 out:
     if (default_output_format == OUTPUT_FORMAT_JSON) {
+#ifdef HAVE_LIBJSONC
+        json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
         yajl_gen_free(hand);
         if (s != yajl_gen_status_ok)
             fprintf(stderr,
                     "unable to format domain config as JSON (YAJL:%d)\n", s);
+#endif
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:33:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138192.1473945 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lLU-0003jc-5h; Mon, 06 Oct 2025 13:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138192.1473945; Mon, 06 Oct 2025 13:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lLU-0003jU-36; Mon, 06 Oct 2025 13:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1138192;
 Mon, 06 Oct 2025 13: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 1v5lLS-0003jK-B5
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 13: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 1v5lLS-00BpAQ-10
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lLS-0061Lq-0r
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9JDiJtQ0Bzz1R7dFLrKgQWLYagFz7Y7brupEzuAuVJI=; b=JeZWyvqhNlilvVFMIqMn9e0pVG
	IMIHp/ooC5unY8LIYIK+SDuNh0Kz/6FrbTQMxoe4P5j0lLJXLvp4KQHFogr1xCMwJTJhXngBwY5GU
	g4AWQcdzqtHaqzDvhk6AX1LsUw9813ULorL0UDLSaPW3iXqSp6cupF/yoe4CxqFBSky4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: Convert libxl__json_object_to_json() to json_object
Message-Id: <E1v5lLS-0061Lq-0r@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:33:42 +0000

commit 75fa670e582cdee7d8ac639d0cb9932b8867f740
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:53 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:55 2025 +0100

    libxl: Convert libxl__json_object_to_json() to json_object
    
    But keep the implementation done for YAJL.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/libs/light/libxl_json.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index eeda9c301d..c76ae9f64a 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -104,10 +104,12 @@ typedef struct libxl__yajl_ctx {
  * YAJL Helper
  */
 
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str)
 {
     return yajl_gen_string(hand, (const unsigned char *)str, strlen(str));
 }
+#endif
 
 #ifdef HAVE_LIBJSONC
 int libxl__enum_gen_jso(json_object **jso_r, const char *str)
@@ -1527,6 +1529,29 @@ out:
 char *libxl__json_object_to_json(libxl__gc *gc,
                                  const libxl__json_object *args)
 {
+#ifdef HAVE_LIBJSONC
+    const char *buf;
+    json_object *root;
+    char *ret = NULL;
+    int rc;
+
+    if (!args)
+        return NULL;
+
+    rc = libxl__json_object_to_json_object(gc, &root, args);
+    if (rc)
+        goto out;
+
+    buf = json_object_to_json_string_ext(root, JSON_C_TO_STRING_PRETTY);
+    if (!buf)
+        goto out;
+
+    ret = libxl__strdup(gc, buf);
+
+out:
+    json_object_put(root);
+    return ret;
+#elif defined(HAVE_LIBYAJL)
     const unsigned char *buf;
     libxl_yajl_length len;
     yajl_gen_status s;
@@ -1554,6 +1579,7 @@ char *libxl__json_object_to_json(libxl__gc *gc,
 out:
     yajl_gen_free(hand);
     return ret;
+#endif
 }
 
 #ifdef HAVE_LIBJSONC
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:33:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138193.1473949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lLe-0003ll-79; Mon, 06 Oct 2025 13:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138193.1473949; Mon, 06 Oct 2025 13: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 1v5lLe-0003ld-4U; Mon, 06 Oct 2025 13:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1138193;
 Mon, 06 Oct 2025 13:33: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 1v5lLc-0003lT-Db
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 13:33: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 1v5lLc-00BpAu-1H
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lLc-0061Md-1B
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=opno/h7GW8tl1C3Du6VavVkT76dWUmRmJk5csVPEN9g=; b=Zt/CrNgY27RSSe5qg/6eO7gcJ+
	Q7+ekg7gIXHBl2W8tEppmMfb7TFQOjqlnVwgvOd2dXbIHpAKVO3LergstWRQkDMtUPm+GRrkiVHPX
	C1/5pAcWxuWD8BHZU+7YyHP+piip1Xv43ODfSzstHI7KtfLc9M+0JeUjVS8U5LLsksSw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxenstat: Use json-c when available
Message-Id: <E1v5lLc-0061Md-1B@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:33:52 +0000

commit c4abe30ca6e4270a5eb941be5330c206a52f6fb2
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:54 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:59 2025 +0100

    tools/libxenstat: Use json-c when available
    
    This is mainly a copy of the existing code in yajl and use json-c
    instead.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/libs/stat/Makefile      |   2 +-
 tools/libs/stat/xenstat_qmp.c | 126 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 120 insertions(+), 8 deletions(-)

diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index a968eaff48..3151ee9f12 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -24,7 +24,7 @@ OBJS-$(CONFIG_SunOS) += xenstat_solaris.o
 OBJS-$(CONFIG_NetBSD) += xenstat_netbsd.o
 OBJS-$(CONFIG_FreeBSD) += xenstat_freebsd.o
 
-LDLIBS-y += -lyajl
+LDLIBS-y += $(XEN_JSON_LIBS)
 LDLIBS-$(CONFIG_SunOS) += -lkstat
 LDLIBS += $(LDLIBS-y)
 
diff --git a/tools/libs/stat/xenstat_qmp.c b/tools/libs/stat/xenstat_qmp.c
index 9909b9727e..21e321fffa 100644
--- a/tools/libs/stat/xenstat_qmp.c
+++ b/tools/libs/stat/xenstat_qmp.c
@@ -24,6 +24,10 @@
 
 #include "xenstat_priv.h"
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+
+#elif defined(HAVE_LIBYAJL)
 #ifdef HAVE_YAJL_YAJL_VERSION_H
 #  include <yajl/yajl_version.h>
 #endif
@@ -32,11 +36,13 @@
 #if defined(YAJL_MAJOR) && (YAJL_MAJOR > 1)
 #  define HAVE_YAJL_V2 1
 #endif
+#endif
 
 #ifdef HAVE_YAJL_V2
-
 #include <yajl/yajl_tree.h>
+#endif
 
+#if defined(HAVE_LIBJSONC) || defined(HAVE_YAJL_V2)
 static unsigned char *qmp_query(int, const char *);
 
 enum query_blockstats {
@@ -76,9 +82,10 @@ enum query_block {
             "type": 'str'
           }]}
 */
-static char *qmp_get_block_image(xenstat_node *node, char *qmp_devname, int qfd)
+static char *qmp_get_block_image(xenstat_node *node, const char *qmp_devname, int qfd)
 {
-	char *tmp, *file = NULL;
+	const char *tmp;
+	char *file = NULL;
 	const char *query_block_cmd = "{ \"execute\": \"query-block\" }";
 	static const char *const qblock[] = {
 		[ QMP_BLOCK_RETURN  ] = "return",
@@ -88,13 +95,56 @@ static char *qmp_get_block_image(xenstat_node *node, char *qmp_devname, int qfd)
 	};
 	const char *ptr[] = {0, 0};
 	unsigned char *qmp_stats;
-	yajl_val info, ret_obj, dev_obj, n;
 	int i;
 
 	if ((qmp_stats = qmp_query(qfd, query_block_cmd)) == NULL)
 		return NULL;
 
+#ifdef HAVE_LIBJSONC
+	json_object *jso;
+	enum json_tokener_error error;
+	jso = json_tokener_parse_verbose((const char *)qmp_stats, &error);
+	free(qmp_stats);
+	if (jso == NULL)
+		return NULL;
+
+	ptr[0] = qblock[QMP_BLOCK_RETURN]; /* "return" */
+	json_object *ret_jso = json_object_object_get(jso, ptr[0]);
+	if (ret_jso == NULL)
+		goto done;
+
+	for (i=0; i<json_object_array_length(ret_jso); i++) {
+		json_object *n = json_object_array_get_idx(ret_jso, i);
+
+		ptr[0] = qblock[QMP_BLOCK_DEVICE]; /* "device" */
+		json_object *dev_jso = json_object_object_get(n, ptr[0]);
+		if (dev_jso) {
+			tmp = json_object_get_string(dev_jso);
+			if (!tmp || strcmp(qmp_devname, tmp))
+				continue;
+		} else {
+			continue;
+		}
+
+		ptr[0] = qblock[QMP_INSERTED]; /* "inserted" */
+		n = json_object_object_get(n, ptr[0]);
+		if (n) {
+			ptr[0] = qblock[QMP_FILE]; /* "file" */
+			n = json_object_object_get(n, ptr[0]);
+			if (n && json_object_is_type(n, json_type_string)) {
+				tmp = json_object_get_string(n);
+				file = malloc(strlen(tmp)+1);
+				if (file != NULL)
+					strcpy(file, tmp);
+				goto done;
+			}
+		}
+	}
+done:
+	json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
 	/* Use libyajl version 2.0.3 or newer for the tree parser feature with bug fixes */
+	yajl_val info, ret_obj, dev_obj, n;
 	info = yajl_tree_parse((char *)qmp_stats, NULL, 0);
 	free(qmp_stats);
 	if (info == NULL)
@@ -132,12 +182,13 @@ static char *qmp_get_block_image(xenstat_node *node, char *qmp_devname, int qfd)
 	}
 done:
 	yajl_tree_free(info);
+#endif
 	return file;
 }
 
 
 /* Given a QMP device name, lookup the associated xenstore qdisk device id */
-static void lookup_xenstore_devid(xenstat_node * node, unsigned int domid, char *qmp_devname,
+static void lookup_xenstore_devid(xenstat_node * node, unsigned int domid, const char *qmp_devname,
 	int qfd, unsigned int *dev, unsigned int *sector_size)
 {
 	char **dev_ids, *tmp, *ptr, *image, path[80];
@@ -191,7 +242,7 @@ static void lookup_xenstore_devid(xenstat_node * node, unsigned int domid, char
 /* Parse the stats buffer which contains I/O data for all the disks belonging to domid */
 static void qmp_parse_stats(xenstat_node *node, unsigned int domid, unsigned char *stats_buf, int qfd)
 {
-	char *qmp_devname;
+	const char *qmp_devname;
 	static const char *const qstats[] = {
 		[ QMP_STATS_RETURN  ] = "return",
 		[ QMP_STATS_DEVICE  ] = "device",
@@ -202,12 +253,72 @@ static void qmp_parse_stats(xenstat_node *node, unsigned int domid, unsigned cha
 		[ QMP_WR_OPERATIONS ] = "wr_operations",
 	};
 	const char *ptr[] = {0, 0};
-	yajl_val info, ret_obj, stats_obj, n;
 	xenstat_vbd vbd;
 	xenstat_domain *domain;
 	unsigned int sector_size = 512;
 	int i, j;
 
+#ifdef HAVE_LIBJSONC
+	json_object *jso, *ret_jso, *stats_obj, *n;
+	enum json_tokener_error error;
+
+	jso = json_tokener_parse_verbose((const char *)stats_buf, &error);
+	if (jso == NULL)
+		return;
+
+	ptr[0] = qstats[QMP_STATS_RETURN]; /* "return" */
+	ret_jso = json_object_object_get(jso, ptr[0]);
+	if (ret_jso == NULL)
+		goto done;
+
+	/* Array of devices */
+	for (i=0; i<json_object_array_length(ret_jso); i++) {
+		memset(&vbd, 0, sizeof(xenstat_vbd));
+		qmp_devname = NULL;
+		stats_obj = json_object_array_get_idx(ret_jso, i);
+
+		ptr[0] = qstats[QMP_STATS_DEVICE]; /* "device" */
+		n = json_object_object_get(stats_obj, ptr[0]);
+		if (n)
+			qmp_devname = json_object_get_string(n);
+
+		ptr[0] = qstats[QMP_STATS]; /* "stats" */
+		stats_obj = json_object_object_get(stats_obj, ptr[0]);
+		if (stats_obj && json_object_is_type(stats_obj, json_type_object)) {
+			for (j=3; j<7; j++) {
+				ptr[0] = qstats[j];
+				n = json_object_object_get(stats_obj, ptr[0]);
+				if (n && json_object_is_type(n, json_type_int)) {
+					switch(j) {
+					case QMP_RD_BYTES: /* "rd_bytes" */
+						vbd.rd_sects = json_object_get_int64(n) / sector_size;
+						break;
+					case QMP_WR_BYTES: /* "wr_bytes" */
+						vbd.wr_sects = json_object_get_int64(n) / sector_size;
+						break;
+					case QMP_RD_OPERATIONS: /* "rd_operations" */
+						vbd.rd_reqs = json_object_get_int64(n);
+						break;
+					case QMP_WR_OPERATIONS: /* "wr_operations" */
+						vbd.wr_reqs = json_object_get_int64(n);
+						break;
+					}
+				}
+			}
+			/* With the QMP device name, lookup the xenstore qdisk device ID and set vdb.dev */
+			if (qmp_devname)
+				lookup_xenstore_devid(node, domid, qmp_devname, qfd, &vbd.dev, &sector_size);
+			if ((domain = xenstat_node_domain(node, domid)) == NULL)
+				continue;
+			if ((xenstat_save_vbd(domain, &vbd)) == NULL)
+				goto done;
+		}
+	}
+done:
+	json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
+	yajl_val info, ret_obj, stats_obj, n;
+
 	/* Use libyajl version 2.0.3 or newer for the tree parser feature */
 	if ((info = yajl_tree_parse((char *)stats_buf, NULL, 0)) == NULL)
 		return;
@@ -260,6 +371,7 @@ static void qmp_parse_stats(xenstat_node *node, unsigned int domid, unsigned cha
 	}
 done:
 	yajl_tree_free(info);
+#endif
 }
 
 /* Write a command via the QMP. Returns number of bytes written */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:34:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138194.1473952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lLo-0003ny-8Y; Mon, 06 Oct 2025 13:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138194.1473952; Mon, 06 Oct 2025 13: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 1v5lLo-0003nq-5s; Mon, 06 Oct 2025 13:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1138194;
 Mon, 06 Oct 2025 13:34: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 1v5lLm-0003nh-H3
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 13:34: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 1v5lLm-00BpBB-1b
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lLm-0061OJ-1U
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/iOmg+Psrhlg1xyQMEEGYmzVSaCSaRocpyvO6OWmJ6c=; b=zMDBv9ySxwPJoNreX0DASzF4pR
	vMpYqVOH5DUAj8IFiqv3vDTt7xTCgsMjJeGNw7NEgqu8012yE+SW3FfXZdTuPZrFY+/J99Gm+wJzV
	bcNMPGQoHoQ1+3VTFy/+oek9NoxjU/CvguiYmJgpTUIcZvtepoTiRN9Wo1N7wakMUUDo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] configure: Use json-c by default, fallback to yajl
Message-Id: <E1v5lLm-0061OJ-1U@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:34:02 +0000

commit c71d8ef0cca37b11b83f303feebfedce2621994a
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:55 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:59 2025 +0100

    configure: Use json-c by default, fallback to yajl
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/configure    | 85 +++++++++++++++++++++++++++++++++++-------------------
 tools/configure.ac | 12 ++++----
 2 files changed, 63 insertions(+), 34 deletions(-)

diff --git a/tools/configure b/tools/configure
index edd1701b2d..0eb7a0ab6a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9692,41 +9692,57 @@ fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$libjsonc_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (json-c) were not met:
-
-$libjsonc_PKG_ERRORS
+	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
+printf %s "checking for yajl_alloc in -lyajl... " >&6; }
+if test ${ac_cv_lib_yajl_yajl_alloc+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lyajl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char yajl_alloc ();
+int
+main (void)
+{
+return yajl_alloc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_yajl_yajl_alloc=yes
+else $as_nop
+  ac_cv_lib_yajl_yajl_alloc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
+printf "%s\n" "$ac_cv_lib_yajl_yajl_alloc" >&6; }
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes
+then :
+  YAJL_LIBS=-lyajl
 
-Alternatively, you may set the environment variables libjsonc_CFLAGS
-and libjsonc_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
-     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-	{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
 
-Alternatively, you may set the environment variables libjsonc_CFLAGS
-and libjsonc_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
+printf "%s\n" "#define HAVE_LIBYAJL 1" >>confdefs.h
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
-	libjsonc_CFLAGS=$pkg_cv_libjsonc_CFLAGS
-	libjsonc_LIBS=$pkg_cv_libjsonc_LIBS
-        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
+else $as_nop
+  as_fn_error $? "Could not find yajl" "$LINENO" 5
+fi
 
-printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h
 
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
+elif test $pkg_failed = untried; then
+     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 printf %s "checking for yajl_alloc in -lyajl... " >&6; }
 if test ${ac_cv_lib_yajl_yajl_alloc+y}
 then :
@@ -9772,6 +9788,17 @@ else $as_nop
   as_fn_error $? "Could not find yajl" "$LINENO" 5
 fi
 
+
+else
+	libjsonc_CFLAGS=$pkg_cv_libjsonc_CFLAGS
+	libjsonc_LIBS=$pkg_cv_libjsonc_LIBS
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h
+
+fi
+
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 printf %s "checking for deflateCopy in -lz... " >&6; }
 if test ${ac_cv_lib_z_deflateCopy+y}
diff --git a/tools/configure.ac b/tools/configure.ac
index bb40b5b3f0..7267d02a04 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -425,11 +425,13 @@ AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
 PKG_CHECK_MODULES([libjsonc], [json-c],
-    [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])])
-AC_CHECK_LIB([yajl], [yajl_alloc],
-   [AC_SUBST([YAJL_LIBS],[-lyajl])
-    AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' library (-lyajl).])],
-    [AC_MSG_ERROR([Could not find yajl])])
+    [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])],
+    [AC_CHECK_LIB([yajl], [yajl_alloc],
+        [AC_SUBST([YAJL_LIBS],[-lyajl])
+         AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' library (-lyajl).])],
+        [AC_MSG_ERROR([Could not find yajl])])
+])
+
 AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
 AC_CHECK_HEADER([argp.h], [
 AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 13:34:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 13:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138198.1473957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5lLy-0003qU-9v; Mon, 06 Oct 2025 13:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138198.1473957; Mon, 06 Oct 2025 13: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 1v5lLy-0003qM-7I; Mon, 06 Oct 2025 13:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1138198;
 Mon, 06 Oct 2025 13:34: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 1v5lLw-0003qA-Jm
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 13:34: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 1v5lLw-00BpBF-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5lLw-0061PO-1m
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 13:34:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D1WjlJLq3UgphW+8bxTAOnIorZ9DNH+KLSckn+9uSUs=; b=PgLm5DZTNlnjqtG4XE6MFm47wg
	x4/ZYABpe/yT9ZU9IO/JDY24pV60qSscKY5Kcy6nIzRWuo/0brhddwIncvHJGe9k0Dp3WnsoznJoX
	xqxAuPoU6gUGQTMkvFXS7jsmu+NMR6nDPTtr0PRjF6RgwF4xRNRMPDQUNPsBXoLj6dGI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Update CHANGELOG and README with dependency on json-c
Message-Id: <E1v5lLw-0061PO-1m@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 13:34:12 +0000

commit acaecf31ea1d566a20b5ee9c0f1f3cb4ee0ec9c2
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:56 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:59 2025 +0100

    Update CHANGELOG and README with dependency on json-c
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 CHANGELOG.md | 2 ++
 README       | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b9518ff08..5c70bc0250 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - Debian Trixie added to CI.  Debian Bullseye retired from CI for RISC-V due
    to the baseline change.
  - Linux based device model stubdomains are now fully supported.
+ - New dependency on library json-c, the toolstack will prefer it to `YAJL`
+   when available.
 
  - On x86:
    - Restrict the cache flushing done as a result of guest physical memory map
diff --git a/README b/README
index 6ee58f7b35..9329f30e13 100644
--- a/README
+++ b/README
@@ -53,7 +53,7 @@ provided by your OS distributor:
     * Development install of Python 2.7 or later (e.g., python-dev)
     * Development install of curses (e.g., libncurses-dev)
     * Development install of uuid (e.g. uuid-dev)
-    * Development install of yajl (e.g. libyajl-dev)
+    * Development install of json-c (e.g. libjson-c-dev) or yajl (e.g. libyajl-dev)
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:22:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138258.1474001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m6F-0003GQ-FU; Mon, 06 Oct 2025 14:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138258.1474001; Mon, 06 Oct 2025 14: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 1v5m6F-0003GI-Cd; Mon, 06 Oct 2025 14:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1138258;
 Mon, 06 Oct 2025 14: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 1v5m6E-0003GC-0O
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m6D-00BqFY-35
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m6D-0067Bm-2y
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=W7qk6vVCMei4ehm1Bz8g9K7h8Ptt3pucHnnEd9hMwPU=; b=hUQTlUxiq0Zpq4kSFckiQov1Tk
	vBXOkxu6E93FL/FNS+iKlBL0acPeFr01W7UBeIzLpdMM93mj8gFIXUw7acjlL1eoKoGDuQMwyYmD1
	c7xvtIQ/GVtTFzmogMsEqNkxL/dAzUCNjbZSAti8OnSQcE1Jo/BHDlyt6vcmwUqX4icU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/configure: Introduce deps on json-c lib for libxl
Message-Id: <E1v5m6D-0067Bm-2y@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:22:01 +0000

commit bb3da1c885ffe5c5262cb94ab118a1b570216254
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:49 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:28:43 2025 +0100

    tools/configure: Introduce deps on json-c lib for libxl
    
    To replace yajl.
    
    Introduce XEN_JSON_LIBS variable, to be able to remove "-lyajl" later.
    
    As a first step, the variable will have both or only -lyajl. Then
    commit "configure: Use json-c by default, fallback to yajl" will make
    a change to only have one or the other once the code is ready to build
    with only json-c.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 config/Tools.mk.in        |   1 +
 tools/config.h.in         |   3 ++
 tools/configure           | 107 +++++++++++++++++++++++++++++++++++++++++++++-
 tools/configure.ac        |   6 ++-
 tools/libs/light/Makefile |   4 +-
 tools/xl/Makefile         |   2 +-
 6 files changed, 117 insertions(+), 6 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index e47ac23d11..0037ad5a64 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -65,6 +65,7 @@ EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
 TINFO_LIBS          := @TINFO_LIBS@
 ARGP_LDFLAGS        := @argp_ldflags@
+XEN_JSON_LIBS       := @YAJL_LIBS@ @libjsonc_LIBS@
 
 FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
 
diff --git a/tools/config.h.in b/tools/config.h.in
index fe2a94cfc4..ed0042018d 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -27,6 +27,9 @@
 /* Define to 1 if you have the `fdt' library (-lfdt). */
 #undef HAVE_LIBFDT
 
+/* Use library json-c */
+#undef HAVE_LIBJSONC
+
 /* Define to 1 if you have the `lzma' library (-llzma). */
 #undef HAVE_LIBLZMA
 
diff --git a/tools/configure b/tools/configure
index 5abd44e21e..edd1701b2d 100755
--- a/tools/configure
+++ b/tools/configure
@@ -660,6 +660,9 @@ libnl
 LIBNL3_LIBS
 LIBNL3_CFLAGS
 argp_ldflags
+YAJL_LIBS
+libjsonc_LIBS
+libjsonc_CFLAGS
 PTHREAD_LIBS
 PTHREAD_LDFLAGS
 PTHREAD_CFLAGS
@@ -882,6 +885,8 @@ pixman_CFLAGS
 pixman_LIBS
 libzstd_CFLAGS
 libzstd_LIBS
+libjsonc_CFLAGS
+libjsonc_LIBS
 LIBNL3_CFLAGS
 LIBNL3_LIBS
 SYSTEMD_SLEEP_DIR'
@@ -1633,6 +1638,10 @@ Some influential environment variables:
               C compiler flags for libzstd, overriding pkg-config
   libzstd_LIBS
               linker flags for libzstd, overriding pkg-config
+  libjsonc_CFLAGS
+              C compiler flags for libjsonc, overriding pkg-config
+  libjsonc_LIBS
+              linker flags for libjsonc, overriding pkg-config
   LIBNL3_CFLAGS
               C compiler flags for LIBNL3, overriding pkg-config
   LIBNL3_LIBS linker flags for LIBNL3, overriding pkg-config
@@ -9624,6 +9633,99 @@ printf "%s\n" "$ax_cv_pthread_flags" >&6; }
 
 
 
+
+pkg_failed=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libjsonc" >&5
+printf %s "checking for libjsonc... " >&6; }
+
+if test -n "$libjsonc_CFLAGS"; then
+    pkg_cv_libjsonc_CFLAGS="$libjsonc_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$libjsonc_LIBS"; then
+    pkg_cv_libjsonc_LIBS="$libjsonc_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1`
+        else
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$libjsonc_PKG_ERRORS" >&5
+
+	as_fn_error $? "Package requirements (json-c) were not met:
+
+$libjsonc_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables libjsonc_CFLAGS
+and libjsonc_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+	{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables libjsonc_CFLAGS
+and libjsonc_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	libjsonc_CFLAGS=$pkg_cv_libjsonc_CFLAGS
+	libjsonc_LIBS=$pkg_cv_libjsonc_LIBS
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h
+
+fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 printf %s "checking for yajl_alloc in -lyajl... " >&6; }
 if test ${ac_cv_lib_yajl_yajl_alloc+y}
@@ -9661,9 +9763,10 @@ fi
 printf "%s\n" "$ac_cv_lib_yajl_yajl_alloc" >&6; }
 if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes
 then :
-  printf "%s\n" "#define HAVE_LIBYAJL 1" >>confdefs.h
+  YAJL_LIBS=-lyajl
+
 
-  LIBS="-lyajl $LIBS"
+printf "%s\n" "#define HAVE_LIBYAJL 1" >>confdefs.h
 
 else $as_nop
   as_fn_error $? "Could not find yajl" "$LINENO" 5
diff --git a/tools/configure.ac b/tools/configure.ac
index dada1c3b15..bb40b5b3f0 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -424,7 +424,11 @@ AC_SUBST([ZLIB_CFLAGS])
 AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
-AC_CHECK_LIB([yajl], [yajl_alloc], [],
+PKG_CHECK_MODULES([libjsonc], [json-c],
+    [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])])
+AC_CHECK_LIB([yajl], [yajl_alloc],
+   [AC_SUBST([YAJL_LIBS],[-lyajl])
+    AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' library (-lyajl).])],
     [AC_MSG_ERROR([Could not find yajl])])
 AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
 AC_CHECK_HEADER([argp.h], [
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index b690d92159..c05d89db33 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -166,7 +166,7 @@ LDLIBS-$(CONFIG_Linux) += -luuid
 LDLIBS-$(CONFIG_Linux) += -lrt
 LDLIBS-$(CONFIG_ARM) += -lfdt
 LDLIBS-y += $(PTHREAD_LIBS)
-LDLIBS-y += -lyajl
+LDLIBS-y += $(XEN_JSON_LIBS)
 LDLIBS += $(LDLIBS-y)
 
 $(OBJS-y) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
@@ -246,7 +246,7 @@ libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS)
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS) $(APPEND_LDFLAGS)
 
 test_%: test_%.o test_common.o libxenlight_test.so
-	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(XEN_JSON_LIBS) $(APPEND_LDFLAGS)
 
 libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index ad577cdd70..973ff0e1a2 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -33,7 +33,7 @@ $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs i
 all: xl
 
 xl: $(XL_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(XEN_JSON_LIBS) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138259.1474004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m6P-0003KE-IF; Mon, 06 Oct 2025 14:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138259.1474004; Mon, 06 Oct 2025 14: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 1v5m6P-0003K6-Ff; Mon, 06 Oct 2025 14:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1138259;
 Mon, 06 Oct 2025 14: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 1v5m6O-0003Ji-3T
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m6O-00BqFh-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m6O-0067Cz-02
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=0ZDN+AJ996oTAj5N8rp6K/weGWeWxV1y37nVQNUBZFw=; b=rPy85pYMtGigPmbe2qj0rmKVOb
	D8jNcsCmC9D2QLpJNYWpLThBuy95M4H1T/KzBp0c48cIjRIUtjb9mSKSnonLsHKUSdwGIklv5bOMl
	B8zfZx82LaUAGImx+S2t1l0HiNqdfKncQjCENaW5u/y4RTX1afrB0pcQr3R+V9TQY2DA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: Convert libxl__json_parse() to use json-c
Message-Id: <E1v5m6O-0067Cz-02@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:22:12 +0000

commit 7e95dab9eb63669465634fe51612c612398aeb17
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:50 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:28:43 2025 +0100

    libxl: Convert libxl__json_parse() to use json-c
    
    This reuse the "json_callback_*" implemented for the yajl parser as
    they don't really need to be changed. It's just awkward to have to
    cast between `unsigned char` and `char.`
    
    Replace few strncpy() by memcpy() to let the compiler know we want to
    copy the string without the terminating nul, as we are adding it just
    after.
    
    Also, it should be possible to keep using YAJL parser when json-c
    library isn't available.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/include/libxl_json.h    |   4 ++
 tools/libs/light/libxl_json.c | 120 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/tools/include/libxl_json.h b/tools/include/libxl_json.h
index 3f97267eae..f0b4871e0e 100644
--- a/tools/include/libxl_json.h
+++ b/tools/include/libxl_json.h
@@ -42,6 +42,7 @@ yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p);
 #  define HAVE_YAJL_V2 1
 #endif
 
+#ifdef HAVE_LIBYAJL
 #ifdef HAVE_YAJL_V2
 
 typedef size_t libxl_yajl_length;
@@ -89,5 +90,8 @@ static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 }
 
 #endif /* !HAVE_YAJL_V2 */
+#else
+typedef size_t libxl_yajl_length;
+#endif /* !HAVE_LIBYAJL */
 
 #endif /* LIBXL_JSON_H */
diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index 9b8ef2cab9..44ee6e213f 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -16,7 +16,25 @@
 
 #include <math.h>
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+#define USE_LIBJSONC_PARSER
+#endif
+
+#ifdef HAVE_LIBYAJL
+#  ifndef USE_LIBJSONC_PARSER
+#    define USE_LIBYAJL_PARSER
+#  endif
+#endif
+
+
+#ifdef USE_LIBJSONC_PARSER
+#include <json-c/json_visit.h>
+#endif
+
+#ifdef USE_LIBYAJL_PARSER
 #include <yajl/yajl_parse.h>
+#endif
 #include <yajl/yajl_gen.h>
 
 #include "libxl_internal.h"
@@ -25,7 +43,9 @@
 
 typedef struct libxl__yajl_ctx {
     libxl__gc *gc;
+#ifdef USE_LIBYAJL_PARSER
     yajl_handle hand;
+#endif
     libxl__json_object *head;
     libxl__json_object *current;
 #ifdef DEBUG_ANSWER
@@ -33,7 +53,7 @@ typedef struct libxl__yajl_ctx {
 #endif
 } libxl__yajl_ctx;
 
-#ifdef DEBUG_ANSWER
+#if defined(DEBUG_ANSWER) && defined(USE_LIBYAJL_PARSER)
 #if YAJL_VERSION < 20000
 #  define DEBUG_GEN_ALLOC(ctx)                  \
     if ((ctx)->g == NULL) {                     \
@@ -759,7 +779,7 @@ error:
     obj = libxl__json_object_alloc(ctx->gc, JSON_NUMBER);
 
     t = libxl__zalloc(ctx->gc, len + 1);
-    strncpy(t, s, len);
+    memcpy(t, s, len);
     t[len] = 0;
 
     obj->u.string = t;
@@ -806,7 +826,7 @@ static int json_callback_map_key(void *opaque, const unsigned char *str,
 
     DEBUG_GEN_STRING(ctx, str, len);
 
-    strncpy(t, (const char *) str, len);
+    memcpy(t, (const char *) str, len);
     t[len] = 0;
 
     if (libxl__json_object_is_map(obj)) {
@@ -890,6 +910,7 @@ static int json_callback_end_array(void *opaque)
     return 1;
 }
 
+#ifdef USE_LIBYAJL_PARSER
 static yajl_callbacks callbacks = {
     json_callback_null,
     json_callback_boolean,
@@ -903,28 +924,111 @@ static yajl_callbacks callbacks = {
     json_callback_start_array,
     json_callback_end_array
 };
+#endif
 
 static void yajl_ctx_free(libxl__yajl_ctx *yajl_ctx)
 {
+#ifdef USE_LIBYAJL_PARSER
     if (yajl_ctx->hand) {
         yajl_free(yajl_ctx->hand);
         yajl_ctx->hand = NULL;
     }
+#endif
     DEBUG_GEN_FREE(yajl_ctx);
 }
 
+#ifdef USE_LIBJSONC_PARSER
+static int jso_visiter(json_object *jso,
+                       int flags,
+                       json_object *parent_jso,
+                       const char *jso_key,
+                       size_t *jso_index,
+                       void *userarg)
+{
+    enum json_type type;
+    int r;
+
+    if (jso_key && flags != JSON_C_VISIT_SECOND) {
+        json_callback_map_key(userarg, (const unsigned char*)jso_key, strlen(jso_key));
+    }
+    type = json_object_get_type(jso);
+    switch (type) {
+    case json_type_null:
+        r = json_callback_null(userarg);
+        break;
+    case json_type_boolean:
+        r = json_callback_boolean(userarg, json_object_get_boolean(jso));
+        break;
+    case json_type_int:
+    case json_type_double: {
+        // it might be better to use on of
+        // json_object_get_{int,int64,uint64,double} instead.
+        // but would need to replace json_callback_number().
+        const char *s = json_object_get_string(jso);
+        r = json_callback_number(userarg, s, strlen(s));
+        break;
+    }
+    case json_type_object:
+        if (flags != JSON_C_VISIT_SECOND) {
+            r = json_callback_start_map(userarg);
+        } else {
+            r = json_callback_end_map(userarg);
+        }
+        break;
+    case json_type_array:
+        if (flags != JSON_C_VISIT_SECOND) {
+            r = json_callback_start_array(userarg);
+        } else {
+            r = json_callback_end_array(userarg);
+        }
+        break;
+    case json_type_string: {
+        const char *s = json_object_get_string(jso);
+        const int len = json_object_get_string_len(jso);
+        r = json_callback_string(userarg, (const unsigned char*)s, len);
+        break;
+    }
+    default:
+        /* error */
+        r = 0;
+    }
+    if (r == 0)
+        return JSON_C_VISIT_RETURN_ERROR;
+    return JSON_C_VISIT_RETURN_CONTINUE;
+}
+#endif
+
 libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
 {
+#ifdef USE_LIBYAJL_PARSER
     yajl_status status;
+    unsigned char *str = NULL;
+#endif
     libxl__yajl_ctx yajl_ctx;
     libxl__json_object *o = NULL;
-    unsigned char *str = NULL;
+#ifdef USE_LIBJSONC_PARSER
+    json_object *jso;
+    enum json_tokener_error error;
+
+    jso = json_tokener_parse_verbose(s, &error);
+    if (!jso) {
+        LOG(ERROR, "json-c parse error: %s", json_tokener_error_desc(error));
+        goto out;
+    }
+#endif
 
     memset(&yajl_ctx, 0, sizeof (yajl_ctx));
     yajl_ctx.gc = gc;
 
     DEBUG_GEN_ALLOC(&yajl_ctx);
 
+#ifdef USE_LIBJSONC_PARSER
+    int r = json_c_visit(jso, 0, jso_visiter, &yajl_ctx);
+    if (r < 0) {
+        LOG(ERROR, "json_c_visit failed");
+        goto out;
+    }
+#elif defined(USE_LIBYAJL_PARSER)
     if (yajl_ctx.hand == NULL) {
         yajl_ctx.hand = libxl__yajl_alloc(&callbacks, NULL, &yajl_ctx);
     }
@@ -935,6 +1039,7 @@ libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
     status = yajl_complete_parse(yajl_ctx.hand);
     if (status != yajl_status_ok)
         goto out;
+#endif
 
     o = yajl_ctx.head;
 
@@ -943,13 +1048,20 @@ libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
     yajl_ctx.head = NULL;
 
     yajl_ctx_free(&yajl_ctx);
+#ifdef USE_LIBJSONC_PARSER
+    json_object_put(jso);
+#endif
     return o;
 
 out:
+#ifdef USE_LIBJSONC_PARSER
+    json_object_put(jso);
+#elif defined(USE_LIBYAJL_PARSER)
     str = yajl_get_error(yajl_ctx.hand, 1, (const unsigned char*)s, strlen(s));
 
     LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR, "yajl error: %s", str);
     yajl_free_error(yajl_ctx.hand, str);
+#endif
     yajl_ctx_free(&yajl_ctx);
     return NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:22:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138260.1474009 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m6Z-0003Mu-Jj; Mon, 06 Oct 2025 14:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138260.1474009; Mon, 06 Oct 2025 14: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 1v5m6Z-0003Mn-H4; Mon, 06 Oct 2025 14:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1138260;
 Mon, 06 Oct 2025 14: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 1v5m6Y-0003Mc-6v
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m6Y-00BqFm-0b
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m6Y-0067E9-0S
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=y+fh4WkOuCknSiBlR2JO2DZrapZwfdKtAl6SCGzw6uk=; b=M93S80FiymEwHwdV6wEezadBFK
	ZTHKBPxqbZwI3MPDpuIeICCgYLUH961GW2DnfLanbKk8Nheh/1JgpJOo+Vh5fJHT3ERKiw1VfX2JX
	DoPR07c0P2UZF5/u2vJ3WVK6CBl9Vtu1p/BeNDBwChW0rxHLaKRTCHn6hZNGjckL8+FA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: Convert libxl__json_object_to_yajl_gen to libxl__json_object_to_libjsonc_object
Message-Id: <E1v5m6Y-0067E9-0S@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:22:22 +0000

commit a6fd4a1c55dde987049b803a4ffc718484ca9524
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:51 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:44 2025 +0100

    libxl: Convert libxl__json_object_to_yajl_gen to libxl__json_object_to_libjsonc_object
    
    Convert yajl_gen to json_object from lib json-c.
    
    And make use of it in qmp_prepare_cmd(), which can be compiled with
    either lib.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/include/libxl_json.h        |   6 +++
 tools/libs/light/libxl_internal.h |   7 +++
 tools/libs/light/libxl_json.c     | 100 ++++++++++++++++++++++++++++++++++++++
 tools/libs/light/libxl_qmp.c      |  53 ++++++++++++++++++++
 4 files changed, 166 insertions(+)

diff --git a/tools/include/libxl_json.h b/tools/include/libxl_json.h
index f0b4871e0e..e2ef8151f0 100644
--- a/tools/include/libxl_json.h
+++ b/tools/include/libxl_json.h
@@ -15,12 +15,18 @@
 #ifndef LIBXL_JSON_H
 #define LIBXL_JSON_H
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+#endif
+
+#ifdef HAVE_LIBYAJL
 #include <yajl/yajl_gen.h>
 #include <yajl/yajl_parse.h>
 
 #ifdef HAVE_YAJL_YAJL_VERSION_H
 #  include <yajl/yajl_version.h>
 #endif
+#endif
 
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 062123eed4..5204cb8889 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -2234,9 +2234,16 @@ _hidden const libxl__json_object *libxl__json_map_get(const char *key,
  */
 _hidden libxl__json_object *libxl__json_object_alloc(libxl__gc *gc_opt,
                                                      libxl__json_node_type type);
+#ifdef HAVE_LIBJSONC
+_hidden int libxl__json_object_to_json_object(libxl__gc *gc,
+                                              json_object **jso_out,
+                                              const libxl__json_object *obj);
+#endif
+#ifdef HAVE_LIBYAJL
 _hidden yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc_opt,
                                                    yajl_gen hand,
                                                    const libxl__json_object *param);
+#endif
 _hidden void libxl__json_object_free(libxl__gc *gc_opt,
                                      libxl__json_object *obj);
 
diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index 44ee6e213f..75b383ee14 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -631,6 +631,105 @@ const libxl__json_object *libxl__json_map_get(const char *key,
     return NULL;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__json_object_to_json_object(libxl__gc *gc,
+                                      json_object **jso_out,
+                                      const libxl__json_object *obj)
+{
+    int idx = 0;
+    int rc, r;
+
+    switch (obj->type) {
+    case JSON_NULL:
+        *jso_out = json_object_new_null();
+        return 0;
+    case JSON_BOOL:
+        *jso_out = json_object_new_boolean(obj->u.b);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_INTEGER:
+        *jso_out = json_object_new_int64(obj->u.i);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_DOUBLE:
+        *jso_out = json_object_new_double(obj->u.d);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_NUMBER:
+        /*
+         * Use json_object_new_double_s() to rewrite the number exactly as
+         * we parsed it. When generating the JSON string the value `0` will
+         * be ignored and `obj->u.string` will be written instead.
+         */
+        *jso_out = json_object_new_double_s(0, obj->u.string);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_STRING:
+        *jso_out = json_object_new_string(obj->u.string);
+        if (!*jso_out)
+            return ERROR_NOMEM;
+        return 0;
+    case JSON_MAP: {
+        libxl__json_map_node *node = NULL;
+        json_object *map_root = json_object_new_object();
+        json_object *node_value;
+
+        for (idx = 0; idx < obj->u.map->count; idx++) {
+            if (flexarray_get(obj->u.map, idx, (void**)&node) != 0)
+                break;
+
+            rc = libxl__json_object_to_json_object(gc, &node_value, node->obj);
+            if (rc) {
+                json_object_put(map_root);
+                return rc;
+            }
+
+            r = json_object_object_add(map_root, node->map_key, node_value);
+            if (r < 0) {
+                json_object_put(node_value);
+                json_object_put(map_root);
+                return ERROR_FAIL;
+            }
+        }
+        *jso_out = map_root;
+        return 0;
+    }
+    case JSON_ARRAY: {
+        libxl__json_object *node = NULL;
+        json_object *array_root = json_object_new_array_ext(obj->u.array->count);
+        json_object *node_value;
+
+        for (idx = 0; idx < obj->u.array->count; idx++) {
+            if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
+                break;
+
+            rc = libxl__json_object_to_json_object(gc, &node_value, node);
+            if (rc) {
+                json_object_put(array_root);
+                return rc;
+            }
+            r = json_object_array_add(array_root, node_value);
+            if (r < 0) {
+                json_object_put(node_value);
+                json_object_put(array_root);
+                return ERROR_FAIL;
+            }
+        }
+        *jso_out = array_root;
+        return 0;
+    }
+    case JSON_ANY:
+    default:
+        /* JSON_ANY is not a valid value for obj->type. */
+        return ERROR_FAIL;
+    }
+}
+#endif
+#ifdef HAVE_LIBYAJL
 yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
                                            yajl_gen hand,
                                            const libxl__json_object *obj)
@@ -698,6 +797,7 @@ yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
     abort();
 #undef CONVERT_YAJL_GEN_TO_STATUS
 }
+#endif
 
 
 /*
diff --git a/tools/libs/light/libxl_qmp.c b/tools/libs/light/libxl_qmp.c
index 84740bd4b3..94b6fdb559 100644
--- a/tools/libs/light/libxl_qmp.c
+++ b/tools/libs/light/libxl_qmp.c
@@ -61,7 +61,11 @@
 
 #include <sys/un.h>
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+#elif defined(HAVE_LIBYAJL)
 #include <yajl/yajl_gen.h>
+#endif
 
 #include "xen_list.h"
 #include "libxl_internal.h"
@@ -481,13 +485,56 @@ static char *qmp_prepare_cmd(libxl__gc *gc, const char *cmd,
                              const libxl__json_object *args,
                              int id)
 {
+#ifdef HAVE_LIBJSONC
+    json_object *jso = NULL;
+    json_object *jso_value = NULL;
+    /* memory for 'buf' is owned by 'jso' */
+    const char *buf;
+    int rc, r;
+#elif defined(HAVE_LIBYAJL)
     yajl_gen hand = NULL;
     /* memory for 'buf' is owned by 'hand' */
     const unsigned char *buf;
     libxl_yajl_length len;
     yajl_gen_status s;
+#else
+#  error Missing JSON library
+#endif
     char *ret = NULL;
 
+#ifdef HAVE_LIBJSONC
+    jso = json_object_new_object();
+    if (!jso)
+        goto out;
+
+    jso_value = json_object_new_string(cmd);
+    if (!jso_value)
+        goto out;
+    r = json_object_object_add(jso, "execute", jso_value);
+    if (r < 0)
+        goto out;
+    jso_value = json_object_new_int(id);
+    if (!jso_value)
+        goto out;
+    r = json_object_object_add(jso, "id", jso_value);
+    if (r < 0)
+        goto out;
+    /* `jso_value` now part of `jso`, shouldn't free it anymore */
+    jso_value = NULL;
+    if (args) {
+        rc = libxl__json_object_to_json_object(gc, &jso_value, args);
+        if (rc)
+            goto out;
+        r = json_object_object_add(jso, "arguments", jso_value);
+        if (r < 0)
+            goto out;
+        jso_value = NULL;
+    }
+
+    buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN);
+    ret = libxl__sprintf(gc, "%s\r\n", buf);
+
+#elif defined(HAVE_LIBYAJL)
     hand = libxl_yajl_gen_alloc(NULL);
 
     if (!hand) {
@@ -516,9 +563,15 @@ static char *qmp_prepare_cmd(libxl__gc *gc, const char *cmd,
         goto out;
 
     ret = libxl__sprintf(gc, "%*.*s\r\n", (int)len, (int)len, buf);
+#endif
 
 out:
+#ifdef HAVE_LIBJSONC
+    json_object_put(jso_value);
+    json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
     yajl_gen_free(hand);
+#endif
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:22:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138261.1474014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m6j-0003PD-MG; Mon, 06 Oct 2025 14:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138261.1474014; Mon, 06 Oct 2025 14: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 1v5m6j-0003P4-If; Mon, 06 Oct 2025 14:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1138261;
 Mon, 06 Oct 2025 14: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 1v5m6i-0003Os-Ai
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m6i-00BqFq-0x
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m6i-0067FJ-0p
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=8FeORDHnGHpq/oYU2h+X8HiCM4jmiLAOAISiC4xDRgY=; b=X7unJpjDY4yzTrf/dsshxU3KKC
	86I3PpmaP2JYGe7YPGUOzc/eKZYCtyUQXQC1HEBL9sJu76qDFIWS19GHekfoR5rOTuLWMlNm8KEne
	YjvSUi0Nr+oXGnW60rJtDB5XJ8pqXLV0uV5gXX3luyPEAUY2h4lVCIz0Te9xHEIOIpWw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: Convert libxl__object_to_json() to json-c
Message-Id: <E1v5m6i-0067FJ-0p@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:22:32 +0000

commit f6c6f2679d49ee0a7663c087128524b60391b2dd
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:52 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:50 2025 +0100

    libxl: Convert libxl__object_to_json() to json-c
    
    - libxl changes:
    
    While doing so, we rename all "*_gen_json" function to "*_gen_jso" as
    they have different prototype. All the function pointer are been cast
    to (libxl__gen_json_callback) by "gentypes.py" when generating
    "*_to_json()" functions.
    
    We also introduce a few more "*_gen_jso" functions for "int" and
    "bool" because we can't use json_object_*() functions from json-c
    directly like it's done with yajl.
    
    To make the generation of _libxl_types*json.[ch] with both YAJL and
    json-c we add "--libjsonc" to gentypes.py so it can generate
    functions/types for both.
    
    Also introducing "jsonc_json_gen_fn" in the IDL, to be able to point
    to a different function when using json-c.
    
    Also, don't export any of the new *_gen_jso() function, at the cost of
    having "_hidden" macro in semi-public headers.
    
    - xl changes:
    
    Also, rework the implementation of printf_info() in `xl` to avoid
    using libxl_domain_config_gen_json() which isn't available without
    YAJL. The implementation using "json_object" call
    libxl_domain_config_to_json() which generate a plain string of JSON,
    which we parse to add it to our own json; this avoid a dependency on
    the json library used by libxl.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/include/libxl_json.h                |  17 ++
 tools/libs/light/Makefile                 |   2 +-
 tools/libs/light/gentypes.py              | 160 ++++++++++++++-
 tools/libs/light/idl.py                   |   7 +-
 tools/libs/light/libxl_cpuid.c            | 119 +++++++++++
 tools/libs/light/libxl_internal.h         |  16 +-
 tools/libs/light/libxl_json.c             | 316 ++++++++++++++++++++++++++++++
 tools/libs/light/libxl_types.idl          |   7 +-
 tools/libs/light/libxl_types_internal.idl |   3 +-
 tools/xl/xl_info.c                        | 102 +++++++++-
 10 files changed, 729 insertions(+), 20 deletions(-)

diff --git a/tools/include/libxl_json.h b/tools/include/libxl_json.h
index e2ef8151f0..c130e88a5e 100644
--- a/tools/include/libxl_json.h
+++ b/tools/include/libxl_json.h
@@ -28,6 +28,22 @@
 #endif
 #endif
 
+#ifdef HAVE_LIBJSONC
+#ifndef _hidden
+#define _hidden
+#endif
+_hidden int libxl__uint64_gen_jso(json_object **jso_r, uint64_t val);
+_hidden int libxl_defbool_gen_jso(json_object **jso_r, libxl_defbool *p);
+_hidden int libxl_uuid_gen_jso(json_object **jso_r, libxl_uuid *p);
+_hidden int libxl_mac_gen_jso(json_object **jso_r, libxl_mac *p);
+_hidden int libxl_bitmap_gen_jso(json_object **jso_r, libxl_bitmap *p);
+_hidden int libxl_cpuid_policy_list_gen_jso(json_object **jso_r,libxl_cpuid_policy_list *p);
+_hidden int libxl_string_list_gen_jso(json_object **jso_r,libxl_string_list *p);
+_hidden int libxl_key_value_list_gen_jso(json_object **jso_r, libxl_key_value_list *p);
+_hidden int libxl_hwcap_gen_jso(json_object **jso_r, libxl_hwcap *p);
+_hidden int libxl_ms_vm_genid_gen_jso(json_object **jso_r, libxl_ms_vm_genid *p);
+#endif
+#if defined(HAVE_LIBYAJL)
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
@@ -40,6 +56,7 @@ yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *p);
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
 yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p);
+#endif
 
 #include <_libxl_types_json.h>
 
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index c05d89db33..bc60c46558 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -226,7 +226,7 @@ testidl.o: $(XEN_INCLUDE)/libxl.h
 # This exploits the 'multi-target pattern rule' trick.
 # gentypes.py should be executed only once to make all the targets.
 _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
-	$(PYTHON) gentypes.py libxl_type$(*F).idl __libxl_type$(*F).h __libxl_type$(*F)_private.h \
+	$(PYTHON) gentypes.py $(if $(filter -ljson-c,$(XEN_JSON_LIBS)),--libjsonc) libxl_type$(*F).idl __libxl_type$(*F).h __libxl_type$(*F)_private.h \
 		__libxl_type$(*F)_json.h  __libxl_type$(*F).c
 	$(call move-if-changed,__libxl_type$(*F).h,_libxl_type$(*F).h)
 	$(call move-if-changed,__libxl_type$(*F)_private.h,_libxl_type$(*F)_private.h)
diff --git a/tools/libs/light/gentypes.py b/tools/libs/light/gentypes.py
index 3fe3873242..006bea170a 100644
--- a/tools/libs/light/gentypes.py
+++ b/tools/libs/light/gentypes.py
@@ -256,6 +256,30 @@ def libxl_C_type_member_init(ty, field):
     s += "\n"
     return s
 
+# For json-c gen_jso functions
+def libxl_C_type_gen_jso_map_key(f, parent, indent, scope_object, sub_scope_object):
+    s = ""
+    if isinstance(f.type, idl.KeyedUnion):
+        s += "switch (%s) {\n" % (parent + f.type.keyvar.name)
+        for x in f.type.fields:
+            v = f.type.keyvar.name + "." + x.name
+            s += "case %s:\n" % x.enumname
+            s += "    if (json_object_object_add(%s, \"%s\", %s)) {\n" % (scope_object, v, sub_scope_object)
+            s += "        json_object_put(%s);\n" % (sub_scope_object)
+            s += "        goto out;\n"
+            s += "    }\n"
+            s += "    break;\n"
+        s += "}\n"
+    else:
+        s += "if (json_object_object_add(%s, \"%s\", %s)) {\n" % (scope_object, f.name, sub_scope_object)
+        s += "    json_object_put(%s);\n" % (sub_scope_object)
+        s += "    goto out;\n"
+        s += "}\n"
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+# For YAJL gen_json functions
 def libxl_C_type_gen_map_key(f, parent, indent = ""):
     s = ""
     if isinstance(f.type, idl.KeyedUnion):
@@ -352,6 +376,86 @@ def get_default_expr(f, nparent, fexpr):
 
     return "%s" % fexpr
 
+# For json-c gen_json functions
+def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "jso"):
+    s = ""
+    if parent is None:
+        s += "json_object *jso;\n"
+        s += "int rc;\n"
+        sub_scope_object = "jso_sub_1"
+    else:
+        sub_scope_object = "jso_sub_%d" % (1+int(scope_object.removeprefix("jso_sub_")))
+
+    if isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    %s = json_object_new_array_ext(%s);\n" % (scope_object, parent + ty.lenvar.name)
+        s += "    if (!%s)\n" % (scope_object)
+        s += "        goto out;\n"
+        s += "    for (i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
+        s += "        json_object *%s;\n" % (sub_scope_object)
+        # remove some indent, it's over indented at least in one case libxl_vcpu_sched_params_gen_json
+        s += libxl_C_type_gen_jso(ty.elem_type, v+"[i]",
+                                   indent + "    ", parent, sub_scope_object)
+        s += "        if (json_object_array_add(%s, %s)) {\n" % (scope_object, sub_scope_object)
+        s += "            json_object_put(%s);\n" % (sub_scope_object)
+        s += "            goto out;\n"
+        s += "        }\n"
+        s += "    }\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Enumeration):
+        s += "rc = libxl__enum_gen_jso(&%s, %s_to_string(%s));\n" % (scope_object, ty.typename, ty.pass_arg(v, parent is None))
+        s += "if (rc)\n"
+        s += "    goto out;\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_gen_jso(f.type, fexpr, indent + "    ", nparent, scope_object)
+            else:
+                s += "    %s = json_object_new_object();\n" % (scope_object)
+                s += "    if (!%s)\n" % (scope_object)
+                s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_gen_fn is None):
+        s += "%s = json_object_new_object();\n" % (scope_object)
+        s += "if (!%s)\n" % (scope_object)
+        s += "    goto out;\n"
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            default_expr = get_default_expr(f, nparent, fexpr)
+            s += "if (%s) {\n" % default_expr
+            s += "    json_object *%s = NULL;\n" % (sub_scope_object)
+            s += libxl_C_type_gen_jso(f.type, fexpr, "    ", nparent, sub_scope_object)
+            s += libxl_C_type_gen_jso_map_key(f, nparent, "    ", scope_object, sub_scope_object)
+
+            s += "}\n"
+
+    else:
+        if ty.json_gen_fn is not None:
+            s += "rc = %s(&%s, %s);\n" % (ty.json_gen_fn, scope_object, ty.pass_arg(v, parent is None))
+            s += "if (rc)\n"
+            s += "    goto out;\n"
+
+    if parent is None:
+        s += "*jso_r = jso;\n"
+        s += "return 0;\n"
+        s += "out:\n"
+        s += "json_object_put(jso);\n"
+        s += "return ERROR_FAIL;\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+# For YAJL gen_json functions
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -426,9 +530,9 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
-def libxl_C_type_to_json(ty, v, indent = "    "):
+def libxl_C_type_to_json(ty, v, indent = "    ", fn_ptr_type="libxl__gen_json_callback", fn_suffix="_gen_json"):
     s = ""
-    gen = "(libxl__gen_json_callback)&%s_gen_json" % ty.typename
+    gen = "(%s)&%s%s" % (fn_ptr_type, ty.typename, fn_suffix)
     s += "return libxl__object_to_json(ctx, \"%s\", %s, (void *)%s);\n" % (ty.typename, gen, ty.pass_arg(v, passby=idl.PASS_BY_REFERENCE))
 
     if s != "":
@@ -589,14 +693,38 @@ def clean_header_define(header_path):
 
 
 if __name__ == '__main__':
+    opt_libjsonc = False
+    if len(sys.argv) == 7:
+        if sys.argv.pop(1) == "--libjsonc":
+            opt_libjsonc = True
     if len(sys.argv) != 6:
         print("Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>", file=sys.stderr)
         sys.exit(1)
 
     (_, idlname, header, header_private, header_json, impl) = sys.argv
 
+    # Overwrite `json_gen_fn` for standard types
+    if opt_libjsonc:
+        idl.bool.json_gen_fn = "libxl__boolean_gen_jso"
+        idl.size_t.json_gen_fn = "libxl__int_gen_jso"
+        idl.integer .json_gen_fn = "libxl__int_gen_jso"
+        idl.uint8.json_gen_fn = "libxl__int_gen_jso"
+        idl.uint16.json_gen_fn = "libxl__int_gen_jso"
+        idl.uint32.json_gen_fn = "libxl__int_gen_jso"
+        idl.uint64.json_gen_fn = "libxl__uint64_gen_jso"
+        idl.string.json_gen_fn = "libxl__string_gen_jso"
+
     (builtins,types) = idl.parse(idlname)
 
+    # Overwrite `json_gen_fn` with `jsonc_json_gen_fn` for types from the IDL
+    if opt_libjsonc:
+        for t in builtins:
+            if t.jsonc_json_gen_fn is not None:
+                t.json_gen_fn = t.jsonc_json_gen_fn
+        for t in types:
+            if t.jsonc_json_gen_fn is not None:
+                t.json_gen_fn = t.jsonc_json_gen_fn
+
     print("outputting libxl type definitions to %s" % header)
 
     f = open(header, "w")
@@ -665,7 +793,11 @@ if __name__ == '__main__':
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
     for ty in [ty for ty in types if ty.json_gen_fn is not None]:
-        f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        if opt_libjsonc:
+            # Always hide JSON generators base on json-c
+            f.write("%sint %s_gen_jso(json_object **jso_r, %s);\n" % ("_hidden ", ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        else:
+            f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
     f.write("""#endif /* %s */\n""" % header_json_define)
@@ -769,15 +901,25 @@ if __name__ == '__main__':
         f.write("\n")
 
     for ty in [t for t in types if t.json_gen_fn is not None]:
-        f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
-        f.write("{\n")
-        f.write(libxl_C_type_gen_json(ty, "p"))
-        f.write("}\n")
-        f.write("\n")
+        if opt_libjsonc:
+            f.write("int %s_gen_jso(json_object **jso_r, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("{\n")
+            f.write(libxl_C_type_gen_jso(ty, "p"))
+            f.write("}\n")
+            f.write("\n")
+        else:
+            f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("{\n")
+            f.write(libxl_C_type_gen_json(ty, "p"))
+            f.write("}\n")
+            f.write("\n")
 
         f.write("char *%s_to_json(libxl_ctx *ctx, %s)\n" % (ty.typename, ty.make_arg("p")))
         f.write("{\n")
-        f.write(libxl_C_type_to_json(ty, "p"))
+        if opt_libjsonc:
+            f.write(libxl_C_type_to_json(ty, "p", fn_ptr_type="libxl__gen_json_callback", fn_suffix="_gen_jso"))
+        else:
+            f.write(libxl_C_type_to_json(ty, "p", fn_ptr_type="libxl__gen_json_callback", fn_suffix="_gen_json"))
         f.write("}\n")
         f.write("\n")
 
diff --git a/tools/libs/light/idl.py b/tools/libs/light/idl.py
index d7367503b4..61c8e14004 100644
--- a/tools/libs/light/idl.py
+++ b/tools/libs/light/idl.py
@@ -79,6 +79,7 @@ class Type(object):
 
         if self.typename is not None and not self.private:
             self.json_gen_fn = kwargs.setdefault('json_gen_fn', self.typename + "_gen_json")
+            self.jsonc_json_gen_fn = kwargs.setdefault('jsonc_json_gen_fn', self.typename + "_gen_jso")
             self.json_parse_type = kwargs.setdefault('json_parse_type', "JSON_ANY")
             if self.namespace is not None:
                 self.json_parse_fn = kwargs.setdefault('json_parse_fn',
@@ -88,6 +89,7 @@ class Type(object):
                                                        self.typename + "_parse_json")
         else:
             self.json_gen_fn = kwargs.setdefault('json_gen_fn', None)
+            self.jsonc_json_gen_fn = kwargs.setdefault('jsonc_json_gen_fn', None)
             self.json_parse_type = kwargs.setdefault('json_parse_type', None)
             self.json_parse_fn = kwargs.setdefault('json_parse_fn', None)
 
@@ -142,6 +144,7 @@ class Number(Builtin):
         kwargs.setdefault('copy_fn', None)
         kwargs.setdefault('signed', False)
         kwargs.setdefault('json_gen_fn', "yajl_gen_integer")
+        kwargs.setdefault('jsonc_json_gen_fn', "libxl__int_gen_jso")
         kwargs.setdefault('json_parse_type', "JSON_INTEGER")
         # json_parse_fn might be overriden on specific type
         kwargs.setdefault('json_parse_fn', "libxl__int_parse_json")
@@ -290,6 +293,7 @@ void = Builtin("void *", namespace = None)
 bool = Builtin("bool", namespace = None,
                copy_fn=None,
                json_gen_fn = "yajl_gen_bool",
+               jsonc_json_gen_fn = "libxl__boolean_gen_jso",
                json_parse_type = "JSON_BOOL",
                json_parse_fn = "libxl__bool_parse_json",
                autogenerate_json = False)
@@ -301,10 +305,11 @@ integer = Number("int", namespace = None, signed = True)
 uint8 = UInt(8)
 uint16 = UInt(16)
 uint32 = UInt(32)
-uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json")
+uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json", jsonc_json_gen_fn = "libxl__uint64_gen_jso")
 
 string = Builtin("char *", namespace = None, copy_fn = "libxl_string_copy", dispose_fn = "free",
                  json_gen_fn = "libxl__string_gen_json",
+                 jsonc_json_gen_fn = "libxl__string_gen_jso",
                  json_parse_type = "JSON_STRING | JSON_NULL",
                  json_parse_fn = "libxl__string_parse_json",
                  autogenerate_json = False,
diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index f738e17b19..8420b2465f 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -545,6 +545,124 @@ static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
  * }
  */
 
+#ifdef HAVE_LIBJSONC
+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, libxl_cpuid_policy_list *pl)
+{
+    libxl_cpuid_policy_list policy = *pl;
+    struct xc_xend_cpuid *cpuid;
+    const struct xc_msr *msr;
+    json_object *jso_outer;
+    json_object *jso_array;
+    int i, j;
+    int r;
+    int rc = ERROR_FAIL;
+
+    jso_outer = json_object_new_object();
+    if (!jso_outer) goto out;
+
+    jso_array = json_object_new_array();
+    if (!jso_array) goto out;
+
+    r = json_object_object_add(jso_outer, "cpuid", jso_array);
+    if (r < 0) {
+        json_object_put(jso_array);
+        goto out;
+    }
+
+    if (policy == NULL || policy->cpuid == NULL) goto empty;
+    cpuid = policy->cpuid;
+
+    for (i = 0; cpuid[i].input[0] != XEN_CPUID_INPUT_UNUSED; i++) {
+        json_object *jso_inner;
+        jso_inner = json_object_new_object();
+        if (!jso_inner) goto out;
+
+        r = json_object_array_add(jso_array, jso_inner);
+        if (r < 0) {
+            json_object_put(jso_inner);
+            goto out;
+        }
+
+        for (j = 0; j < 2; j++) {
+            if (cpuid[i].input[j] != XEN_CPUID_INPUT_UNUSED) {
+                json_object *jso_value = json_object_new_int(cpuid[i].input[j]);
+                if (!jso_value) goto out;
+                r = json_object_object_add(jso_inner, input_names[j], jso_value);
+                if (r < 0) {
+                    json_object_put(jso_value);
+                    goto out;
+                }
+            }
+        }
+
+        for (j = 0; j < 4; j++) {
+            if (cpuid[i].policy[j] != NULL) {
+                json_object *jso_value = json_object_new_string_len(cpuid[i].policy[j], 32);
+                if (!jso_value) goto out;
+                r = json_object_object_add(jso_inner, policy_names[j], jso_value);
+                if (r < 0) {
+                    json_object_put(jso_value);
+                    goto out;
+                }
+            }
+        }
+    }
+
+empty:
+
+    jso_array = json_object_new_array();
+    if (!jso_array) goto out;
+
+    r = json_object_object_add(jso_outer, "msr", jso_array);
+    if (r < 0) {
+        json_object_put(jso_array);
+        goto out;
+    }
+
+    if (!policy || !policy->msr) goto done;
+    msr = policy->msr;
+
+    for (i = 0; msr[i].index != XC_MSR_INPUT_UNUSED; i++) {
+        json_object *jso_inner;
+        json_object *jso_value;
+
+        jso_inner = json_object_new_object();
+        if (!jso_inner) goto out;
+
+        r = json_object_array_add(jso_array, jso_inner);
+        if (r < 0) {
+            json_object_put(jso_inner);
+            goto out;
+        }
+
+        jso_value = json_object_new_int(msr[i].index);
+        if (!jso_value) goto out;
+        r = json_object_object_add(jso_inner, "index", jso_value);
+        if (r < 0) {
+            json_object_put(jso_value);
+            goto out;
+        }
+
+        jso_value = json_object_new_string_len(msr[i].policy, 64);
+        if (!jso_value) goto out;
+        r = json_object_object_add(jso_inner, "policy", jso_value);
+        if (r < 0) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+
+done:
+    *jso_r = jso_outer;
+    jso_outer = NULL;
+    rc = 0;
+out:
+    json_object_put(jso_outer);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pl)
 {
@@ -630,6 +748,7 @@ done:
 out:
     return s;
 }
+#endif
 
 int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         const libxl__json_object *o,
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 5204cb8889..b65e0064b9 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -1993,9 +1993,11 @@ _hidden char *libxl__cpupoolid_to_name(libxl__gc *gc, uint32_t poolid);
 _hidden int libxl__enum_from_string(const libxl_enum_string_table *t,
                                     const char *s, int *e) NN(2);
 
-_hidden yajl_gen_status libxl__string_gen_json(yajl_gen hand, const char *p);
-
+#ifdef HAVE_LIBJSONC
+typedef int (*libxl__gen_json_callback)(json_object **jso_r, void *);
+#elif defined(HAVE_LIBYAJL)
 typedef yajl_gen_status (*libxl__gen_json_callback)(yajl_gen hand, void *);
+#endif
 _hidden char *libxl__object_to_json(libxl_ctx *ctx, const char *type,
                                     libxl__gen_json_callback gen, void *p);
 
@@ -2084,11 +2086,21 @@ int libxl__recvmsg_fds(libxl__gc *gc, int carrier,
                        void *databuf, size_t datalen,
                        int nfds, int fds[], const char *what);
 
+#ifdef HAVE_LIBJSONC
+_hidden int libxl__enum_gen_jso(json_object **jso_r, const char *str);
+_hidden int libxl__int_gen_jso(json_object **jso_r, int i);
+_hidden int libxl__boolean_gen_jso(json_object **jso_r, bool b);
+_hidden int libxl__string_gen_jso(json_object **jso_r, const char *p);
+#endif
+
+#ifdef HAVE_LIBYAJL
 /* from libxl_json */
 #include <yajl/yajl_gen.h>
 
 _hidden yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str);
 _hidden yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str);
+_hidden yajl_gen_status libxl__string_gen_json(yajl_gen hand, const char *p);
+#endif
 
 typedef enum {
     JSON_NULL    = (1 << 0),
diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index 75b383ee14..eeda9c301d 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -19,12 +19,16 @@
 #ifdef HAVE_LIBJSONC
 #include <json-c/json.h>
 #define USE_LIBJSONC_PARSER
+#define USE_LIBJSONC_GEN
 #endif
 
 #ifdef HAVE_LIBYAJL
 #  ifndef USE_LIBJSONC_PARSER
 #    define USE_LIBYAJL_PARSER
 #  endif
+#  ifndef USE_LIBJSONC_GEN
+#    define USE_LIBYAJL_GEN
+#  endif
 #endif
 
 
@@ -35,7 +39,9 @@
 #ifdef USE_LIBYAJL_PARSER
 #include <yajl/yajl_parse.h>
 #endif
+#ifdef USE_LIBYAJL_GEN
 #include <yajl/yajl_gen.h>
+#endif
 
 #include "libxl_internal.h"
 
@@ -103,6 +109,21 @@ yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str)
     return yajl_gen_string(hand, (const unsigned char *)str, strlen(str));
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__enum_gen_jso(json_object **jso_r, const char *str)
+{
+    if (str) {
+        *jso_r = json_object_new_string(str);
+        if (!*jso_r)
+            return ERROR_FAIL;
+    } else {
+        *jso_r = json_object_new_null();
+    }
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str)
 {
     if (str)
@@ -110,15 +131,28 @@ yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str)
     else
         return yajl_gen_null(hand);
 }
+#endif
 
 /*
  * YAJL generators for builtin libxl types.
  */
+#ifdef HAVE_LIBJSONC
+int libxl_defbool_gen_jso(json_object **jso_r, libxl_defbool *db)
+{
+    *jso_r = json_object_new_string(libxl_defbool_to_string(*db));
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
                                        libxl_defbool *db)
 {
     return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
 }
+#endif
 
 int libxl__defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
                               libxl_defbool *p)
@@ -145,6 +179,16 @@ int libxl__defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__boolean_gen_jso(json_object **jso_r, bool b)
+{
+    *jso_r = json_object_new_boolean(b);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
 int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
                            bool *p)
 {
@@ -156,6 +200,19 @@ int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_uuid_gen_jso(json_object **jso_r, libxl_uuid *uuid)
+{
+    char buf[LIBXL_UUID_FMTLEN+1];
+    snprintf(buf, sizeof(buf), LIBXL_UUID_FMT, LIBXL_UUID_BYTES((*uuid)));
+    *jso_r = json_object_new_string_len(buf, LIBXL_UUID_FMTLEN);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
@@ -163,6 +220,7 @@ yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
     snprintf(buf, sizeof(buf), LIBXL_UUID_FMT, LIBXL_UUID_BYTES((*uuid)));
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_UUID_FMTLEN);
 }
+#endif
 
 int libxl__uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
                            libxl_uuid *p)
@@ -173,6 +231,39 @@ int libxl__uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return libxl_uuid_from_string(p, o->u.string);
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_bitmap_gen_jso(json_object **jso_r, libxl_bitmap *bitmap)
+{
+    json_object *jso;
+    int i;
+    int r;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array();
+    if (!jso) goto out;
+
+    libxl_for_each_bit(i, *bitmap) {
+        if (libxl_bitmap_test(bitmap, i)) {
+            json_object *jso_value = json_object_new_int(i);
+            if (!jso_value) goto out;
+            r = json_object_array_add(jso, jso_value);
+            if (r) {
+                json_object_put(jso_value);
+                goto out;
+            }
+        }
+    }
+
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand,
                                       libxl_bitmap *bitmap)
 {
@@ -192,6 +283,7 @@ yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand,
 out:
     return s;
 }
+#endif
 
 int libxl__bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
                             libxl_bitmap *p)
@@ -227,6 +319,42 @@ int libxl__bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_key_value_list_gen_jso(json_object **jso_r, libxl_key_value_list *pkvl)
+{
+    libxl_key_value_list kvl = *pkvl;
+    json_object *jso;
+    int i;
+
+    jso = json_object_new_object();
+    if (!jso) goto out;
+
+    if (!kvl) goto empty;
+
+    for (i = 0; kvl[i] != NULL; i += 2) {
+        json_object *jso_value;
+        if (kvl[i + 1]) {
+            jso_value = json_object_new_string(kvl[i+1]);
+            if (!jso_value) goto out;
+        } else {
+            jso_value = json_object_new_null();
+        }
+        int r = json_object_object_add(jso, kvl[i], jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+empty:
+    *jso_r = jso;
+    return 0;
+out:
+    json_object_put(jso);
+    return ERROR_FAIL;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *pkvl)
 {
@@ -253,6 +381,7 @@ empty:
 out:
     return s;
 }
+#endif
 
 int libxl__key_value_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
                                      libxl_key_value_list *p)
@@ -289,6 +418,39 @@ int libxl__key_value_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_string_list_gen_jso(json_object **jso_r, libxl_string_list *pl)
+{
+    libxl_string_list l = *pl;
+    json_object *jso;
+    int i;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array();
+    if (!jso) goto out;
+
+    if (!l) goto empty;
+
+    for (i = 0; l[i] != NULL; i++) {
+        json_object *jso_value = json_object_new_string(l[i]);
+        if (!jso_value) goto out;
+        int r = json_object_array_add(jso, jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+empty:
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *pl)
 {
     libxl_string_list l = *pl;
@@ -309,6 +471,7 @@ empty:
 out:
     return s;
 }
+#endif
 
 int libxl__string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
                                   libxl_string_list *p)
@@ -342,12 +505,26 @@ int libxl__string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_mac_gen_jso(json_object **jso_r, libxl_mac *mac)
+{
+    char buf[LIBXL_MAC_FMTLEN+1];
+    snprintf(buf, sizeof(buf), LIBXL_MAC_FMT, LIBXL_MAC_BYTES((*mac)));
+    *jso_r = json_object_new_string_len(buf, LIBXL_MAC_FMTLEN);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *mac)
 {
     char buf[LIBXL_MAC_FMTLEN+1];
     snprintf(buf, sizeof(buf), LIBXL_MAC_FMT, LIBXL_MAC_BYTES((*mac)));
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_MAC_FMTLEN);
 }
+#endif
 
 int libxl__mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
                           libxl_mac *p)
@@ -358,6 +535,36 @@ int libxl__mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return libxl__parse_mac(libxl__json_object_get_string(o), *p);
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_hwcap_gen_jso(json_object **jso_r, libxl_hwcap *p)
+{
+    json_object *jso;
+    int i;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array();
+    if (!jso) goto out;
+
+    for(i=0; i<4; i++) {
+        json_object *jso_value = json_object_new_int((*p)[i]);
+        if (!jso_value)
+            goto out;
+        int r = json_object_array_add(jso, jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand,
                                      libxl_hwcap *p)
 {
@@ -375,6 +582,7 @@ yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand,
 out:
     return s;
 }
+#endif
 
 int libxl__hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
                             libxl_hwcap *p)
@@ -397,6 +605,37 @@ int libxl__hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_ms_vm_genid_gen_jso(json_object **jso_r, libxl_ms_vm_genid *p)
+{
+    json_object *jso;
+    int i;
+    int rc = ERROR_FAIL;
+
+    jso = json_object_new_array_ext(LIBXL_MS_VM_GENID_LEN);
+    if (!jso) goto out;
+
+    for (i = 0; i < LIBXL_MS_VM_GENID_LEN; i++) {
+        json_object *jso_value = json_object_new_int(p->bytes[i]);
+        if (!jso_value)
+            goto out;
+        int r = json_object_array_add(jso, jso_value);
+        if (r) {
+            json_object_put(jso_value);
+            goto out;
+        }
+    }
+
+    *jso_r = jso;
+    jso = NULL;
+    rc = 0;
+out:
+    json_object_put(jso);
+    return rc;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p)
 {
     yajl_gen_status s;
@@ -414,6 +653,7 @@ yajl_gen_status libxl_ms_vm_genid_gen_json(yajl_gen hand, libxl_ms_vm_genid *p)
 
     return yajl_gen_array_close(hand);
 }
+#endif
 
 int libxl__ms_vm_genid_parse_json(libxl__gc *gc, const libxl__json_object *o,
                                   libxl_ms_vm_genid *p)
@@ -436,6 +676,21 @@ int libxl__ms_vm_genid_parse_json(libxl__gc *gc, const libxl__json_object *o,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__string_gen_jso(json_object **jso_r, const char *p)
+{
+    if (p) {
+        *jso_r = json_object_new_string(p);
+        if (!*jso_r)
+            return ERROR_FAIL;
+    } else {
+        *jso_r = json_object_new_null();
+    }
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__string_gen_json(yajl_gen hand,
                                        const char *p)
 {
@@ -444,6 +699,7 @@ yajl_gen_status libxl__string_gen_json(yajl_gen hand,
     else
         return yajl_gen_null(hand);
 }
+#endif
 
 int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
                              char **p)
@@ -1166,6 +1422,7 @@ out:
     return NULL;
 }
 
+#ifdef USE_LIBYAJL_GEN
 static const char *yajl_gen_status_to_string(yajl_gen_status s)
 {
         switch (s) {
@@ -1190,7 +1447,43 @@ static const char *yajl_gen_status_to_string(yajl_gen_status s)
             return "unknown error";
         }
 }
+#endif
+
+#ifdef USE_LIBJSONC_GEN
+char *libxl__object_to_json(libxl_ctx *ctx, const char *type,
+                            libxl__gen_json_callback gen, void *p)
+{
+    const char *buf;
+    char *ret = NULL;
+    json_object *jso = NULL;
+    int rc;
+
+    rc = gen(&jso, p);
+    if (rc)
+        goto out;
+
+    buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PRETTY);
+    if (!buf)
+        goto out;
+    ret = strdup((const char *)buf);
+
+out:
+    json_object_put(jso);
+
+    if (rc) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "unable to convert %s to JSON representation. ",
+                   type);
+    } else if (!ret) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "unable to allocate space for to JSON representation of %s",
+                   type);
+    }
+
+    return ret;
+}
 
+#elif defined(USE_LIBYAJL_GEN)
 char *libxl__object_to_json(libxl_ctx *ctx, const char *type,
                             libxl__gen_json_callback gen, void *p)
 {
@@ -1229,6 +1522,7 @@ out:
 
     return ret;
 }
+#endif
 
 char *libxl__json_object_to_json(libxl__gc *gc,
                                  const libxl__json_object *args)
@@ -1262,6 +1556,17 @@ out:
     return ret;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__uint64_gen_jso(json_object **jso_r, uint64_t val)
+{
+    *jso_r = json_object_new_uint64(val);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val)
 {
     char *num;
@@ -1282,6 +1587,7 @@ yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val)
 out:
     return s;
 }
+#endif
 
 int libxl__object_from_json(libxl_ctx *ctx, const char *type,
                             libxl__json_parse_callback parse,
@@ -1313,6 +1619,16 @@ out:
     return rc;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl__int_gen_jso(json_object **jso_r, int i)
+{
+    *jso_r = json_object_new_int(i);
+    if (!*jso_r)
+        return ERROR_FAIL;
+    return 0;
+}
+#endif
+
 int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
                           void *p)
 {
diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl
index b53e013a44..d64a573ff3 100644
--- a/tools/libs/light/libxl_types.idl
+++ b/tools/libs/light/libxl_types.idl
@@ -7,9 +7,9 @@ namespace("libxl_")
 
 libxl_defbool = Builtin("defbool", json_parse_type="JSON_STRING", passby=PASS_BY_REFERENCE, copy_fn=None,
                         check_default_fn="libxl__defbool_is_default")
-libxl_domid = Builtin("domid", json_gen_fn = "yajl_gen_integer", json_parse_fn = "libxl__uint32_parse_json",
+libxl_domid = Builtin("domid", json_gen_fn = "yajl_gen_integer", jsonc_json_gen_fn = "libxl__uint64_gen_jso", json_parse_fn = "libxl__uint32_parse_json",
                       json_parse_type = "JSON_INTEGER", autogenerate_json = False, copy_fn=None)
-libxl_devid = Builtin("devid", json_gen_fn = "yajl_gen_integer", json_parse_fn = "libxl__int_parse_json",
+libxl_devid = Builtin("devid", json_gen_fn = "yajl_gen_integer", jsonc_json_gen_fn = "libxl__int_gen_jso", json_parse_fn = "libxl__int_parse_json",
                       json_parse_type = "JSON_INTEGER", autogenerate_json = False, signed = True, init_val="-1",
                       copy_fn=None)
 libxl_uuid = Builtin("uuid", json_parse_type="JSON_STRING", passby=PASS_BY_REFERENCE, check_default_fn="libxl_uuid_is_nil",
@@ -37,7 +37,8 @@ libxl_ms_vm_genid = Builtin("ms_vm_genid", passby=PASS_BY_REFERENCE, check_defau
 # Specific integer types
 #
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_gen_fn = "libxl__uint64_gen_json")
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT",
+             json_gen_fn = "libxl__uint64_gen_json", jsonc_json_gen_fn = "libxl__uint64_gen_jso")
 
 #
 # Constants / Enumerations
diff --git a/tools/libs/light/libxl_types_internal.idl b/tools/libs/light/libxl_types_internal.idl
index 0425e9b6b0..ab4ee92870 100644
--- a/tools/libs/light/libxl_types_internal.idl
+++ b/tools/libs/light/libxl_types_internal.idl
@@ -1,7 +1,8 @@
 namespace("libxl__")
 hidden(True)
 
-libxl_domid = Builtin("domid", namespace="libxl_", json_gen_fn = "yajl_gen_integer",
+libxl_domid = Builtin("domid", namespace="libxl_",
+                      json_gen_fn = "yajl_gen_integer", jsonc_json_gen_fn = "libxl__uint64_gen_jso",
 		      json_parse_fn = "libxl__uint32_parse_json", json_parse_type = "JSON_INTEGER",
 		      autogenerate_json = False, copy_fn = None)
 
diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 83a02f45fe..80a3b25aac 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -60,6 +60,48 @@ static int maybe_printf(const char *fmt, ...)
     return count;
 }
 
+
+#ifdef HAVE_LIBJSONC
+static int printf_info_one_json(json_object **jso_r, int domid,
+                                libxl_domain_config *d_config)
+{
+    json_object *jso = NULL;
+    json_object *jso_config = NULL;
+    enum json_tokener_error error;
+    char *s = NULL;
+    int r = EXIT_FAILURE;
+
+    s = libxl_domain_config_to_json(ctx, d_config);
+    jso_config = json_tokener_parse_verbose(s, &error);
+    if (!jso_config) {
+        fprintf(stderr, "fail to parse JSON from libxl_domain_config_to_json(): %s\n",
+                json_tokener_error_desc(error));
+        goto out;
+    }
+
+    jso = json_object_new_object();
+    if (domid != -1)
+        json_object_object_add(jso, "domid", json_object_new_int(domid));
+    else
+        json_object_object_add(jso, "domid", json_object_new_null());
+
+
+    json_object_object_add(jso, "config", jso_config);
+    jso_config = NULL;
+
+    *jso_r = jso;
+    jso = NULL;
+    r = EXIT_SUCCESS;
+
+out:
+    free(s);
+    json_object_put(jso);
+    json_object_put(jso_config);
+    return r;
+}
+
+#elif defined(HAVE_LIBYAJL)
+
 static yajl_gen_status printf_info_one_json(yajl_gen hand, int domid,
                                             libxl_domain_config *d_config)
 {
@@ -95,6 +137,7 @@ static yajl_gen_status printf_info_one_json(yajl_gen hand, int domid,
 out:
     return s;
 }
+#endif
 
 void printf_info(enum output_format output_format,
                  int domid,
@@ -103,6 +146,27 @@ void printf_info(enum output_format output_format,
     if (output_format == OUTPUT_FORMAT_SXP)
         return printf_info_sexp(domid, d_config, fh);
 
+#ifdef HAVE_LIBJSONC
+    int r;
+    const char *buf;
+    json_object *jso;
+
+    r = printf_info_one_json(&jso, domid, d_config);
+    if (r)
+        goto out;
+
+    buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PRETTY);
+    if (!buf)
+        goto out;
+
+    fputs(buf, fh);
+
+out:
+    json_object_put(jso);
+    flush_stream(fh);
+    return;
+
+#elif defined(HAVE_LIBYAJL)
     const char *buf;
     libxl_yajl_length len = 0;
     yajl_gen_status s;
@@ -132,6 +196,7 @@ out:
                 "unable to format domain config as JSON (YAJL:%d)\n", s);
 
     flush_stream(fh);
+#endif
 }
 
 static void output_xeninfo(void)
@@ -476,11 +541,20 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
 
     int i, rc;
 
+    const char *buf;
+#ifdef HAVE_LIBJSONC
+    json_object *jso = NULL;
+#elif defined(HAVE_LIBYAJL)
     yajl_gen hand = NULL;
     yajl_gen_status s;
-    const char *buf;
     libxl_yajl_length yajl_len = 0;
+#endif
 
+#ifdef HAVE_LIBJSONC
+    if (default_output_format == OUTPUT_FORMAT_JSON) {
+        jso = json_object_new_array();
+    }
+#elif defined(HAVE_LIBYAJL)
     if (default_output_format == OUTPUT_FORMAT_JSON) {
         hand = libxl_yajl_gen_alloc(NULL);
         if (!hand) {
@@ -493,6 +567,7 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
             goto out;
     } else
         s = yajl_gen_status_ok;
+#endif
 
     for (i = 0; i < nb_domain; i++) {
         libxl_domain_config_init(&d_config);
@@ -500,16 +575,32 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
                                                  &d_config, NULL);
         if (rc)
             continue;
-        if (default_output_format == OUTPUT_FORMAT_JSON)
+        if (default_output_format == OUTPUT_FORMAT_JSON) {
+#ifdef HAVE_LIBJSONC
+            json_object *jso_value;
+            rc = printf_info_one_json(&jso_value, info[i].domid, &d_config);
+            json_object_array_add(jso, jso_value);
+#elif defined(HAVE_LIBYAJL)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
-        else
+#endif
+        } else
             printf_info_sexp(info[i].domid, &d_config, stdout);
         libxl_domain_config_dispose(&d_config);
+#ifdef HAVE_LIBJSONC
+        if (rc)
+            goto out;
+#elif defined(HAVE_LIBYAJL)
         if (s != yajl_gen_status_ok)
             goto out;
+#endif
     }
 
     if (default_output_format == OUTPUT_FORMAT_JSON) {
+#ifdef HAVE_LIBJSONC
+        buf = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PRETTY);
+        if (!buf)
+            goto out;
+#elif defined(HAVE_LIBYAJL)
         s = yajl_gen_array_close(hand);
         if (s != yajl_gen_status_ok)
             goto out;
@@ -517,16 +608,21 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
         s = yajl_gen_get_buf(hand, (const unsigned char **)&buf, &yajl_len);
         if (s != yajl_gen_status_ok)
             goto out;
+#endif
 
         puts(buf);
     }
 
 out:
     if (default_output_format == OUTPUT_FORMAT_JSON) {
+#ifdef HAVE_LIBJSONC
+        json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
         yajl_gen_free(hand);
         if (s != yajl_gen_status_ok)
             fprintf(stderr,
                     "unable to format domain config as JSON (YAJL:%d)\n", s);
+#endif
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:22:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138265.1474017 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m6t-0003S2-Oy; Mon, 06 Oct 2025 14:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138265.1474017; Mon, 06 Oct 2025 14: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 1v5m6t-0003Rv-MV; Mon, 06 Oct 2025 14:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1138265;
 Mon, 06 Oct 2025 14: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 1v5m6s-0003Rm-Di
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m6s-00BqIH-1I
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m6s-0067Gh-18
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=GHblmCFvlTcpEG9J0tiqAaGcCxDMghzRbpWOdu31sXU=; b=xs07iovdz50uNUOSib4nHE2nlj
	HZu6/P9vuTUOsGuV6vLr0rY+E2KiHwl/TAemDGG7qUu37ae21xDXUtQ+PV4EcWoJs++rfH5tXGf2e
	ln2kgEbvpeNEqQRZflS7z/1piTmeLbPeq6bEcHWyYAqg1uun4/OGMpQdPwVpjIRhvN4s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: Convert libxl__json_object_to_json() to json_object
Message-Id: <E1v5m6s-0067Gh-18@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:22:42 +0000

commit 75fa670e582cdee7d8ac639d0cb9932b8867f740
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:53 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:55 2025 +0100

    libxl: Convert libxl__json_object_to_json() to json_object
    
    But keep the implementation done for YAJL.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/libs/light/libxl_json.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index eeda9c301d..c76ae9f64a 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -104,10 +104,12 @@ typedef struct libxl__yajl_ctx {
  * YAJL Helper
  */
 
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str)
 {
     return yajl_gen_string(hand, (const unsigned char *)str, strlen(str));
 }
+#endif
 
 #ifdef HAVE_LIBJSONC
 int libxl__enum_gen_jso(json_object **jso_r, const char *str)
@@ -1527,6 +1529,29 @@ out:
 char *libxl__json_object_to_json(libxl__gc *gc,
                                  const libxl__json_object *args)
 {
+#ifdef HAVE_LIBJSONC
+    const char *buf;
+    json_object *root;
+    char *ret = NULL;
+    int rc;
+
+    if (!args)
+        return NULL;
+
+    rc = libxl__json_object_to_json_object(gc, &root, args);
+    if (rc)
+        goto out;
+
+    buf = json_object_to_json_string_ext(root, JSON_C_TO_STRING_PRETTY);
+    if (!buf)
+        goto out;
+
+    ret = libxl__strdup(gc, buf);
+
+out:
+    json_object_put(root);
+    return ret;
+#elif defined(HAVE_LIBYAJL)
     const unsigned char *buf;
     libxl_yajl_length len;
     yajl_gen_status s;
@@ -1554,6 +1579,7 @@ char *libxl__json_object_to_json(libxl__gc *gc,
 out:
     yajl_gen_free(hand);
     return ret;
+#endif
 }
 
 #ifdef HAVE_LIBJSONC
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:22:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138267.1474021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m73-0003UG-Qm; Mon, 06 Oct 2025 14:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138267.1474021; Mon, 06 Oct 2025 14: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 1v5m73-0003U8-O0; Mon, 06 Oct 2025 14:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1138267;
 Mon, 06 Oct 2025 14: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 1v5m72-0003Tx-Gl
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m72-00BqIe-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m72-0067Hb-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=LNaU5Citymggwzi1xQovsb1oZKe3J+dauByWULF56uU=; b=sm89VGCaqA7rYdRZsu+ZyIn3GT
	Lxbgpjnpa81AHc6lCZ8tYKjjH/A1mnlzKVA/4iUQRqSaY6MxHD2oPruq5QJf3j4fRA6iMrnuMVIZv
	Rthm9aillIABF9BXWjU9xQH2+X0n6IVljrDVqDCOMs8+qLQDrUqRYhxEFhSYHcJI2fO8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxenstat: Use json-c when available
Message-Id: <E1v5m72-0067Hb-1T@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:22:52 +0000

commit c4abe30ca6e4270a5eb941be5330c206a52f6fb2
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:54 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:59 2025 +0100

    tools/libxenstat: Use json-c when available
    
    This is mainly a copy of the existing code in yajl and use json-c
    instead.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/libs/stat/Makefile      |   2 +-
 tools/libs/stat/xenstat_qmp.c | 126 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 120 insertions(+), 8 deletions(-)

diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile
index a968eaff48..3151ee9f12 100644
--- a/tools/libs/stat/Makefile
+++ b/tools/libs/stat/Makefile
@@ -24,7 +24,7 @@ OBJS-$(CONFIG_SunOS) += xenstat_solaris.o
 OBJS-$(CONFIG_NetBSD) += xenstat_netbsd.o
 OBJS-$(CONFIG_FreeBSD) += xenstat_freebsd.o
 
-LDLIBS-y += -lyajl
+LDLIBS-y += $(XEN_JSON_LIBS)
 LDLIBS-$(CONFIG_SunOS) += -lkstat
 LDLIBS += $(LDLIBS-y)
 
diff --git a/tools/libs/stat/xenstat_qmp.c b/tools/libs/stat/xenstat_qmp.c
index 9909b9727e..21e321fffa 100644
--- a/tools/libs/stat/xenstat_qmp.c
+++ b/tools/libs/stat/xenstat_qmp.c
@@ -24,6 +24,10 @@
 
 #include "xenstat_priv.h"
 
+#ifdef HAVE_LIBJSONC
+#include <json-c/json.h>
+
+#elif defined(HAVE_LIBYAJL)
 #ifdef HAVE_YAJL_YAJL_VERSION_H
 #  include <yajl/yajl_version.h>
 #endif
@@ -32,11 +36,13 @@
 #if defined(YAJL_MAJOR) && (YAJL_MAJOR > 1)
 #  define HAVE_YAJL_V2 1
 #endif
+#endif
 
 #ifdef HAVE_YAJL_V2
-
 #include <yajl/yajl_tree.h>
+#endif
 
+#if defined(HAVE_LIBJSONC) || defined(HAVE_YAJL_V2)
 static unsigned char *qmp_query(int, const char *);
 
 enum query_blockstats {
@@ -76,9 +82,10 @@ enum query_block {
             "type": 'str'
           }]}
 */
-static char *qmp_get_block_image(xenstat_node *node, char *qmp_devname, int qfd)
+static char *qmp_get_block_image(xenstat_node *node, const char *qmp_devname, int qfd)
 {
-	char *tmp, *file = NULL;
+	const char *tmp;
+	char *file = NULL;
 	const char *query_block_cmd = "{ \"execute\": \"query-block\" }";
 	static const char *const qblock[] = {
 		[ QMP_BLOCK_RETURN  ] = "return",
@@ -88,13 +95,56 @@ static char *qmp_get_block_image(xenstat_node *node, char *qmp_devname, int qfd)
 	};
 	const char *ptr[] = {0, 0};
 	unsigned char *qmp_stats;
-	yajl_val info, ret_obj, dev_obj, n;
 	int i;
 
 	if ((qmp_stats = qmp_query(qfd, query_block_cmd)) == NULL)
 		return NULL;
 
+#ifdef HAVE_LIBJSONC
+	json_object *jso;
+	enum json_tokener_error error;
+	jso = json_tokener_parse_verbose((const char *)qmp_stats, &error);
+	free(qmp_stats);
+	if (jso == NULL)
+		return NULL;
+
+	ptr[0] = qblock[QMP_BLOCK_RETURN]; /* "return" */
+	json_object *ret_jso = json_object_object_get(jso, ptr[0]);
+	if (ret_jso == NULL)
+		goto done;
+
+	for (i=0; i<json_object_array_length(ret_jso); i++) {
+		json_object *n = json_object_array_get_idx(ret_jso, i);
+
+		ptr[0] = qblock[QMP_BLOCK_DEVICE]; /* "device" */
+		json_object *dev_jso = json_object_object_get(n, ptr[0]);
+		if (dev_jso) {
+			tmp = json_object_get_string(dev_jso);
+			if (!tmp || strcmp(qmp_devname, tmp))
+				continue;
+		} else {
+			continue;
+		}
+
+		ptr[0] = qblock[QMP_INSERTED]; /* "inserted" */
+		n = json_object_object_get(n, ptr[0]);
+		if (n) {
+			ptr[0] = qblock[QMP_FILE]; /* "file" */
+			n = json_object_object_get(n, ptr[0]);
+			if (n && json_object_is_type(n, json_type_string)) {
+				tmp = json_object_get_string(n);
+				file = malloc(strlen(tmp)+1);
+				if (file != NULL)
+					strcpy(file, tmp);
+				goto done;
+			}
+		}
+	}
+done:
+	json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
 	/* Use libyajl version 2.0.3 or newer for the tree parser feature with bug fixes */
+	yajl_val info, ret_obj, dev_obj, n;
 	info = yajl_tree_parse((char *)qmp_stats, NULL, 0);
 	free(qmp_stats);
 	if (info == NULL)
@@ -132,12 +182,13 @@ static char *qmp_get_block_image(xenstat_node *node, char *qmp_devname, int qfd)
 	}
 done:
 	yajl_tree_free(info);
+#endif
 	return file;
 }
 
 
 /* Given a QMP device name, lookup the associated xenstore qdisk device id */
-static void lookup_xenstore_devid(xenstat_node * node, unsigned int domid, char *qmp_devname,
+static void lookup_xenstore_devid(xenstat_node * node, unsigned int domid, const char *qmp_devname,
 	int qfd, unsigned int *dev, unsigned int *sector_size)
 {
 	char **dev_ids, *tmp, *ptr, *image, path[80];
@@ -191,7 +242,7 @@ static void lookup_xenstore_devid(xenstat_node * node, unsigned int domid, char
 /* Parse the stats buffer which contains I/O data for all the disks belonging to domid */
 static void qmp_parse_stats(xenstat_node *node, unsigned int domid, unsigned char *stats_buf, int qfd)
 {
-	char *qmp_devname;
+	const char *qmp_devname;
 	static const char *const qstats[] = {
 		[ QMP_STATS_RETURN  ] = "return",
 		[ QMP_STATS_DEVICE  ] = "device",
@@ -202,12 +253,72 @@ static void qmp_parse_stats(xenstat_node *node, unsigned int domid, unsigned cha
 		[ QMP_WR_OPERATIONS ] = "wr_operations",
 	};
 	const char *ptr[] = {0, 0};
-	yajl_val info, ret_obj, stats_obj, n;
 	xenstat_vbd vbd;
 	xenstat_domain *domain;
 	unsigned int sector_size = 512;
 	int i, j;
 
+#ifdef HAVE_LIBJSONC
+	json_object *jso, *ret_jso, *stats_obj, *n;
+	enum json_tokener_error error;
+
+	jso = json_tokener_parse_verbose((const char *)stats_buf, &error);
+	if (jso == NULL)
+		return;
+
+	ptr[0] = qstats[QMP_STATS_RETURN]; /* "return" */
+	ret_jso = json_object_object_get(jso, ptr[0]);
+	if (ret_jso == NULL)
+		goto done;
+
+	/* Array of devices */
+	for (i=0; i<json_object_array_length(ret_jso); i++) {
+		memset(&vbd, 0, sizeof(xenstat_vbd));
+		qmp_devname = NULL;
+		stats_obj = json_object_array_get_idx(ret_jso, i);
+
+		ptr[0] = qstats[QMP_STATS_DEVICE]; /* "device" */
+		n = json_object_object_get(stats_obj, ptr[0]);
+		if (n)
+			qmp_devname = json_object_get_string(n);
+
+		ptr[0] = qstats[QMP_STATS]; /* "stats" */
+		stats_obj = json_object_object_get(stats_obj, ptr[0]);
+		if (stats_obj && json_object_is_type(stats_obj, json_type_object)) {
+			for (j=3; j<7; j++) {
+				ptr[0] = qstats[j];
+				n = json_object_object_get(stats_obj, ptr[0]);
+				if (n && json_object_is_type(n, json_type_int)) {
+					switch(j) {
+					case QMP_RD_BYTES: /* "rd_bytes" */
+						vbd.rd_sects = json_object_get_int64(n) / sector_size;
+						break;
+					case QMP_WR_BYTES: /* "wr_bytes" */
+						vbd.wr_sects = json_object_get_int64(n) / sector_size;
+						break;
+					case QMP_RD_OPERATIONS: /* "rd_operations" */
+						vbd.rd_reqs = json_object_get_int64(n);
+						break;
+					case QMP_WR_OPERATIONS: /* "wr_operations" */
+						vbd.wr_reqs = json_object_get_int64(n);
+						break;
+					}
+				}
+			}
+			/* With the QMP device name, lookup the xenstore qdisk device ID and set vdb.dev */
+			if (qmp_devname)
+				lookup_xenstore_devid(node, domid, qmp_devname, qfd, &vbd.dev, &sector_size);
+			if ((domain = xenstat_node_domain(node, domid)) == NULL)
+				continue;
+			if ((xenstat_save_vbd(domain, &vbd)) == NULL)
+				goto done;
+		}
+	}
+done:
+	json_object_put(jso);
+#elif defined(HAVE_LIBYAJL)
+	yajl_val info, ret_obj, stats_obj, n;
+
 	/* Use libyajl version 2.0.3 or newer for the tree parser feature */
 	if ((info = yajl_tree_parse((char *)stats_buf, NULL, 0)) == NULL)
 		return;
@@ -260,6 +371,7 @@ static void qmp_parse_stats(xenstat_node *node, unsigned int domid, unsigned cha
 	}
 done:
 	yajl_tree_free(info);
+#endif
 }
 
 /* Write a command via the QMP. Returns number of bytes written */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:23:03 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138269.1474024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m7D-0003Wb-SA; Mon, 06 Oct 2025 14:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138269.1474024; Mon, 06 Oct 2025 14: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 1v5m7D-0003WT-Pa; Mon, 06 Oct 2025 14:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1138269;
 Mon, 06 Oct 2025 14: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 1v5m7C-0003WL-K0
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m7C-00BqIw-1u
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m7C-0067I8-1n
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=w966NKjwsRAJ59utgDw4SjUjNEnBmMLCxluTw/jO814=; b=rCEiOhRtrneFCTNzEwEcbJk6yU
	FQx3kiRaUb0twWEjKwyaSAZLCe/M2wtRv8HwaHWGZIOFgysu8udXXr3iol7RxuUc19GtgEGq61WFt
	Os78ZMeo/PgAYVY0zxzaEqauyX0mTAhAKHSgrGdVDuLepO5CAIJ8ZL2yNLi4JJJoqwe4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] configure: Use json-c by default, fallback to yajl
Message-Id: <E1v5m7C-0067I8-1n@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:23:02 +0000

commit c71d8ef0cca37b11b83f303feebfedce2621994a
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:55 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:59 2025 +0100

    configure: Use json-c by default, fallback to yajl
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/configure    | 85 +++++++++++++++++++++++++++++++++++-------------------
 tools/configure.ac | 12 ++++----
 2 files changed, 63 insertions(+), 34 deletions(-)

diff --git a/tools/configure b/tools/configure
index edd1701b2d..0eb7a0ab6a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9692,41 +9692,57 @@ fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$libjsonc_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (json-c) were not met:
-
-$libjsonc_PKG_ERRORS
+	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
+printf %s "checking for yajl_alloc in -lyajl... " >&6; }
+if test ${ac_cv_lib_yajl_yajl_alloc+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lyajl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char yajl_alloc ();
+int
+main (void)
+{
+return yajl_alloc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_yajl_yajl_alloc=yes
+else $as_nop
+  ac_cv_lib_yajl_yajl_alloc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
+printf "%s\n" "$ac_cv_lib_yajl_yajl_alloc" >&6; }
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes
+then :
+  YAJL_LIBS=-lyajl
 
-Alternatively, you may set the environment variables libjsonc_CFLAGS
-and libjsonc_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
-     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-	{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
 
-Alternatively, you may set the environment variables libjsonc_CFLAGS
-and libjsonc_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
+printf "%s\n" "#define HAVE_LIBYAJL 1" >>confdefs.h
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
-	libjsonc_CFLAGS=$pkg_cv_libjsonc_CFLAGS
-	libjsonc_LIBS=$pkg_cv_libjsonc_LIBS
-        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
+else $as_nop
+  as_fn_error $? "Could not find yajl" "$LINENO" 5
+fi
 
-printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h
 
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
+elif test $pkg_failed = untried; then
+     	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 printf %s "checking for yajl_alloc in -lyajl... " >&6; }
 if test ${ac_cv_lib_yajl_yajl_alloc+y}
 then :
@@ -9772,6 +9788,17 @@ else $as_nop
   as_fn_error $? "Could not find yajl" "$LINENO" 5
 fi
 
+
+else
+	libjsonc_CFLAGS=$pkg_cv_libjsonc_CFLAGS
+	libjsonc_LIBS=$pkg_cv_libjsonc_LIBS
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define HAVE_LIBJSONC 1" >>confdefs.h
+
+fi
+
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 printf %s "checking for deflateCopy in -lz... " >&6; }
 if test ${ac_cv_lib_z_deflateCopy+y}
diff --git a/tools/configure.ac b/tools/configure.ac
index bb40b5b3f0..7267d02a04 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -425,11 +425,13 @@ AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
 PKG_CHECK_MODULES([libjsonc], [json-c],
-    [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])])
-AC_CHECK_LIB([yajl], [yajl_alloc],
-   [AC_SUBST([YAJL_LIBS],[-lyajl])
-    AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' library (-lyajl).])],
-    [AC_MSG_ERROR([Could not find yajl])])
+    [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])],
+    [AC_CHECK_LIB([yajl], [yajl_alloc],
+        [AC_SUBST([YAJL_LIBS],[-lyajl])
+         AC_DEFINE([HAVE_LIBYAJL],[1],[Define to 1 if you have the `yajl' library (-lyajl).])],
+        [AC_MSG_ERROR([Could not find yajl])])
+])
+
 AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
 AC_CHECK_HEADER([argp.h], [
 AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 06 14:23:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Oct 2025 14:23:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138270.1474029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v5m7N-0003Yf-TS; Mon, 06 Oct 2025 14:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138270.1474029; Mon, 06 Oct 2025 14: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 1v5m7N-0003YX-Qz; Mon, 06 Oct 2025 14:23:13 +0000
Received: by outflank-mailman (input) for mailman id 1138270;
 Mon, 06 Oct 2025 14: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 1v5m7M-0003YO-MX
 for xen-changelog@lists.xenproject.org; Mon, 06 Oct 2025 14: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 1v5m7M-00BqJ0-29
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v5m7M-0067Js-25
 for xen-changelog@lists.xenproject.org;
 Mon, 06 Oct 2025 14: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=iNUPHSRnGvqn/0KYmsvO7DKf005WeGYHLxk3lqTgIco=; b=dIqxFN4HhZcfno6h2Wx8WGSbRP
	6KHeIHzw2Rw0d0td0k3ZP02CgGXmhI2NKU5RnL2T897e5m1hd6gMZJmKqDE866TIUF9T4vjeWrh1o
	j88YxKDbVHE9obozySRthqqI3FzY8KvBS99v8Q4eKuLiVcD3HKswGxMUXOd81oM3VYEw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Update CHANGELOG and README with dependency on json-c
Message-Id: <E1v5m7M-0067Js-25@xenbits.xenproject.org>
Date: Mon, 06 Oct 2025 14:23:12 +0000

commit acaecf31ea1d566a20b5ee9c0f1f3cb4ee0ec9c2
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Mon Sep 29 14:07:56 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 6 12:36:59 2025 +0100

    Update CHANGELOG and README with dependency on json-c
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 CHANGELOG.md | 2 ++
 README       | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b9518ff08..5c70bc0250 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - Debian Trixie added to CI.  Debian Bullseye retired from CI for RISC-V due
    to the baseline change.
  - Linux based device model stubdomains are now fully supported.
+ - New dependency on library json-c, the toolstack will prefer it to `YAJL`
+   when available.
 
  - On x86:
    - Restrict the cache flushing done as a result of guest physical memory map
diff --git a/README b/README
index 6ee58f7b35..9329f30e13 100644
--- a/README
+++ b/README
@@ -53,7 +53,7 @@ provided by your OS distributor:
     * Development install of Python 2.7 or later (e.g., python-dev)
     * Development install of curses (e.g., libncurses-dev)
     * Development install of uuid (e.g. uuid-dev)
-    * Development install of yajl (e.g. libyajl-dev)
+    * Development install of json-c (e.g. libjson-c-dev) or yajl (e.g. libyajl-dev)
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 14:22:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 14:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138912.1474482 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v68Zm-0004PD-PH; Tue, 07 Oct 2025 14:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138912.1474482; Tue, 07 Oct 2025 14: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 1v68Zm-0004P5-Mf; Tue, 07 Oct 2025 14:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1138912;
 Tue, 07 Oct 2025 14: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 1v68Zm-0004Oz-0P
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 14: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 1v68Zl-00DVrl-34
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v68Zl-008kEP-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14: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=FfFr7fZaNJalotyNTjPdDL918tmpAsTyKNFiP+DWlQ4=; b=YRqfunzaYSUrXEc8TR2bEcKDLR
	COx16UbkJ/YpbB4qHN49sMujkyzOGF0m1cOAOEyrJABH1cq3HcNbFl+95zxCuK2yOaK6wumWUhgmj
	Y3i8AuVSHp2uMtSUtpn5FTfTTJd7Acx2IoJJ07JGemelb2lyOmGv1Uar1O99M/BPkjJg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: install libinotify for FreeBSD
Message-Id: <E1v68Zl-008kEP-2x@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 14:22:01 +0000

commit ed53b7cb1bb2b39346f916a8de543860f18c33d0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 7 09:00:54 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    cirrus-ci: install libinotify for FreeBSD
    
    FreeBSD QEMU build requires libinotify, otherwise the build fails with:
    
    ./qemu-xen-dir-remote/meson.build:2535:15: ERROR: C shared or static library 'inotify' not found
    
    Install the package and add the /usr/local include and libs paths
    explicitly as QEMU configure options.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index f295c8cb0a..10d8371ccc 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -51,11 +51,12 @@ task:
   install_script: pkg install -y seabios gmake ninja bash
                                  pkgconf bison perl5
                                  yajl lzo2 pixman argp-standalone
-                                 libxml2 glib git python3
+                                 libxml2 glib git python3 libinotify
 
   configure_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
+                  --with-extra-qemuu-configure-args="--extra-ldflags=-L${APPEND_LIB} --extra-cflags=-I${APPEND_INCLUDES}"
     - gmake -j`sysctl -n hw.ncpu` -C xen clang=y defconfig
 
   << : *FREEBSD_CONFIGURE_ARTIFACTS
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 14:22:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 14:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138914.1474486 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v68Zw-0004Su-Qj; Tue, 07 Oct 2025 14:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138914.1474486; Tue, 07 Oct 2025 14: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 1v68Zw-0004Sm-O3; Tue, 07 Oct 2025 14:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1138914;
 Tue, 07 Oct 2025 14: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 1v68Zw-0004SJ-2M
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 14: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 1v68Zw-00DVsA-08
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v68Zw-008kGO-01
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14: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=VJVJML878lvS25aYrAogfHCRvMgnOHexk5qaR/MNn/s=; b=eRePsj3HbcTAe26ZO0IPZWyCdB
	B1dYiBmNkN3BBXlCpbyHvtgVzdXQiP7LEYYDXORZY9ck1AqtBFXnNLOB3NNDDr/9L57BHA8zDx3o8
	3RZQ+XtVlkkxFHMZH8Xv7AyiPOjlTqcKD2XT6+e/N5fgg2zFOE8V1Z8uzk5zEwS+4cpE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: fix bashism in the test_script code
Message-Id: <E1v68Zw-008kGO-01@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 14:22:12 +0000

commit bcb7f9588b75365b7ea59055fbe94b84638097a7
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 7 09:00:55 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    cirrus-ci: fix bashism in the test_script code
    
    The default shell in FreeBSD is plain sh, which doesn't support the usage
    of the '|&' operator:
    
    ./automation/scripts/console.exp |& sed 's/\r\+$//'
    /tmp/scripts34c427adc6599db29cb91221a0939d85.sh: 16: Syntax error: "&" unexpected
    
    Fix this by using a redirection of stderr into stdout, and then a pipe.
    
    Fixes: a406195c15dd ("automation: call expect script with redirected standard error")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 10d8371ccc..30108892b7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -167,7 +167,7 @@ task:
     export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
     export PASSED="Test result: SUCCESS"
     export TEST_TIMEOUT=120
-    ./automation/scripts/console.exp |& sed 's/\r\+$//'
+    ./automation/scripts/console.exp 2>&1 | sed 's/\r\+$//'
 
   always:
     serial_artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 14:22:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 14:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138916.1474489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v68a6-0004VH-Rx; Tue, 07 Oct 2025 14:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138916.1474489; Tue, 07 Oct 2025 14:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v68a6-0004V9-PN; Tue, 07 Oct 2025 14:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1138916;
 Tue, 07 Oct 2025 14: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 1v68a6-0004V3-6c
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 14: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 1v68a6-00DVsf-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v68a6-008kHP-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14: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=LN9DjRfi793IRG2rmI5Ar6ZDEg2dulRD+UCgJwBtkXE=; b=GhyB7ctr5KqAFLlNPv4bLCVz3C
	wqwssnrrc9Mbwbla15gAwMwfqzBvNCUqxZ/zlYNcUJT7aaJ780w1cE7GmKs4bvMALUb2PMSA7crHo
	hz3HG8Or8p4Oi+opetNwUeXHdsear0pxMrLVKTASgplqNDc+zjHLCSzxMSbefwO+xSV8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: bump FreeBSD version
Message-Id: <E1v68a6-008kHP-0I@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 14:22:22 +0000

commit 331f94d0bbd11b93d12c762300039c9b36e561c5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 7 09:00:56 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    cirrus-ci: bump FreeBSD version
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 30108892b7..7df7ff5522 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -2,7 +2,7 @@
 freebsd_versions: &FREEBSD_VERSIONS
   env:
     FREEBSD_LEGACY:     freebsd-13-5
-    FREEBSD_PRODUCTION: freebsd-14-2
+    FREEBSD_PRODUCTION: freebsd-14-3
     FREEBSD_CURRENT:    freebsd-15-0-snap
 
 # Build jobs
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 14:22:32 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 14:22:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138918.1474493 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v68aG-0004XX-Te; Tue, 07 Oct 2025 14:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138918.1474493; Tue, 07 Oct 2025 14:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v68aG-0004XP-Qn; Tue, 07 Oct 2025 14:22:32 +0000
Received: by outflank-mailman (input) for mailman id 1138918;
 Tue, 07 Oct 2025 14: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 1v68aG-0004XJ-9e
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 14: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 1v68aG-00DVsq-0s
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v68aG-008kIT-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14: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=UABwii5I6E0oWTCJdSMOxwSK5JGFZefzsxfD63/oxVo=; b=mgk1zysScsM4w6brUDMQc0q4iV
	JTrHB9/k+1xTIho/qdL6DJmfTjelLcVyXM8FsIe1eA56fj5LHuz6byUt5ZqiVGR7JCU5VoeO5SXCu
	nShLv4TOfwntwSrTTNc+PzAAV7lxi3lzgJFZ+O7/6pi0EmbfHPApc2GvsDPjUe2UcUKE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Config.mk: Pin QEMU_UPSTREAM_REVISION
Message-Id: <E1v68aG-008kIT-0j@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 14:22:32 +0000

commit ffd25d717a743ed2e400b7bef73d924be59f1be6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 6 20:59:42 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    Config.mk: Pin QEMU_UPSTREAM_REVISION
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index 7edbab8efe..89c7524a3e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -205,7 +205,7 @@ OVMF_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/ovmf.git
 OVMF_UPSTREAM_REVISION ?= ba91d0292e593df8528b66f99c1b0b14fadc8e16
 
 QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= e064f42c80be6f6ff8c12dcb2a663bdf70f965f6
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
 MINIOS_UPSTREAM_REVISION ?= 6732fd42d8eb8d0af9f5eb54aca17f4c250213a8
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 14:22:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 14:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1138920.1474498 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v68aR-0004a0-Uz; Tue, 07 Oct 2025 14:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1138920.1474498; Tue, 07 Oct 2025 14: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 1v68aR-0004Zs-SL; Tue, 07 Oct 2025 14:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1138920;
 Tue, 07 Oct 2025 14:22: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 1v68aR-0004Zm-9W
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 14:22: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 1v68aR-00DVvN-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14:22:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v68aQ-008kIz-13
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 14: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=zTGMWLOAI/gPJnfC8qJU+W1++Up0Gz27EXNtP1UbYlk=; b=d/It2s7AEyjg8SuS4AYzakdzdS
	se1Atdn8Mzsx8nssdYf0JQvVU22ugbyhMKefmo/l8PaFCu2nYInP0F86NiNlL3EN5+UV16tf0insT
	iOjEt4e78eb4wDRUW5xPPF/NS11D9kSfhKtX34YW4BLN4a5FhgZFGIWszoFOdeLd98YI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Update Xen version to 4.21.0-rc1
Message-Id: <E1v68aQ-008kIz-13@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 14:22:42 +0000

commit d1478321eacbfca57c33dcc106984c7e63f9ad7e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 6 21:07:14 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    Update Xen version to 4.21.0-rc1
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 README       | 10 +++++-----
 SUPPORT.md   |  2 +-
 xen/Makefile |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 9329f30e13..eaee78bd73 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 ############################################################
-__  __                                _        _     _
-\ \/ /___ _ __        _   _ _ __  ___| |_ __ _| |__ | | ___
- \  // _ \ '_ \ _____| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
- /  \  __/ | | |_____| |_| | | | \__ \ || (_| | |_) | |  __/
-/_/\_\___|_| |_|      \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
+ __  __            _  _    ____  _
+ \ \/ /___ _ __   | || |  |___ \/ |   _ __ ___
+  \  // _ \ '_ \  | || |_   __) | |__| '__/ __|
+  /  \  __/ | | | |__   _| / __/| |__| | | (__
+ /_/\_\___|_| |_|    |_|(_)_____|_|  |_|  \___|
 
 ############################################################
 
diff --git a/SUPPORT.md b/SUPPORT.md
index eb44ee85fd..491f9ecd1b 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,7 +9,7 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.21-unstable
+    Xen-Version: 4.21-rc
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
diff --git a/xen/Makefile b/xen/Makefile
index 49da79e10f..ba8c7147a2 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 ?= -unstable$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 15:55:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 15:55:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1139080.1474624 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6A1m-0005SY-Ug; Tue, 07 Oct 2025 15:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1139080.1474624; Tue, 07 Oct 2025 15: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 1v6A1m-0005SN-Rl; Tue, 07 Oct 2025 15:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1139080;
 Tue, 07 Oct 2025 15: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 1v6A1l-0005RZ-K1
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 15: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 1v6A1l-00DXzN-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6A1l-008xOi-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15: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=vPxvsfUvXsyBCVrozXc/AwMB8VbxYjL9Q+E3WgnNtBU=; b=PwsHQgeMKU0HMf07gnn/o0DjNM
	XRabmFBE7HlMlN0P84ZGLoA7oalWTjY6WWVPvJqgvsuLZKyVE0L4hEn7eo21K8tQpON1AGfq9wBM5
	1ET4xebBY4N7cLg6LxWOay4BErPIIaKi5yP7N3D8kuaSR978gdfX+kRq8/rcM47WafE0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: install libinotify for FreeBSD
Message-Id: <E1v6A1l-008xOi-1b@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 15:55:01 +0000

commit ed53b7cb1bb2b39346f916a8de543860f18c33d0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 7 09:00:54 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    cirrus-ci: install libinotify for FreeBSD
    
    FreeBSD QEMU build requires libinotify, otherwise the build fails with:
    
    ./qemu-xen-dir-remote/meson.build:2535:15: ERROR: C shared or static library 'inotify' not found
    
    Install the package and add the /usr/local include and libs paths
    explicitly as QEMU configure options.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index f295c8cb0a..10d8371ccc 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -51,11 +51,12 @@ task:
   install_script: pkg install -y seabios gmake ninja bash
                                  pkgconf bison perl5
                                  yajl lzo2 pixman argp-standalone
-                                 libxml2 glib git python3
+                                 libxml2 glib git python3 libinotify
 
   configure_script:
     - cc --version
     - ./configure --with-system-seabios=/usr/local/share/seabios/bios.bin
+                  --with-extra-qemuu-configure-args="--extra-ldflags=-L${APPEND_LIB} --extra-cflags=-I${APPEND_INCLUDES}"
     - gmake -j`sysctl -n hw.ncpu` -C xen clang=y defconfig
 
   << : *FREEBSD_CONFIGURE_ARTIFACTS
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 15:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 15:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1139084.1474629 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6A1w-0005e6-Vv; Tue, 07 Oct 2025 15:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1139084.1474629; Tue, 07 Oct 2025 15: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 1v6A1w-0005dw-T5; Tue, 07 Oct 2025 15:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1139084;
 Tue, 07 Oct 2025 15: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 1v6A1v-0005dM-N1
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 15: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 1v6A1v-00DXzi-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6A1v-008xPU-23
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15: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=KYcf+xIYxkENCwqjCCfQkcLLftRCNvXJhgpCPeLzth0=; b=bd0Pk7kW9YNt5hlA85yBKYwnR3
	Y3LQsLEMtpjslmwh+IGi5BgFNwG1CINZQb5kKQCor34HmhjEkCEl9xmZ/IcUAF8EkxUpiyjhMhkXh
	mb83bUuLtWxIqjsYrC23SS/OGH8H6QPy5rf4prZxfFOQtsI5EG9dKmoa7p2kvxU9uZRo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: fix bashism in the test_script code
Message-Id: <E1v6A1v-008xPU-23@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 15:55:11 +0000

commit bcb7f9588b75365b7ea59055fbe94b84638097a7
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 7 09:00:55 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    cirrus-ci: fix bashism in the test_script code
    
    The default shell in FreeBSD is plain sh, which doesn't support the usage
    of the '|&' operator:
    
    ./automation/scripts/console.exp |& sed 's/\r\+$//'
    /tmp/scripts34c427adc6599db29cb91221a0939d85.sh: 16: Syntax error: "&" unexpected
    
    Fix this by using a redirection of stderr into stdout, and then a pipe.
    
    Fixes: a406195c15dd ("automation: call expect script with redirected standard error")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 10d8371ccc..30108892b7 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -167,7 +167,7 @@ task:
     export TEST_LOG="serial-${FREEBSD_BUILD}-${XTF_ARCH}.txt"
     export PASSED="Test result: SUCCESS"
     export TEST_TIMEOUT=120
-    ./automation/scripts/console.exp |& sed 's/\r\+$//'
+    ./automation/scripts/console.exp 2>&1 | sed 's/\r\+$//'
 
   always:
     serial_artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 15:55:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 15:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1139088.1474633 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6A27-0005m6-1D; Tue, 07 Oct 2025 15:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1139088.1474633; Tue, 07 Oct 2025 15: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 1v6A26-0005ly-Ud; Tue, 07 Oct 2025 15:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1139088;
 Tue, 07 Oct 2025 15: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 1v6A25-0005lh-QN
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 15: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 1v6A25-00DY05-2W
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6A25-008xRo-2N
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15: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=NwmySE7wEOT0pmxZ3MzGVTxA+i2wKCYGwJCjEGvwDHg=; b=jxkq/LmDPjU9QqtwU1XUaAXl1Z
	drAMunxlEAQi9+snaE1P331qNzWC5LLnzm1Elv740/PPjzFcQF3xpOHbDQrVCKNYUUsfSJQdSNDCB
	ivBShwKd9FfZZ/EKNBDD9IGoigavTXkfGQroI7QGagduf+JB/N82k+qEJDmi365SYzu8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: bump FreeBSD version
Message-Id: <E1v6A25-008xRo-2N@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 15:55:21 +0000

commit 331f94d0bbd11b93d12c762300039c9b36e561c5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Oct 7 09:00:56 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    cirrus-ci: bump FreeBSD version
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 30108892b7..7df7ff5522 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -2,7 +2,7 @@
 freebsd_versions: &FREEBSD_VERSIONS
   env:
     FREEBSD_LEGACY:     freebsd-13-5
-    FREEBSD_PRODUCTION: freebsd-14-2
+    FREEBSD_PRODUCTION: freebsd-14-3
     FREEBSD_CURRENT:    freebsd-15-0-snap
 
 # Build jobs
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 15:55:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 15:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1139092.1474636 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6A2H-0005qE-2m; Tue, 07 Oct 2025 15:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1139092.1474636; Tue, 07 Oct 2025 15: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 1v6A2G-0005pC-Vv; Tue, 07 Oct 2025 15:55:32 +0000
Received: by outflank-mailman (input) for mailman id 1139092;
 Tue, 07 Oct 2025 15:55: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 1v6A2F-0005ox-Ud
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 15:55: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 1v6A2F-00DY0G-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15:55:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6A2F-008xSa-2h
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15: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=LUAGuz0MPkgLZ8Vx05ANDFcXHcnZNC6Y9NhBaPufzhE=; b=QEw6tWq/1cethXCH6F6qmkdI72
	eXJodKouSedXBxzgMWSfqFo3R/U8fzqMNRha7968UqSYV0IxECIvr8WdhRiJ5UQ7a7z3aweBv6yCd
	vtzGWCxzS2s/CyyViW8qRCrqYuPWTKnTUt+tK6Ehzcd98xfrJTAtqqCzklMytYZt7rS0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Config.mk: Pin QEMU_UPSTREAM_REVISION
Message-Id: <E1v6A2F-008xSa-2h@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 15:55:31 +0000

commit ffd25d717a743ed2e400b7bef73d924be59f1be6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 6 20:59:42 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    Config.mk: Pin QEMU_UPSTREAM_REVISION
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index 7edbab8efe..89c7524a3e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -205,7 +205,7 @@ OVMF_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/ovmf.git
 OVMF_UPSTREAM_REVISION ?= ba91d0292e593df8528b66f99c1b0b14fadc8e16
 
 QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= e064f42c80be6f6ff8c12dcb2a663bdf70f965f6
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
 MINIOS_UPSTREAM_REVISION ?= 6732fd42d8eb8d0af9f5eb54aca17f4c250213a8
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 07 15:55:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Oct 2025 15:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1139095.1474640 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6A2R-0005u3-57; Tue, 07 Oct 2025 15:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1139095.1474640; Tue, 07 Oct 2025 15: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 1v6A2R-0005tv-2H; Tue, 07 Oct 2025 15:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1139095;
 Tue, 07 Oct 2025 15: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 1v6A2Q-0005td-0x
 for xen-changelog@lists.xenproject.org; Tue, 07 Oct 2025 15: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 1v6A2P-00DY0S-33
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15:55:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6A2P-008xUo-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 07 Oct 2025 15:55: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=Gjw7r1Ul3ZVrX8XbqXyEvo21PoU6r1FYyu3oEJt35Js=; b=TEvSfUBp4kBJsO7oSQOFH143q5
	nFWF+It+/CkBC+qwkC12+sBg9iZIDy7Ou2ImaufQumJb197BkIm4j5RfUrFCaPb9K/INluLpnzzh2
	MDo8pBYUEASYFIyO0EXGU5dQMtZ2Qc+T0HNfqRIljfT/mNMNKDb2Z5UlWUwUdHx5FZKc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Update Xen version to 4.21.0-rc1
Message-Id: <E1v6A2P-008xUo-2y@xenbits.xenproject.org>
Date: Tue, 07 Oct 2025 15:55:41 +0000

commit d1478321eacbfca57c33dcc106984c7e63f9ad7e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 6 21:07:14 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 7 15:13:16 2025 +0100

    Update Xen version to 4.21.0-rc1
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 README       | 10 +++++-----
 SUPPORT.md   |  2 +-
 xen/Makefile |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 9329f30e13..eaee78bd73 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
 ############################################################
-__  __                                _        _     _
-\ \/ /___ _ __        _   _ _ __  ___| |_ __ _| |__ | | ___
- \  // _ \ '_ \ _____| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
- /  \  __/ | | |_____| |_| | | | \__ \ || (_| | |_) | |  __/
-/_/\_\___|_| |_|      \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
+ __  __            _  _    ____  _
+ \ \/ /___ _ __   | || |  |___ \/ |   _ __ ___
+  \  // _ \ '_ \  | || |_   __) | |__| '__/ __|
+  /  \  __/ | | | |__   _| / __/| |__| | | (__
+ /_/\_\___|_| |_|    |_|(_)_____|_|  |_|  \___|
 
 ############################################################
 
diff --git a/SUPPORT.md b/SUPPORT.md
index eb44ee85fd..491f9ecd1b 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,7 +9,7 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.21-unstable
+    Xen-Version: 4.21-rc
     Initial-Release: n/a
     Supported-Until: TBD
     Security-Support-Until: Unreleased - not yet security-supported
diff --git a/xen/Makefile b/xen/Makefile
index 49da79e10f..ba8c7147a2 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 ?= -unstable$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 08 07:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2025 07:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1139367.1474757 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6OfW-00086W-92; Wed, 08 Oct 2025 07:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1139367.1474757; Wed, 08 Oct 2025 07: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 1v6OfW-00086P-6R; Wed, 08 Oct 2025 07:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1139367;
 Wed, 08 Oct 2025 07: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 1v6OfV-00086J-GJ
 for xen-changelog@lists.xenproject.org; Wed, 08 Oct 2025 07: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 1v6OfV-00F524-1R
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Oct 2025 07:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6OfV-00B3zW-1J
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Oct 2025 07:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=21YT4grXd81T78pNW9Zlwnslem3ilbuL4jY1j2cxL5E=; b=oAO52qyBPBLD7anj56DDhigDP+
	oGSQEm9SozAEfaCkmpYgl+oLwH7R1r39jDyUY52rp0LT16KyaTqXIX8CCcrswDJl7PKLntC9XJUt7
	M4+bAqX+amAPYuasUMQNbW4uzGLZpIzMzQsAg2jT6RlX4yn3hR2NJo7q7V6DpOZP3uy4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: add json-c for libxl dependency
Message-Id: <E1v6OfV-00B3zW-1J@xenbits.xenproject.org>
Date: Wed, 08 Oct 2025 07:33:01 +0000

commit 24bcde538f9b1e0dd2337d944ccd62c623ec374b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 6 16:27:41 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Oct 8 09:29:18 2025 +0200

    cirrus-ci: add json-c for libxl dependency
    
    Add json-c package for libxl usage.  At the same time drop YAJL.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7df7ff5522..0de1012d8c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -50,7 +50,7 @@ task:
 
   install_script: pkg install -y seabios gmake ninja bash
                                  pkgconf bison perl5
-                                 yajl lzo2 pixman argp-standalone
+                                 json-c lzo2 pixman argp-standalone
                                  libxml2 glib git python3 libinotify
 
   configure_script:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 08 08:33:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Oct 2025 08:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1139390.1474760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6Pbb-0006z6-Ap; Wed, 08 Oct 2025 08:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1139390.1474760; Wed, 08 Oct 2025 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 1v6Pbb-0006yz-8M; Wed, 08 Oct 2025 08:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1139390;
 Wed, 08 Oct 2025 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 1v6Pba-0006yt-B4
 for xen-changelog@lists.xenproject.org; Wed, 08 Oct 2025 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 1v6Pba-00F6in-0v
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Oct 2025 08:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6Pba-00BBaE-0g
 for xen-changelog@lists.xenproject.org;
 Wed, 08 Oct 2025 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=4iMnreOPk/TWcF970aclOd/ehAX2dKYccNpcOgD/qQo=; b=q6ZkjOkxs+h47a+iqGsbcf1Xuc
	lpO2Q0tEQFGya8JYmLjEVcO1bR4QmbHqXLakpjz1jdsDPcZZkot7nrj+/2ze9bRVL5AN96kIP1InL
	11Md7e0pff/k+1HtswRDCLfr5GBjdWJpTtCdpyCihIcXmBgeaolSMJnuuP9AGaikJkd0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: add json-c for libxl dependency
Message-Id: <E1v6Pba-00BBaE-0g@xenbits.xenproject.org>
Date: Wed, 08 Oct 2025 08:33:02 +0000

commit 24bcde538f9b1e0dd2337d944ccd62c623ec374b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 6 16:27:41 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Oct 8 09:29:18 2025 +0200

    cirrus-ci: add json-c for libxl dependency
    
    Add json-c package for libxl usage.  At the same time drop YAJL.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7df7ff5522..0de1012d8c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -50,7 +50,7 @@ task:
 
   install_script: pkg install -y seabios gmake ninja bash
                                  pkgconf bison perl5
-                                 yajl lzo2 pixman argp-standalone
+                                 json-c lzo2 pixman argp-standalone
                                  libxml2 glib git python3 libinotify
 
   configure_script:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Oct 09 09:22:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2025 09:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1140426.1475320 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6mqY-0007yq-UA; Thu, 09 Oct 2025 09:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1140426.1475320; Thu, 09 Oct 2025 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 1v6mqY-0007yf-RM; Thu, 09 Oct 2025 09:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1140426;
 Thu, 09 Oct 2025 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 1v6mqY-0007yO-8a
 for xen-changelog@lists.xenproject.org; Thu, 09 Oct 2025 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 1v6mqY-00Gmeo-0j
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Oct 2025 09:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6mqY-00EUmF-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Oct 2025 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=N7r3Al4EWfLKpyBfj/49XhbDriJbJq5ir1jw+msRpJY=; b=XO+ejcO0IxCPBXRMe03nvVVh8N
	56ksYF1vPLTAE54Qig1Q9Y5Uf8I/Nc69qJpvzOs42UImVSQUP7YwiMQs9XVNLUpzEDc+bFuFdN1lj
	U9oMto4Iw3pkl+2+JvYxujSLMDfSBRaj7566XdfzMWPDW/lpLkTsZ43bns3fumJQ8h9c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/tests: don't pass -E to sed
Message-Id: <E1v6mqY-00EUmF-0b@xenbits.xenproject.org>
Date: Thu, 09 Oct 2025 09:22:02 +0000

commit 8daabe4052a010035ab690a7b8bb392499452e4e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 9 11:09:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 9 11:09:25 2025 +0200

    tools/tests: don't pass -E to sed
    
    Even the 2018 edition of The Open Group Base Specifications Issue 7 [1]
    doesn't name -E as a standard option; only Issue 8 [2] does. As there's
    nothing "extended" about the expression used, simply drop the -E.
    
    [1] https://pubs.opengroup.org/onlinepubs/9699919799/
    [2] https://pubs.opengroup.org/onlinepubs/9799919799/
    
    Fixes: cb50e4033717 ("test/pdx: add PDX compression unit tests")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 tools/tests/pdx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/pdx/Makefile b/tools/tests/pdx/Makefile
index 10b354f0ce..3c431d7c78 100644
--- a/tools/tests/pdx/Makefile
+++ b/tools/tests/pdx/Makefile
@@ -35,7 +35,7 @@ uninstall:
 	$(RM) -- $(patsubst %,$(DESTDIR)$(LIBEXEC)/tests/%,$(TARGETS))
 
 pdx.h: $(XEN_ROOT)/xen/include/xen/pdx.h
-	sed -E -e '/^#[[:space:]]*include/d' <$< >$@
+	sed -e '/^#[[:space:]]*include/d' <$< >$@
 
 CFLAGS += -D__XEN_TOOLS__
 CFLAGS += $(APPEND_CFLAGS)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 09 10:44:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Oct 2025 10:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1140460.1475333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v6o7v-0000dv-Ei; Thu, 09 Oct 2025 10:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1140460.1475333; Thu, 09 Oct 2025 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 1v6o7v-0000dn-By; Thu, 09 Oct 2025 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1140460;
 Thu, 09 Oct 2025 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 1v6o7u-0000dh-3s
 for xen-changelog@lists.xenproject.org; Thu, 09 Oct 2025 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 1v6o7u-00GoHf-02
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Oct 2025 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v6o7t-00Ef8E-39
 for xen-changelog@lists.xenproject.org;
 Thu, 09 Oct 2025 10:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sic+iy60GAbS1Lk87vE7OBsOEHJj6FsleXFdVRvbpKo=; b=0FVCUjKFIahiaDpKgRoMMawcLb
	PKhmXh8BHbG+VcItWWwHY4Q+7qdhfR7qH6y7qgg4bm4WuekwoDybZhVH6J+GDfjY6iHt8Utn90BHV
	xGMTeJ0FhE/GCxgOMGeP4bbH50aY0wgGqWyeStD77gJHc5utheF77W1sK9j3/EdugUUc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/tests: don't pass -E to sed
Message-Id: <E1v6o7t-00Ef8E-39@xenbits.xenproject.org>
Date: Thu, 09 Oct 2025 10:44:01 +0000

commit 8daabe4052a010035ab690a7b8bb392499452e4e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 9 11:09:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 9 11:09:25 2025 +0200

    tools/tests: don't pass -E to sed
    
    Even the 2018 edition of The Open Group Base Specifications Issue 7 [1]
    doesn't name -E as a standard option; only Issue 8 [2] does. As there's
    nothing "extended" about the expression used, simply drop the -E.
    
    [1] https://pubs.opengroup.org/onlinepubs/9699919799/
    [2] https://pubs.opengroup.org/onlinepubs/9799919799/
    
    Fixes: cb50e4033717 ("test/pdx: add PDX compression unit tests")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 tools/tests/pdx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/pdx/Makefile b/tools/tests/pdx/Makefile
index 10b354f0ce..3c431d7c78 100644
--- a/tools/tests/pdx/Makefile
+++ b/tools/tests/pdx/Makefile
@@ -35,7 +35,7 @@ uninstall:
 	$(RM) -- $(patsubst %,$(DESTDIR)$(LIBEXEC)/tests/%,$(TARGETS))
 
 pdx.h: $(XEN_ROOT)/xen/include/xen/pdx.h
-	sed -E -e '/^#[[:space:]]*include/d' <$< >$@
+	sed -e '/^#[[:space:]]*include/d' <$< >$@
 
 CFLAGS += -D__XEN_TOOLS__
 CFLAGS += $(APPEND_CFLAGS)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 10 09:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Oct 2025 09:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1141082.1475693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v799S-0005AT-FS; Fri, 10 Oct 2025 09:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1141082.1475693; Fri, 10 Oct 2025 09: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 1v799S-0005AJ-CW; Fri, 10 Oct 2025 09:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1141082;
 Fri, 10 Oct 2025 09: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 1v799R-00059u-Hs
 for xen-changelog@lists.xenproject.org; Fri, 10 Oct 2025 09: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 1v799R-000qdt-1Y
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Oct 2025 09:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v799R-00HGav-1P
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Oct 2025 09: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=CsYTfZHCckhIVEUxIvaoCmsRMtWwff2kkAd609r51Lc=; b=Msp9ZnnAZAXjBTNcGEgXdkiwGr
	uukziOIK6Gj+y8SrHarAuvki84H6NCOaT0Hidfb1uMIAdzNp0WF4p2tYYdRCRBpL8Jra2viLVUJWy
	cXbF2MVSupGdO3/0OcHlqswWO6V+hvKgXnFodVKyNOMuY1k4C+VpBF7/Vk7X/9LRTo9o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vpci/msix: improve handling of bogus MSI-X capabilities
Message-Id: <E1v799R-00HGav-1P@xenbits.xenproject.org>
Date: Fri, 10 Oct 2025 09:11:01 +0000

commit 53859596c0d34dbca776ec1e47bac8dd90552530
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Sep 26 17:39:29 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Oct 10 11:02:39 2025 +0200

    vpci/msix: improve handling of bogus MSI-X capabilities
    
    I've had the luck to come across a PCI card that exposes a MSI-X capability
    where the BIR of the vector and PBA tables points at a BAR that has 0 size.
    
    This doesn't play nice with the code in vpci_make_msix_hole(), as it would
    still use the address of such empty BAR (0) and attempt to carve a hole in
    the p2m.  This leads to errors like the one below being reported by Xen:
    
    d0v0 0000:22:00.0: existing mapping (mfn: 181c4300 type: 0) at 0 clobbers MSIX MMIO area
    
    And the device left unable to enable memory decoding due to the failure
    reported by vpci_make_msix_hole().
    
    Introduce checking in init_msix() to ensure the BARs containing the MSI-X
    tables are usable.  This requires checking that the BIR points to a
    non-empty BAR, and the offset and size of the MSI-X tables can fit in the
    target BAR.
    
    This fixes booting PVH dom0 on Supermicro AS -2126HS-TN servers with AMD
    EPYC 9965 processors.  The broken device is:
    
    22:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 93)
    
    There are multiple of those integrated controllers in the system, all
    broken in the same way.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Released-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/lib.h   |  3 +++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 54a5070733..032e471bb1 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -18,6 +18,7 @@
  */
 
 #include <xen/io.h>
+#include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -675,6 +676,51 @@ static int cf_check init_msix(struct pci_dev *pdev)
     if ( !msix )
         return -ENOMEM;
 
+    msix->tables[VPCI_MSIX_TABLE] =
+        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
+    msix->tables[VPCI_MSIX_PBA] =
+        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
+
+    /* Check that the referenced BAR(s) regions are valid. */
+    for ( i = 0; i < ARRAY_SIZE(msix->tables); i++ )
+    {
+        const char *name = (i == VPCI_MSIX_TABLE) ? "vector" : "PBA";
+        const struct vpci_bar *bars = pdev->vpci->header.bars;
+        unsigned int bir = msix->tables[i] & PCI_MSIX_BIRMASK;
+        unsigned int type;
+        unsigned int offset = msix->tables[i] & ~PCI_MSIX_BIRMASK;
+        unsigned int size =
+            (i == VPCI_MSIX_TABLE) ? max_entries * PCI_MSIX_ENTRY_SIZE
+                                   : ROUNDUP(DIV_ROUND_UP(max_entries, 8), 8);
+
+        if ( bir >= ARRAY_SIZE(pdev->vpci->header.bars) )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table with out of range BIR %u\n",
+                   &pdev->sbdf, name, bir);
+ invalid:
+            xfree(msix);
+            return -ENODEV;
+        }
+
+        type = bars[bir].type;
+        if ( type != VPCI_BAR_MEM32 && type != VPCI_BAR_MEM64_LO )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table at invalid BAR%u with type %u\n",
+                   &pdev->sbdf, name, bir, type);
+            goto invalid;
+        }
+
+        if ( (uint64_t)offset + size > bars[bir].size )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table offset %#x size %#x outside of BAR%u size %#lx\n",
+                   &pdev->sbdf, name, offset, size, bir, bars[bir].size);
+            goto invalid;
+        }
+    }
+
     rc = vpci_add_register(pdev->vpci, control_read, control_write,
                            msix_control_reg(msix_offset), 2, msix);
     if ( rc )
@@ -686,11 +732,6 @@ static int cf_check init_msix(struct pci_dev *pdev)
     msix->max_entries = max_entries;
     msix->pdev = pdev;
 
-    msix->tables[VPCI_MSIX_TABLE] =
-        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
-    msix->tables[VPCI_MSIX_PBA] =
-        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
-
     for ( i = 0; i < max_entries; i++)
     {
         msix->entries[i].masked = true;
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index c434dd5f16..c4ac482392 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -60,6 +60,9 @@ static inline void
 debugtrace_printk(const char *fmt, ...) {}
 #endif
 
+/* Common log prefixes for platform related issues. */
+#define DEV_BUG_PREFIX "DEVICE BUG: "
+
 extern void printk(const char *fmt, ...)
     __attribute__ ((format (printf, 1, 2), cold));
 void vprintk(const char *fmt, va_list args)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 10 10:00:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Oct 2025 10:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1141157.1475758 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v79ut-00063V-Sj; Fri, 10 Oct 2025 10:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1141157.1475758; Fri, 10 Oct 2025 10: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 1v79ut-000635-PW; Fri, 10 Oct 2025 10:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1141157;
 Fri, 10 Oct 2025 10:00: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 1v79ur-0005bs-RI
 for xen-changelog@lists.xenproject.org; Fri, 10 Oct 2025 10:00: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 1v79ur-000re1-2b
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Oct 2025 10:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v79ur-00HLtk-2R
 for xen-changelog@lists.xenproject.org;
 Fri, 10 Oct 2025 10: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=g3v9QRBUFHrN+7IM5k3Uab456inoCJ1lEDPd4GjqS/E=; b=QNy9wRB9kg+PpwBGhkJjV8GQr8
	YL+Kq5/jd3FIW0YaEbBOO9e3DKejYVhqsweKh0A1NKw64qd64tmaurTRhBeJ/5fCaiFbiriC25xhx
	vBta3z7/5eR0d00WHEmwgazKzrHKGeaTfdGgkuJeZ5Y1XmVmJEFkMWf9Uhbi/ushWugM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vpci/msix: improve handling of bogus MSI-X capabilities
Message-Id: <E1v79ur-00HLtk-2R@xenbits.xenproject.org>
Date: Fri, 10 Oct 2025 10:00:01 +0000

commit 53859596c0d34dbca776ec1e47bac8dd90552530
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Sep 26 17:39:29 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Oct 10 11:02:39 2025 +0200

    vpci/msix: improve handling of bogus MSI-X capabilities
    
    I've had the luck to come across a PCI card that exposes a MSI-X capability
    where the BIR of the vector and PBA tables points at a BAR that has 0 size.
    
    This doesn't play nice with the code in vpci_make_msix_hole(), as it would
    still use the address of such empty BAR (0) and attempt to carve a hole in
    the p2m.  This leads to errors like the one below being reported by Xen:
    
    d0v0 0000:22:00.0: existing mapping (mfn: 181c4300 type: 0) at 0 clobbers MSIX MMIO area
    
    And the device left unable to enable memory decoding due to the failure
    reported by vpci_make_msix_hole().
    
    Introduce checking in init_msix() to ensure the BARs containing the MSI-X
    tables are usable.  This requires checking that the BIR points to a
    non-empty BAR, and the offset and size of the MSI-X tables can fit in the
    target BAR.
    
    This fixes booting PVH dom0 on Supermicro AS -2126HS-TN servers with AMD
    EPYC 9965 processors.  The broken device is:
    
    22:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 93)
    
    There are multiple of those integrated controllers in the system, all
    broken in the same way.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Released-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/lib.h   |  3 +++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 54a5070733..032e471bb1 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -18,6 +18,7 @@
  */
 
 #include <xen/io.h>
+#include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -675,6 +676,51 @@ static int cf_check init_msix(struct pci_dev *pdev)
     if ( !msix )
         return -ENOMEM;
 
+    msix->tables[VPCI_MSIX_TABLE] =
+        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
+    msix->tables[VPCI_MSIX_PBA] =
+        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
+
+    /* Check that the referenced BAR(s) regions are valid. */
+    for ( i = 0; i < ARRAY_SIZE(msix->tables); i++ )
+    {
+        const char *name = (i == VPCI_MSIX_TABLE) ? "vector" : "PBA";
+        const struct vpci_bar *bars = pdev->vpci->header.bars;
+        unsigned int bir = msix->tables[i] & PCI_MSIX_BIRMASK;
+        unsigned int type;
+        unsigned int offset = msix->tables[i] & ~PCI_MSIX_BIRMASK;
+        unsigned int size =
+            (i == VPCI_MSIX_TABLE) ? max_entries * PCI_MSIX_ENTRY_SIZE
+                                   : ROUNDUP(DIV_ROUND_UP(max_entries, 8), 8);
+
+        if ( bir >= ARRAY_SIZE(pdev->vpci->header.bars) )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table with out of range BIR %u\n",
+                   &pdev->sbdf, name, bir);
+ invalid:
+            xfree(msix);
+            return -ENODEV;
+        }
+
+        type = bars[bir].type;
+        if ( type != VPCI_BAR_MEM32 && type != VPCI_BAR_MEM64_LO )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table at invalid BAR%u with type %u\n",
+                   &pdev->sbdf, name, bir, type);
+            goto invalid;
+        }
+
+        if ( (uint64_t)offset + size > bars[bir].size )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table offset %#x size %#x outside of BAR%u size %#lx\n",
+                   &pdev->sbdf, name, offset, size, bir, bars[bir].size);
+            goto invalid;
+        }
+    }
+
     rc = vpci_add_register(pdev->vpci, control_read, control_write,
                            msix_control_reg(msix_offset), 2, msix);
     if ( rc )
@@ -686,11 +732,6 @@ static int cf_check init_msix(struct pci_dev *pdev)
     msix->max_entries = max_entries;
     msix->pdev = pdev;
 
-    msix->tables[VPCI_MSIX_TABLE] =
-        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
-    msix->tables[VPCI_MSIX_PBA] =
-        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
-
     for ( i = 0; i < max_entries; i++)
     {
         msix->entries[i].masked = true;
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index c434dd5f16..c4ac482392 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -60,6 +60,9 @@ static inline void
 debugtrace_printk(const char *fmt, ...) {}
 #endif
 
+/* Common log prefixes for platform related issues. */
+#define DEV_BUG_PREFIX "DEVICE BUG: "
+
 extern void printk(const char *fmt, ...)
     __attribute__ ((format (printf, 1, 2), cold));
 void vprintk(const char *fmt, va_list args)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 13 08:55:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Oct 2025 08:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1141869.1476029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8EKe-0000tW-FC; Mon, 13 Oct 2025 08:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1141869.1476029; Mon, 13 Oct 2025 08:55:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8EKe-0000tO-C1; Mon, 13 Oct 2025 08:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1141869;
 Mon, 13 Oct 2025 08: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 1v8EKc-0000tI-MT
 for xen-changelog@lists.xenproject.org; Mon, 13 Oct 2025 08: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 1v8EKc-005sWg-1R
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 08:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8EKc-007fBv-1J
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 08:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Uextsm9mB0rmjsVvcr0D/oeF+wUm26eP4CMz2XcqvgY=; b=3Tfe8ew05pjnw7YcHxubNmWMTS
	qOKZc9yF10CZbo2BW9q6GT4q2mEQRvNNkGfmZLM/YCRIjwSXvvf/I7ivo5HU9XjdMpayrj6vKSE9V
	AVZZMgSKMutKA8taqJCxVSOAZIRFiCStV0AfK5UWwct1/ySqUpM6L85fvxYpAdV4K5lw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: Add myself as an AMD SVM & IOMMU reviewer
Message-Id: <E1v8EKc-007fBv-1J@xenbits.xenproject.org>
Date: Mon, 13 Oct 2025 08:55:02 +0000

commit 9db10d89c41e0272066a8547ec5ee2a642663baa
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Mon Oct 13 10:41:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 13 10:41:01 2025 +0200

    MAINTAINERS: Add myself as an AMD SVM & IOMMU reviewer
    
    Split out AMD SVM and AMD IOMMU, and add myself as a reviewer.  Jan,
    Andrew and Roger are set as maintainers as they were for the X86 entry.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 MAINTAINERS | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 793561f63f..ecd3f40df8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -220,6 +220,24 @@ F:	xen/drivers/acpi/
 F:	xen/include/acpi/
 F:	tools/libacpi/
 
+AMD IOMMU
+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>
+S:	Supported
+F:	xen/drivers/passthrough/amd/
+
+AMD SVM
+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>
+S:	Supported
+F:	xen/arch/x86/cpu/vpmu_amd.c
+F:	xen/arch/x86/hvm/svm/
+F:	xen/arch/x86/include/asm/hvm/svm/
+
 ARGO
 M:	Christopher Clark <christopher.w.clark@gmail.com>
 R:	Daniel P. Smith <dpsmith@apertussolutions.com>
@@ -601,7 +619,6 @@ M:	Roger Pau Monné <roger.pau@citrix.com>
 S:	Supported
 L:	xen-devel@lists.xenproject.org
 F:	xen/arch/x86/
-F:	xen/drivers/passthrough/amd/
 F:	xen/drivers/passthrough/vtd/
 F:	xen/include/public/arch-x86/
 F:	xen/include/xen/lib/x86/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 13 08:55:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Oct 2025 08:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1141870.1476032 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8EKo-0000vY-G6; Mon, 13 Oct 2025 08:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1141870.1476032; Mon, 13 Oct 2025 08:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8EKo-0000vQ-DW; Mon, 13 Oct 2025 08:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1141870;
 Mon, 13 Oct 2025 08: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 1v8EKm-0000vB-I9
 for xen-changelog@lists.xenproject.org; Mon, 13 Oct 2025 08: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 1v8EKm-005sX4-1i
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 08:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8EKm-007fCZ-1c
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 08:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LSvKLOzgrsZ+vuPLE8xb5QYaQMWKbEWAK16p5b+WK8A=; b=vcT8AMluBgj8fcCpK3WSFcuB3t
	dKTwBnOCrefHpQ3Z5CmJm6FnK4TKz180Vyhp6lTli/taeEdobB9Y8dQmXD+F1sL1CrBH12UZKToU1
	RxiVI5CePsk6sxqjcdByNWMf0yKbFkZFhiBBN40fISetCy1wcWXbCdxYc20zSOP1Vcco=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HWP: adjust feature_hdc's section annotation
Message-Id: <E1v8EKm-007fCZ-1c@xenbits.xenproject.org>
Date: Mon, 13 Oct 2025 08:55:12 +0000

commit 4676e09b3c3b2750aef3d6ec7e43b632d4800ab9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 13 10:41:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 13 10:41:35 2025 +0200

    x86/HWP: adjust feature_hdc's section annotation
    
    The variable can be cleared (set to false) by a non-init function's error
    path (hwp_init_msrs()).
    
    Fixes: 99c4570f8209 ("cpufreq: Add Hardware P-State (HWP) driver")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/acpi/cpufreq/hwp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 240491c96a..e801acd7a7 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -21,7 +21,7 @@ static bool __ro_after_init hwp_in_use;
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
-static bool __ro_after_init feature_hdc;
+static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 13 09:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Oct 2025 09:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1141892.1476056 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8EvP-0007Gb-M5; Mon, 13 Oct 2025 09:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1141892.1476056; Mon, 13 Oct 2025 09: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 1v8EvP-0007GT-JV; Mon, 13 Oct 2025 09:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1141892;
 Mon, 13 Oct 2025 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 1v8EvO-0007GN-27
 for xen-changelog@lists.xenproject.org; Mon, 13 Oct 2025 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 1v8EvN-005tM8-37
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 09:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8EvN-007jI9-30
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 09:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tUvFSjCk9/5eZ1J7vc0wWzSrOprtACu0ZALcd76thUs=; b=UL4PQ2YTeUzMC6CR1px1cgWz55
	0At5c3Y5eEKH9VpHkNLBz4VCabjv/S3Q55j5zWGhEge/eyGN78NdtVF/+m7N51WEGMzvUjXZYWpb9
	x9gDi/v07v5Q1O5wlsfpuIcxNQ0UXZmxMmsTAaVCUfZUp8L80whYxEntpEwx2u9oYYAM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: Add myself as an AMD SVM & IOMMU reviewer
Message-Id: <E1v8EvN-007jI9-30@xenbits.xenproject.org>
Date: Mon, 13 Oct 2025 09:33:01 +0000

commit 9db10d89c41e0272066a8547ec5ee2a642663baa
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Mon Oct 13 10:41:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 13 10:41:01 2025 +0200

    MAINTAINERS: Add myself as an AMD SVM & IOMMU reviewer
    
    Split out AMD SVM and AMD IOMMU, and add myself as a reviewer.  Jan,
    Andrew and Roger are set as maintainers as they were for the X86 entry.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 MAINTAINERS | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 793561f63f..ecd3f40df8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -220,6 +220,24 @@ F:	xen/drivers/acpi/
 F:	xen/include/acpi/
 F:	tools/libacpi/
 
+AMD IOMMU
+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>
+S:	Supported
+F:	xen/drivers/passthrough/amd/
+
+AMD SVM
+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>
+S:	Supported
+F:	xen/arch/x86/cpu/vpmu_amd.c
+F:	xen/arch/x86/hvm/svm/
+F:	xen/arch/x86/include/asm/hvm/svm/
+
 ARGO
 M:	Christopher Clark <christopher.w.clark@gmail.com>
 R:	Daniel P. Smith <dpsmith@apertussolutions.com>
@@ -601,7 +619,6 @@ M:	Roger Pau Monné <roger.pau@citrix.com>
 S:	Supported
 L:	xen-devel@lists.xenproject.org
 F:	xen/arch/x86/
-F:	xen/drivers/passthrough/amd/
 F:	xen/drivers/passthrough/vtd/
 F:	xen/include/public/arch-x86/
 F:	xen/include/xen/lib/x86/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 13 09:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Oct 2025 09:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1141893.1476060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8EvZ-0007Iq-NY; Mon, 13 Oct 2025 09:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1141893.1476060; Mon, 13 Oct 2025 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 1v8EvZ-0007Ii-Kv; Mon, 13 Oct 2025 09:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1141893;
 Mon, 13 Oct 2025 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 1v8EvY-0007IS-2h
 for xen-changelog@lists.xenproject.org; Mon, 13 Oct 2025 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 1v8EvY-005tMV-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 09:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8EvY-007jJb-04
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 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=7lDpqL6lbg40hVPnelBOZBiWClawu7IpewmAtvTxdgI=; b=LqDKAopd+uui4XqodVmzWdV/Qs
	g8M0Zk74DDytR9E4wOjP1l2SR5gLBdrXREbOBiO9R0Au2yPBK9fKw2bolVuBiekoBpfK7pmhfpTW2
	HqgtALkaiCh/pcgpOsPWlXv9sdqYnjKfHPZmAmfLbjx10ifbqUvj6eZZY2NSotC73bxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HWP: adjust feature_hdc's section annotation
Message-Id: <E1v8EvY-007jJb-04@xenbits.xenproject.org>
Date: Mon, 13 Oct 2025 09:33:12 +0000

commit 4676e09b3c3b2750aef3d6ec7e43b632d4800ab9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 13 10:41:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 13 10:41:35 2025 +0200

    x86/HWP: adjust feature_hdc's section annotation
    
    The variable can be cleared (set to false) by a non-init function's error
    path (hwp_init_msrs()).
    
    Fixes: 99c4570f8209 ("cpufreq: Add Hardware P-State (HWP) driver")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/acpi/cpufreq/hwp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 240491c96a..e801acd7a7 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -21,7 +21,7 @@ static bool __ro_after_init hwp_in_use;
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
-static bool __ro_after_init feature_hdc;
+static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 13 14:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Oct 2025 14:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1142401.1476594 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8Jx1-0003eI-RH; Mon, 13 Oct 2025 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1142401.1476594; Mon, 13 Oct 2025 14:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8Jx1-0003eA-Ok; Mon, 13 Oct 2025 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1142401;
 Mon, 13 Oct 2025 14: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 1v8Jx0-0003e4-TV
 for xen-changelog@lists.xenproject.org; Mon, 13 Oct 2025 14: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 1v8Jx0-0006Su-0q
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 14:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8Jx0-000Vnv-13
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 14: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=FBfBZ7Zsu1bxRC+kDpR9WatckVdY2jkV1AWrXpQLBmg=; b=lFlele7bTJtTQRxVMn7jgVszsl
	hNoOJ0umikdBuEaNWHVxe/YYvsdtcGR4O5bfl3N9grgBxXFQ2JxDvEyHmRtdD9o54NTUQ4Bw5tMfN
	fUlfLmR29oMvNpWJLAwambUSlgQ0vcW0kTNga20Qk3h7KYeTflOF4Ky94+ecvL/fRWcU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: check bus_to_context_maddr()'s return value
Message-Id: <E1v8Jx0-000Vnv-13@xenbits.xenproject.org>
Date: Mon, 13 Oct 2025 14:55:02 +0000

commit ef5b718cf81a2448118b86b86777f9430739445d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 13 16:50:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 13 16:50:01 2025 +0200

    VT-d: check bus_to_context_maddr()'s return value
    
    The function returning zero is an error indication; we shouldn't try to
    map MFN 0 and then treat that page as a context table.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b4105163cc..90f36ac22b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1499,6 +1499,11 @@ int domain_context_mapping_one(
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        spin_unlock(&iommu->lock);
+        return -ENOMEM;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
     old = (lctxt = *context).full;
@@ -1853,6 +1858,12 @@ int domain_context_unmap_one(
     spin_lock(&iommu->lock);
 
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        ASSERT_UNREACHABLE();
+        spin_unlock(&iommu->lock);
+        return 0;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 13 16:11:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Oct 2025 16:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1142472.1476614 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8L8Z-0006g6-Ai; Mon, 13 Oct 2025 16:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1142472.1476614; Mon, 13 Oct 2025 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 1v8L8Z-0006fy-85; Mon, 13 Oct 2025 16:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1142472;
 Mon, 13 Oct 2025 16: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 1v8L8X-0006fs-Tw
 for xen-changelog@lists.xenproject.org; Mon, 13 Oct 2025 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 1v8L8X-0008Fg-1p
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 16:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8L8X-000eit-2K
 for xen-changelog@lists.xenproject.org;
 Mon, 13 Oct 2025 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=h4FsudXN/tRXgpy6RAWSX/TADHqomSp7IHhJ857MOck=; b=zH2rrbv1WD4Fe0iu9nFd6wyiFN
	o8RK01NWoNPY0S3ud32UO7H4P2oLagL22ra78W6YNE5qos4StNHabwxh4lYwPNbyJf2mJ1SWpTHy2
	goqlE0QONymGKAWGpwMRGdYvEuNvcGjhh1W+sY+RZPivoZ82eaBgcb3hg4mQGUrXIud8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: check bus_to_context_maddr()'s return value
Message-Id: <E1v8L8X-000eit-2K@xenbits.xenproject.org>
Date: Mon, 13 Oct 2025 16:11:01 +0000

commit ef5b718cf81a2448118b86b86777f9430739445d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 13 16:50:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 13 16:50:01 2025 +0200

    VT-d: check bus_to_context_maddr()'s return value
    
    The function returning zero is an error indication; we shouldn't try to
    map MFN 0 and then treat that page as a context table.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b4105163cc..90f36ac22b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1499,6 +1499,11 @@ int domain_context_mapping_one(
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        spin_unlock(&iommu->lock);
+        return -ENOMEM;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
     old = (lctxt = *context).full;
@@ -1853,6 +1858,12 @@ int domain_context_unmap_one(
     spin_lock(&iommu->lock);
 
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        ASSERT_UNREACHABLE();
+        spin_unlock(&iommu->lock);
+        return 0;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 14 17:44:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Oct 2025 17:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1142998.1476872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8j46-0005Of-LE; Tue, 14 Oct 2025 17:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1142998.1476872; Tue, 14 Oct 2025 17:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8j46-0005OX-IU; Tue, 14 Oct 2025 17:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1142998;
 Tue, 14 Oct 2025 17: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 1v8j45-0005OR-Oj
 for xen-changelog@lists.xenproject.org; Tue, 14 Oct 2025 17: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 1v8j45-001kzl-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 14 Oct 2025 17:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8j45-003lrN-1e
 for xen-changelog@lists.xenproject.org;
 Tue, 14 Oct 2025 17:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mzfu6sOZV/bOX9tmggXAzqKyPVBkW0XUF7o+HFIMk5o=; b=mSDh2N55a+cDFfmU8NeBFhfpto
	sJEmBKRL13tB26rtzY3FTAec+pYOb9v9k1BoVmMyVIw3qlp4SjgjNOxZRtSiRrLDaRo4cy5e1ekLG
	yTuwYwNXYD2CN3FOFgD1gKXH5mau90LCL4cAoFqdvmIShFWu6Cer4+IzrdCVYQgdM6dw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] efi: Protect against unnecessary image unloading
Message-Id: <E1v8j45-003lrN-1e@xenbits.xenproject.org>
Date: Tue, 14 Oct 2025 17:44:01 +0000

commit 5d492ce33d66397f60692f3c2b1b1e0ea6a6ea2e
Author:     Gerald Elder-Vass <gerald.elder-vass@cloud.com>
AuthorDate: Thu Sep 11 08:24:28 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 14 18:31:43 2025 +0100

    efi: Protect against unnecessary image unloading
    
    Commit 59a1d6d3ea1e introduced Shim's LoadImage protocol and unloads the
    image after loading it (for verification purposes) regardless of the
    returned status. The protocol API implies this is the correct behaviour
    but we should add a check to protect against the unlikely case this
    frees any memory in use.
    
    Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/common/efi/boot.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 5b84dbf26e..d7f4d0cb22 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1062,7 +1062,7 @@ static void __init efi_verify_kernel(EFI_HANDLE ImageHandle)
     static EFI_GUID __initdata shim_image_guid = SHIM_IMAGE_LOADER_GUID;
     static EFI_GUID __initdata shim_lock_guid = SHIM_LOCK_PROTOCOL_GUID;
     SHIM_IMAGE_LOADER *shim_loader;
-    EFI_HANDLE loaded_kernel;
+    EFI_HANDLE loaded_kernel = NULL;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_STATUS status;
     bool verified = false;
@@ -1078,11 +1078,13 @@ static void __init efi_verify_kernel(EFI_HANDLE ImageHandle)
             verified = true;
 
         /*
-         * Always unload the image.  We only needed LoadImage() to perform
-         * verification anyway, and in the case of a failure there may still
-         * be cleanup needing to be performed.
+         * If the kernel was loaded, unload it. We only needed LoadImage() to
+         * perform verification anyway, and in the case of a failure there may
+         * still be cleanup needing to be performed.
          */
-        shim_loader->UnloadImage(loaded_kernel);
+        if ( loaded_kernel &&
+             (!EFI_ERROR(status) || status == EFI_SECURITY_VIOLATION) )
+            shim_loader->UnloadImage(loaded_kernel);
     }
 
     /* Otherwise, fall back to SHIM_LOCK. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 14 23:22:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Oct 2025 23:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1143055.1476886 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8oLE-000187-7a; Tue, 14 Oct 2025 23:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1143055.1476886; Tue, 14 Oct 2025 23:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v8oLE-00017z-4z; Tue, 14 Oct 2025 23:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1143055;
 Tue, 14 Oct 2025 23: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 1v8oLC-00017t-Bu
 for xen-changelog@lists.xenproject.org; Tue, 14 Oct 2025 23: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 1v8oLB-001rFr-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 14 Oct 2025 23:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v8oLB-004PH2-37
 for xen-changelog@lists.xenproject.org;
 Tue, 14 Oct 2025 23:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d+48+gPAXcqHAawoMupOzQDsRrKXH10NsDgmh6hem+s=; b=nqCHOmPqSa01J0M20IvREPPzp/
	hoytsWioitEcIIN259FON87ChD0uSHwntLQgEWPFV0Ori8cYerL73vOVU+ycvBCEtRkeeddzrX0vT
	dMwU9yoxZG6dJiVv0ksoPrOVCUIqyTqet58JY/8pC66uRPPjJGZsLZf8hcCx3wcgoZ2M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] efi: Protect against unnecessary image unloading
Message-Id: <E1v8oLB-004PH2-37@xenbits.xenproject.org>
Date: Tue, 14 Oct 2025 23:22:01 +0000

commit 5d492ce33d66397f60692f3c2b1b1e0ea6a6ea2e
Author:     Gerald Elder-Vass <gerald.elder-vass@cloud.com>
AuthorDate: Thu Sep 11 08:24:28 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 14 18:31:43 2025 +0100

    efi: Protect against unnecessary image unloading
    
    Commit 59a1d6d3ea1e introduced Shim's LoadImage protocol and unloads the
    image after loading it (for verification purposes) regardless of the
    returned status. The protocol API implies this is the correct behaviour
    but we should add a check to protect against the unlikely case this
    frees any memory in use.
    
    Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/common/efi/boot.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 5b84dbf26e..d7f4d0cb22 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1062,7 +1062,7 @@ static void __init efi_verify_kernel(EFI_HANDLE ImageHandle)
     static EFI_GUID __initdata shim_image_guid = SHIM_IMAGE_LOADER_GUID;
     static EFI_GUID __initdata shim_lock_guid = SHIM_LOCK_PROTOCOL_GUID;
     SHIM_IMAGE_LOADER *shim_loader;
-    EFI_HANDLE loaded_kernel;
+    EFI_HANDLE loaded_kernel = NULL;
     EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_STATUS status;
     bool verified = false;
@@ -1078,11 +1078,13 @@ static void __init efi_verify_kernel(EFI_HANDLE ImageHandle)
             verified = true;
 
         /*
-         * Always unload the image.  We only needed LoadImage() to perform
-         * verification anyway, and in the case of a failure there may still
-         * be cleanup needing to be performed.
+         * If the kernel was loaded, unload it. We only needed LoadImage() to
+         * perform verification anyway, and in the case of a failure there may
+         * still be cleanup needing to be performed.
          */
-        shim_loader->UnloadImage(loaded_kernel);
+        if ( loaded_kernel &&
+             (!EFI_ERROR(status) || status == EFI_SECURITY_VIOLATION) )
+            shim_loader->UnloadImage(loaded_kernel);
     }
 
     /* Otherwise, fall back to SHIM_LOCK. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Oct 16 10:11:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Oct 2025 10:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1144399.1477786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9Kwp-00020z-SI; Thu, 16 Oct 2025 10:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1144399.1477786; Thu, 16 Oct 2025 10: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 1v9Kwp-00020r-PR; Thu, 16 Oct 2025 10:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1144399;
 Thu, 16 Oct 2025 10: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 1v9Kwo-00020l-Ai
 for xen-changelog@lists.xenproject.org; Thu, 16 Oct 2025 10: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 1v9Kwn-004loB-2j
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 10:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9Kwn-008ODZ-3B
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 10: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=1gQN70iRcWEPbHlpCfGU4ZEesIj16oNPV8IxEptiPy0=; b=dkksXAS0fNQH4T+rSnSBRKg+GV
	8EoDnb7RMOv9B2eeMelKARsSUZtplMDm1f4ZRwzGQgJdws5zmSm+8lJzIcMVto49N4ie2szWxiL+7
	/0sqjuowXCbkdfHyvF420u3o6zcZQv3JPaJuC0B1V1+kw53I9WBxzABG4rgxAaRkVXRo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CHANGELOG.md: mention the introduction of configurable altp2m count
Message-Id: <E1v9Kwn-008ODZ-3B@xenbits.xenproject.org>
Date: Thu, 16 Oct 2025 10:11:01 +0000

commit c859b7b2060dd7fd916816f8caf8939eb1aa2bea
Author:     Petr Beneš <w1benny@gmail.com>
AuthorDate: Thu Oct 16 10:25:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:25:08 2025 +0200

    CHANGELOG.md: mention the introduction of configurable altp2m count
    
    Signed-off-by: Petr Beneš <w1benny@gmail.com>
    Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c70bc0250..0cf9ad2d95 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - Allow controlling the MTRR cache attribute of the Xen platform PCI device
      BAR for HVM guests, to improve performance of guests using it to map the
      grant table or foreign memory.
+   - Allow configuring the number of altp2m tables per domain via vm.cfg.
 
 ### Added
  - Introduce new PDX compression algorithm to cope with Intel Sierra Forest and
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 16 10:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Oct 2025 10:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1144400.1477789 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9Kwz-00022k-TZ; Thu, 16 Oct 2025 10:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1144400.1477789; Thu, 16 Oct 2025 10: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 1v9Kwz-00022c-R4; Thu, 16 Oct 2025 10:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1144400;
 Thu, 16 Oct 2025 10: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 1v9Kwy-00022R-7i
 for xen-changelog@lists.xenproject.org; Thu, 16 Oct 2025 10: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 1v9Kwx-004loF-34
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 10:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9Kwy-008OEJ-0M
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 10: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=p8cSqaGv4xUcQVkkII9EiSMIn3R2+W0/KeiyHl1q7ik=; b=bnvhARSa5NEdTbmRpwAX2U8vXi
	eVfEl5uyYjm/i6ipsyQHyEQLRfC8R4KjjWcZpmYBNAbcCndE/IO+M9rsJfE0RiyoIbITGMSxuwW7e
	bmvO8IpB8JtBgI913w+ncmGcvPkQBnJNEYFCJG5hp6+c2rsWdpzfec0CP1kXNYLv8YWY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/boot: Fix edd=off to skip mbr
Message-Id: <E1v9Kwy-008OEJ-0M@xenbits.xenproject.org>
Date: Thu, 16 Oct 2025 10:11:12 +0000

commit 02e656f7c8fd63828307a4eac633958d82b36116
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Thu Oct 16 10:25:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:25:27 2025 +0200

    x86/boot: Fix edd=off to skip mbr
    
    When the fixes commit re-arranged the code, it made edd=off jump to the
    mbr code instead of returning from the function.  Previously edd_done
    was immediately before ret and skipped the MBR check.
    
    Replace edd_done with .Ledd_mbr_sig for the start of the MBR checking,
    and replace .Ledd_mbr_sig_skip with .Ledd_done to exit from the function.
    
    edd=off jumps to .Ledd_done to return from the function, and internal
    jumps go to .Ledd_mbr_sig to check edd=skipmbr.
    
    Fixes: 5ec164fd61bd ("x86/boot: re-arrange how/when we do disk I/O")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/boot/edd.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 3df712bce1..02437511b2 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -25,7 +25,7 @@
 
 get_edd:
         cmpb    $2, bootsym(opt_edd)            # edd=off ?
-        je      edd_done
+        je      .Ledd_done
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
@@ -48,7 +48,7 @@ edd_check_ext:
         movb    $0x41, %ah                      # 0x41 Check Extensions Present
         movw    $0x55AA, %bx                    # magic
         int     $0x13                           # make the call
-        jc      edd_done                        # no more BIOS devices
+        jc      .Ledd_mbr_sig                   # no more BIOS devices
 
         cmpw    $0xAA55, %bx                    # is magic right?
         jne     edd_next                        # nope, next...
@@ -96,13 +96,13 @@ edd_legacy_done:
 
 edd_next:
         incb    %dl                             # increment to next device
-        jz      edd_done
+        jz      .Ledd_mbr_sig
         cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
         jb      edd_check_ext
 
-edd_done:
+.Ledd_mbr_sig:
         cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
-        je      .Ledd_mbr_sig_skip
+        je      .Ledd_done
 
 # Read the first sector of each BIOS disk device and store the 4-byte signature
 .Ledd_mbr_sig_start:
@@ -160,7 +160,7 @@ edd_done:
         jb      .Ledd_mbr_sig_read
 .Ledd_mbr_sig_done:
         popw    %es
-.Ledd_mbr_sig_skip:
+.Ledd_done:
         ret
 
 GLOBAL(boot_edd_info_nr)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 16 11:00:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Oct 2025 11:00:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1144449.1477842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9LiH-0001VC-7O; Thu, 16 Oct 2025 11:00:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1144449.1477842; Thu, 16 Oct 2025 11:00:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9LiH-0001Um-4i; Thu, 16 Oct 2025 11:00:05 +0000
Received: by outflank-mailman (input) for mailman id 1144449;
 Thu, 16 Oct 2025 11:00: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 1v9LiF-0000wd-HC
 for xen-changelog@lists.xenproject.org; Thu, 16 Oct 2025 11:00: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 1v9LiE-004mhU-0K
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 11:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9LiE-008TS7-0r
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 11: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=5wAzD9BzrnanZujDPgcb62EAxqbqhzVZTYxV3jrrGo4=; b=PPbQ4Aq0awGahiDdnr8AzHcyFM
	e5ucisfagKs2MFF9O/5t5vx8pn22K26B76QbHY4OB6oqEZXpB9RApx2BfDuT2jhNCg2J47QW0RbSv
	SMia7eNdMY/UA90vThADnsjjdd0/ndkRez53N9NjnItm1joNRRnQl8+TYg3zijrTwivw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG.md: mention the introduction of configurable altp2m count
Message-Id: <E1v9LiE-008TS7-0r@xenbits.xenproject.org>
Date: Thu, 16 Oct 2025 11:00:02 +0000

commit c859b7b2060dd7fd916816f8caf8939eb1aa2bea
Author:     Petr Beneš <w1benny@gmail.com>
AuthorDate: Thu Oct 16 10:25:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:25:08 2025 +0200

    CHANGELOG.md: mention the introduction of configurable altp2m count
    
    Signed-off-by: Petr Beneš <w1benny@gmail.com>
    Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c70bc0250..0cf9ad2d95 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - Allow controlling the MTRR cache attribute of the Xen platform PCI device
      BAR for HVM guests, to improve performance of guests using it to map the
      grant table or foreign memory.
+   - Allow configuring the number of altp2m tables per domain via vm.cfg.
 
 ### Added
  - Introduce new PDX compression algorithm to cope with Intel Sierra Forest and
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Oct 16 11:00:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Oct 2025 11:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1144450.1477845 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9LiQ-0001oa-8U; Thu, 16 Oct 2025 11:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1144450.1477845; Thu, 16 Oct 2025 11:00:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9LiQ-0001oS-5z; Thu, 16 Oct 2025 11:00:14 +0000
Received: by outflank-mailman (input) for mailman id 1144450;
 Thu, 16 Oct 2025 11:00: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 1v9LiO-0001oJ-ED
 for xen-changelog@lists.xenproject.org; Thu, 16 Oct 2025 11:00: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 1v9LiO-004mhc-0d
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 11:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9LiO-008TXs-1A
 for xen-changelog@lists.xenproject.org;
 Thu, 16 Oct 2025 11:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cpyYff+zEd3P+FaqP8BH00RBh0xsSeviNHKUG4nPixU=; b=YlnzeHf/mt7uD2xalrHfal0+yx
	Fi9+gwzBAO0tSv/IT74fWjEnZLvQHhdFu1oJ52oDYZOWY79nplHwZ7u8PDlWTDRH//lHCPX+utLoo
	rskdelEEwEy7+PSKEeFjSsFOgQqeTDVXKOIciusVDVuSeOPqDQVjNf8U1g+Xs13Fs+2w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: Fix edd=off to skip mbr
Message-Id: <E1v9LiO-008TXs-1A@xenbits.xenproject.org>
Date: Thu, 16 Oct 2025 11:00:12 +0000

commit 02e656f7c8fd63828307a4eac633958d82b36116
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Thu Oct 16 10:25:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 16 10:25:27 2025 +0200

    x86/boot: Fix edd=off to skip mbr
    
    When the fixes commit re-arranged the code, it made edd=off jump to the
    mbr code instead of returning from the function.  Previously edd_done
    was immediately before ret and skipped the MBR check.
    
    Replace edd_done with .Ledd_mbr_sig for the start of the MBR checking,
    and replace .Ledd_mbr_sig_skip with .Ledd_done to exit from the function.
    
    edd=off jumps to .Ledd_done to return from the function, and internal
    jumps go to .Ledd_mbr_sig to check edd=skipmbr.
    
    Fixes: 5ec164fd61bd ("x86/boot: re-arrange how/when we do disk I/O")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/boot/edd.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 3df712bce1..02437511b2 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -25,7 +25,7 @@
 
 get_edd:
         cmpb    $2, bootsym(opt_edd)            # edd=off ?
-        je      edd_done
+        je      .Ledd_done
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
@@ -48,7 +48,7 @@ edd_check_ext:
         movb    $0x41, %ah                      # 0x41 Check Extensions Present
         movw    $0x55AA, %bx                    # magic
         int     $0x13                           # make the call
-        jc      edd_done                        # no more BIOS devices
+        jc      .Ledd_mbr_sig                   # no more BIOS devices
 
         cmpw    $0xAA55, %bx                    # is magic right?
         jne     edd_next                        # nope, next...
@@ -96,13 +96,13 @@ edd_legacy_done:
 
 edd_next:
         incb    %dl                             # increment to next device
-        jz      edd_done
+        jz      .Ledd_mbr_sig
         cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
         jb      edd_check_ext
 
-edd_done:
+.Ledd_mbr_sig:
         cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
-        je      .Ledd_mbr_sig_skip
+        je      .Ledd_done
 
 # Read the first sector of each BIOS disk device and store the 4-byte signature
 .Ledd_mbr_sig_start:
@@ -160,7 +160,7 @@ edd_done:
         jb      .Ledd_mbr_sig_read
 .Ledd_mbr_sig_done:
         popw    %es
-.Ledd_mbr_sig_skip:
+.Ledd_done:
         ret
 
 GLOBAL(boot_edd_info_nr)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 08:33:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 08:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145048.1478194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9ftX-0006ro-Ei; Fri, 17 Oct 2025 08:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145048.1478194; Fri, 17 Oct 2025 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 1v9ftX-0006rg-Bb; Fri, 17 Oct 2025 08:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1145048;
 Fri, 17 Oct 2025 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 1v9ftW-0006ra-3H
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 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 1v9ftV-006KHu-22
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9ftV-00Avs6-2V
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 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=ldnPB/yi5eizAOLdTsKcmxAsGcWp7mwbS1a3wx5P2CE=; b=aN8vvQKIPfBTYwQXAnq+NZooOY
	vGLIvY2dTfgYqRYCcV7O0NILuInclqd4cKce1gozOT3XBBJBDQjt9QNePo/85EKeQxru1jvCTffMN
	1h2jES1eoP93J9AL3v2SyTUqB59FmcnHNrFcvFZ+UH20Gaz7F+PRZxpVNl8AGLiU5k2w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/{lib,}xl: fix usage of error return from json_tokener_parse_verbose()
Message-Id: <E1v9ftV-00Avs6-2V@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 08:33:01 +0000

commit 98cdab167938d74fcce5b83260a43610316bafb2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 13:49:49 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:10 2025 +0200

    tools/{lib,}xl: fix usage of error return from json_tokener_parse_verbose()
    
    It's possible for json_tokener_parse_verbose() to return NULL and leave the
    error parameter unset.  Initialize the error variable at definition to an
    existing error token to make sure it's not uninitialized in case of
    failure.
    
    Reported by XenServer internal Coverity instance.
    
    Fixes: 7e95dab9eb63 ("libxl: Convert libxl__json_parse() to use json-c")
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/libs/light/libxl_json.c | 2 +-
 tools/xl/xl_info.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index c76ae9f64a..e895cca4cf 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -1366,7 +1366,7 @@ libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
     libxl__json_object *o = NULL;
 #ifdef USE_LIBJSONC_PARSER
     json_object *jso;
-    enum json_tokener_error error;
+    enum json_tokener_error error = json_tokener_error_parse_unexpected;
 
     jso = json_tokener_parse_verbose(s, &error);
     if (!jso) {
diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 80a3b25aac..47f4bb7e3f 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -67,7 +67,7 @@ static int printf_info_one_json(json_object **jso_r, int domid,
 {
     json_object *jso = NULL;
     json_object *jso_config = NULL;
-    enum json_tokener_error error;
+    enum json_tokener_error error = json_tokener_error_parse_unexpected;
     char *s = NULL;
     int r = EXIT_FAILURE;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 08:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 08:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145049.1478197 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9fth-0006tY-Fa; Fri, 17 Oct 2025 08:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145049.1478197; Fri, 17 Oct 2025 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 1v9fth-0006tQ-D2; Fri, 17 Oct 2025 08:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1145049;
 Fri, 17 Oct 2025 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 1v9ftg-0006tE-0Y
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 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 1v9ftf-006KI1-2W
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9ftf-00AvtA-2s
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 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=BNtK4/61BJoFEsNtDefPJuz93YxmCkmF0se7dux/qd0=; b=jQODpeQ6XM2DsxDhkhqDB3QIWw
	d0GHtDUU82buNW2bW9kdsZ0Ue/qxBqAgluTNeGvyyjuxeIpDCMQ5VsY0k6h7WdIMGm6BbTqRFE7Gs
	bRiFtr4r14aKY262ExpxycnQJlV/uFY4CJ4tLr6EC+FMGtykctwKKm2EB61rFCWv/CPQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: avoid freeing stack rubble in libxl__json_object_to_json()
Message-Id: <E1v9ftf-00AvtA-2s@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 08:33:11 +0000

commit 3539308d8206e64526f66726f5514330f2ff10d5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:02:17 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:18 2025 +0200

    tools/libxl: avoid freeing stack rubble in libxl__json_object_to_json()
    
    It's possible for libxl__json_object_to_json_object() to not set the passed
    jso_out parameter, hence initialize it in libxl__json_object_to_json() to
    avoid freeing an uninitialized pointer in case of failure.
    
    Reported by XenServer internal Coverity instance.
    
    Fixes: 75fa670e582c ("libxl: Convert libxl__json_object_to_json() to json_object")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/libs/light/libxl_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index e895cca4cf..68f36901c2 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -1531,7 +1531,7 @@ char *libxl__json_object_to_json(libxl__gc *gc,
 {
 #ifdef HAVE_LIBJSONC
     const char *buf;
-    json_object *root;
+    json_object *root = NULL;
     char *ret = NULL;
     int rc;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 08:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 08:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145050.1478201 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9ftr-0006w6-H8; Fri, 17 Oct 2025 08:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145050.1478201; Fri, 17 Oct 2025 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 1v9ftr-0006vy-EV; Fri, 17 Oct 2025 08:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1145050;
 Fri, 17 Oct 2025 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 1v9ftq-0006vn-5L
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 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 1v9ftp-006KI8-2n
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9ftq-00Avtw-07
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 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=mpczfF4nuRpGFzxMvJb5WisySJgzZK8Kh/B+E/EPF/Y=; b=HJehxhz4mU4M3vY+QurKwUcVws
	J5qxQjf4Gm8qLRaYNeYwgH1ER4aHbi1S1Kdj1tK0sUBcFR8lt5No2HK+ukaR5Uk9KZd0Rr7sKT6MR
	KM+3mW0AFalq8ogw2+Wncf367vVYCZdHkoMvejMhxewunDEmXefPIRZ5PyO6PHzo1ZtU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xl: check return of json_object_object_add()
Message-Id: <E1v9ftq-00Avtw-07@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 08:33:22 +0000

commit a4d92cf18955dfd8eb0b9c858a149e064e8e2e54
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:11:39 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:27 2025 +0200

    tools/xl: check return of json_object_object_add()
    
    Check the return codes of json_object_object_add() calls in
    printf_info_one_json().
    
    Reported by XenServer internal Coverity instance.
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xl/xl_info.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 47f4bb7e3f..b1799dd8af 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -69,7 +69,7 @@ static int printf_info_one_json(json_object **jso_r, int domid,
     json_object *jso_config = NULL;
     enum json_tokener_error error = json_tokener_error_parse_unexpected;
     char *s = NULL;
-    int r = EXIT_FAILURE;
+    int r = EXIT_FAILURE, rc;
 
     s = libxl_domain_config_to_json(ctx, d_config);
     jso_config = json_tokener_parse_verbose(s, &error);
@@ -81,12 +81,17 @@ static int printf_info_one_json(json_object **jso_r, int domid,
 
     jso = json_object_new_object();
     if (domid != -1)
-        json_object_object_add(jso, "domid", json_object_new_int(domid));
+        rc = json_object_object_add(jso, "domid", json_object_new_int(domid));
     else
-        json_object_object_add(jso, "domid", json_object_new_null());
+        rc = json_object_object_add(jso, "domid", json_object_new_null());
+    if (rc)
+        goto out;
+
 
+    rc = json_object_object_add(jso, "config", jso_config);
+    if (rc)
+        goto out;
 
-    json_object_object_add(jso, "config", jso_config);
     jso_config = NULL;
 
     *jso_r = jso;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 08:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 08:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145051.1478205 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9fu1-0006yD-IQ; Fri, 17 Oct 2025 08:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145051.1478205; Fri, 17 Oct 2025 08:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9fu1-0006y5-Ft; Fri, 17 Oct 2025 08:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1145051;
 Fri, 17 Oct 2025 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 1v9fu0-0006xx-7g
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 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 1v9fu0-006KID-01
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9fu0-00AvvF-0O
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 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=kGa4QLOUjuZx1u0BnKvvCpBwzhjJXfV1e5F2UJR8syc=; b=KPE0u1zCKmLHRR26/NWofX3Wn5
	V+B1dlcIGC9T34m6TeMA8zCH+OOCHHbVfgz6GhI3nSmf2U1Vewky8KawmgV1iCldZbaSlrwUL0KFZ
	Zjvxbpz/adQpNGmkMr+fi83dxxhCZQgJWs3rgMnCNKfJUTrgHpQzgOPoGmOBypG27Yqs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xl: check return value of printf_info_one_json() in list_domains_details()
Message-Id: <E1v9fu0-00AvvF-0O@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 08:33:32 +0000

commit d0193c6d6716784358e44d59556d6ad32e885cca
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:17:37 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:32 2025 +0200

    tools/xl: check return value of printf_info_one_json() in list_domains_details()
    
    And return from the function early if printf_info_one_json() returns error.
    
    Reported by internal XenServer Coverity instance.
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pua@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xl/xl_info.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index b1799dd8af..61243bd558 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -584,6 +584,8 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
 #ifdef HAVE_LIBJSONC
             json_object *jso_value;
             rc = printf_info_one_json(&jso_value, info[i].domid, &d_config);
+            if (rc)
+                goto out;
             json_object_array_add(jso, jso_value);
 #elif defined(HAVE_LIBYAJL)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 08:33:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 08:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145052.1478209 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9fuB-00070Q-K1; Fri, 17 Oct 2025 08:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145052.1478209; Fri, 17 Oct 2025 08:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9fuB-00070I-HE; Fri, 17 Oct 2025 08:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1145052;
 Fri, 17 Oct 2025 08: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 1v9fuA-000703-AW
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 08: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 1v9fuA-006KIJ-0K
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9fuA-00Avxn-0r
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wIsqYdMHFMTqrH9XeCbsnaFc3336BDcxX8T2i/JAxiw=; b=0o6g8fGpXshYqJr6D7yyazd8Me
	zr7xu1QQ9tHXfrHIop4Ui7Fe1O6rYzWKTgJ6OVbPWgeHLtApaFWKJoq6ujHkJSysRwdl8tDvDzs8a
	ZT71PmBlbea9zonErykC0yfgsWgjLufpLJBMBZYs+K8xPhrFCq6y8sJ5REnYmy0Xa4zA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xl: fix possible uninitialized usage in printf_info()
Message-Id: <E1v9fuA-00Avxn-0r@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 08:33:42 +0000

commit 439ebb08081f8ca01d52d0aecf4b3aed895f40c9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:23:45 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:38 2025 +0200

    tools/xl: fix possible uninitialized usage in printf_info()
    
    printf_info_one_json() won't initialize the passed jso_r parameter on
    error, and hence the usage in printf_info() needs prior initialization,
    otherwise an uninitialized pointer is passed to json_object_put() on
    failure.
    
    Reported by the internal XenServer Coverity instance.
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xl/xl_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 61243bd558..dbb682cc52 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -154,7 +154,7 @@ void printf_info(enum output_format output_format,
 #ifdef HAVE_LIBJSONC
     int r;
     const char *buf;
-    json_object *jso;
+    json_object *jso = NULL;
 
     r = printf_info_one_json(&jso, domid, d_config);
     if (r)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 08:33:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 08:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145053.1478213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9fuL-00072V-LL; Fri, 17 Oct 2025 08:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145053.1478213; Fri, 17 Oct 2025 08:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9fuL-00072N-If; Fri, 17 Oct 2025 08:33:53 +0000
Received: by outflank-mailman (input) for mailman id 1145053;
 Fri, 17 Oct 2025 08:33: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 1v9fuK-00072F-DH
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 08:33: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 1v9fuK-006KIg-0a
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9fuK-00AvyZ-18
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 08:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oOpSIXjgNxJjYGKI77Sv1pxsZJgm6pBHVtZX4b/S40c=; b=YLwSRr2ejdWA2AQ40enmbs1B/r
	yqGGlKIgmNirE5rqE6Bnp47VVsG/Z6y3kLiNMiqu+bmKoqAkt3nCsX+Y5M0R+eHFL5oHJ/aXhD+qQ
	Z++KQonwVLRH0hE3jnD3N2s9ChK/QWcDDCIAw/5hg88xQC7dWDorjGoO/4w3xy3W4oTw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] github/coverity: switch to building with json-c instead of yajl
Message-Id: <E1v9fuK-00AvyZ-18@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 08:33:52 +0000

commit a087606a3ef52e400e03ff03b26e7831a25542cc
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:57:19 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:45 2025 +0200

    github/coverity: switch to building with json-c instead of yajl
    
    Switch the json library used by the Coverity runs.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .github/workflows/coverity.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index a6c2819b0a..a9a971f6a1 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -20,9 +20,9 @@ jobs:
           iasl \
           libbz2-dev \
           libext2fs-dev \
+          libjson-c-dev \
           liblzma-dev \
           libncurses5-dev \
-          libyajl-dev \
           libzstd-dev \
           ocaml \
           ocaml-findlib \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 09:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 09:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145091.1478237 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9gpc-0006C3-0Z; Fri, 17 Oct 2025 09:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145091.1478237; Fri, 17 Oct 2025 09: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 1v9gpb-0006Bv-UC; Fri, 17 Oct 2025 09:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1145091;
 Fri, 17 Oct 2025 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 1v9gpa-0006Bn-0R
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 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 1v9gpZ-006LM4-1n
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9gpZ-00B3UJ-2F
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zslDmYFH/0ED0ZtNWbqlwHMidyyowEG7vlNlUb/iPsQ=; b=tm2qoLY6GUipmwdan0OZM0y4wU
	o+tKSdpd0SVn2eQRqOOyZoQwcotHq+8KA2HjjuUCDPatVPBnJyJZTEQHqEwJuEms9FsS4cF0tmmII
	IyMi0J4R7YPDJ1ICQqHWLhyps/kk/yIG1DeX4vFFO7YGF225/oS1RKm2hbwcQUpddo38=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/{lib,}xl: fix usage of error return from json_tokener_parse_verbose()
Message-Id: <E1v9gpZ-00B3UJ-2F@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 09:33:01 +0000

commit 98cdab167938d74fcce5b83260a43610316bafb2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 13:49:49 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:10 2025 +0200

    tools/{lib,}xl: fix usage of error return from json_tokener_parse_verbose()
    
    It's possible for json_tokener_parse_verbose() to return NULL and leave the
    error parameter unset.  Initialize the error variable at definition to an
    existing error token to make sure it's not uninitialized in case of
    failure.
    
    Reported by XenServer internal Coverity instance.
    
    Fixes: 7e95dab9eb63 ("libxl: Convert libxl__json_parse() to use json-c")
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/libs/light/libxl_json.c | 2 +-
 tools/xl/xl_info.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index c76ae9f64a..e895cca4cf 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -1366,7 +1366,7 @@ libxl__json_object *libxl__json_parse(libxl__gc *gc, const char *s)
     libxl__json_object *o = NULL;
 #ifdef USE_LIBJSONC_PARSER
     json_object *jso;
-    enum json_tokener_error error;
+    enum json_tokener_error error = json_tokener_error_parse_unexpected;
 
     jso = json_tokener_parse_verbose(s, &error);
     if (!jso) {
diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 80a3b25aac..47f4bb7e3f 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -67,7 +67,7 @@ static int printf_info_one_json(json_object **jso_r, int domid,
 {
     json_object *jso = NULL;
     json_object *jso_config = NULL;
-    enum json_tokener_error error;
+    enum json_tokener_error error = json_tokener_error_parse_unexpected;
     char *s = NULL;
     int r = EXIT_FAILURE;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 09:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 09:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145092.1478241 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9gpl-0006E3-1m; Fri, 17 Oct 2025 09:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145092.1478241; Fri, 17 Oct 2025 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 1v9gpk-0006Dv-VZ; Fri, 17 Oct 2025 09:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1145092;
 Fri, 17 Oct 2025 09: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 1v9gpj-0006Dj-UF
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 09: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 1v9gpj-006LMA-25
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9gpj-00B3VK-2c
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09: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=xbYweVC0Co5Qq9OqNwZ2PN4+VlpfzSdCpplOO7OLi7s=; b=rgYGhQHwEfEu4cX4tljTv5OSTr
	qtdVgS0aaEonqi3TSilqD6Z/HIlmkHymABh1EIiHUOZUYcxLd7Ow2HsLPgIFM6PFxRuE9ws/nwrPU
	+A9aEVm2UHu1dV7kPyVWuPGhNLc7cvBDLAzBqIEF0U9PNX94yL2a264+lpcmgFfJoqq8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: avoid freeing stack rubble in libxl__json_object_to_json()
Message-Id: <E1v9gpj-00B3VK-2c@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 09:33:11 +0000

commit 3539308d8206e64526f66726f5514330f2ff10d5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:02:17 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:18 2025 +0200

    tools/libxl: avoid freeing stack rubble in libxl__json_object_to_json()
    
    It's possible for libxl__json_object_to_json_object() to not set the passed
    jso_out parameter, hence initialize it in libxl__json_object_to_json() to
    avoid freeing an uninitialized pointer in case of failure.
    
    Reported by XenServer internal Coverity instance.
    
    Fixes: 75fa670e582c ("libxl: Convert libxl__json_object_to_json() to json_object")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/libs/light/libxl_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index e895cca4cf..68f36901c2 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -1531,7 +1531,7 @@ char *libxl__json_object_to_json(libxl__gc *gc,
 {
 #ifdef HAVE_LIBJSONC
     const char *buf;
-    json_object *root;
+    json_object *root = NULL;
     char *ret = NULL;
     int rc;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 09:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 09:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145093.1478246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9gpv-0006GY-3k; Fri, 17 Oct 2025 09:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145093.1478246; Fri, 17 Oct 2025 09: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 1v9gpv-0006GQ-0c; Fri, 17 Oct 2025 09:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1145093;
 Fri, 17 Oct 2025 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 1v9gpt-0006GI-Vj
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 09: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 1v9gpt-006LMF-2O
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9gpt-00B3Y6-2u
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09: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=3EJj0EwEkpSTIWZ/ZV4L3t6aCDRtyZHNBvmM2+WNA2A=; b=JCNeqO5VAIAFJFIKWIBc/KDC4o
	6z+x+NegmaaRoQ2KeEiFdnO83ETFGF+CNh6PH7gX6SUpQdAVpuOeZ2AA0DiHo5OddzgD6x435HX8w
	z0vKKZgFcEc2LyDRXWi/KpFc2CJXg56GmQHimm5R3XYgqza/t8FUFBqbxkz6RkaQsWqA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xl: check return of json_object_object_add()
Message-Id: <E1v9gpt-00B3Y6-2u@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 09:33:21 +0000

commit a4d92cf18955dfd8eb0b9c858a149e064e8e2e54
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:11:39 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:27 2025 +0200

    tools/xl: check return of json_object_object_add()
    
    Check the return codes of json_object_object_add() calls in
    printf_info_one_json().
    
    Reported by XenServer internal Coverity instance.
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xl/xl_info.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 47f4bb7e3f..b1799dd8af 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -69,7 +69,7 @@ static int printf_info_one_json(json_object **jso_r, int domid,
     json_object *jso_config = NULL;
     enum json_tokener_error error = json_tokener_error_parse_unexpected;
     char *s = NULL;
-    int r = EXIT_FAILURE;
+    int r = EXIT_FAILURE, rc;
 
     s = libxl_domain_config_to_json(ctx, d_config);
     jso_config = json_tokener_parse_verbose(s, &error);
@@ -81,12 +81,17 @@ static int printf_info_one_json(json_object **jso_r, int domid,
 
     jso = json_object_new_object();
     if (domid != -1)
-        json_object_object_add(jso, "domid", json_object_new_int(domid));
+        rc = json_object_object_add(jso, "domid", json_object_new_int(domid));
     else
-        json_object_object_add(jso, "domid", json_object_new_null());
+        rc = json_object_object_add(jso, "domid", json_object_new_null());
+    if (rc)
+        goto out;
+
 
+    rc = json_object_object_add(jso, "config", jso_config);
+    if (rc)
+        goto out;
 
-    json_object_object_add(jso, "config", jso_config);
     jso_config = NULL;
 
     *jso_r = jso;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 09:33:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 09:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145094.1478249 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9gq6-0006JZ-5e; Fri, 17 Oct 2025 09:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145094.1478249; Fri, 17 Oct 2025 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 1v9gq6-0006JR-3A; Fri, 17 Oct 2025 09:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1145094;
 Fri, 17 Oct 2025 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 1v9gq4-0006JG-2J
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 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 1v9gq3-006LMK-2i
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9gq3-00B3ZH-3C
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09: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=Vyo3Vc1hLQCUv5d/paBTc0Y6KLYx9I1VGgWUjz5cmZ4=; b=SRVsW5xfUJDDcvAI+kd66cJ7en
	Z1ytxo44asjSwNHMccDIEmzlq9HuuKghS/W0PmZvjxfJANiTfqC6ivrV1yK6gXmUG7PY3QIOzs41w
	IDdoBHgjJ/EpA5tdJbfuGz2VhwGRL2IU+ZdMMzKxYc4qrLSnkJgzeiL+Kb4BIERgzeP0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xl: check return value of printf_info_one_json() in list_domains_details()
Message-Id: <E1v9gq3-00B3ZH-3C@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 09:33:31 +0000

commit d0193c6d6716784358e44d59556d6ad32e885cca
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:17:37 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:32 2025 +0200

    tools/xl: check return value of printf_info_one_json() in list_domains_details()
    
    And return from the function early if printf_info_one_json() returns error.
    
    Reported by internal XenServer Coverity instance.
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pua@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xl/xl_info.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index b1799dd8af..61243bd558 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -584,6 +584,8 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
 #ifdef HAVE_LIBJSONC
             json_object *jso_value;
             rc = printf_info_one_json(&jso_value, info[i].domid, &d_config);
+            if (rc)
+                goto out;
             json_object_array_add(jso, jso_value);
 #elif defined(HAVE_LIBYAJL)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 09:33:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 09:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145095.1478253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9gqG-0006Lk-7Q; Fri, 17 Oct 2025 09:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145095.1478253; Fri, 17 Oct 2025 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 1v9gqG-0006Lc-4T; Fri, 17 Oct 2025 09:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1145095;
 Fri, 17 Oct 2025 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 1v9gqE-0006LS-5U
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 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 1v9gqD-006LMO-30
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9gqE-00B3aK-0J
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 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=y/C5iWEPhDACuyZAAgsVvPuk0GTXvX2I4YMlnuQpZNw=; b=NrqIfCb3l49SlkHkowpn/R2wOB
	ahUtKIv4VNXP4JbJx0Z+Otg8nkMfQbuGiH8k5bOZq6SJe/6/vEQFIz+6IL6e1O3KzemoGHFgwwpH9
	ZZWWWsSn19cIuHZtVIBrrtfndkAcWZ2fDkJoSNPwlIx+JQA5YLblijqRgjUcLlq2VXeU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xl: fix possible uninitialized usage in printf_info()
Message-Id: <E1v9gqE-00B3aK-0J@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 09:33:42 +0000

commit 439ebb08081f8ca01d52d0aecf4b3aed895f40c9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:23:45 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:38 2025 +0200

    tools/xl: fix possible uninitialized usage in printf_info()
    
    printf_info_one_json() won't initialize the passed jso_r parameter on
    error, and hence the usage in printf_info() needs prior initialization,
    otherwise an uninitialized pointer is passed to json_object_put() on
    failure.
    
    Reported by the internal XenServer Coverity instance.
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xl/xl_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 61243bd558..dbb682cc52 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -154,7 +154,7 @@ void printf_info(enum output_format output_format,
 #ifdef HAVE_LIBJSONC
     int r;
     const char *buf;
-    json_object *jso;
+    json_object *jso = NULL;
 
     r = printf_info_one_json(&jso, domid, d_config);
     if (r)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 17 09:33:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Oct 2025 09:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1145096.1478257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1v9gqQ-0006Nx-8g; Fri, 17 Oct 2025 09:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1145096.1478257; Fri, 17 Oct 2025 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 1v9gqQ-0006Np-69; Fri, 17 Oct 2025 09:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1145096;
 Fri, 17 Oct 2025 09:33: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 1v9gqO-0006Nf-DN
 for xen-changelog@lists.xenproject.org; Fri, 17 Oct 2025 09:33: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 1v9gqO-006LMl-0P
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 09:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1v9gqO-00B3cd-0a
 for xen-changelog@lists.xenproject.org;
 Fri, 17 Oct 2025 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=lRjuDN/MUh945pdrONlc2c0DS5kYdW0DvmyadeOJYOA=; b=Th/dIdVmlVHPf5pgtYK7HI+1/t
	8EaC38LnRal7Vl10BupiAQOZ1lLS6uz66RrfR+NL6MKr/cLoEYqhHdVjNwsRa/zsOwxMEakHHBFaU
	IPAQrwpqm37azFBHFP1VNQ46eRYjUVt38PnhZgFSsX3AsdXDRj18dXewijcOj6BUHiHE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] github/coverity: switch to building with json-c instead of yajl
Message-Id: <E1v9gqO-00B3cd-0a@xenbits.xenproject.org>
Date: Fri, 17 Oct 2025 09:33:52 +0000

commit a087606a3ef52e400e03ff03b26e7831a25542cc
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Oct 15 14:57:19 2025 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Oct 16 17:20:45 2025 +0200

    github/coverity: switch to building with json-c instead of yajl
    
    Switch the json library used by the Coverity runs.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 .github/workflows/coverity.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index a6c2819b0a..a9a971f6a1 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -20,9 +20,9 @@ jobs:
           iasl \
           libbz2-dev \
           libext2fs-dev \
+          libjson-c-dev \
           liblzma-dev \
           libncurses5-dev \
-          libyajl-dev \
           libzstd-dev \
           ocaml \
           ocaml-findlib \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 20 12:33:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Oct 2025 12:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1146286.1478724 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vAp4R-0002nu-0H; Mon, 20 Oct 2025 12:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1146286.1478724; Mon, 20 Oct 2025 12: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 1vAp4Q-0002nm-Tz; Mon, 20 Oct 2025 12:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1146286;
 Mon, 20 Oct 2025 12: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 1vAp4P-0002ng-Nm
 for xen-changelog@lists.xenproject.org; Mon, 20 Oct 2025 12: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 1vAp4P-00B8qg-19
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Oct 2025 12:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vAp4P-002oY7-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Oct 2025 12:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Sap+sIuhXslrkGskSiAvFlfpdq/suCqHRkBpGNiSSNk=; b=UVmMiyhnCpFLuQlJxzmeS+VFN2
	vvihk53OPNJt/NzpNmg27SH6qQeVVZTVTHXG0QZQ04u0efSmRfcW/Uft0sMkR4pM5THKB0Qr+NKEr
	K0al+hzmb9jDKQyvnn/qwOQnD5nN87WWwHwnp8/As3SasVv3iQmTf7INYRAhrnsM+3Jg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/apic: Avoid infinite loop in io_apic_level_ack_pending()
Message-Id: <E1vAp4P-002oY7-1a@xenbits.xenproject.org>
Date: Mon, 20 Oct 2025 12:33:01 +0000

commit ad8d3d7f4001046c03b9bfb3919884d74dad96ed
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Mon Oct 20 13:03:10 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 20 13:03:10 2025 +0200

    x86/apic: Avoid infinite loop in io_apic_level_ack_pending()
    
    io_apic_level_ack_pending() will end up in an infinite loop if
    entry->pin == -1.  entry does not change, so it will keep reading -1.
    
    Convert to a proper for loop so that continue works.  Add a new helper,
    pin_list_next(), to handle advancing to the next irq_pin_list entry.
    
    Noticed during code inspection.  The infinite loop was not observed.
    
    Fixes: f821102450a1 ("x86: IRQ Migration logic enhancement.")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/io_apic.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index c384f10c1b..24447aef6c 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -191,6 +191,14 @@ static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
     irq_2_pin_free_entry = entry - irq_2_pin;
 }
 
+static struct irq_pin_list *pin_list_next(const struct irq_pin_list *entry)
+{
+    if ( !entry->next )
+        return NULL;
+
+    return irq_2_pin + entry->next;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -1592,14 +1600,10 @@ static bool io_apic_level_ack_pending(unsigned int irq)
     unsigned long flags;
 
     spin_lock_irqsave(&ioapic_lock, flags);
-    entry = &irq_2_pin[irq];
-    for (;;) {
+    for (entry = &irq_2_pin[irq]; entry; entry = pin_list_next(entry)) {
         unsigned int reg;
         int pin;
 
-        if (!entry)
-            break;
-
         pin = entry->pin;
         if (pin == -1)
             continue;
@@ -1609,9 +1613,6 @@ static bool io_apic_level_ack_pending(unsigned int irq)
             spin_unlock_irqrestore(&ioapic_lock, flags);
             return 1;
         }
-        if (!entry->next)
-            break;
-        entry = irq_2_pin + entry->next;
     }
     spin_unlock_irqrestore(&ioapic_lock, flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 20 13:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Oct 2025 13:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1146367.1478798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vAq0U-000567-Pn; Mon, 20 Oct 2025 13:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1146367.1478798; Mon, 20 Oct 2025 13: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 1vAq0U-000560-N9; Mon, 20 Oct 2025 13:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1146367;
 Mon, 20 Oct 2025 13: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 1vAq0U-00055t-25
 for xen-changelog@lists.xenproject.org; Mon, 20 Oct 2025 13: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 1vAq0T-00B9t7-21
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Oct 2025 13:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vAq0T-002w9e-2Y
 for xen-changelog@lists.xenproject.org;
 Mon, 20 Oct 2025 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=DGgs81jyWjrPFR0y987+GwDCmODoR6WTRHNT6Srr2b4=; b=0TKFPRoiLg3d8lqB/3O7jMOUK6
	u9R8kpkr1UfF3x/jO+3AMN29+HjlCN6NgiqYEqesRHT+5ksYQv9w9RHuaFJQFN0fHEHpz60aEZrV7
	eles678VGqd8zxu/jSQMDRLhRo/v2NRHR5LIH2/uK+9UKxVvQ6GqUxZcRPbzTEJWqs2M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/apic: Avoid infinite loop in io_apic_level_ack_pending()
Message-Id: <E1vAq0T-002w9e-2Y@xenbits.xenproject.org>
Date: Mon, 20 Oct 2025 13:33:01 +0000

commit ad8d3d7f4001046c03b9bfb3919884d74dad96ed
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Mon Oct 20 13:03:10 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 20 13:03:10 2025 +0200

    x86/apic: Avoid infinite loop in io_apic_level_ack_pending()
    
    io_apic_level_ack_pending() will end up in an infinite loop if
    entry->pin == -1.  entry does not change, so it will keep reading -1.
    
    Convert to a proper for loop so that continue works.  Add a new helper,
    pin_list_next(), to handle advancing to the next irq_pin_list entry.
    
    Noticed during code inspection.  The infinite loop was not observed.
    
    Fixes: f821102450a1 ("x86: IRQ Migration logic enhancement.")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/io_apic.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index c384f10c1b..24447aef6c 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -191,6 +191,14 @@ static void remove_pin_from_irq(unsigned int irq, int apic, int pin)
     irq_2_pin_free_entry = entry - irq_2_pin;
 }
 
+static struct irq_pin_list *pin_list_next(const struct irq_pin_list *entry)
+{
+    if ( !entry->next )
+        return NULL;
+
+    return irq_2_pin + entry->next;
+}
+
 /*
  * Reroute an IRQ to a different pin.
  */
@@ -1592,14 +1600,10 @@ static bool io_apic_level_ack_pending(unsigned int irq)
     unsigned long flags;
 
     spin_lock_irqsave(&ioapic_lock, flags);
-    entry = &irq_2_pin[irq];
-    for (;;) {
+    for (entry = &irq_2_pin[irq]; entry; entry = pin_list_next(entry)) {
         unsigned int reg;
         int pin;
 
-        if (!entry)
-            break;
-
         pin = entry->pin;
         if (pin == -1)
             continue;
@@ -1609,9 +1613,6 @@ static bool io_apic_level_ack_pending(unsigned int irq)
             spin_unlock_irqrestore(&ioapic_lock, flags);
             return 1;
         }
-        if (!entry->next)
-            break;
-        entry = irq_2_pin + entry->next;
     }
     spin_unlock_irqrestore(&ioapic_lock, flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147155.1479419 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBC8l-0000gY-Ba; Tue, 21 Oct 2025 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147155.1479419; Tue, 21 Oct 2025 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 1vBC8l-0000gQ-8p; Tue, 21 Oct 2025 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1147155;
 Tue, 21 Oct 2025 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 1vBC8k-0000gK-HC
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 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 1vBC8k-00Cj0e-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBC8k-005nbP-18
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 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=+cOKQOvPhtoq7ZdFzrb3/fiDOrVToV6Er41fJSztcUM=; b=RY0+jhkCkO+Z69Lc5zKK0ZT9WL
	Ya5RkoxXpG5r9LzvxzSMBf/FTlu87DWY/j6B88Z4gOk07RV3LfxqtmYsEEuTRUFn42WWsASBNs+eq
	XNdlb8lT8h1M5r8bVQhyYZvjVROjn50F9ec0rmEokMONbws3wKjV0acQY5EEwGa793L0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBC8k-005nbP-18@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:11:02 +0000

commit 36e90c4ef1f2667dc8159c634fb00d393fc2d857
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 14:09:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:09:37 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index c0be24bd22..703f9ac8bc 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147156.1479423 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBC8v-0000iH-D8; Tue, 21 Oct 2025 13:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147156.1479423; Tue, 21 Oct 2025 13:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBC8v-0000i9-AL; Tue, 21 Oct 2025 13:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1147156;
 Tue, 21 Oct 2025 13: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 1vBC8u-0000hz-GQ
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBC8u-00Cj0k-0u
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBC8u-005ncH-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2TRdh589TxaJdkrW9ERZ0NMrBkoCBl51NX33OPXbfe4=; b=5DDuNYm7YG9M04FqQk+oW7Y45L
	KnVZBIqLVz+/PQ0q23NsbJxyWA6JjyBVilvLnTq+6UIJBD1Ll3tHKHbfX5Tn3E1F0JqeVsMRNSSuJ
	YqueOM5KJdNo02fgzcvjhpbgkucOuaUPMbdKGhdaK98tIRtXKy6SHublLo7UrfM9x2gQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBC8u-005ncH-1R@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:11:12 +0000

commit cc64c245023c3ff8e388c1c96aed3faed6fd00cb
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 14:10:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:10:13 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 703f9ac8bc..f79cffcb37 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    bitmap_for_each ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147157.1479427 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBC95-0000l5-ES; Tue, 21 Oct 2025 13:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147157.1479427; Tue, 21 Oct 2025 13: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 1vBC95-0000kw-Bg; Tue, 21 Oct 2025 13:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1147157;
 Tue, 21 Oct 2025 13: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 1vBC94-0000kq-Kv
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBC94-00Cj19-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBC94-005nea-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hoxFYufKLKk4C6V/QV/hl1mqLdxLlaOJoX9cRMWsX8U=; b=x45EjDqQkKYJ+zgAQyrhjJ/75S
	KmXlHYQwpwWJFsPXGPCw6daPlDo+QP/yHZGqe+6+bPECT9rZlxmHQlkDVOZZyh8vc9X3X6NATSu+F
	ceJmgZlCvjszogvuqtd9XLCxp8wUEMVoa90Qph2dvL6hA68GYUXh0EuRvDUct8KgNV+8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] symbols: discard stray file symbols
Message-Id: <E1vBC94-005nea-1i@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:11:22 +0000

commit 2f21ce1a6ad57a1a56840ab49c32d096160be595
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 14:10:46 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:10:46 2025 +0200

    symbols: discard stray file symbols
    
    By observation GNU ld 2.25 may emit file symbols for .data.read_mostly
    when linking xen.efi. Due to the nature of file symbols in COFF symbol
    tables (see the code comment) the symbols_offsets[] entries for such
    symbols would cause assembler warnings regarding value truncation. Of
    course the resulting entries would also be both meaningless and useless.
    Add a heuristic to get rid of them, really taking effect only when
    --all-symbols is specified (otherwise these symbols are discarded
    anyway).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/tools/symbols.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 06ad2c25f5..399edc8578 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -224,6 +224,16 @@ static int symbol_valid(struct sym_entry *s)
 	if (strstr((char *)s->sym + offset, "_compiled."))
 		return 0;
 
+	/* At least GNU ld 2.25 may emit bogus file symbols referencing a
+	 * section name while linking xen.efi. In COFF symbol tables the
+	 * "value" of file symbols is a link (symbol table index) to the next
+	 * file symbol. Since file (and other) symbols (can) come with one
+	 * (or in principle more) auxiliary symbol table entries, the value in
+	 * this heuristic is bounded to twice the number of symbols we have
+	 * found. See also read_symbol() as to the '?' checked for here. */
+	if (s->sym[0] == '?' && s->sym[1] == '.' && s->addr < table_cnt * 2)
+		return 0;
+
 	return 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147158.1479430 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBC9F-0000nN-FS; Tue, 21 Oct 2025 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147158.1479430; Tue, 21 Oct 2025 13: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 1vBC9F-0000nF-D0; Tue, 21 Oct 2025 13:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1147158;
 Tue, 21 Oct 2025 13: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 1vBC9E-0000n9-MP
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBC9E-00Cj1F-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBC9E-005nfU-21
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DVnvFoQnAUxj5pHCAsIh+F2wtemHnaUOv/FYSIbPvbs=; b=CBcd4d2TBdxmSMhQiZ9p274Z62
	JnIZPkQ+T3laDVT3/VRiqrjq19Dj4PQrwcPp3DyvmXbj1HtKLSO+Gc8G13jUIOcUTDLFAo6uWZqjz
	PUzXb86+/Mc3yTdp2keor11RPuXKb0otMCRwvevO+fWd7JIBvyYr1VEiJjF2ndxiLC+c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/tests/domid: don't pass -E to sed
Message-Id: <E1vBC9E-005nfU-21@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:11:32 +0000

commit 3bc40a4404f8a2d36efe305ba72bf0eb37071c87
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 14:11:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:11:27 2025 +0200

    tools/tests/domid: don't pass -E to sed
    
    Even the 2018 edition of The Open Group Base Specifications Issue 7 [1]
    doesn't name -E as a standard option; only Issue 8 [2] does. As we can
    easily avoid anything "extended" about the expression used, drop the -E,
    escape the parentheses, and replace the sole + by *.
    
    [1] https://pubs.opengroup.org/onlinepubs/9699919799/
    [2] https://pubs.opengroup.org/onlinepubs/9799919799/
    
    Fixes: b3d31533a047 ("tools/tests: introduce unit tests for domain ID allocator")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 tools/tests/domid/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/tests/domid/Makefile b/tools/tests/domid/Makefile
index 22f1f15d11..753129029e 100644
--- a/tools/tests/domid/Makefile
+++ b/tools/tests/domid/Makefile
@@ -10,8 +10,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 TESTS := test-domid
 
 define list-c-headers
-$(shell sed -n -E \
-    's/^[ \t]*# *include[ \t]*[<"]([^">]+)[">].*/\1/p' $(1) 2>/dev/null)
+$(shell sed -n \
+    's/^[ \t]*# *include[ \t]*[<"]\([^">]*\)[">].*/\1/p' $(1) 2>/dev/null)
 endef
 
 # NB: $1 cannot be a list
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:11:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147159.1479436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBC9P-0000pR-HO; Tue, 21 Oct 2025 13:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147159.1479436; Tue, 21 Oct 2025 13: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 1vBC9P-0000pJ-EU; Tue, 21 Oct 2025 13:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1147159;
 Tue, 21 Oct 2025 13: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 1vBC9O-0000pD-S6
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBC9O-00Cj1L-1q
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBC9O-005ngX-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=sWbqdyrPb2F9vi9SIhqh0DuVQALQJF3NbVFZ7SK1zQs=; b=Pz6SGg6DU99fs9zOPPf/akG+Ly
	okynInhdOVEwnS/MgqP6+uJ0PZAsBxjWd1RGd7HOR16Qrb3Mi6sApupsbBS3o7/nwEjMsyJxd64JS
	MS8QddTtQZrQr6C6GJG9se2P4R/CZcz/xNCY7evx2x3TVWEX3mn29QjeL3FAW5MvJjkI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] AMD/IOMMU: unshare IRQ .ack and .disable handlers
Message-Id: <E1vBC9O-005ngX-2I@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:11:42 +0000

commit aed6278b2a7faac1bacce2d22aad29bc463fa0c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 14:11:45 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:11:45 2025 +0200

    AMD/IOMMU: unshare IRQ .ack and .disable handlers
    
    A .disable handler can't typically be re-used for .ack: The latter needs
    to deal with IRQ migration, while the former shouldn't. Furthermore
    invoking just irq_complete_move() isn't enough; one of
    move_{native,masked}_irq() also needs invoking.
    
    Fixes: 487a1cffd71a ("x86: Implement per-cpu vector for xen hypervisor")
    Fixes: f821102450a1 ("x86: IRQ Migration logic enhancement")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/drivers/passthrough/amd/iommu_init.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 3f6d2f5db5..00d2c46cbc 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -428,8 +428,6 @@ static void cf_check iommu_msi_mask(struct irq_desc *desc)
     unsigned long flags;
     struct amd_iommu *iommu = desc->action->dev_id;
 
-    irq_complete_move(desc);
-
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
@@ -442,6 +440,13 @@ static unsigned int cf_check iommu_msi_startup(struct irq_desc *desc)
     return 0;
 }
 
+static void cf_check iommu_msi_ack(struct irq_desc *desc)
+{
+    irq_complete_move(desc);
+    iommu_msi_mask(desc);
+    move_masked_irq(desc);
+}
+
 static void cf_check iommu_msi_end(struct irq_desc *desc, u8 vector)
 {
     iommu_msi_unmask(desc);
@@ -455,7 +460,7 @@ static hw_irq_controller iommu_msi_type = {
     .shutdown = iommu_msi_mask,
     .enable = iommu_msi_unmask,
     .disable = iommu_msi_mask,
-    .ack = iommu_msi_mask,
+    .ack = iommu_msi_ack,
     .end = iommu_msi_end,
     .set_affinity = set_msi_affinity,
 };
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147204.1479470 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCU3-0004vh-1p; Tue, 21 Oct 2025 13:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147204.1479470; Tue, 21 Oct 2025 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 1vBCU2-0004vY-Uy; Tue, 21 Oct 2025 13:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1147204;
 Tue, 21 Oct 2025 13: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 1vBCU2-0004vN-8F
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCU1-00CjT8-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCU2-005qI9-0M
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ALUtzXlMY6rkoWAPFEiyXW14n2hoPZd9n5c4JWNOyAM=; b=mQT8HvBQcsuAsn2ZYRe/Eiz5RC
	Hz944sIC7Z5EsdAWNKfpGdO0oE2SK8GWltzy7JdDDXcJ7brCUwlXHO1TA8hylpWYh9DfDlVBHT6ng
	Pg8H1Yj1VLkf6Yk83cudvjLuFnLUyNiRRsLb9byasN9hUKF6knZb5uFV9dVGBE7PONI8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST
Message-Id: <E1vBCU2-005qI9-0M@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:33:02 +0000

commit db1c1e0fe8bc709fc0c957e9ab7756d973419d65
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:18:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:18:26 2025 +0200

    x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST
    
    When building Xen with GCC 12 with UBSAN and PVH_GUEST both enabled the
    compiler emits the following errors:
    
    arch/x86/setup.c: In function '__start_xen':
    arch/x86/setup.c:1504:19: error: 'consider_modules' reading 40 bytes from a region of size 4 [-Werror=stringop-overread]
     1504 |             end = consider_modules(s, e, reloc_size + mask,
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1505 |                                    bi->mods, bi->nr_modules, -1);
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/x86/setup.c:1504:19: note: referencing argument 4 of type 'const struct boot_module[0]'
    arch/x86/setup.c:686:24: note: in a call to function 'consider_modules'
      686 | static uint64_t __init consider_modules(
          |                        ^~~~~~~~~~~~~~~~
    arch/x86/setup.c:1535:19: error: 'consider_modules' reading 40 bytes from a region of size 4 [-Werror=stringop-overread]
     1535 |             end = consider_modules(s, e, size, bi->mods,
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1536 |                                    bi->nr_modules + relocated, j);
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/x86/setup.c:1535:19: note: referencing argument 4 of type 'const struct boot_module[0]'
    arch/x86/setup.c:686:24: note: in a call to function 'consider_modules'
      686 | static uint64_t __init consider_modules(
          |                        ^~~~~~~~~~~~~~~~
    
    This seems to be the result of some function manipulation done by UBSAN
    triggering GCC stringops related errors.  Placate the errors by declaring
    the function parameter as `const struct *boot_module` instead of `const
    struct boot_module[]`.
    
    Note that GCC 13 seems to be fixed, and doesn't trigger the error when
    using `[]`.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 932898d4492609f99e3016d423a9323235392864
    master date: 2025-03-17 13:33:28 +0100
---
 xen/arch/x86/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 10d55884ab..3dc8de3114 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -682,7 +682,7 @@ static void __init noinline move_xen(void)
 #undef BOOTSTRAP_MAP_LIMIT
 
 static uint64_t __init consider_modules(
-    uint64_t s, uint64_t e, uint32_t size, const struct boot_module mods[],
+    uint64_t s, uint64_t e, uint32_t size, const struct boot_module *mods,
     unsigned int nr_mods, unsigned int this_mod)
 {
     unsigned int i;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147205.1479473 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCUD-0004xo-2n; Tue, 21 Oct 2025 13:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147205.1479473; Tue, 21 Oct 2025 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 1vBCUD-0004xg-09; Tue, 21 Oct 2025 13:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1147205;
 Tue, 21 Oct 2025 13: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 1vBCUC-0004xY-Dm
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCUC-00CjTE-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCUC-005qJS-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MSIeSV85uq4tD0x9mA2zN/0NFbEALCvZHsKM2ZP0RDk=; b=x51R9Hp1mnAkZ71YII0QGe7ebC
	9d0IMcszvqCb3DAq0lXJjRKUK0BkWogkbsGg8mMCLk7wp5kEpCVHsaA+6UjonrhGvcy0rAAnsNHjI
	uhFIRy+hbtS3iYRSaXw6kTmN3vI7Fc14ZpKUC0XuuRTlLqVtjBDcYjXIPu68x5oOY2vE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/mcheck: fix mca_allbanks updating
Message-Id: <E1vBCUC-005qJS-0o@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:33:12 +0000

commit 247b708b1400a989d142ba2f29c54286fbfc26e4
Author:     Soham Dandapat <soham.dandapat@amd.com>
AuthorDate: Tue Oct 21 15:19:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:19:06 2025 +0200

    x86/mcheck: fix mca_allbanks updating
    
    In mca_cap_init function,the mcabanks_alloc allocates and
    initializes an mca_banks structure for managing MCA banks,
    setting up a bank map and storing the specified or default number
    of banks.
    
    After this we will call mcabanks_set(i, mca_allbanks);
    The mcabanks_set function sets a specific bit in the bank_map of
    an mca_banks structure, provided the structure, its bank_map, and
    the bit index are valid.
    
    At the end, we will call
    mcabanks_free(xchg(&mca_allbanks, all));
    This function is thread safe and does below:
       1. Atomically exchanges the value of "mca_allbanks" with "all"
       2. Returns the old value that was previously in "mca_allbanks"
    So, when we will call mcabanks_free , that will free the memory.
    
    The problem is that mcabanks_set(i, mca_allbanks) function is updating
    mca_allbanks which will be freed via mcabanks_free later. This means
    new mca_allbanks instance("all") will never get chance to update
    it's bank_map.
    
    Due to this when we will collect log from mcheck_mca_logout function ,
    the condition "if ( !mcabanks_test(i, bankmask) )" will always fails
    and MCA logs will not be collected for any bank.
    
    The fix is to solve this problem.
    
    Fixes: 560cf418c845 ("x86/mcheck: allow varying bank counts per CPU")
    Signed-off-by: Soham Dandapat <soham.dandapat@amd.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 532988dccc197bc4fe700ebceffad95f2f4c7541
    master date: 2025-09-09 08:18:11 +0200
---
 xen/arch/x86/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 9028ccde54..84238cd0ef 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -663,7 +663,7 @@ static int mca_cap_init(void)
         if ( !all )
             return -ENOMEM;
         for ( i = 0; i < nr; i++ )
-            mcabanks_set(i, mca_allbanks);
+            mcabanks_set(i, all);
         mcabanks_free(xchg(&mca_allbanks, all));
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:33:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147206.1479476 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCUN-00050S-3x; Tue, 21 Oct 2025 13:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147206.1479476; Tue, 21 Oct 2025 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 1vBCUN-00050J-1X; Tue, 21 Oct 2025 13:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1147206;
 Tue, 21 Oct 2025 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 1vBCUM-000508-Ee
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCUM-00CjTc-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCUM-005qKx-1H
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=b2e04UktEOKuqH73194bAvMQgUYtZq4/mjkx1GrGkpQ=; b=J74t3nKTnNIvxojOEld1Dobt1a
	j0eoWjcljj+LbEdycTv8r0pcmeQ/OF3giuGuH1/mx7hkoVUOGaROgLI+4TLeStbZzfznUxBmXyYXM
	sGciFvNG1S7TI16N9t6mK7XWGee8j3lqrgcQFdeIqcdV0z7tCb3zCgsdPnSFIGuSjvMY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Message-Id: <E1vBCUM-005qKx-1H@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:33:22 +0000

commit a5aa6b397f83e4a2a40f2e43e07b2d872273dee5
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Oct 21 15:19:21 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:19:21 2025 +0200

    libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
    
    PVH guests have no DM, so this causes the guest to fetch the online CPU
    bitmap from an unbacked 0xaf00 PIO port when executing the GPE handler.
    
    Seeing how ACPI CPU hotplug is the only event delivered via GPE, remove
    the GPE handler in addition to anything ACPI CPU hotplug related.
    
    This shrinks PVH's DSDT substantially and prevents spuriously executing
    a large amount of AML with no purpose at all.
    
    Fixes: 062975dc9441("acpi: PVH guests need _E02 method")
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: b59e564aa0830f60214b9b5afb4f8543dd1bf2b0
    master date: 2025-09-25 09:18:55 +0200
---
 tools/libacpi/mk_dsdt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
index 34f6753f61..0b1818d4e8 100644
--- a/tools/libacpi/mk_dsdt.c
+++ b/tools/libacpi/mk_dsdt.c
@@ -237,6 +237,11 @@ int main(int argc, char **argv)
     pop_block();
     /**** Processor end ****/
 #else
+    if (dm_version == QEMU_NONE) {
+        pop_block();
+        pop_block();
+        return 0;
+    }
 
     /* Operation Region 'PRST': bitmask of online CPUs. */
     stmt("OperationRegion", "PRST, SystemIO, %#x, %d",
@@ -285,10 +290,6 @@ int main(int argc, char **argv)
     pop_block();
     pop_block();
 
-    if (dm_version == QEMU_NONE) {
-        pop_block();
-        return 0;
-    }
     /**** Processor end ****/
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147207.1479480 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCUX-00053W-6x; Tue, 21 Oct 2025 13:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147207.1479480; Tue, 21 Oct 2025 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 1vBCUX-00053Q-4C; Tue, 21 Oct 2025 13:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1147207;
 Tue, 21 Oct 2025 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 1vBCUW-00053K-Hl
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 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 1vBCUW-00CjTm-12
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCUW-005qM4-1Z
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z6uWuN5wsiEn3L97+d+erKPFrd0vyGWYdTZx+baXYzw=; b=bgvF9uXASIQ4GW5OBt35w3FE5F
	zWPlOlQKBmPsZdxcskOjNbUjtTnxlbBGHpiQ034FhYoHvoNXjBkp65FjAZQD1F0+r4mmKC7ZpL0xl
	w1wcqyLtT6Ya7xXNcEWg/zgaLBMHf0fQCZZADVSgNBJFq5XoBOW9m5E92kjYx+VSrFlQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
Message-Id: <E1vBCUW-005qM4-1Z@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:33:32 +0000

commit 02806fc9671113b90e8740faec275ee2a6e1962d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:20:02 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:02 2025 +0200

    x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
    
    Otherwise the check for the SS feature in
    check_memory_type_self_snoop_errata() fails unconditionally, which leads to
    X86_FEATURE_XEN_SELFSNOOP never being set.
    
    We could also avoid this by not doing the reset_cpuinfo() for the BSP in
    identify_cpu(), because SS detection uses boot_cpu_data.  However that
    creates an imbalance on the state of the BSP versus the APs in the
    identify_cpu() code.
    
    I've opted for the less controversial solution of populating FEATURESET_1d
    in generic_identify(), as the value is already there.  The same is done for
    the AMD faulting probe code.  While there also populate the FEATURESET_1c
    element, as the value is in context.
    
    Fixes: f2663ca2e520 ("x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 382dd0d166cb85139d86ff26fd96af102ae4fef3
    master date: 2025-09-25 16:07:05 +0200
---
 xen/arch/x86/cpu/common.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 4eacdaac0f..168cd3a9ee 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -438,6 +438,13 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 
+	/*
+	 * Early init of Self Snoop support requires 0x1.edx, while there also
+	 * set 0x1.ecx as the value is in context.
+	 */
+	c->x86_capability[FEATURESET_1c] = ecx;
+	c->x86_capability[FEATURESET_1d] = edx;
+
 	eax = cpuid_eax(0x80000000);
 	if ((eax >> 16) == 0x8000)
 		c->extended_cpuid_level = eax;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:33:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147208.1479485 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCUh-00055j-7w; Tue, 21 Oct 2025 13:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147208.1479485; Tue, 21 Oct 2025 13:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCUh-00055b-5R; Tue, 21 Oct 2025 13:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1147208;
 Tue, 21 Oct 2025 13: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 1vBCUg-00055T-Km
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCUg-00CjTt-1K
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCUg-005qNG-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=thR3F4rUbkNPxVJbO9zkKLX9B9BXSrg30uDju+vM9xw=; b=Ia5LcBEzDqqlAkV5cdSWP/CBso
	2wkgEPlazkmy8UyMnaBtaFgdjhNd7s/56G7ZLOeRu54EcbTKkkfixv1rwYHy07gNn4Is4d5ua6Rqx
	59ry1TjDzuswSmdRJuFragY6nN6OpNz1BcZNAOyL98ajtdG9wPQ0pOfz42o+9+kjjjqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
Message-Id: <E1vBCUg-005qNG-1s@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:33:42 +0000

commit 6c2fab72f7cf49306aedd5e0561fdcb426045086
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:20:17 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:17 2025 +0200

    x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
    
    Reading from the E9 port if the emergency console is active should return
    0xe9 according to the documentation from Bochs:
    
    https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
    
    See `port_e9_hack` section description.
    
    Fix Xen so it also returns the port address.  OSes can use it to detect
    whether the emergency console is available or not.
    
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: db5a3c31a650d3fb0945f77f8ceda133412b5ce0
    master date: 2025-10-02 18:05:50 +0200
---
 xen/arch/x86/hvm/hvm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 0f0630769b..ba9a08bf54 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -557,9 +557,15 @@ static int cf_check hvm_print_line(
 
     ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
 
-    /* Deny any input requests. */
-    if ( dir != IOREQ_WRITE )
-        return X86EMUL_UNHANDLEABLE;
+    if ( dir == IOREQ_READ )
+    {
+        /*
+         * According to Bochs documentation, reading from the E9 port should
+         * return 0xE9 if the "port E9 hack" is implemented.
+         */
+        *val = XEN_HVM_DEBUGCONS_IOPORT;
+        return X86EMUL_OKAY;
+    }
 
     /* Accept only printable characters, newline, and horizontal tab. */
     if ( !isprint(c) && (c != '\n') && (c != '\t') )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:33:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147209.1479489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCUs-00057v-9a; Tue, 21 Oct 2025 13:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147209.1479489; Tue, 21 Oct 2025 13: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 1vBCUs-00057n-71; Tue, 21 Oct 2025 13:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1147209;
 Tue, 21 Oct 2025 13:33: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 1vBCUq-00057f-NM
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:33: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 1vBCUq-00CjTz-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCUq-005qPh-29
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e6ltsEDYvPq1SbP0HM1saA2uEUQKISZ/H/hNdopZx04=; b=cDLiGHFNdOKrRsHkDT4H0a0e5/
	002RTyXz3OGCl70QtxQbH1mV6CpcA8Zkr9nP0JXfxd2r9VXXDsbQGOOPSfuIuTtrsbzA7nsiLhFC0
	m1tWUneX1fMkVtz5w3cCK6mBasqBhbOaCC6GVKVgUZeyrLMbo6u4Qablhf9zBbmyrOcE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] vpci/msix: improve handling of bogus MSI-X capabilities
Message-Id: <E1vBCUq-005qPh-29@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:33:52 +0000

commit f9aea52a9747d56440faf06263b8cd5ffbc524fd
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:20:33 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:33 2025 +0200

    vpci/msix: improve handling of bogus MSI-X capabilities
    
    I've had the luck to come across a PCI card that exposes a MSI-X capability
    where the BIR of the vector and PBA tables points at a BAR that has 0 size.
    
    This doesn't play nice with the code in vpci_make_msix_hole(), as it would
    still use the address of such empty BAR (0) and attempt to carve a hole in
    the p2m.  This leads to errors like the one below being reported by Xen:
    
    d0v0 0000:22:00.0: existing mapping (mfn: 181c4300 type: 0) at 0 clobbers MSIX MMIO area
    
    And the device left unable to enable memory decoding due to the failure
    reported by vpci_make_msix_hole().
    
    Introduce checking in init_msix() to ensure the BARs containing the MSI-X
    tables are usable.  This requires checking that the BIR points to a
    non-empty BAR, and the offset and size of the MSI-X tables can fit in the
    target BAR.
    
    This fixes booting PVH dom0 on Supermicro AS -2126HS-TN servers with AMD
    EPYC 9965 processors.  The broken device is:
    
    22:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 93)
    
    There are multiple of those integrated controllers in the system, all
    broken in the same way.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 53859596c0d34dbca776ec1e47bac8dd90552530
    master date: 2025-10-10 11:02:39 +0200
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/lib.h   |  3 +++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 6bd8c55bb4..faa7c1cd49 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -17,6 +17,7 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -723,6 +724,51 @@ static int cf_check init_msix(struct pci_dev *pdev)
     if ( !msix )
         return -ENOMEM;
 
+    msix->tables[VPCI_MSIX_TABLE] =
+        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
+    msix->tables[VPCI_MSIX_PBA] =
+        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
+
+    /* Check that the referenced BAR(s) regions are valid. */
+    for ( i = 0; i < ARRAY_SIZE(msix->tables); i++ )
+    {
+        const char *name = (i == VPCI_MSIX_TABLE) ? "vector" : "PBA";
+        const struct vpci_bar *bars = pdev->vpci->header.bars;
+        unsigned int bir = msix->tables[i] & PCI_MSIX_BIRMASK;
+        unsigned int type;
+        unsigned int offset = msix->tables[i] & ~PCI_MSIX_BIRMASK;
+        unsigned int size =
+            (i == VPCI_MSIX_TABLE) ? max_entries * PCI_MSIX_ENTRY_SIZE
+                                   : ROUNDUP(DIV_ROUND_UP(max_entries, 8), 8);
+
+        if ( bir >= ARRAY_SIZE(pdev->vpci->header.bars) )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table with out of range BIR %u\n",
+                   &pdev->sbdf, name, bir);
+ invalid:
+            xfree(msix);
+            return -ENODEV;
+        }
+
+        type = bars[bir].type;
+        if ( type != VPCI_BAR_MEM32 && type != VPCI_BAR_MEM64_LO )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table at invalid BAR%u with type %u\n",
+                   &pdev->sbdf, name, bir, type);
+            goto invalid;
+        }
+
+        if ( (uint64_t)offset + size > bars[bir].size )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table offset %#x size %#x outside of BAR%u size %#lx\n",
+                   &pdev->sbdf, name, offset, size, bir, bars[bir].size);
+            goto invalid;
+        }
+    }
+
     rc = vpci_add_register(pdev->vpci, control_read, control_write,
                            msix_control_reg(msix_offset), 2, msix);
     if ( rc )
@@ -734,11 +780,6 @@ static int cf_check init_msix(struct pci_dev *pdev)
     msix->max_entries = max_entries;
     msix->pdev = pdev;
 
-    msix->tables[VPCI_MSIX_TABLE] =
-        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
-    msix->tables[VPCI_MSIX_PBA] =
-        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
-
     for ( i = 0; i < max_entries; i++)
     {
         msix->entries[i].masked = true;
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 130f96791f..1a09f8ada9 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -58,6 +58,9 @@ static inline void
 debugtrace_printk(const char *fmt, ...) {}
 #endif
 
+/* Common log prefixes for platform related issues. */
+#define DEV_BUG_PREFIX "DEVICE BUG: "
+
 extern void printk(const char *fmt, ...)
     __attribute__ ((format (printf, 1, 2), cold));
 void vprintk(const char *fmt, va_list args)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:34:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147210.1479493 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCV2-0005BY-B8; Tue, 21 Oct 2025 13:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147210.1479493; Tue, 21 Oct 2025 13: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 1vBCV2-0005BQ-8T; Tue, 21 Oct 2025 13:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1147210;
 Tue, 21 Oct 2025 13:34: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 1vBCV0-0005BI-QC
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:34: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 1vBCV0-00CjUE-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCV0-005qQw-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f5mo3BxgyflBAdq0EFCoNUr3iQzNeqM7pDg946TjOLQ=; b=YzT6rAB9AbpkQClisQtU8Z5Pk8
	eNjVqB9B7GqCHMJfjTuIcrA9wQoHGZApBlyuS++cUHYbhgyBIsxAHuIFeSO91nUNVmN8AlBD2JfTp
	u0HikNrkd2vVSNaWxIFCj3r4aXPygj1iQm0NhpPJKFEPvoJcoxG2QcwlTDBO+iIMLSh0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/HWP: adjust feature_hdc's section annotation
Message-Id: <E1vBCV0-005qQw-2P@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:34:02 +0000

commit 040e8cc14d7cbce4939bd08c3e6cfea7e60dee67
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:20:55 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:55 2025 +0200

    x86/HWP: adjust feature_hdc's section annotation
    
    The variable can be cleared (set to false) by a non-init function's error
    path (hwp_init_msrs()).
    
    Fixes: 99c4570f8209 ("cpufreq: Add Hardware P-State (HWP) driver")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    master commit: 4676e09b3c3b2750aef3d6ec7e43b632d4800ab9
    master date: 2025-10-13 10:41:35 +0200
---
 xen/arch/x86/acpi/cpufreq/hwp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 59b57a4cef..1380989f30 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -17,7 +17,7 @@ static bool __ro_after_init hwp_in_use;
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
-static bool __ro_after_init feature_hdc;
+static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:34:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147211.1479497 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVC-0005E6-CR; Tue, 21 Oct 2025 13:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147211.1479497; Tue, 21 Oct 2025 13: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 1vBCVC-0005Dy-9u; Tue, 21 Oct 2025 13:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1147211;
 Tue, 21 Oct 2025 13:34: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 1vBCVA-0005Da-Sp
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:34: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 1vBCVA-00CjUI-29
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCVA-005qUr-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ocmWWQO5SWW5KsQ5hK95aHCt+jybj+pnTSMcFDSpsVk=; b=Qw/sFHWG1/7SivLMBLhRLJaJuM
	nGXuXekm+1MYsLFfzEPyuCMHcYYHdZuJaMZPKMAwth+SNpF1XQL2+UZuN+zRKcJUMwHWvqvUT11un
	TyNxy+ZoFMoKEYamzRvOZMHB/d5l7vXqj2XgILu6hhgTK46eRDdy+EJPniw5oSjNyWko=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] VT-d: check bus_to_context_maddr()'s return value
Message-Id: <E1vBCVA-005qUr-2i@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:34:12 +0000

commit aab88a3ef3ce7b92fa96b965bf39560f173baa88
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:21:14 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:21:14 2025 +0200

    VT-d: check bus_to_context_maddr()'s return value
    
    The function returning zero is an error indication; we shouldn't try to
    map MFN 0 and then treat that page as a context table.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef5b718cf81a2448118b86b86777f9430739445d
    master date: 2025-10-13 16:50:01 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index a1927d9f12..5816ea0c9f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1498,6 +1498,11 @@ int domain_context_mapping_one(
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        spin_unlock(&iommu->lock);
+        return -ENOMEM;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
     old = (lctxt = *context).full;
@@ -1852,6 +1857,12 @@ int domain_context_unmap_one(
     spin_lock(&iommu->lock);
 
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        ASSERT_UNREACHABLE();
+        spin_unlock(&iommu->lock);
+        return 0;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:34:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147212.1479501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVM-0005GB-E0; Tue, 21 Oct 2025 13:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147212.1479501; Tue, 21 Oct 2025 13: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 1vBCVM-0005G3-BH; Tue, 21 Oct 2025 13:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1147212;
 Tue, 21 Oct 2025 13: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 1vBCVK-0005Fv-VW
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:34: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 1vBCVK-00CjUe-2Q
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCVK-005qVi-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YE1qLgTqGHBrH+J2Xml2xF3K4wW167e7rNknkGM+cpg=; b=JWwOqxoXCFqSNViFDx2eXulZQt
	DrX4HPBFQB/NSelBRH0t8lzRuJDerL8FuJjAeXJyiynhNzCePThFIC6o9aI/rbqn1gsRwcu43NkkE
	+U6ffXFQt8pQsOVwW/VubeVCCJRpoScJVsMjyvEvJKjpLAJYGysnkDyQJILOpLtUtMps=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/boot: Fix edd=off to skip mbr
Message-Id: <E1vBCVK-005qVi-2x@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:34:22 +0000

commit 8b29b6a484f5e63e92516eeb6bbe31c86a2a63fb
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Oct 21 15:21:36 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:21:36 2025 +0200

    x86/boot: Fix edd=off to skip mbr
    
    When the fixes commit re-arranged the code, it made edd=off jump to the
    mbr code instead of returning from the function.  Previously edd_done
    was immediately before ret and skipped the MBR check.
    
    Replace edd_done with .Ledd_mbr_sig for the start of the MBR checking,
    and replace .Ledd_mbr_sig_skip with .Ledd_done to exit from the function.
    
    edd=off jumps to .Ledd_done to return from the function, and internal
    jumps go to .Ledd_mbr_sig to check edd=skipmbr.
    
    Fixes: 5ec164fd61bd ("x86/boot: re-arrange how/when we do disk I/O")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 02e656f7c8fd63828307a4eac633958d82b36116
    master date: 2025-10-16 10:25:27 +0200
---
 xen/arch/x86/boot/edd.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 3df712bce1..02437511b2 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -25,7 +25,7 @@
 
 get_edd:
         cmpb    $2, bootsym(opt_edd)            # edd=off ?
-        je      edd_done
+        je      .Ledd_done
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
@@ -48,7 +48,7 @@ edd_check_ext:
         movb    $0x41, %ah                      # 0x41 Check Extensions Present
         movw    $0x55AA, %bx                    # magic
         int     $0x13                           # make the call
-        jc      edd_done                        # no more BIOS devices
+        jc      .Ledd_mbr_sig                   # no more BIOS devices
 
         cmpw    $0xAA55, %bx                    # is magic right?
         jne     edd_next                        # nope, next...
@@ -96,13 +96,13 @@ edd_legacy_done:
 
 edd_next:
         incb    %dl                             # increment to next device
-        jz      edd_done
+        jz      .Ledd_mbr_sig
         cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
         jb      edd_check_ext
 
-edd_done:
+.Ledd_mbr_sig:
         cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
-        je      .Ledd_mbr_sig_skip
+        je      .Ledd_done
 
 # Read the first sector of each BIOS disk device and store the 4-byte signature
 .Ledd_mbr_sig_start:
@@ -160,7 +160,7 @@ edd_done:
         jb      .Ledd_mbr_sig_read
 .Ledd_mbr_sig_done:
         popw    %es
-.Ledd_mbr_sig_skip:
+.Ledd_done:
         ret
 
 GLOBAL(boot_edd_info_nr)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:34:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147213.1479505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVW-0005IH-FD; Tue, 21 Oct 2025 13:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147213.1479505; Tue, 21 Oct 2025 13:34:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVW-0005I9-Ce; Tue, 21 Oct 2025 13:34:34 +0000
Received: by outflank-mailman (input) for mailman id 1147213;
 Tue, 21 Oct 2025 13: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 1vBCVV-0005I1-24
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCVU-00CjUm-2h
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCVV-005qWZ-01
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7i2oDfk26nQRo1eF2BQsWzb2UGCjDc7DMnBO9164ug4=; b=eKisgFrpoNsSTJpByK2ULVZouJ
	e+y6DUpYHU8z5LdIjZdz0OszW/22JiKGocuYpJLhjkPK6FKpDMvnTMlqd+8mN5wDirmOM5UIRX0uI
	xv225PCJVsL5bq/iSxRQg3yn7180S+CVkUK58/xvq1H91v+FZfSbxtdjQbNzAhzkx10k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBCVV-005qWZ-01@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:34:33 +0000

commit 188b66cf0fd7492645b1e77d872f65307d5ce550
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:21:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:21:59 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 8ff19a00fe..0b614f4d20 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:34:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147214.1479509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVg-0005Kx-Hr; Tue, 21 Oct 2025 13:34:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147214.1479509; Tue, 21 Oct 2025 13:34:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVg-0005Kp-FD; Tue, 21 Oct 2025 13:34:44 +0000
Received: by outflank-mailman (input) for mailman id 1147214;
 Tue, 21 Oct 2025 13: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 1vBCVf-0005Kh-4o
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCVe-00CjUv-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCVf-005qXn-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=DVyd+lIWGvjxqtZTVYAuZ3cf5BGcoOFnB7aKbOh6D6A=; b=MLfAWDrw7XCFzSbNPPAQZ6ITBg
	WOHxSAOp07QCU0/F36vqnHtog1GVCyn78XUxIVzPqPZxAryTDIW9EVcEcfS6oRk9ovpCHjucqH8zd
	tOENjUTCyrw2fb6HG1TafzzP4aABqb2gFrQBZE/FsxVrUdUNUqNNhMdGF/7wteY9h8EY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBCVf-005qXn-0I@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:34:43 +0000

commit d8d23d168823c7ff8e9afa09bceb916c809f525c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:22:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:22:23 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 0b614f4d20..536614050d 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    bitmap_for_each ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:34:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147215.1479515 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVq-0005N8-Ka; Tue, 21 Oct 2025 13:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147215.1479515; Tue, 21 Oct 2025 13:34:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCVq-0005Mz-GX; Tue, 21 Oct 2025 13:34:54 +0000
Received: by outflank-mailman (input) for mailman id 1147215;
 Tue, 21 Oct 2025 13: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 1vBCVp-0005Mq-Ko
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCVp-00CjV8-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCVp-005qZb-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=UUT8Nq70SODxg7UqCmcbuPftAOIDkcsrcPWmPXbwCkc=; b=z5vPYat/OQYIrDGzHwfOuEi8cj
	wAKdXfmiFCBZtAl9J4tSa4ifRyAM0aXZqX7WR2x6byUnKUK3NdLQ53wSnPbkVyzvaVcYrjvi9cxnI
	aTLTENqH/8xy6A9Xaz0SQRXbAXrdSTn/CBbT3pC0k5eFvjglUS/ucJTVkI+EFK9g6CGk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/mcheck: fix mca_allbanks updating
Message-Id: <E1vBCVp-005qZb-1u@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:34:53 +0000

commit 01b8bc41e8fd1d55169353de8882189c56c6908e
Author:     Soham Dandapat <soham.dandapat@amd.com>
AuthorDate: Tue Oct 21 15:26:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:26:13 2025 +0200

    x86/mcheck: fix mca_allbanks updating
    
    In mca_cap_init function,the mcabanks_alloc allocates and
    initializes an mca_banks structure for managing MCA banks,
    setting up a bank map and storing the specified or default number
    of banks.
    
    After this we will call mcabanks_set(i, mca_allbanks);
    The mcabanks_set function sets a specific bit in the bank_map of
    an mca_banks structure, provided the structure, its bank_map, and
    the bit index are valid.
    
    At the end, we will call
    mcabanks_free(xchg(&mca_allbanks, all));
    This function is thread safe and does below:
       1. Atomically exchanges the value of "mca_allbanks" with "all"
       2. Returns the old value that was previously in "mca_allbanks"
    So, when we will call mcabanks_free , that will free the memory.
    
    The problem is that mcabanks_set(i, mca_allbanks) function is updating
    mca_allbanks which will be freed via mcabanks_free later. This means
    new mca_allbanks instance("all") will never get chance to update
    it's bank_map.
    
    Due to this when we will collect log from mcheck_mca_logout function ,
    the condition "if ( !mcabanks_test(i, bankmask) )" will always fails
    and MCA logs will not be collected for any bank.
    
    The fix is to solve this problem.
    
    Fixes: 560cf418c845 ("x86/mcheck: allow varying bank counts per CPU")
    Signed-off-by: Soham Dandapat <soham.dandapat@amd.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 532988dccc197bc4fe700ebceffad95f2f4c7541
    master date: 2025-09-09 08:18:11 +0200
---
 xen/arch/x86/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 32c1b2756b..5a59e79cbc 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -663,7 +663,7 @@ static int mca_cap_init(void)
         if ( !all )
             return -ENOMEM;
         for ( i = 0; i < nr; i++ )
-            mcabanks_set(i, mca_allbanks);
+            mcabanks_set(i, all);
         mcabanks_free(xchg(&mca_allbanks, all));
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:35:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:35:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147216.1479517 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCW0-0005PA-KZ; Tue, 21 Oct 2025 13:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147216.1479517; Tue, 21 Oct 2025 13:35:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCW0-0005P2-Hv; Tue, 21 Oct 2025 13:35:04 +0000
Received: by outflank-mailman (input) for mailman id 1147216;
 Tue, 21 Oct 2025 13: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 1vBCVz-0005Ou-NK
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCVz-00CjVQ-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCVz-005qbN-29
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=etgD6i9lSbxuIy2US4w5PqfgJmFbB7tgJW4owqR7Chc=; b=Z/4EL/9SNm0XLOsmt9sSnFTdKf
	nnaTvRvTQM1Jl1yMssUXsJdsRH6x/S//xJo5PO+RqmMkVhQvlt4UzVowU2NF/2DGlIkp6eAL+4Ts0
	j0bxAM/wh35T+RBNbHKoZN27qh4Z58osVr0lPW6TGigNdSqdIP32cgZ+HQYoAS/aVAlo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Message-Id: <E1vBCVz-005qbN-29@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:35:03 +0000

commit 030b9ade00a374e233a67bd4040d974c8294956e
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Oct 21 15:26:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:26:35 2025 +0200

    libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
    
    PVH guests have no DM, so this causes the guest to fetch the online CPU
    bitmap from an unbacked 0xaf00 PIO port when executing the GPE handler.
    
    Seeing how ACPI CPU hotplug is the only event delivered via GPE, remove
    the GPE handler in addition to anything ACPI CPU hotplug related.
    
    This shrinks PVH's DSDT substantially and prevents spuriously executing
    a large amount of AML with no purpose at all.
    
    Fixes: 062975dc9441("acpi: PVH guests need _E02 method")
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: b59e564aa0830f60214b9b5afb4f8543dd1bf2b0
    master date: 2025-09-25 09:18:55 +0200
---
 tools/libacpi/mk_dsdt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
index 34f6753f61..0b1818d4e8 100644
--- a/tools/libacpi/mk_dsdt.c
+++ b/tools/libacpi/mk_dsdt.c
@@ -237,6 +237,11 @@ int main(int argc, char **argv)
     pop_block();
     /**** Processor end ****/
 #else
+    if (dm_version == QEMU_NONE) {
+        pop_block();
+        pop_block();
+        return 0;
+    }
 
     /* Operation Region 'PRST': bitmask of online CPUs. */
     stmt("OperationRegion", "PRST, SystemIO, %#x, %d",
@@ -285,10 +290,6 @@ int main(int argc, char **argv)
     pop_block();
     pop_block();
 
-    if (dm_version == QEMU_NONE) {
-        pop_block();
-        return 0;
-    }
     /**** Processor end ****/
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:35:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147217.1479521 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCWA-0005SQ-M3; Tue, 21 Oct 2025 13:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147217.1479521; Tue, 21 Oct 2025 13:35:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCWA-0005SI-JQ; Tue, 21 Oct 2025 13:35:14 +0000
Received: by outflank-mailman (input) for mailman id 1147217;
 Tue, 21 Oct 2025 13: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 1vBCW9-0005Rr-Q0
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCW9-00CjVX-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCW9-005qce-2Q
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=DaeXFBNft+ngozUQ7SWem4gSOCN/upQj5yXpm3HLopM=; b=fBJzRjo8XAI4K+B/6ce4eWCsIW
	2s2QXuRaBnMkpK5xqfkibBPLB9bQzL8tO+eoZ51pBXkjxQKaWw72cB+r2aYBSWwNJGjALOst+y7VK
	axoo2Ydd7Nfz/AOcHbyQ0E3ZNbgT//jxv4WEVEPoVZPySCLcYkQKxFf9QUpq+CEKXH+o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
Message-Id: <E1vBCW9-005qce-2Q@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:35:13 +0000

commit 2c27742563d221144906a3c7cadd8839bdb61277
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:26:47 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:26:47 2025 +0200

    x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
    
    Otherwise the check for the SS feature in
    check_memory_type_self_snoop_errata() fails unconditionally, which leads to
    X86_FEATURE_XEN_SELFSNOOP never being set.
    
    We could also avoid this by not doing the reset_cpuinfo() for the BSP in
    identify_cpu(), because SS detection uses boot_cpu_data.  However that
    creates an imbalance on the state of the BSP versus the APs in the
    identify_cpu() code.
    
    I've opted for the less controversial solution of populating FEATURESET_1d
    in generic_identify(), as the value is already there.  The same is done for
    the AMD faulting probe code.  While there also populate the FEATURESET_1c
    element, as the value is in context.
    
    Fixes: f2663ca2e520 ("x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 382dd0d166cb85139d86ff26fd96af102ae4fef3
    master date: 2025-09-25 16:07:05 +0200
---
 xen/arch/x86/cpu/common.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index d4d21da9c5..859df977a0 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -439,6 +439,13 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 
+	/*
+	 * Early init of Self Snoop support requires 0x1.edx, while there also
+	 * set 0x1.ecx as the value is in context.
+	 */
+	c->x86_capability[FEATURESET_1c] = ecx;
+	c->x86_capability[FEATURESET_1d] = edx;
+
 	eax = cpuid_eax(0x80000000);
 	if ((eax >> 16) == 0x8000)
 		c->extended_cpuid_level = eax;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:35:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:35:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147218.1479525 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCWL-0005UV-NU; Tue, 21 Oct 2025 13:35:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147218.1479525; Tue, 21 Oct 2025 13: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 1vBCWL-0005UN-Kp; Tue, 21 Oct 2025 13:35:25 +0000
Received: by outflank-mailman (input) for mailman id 1147218;
 Tue, 21 Oct 2025 13:35: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 1vBCWJ-0005UF-Sg
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCWJ-00CjVu-28
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCWJ-005qdb-2g
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=UozkXEzPKchckWLwsLZyxFVbDlvKn56eRYalkTf68gw=; b=FLwwHtixld15TB7E6P+YgplWdJ
	ZH+bQwG7H5Wx4IfuIgBpKtu8BdPEEJRiqAzPikaIaVZV3I5Fc9dOHd5X2UORpnDaIWO5zWr4SaObb
	a7Xj/ccphfdkHGtdN0Gis0It4lRu5pmfaJNANozLsXNuvs+W3g+1qXDJEyPahQQ4CUPU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
Message-Id: <E1vBCWJ-005qdb-2g@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:35:23 +0000

commit 5dc4685d1327b273d2cacc63233b4da62932e27c
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:27:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:27:28 2025 +0200

    x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
    
    Reading from the E9 port if the emergency console is active should return
    0xe9 according to the documentation from Bochs:
    
    https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
    
    See `port_e9_hack` section description.
    
    Fix Xen so it also returns the port address.  OSes can use it to detect
    whether the emergency console is available or not.
    
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: db5a3c31a650d3fb0945f77f8ceda133412b5ce0
    master date: 2025-10-02 18:05:50 +0200
---
 xen/arch/x86/hvm/hvm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index fbca7e4949..7c5a5314ba 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -557,9 +557,15 @@ static int cf_check hvm_print_line(
 
     ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
 
-    /* Deny any input requests. */
-    if ( dir != IOREQ_WRITE )
-        return X86EMUL_UNHANDLEABLE;
+    if ( dir == IOREQ_READ )
+    {
+        /*
+         * According to Bochs documentation, reading from the E9 port should
+         * return 0xE9 if the "port E9 hack" is implemented.
+         */
+        *val = XEN_HVM_DEBUGCONS_IOPORT;
+        return X86EMUL_OKAY;
+    }
 
     /* Accept only printable characters, newline, and horizontal tab. */
     if ( !isprint(c) && (c != '\n') && (c != '\t') )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:35:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:35:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147219.1479529 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCWV-0005Wk-Os; Tue, 21 Oct 2025 13:35:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147219.1479529; Tue, 21 Oct 2025 13: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 1vBCWV-0005Wc-MD; Tue, 21 Oct 2025 13:35:35 +0000
Received: by outflank-mailman (input) for mailman id 1147219;
 Tue, 21 Oct 2025 13: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 1vBCWT-0005WT-VZ
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:35: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 1vBCWT-00CjVy-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCWT-005qem-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2qohwHJ0MnbaNN6+8W+dzKF4anRE9275ne+KaDCR+bQ=; b=HitXOr5368tc/IfjJCMEjsjOpZ
	YW4Mr3lA4gKDHbYtOA6SY1De3I4kTEFqN3zjpHqfuob7XBvC2+hIEqwXnlcInwkiKZEw1CwpilJYw
	Ya4lMbANEbQyXRY8JIK9JqZUz7oTaRJ7eEHrUBrkiGCgifzeysvqc6f37qTjtwfrY7fY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] vpci/msix: improve handling of bogus MSI-X capabilities
Message-Id: <E1vBCWT-005qem-2x@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:35:33 +0000

commit 50b649c742722337ab6e324bfe838cd500871f4b
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:27:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:27:49 2025 +0200

    vpci/msix: improve handling of bogus MSI-X capabilities
    
    I've had the luck to come across a PCI card that exposes a MSI-X capability
    where the BIR of the vector and PBA tables points at a BAR that has 0 size.
    
    This doesn't play nice with the code in vpci_make_msix_hole(), as it would
    still use the address of such empty BAR (0) and attempt to carve a hole in
    the p2m.  This leads to errors like the one below being reported by Xen:
    
    d0v0 0000:22:00.0: existing mapping (mfn: 181c4300 type: 0) at 0 clobbers MSIX MMIO area
    
    And the device left unable to enable memory decoding due to the failure
    reported by vpci_make_msix_hole().
    
    Introduce checking in init_msix() to ensure the BARs containing the MSI-X
    tables are usable.  This requires checking that the BIR points to a
    non-empty BAR, and the offset and size of the MSI-X tables can fit in the
    target BAR.
    
    This fixes booting PVH dom0 on Supermicro AS -2126HS-TN servers with AMD
    EPYC 9965 processors.  The broken device is:
    
    22:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 93)
    
    There are multiple of those integrated controllers in the system, all
    broken in the same way.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 53859596c0d34dbca776ec1e47bac8dd90552530
    master date: 2025-10-10 11:02:39 +0200
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/lib.h   |  3 +++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index fbe710ab92..7d6e691b36 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -17,6 +17,7 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -721,6 +722,51 @@ static int cf_check init_msix(struct pci_dev *pdev)
     if ( !msix )
         return -ENOMEM;
 
+    msix->tables[VPCI_MSIX_TABLE] =
+        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
+    msix->tables[VPCI_MSIX_PBA] =
+        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
+
+    /* Check that the referenced BAR(s) regions are valid. */
+    for ( i = 0; i < ARRAY_SIZE(msix->tables); i++ )
+    {
+        const char *name = (i == VPCI_MSIX_TABLE) ? "vector" : "PBA";
+        const struct vpci_bar *bars = pdev->vpci->header.bars;
+        unsigned int bir = msix->tables[i] & PCI_MSIX_BIRMASK;
+        unsigned int type;
+        unsigned int offset = msix->tables[i] & ~PCI_MSIX_BIRMASK;
+        unsigned int size =
+            (i == VPCI_MSIX_TABLE) ? max_entries * PCI_MSIX_ENTRY_SIZE
+                                   : ROUNDUP(DIV_ROUND_UP(max_entries, 8), 8);
+
+        if ( bir >= ARRAY_SIZE(pdev->vpci->header.bars) )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table with out of range BIR %u\n",
+                   &pdev->sbdf, name, bir);
+ invalid:
+            xfree(msix);
+            return -ENODEV;
+        }
+
+        type = bars[bir].type;
+        if ( type != VPCI_BAR_MEM32 && type != VPCI_BAR_MEM64_LO )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table at invalid BAR%u with type %u\n",
+                   &pdev->sbdf, name, bir, type);
+            goto invalid;
+        }
+
+        if ( (uint64_t)offset + size > bars[bir].size )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table offset %#x size %#x outside of BAR%u size %#lx\n",
+                   &pdev->sbdf, name, offset, size, bir, bars[bir].size);
+            goto invalid;
+        }
+    }
+
     rc = vpci_add_register(pdev->vpci, control_read, control_write,
                            msix_control_reg(msix_offset), 2, msix);
     if ( rc )
@@ -732,11 +778,6 @@ static int cf_check init_msix(struct pci_dev *pdev)
     msix->max_entries = max_entries;
     msix->pdev = pdev;
 
-    msix->tables[VPCI_MSIX_TABLE] =
-        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
-    msix->tables[VPCI_MSIX_PBA] =
-        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
-
     for ( i = 0; i < max_entries; i++)
     {
         msix->entries[i].masked = true;
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 544d45cb9d..f78cdafa2c 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -57,6 +57,9 @@ static inline void
 debugtrace_printk(const char *fmt, ...) {}
 #endif
 
+/* Common log prefixes for platform related issues. */
+#define DEV_BUG_PREFIX "DEVICE BUG: "
+
 /* Allows us to use '%p' as general-purpose machine-word format char. */
 #define _p(_x) ((void *)(unsigned long)(_x))
 extern void printk(const char *fmt, ...)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:35:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:35:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147220.1479532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCWf-0005Ym-Qi; Tue, 21 Oct 2025 13:35:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147220.1479532; Tue, 21 Oct 2025 13: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 1vBCWf-0005Ye-Nv; Tue, 21 Oct 2025 13:35:45 +0000
Received: by outflank-mailman (input) for mailman id 1147220;
 Tue, 21 Oct 2025 13: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 1vBCWe-0005YW-1g
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCWd-00CjW7-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCWd-005qg1-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wWM4f7yQsF/7dpaL0tqKjAr71KjLnYnynZbLtB01R/U=; b=sW5MlPz5sOV65QuGEPcOB7NVCi
	cNIqhIp3A9jhZTljpEjWaEn4HiqC/OjoRm1i1AKLXbiAlkd1LWLRpmnb79mhJads+kzHKY1giNhuB
	AOmqgBgrCCBTuAuWQ6vNRrxPJNa+AElDPODt3huzI/iXAwEBLTN9qF0nB2ecczuK0dd0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/HWP: adjust feature_hdc's section annotation
Message-Id: <E1vBCWd-005qg1-3D@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:35:43 +0000

commit 117df4219161acc8399d4bd696cf962c798cbd72
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:28:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:08 2025 +0200

    x86/HWP: adjust feature_hdc's section annotation
    
    The variable can be cleared (set to false) by a non-init function's error
    path (hwp_init_msrs()).
    
    Fixes: 99c4570f8209 ("cpufreq: Add Hardware P-State (HWP) driver")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    master commit: 4676e09b3c3b2750aef3d6ec7e43b632d4800ab9
    master date: 2025-10-13 10:41:35 +0200
---
 xen/arch/x86/acpi/cpufreq/hwp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 59b57a4cef..1380989f30 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -17,7 +17,7 @@ static bool __ro_after_init hwp_in_use;
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
-static bool __ro_after_init feature_hdc;
+static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:35:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:35:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147222.1479537 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCWp-0005bV-TW; Tue, 21 Oct 2025 13:35:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147222.1479537; Tue, 21 Oct 2025 13: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 1vBCWp-0005bM-Qk; Tue, 21 Oct 2025 13:35:55 +0000
Received: by outflank-mailman (input) for mailman id 1147222;
 Tue, 21 Oct 2025 13: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 1vBCWo-0005bA-4c
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCWn-00CjWF-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:35:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCWo-005qgv-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=cvP2IYlw6QGqeVINYiIp8RWWcmFgOx5YrYuCy0ob5I4=; b=DJEewBmYgWb9Fms6V1BSqLROLp
	rukNSbwcHn6ol73m9tQEE1DlgWk7Pwb+5EXRBQMCrRNZFrF9k7gEfuOpWe8BsDeDeSYaossRiEGGw
	LDXuM+CJ5CEALqYmOrApBOQ3nKtoEAjdT6mxp0Oey+bfhqkCpZ+qkbBWmEgU75ffY7n4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] VT-d: check bus_to_context_maddr()'s return value
Message-Id: <E1vBCWo-005qgv-0G@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:35:54 +0000

commit de5a58a22ef3e7a9660f7a8cdc7f9ba48960399a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:28:19 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:19 2025 +0200

    VT-d: check bus_to_context_maddr()'s return value
    
    The function returning zero is an error indication; we shouldn't try to
    map MFN 0 and then treat that page as a context table.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef5b718cf81a2448118b86b86777f9430739445d
    master date: 2025-10-13 16:50:01 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index f28de36458..1013475f7f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1495,6 +1495,11 @@ int domain_context_mapping_one(
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        spin_unlock(&iommu->lock);
+        return -ENOMEM;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
     old = (lctxt = *context).full;
@@ -1887,6 +1892,12 @@ int domain_context_unmap_one(
     spin_lock(&iommu->lock);
 
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        ASSERT_UNREACHABLE();
+        spin_unlock(&iommu->lock);
+        return 0;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:36:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:36:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147224.1479540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCWz-0005ds-V3; Tue, 21 Oct 2025 13:36:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147224.1479540; Tue, 21 Oct 2025 13: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 1vBCWz-0005dl-S5; Tue, 21 Oct 2025 13:36:05 +0000
Received: by outflank-mailman (input) for mailman id 1147224;
 Tue, 21 Oct 2025 13: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 1vBCWy-0005dH-7X
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCWy-00CjWV-00
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCWy-005qkI-0W
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=NeH3gVF3aTQrwwSVV3wOM9NT+hicZTa+izRGWgPDBGs=; b=Q5+kLlsrBgDSRPcEDHpFzsnr+3
	dT/sqjVIe3N8tSKdbIC3D6FB2pwTVEXyPc6voj+R6tiBIgO5hfyXEKU0qobEURbYChej6qL3DuPXw
	Jx5rPh9uz/qYrtAAO/O3wD0S4CSmp0s7wqiLb1g9/f+kpszDSxSakPzha/JRAs9R1siU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/boot: Fix edd=off to skip mbr
Message-Id: <E1vBCWy-005qkI-0W@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:36:04 +0000

commit 67b8f4622131c38885720db6b8c3d6b64875f623
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Oct 21 15:28:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:31 2025 +0200

    x86/boot: Fix edd=off to skip mbr
    
    When the fixes commit re-arranged the code, it made edd=off jump to the
    mbr code instead of returning from the function.  Previously edd_done
    was immediately before ret and skipped the MBR check.
    
    Replace edd_done with .Ledd_mbr_sig for the start of the MBR checking,
    and replace .Ledd_mbr_sig_skip with .Ledd_done to exit from the function.
    
    edd=off jumps to .Ledd_done to return from the function, and internal
    jumps go to .Ledd_mbr_sig to check edd=skipmbr.
    
    Fixes: 5ec164fd61bd ("x86/boot: re-arrange how/when we do disk I/O")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 02e656f7c8fd63828307a4eac633958d82b36116
    master date: 2025-10-16 10:25:27 +0200
---
 xen/arch/x86/boot/edd.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 3df712bce1..02437511b2 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -25,7 +25,7 @@
 
 get_edd:
         cmpb    $2, bootsym(opt_edd)            # edd=off ?
-        je      edd_done
+        je      .Ledd_done
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
@@ -48,7 +48,7 @@ edd_check_ext:
         movb    $0x41, %ah                      # 0x41 Check Extensions Present
         movw    $0x55AA, %bx                    # magic
         int     $0x13                           # make the call
-        jc      edd_done                        # no more BIOS devices
+        jc      .Ledd_mbr_sig                   # no more BIOS devices
 
         cmpw    $0xAA55, %bx                    # is magic right?
         jne     edd_next                        # nope, next...
@@ -96,13 +96,13 @@ edd_legacy_done:
 
 edd_next:
         incb    %dl                             # increment to next device
-        jz      edd_done
+        jz      .Ledd_mbr_sig
         cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
         jb      edd_check_ext
 
-edd_done:
+.Ledd_mbr_sig:
         cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
-        je      .Ledd_mbr_sig_skip
+        je      .Ledd_done
 
 # Read the first sector of each BIOS disk device and store the 4-byte signature
 .Ledd_mbr_sig_start:
@@ -160,7 +160,7 @@ edd_done:
         jb      .Ledd_mbr_sig_read
 .Ledd_mbr_sig_done:
         popw    %es
-.Ledd_mbr_sig_skip:
+.Ledd_done:
         ret
 
 GLOBAL(boot_edd_info_nr)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:36:16 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:36:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147225.1479545 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCX9-0005gh-W9; Tue, 21 Oct 2025 13:36:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147225.1479545; Tue, 21 Oct 2025 13: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 1vBCX9-0005gZ-Te; Tue, 21 Oct 2025 13:36:15 +0000
Received: by outflank-mailman (input) for mailman id 1147225;
 Tue, 21 Oct 2025 13: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 1vBCX8-0005gK-9z
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCX8-00CjWb-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCX8-005qnI-0p
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=hIE8qiuVNmgTXoPUANhyVHxpTi42YGtyy3rgAGRt1Ys=; b=653mtySn1hVgpCvMOpjJlg4CHj
	BPc/bP16LqUYf4uHxsVfLDO7S21vAqEOnnMhD+diaTuG2pDOh3tySlJYrQ0q7YFr+6m3KXnPZrN/L
	fhbSc4Tsv98ADqkxoX/9vGpqW8f2BO3AzNAcwac/i53ZBUvSM1kqkTjDTc5xOf70pSxI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBCX8-005qnI-0p@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:36:14 +0000

commit 965fdf7b4278392c35888c4949a98d7cc650280d
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:28:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:49 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index a41a70e37a..41e93ef20f 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:36:26 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:36:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147226.1479548 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXK-0005j0-1e; Tue, 21 Oct 2025 13:36:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147226.1479548; Tue, 21 Oct 2025 13:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXJ-0005is-V4; Tue, 21 Oct 2025 13:36:25 +0000
Received: by outflank-mailman (input) for mailman id 1147226;
 Tue, 21 Oct 2025 13: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 1vBCXI-0005ij-CU
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCXI-00CjX3-0V
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCXI-005qpF-15
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=X6EIxOcYPwj6vAcexU13a2YpVO1QFeLWKx6UWJ1hFYU=; b=uv4fRpuiI1Q6vGyMzNxZzTGstb
	uUBgD0Iu4C6HB3FCuGC2xDzPBc4O6wzlAYEcuAjb8MZwBOThnvPY1Bsy43ZFOFX7tD7OFF1YZ9IgE
	ST2d5ZElXkUajVtdbpLDpxh2oBmf7KPPLQifd9KoYOQzm85BaLwBrHDd5lxonlLwNlKE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBCXI-005qpF-15@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:36:24 +0000

commit 5177ae067243dad9d1146f39f7a73b3ec4abb75c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:29:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:29:01 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 41e93ef20f..d45751365f 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    for_each_set_bit ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:36:36 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:36:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147227.1479553 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXU-0005lB-2x; Tue, 21 Oct 2025 13:36:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147227.1479553; Tue, 21 Oct 2025 13:36:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXU-0005l3-0F; Tue, 21 Oct 2025 13:36:36 +0000
Received: by outflank-mailman (input) for mailman id 1147227;
 Tue, 21 Oct 2025 13: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 1vBCXS-0005kv-Ow
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13: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 1vBCXS-00CjX7-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCXS-005qqL-2K
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13: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=JOUGjkX9MPUDLkw/bRUkcRgmwMWDdepiy62M2+s8N5o=; b=cXRyZhAcIyKNkkRAevNi05yr5n
	GZXpnx5w4at6kCmdxjK0F05eGu01LYjUxHAl2en9J+QaoW0TkmfEYacwP33+K1xlhWN1MuPrml/by
	0MC2xEOcPAjQhOEA2D+OqHcWH6dWM+SwzftggiPL80voxijnmMKmijQyxWHYxL4lUEJs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBCXS-005qqL-2K@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:36:34 +0000

commit 1ac5088ca06ce67528c46a5b1454f0026a5e2e21
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:30:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:30:28 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index a15fe0e9f8..99bbfaa596 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:36:46 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:36:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147228.1479557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXe-0005nM-49; Tue, 21 Oct 2025 13:36:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147228.1479557; Tue, 21 Oct 2025 13:36:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXe-0005nE-1Z; Tue, 21 Oct 2025 13:36:46 +0000
Received: by outflank-mailman (input) for mailman id 1147228;
 Tue, 21 Oct 2025 13:36: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 1vBCXc-0005n5-RP
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:36: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 1vBCXc-00CjXF-20
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCXc-005qrM-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sXCcmAtgp7XDiawZDuxWBUkU257wsFgD1nCyl8LOzLk=; b=ZPgPpnX/6M91sG6xqkhTlsQdQl
	V9Be5UmtD2a0/7WgBRDr+N/zfNOORRk5UFhNFJ8g5MKdv46bqqzqfkm2gmNtdDaGmmZeynQeiFeg8
	wkUwh9/UxSsu6tkr0G47CRObrgKJAiHhCi7o5Ggyf+eu9ilAMwfGYJLRgJ/e1gSD0WB4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBCXc-005qrM-2a@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:36:44 +0000

commit 91434069502a3c62a8568dffbe59835eb159e23c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:30:57 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:30:57 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 99bbfaa596..b04221eb25 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    for_each_set_bit ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:36:57 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:36:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147229.1479560 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXp-0005pa-5O; Tue, 21 Oct 2025 13:36:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147229.1479560; Tue, 21 Oct 2025 13:36:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXp-0005pT-2v; Tue, 21 Oct 2025 13:36:57 +0000
Received: by outflank-mailman (input) for mailman id 1147229;
 Tue, 21 Oct 2025 13:36:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vBCXn-0005pJ-8E
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:36:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCXn-00CjXL-05
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCXn-005qtM-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:36:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kxFU5BmQmWUxcYX4cSxtSdknsCxKVgTkTl76dLaZPMk=; b=ZOsvobY+md6ufKGkN6jnGH0m/y
	4RVOMx0GkK39JZkgE8mT0ySGP/l2Z1MK7NClTy2lZfJ26OIEFyrIARrIcnyU7ePmL13+V3dwe9lbw
	Yx2voabqG7KZlJpf7RcQs1S+1s4tsWTYcQJyeJ77PWbajv+dW+avbpJ3VlAxPr/0P9Bs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBCXn-005qtM-0f@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:36:55 +0000

commit 17bfa36a41c82af904fba99f120ddacc862f4b1f
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:31:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:31:25 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 372a749ab9..034f64b809 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 13:37:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 13:37:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147230.1479565 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXz-0005rf-72; Tue, 21 Oct 2025 13:37:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147230.1479565; Tue, 21 Oct 2025 13:37:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBCXz-0005rX-4O; Tue, 21 Oct 2025 13:37:07 +0000
Received: by outflank-mailman (input) for mailman id 1147230;
 Tue, 21 Oct 2025 13:37:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vBCXx-0005rP-Ao
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 13:37:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCXx-00CjZZ-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:37:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBCXx-005qvM-0u
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 13:37:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M69vwrNA0XJFZu2RxX6dzoqaePsPscm0dLSMYhKPGgc=; b=dFMF5y6Pts6rN+nUCcG7zOQ5+4
	rbw3RmOewcjeC6ReJ6UPz4bdScRA3+xOpjoZkvccNWS1ad5KERgn1/df4htGqPCdXX93Of92+Zymt
	9Lv5xEQNAn9NyFpMeKC3KjWKpS8wi0uFb0hCU6vhZgR2EgZeFXvbi4sxL3BYrxeqxieY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBCXx-005qvM-0u@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 13:37:05 +0000

commit 464e9f4a40c2d72cb88ada20ada3f84b6bd9ee5f
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:31:42 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:31:42 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 034f64b809..d39464f4a4 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    for_each_set_bit ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 14:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 14:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147416.1479722 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBDlP-0006o6-SV; Tue, 21 Oct 2025 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147416.1479722; Tue, 21 Oct 2025 14:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBDlP-0006ny-Pz; Tue, 21 Oct 2025 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1147416;
 Tue, 21 Oct 2025 14: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 1vBDlN-0006ns-VP
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 14: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 1vBDlN-00Cl4G-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 14:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBDlN-005xbm-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 14:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xkSjgbCLXveiLNGtYIoEmZxrk5f1YzrHf/yhBv676SU=; b=L76jHlWypirbYYq+r/9hc8+X64
	a/pdTT0KpfzxybihYta0+3iXkmopYAS2W1VFtwC6V4Q2rjBtI+M3yu3q/If8eLewZQqM4wRiC06GX
	zzYq69FQ4fZOb9GwGmG2wgNX12PWc8wXoCDANgPsGFekSK5JBt60iE3dZCX1V3ZWya7c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBDlN-005xbm-2w@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 14:55:01 +0000

commit 17bfa36a41c82af904fba99f120ddacc862f4b1f
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:31:25 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:31:25 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 372a749ab9..034f64b809 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 14:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 14:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147417.1479729 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBDlZ-0006q1-Ua; Tue, 21 Oct 2025 14:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147417.1479729; Tue, 21 Oct 2025 14:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBDlZ-0006pn-RL; Tue, 21 Oct 2025 14:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1147417;
 Tue, 21 Oct 2025 14: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 1vBDlY-0006pT-5U
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 14: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 1vBDlX-00Cl4S-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 14:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBDlX-005xcO-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 14:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a/DSprk/4zfGf/3zLVwiGI1JrAaVPrxJoZEwE2tQDzE=; b=K9k5zJ3Ci56s1kC8Z/zLo3wKZu
	Hp28rghVN/v84WfFhDBzQu3Obt79iItbKjCOgZBNtveUez5pgUjxeMO9QmU6IVJT8KayNT/5CczDO
	lfzWD2nEkFVaUM1k6IJcH5fr/29cnUvPkiQCyRwBgjacUGxxJmaSNdBwE0S1b/yqXpXE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBDlX-005xcO-3D@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 14:55:11 +0000

commit 464e9f4a40c2d72cb88ada20ada3f84b6bd9ee5f
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:31:42 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:31:42 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 034f64b809..d39464f4a4 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    for_each_set_bit ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 15:22:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 15:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147441.1479751 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEBW-0002zK-9l; Tue, 21 Oct 2025 15:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147441.1479751; Tue, 21 Oct 2025 15:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEBW-0002zC-7F; Tue, 21 Oct 2025 15:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1147441;
 Tue, 21 Oct 2025 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 1vBEBV-0002z3-Kr
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 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 1vBEBV-00ClYt-17
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBEBV-0060Yl-1Z
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 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=6Ct+9DF8+aZxUrMfduT3Z+ZWhbbvKZgUE7gI/SdM8Eg=; b=H16jbyULkxhesGOWQYo5HJCAds
	pxLm9pWpimlm89zAEWa5VXcOoEPrsOVmOV2hDg8dI0SC7eI0JBy7LUH0qqJSdjfFPic4nqyCvDDR0
	+7Jl64yBUjN+/PzyzP32nuGhiqzRAQw1INLZEpZzXsgtYi6oOjvwdFq8cf/SAXN/O/5I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBEBV-0060Yl-1Z@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 15:22:01 +0000

commit 1ac5088ca06ce67528c46a5b1454f0026a5e2e21
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:30:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:30:28 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index a15fe0e9f8..99bbfaa596 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 15:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 15:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147445.1479755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEBh-00035Q-BQ; Tue, 21 Oct 2025 15:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147445.1479755; Tue, 21 Oct 2025 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 1vBEBh-00035I-8i; Tue, 21 Oct 2025 15:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1147445;
 Tue, 21 Oct 2025 15: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 1vBEBf-00032x-Mg
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 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 1vBEBf-00Clax-1V
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBEBf-0060a9-1x
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 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=E0y7a5eiqBjKEMu+cHAly01+fC2q1MQBgfyPEHJEcrk=; b=y6nV7naEx0LjXDg6N4vy3PgLiy
	cG2qmoGTiOFplW+vuxtJ/9eGg6CoxP/isRZylQxcbosP3BrPXmTZiYsGORj5ADbNj12T4mGivq0SE
	ebKjDbKKAVgjzMzbnoUbj9y6v004ooHuCn4VMQ0shS5FvNSe7AQJRBsKqIM0DLUDNrTU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBEBf-0060a9-1x@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 15:22:11 +0000

commit 91434069502a3c62a8568dffbe59835eb159e23c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:30:57 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:30:57 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 99bbfaa596..b04221eb25 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    for_each_set_bit ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 15:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 15:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147450.1479760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEMA-0004T6-Rk; Tue, 21 Oct 2025 15:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147450.1479760; Tue, 21 Oct 2025 15: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 1vBEMA-0004Sy-Ob; Tue, 21 Oct 2025 15:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1147450;
 Tue, 21 Oct 2025 15: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 1vBEM9-0004Ss-Qm
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 15: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 1vBEM9-00Cln7-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBEM9-0062AM-2N
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15: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=veovusp0UXN5np9qLWtlkeorXt0dhSsGhjUTDhC52hg=; b=CzCl262MDeUmpW08WqH0ABk+5N
	sCqkt4KNfUymt3uRW1r+ICh4QiHX2qzphQILcstNtT4dVG6P8b9e8mHGvlhS2nCe1gJlxNWTR5Xv7
	tFk/50Xu/CNIQhE2b1j0OmeCFfzSiuNkwFAJUkwqnJ137RAVfOjw3o9lVm7V+iL4FsPg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBEM9-0062AM-2N@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 15:33:01 +0000

commit 36e90c4ef1f2667dc8159c634fb00d393fc2d857
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 14:09:37 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:09:37 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index c0be24bd22..703f9ac8bc 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 15:33:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 15:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147451.1479763 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEMK-0004V5-Se; Tue, 21 Oct 2025 15:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147451.1479763; Tue, 21 Oct 2025 15: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 1vBEMK-0004Ux-Q2; Tue, 21 Oct 2025 15:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1147451;
 Tue, 21 Oct 2025 15: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 1vBEMJ-0004Uq-UY
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 15: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 1vBEMJ-00ClnB-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBEMJ-0062Bl-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15: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=EaEnt4LPSf7/4wh8Z1cJL7sY8tH+Zk67oNKilQGskzw=; b=OX7zyMDmbFCt4mS/pg3HFi1Ekd
	OJFiPHmprxHfPC6GDK5GLaopkzwoBYwQCfoZFl/1SEfl2kH3Meg2QBWZ4T+AsccOKa7zRqMdpM9gs
	UnqGnTAlGSEKVlQk86lfvEgWmLgXpIGqvFo7yEaw84f9Bt97mG3OtsMsAiXgJkBSjQD8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBEMJ-0062Bl-2f@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 15:33:11 +0000

commit cc64c245023c3ff8e388c1c96aed3faed6fd00cb
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 14:10:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:10:13 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 703f9ac8bc..f79cffcb37 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    bitmap_for_each ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 15:33:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 15:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147452.1479767 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEMU-0004Xf-UC; Tue, 21 Oct 2025 15:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147452.1479767; Tue, 21 Oct 2025 15: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 1vBEMU-0004XX-RP; Tue, 21 Oct 2025 15:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1147452;
 Tue, 21 Oct 2025 15: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 1vBEMU-0004XP-0r
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 15: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 1vBEMT-00ClnZ-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBEMT-0062Ef-37
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15: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=c2UqOVgwBVIVZ60JfUu6hLzkBRvbdmyvNb07RoCr5U0=; b=UfQ1+XBHFmj7IbznS3fLYWM5jr
	hx529r+vxguRmOIESQT6vS100wTEnhECj3/2AkU/MOjZGLFWMRwHokpb/NlyfN6mWK+fuuFJQJvWq
	193ypm2puf2+Hq3n1zZ5GIA+4aneWtRCrnDkCqjXTNagaz7OKPq7/QZrTkO+7B4Odr14=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] symbols: discard stray file symbols
Message-Id: <E1vBEMT-0062Ef-37@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 15:33:21 +0000

commit 2f21ce1a6ad57a1a56840ab49c32d096160be595
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 14:10:46 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:10:46 2025 +0200

    symbols: discard stray file symbols
    
    By observation GNU ld 2.25 may emit file symbols for .data.read_mostly
    when linking xen.efi. Due to the nature of file symbols in COFF symbol
    tables (see the code comment) the symbols_offsets[] entries for such
    symbols would cause assembler warnings regarding value truncation. Of
    course the resulting entries would also be both meaningless and useless.
    Add a heuristic to get rid of them, really taking effect only when
    --all-symbols is specified (otherwise these symbols are discarded
    anyway).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/tools/symbols.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 06ad2c25f5..399edc8578 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -224,6 +224,16 @@ static int symbol_valid(struct sym_entry *s)
 	if (strstr((char *)s->sym + offset, "_compiled."))
 		return 0;
 
+	/* At least GNU ld 2.25 may emit bogus file symbols referencing a
+	 * section name while linking xen.efi. In COFF symbol tables the
+	 * "value" of file symbols is a link (symbol table index) to the next
+	 * file symbol. Since file (and other) symbols (can) come with one
+	 * (or in principle more) auxiliary symbol table entries, the value in
+	 * this heuristic is bounded to twice the number of symbols we have
+	 * found. See also read_symbol() as to the '?' checked for here. */
+	if (s->sym[0] == '?' && s->sym[1] == '.' && s->addr < table_cnt * 2)
+		return 0;
+
 	return 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 15:33:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 15:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147453.1479771 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEMf-0004Zm-03; Tue, 21 Oct 2025 15:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147453.1479771; Tue, 21 Oct 2025 15: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 1vBEMe-0004Zd-Sz; Tue, 21 Oct 2025 15:33:32 +0000
Received: by outflank-mailman (input) for mailman id 1147453;
 Tue, 21 Oct 2025 15: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 1vBEMe-0004ZV-5t
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 15: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 1vBEMd-00Clng-34
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBEMe-0062Fq-09
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15: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=p8OfEd9oZeSLPIXaz+irDgc/k7Z07l06Hk+EJ0YIOyg=; b=yNBsFtLa8O4D3TioD1H09yNGqh
	p9Bl+1RWvzv+QGl1rKDNw3q67QMAjkzsu5FON0elF3ZChYJ5F6AB4eQliZFD1gQEThtUiPFCwvnip
	HeuzKggfTMHAiNl17J2YMoienDyA5DAnY0oMPo5aN0byeAGsLzMekFMCM+zMDd0N7f3s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/tests/domid: don't pass -E to sed
Message-Id: <E1vBEMe-0062Fq-09@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 15:33:32 +0000

commit 3bc40a4404f8a2d36efe305ba72bf0eb37071c87
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 14:11:27 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:11:27 2025 +0200

    tools/tests/domid: don't pass -E to sed
    
    Even the 2018 edition of The Open Group Base Specifications Issue 7 [1]
    doesn't name -E as a standard option; only Issue 8 [2] does. As we can
    easily avoid anything "extended" about the expression used, drop the -E,
    escape the parentheses, and replace the sole + by *.
    
    [1] https://pubs.opengroup.org/onlinepubs/9699919799/
    [2] https://pubs.opengroup.org/onlinepubs/9799919799/
    
    Fixes: b3d31533a047 ("tools/tests: introduce unit tests for domain ID allocator")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 tools/tests/domid/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/tests/domid/Makefile b/tools/tests/domid/Makefile
index 22f1f15d11..753129029e 100644
--- a/tools/tests/domid/Makefile
+++ b/tools/tests/domid/Makefile
@@ -10,8 +10,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 TESTS := test-domid
 
 define list-c-headers
-$(shell sed -n -E \
-    's/^[ \t]*# *include[ \t]*[<"]([^">]+)[">].*/\1/p' $(1) 2>/dev/null)
+$(shell sed -n \
+    's/^[ \t]*# *include[ \t]*[<"]\([^">]*\)[">].*/\1/p' $(1) 2>/dev/null)
 endef
 
 # NB: $1 cannot be a list
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 21 15:33:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Oct 2025 15:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147454.1479775 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEMp-0004cQ-2X; Tue, 21 Oct 2025 15:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147454.1479775; Tue, 21 Oct 2025 15:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBEMp-0004cI-00; Tue, 21 Oct 2025 15:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1147454;
 Tue, 21 Oct 2025 15: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 1vBEMo-0004cA-A9
 for xen-changelog@lists.xenproject.org; Tue, 21 Oct 2025 15: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 1vBEMo-00Clno-06
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBEMo-0062HH-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 21 Oct 2025 15: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=kqVwp5E89V/jWvjZmNhKORL4Vzss9FaMYNpur6oyi98=; b=whFne+NmqofEPu9gwthrU6cGh9
	66sUL9YCmtbHBPLy5SOqMmTb79vidzgNwVg90GLOEhJzld/zmw9QBgKEWXpitHyiJo7mqV4v6Kidt
	mskLRWTJMo4aap986AkkOiXv8gOdGvHijMWb6ADgrwY0TlRA5U7UbhT7ctNtZQc95MX4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] AMD/IOMMU: unshare IRQ .ack and .disable handlers
Message-Id: <E1vBEMo-0062HH-0f@xenbits.xenproject.org>
Date: Tue, 21 Oct 2025 15:33:42 +0000

commit aed6278b2a7faac1bacce2d22aad29bc463fa0c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 14:11:45 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 14:11:45 2025 +0200

    AMD/IOMMU: unshare IRQ .ack and .disable handlers
    
    A .disable handler can't typically be re-used for .ack: The latter needs
    to deal with IRQ migration, while the former shouldn't. Furthermore
    invoking just irq_complete_move() isn't enough; one of
    move_{native,masked}_irq() also needs invoking.
    
    Fixes: 487a1cffd71a ("x86: Implement per-cpu vector for xen hypervisor")
    Fixes: f821102450a1 ("x86: IRQ Migration logic enhancement")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/drivers/passthrough/amd/iommu_init.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 3f6d2f5db5..00d2c46cbc 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -428,8 +428,6 @@ static void cf_check iommu_msi_mask(struct irq_desc *desc)
     unsigned long flags;
     struct amd_iommu *iommu = desc->action->dev_id;
 
-    irq_complete_move(desc);
-
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
@@ -442,6 +440,13 @@ static unsigned int cf_check iommu_msi_startup(struct irq_desc *desc)
     return 0;
 }
 
+static void cf_check iommu_msi_ack(struct irq_desc *desc)
+{
+    irq_complete_move(desc);
+    iommu_msi_mask(desc);
+    move_masked_irq(desc);
+}
+
 static void cf_check iommu_msi_end(struct irq_desc *desc, u8 vector)
 {
     iommu_msi_unmask(desc);
@@ -455,7 +460,7 @@ static hw_irq_controller iommu_msi_type = {
     .shutdown = iommu_msi_mask,
     .enable = iommu_msi_unmask,
     .disable = iommu_msi_mask,
-    .ack = iommu_msi_mask,
+    .ack = iommu_msi_ack,
     .end = iommu_msi_end,
     .set_affinity = set_msi_affinity,
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 11:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 11:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147937.1480060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBWkL-0000LH-V6; Wed, 22 Oct 2025 11:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147937.1480060; Wed, 22 Oct 2025 11: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 1vBWkL-0000LA-Sg; Wed, 22 Oct 2025 11:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1147937;
 Wed, 22 Oct 2025 11: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 1vBWkK-0000L4-LI
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 11: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 1vBWkK-00EGdo-1N
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBWkK-008TP7-1u
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11: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=19+dB4l3iJpZk7LcMjCZPY/4i8t/TjqQTC7zfO9M3Yw=; b=juNWtlFjKvC+8yPkzLUxLcG/Bk
	3flvGQCE+V0nw1RstZ/89wSPwDpuDYEmHPLVjY9n271SsQaL3K7N91XWXaxqZKA391iX2KS/d9Fw6
	jNTUKEWWlIMBcmD2ylfS+NLSDk/YQPTMePw6LVGsyykr7bvk8YO535p+vb6c4ecncO5g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
Message-Id: <E1vBWkK-008TP7-1u@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 11:11:12 +0000

commit b7838d12bd1adc12e7fa820fc124a251b8f4629e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 20 11:56:13 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 16:56:19 2025 +0100

    tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
    
    Otherwise it's not possible for device models to map IRQs of devices on
    segments different than 0.  Keep the same function prototype and pass the
    segment in the high 16bits of the bus parameter, like it's done for the
    hypercall itself.
    
    Amends: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenctrl.h      | 2 +-
 tools/libs/ctrl/xc_physdev.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index c14ecd66aa..d5dbf69c89 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1623,7 +1623,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
                             int index,
                             int *pirq,
                             int devfn,
-                            int bus,
+                            int segbus,
                             int entry_nr,
                             uint64_t table_base);
 
diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
index 25e686d7b3..9fb78536ea 100644
--- a/tools/libs/ctrl/xc_physdev.c
+++ b/tools/libs/ctrl/xc_physdev.c
@@ -65,7 +65,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
                             int index,
                             int *pirq,
                             int devfn,
-                            int bus,
+                            int segbus,
                             int entry_nr,
                             uint64_t table_base)
 {
@@ -79,10 +79,10 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
     }
     memset(&map, 0, sizeof(struct physdev_map_pirq));
     map.domid = domid;
-    map.type = MAP_PIRQ_TYPE_MSI;
+    map.type = MAP_PIRQ_TYPE_MSI_SEG;
     map.index = index;
     map.pirq = *pirq;
-    map.bus = bus;
+    map.bus = segbus;
     map.devfn = devfn;
     map.entry_nr = entry_nr;
     map.table_base = table_base;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 11:11:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 11:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147936.1480058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBWkB-0000Ju-UH; Wed, 22 Oct 2025 11:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147936.1480058; Wed, 22 Oct 2025 11: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 1vBWkB-0000Jm-RI; Wed, 22 Oct 2025 11:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1147936;
 Wed, 22 Oct 2025 11: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 1vBWkA-0000Jg-J0
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 11: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 1vBWkA-00EGdk-15
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBWkA-008TLw-1c
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11: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=XxxVry5bbfi8WBL7PCm5jrL/W2wrt/VTG+sQZn3srHk=; b=hFdS5aIH/1hnmfiC050kgyhoMQ
	IQU0ul6+1qHktIxr+FYiBLrSloqpcuR9EuwQP204PCAEoWx985G8B5Yex1ZWqPpcBbjILHxHhDPb0
	/5kH9LnCPF8s9eKZWOHLikTa9S/e3V6hOYVD5fAqli0UQ8lwzphUbkVJhztZU5iKgtRA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vBWkA-008TLw-1c@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 11:11:02 +0000

commit dc645cdf7d374933052fb933748a7502e06b007e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 16:56:19 2025 +0100

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index a5729229a4..59332da2b8 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -519,7 +519,7 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
     if ( !opt_digest_check && boot_cpu_data.family >= 0x17 )
     {
         printk(XENLOG_WARNING
-               "Microcode patch additional digest checks disabled");
+               "Microcode patch additional digest checks disabled\n");
         add_taint(TAINT_CPU_OUT_OF_SPEC);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 11:11:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 11:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147938.1480064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBWkW-0000Ns-0X; Wed, 22 Oct 2025 11:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147938.1480064; Wed, 22 Oct 2025 11: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 1vBWkV-0000Nk-UF; Wed, 22 Oct 2025 11:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1147938;
 Wed, 22 Oct 2025 11: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 1vBWkU-0000Nc-OP
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 11: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 1vBWkU-00EGds-1e
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBWkU-008TQi-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11: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=tWAyawtnz72AijEtL17C+nWU8JeAqtkIA26HO9/BGSw=; b=lICQRct6Nivo4edR8oXNuy3Fo+
	IrIu6nLwIEI1U8FAMH9Pz5mMT25jgLF4dPTP6iQ2XGMNjr36vmIWx9ADs6iZJS9UqeHKqzDsUMTuu
	WsXZ5Q4IePyNkmUqfaFynxmEFYrAlP7iYDInnUoNmthCoKxwMtUyW82yafd7dJek/tL4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xl: fix for dead code in list_domains_details()
Message-Id: <E1vBWkU-008TQi-2C@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 11:11:22 +0000

commit 80fb43a1b583334363608b0d74a863c5a67a0d02
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 20 13:19:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 16:56:35 2025 +0100

    tools/xl: fix for dead code in list_domains_details()
    
    Commit d0193c6d6716 introduced checking for the return value of
    printf_info_one_json(), but failed to remove a further check down, which
    now Coverity complains is dead code.
    
    The correct fix is to make the call to json_object_array_add() conditional
    on printf_info_one_json() having been successful, so that the further call
    to libxl_domain_config_dispose() is not avoided.
    
    CID: 1667251
    Fixes: d0193c6d6716 ("tools/xl: check return value of printf_info_one_json() in list_domains_details()")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/xl/xl_info.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index dbb682cc52..98fc879e63 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -584,9 +584,8 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
 #ifdef HAVE_LIBJSONC
             json_object *jso_value;
             rc = printf_info_one_json(&jso_value, info[i].domid, &d_config);
-            if (rc)
-                goto out;
-            json_object_array_add(jso, jso_value);
+            if (!rc)
+                json_object_array_add(jso, jso_value);
 #elif defined(HAVE_LIBYAJL)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 11:11:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 11:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147939.1480069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBWkg-0000QT-25; Wed, 22 Oct 2025 11:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147939.1480069; Wed, 22 Oct 2025 11:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBWkf-0000QL-Vf; Wed, 22 Oct 2025 11:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1147939;
 Wed, 22 Oct 2025 11: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 1vBWke-0000QA-Rb
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 11: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 1vBWke-00EGdz-1z
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBWke-008TRk-2T
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11: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=RarAxBQCtd1FeC8LHGN3EEkcAojjxSlW8SnIkCRWXYA=; b=EoAVJtCdShb5a10EhjCli6WPFH
	nwaNOBQcQQHegElJaYRVoluownrxdUJTra2LOjHkhdwMjo/OQi3UITS0wN3va2poGaMunZ+bvBEEG
	kI44rE6+fkzP7hrk+1xj6bMWIN3xKVewIrYA50eZl+JWHObGQrZcbSVjQb4HlsxIYxOE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: Make gentypes.py compatible with older Python
Message-Id: <E1vBWke-008TRk-2T@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 11:11:32 +0000

commit 47268fb8c8cdeeddcd1cf5c5b33903e9926ecaad
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Thu Oct 16 22:06:13 2025 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 18:11:22 2025 +0100

    tools/libxl: Make gentypes.py compatible with older Python
    
    removeprefix is only added in Python 3.9.
    
    Instead of the prefix removal, switch to passing in a "depth" parameter,
    and incrementing it for each level.
    
    There is a slight change in the generated _libxl_types.c.  instances of
    KeyedUnion increment depth without outputing any code.  The net result
    is some cases where jso_sub_1 is followed by jso_sub_3.  As an example:
    
      _libxl_types.c
      _libxl_types.c
      @@ -5535,12 +5535,12 @@
                       if (!jso_sub_1)
                           goto out;
                       if (!libxl__string_is_default(&p->u.pty.path)) {
      -                    json_object *jso_sub_2 = NULL;
      -                    rc = libxl__string_gen_jso(&jso_sub_2, p->u.pty.path);
      +                    json_object *jso_sub_3 = NULL;
      +                    rc = libxl__string_gen_jso(&jso_sub_3, p->u.pty.path);
                           if (rc)
                               goto out;
      -                    if (json_object_object_add(jso_sub_1, "path", jso_sub_2)) {
      -                        json_object_put(jso_sub_2);
      +                    if (json_object_object_add(jso_sub_1, "path", jso_sub_3)) {
      +                        json_object_put(jso_sub_3);
                               goto out;
                           }
                       }
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/libs/light/gentypes.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/gentypes.py b/tools/libs/light/gentypes.py
index 006bea170a..47bca4bc57 100644
--- a/tools/libs/light/gentypes.py
+++ b/tools/libs/light/gentypes.py
@@ -377,15 +377,14 @@ def get_default_expr(f, nparent, fexpr):
     return "%s" % fexpr
 
 # For json-c gen_json functions
-def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "jso"):
+def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "jso", depth = 0):
     s = ""
     if parent is None:
         s += "json_object *jso;\n"
         s += "int rc;\n"
-        sub_scope_object = "jso_sub_1"
-    else:
-        sub_scope_object = "jso_sub_%d" % (1+int(scope_object.removeprefix("jso_sub_")))
 
+    depth += 1
+    sub_scope_object = "jso_sub_%d" % depth
     if isinstance(ty, idl.Array):
         if parent is None:
             raise Exception("Array type must have a parent")
@@ -398,7 +397,8 @@ def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "
         s += "        json_object *%s;\n" % (sub_scope_object)
         # remove some indent, it's over indented at least in one case libxl_vcpu_sched_params_gen_json
         s += libxl_C_type_gen_jso(ty.elem_type, v+"[i]",
-                                   indent + "    ", parent, sub_scope_object)
+                                  indent + "    ", parent, sub_scope_object,
+                                  depth)
         s += "        if (json_object_array_add(%s, %s)) {\n" % (scope_object, sub_scope_object)
         s += "            json_object_put(%s);\n" % (sub_scope_object)
         s += "            goto out;\n"
@@ -417,7 +417,7 @@ def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
             if f.type is not None:
-                s += libxl_C_type_gen_jso(f.type, fexpr, indent + "    ", nparent, scope_object)
+                s += libxl_C_type_gen_jso(f.type, fexpr, indent + "    ", nparent, scope_object, depth)
             else:
                 s += "    %s = json_object_new_object();\n" % (scope_object)
                 s += "    if (!%s)\n" % (scope_object)
@@ -433,7 +433,7 @@ def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "
             default_expr = get_default_expr(f, nparent, fexpr)
             s += "if (%s) {\n" % default_expr
             s += "    json_object *%s = NULL;\n" % (sub_scope_object)
-            s += libxl_C_type_gen_jso(f.type, fexpr, "    ", nparent, sub_scope_object)
+            s += libxl_C_type_gen_jso(f.type, fexpr, "    ", nparent, sub_scope_object, depth)
             s += libxl_C_type_gen_jso_map_key(f, nparent, "    ", scope_object, sub_scope_object)
 
             s += "}\n"
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 11:11:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 11:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147940.1480074 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBWkq-0000Sh-3b; Wed, 22 Oct 2025 11:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147940.1480074; Wed, 22 Oct 2025 11:11:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBWkq-0000SY-0j; Wed, 22 Oct 2025 11:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1147940;
 Wed, 22 Oct 2025 11: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 1vBWko-0000SQ-U8
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 11: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 1vBWko-00EGeM-2H
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBWko-008TSP-2o
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11: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=YthhGn1kEPXvcyGQunr94y3vaZNq/ewKMG4LskyA5xs=; b=GAZiBQ5zOyZkWfqyzh9+WyQiHR
	MNoPzpxUaSNtDPxPI+eahKZBDOMdxn2deZJdDZV0SsHGXMDnxcRdE90azXp3WrwvJvfdq9TjfsQL4
	tuT5rs1hGXAqDW9TCXwAhKXxObqIhUsuzI7dN8qicQQFcl5UwCH4Jsd+W+3MLEwPiq9U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Update Xen version to 4.21.0-rc2
Message-Id: <E1vBWko-008TSP-2o@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 11:11:42 +0000

commit eff32008be0d2718d32d60245650ff6f88fb3d13
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 22 12:01:02 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Oct 22 12:01:02 2025 +0100

    Update Xen version to 4.21.0-rc2
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index ba8c7147a2..a0bd29fe11 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 ?= .0-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 11:55:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 11:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147942.1480077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBXQl-0005UC-3j; Wed, 22 Oct 2025 11:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147942.1480077; Wed, 22 Oct 2025 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 1vBXQl-0005U5-0Y; Wed, 22 Oct 2025 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1147942;
 Wed, 22 Oct 2025 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 1vBXQj-0005Tz-SZ
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBXQj-00EHRG-1v
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBXQj-008Z1S-2R
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=iVR2+f1VfqvU1WUVSAJD03D5Bi6B+ijmhKzjuqd8zo0=; b=gKnzl232Dafbg5++Tn6NziNw02
	5YAqvua+o0CmUK1IT6Nh3pCLLZA/j0qrKg2T0pnUUPWDyuKcQPEHr5dyjUaxB+cCGaxpQCSm5V2YG
	4tQmphs324OhVD9dTyNy4q0cR+2sus0VwzPoadl8DdaHsfQqkx+sfnT+LJipW99cnYxs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/vpci: fix backport of 53859596c0d3
Message-Id: <E1vBXQj-008Z1S-2R@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 11:55:01 +0000

commit e5d643d28a2b8e077ae330217c7fa405fe27e6c5
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Oct 22 13:42:48 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 22 13:42:48 2025 +0200

    xen/vpci: fix backport of 53859596c0d3
    
    Commit 53859596c0d3 depends on the behavioral change introduced in
    ee2eb6849d50 that inverted the initialization of the MSI-X and header vPCI
    handlers.  53859596c0d3 requires the header to be initialized before MSI-X.
    
    Change the order of initialization and adjust init_msix() to carve holes
    for the MSI-X tables if necessary, since it will now run after the BARs
    have been possibly mapped into the domain p2m.
    
    Fixes: f9aea52a9747 ("vpci/msix: improve handling of bogus MSI-X capabilities")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/vpci/header.c | 2 +-
 xen/drivers/vpci/msix.c   | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 1f48f2aac6..b002eb2072 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -1016,7 +1016,7 @@ static int cf_check init_header(struct pci_dev *pdev)
     pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
     return rc;
 }
-REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_MIDDLE);
+REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_HIGH);
 
 /*
  * Local variables:
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index faa7c1cd49..94fb645377 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -792,9 +792,14 @@ static int cf_check init_msix(struct pci_dev *pdev)
     pdev->vpci->msix = msix;
     list_add(&msix->next, &d->arch.hvm.msix_tables);
 
-    return 0;
+    /*
+     * vPCI header initialization will have mapped the whole BAR into the
+     * p2m, as MSI-X capability was not yet initialized.  Crave a hole for
+     * the MSI-X table here, so that Xen can trap accesses.
+     */
+    return vpci_make_msix_hole(pdev);
 }
-REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_HIGH);
+REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_MIDDLE);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 11:55:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 11:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1147943.1480083 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBXQv-0005Wg-70; Wed, 22 Oct 2025 11:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1147943.1480083; Wed, 22 Oct 2025 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 1vBXQv-0005WY-3M; Wed, 22 Oct 2025 11:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1147943;
 Wed, 22 Oct 2025 11: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 1vBXQu-0005WP-3H
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 11: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 1vBXQt-00EHRN-2o
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBXQu-008Z32-05
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 11: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=V8o+bEXmDTbjAW2YjUgE2sDblH3iXt154fFIwg7MaCo=; b=GfreF8CZRYmc+5JRW02mUDKm1O
	jQED3urlliPOnD1TMQCdAQgzMvMtQum1fe9Gj0TgWr/RU8f/6IL9crH3p0u1HNuE8zA8S7ElSHG1I
	ibshQdKTrHCRwehipBkfZ5gV5a1RYyvkRM1O2tKo8F+8vq66wrZ9LphBVe4RckNqBrB4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/vpci: fix backport of 53859596c0d3
Message-Id: <E1vBXQu-008Z32-05@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 11:55:12 +0000

commit 8a62bb04e27fe1e3e59d6551df5452c4e27683bd
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Oct 22 13:44:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 22 13:44:01 2025 +0200

    xen/vpci: fix backport of 53859596c0d3
    
    Commit 53859596c0d3 depends on the behavioral change introduced in
    ee2eb6849d50 that inverted the initialization of the MSI-X and header vPCI
    handlers.  53859596c0d3 requires the header to be initialized before MSI-X.
    
    Change the order of initialization and adjust init_msix() to carve holes
    for the MSI-X tables if necessary, since it will now run after the BARs
    have been possibly mapped into the domain p2m.
    
    Fixes: 50b649c74272 ("vpci/msix: improve handling of bogus MSI-X capabilities")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/vpci/header.c | 2 +-
 xen/drivers/vpci/msix.c   | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 1f48f2aac6..b002eb2072 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -1016,7 +1016,7 @@ static int cf_check init_header(struct pci_dev *pdev)
     pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
     return rc;
 }
-REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_MIDDLE);
+REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_HIGH);
 
 /*
  * Local variables:
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 7d6e691b36..140f5ab284 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -790,9 +790,14 @@ static int cf_check init_msix(struct pci_dev *pdev)
     pdev->vpci->msix = msix;
     list_add(&msix->next, &d->arch.hvm.msix_tables);
 
-    return 0;
+    /*
+     * vPCI header initialization will have mapped the whole BAR into the
+     * p2m, as MSI-X capability was not yet initialized.  Crave a hole for
+     * the MSI-X table here, so that Xen can trap accesses.
+     */
+    return vpci_make_msix_hole(pdev);
 }
-REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_HIGH);
+REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_MIDDLE);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:44:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148016.1480115 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYCB-0004uq-5Z; Wed, 22 Oct 2025 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148016.1480115; Wed, 22 Oct 2025 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 1vBYCB-0004ui-32; Wed, 22 Oct 2025 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1148016;
 Wed, 22 Oct 2025 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 1vBYCA-0004uc-9N
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYCA-00EIMn-06
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYCA-008f4v-0S
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=fvI1TlP8FSqS5fnOJWMfLXk62yaPkbxLXo/f4baHrWE=; b=Wwp+LUTW6bLSYbmgXKgEpOw19h
	jgJ3UuPimpvoz77EQ4fiBEAPDyWXbwl6VjzTJcZk+SJudpaGYEh34x6+IErMWDo7PpfY01gJTAVq7
	Ufj4zmj436RbNfoHeZG2Jbn0M7FIBS+w3WWkJ+tdmrrXW+MQJON3gpf+U2+K+vtCw3lE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST
Message-Id: <E1vBYCA-008f4v-0S@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:44:02 +0000

commit db1c1e0fe8bc709fc0c957e9ab7756d973419d65
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:18:26 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:18:26 2025 +0200

    x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST
    
    When building Xen with GCC 12 with UBSAN and PVH_GUEST both enabled the
    compiler emits the following errors:
    
    arch/x86/setup.c: In function '__start_xen':
    arch/x86/setup.c:1504:19: error: 'consider_modules' reading 40 bytes from a region of size 4 [-Werror=stringop-overread]
     1504 |             end = consider_modules(s, e, reloc_size + mask,
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1505 |                                    bi->mods, bi->nr_modules, -1);
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/x86/setup.c:1504:19: note: referencing argument 4 of type 'const struct boot_module[0]'
    arch/x86/setup.c:686:24: note: in a call to function 'consider_modules'
      686 | static uint64_t __init consider_modules(
          |                        ^~~~~~~~~~~~~~~~
    arch/x86/setup.c:1535:19: error: 'consider_modules' reading 40 bytes from a region of size 4 [-Werror=stringop-overread]
     1535 |             end = consider_modules(s, e, size, bi->mods,
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1536 |                                    bi->nr_modules + relocated, j);
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/x86/setup.c:1535:19: note: referencing argument 4 of type 'const struct boot_module[0]'
    arch/x86/setup.c:686:24: note: in a call to function 'consider_modules'
      686 | static uint64_t __init consider_modules(
          |                        ^~~~~~~~~~~~~~~~
    
    This seems to be the result of some function manipulation done by UBSAN
    triggering GCC stringops related errors.  Placate the errors by declaring
    the function parameter as `const struct *boot_module` instead of `const
    struct boot_module[]`.
    
    Note that GCC 13 seems to be fixed, and doesn't trigger the error when
    using `[]`.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 932898d4492609f99e3016d423a9323235392864
    master date: 2025-03-17 13:33:28 +0100
---
 xen/arch/x86/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 10d55884ab..3dc8de3114 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -682,7 +682,7 @@ static void __init noinline move_xen(void)
 #undef BOOTSTRAP_MAP_LIMIT
 
 static uint64_t __init consider_modules(
-    uint64_t s, uint64_t e, uint32_t size, const struct boot_module mods[],
+    uint64_t s, uint64_t e, uint32_t size, const struct boot_module *mods,
     unsigned int nr_mods, unsigned int this_mod)
 {
     unsigned int i;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148017.1480119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYCL-0004ww-7C; Wed, 22 Oct 2025 12:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148017.1480119; Wed, 22 Oct 2025 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 1vBYCL-0004wo-4Q; Wed, 22 Oct 2025 12:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1148017;
 Wed, 22 Oct 2025 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 1vBYCK-0004wb-DO
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYCK-00EIMr-0a
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYCK-008f8v-0v
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=9AvBcJpTOu7vKbou8qaQpsHzuf0VCmTv3Alh86K/WHU=; b=63QH+58s6xB6vr1+ef+KM0VrOJ
	XQlWpxECO2M/gFB7XxhQIq89P75X878/azukV3Rw8XzhQIMf4YypXRvUyFE2arOb4UEvS8lzX39s8
	cFyn0sR5+Q5mP6lZx2I2LHxi/HXGabxiKHK3dCIp1GCm2FuZQSnArjOpLy3KEGMfvRuQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/mcheck: fix mca_allbanks updating
Message-Id: <E1vBYCK-008f8v-0v@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:44:12 +0000

commit 247b708b1400a989d142ba2f29c54286fbfc26e4
Author:     Soham Dandapat <soham.dandapat@amd.com>
AuthorDate: Tue Oct 21 15:19:06 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:19:06 2025 +0200

    x86/mcheck: fix mca_allbanks updating
    
    In mca_cap_init function,the mcabanks_alloc allocates and
    initializes an mca_banks structure for managing MCA banks,
    setting up a bank map and storing the specified or default number
    of banks.
    
    After this we will call mcabanks_set(i, mca_allbanks);
    The mcabanks_set function sets a specific bit in the bank_map of
    an mca_banks structure, provided the structure, its bank_map, and
    the bit index are valid.
    
    At the end, we will call
    mcabanks_free(xchg(&mca_allbanks, all));
    This function is thread safe and does below:
       1. Atomically exchanges the value of "mca_allbanks" with "all"
       2. Returns the old value that was previously in "mca_allbanks"
    So, when we will call mcabanks_free , that will free the memory.
    
    The problem is that mcabanks_set(i, mca_allbanks) function is updating
    mca_allbanks which will be freed via mcabanks_free later. This means
    new mca_allbanks instance("all") will never get chance to update
    it's bank_map.
    
    Due to this when we will collect log from mcheck_mca_logout function ,
    the condition "if ( !mcabanks_test(i, bankmask) )" will always fails
    and MCA logs will not be collected for any bank.
    
    The fix is to solve this problem.
    
    Fixes: 560cf418c845 ("x86/mcheck: allow varying bank counts per CPU")
    Signed-off-by: Soham Dandapat <soham.dandapat@amd.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 532988dccc197bc4fe700ebceffad95f2f4c7541
    master date: 2025-09-09 08:18:11 +0200
---
 xen/arch/x86/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 9028ccde54..84238cd0ef 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -663,7 +663,7 @@ static int mca_cap_init(void)
         if ( !all )
             return -ENOMEM;
         for ( i = 0; i < nr; i++ )
-            mcabanks_set(i, mca_allbanks);
+            mcabanks_set(i, all);
         mcabanks_free(xchg(&mca_allbanks, all));
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148018.1480123 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYCV-0004zK-8M; Wed, 22 Oct 2025 12:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148018.1480123; Wed, 22 Oct 2025 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 1vBYCV-0004zC-5o; Wed, 22 Oct 2025 12:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1148018;
 Wed, 22 Oct 2025 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 1vBYCU-0004z2-GD
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYCU-00EIMx-0s
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYCU-008fB8-1Q
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=W4lSoFNZAIqZoQdamz7AedHUk32YhMe89Pfxu2oVfhI=; b=upF8y+r6OcNnCBi1wInWnT4WFP
	NQPqA33Mmc5hY+xXIQBpUGJh8VdLeRooNSmYE2ye8dVMlrOpke5lQt7uR4zVSy3a1lA74lUoYugxh
	aD3YdOfktgdpAPphoyXuRNlkPtFKAceqv5AOqfhKOMLveAci0NApavJ2oFBIe4QOQhMg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Message-Id: <E1vBYCU-008fB8-1Q@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:44:22 +0000

commit a5aa6b397f83e4a2a40f2e43e07b2d872273dee5
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Oct 21 15:19:21 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:19:21 2025 +0200

    libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
    
    PVH guests have no DM, so this causes the guest to fetch the online CPU
    bitmap from an unbacked 0xaf00 PIO port when executing the GPE handler.
    
    Seeing how ACPI CPU hotplug is the only event delivered via GPE, remove
    the GPE handler in addition to anything ACPI CPU hotplug related.
    
    This shrinks PVH's DSDT substantially and prevents spuriously executing
    a large amount of AML with no purpose at all.
    
    Fixes: 062975dc9441("acpi: PVH guests need _E02 method")
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: b59e564aa0830f60214b9b5afb4f8543dd1bf2b0
    master date: 2025-09-25 09:18:55 +0200
---
 tools/libacpi/mk_dsdt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
index 34f6753f61..0b1818d4e8 100644
--- a/tools/libacpi/mk_dsdt.c
+++ b/tools/libacpi/mk_dsdt.c
@@ -237,6 +237,11 @@ int main(int argc, char **argv)
     pop_block();
     /**** Processor end ****/
 #else
+    if (dm_version == QEMU_NONE) {
+        pop_block();
+        pop_block();
+        return 0;
+    }
 
     /* Operation Region 'PRST': bitmask of online CPUs. */
     stmt("OperationRegion", "PRST, SystemIO, %#x, %d",
@@ -285,10 +290,6 @@ int main(int argc, char **argv)
     pop_block();
     pop_block();
 
-    if (dm_version == QEMU_NONE) {
-        pop_block();
-        return 0;
-    }
     /**** Processor end ****/
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148019.1480127 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYCf-00051o-9u; Wed, 22 Oct 2025 12:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148019.1480127; Wed, 22 Oct 2025 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 1vBYCf-00051g-7E; Wed, 22 Oct 2025 12:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1148019;
 Wed, 22 Oct 2025 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 1vBYCe-00051Y-Kx
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYCe-00EIN1-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYCe-008fEI-1h
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=IgzqDIB+PajM516KXkjCL33/qOpdDDkMd9Z/vEGzzuA=; b=d/FQ5RmyGEpsjibxekr1dkz/r9
	df5N4AK0+IjexAei9JJ2lG4AqwsN50TQjhmaxRuknMT+U540Nn+Huz6o1tBjW3HM9qrf5w0zKQEr/
	xQhq1Jkbr2HPwXjiPvn+DiMkCT9nj20467sEKpV4RPAwl8/GaqOevPcnTvzuzTWDxM9Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
Message-Id: <E1vBYCe-008fEI-1h@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:44:32 +0000

commit 02806fc9671113b90e8740faec275ee2a6e1962d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:20:02 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:02 2025 +0200

    x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
    
    Otherwise the check for the SS feature in
    check_memory_type_self_snoop_errata() fails unconditionally, which leads to
    X86_FEATURE_XEN_SELFSNOOP never being set.
    
    We could also avoid this by not doing the reset_cpuinfo() for the BSP in
    identify_cpu(), because SS detection uses boot_cpu_data.  However that
    creates an imbalance on the state of the BSP versus the APs in the
    identify_cpu() code.
    
    I've opted for the less controversial solution of populating FEATURESET_1d
    in generic_identify(), as the value is already there.  The same is done for
    the AMD faulting probe code.  While there also populate the FEATURESET_1c
    element, as the value is in context.
    
    Fixes: f2663ca2e520 ("x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 382dd0d166cb85139d86ff26fd96af102ae4fef3
    master date: 2025-09-25 16:07:05 +0200
---
 xen/arch/x86/cpu/common.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 4eacdaac0f..168cd3a9ee 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -438,6 +438,13 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 
+	/*
+	 * Early init of Self Snoop support requires 0x1.edx, while there also
+	 * set 0x1.ecx as the value is in context.
+	 */
+	c->x86_capability[FEATURESET_1c] = ecx;
+	c->x86_capability[FEATURESET_1d] = edx;
+
 	eax = cpuid_eax(0x80000000);
 	if ((eax >> 16) == 0x8000)
 		c->extended_cpuid_level = eax;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:44:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148020.1480131 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYCp-000543-BV; Wed, 22 Oct 2025 12:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148020.1480131; Wed, 22 Oct 2025 12:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYCp-00053v-8n; Wed, 22 Oct 2025 12:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1148020;
 Wed, 22 Oct 2025 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 1vBYCo-00053p-Nl
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYCo-00EINP-1d
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYCo-008fGM-2B
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=nuPGBj9gASrY7T3ywbXHEOQ1eg8QGRkQuNXD5TXYssU=; b=qF/Yjy6ZzSzgUeijMdS8+cHQNG
	otN7SSrLFfEdEmW4IfM9FrxZ1OSweMA2AqUHOMXvYoHSLo1Zs82Wjg5ooFYVyQKvRs9kZWPLgf9EJ
	JiQdKozt68RAaURwykJcEq+9LMssI/HeLvDaJCd2cljx++eYaolyad9ntNY2vFJykGCI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
Message-Id: <E1vBYCo-008fGM-2B@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:44:42 +0000

commit 6c2fab72f7cf49306aedd5e0561fdcb426045086
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:20:17 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:17 2025 +0200

    x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
    
    Reading from the E9 port if the emergency console is active should return
    0xe9 according to the documentation from Bochs:
    
    https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
    
    See `port_e9_hack` section description.
    
    Fix Xen so it also returns the port address.  OSes can use it to detect
    whether the emergency console is available or not.
    
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: db5a3c31a650d3fb0945f77f8ceda133412b5ce0
    master date: 2025-10-02 18:05:50 +0200
---
 xen/arch/x86/hvm/hvm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 0f0630769b..ba9a08bf54 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -557,9 +557,15 @@ static int cf_check hvm_print_line(
 
     ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
 
-    /* Deny any input requests. */
-    if ( dir != IOREQ_WRITE )
-        return X86EMUL_UNHANDLEABLE;
+    if ( dir == IOREQ_READ )
+    {
+        /*
+         * According to Bochs documentation, reading from the E9 port should
+         * return 0xE9 if the "port E9 hack" is implemented.
+         */
+        *val = XEN_HVM_DEBUGCONS_IOPORT;
+        return X86EMUL_OKAY;
+    }
 
     /* Accept only printable characters, newline, and horizontal tab. */
     if ( !isprint(c) && (c != '\n') && (c != '\t') )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:44:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148021.1480134 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYD0-00056d-Cw; Wed, 22 Oct 2025 12:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148021.1480134; Wed, 22 Oct 2025 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 1vBYD0-00056T-AH; Wed, 22 Oct 2025 12:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1148021;
 Wed, 22 Oct 2025 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 1vBYCy-00056D-QY
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYCy-00EINV-1u
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYCy-008fH9-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=aOBfO/2HsgPqCbL1gXzHhFTLMAWfUcjnDsCMaSpIup0=; b=HPmNv7v5NFMv3gKj/4IAykPl0c
	MsEOYlNLe2vFbZhZRRPfZRMnZUW2JECYvbpC3Msbdw2hN0TaFSAc45DQMScuG33Fxv7GAjyTQIEeI
	ZjgYex7yHU5TnSTSuXR4tPQaehYznY43LUkzBRjnKBQPHFEEH3ZYnec7O+XAfEvfvV0U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] vpci/msix: improve handling of bogus MSI-X capabilities
Message-Id: <E1vBYCy-008fH9-2S@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:44:52 +0000

commit f9aea52a9747d56440faf06263b8cd5ffbc524fd
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:20:33 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:33 2025 +0200

    vpci/msix: improve handling of bogus MSI-X capabilities
    
    I've had the luck to come across a PCI card that exposes a MSI-X capability
    where the BIR of the vector and PBA tables points at a BAR that has 0 size.
    
    This doesn't play nice with the code in vpci_make_msix_hole(), as it would
    still use the address of such empty BAR (0) and attempt to carve a hole in
    the p2m.  This leads to errors like the one below being reported by Xen:
    
    d0v0 0000:22:00.0: existing mapping (mfn: 181c4300 type: 0) at 0 clobbers MSIX MMIO area
    
    And the device left unable to enable memory decoding due to the failure
    reported by vpci_make_msix_hole().
    
    Introduce checking in init_msix() to ensure the BARs containing the MSI-X
    tables are usable.  This requires checking that the BIR points to a
    non-empty BAR, and the offset and size of the MSI-X tables can fit in the
    target BAR.
    
    This fixes booting PVH dom0 on Supermicro AS -2126HS-TN servers with AMD
    EPYC 9965 processors.  The broken device is:
    
    22:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 93)
    
    There are multiple of those integrated controllers in the system, all
    broken in the same way.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 53859596c0d34dbca776ec1e47bac8dd90552530
    master date: 2025-10-10 11:02:39 +0200
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/lib.h   |  3 +++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 6bd8c55bb4..faa7c1cd49 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -17,6 +17,7 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -723,6 +724,51 @@ static int cf_check init_msix(struct pci_dev *pdev)
     if ( !msix )
         return -ENOMEM;
 
+    msix->tables[VPCI_MSIX_TABLE] =
+        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
+    msix->tables[VPCI_MSIX_PBA] =
+        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
+
+    /* Check that the referenced BAR(s) regions are valid. */
+    for ( i = 0; i < ARRAY_SIZE(msix->tables); i++ )
+    {
+        const char *name = (i == VPCI_MSIX_TABLE) ? "vector" : "PBA";
+        const struct vpci_bar *bars = pdev->vpci->header.bars;
+        unsigned int bir = msix->tables[i] & PCI_MSIX_BIRMASK;
+        unsigned int type;
+        unsigned int offset = msix->tables[i] & ~PCI_MSIX_BIRMASK;
+        unsigned int size =
+            (i == VPCI_MSIX_TABLE) ? max_entries * PCI_MSIX_ENTRY_SIZE
+                                   : ROUNDUP(DIV_ROUND_UP(max_entries, 8), 8);
+
+        if ( bir >= ARRAY_SIZE(pdev->vpci->header.bars) )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table with out of range BIR %u\n",
+                   &pdev->sbdf, name, bir);
+ invalid:
+            xfree(msix);
+            return -ENODEV;
+        }
+
+        type = bars[bir].type;
+        if ( type != VPCI_BAR_MEM32 && type != VPCI_BAR_MEM64_LO )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table at invalid BAR%u with type %u\n",
+                   &pdev->sbdf, name, bir, type);
+            goto invalid;
+        }
+
+        if ( (uint64_t)offset + size > bars[bir].size )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table offset %#x size %#x outside of BAR%u size %#lx\n",
+                   &pdev->sbdf, name, offset, size, bir, bars[bir].size);
+            goto invalid;
+        }
+    }
+
     rc = vpci_add_register(pdev->vpci, control_read, control_write,
                            msix_control_reg(msix_offset), 2, msix);
     if ( rc )
@@ -734,11 +780,6 @@ static int cf_check init_msix(struct pci_dev *pdev)
     msix->max_entries = max_entries;
     msix->pdev = pdev;
 
-    msix->tables[VPCI_MSIX_TABLE] =
-        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
-    msix->tables[VPCI_MSIX_PBA] =
-        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
-
     for ( i = 0; i < max_entries; i++)
     {
         msix->entries[i].masked = true;
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 130f96791f..1a09f8ada9 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -58,6 +58,9 @@ static inline void
 debugtrace_printk(const char *fmt, ...) {}
 #endif
 
+/* Common log prefixes for platform related issues. */
+#define DEV_BUG_PREFIX "DEVICE BUG: "
+
 extern void printk(const char *fmt, ...)
     __attribute__ ((format (printf, 1, 2), cold));
 void vprintk(const char *fmt, va_list args)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:45:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148023.1480138 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDA-00058u-EC; Wed, 22 Oct 2025 12:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148023.1480138; Wed, 22 Oct 2025 12: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 1vBYDA-00058l-Bc; Wed, 22 Oct 2025 12:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1148023;
 Wed, 22 Oct 2025 12: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 1vBYD8-00058d-TV
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 12: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 1vBYD8-00EINv-2D
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYD8-008fJo-2j
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Za8lgd39PjS9+MlZFgwoTeTHVThUTA3seCqM+VwBmSI=; b=c7guRFdEm10UWfZlNbGX0kr0F2
	kb13S/PzUgh+gWeWA7OLXcojBaOozU1ZxqXMmtr8Ms87OaNiiO0HtiUNoZEdDUGnXIbuF7zIcThWq
	p+tIewgDsBw7eAFB0aCwRgdmJvNj0xpFNeUEsqP7VdslQqCroG6IPp0gL4+HqnCyBQ2Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/HWP: adjust feature_hdc's section annotation
Message-Id: <E1vBYD8-008fJo-2j@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:45:02 +0000

commit 040e8cc14d7cbce4939bd08c3e6cfea7e60dee67
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:20:55 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:20:55 2025 +0200

    x86/HWP: adjust feature_hdc's section annotation
    
    The variable can be cleared (set to false) by a non-init function's error
    path (hwp_init_msrs()).
    
    Fixes: 99c4570f8209 ("cpufreq: Add Hardware P-State (HWP) driver")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    master commit: 4676e09b3c3b2750aef3d6ec7e43b632d4800ab9
    master date: 2025-10-13 10:41:35 +0200
---
 xen/arch/x86/acpi/cpufreq/hwp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 59b57a4cef..1380989f30 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -17,7 +17,7 @@ static bool __ro_after_init hwp_in_use;
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
-static bool __ro_after_init feature_hdc;
+static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:45:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148025.1480143 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDK-0005Bo-Gm; Wed, 22 Oct 2025 12:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148025.1480143; Wed, 22 Oct 2025 12: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 1vBYDK-0005Bg-EF; Wed, 22 Oct 2025 12:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1148025;
 Wed, 22 Oct 2025 12: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 1vBYDJ-0005BX-05
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 12: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 1vBYDI-00EIO4-2V
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYDI-008fN2-32
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UYZoNfXZMCHrIHEKD7Tpr8EOEnBD8WfSIvyURzH7oL8=; b=zfrRGCgt8ii+Mkq2EmEm0r3+/e
	Ym2Tw+zNF7TssCFDeDFBnM0CoR1ghTLpujO/8A0bMPsM8v4opJwYiA0Z8h9qLc2OUM/k1K1q1AUV0
	eW5RrbM6rJP3EgtrOn0ws+7AONuLHEwviFyVSOsgMIPnQVhvpmYNDaHsjNEEqwWtngK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] VT-d: check bus_to_context_maddr()'s return value
Message-Id: <E1vBYDI-008fN2-32@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:45:12 +0000

commit aab88a3ef3ce7b92fa96b965bf39560f173baa88
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:21:14 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:21:14 2025 +0200

    VT-d: check bus_to_context_maddr()'s return value
    
    The function returning zero is an error indication; we shouldn't try to
    map MFN 0 and then treat that page as a context table.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef5b718cf81a2448118b86b86777f9430739445d
    master date: 2025-10-13 16:50:01 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index a1927d9f12..5816ea0c9f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1498,6 +1498,11 @@ int domain_context_mapping_one(
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        spin_unlock(&iommu->lock);
+        return -ENOMEM;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
     old = (lctxt = *context).full;
@@ -1852,6 +1857,12 @@ int domain_context_unmap_one(
     spin_lock(&iommu->lock);
 
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        ASSERT_UNREACHABLE();
+        spin_unlock(&iommu->lock);
+        return 0;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:45:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148027.1480146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDU-0005Dy-I3; Wed, 22 Oct 2025 12:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148027.1480146; Wed, 22 Oct 2025 12:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDU-0005Dq-Fb; Wed, 22 Oct 2025 12:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1148027;
 Wed, 22 Oct 2025 12: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 1vBYDT-0005Di-2b
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 12: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 1vBYDS-00EIOA-2k
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYDT-008fNi-05
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FmRQ6aILRKj7bPBM+bcH7q/BNCBI+spAEV+/cGmjp5k=; b=PI7cHQNml6wB+4AXpHbT0w1H/D
	2KQJmyTUa+vWjZ2yT0ydiLSnRhtEjJshSRvWPj6h7z7S7gr8CAWKvqpTq90WE/tarJDcxJFzxBCdx
	V6DY+KDp/gi+R6T8mNh3IZGKDzmN2O1SuL63c2M9GY4DIdCg0yLO6x0SaNDxt2CuvE1s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/boot: Fix edd=off to skip mbr
Message-Id: <E1vBYDT-008fNi-05@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:45:23 +0000

commit 8b29b6a484f5e63e92516eeb6bbe31c86a2a63fb
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Oct 21 15:21:36 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:21:36 2025 +0200

    x86/boot: Fix edd=off to skip mbr
    
    When the fixes commit re-arranged the code, it made edd=off jump to the
    mbr code instead of returning from the function.  Previously edd_done
    was immediately before ret and skipped the MBR check.
    
    Replace edd_done with .Ledd_mbr_sig for the start of the MBR checking,
    and replace .Ledd_mbr_sig_skip with .Ledd_done to exit from the function.
    
    edd=off jumps to .Ledd_done to return from the function, and internal
    jumps go to .Ledd_mbr_sig to check edd=skipmbr.
    
    Fixes: 5ec164fd61bd ("x86/boot: re-arrange how/when we do disk I/O")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 02e656f7c8fd63828307a4eac633958d82b36116
    master date: 2025-10-16 10:25:27 +0200
---
 xen/arch/x86/boot/edd.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 3df712bce1..02437511b2 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -25,7 +25,7 @@
 
 get_edd:
         cmpb    $2, bootsym(opt_edd)            # edd=off ?
-        je      edd_done
+        je      .Ledd_done
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
@@ -48,7 +48,7 @@ edd_check_ext:
         movb    $0x41, %ah                      # 0x41 Check Extensions Present
         movw    $0x55AA, %bx                    # magic
         int     $0x13                           # make the call
-        jc      edd_done                        # no more BIOS devices
+        jc      .Ledd_mbr_sig                   # no more BIOS devices
 
         cmpw    $0xAA55, %bx                    # is magic right?
         jne     edd_next                        # nope, next...
@@ -96,13 +96,13 @@ edd_legacy_done:
 
 edd_next:
         incb    %dl                             # increment to next device
-        jz      edd_done
+        jz      .Ledd_mbr_sig
         cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
         jb      edd_check_ext
 
-edd_done:
+.Ledd_mbr_sig:
         cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
-        je      .Ledd_mbr_sig_skip
+        je      .Ledd_done
 
 # Read the first sector of each BIOS disk device and store the 4-byte signature
 .Ledd_mbr_sig_start:
@@ -160,7 +160,7 @@ edd_done:
         jb      .Ledd_mbr_sig_read
 .Ledd_mbr_sig_done:
         popw    %es
-.Ledd_mbr_sig_skip:
+.Ledd_done:
         ret
 
 GLOBAL(boot_edd_info_nr)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:45:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148028.1480151 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDe-0005GQ-JV; Wed, 22 Oct 2025 12:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148028.1480151; Wed, 22 Oct 2025 12:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDe-0005GI-Gw; Wed, 22 Oct 2025 12:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1148028;
 Wed, 22 Oct 2025 12: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 1vBYDd-0005GA-7J
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 12: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 1vBYDc-00EIOE-32
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYDd-008fPC-0L
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CUP/pIQY4N9S4LZrco/nNmMJuBSwBh2Ou0uJpFhIts0=; b=kNMEzhwxia2CbAgo2YaOsvBtTl
	PAeRmGtyu9AX3K/mdoZLymjYnhpFIo5GkhRCqlFiC+PmpGDvA8PrGojLDUOa/oEKI++3QTIxVD1iA
	02amu/zAFviXH+jtY7FvRMaltLdRjPWmGeJQYC38aJtpHYRYoWOvCxHH2XR5kpRCpHHw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBYDd-008fPC-0L@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:45:33 +0000

commit 188b66cf0fd7492645b1e77d872f65307d5ce550
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:21:59 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:21:59 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 8ff19a00fe..0b614f4d20 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:45:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148029.1480155 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDo-0005IV-Kv; Wed, 22 Oct 2025 12:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148029.1480155; Wed, 22 Oct 2025 12:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDo-0005IN-IM; Wed, 22 Oct 2025 12:45:44 +0000
Received: by outflank-mailman (input) for mailman id 1148029;
 Wed, 22 Oct 2025 12: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 1vBYDn-0005IF-8k
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 12: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 1vBYDn-00EIOg-08
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYDn-008fR6-0f
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12: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=XFU3Ogz1rEN+nZFQUpkT4xr4QphitJXaGOof2mRC5gk=; b=C5FhB+bG8UMEMBrj7B+EXXx8y/
	EIxnNVPYfyTggDWxmfbDY6KUCO4tcCsJacxhsDx4EjvvMGAb5q/Ymb+RyBxJcYnGESbYcvA7AmSHm
	i2Ah5CYogfBk/1oSIVrDsguGB7zDN0E/05TULAK8bexSZkbhEC8gsp7m8qHo/Q0fFmng=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBYDn-008fR6-0f@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:45:43 +0000

commit d8d23d168823c7ff8e9afa09bceb916c809f525c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:22:23 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:22:23 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 0b614f4d20..536614050d 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    bitmap_for_each ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 12:45:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 12:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148030.1480159 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDy-0005Ke-ML; Wed, 22 Oct 2025 12:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148030.1480159; Wed, 22 Oct 2025 12:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYDy-0005KX-Jl; Wed, 22 Oct 2025 12:45:54 +0000
Received: by outflank-mailman (input) for mailman id 1148030;
 Wed, 22 Oct 2025 12: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 1vBYDx-0005KR-CE
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 12: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 1vBYDx-00EIOk-0U
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYDx-008fS3-0y
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 12: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=m1RQ0rcuqbUlZ5IhKWayDB2evExOHZzEewzqK0ZjV3Y=; b=vdeb/fnc6XRcMitGkEj+/H7rUn
	HRs/FrUL579Egrbrijvb4PodzEfFECIJc00t6EI5HQxDWPnogp4ZWNHoAmaHfCsgmiTG7l0+9NKDX
	nR8ktCUmOc2/DGFH5yQEb2sP/KXaTKaOqlU7W9rBeWZPYunUoMT8TBwevP8hDyMPRUfg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/vpci: fix backport of 53859596c0d3
Message-Id: <E1vBYDx-008fS3-0y@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 12:45:53 +0000

commit e5d643d28a2b8e077ae330217c7fa405fe27e6c5
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Oct 22 13:42:48 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 22 13:42:48 2025 +0200

    xen/vpci: fix backport of 53859596c0d3
    
    Commit 53859596c0d3 depends on the behavioral change introduced in
    ee2eb6849d50 that inverted the initialization of the MSI-X and header vPCI
    handlers.  53859596c0d3 requires the header to be initialized before MSI-X.
    
    Change the order of initialization and adjust init_msix() to carve holes
    for the MSI-X tables if necessary, since it will now run after the BARs
    have been possibly mapped into the domain p2m.
    
    Fixes: f9aea52a9747 ("vpci/msix: improve handling of bogus MSI-X capabilities")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/vpci/header.c | 2 +-
 xen/drivers/vpci/msix.c   | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 1f48f2aac6..b002eb2072 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -1016,7 +1016,7 @@ static int cf_check init_header(struct pci_dev *pdev)
     pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
     return rc;
 }
-REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_MIDDLE);
+REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_HIGH);
 
 /*
  * Local variables:
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index faa7c1cd49..94fb645377 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -792,9 +792,14 @@ static int cf_check init_msix(struct pci_dev *pdev)
     pdev->vpci->msix = msix;
     list_add(&msix->next, &d->arch.hvm.msix_tables);
 
-    return 0;
+    /*
+     * vPCI header initialization will have mapped the whole BAR into the
+     * p2m, as MSI-X capability was not yet initialized.  Crave a hole for
+     * the MSI-X table here, so that Xen can trap accesses.
+     */
+    return vpci_make_msix_hole(pdev);
 }
-REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_HIGH);
+REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_MIDDLE);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148063.1480183 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYxa-0003lX-Fs; Wed, 22 Oct 2025 13:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148063.1480183; Wed, 22 Oct 2025 13: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 1vBYxa-0003lQ-DD; Wed, 22 Oct 2025 13:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1148063;
 Wed, 22 Oct 2025 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 1vBYxZ-0003lK-SH
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYxZ-00EJJF-1t
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYxZ-008kZ9-2E
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=8h/iFhJ39mFS0X/eCTJanpHrtrqGa8XWUDfA15o4SVE=; b=O7fRIR17TtgOiTcZALBVCSJeHW
	JGNQu3+sQRXg/wSDNgzbcH/Tin1kfqXBl79kVFLGNxHpkQoWPk8wNGZ9RKEsxTYwgeR8I281RhbAX
	A5zTYNRDFjrg2Kar1UcVozW0WdebjS0C4/DSKhwVx2U2s2JpmeZCKuWM5E1Gw04iXbns=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vBYxZ-008kZ9-2E@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:33:01 +0000

commit dc645cdf7d374933052fb933748a7502e06b007e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 16:56:19 2025 +0100

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index a5729229a4..59332da2b8 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -519,7 +519,7 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
     if ( !opt_digest_check && boot_cpu_data.family >= 0x17 )
     {
         printk(XENLOG_WARNING
-               "Microcode patch additional digest checks disabled");
+               "Microcode patch additional digest checks disabled\n");
         add_taint(TAINT_CPU_OUT_OF_SPEC);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:33:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148064.1480187 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYxk-0003nK-HQ; Wed, 22 Oct 2025 13:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148064.1480187; Wed, 22 Oct 2025 13: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 1vBYxk-0003nD-Em; Wed, 22 Oct 2025 13:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1148064;
 Wed, 22 Oct 2025 13: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 1vBYxj-0003n3-VS
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYxj-00EJJL-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYxj-008kaY-2j
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=AIoeGj5BAd0sVG6QcNo7W+JK9fPuTCpB4SsJF6KZgpM=; b=lbNqWyxP2OuDTVBkyDFmu2LaHg
	QZnzoweSRWxLBd2ZMQXw4SPJzpT/Qc70q2aupEz4nUmN4sZiSiH6e4JDpa3r3bAV2yqxpYSmcqtYU
	6mPRswVPk17aTlw9KNrQxy9zfBmrkwLRwZ+fFbu6uxBWEysR0wHyuodc5XPIA/ChMZ/U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
Message-Id: <E1vBYxj-008kaY-2j@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:33:11 +0000

commit b7838d12bd1adc12e7fa820fc124a251b8f4629e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 20 11:56:13 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 16:56:19 2025 +0100

    tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
    
    Otherwise it's not possible for device models to map IRQs of devices on
    segments different than 0.  Keep the same function prototype and pass the
    segment in the high 16bits of the bus parameter, like it's done for the
    hypercall itself.
    
    Amends: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenctrl.h      | 2 +-
 tools/libs/ctrl/xc_physdev.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index c14ecd66aa..d5dbf69c89 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1623,7 +1623,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
                             int index,
                             int *pirq,
                             int devfn,
-                            int bus,
+                            int segbus,
                             int entry_nr,
                             uint64_t table_base);
 
diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
index 25e686d7b3..9fb78536ea 100644
--- a/tools/libs/ctrl/xc_physdev.c
+++ b/tools/libs/ctrl/xc_physdev.c
@@ -65,7 +65,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
                             int index,
                             int *pirq,
                             int devfn,
-                            int bus,
+                            int segbus,
                             int entry_nr,
                             uint64_t table_base)
 {
@@ -79,10 +79,10 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
     }
     memset(&map, 0, sizeof(struct physdev_map_pirq));
     map.domid = domid;
-    map.type = MAP_PIRQ_TYPE_MSI;
+    map.type = MAP_PIRQ_TYPE_MSI_SEG;
     map.index = index;
     map.pirq = *pirq;
-    map.bus = bus;
+    map.bus = segbus;
     map.devfn = devfn;
     map.entry_nr = entry_nr;
     map.table_base = table_base;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:33:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148065.1480191 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYxu-0003pj-Iz; Wed, 22 Oct 2025 13:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148065.1480191; Wed, 22 Oct 2025 13: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 1vBYxu-0003pa-GG; Wed, 22 Oct 2025 13:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1148065;
 Wed, 22 Oct 2025 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 1vBYxu-0003pS-1v
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBYxt-00EJJR-2f
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYxt-008kby-31
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=EO5uW1rYptGEYZEqx33oR9dCRsvMK0ZgvF18sx3pmOU=; b=AYYzbiwbPMIP3tKq+mBQPgLd6A
	e5n+L99c0atXFjkmCy7FWAGU9QJzYDlXSJ+lSIq5CJEJiHNsk55Ef0jv8Qb6Q15HiOqaZKcwzmSUv
	JZUwQgyPvVPUJi7kG865lwm1A6k0vyIkMhla7//H4CNCg++5dbOa5A6rLj17jxs9kN3o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xl: fix for dead code in list_domains_details()
Message-Id: <E1vBYxt-008kby-31@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:33:21 +0000

commit 80fb43a1b583334363608b0d74a863c5a67a0d02
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Oct 20 13:19:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 16:56:35 2025 +0100

    tools/xl: fix for dead code in list_domains_details()
    
    Commit d0193c6d6716 introduced checking for the return value of
    printf_info_one_json(), but failed to remove a further check down, which
    now Coverity complains is dead code.
    
    The correct fix is to make the call to json_object_array_add() conditional
    on printf_info_one_json() having been successful, so that the further call
    to libxl_domain_config_dispose() is not avoided.
    
    CID: 1667251
    Fixes: d0193c6d6716 ("tools/xl: check return value of printf_info_one_json() in list_domains_details()")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/xl/xl_info.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index dbb682cc52..98fc879e63 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -584,9 +584,8 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
 #ifdef HAVE_LIBJSONC
             json_object *jso_value;
             rc = printf_info_one_json(&jso_value, info[i].domid, &d_config);
-            if (rc)
-                goto out;
-            json_object_array_add(jso, jso_value);
+            if (!rc)
+                json_object_array_add(jso, jso_value);
 #elif defined(HAVE_LIBYAJL)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:33:32 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:33:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148066.1480195 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYy4-0003sk-Lw; Wed, 22 Oct 2025 13:33:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148066.1480195; Wed, 22 Oct 2025 13: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 1vBYy4-0003sc-Ir; Wed, 22 Oct 2025 13:33:32 +0000
Received: by outflank-mailman (input) for mailman id 1148066;
 Wed, 22 Oct 2025 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 1vBYy4-0003sU-5L
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBYy3-00EJJY-2y
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYy4-008kci-0G
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Dcid22lC9I3TYfbKeprsEOVqTFam/1IKf+auHHdxdkk=; b=G0zBG7woFDAt8rCYApmzRRK6w7
	b8qePwbRLI8V2IQXxKYEOLDws0gDMY8xMjkY0lPvb9mgo+N1443ub+J7YY0DOcM33KnS0tNQCbsw+
	0HE/0rD9+PhotaKiJbofDOKklfLUSjLt7zEzOVYItRCPGgzBmVz124lG7YRDw9kcSo6g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: Make gentypes.py compatible with older Python
Message-Id: <E1vBYy4-008kci-0G@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:33:32 +0000

commit 47268fb8c8cdeeddcd1cf5c5b33903e9926ecaad
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Thu Oct 16 22:06:13 2025 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 21 18:11:22 2025 +0100

    tools/libxl: Make gentypes.py compatible with older Python
    
    removeprefix is only added in Python 3.9.
    
    Instead of the prefix removal, switch to passing in a "depth" parameter,
    and incrementing it for each level.
    
    There is a slight change in the generated _libxl_types.c.  instances of
    KeyedUnion increment depth without outputing any code.  The net result
    is some cases where jso_sub_1 is followed by jso_sub_3.  As an example:
    
      _libxl_types.c
      _libxl_types.c
      @@ -5535,12 +5535,12 @@
                       if (!jso_sub_1)
                           goto out;
                       if (!libxl__string_is_default(&p->u.pty.path)) {
      -                    json_object *jso_sub_2 = NULL;
      -                    rc = libxl__string_gen_jso(&jso_sub_2, p->u.pty.path);
      +                    json_object *jso_sub_3 = NULL;
      +                    rc = libxl__string_gen_jso(&jso_sub_3, p->u.pty.path);
                           if (rc)
                               goto out;
      -                    if (json_object_object_add(jso_sub_1, "path", jso_sub_2)) {
      -                        json_object_put(jso_sub_2);
      +                    if (json_object_object_add(jso_sub_1, "path", jso_sub_3)) {
      +                        json_object_put(jso_sub_3);
                               goto out;
                           }
                       }
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/libs/light/gentypes.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/gentypes.py b/tools/libs/light/gentypes.py
index 006bea170a..47bca4bc57 100644
--- a/tools/libs/light/gentypes.py
+++ b/tools/libs/light/gentypes.py
@@ -377,15 +377,14 @@ def get_default_expr(f, nparent, fexpr):
     return "%s" % fexpr
 
 # For json-c gen_json functions
-def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "jso"):
+def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "jso", depth = 0):
     s = ""
     if parent is None:
         s += "json_object *jso;\n"
         s += "int rc;\n"
-        sub_scope_object = "jso_sub_1"
-    else:
-        sub_scope_object = "jso_sub_%d" % (1+int(scope_object.removeprefix("jso_sub_")))
 
+    depth += 1
+    sub_scope_object = "jso_sub_%d" % depth
     if isinstance(ty, idl.Array):
         if parent is None:
             raise Exception("Array type must have a parent")
@@ -398,7 +397,8 @@ def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "
         s += "        json_object *%s;\n" % (sub_scope_object)
         # remove some indent, it's over indented at least in one case libxl_vcpu_sched_params_gen_json
         s += libxl_C_type_gen_jso(ty.elem_type, v+"[i]",
-                                   indent + "    ", parent, sub_scope_object)
+                                  indent + "    ", parent, sub_scope_object,
+                                  depth)
         s += "        if (json_object_array_add(%s, %s)) {\n" % (scope_object, sub_scope_object)
         s += "            json_object_put(%s);\n" % (sub_scope_object)
         s += "            goto out;\n"
@@ -417,7 +417,7 @@ def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
             if f.type is not None:
-                s += libxl_C_type_gen_jso(f.type, fexpr, indent + "    ", nparent, scope_object)
+                s += libxl_C_type_gen_jso(f.type, fexpr, indent + "    ", nparent, scope_object, depth)
             else:
                 s += "    %s = json_object_new_object();\n" % (scope_object)
                 s += "    if (!%s)\n" % (scope_object)
@@ -433,7 +433,7 @@ def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object = "
             default_expr = get_default_expr(f, nparent, fexpr)
             s += "if (%s) {\n" % default_expr
             s += "    json_object *%s = NULL;\n" % (sub_scope_object)
-            s += libxl_C_type_gen_jso(f.type, fexpr, "    ", nparent, sub_scope_object)
+            s += libxl_C_type_gen_jso(f.type, fexpr, "    ", nparent, sub_scope_object, depth)
             s += libxl_C_type_gen_jso_map_key(f, nparent, "    ", scope_object, sub_scope_object)
 
             s += "}\n"
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:33:42 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:33:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148067.1480198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBYyE-0003uo-Mm; Wed, 22 Oct 2025 13:33:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148067.1480198; Wed, 22 Oct 2025 13:33: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 1vBYyE-0003ug-KF; Wed, 22 Oct 2025 13:33:42 +0000
Received: by outflank-mailman (input) for mailman id 1148067;
 Wed, 22 Oct 2025 13: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 1vBYyE-0003ua-7U
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBYyE-00EJJv-00
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBYyE-008kdZ-0Z
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0/KYe10ns8jkAUJvDAN0IP+pzA0wopy76lcK3xsQaC8=; b=q6OL80nmEtJM81C8H0cpB8NTim
	BESeDTehL4zvnm0IGMXyXOjH3zHp+9DazRVQ4r1JMvKzasnNlXZSCKIE/WBISKRUjfVtujnwBGF94
	ve2LGRP3kp5fAG4QghRDZY9s0hxwLbuIkK9QxgDQWCMElMY6+G6FyGeHo18g0dTd5Pn4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Update Xen version to 4.21.0-rc2
Message-Id: <E1vBYyE-008kdZ-0Z@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:33:42 +0000

commit eff32008be0d2718d32d60245650ff6f88fb3d13
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 22 12:01:02 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Oct 22 12:01:02 2025 +0100

    Update Xen version to 4.21.0-rc2
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index ba8c7147a2..a0bd29fe11 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 ?= .0-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:44:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148069.1480202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ8F-00056f-En; Wed, 22 Oct 2025 13:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148069.1480202; Wed, 22 Oct 2025 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 1vBZ8F-00056X-Be; Wed, 22 Oct 2025 13:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1148069;
 Wed, 22 Oct 2025 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 1vBZ8E-00056Q-Ar
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBZ8E-00EJbf-0F
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ8E-008m0a-0m
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=gYfia4ZhYA2MKck168bpnWAbiAWEu4WwIzgIW5RkFyI=; b=1S56DOzqdQcuWdFL/P+e8l1MAe
	mt3NqFI6Bvw61TBX7PmDNdY0MX4mNuKKG5/NGfm03SWApYRzA+Kmc+Njk6sHZrJFLczcdXiR9BPxs
	iR07KxdNEn6Znv83pOO/9/Bn2ceA7RPeQYVOG7n9a5RRHyUZ32GBtl5xuQnNW6q0CDZE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/mcheck: fix mca_allbanks updating
Message-Id: <E1vBZ8E-008m0a-0m@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:44:02 +0000

commit 01b8bc41e8fd1d55169353de8882189c56c6908e
Author:     Soham Dandapat <soham.dandapat@amd.com>
AuthorDate: Tue Oct 21 15:26:13 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:26:13 2025 +0200

    x86/mcheck: fix mca_allbanks updating
    
    In mca_cap_init function,the mcabanks_alloc allocates and
    initializes an mca_banks structure for managing MCA banks,
    setting up a bank map and storing the specified or default number
    of banks.
    
    After this we will call mcabanks_set(i, mca_allbanks);
    The mcabanks_set function sets a specific bit in the bank_map of
    an mca_banks structure, provided the structure, its bank_map, and
    the bit index are valid.
    
    At the end, we will call
    mcabanks_free(xchg(&mca_allbanks, all));
    This function is thread safe and does below:
       1. Atomically exchanges the value of "mca_allbanks" with "all"
       2. Returns the old value that was previously in "mca_allbanks"
    So, when we will call mcabanks_free , that will free the memory.
    
    The problem is that mcabanks_set(i, mca_allbanks) function is updating
    mca_allbanks which will be freed via mcabanks_free later. This means
    new mca_allbanks instance("all") will never get chance to update
    it's bank_map.
    
    Due to this when we will collect log from mcheck_mca_logout function ,
    the condition "if ( !mcabanks_test(i, bankmask) )" will always fails
    and MCA logs will not be collected for any bank.
    
    The fix is to solve this problem.
    
    Fixes: 560cf418c845 ("x86/mcheck: allow varying bank counts per CPU")
    Signed-off-by: Soham Dandapat <soham.dandapat@amd.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 532988dccc197bc4fe700ebceffad95f2f4c7541
    master date: 2025-09-09 08:18:11 +0200
---
 xen/arch/x86/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 32c1b2756b..5a59e79cbc 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -663,7 +663,7 @@ static int mca_cap_init(void)
         if ( !all )
             return -ENOMEM;
         for ( i = 0; i < nr; i++ )
-            mcabanks_set(i, mca_allbanks);
+            mcabanks_set(i, all);
         mcabanks_free(xchg(&mca_allbanks, all));
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:44:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148070.1480206 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ8P-00058L-Fu; Wed, 22 Oct 2025 13:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148070.1480206; Wed, 22 Oct 2025 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 1vBZ8P-00058D-DB; Wed, 22 Oct 2025 13:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1148070;
 Wed, 22 Oct 2025 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 1vBZ8O-00057v-EQ
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBZ8O-00EJbl-0h
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ8O-008m4A-13
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=BKgJr22CFygAIFIUjwgkdvQaI+r4Islfrrln2gBW/LE=; b=ersIjmqVfbySCYFaYaft2IqWIg
	4C2LylXITaKkIMpVzgC5zvLf5EYPoSiDsFcc6zmpdy2odqvblJyQPK8Xp/x/JKG9khXr72ocA9uzO
	suYmYEARlR7j2ewKh1tWB+06YuzspDVMJD3wu8Wq02bsSxs005UXMf/0CGcDQm1hzaCk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Message-Id: <E1vBZ8O-008m4A-13@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:44:12 +0000

commit 030b9ade00a374e233a67bd4040d974c8294956e
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Oct 21 15:26:35 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:26:35 2025 +0200

    libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
    
    PVH guests have no DM, so this causes the guest to fetch the online CPU
    bitmap from an unbacked 0xaf00 PIO port when executing the GPE handler.
    
    Seeing how ACPI CPU hotplug is the only event delivered via GPE, remove
    the GPE handler in addition to anything ACPI CPU hotplug related.
    
    This shrinks PVH's DSDT substantially and prevents spuriously executing
    a large amount of AML with no purpose at all.
    
    Fixes: 062975dc9441("acpi: PVH guests need _E02 method")
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: b59e564aa0830f60214b9b5afb4f8543dd1bf2b0
    master date: 2025-09-25 09:18:55 +0200
---
 tools/libacpi/mk_dsdt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
index 34f6753f61..0b1818d4e8 100644
--- a/tools/libacpi/mk_dsdt.c
+++ b/tools/libacpi/mk_dsdt.c
@@ -237,6 +237,11 @@ int main(int argc, char **argv)
     pop_block();
     /**** Processor end ****/
 #else
+    if (dm_version == QEMU_NONE) {
+        pop_block();
+        pop_block();
+        return 0;
+    }
 
     /* Operation Region 'PRST': bitmask of online CPUs. */
     stmt("OperationRegion", "PRST, SystemIO, %#x, %d",
@@ -285,10 +290,6 @@ int main(int argc, char **argv)
     pop_block();
     pop_block();
 
-    if (dm_version == QEMU_NONE) {
-        pop_block();
-        return 0;
-    }
     /**** Processor end ****/
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148071.1480211 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ8Z-0005Al-HZ; Wed, 22 Oct 2025 13:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148071.1480211; Wed, 22 Oct 2025 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 1vBZ8Z-0005Ad-Eq; Wed, 22 Oct 2025 13:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1148071;
 Wed, 22 Oct 2025 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 1vBZ8Y-0005AW-HR
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 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 1vBZ8Y-00EJbt-0z
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ8Y-008m5l-1W
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 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=8kdim0cCrwov0QfUjSBAgxoZw7TFxGYcwTMO0h28PR4=; b=K5Rl755ZeHAagCZKIS4sFTOkMF
	DRylKj5ndywdR915IEQ1v91PCY25BK4oFmTV2qijS56P2PDfuB5r9o8rAH+AQJiBCr53YaPuY/UTa
	uuQAkmy0kqoFypAOzS5l3uAOcnYrasL5UByss0wRWL5pSkQqLKcpukYu07VfgNPM12f8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
Message-Id: <E1vBZ8Y-008m5l-1W@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:44:22 +0000

commit 2c27742563d221144906a3c7cadd8839bdb61277
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:26:47 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:26:47 2025 +0200

    x86/cpu: populate CPUID 0x1.edx features early for self-snoop detection
    
    Otherwise the check for the SS feature in
    check_memory_type_self_snoop_errata() fails unconditionally, which leads to
    X86_FEATURE_XEN_SELFSNOOP never being set.
    
    We could also avoid this by not doing the reset_cpuinfo() for the BSP in
    identify_cpu(), because SS detection uses boot_cpu_data.  However that
    creates an imbalance on the state of the BSP versus the APs in the
    identify_cpu() code.
    
    I've opted for the less controversial solution of populating FEATURESET_1d
    in generic_identify(), as the value is already there.  The same is done for
    the AMD faulting probe code.  While there also populate the FEATURESET_1c
    element, as the value is in context.
    
    Fixes: f2663ca2e520 ("x86/cpu/intel: Clear cache self-snoop capability in CPUs with known errata")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 382dd0d166cb85139d86ff26fd96af102ae4fef3
    master date: 2025-09-25 16:07:05 +0200
---
 xen/arch/x86/cpu/common.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index d4d21da9c5..859df977a0 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -439,6 +439,13 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 
+	/*
+	 * Early init of Self Snoop support requires 0x1.edx, while there also
+	 * set 0x1.ecx as the value is in context.
+	 */
+	c->x86_capability[FEATURESET_1c] = ecx;
+	c->x86_capability[FEATURESET_1d] = edx;
+
 	eax = cpuid_eax(0x80000000);
 	if ((eax >> 16) == 0x8000)
 		c->extended_cpuid_level = eax;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148072.1480215 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ8j-0005DN-JL; Wed, 22 Oct 2025 13:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148072.1480215; Wed, 22 Oct 2025 13: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 1vBZ8j-0005DA-GR; Wed, 22 Oct 2025 13:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1148072;
 Wed, 22 Oct 2025 13: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 1vBZ8i-0005D1-KJ
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ8i-00EJbx-1I
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ8i-008m7o-1p
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=3Z5pJg+a9DScLQQiOIAElQkuF/ZLDakfqfAUENqKTLA=; b=eQp6h6TB2abLawfTv56aTJLCEd
	SbYzIO/R5gM30jnyeALe3uSjSBPLivTq1La2aM3UWwSjd2K5053umMw9itEf0nUzYadIuL3xNyhfp
	/8eDG8q2KvSDlKlItILUAzypYRm1dOfeI4803gmR+8euJzWh/VLZwtyfAtQ6DAKJ+itI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
Message-Id: <E1vBZ8i-008m7o-1p@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:44:32 +0000

commit 5dc4685d1327b273d2cacc63233b4da62932e27c
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:27:28 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:27:28 2025 +0200

    x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
    
    Reading from the E9 port if the emergency console is active should return
    0xe9 according to the documentation from Bochs:
    
    https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
    
    See `port_e9_hack` section description.
    
    Fix Xen so it also returns the port address.  OSes can use it to detect
    whether the emergency console is available or not.
    
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: db5a3c31a650d3fb0945f77f8ceda133412b5ce0
    master date: 2025-10-02 18:05:50 +0200
---
 xen/arch/x86/hvm/hvm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index fbca7e4949..7c5a5314ba 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -557,9 +557,15 @@ static int cf_check hvm_print_line(
 
     ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
 
-    /* Deny any input requests. */
-    if ( dir != IOREQ_WRITE )
-        return X86EMUL_UNHANDLEABLE;
+    if ( dir == IOREQ_READ )
+    {
+        /*
+         * According to Bochs documentation, reading from the E9 port should
+         * return 0xE9 if the "port E9 hack" is implemented.
+         */
+        *val = XEN_HVM_DEBUGCONS_IOPORT;
+        return X86EMUL_OKAY;
+    }
 
     /* Accept only printable characters, newline, and horizontal tab. */
     if ( !isprint(c) && (c != '\n') && (c != '\t') )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:44:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148073.1480218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ8t-0005FQ-Kg; Wed, 22 Oct 2025 13:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148073.1480218; Wed, 22 Oct 2025 13: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 1vBZ8t-0005FI-Ho; Wed, 22 Oct 2025 13:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1148073;
 Wed, 22 Oct 2025 13: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 1vBZ8s-0005FA-Nc
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ8s-00EJcL-1c
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ8s-008mAY-27
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=HZ8OSVZhcCfK/TGmOgTEbybTEMSdpTnNj6NIQoPuNhw=; b=FZmN8TZLcV0QiyUKG8zww2OAqS
	7uBWIpvkXimyOC+mEu2iejMLFFWpxgCUSlKUVsTpNm6ov/6A1ZNNERvg45Ha2MLDxtNX8WJhLnsQ3
	y/Qw+br14mcQDYcpvYK7YGZYY4aJ6HfK7G4c4q5ZxfmtP8UeHmCkftc+R6G5YacgKgTc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] vpci/msix: improve handling of bogus MSI-X capabilities
Message-Id: <E1vBZ8s-008mAY-27@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:44:42 +0000

commit 50b649c742722337ab6e324bfe838cd500871f4b
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 21 15:27:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:27:49 2025 +0200

    vpci/msix: improve handling of bogus MSI-X capabilities
    
    I've had the luck to come across a PCI card that exposes a MSI-X capability
    where the BIR of the vector and PBA tables points at a BAR that has 0 size.
    
    This doesn't play nice with the code in vpci_make_msix_hole(), as it would
    still use the address of such empty BAR (0) and attempt to carve a hole in
    the p2m.  This leads to errors like the one below being reported by Xen:
    
    d0v0 0000:22:00.0: existing mapping (mfn: 181c4300 type: 0) at 0 clobbers MSIX MMIO area
    
    And the device left unable to enable memory decoding due to the failure
    reported by vpci_make_msix_hole().
    
    Introduce checking in init_msix() to ensure the BARs containing the MSI-X
    tables are usable.  This requires checking that the BIR points to a
    non-empty BAR, and the offset and size of the MSI-X tables can fit in the
    target BAR.
    
    This fixes booting PVH dom0 on Supermicro AS -2126HS-TN servers with AMD
    EPYC 9965 processors.  The broken device is:
    
    22:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 93)
    
    There are multiple of those integrated controllers in the system, all
    broken in the same way.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: 53859596c0d34dbca776ec1e47bac8dd90552530
    master date: 2025-10-10 11:02:39 +0200
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/lib.h   |  3 +++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index fbe710ab92..7d6e691b36 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -17,6 +17,7 @@
  * License along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/vpci.h>
 
@@ -721,6 +722,51 @@ static int cf_check init_msix(struct pci_dev *pdev)
     if ( !msix )
         return -ENOMEM;
 
+    msix->tables[VPCI_MSIX_TABLE] =
+        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
+    msix->tables[VPCI_MSIX_PBA] =
+        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
+
+    /* Check that the referenced BAR(s) regions are valid. */
+    for ( i = 0; i < ARRAY_SIZE(msix->tables); i++ )
+    {
+        const char *name = (i == VPCI_MSIX_TABLE) ? "vector" : "PBA";
+        const struct vpci_bar *bars = pdev->vpci->header.bars;
+        unsigned int bir = msix->tables[i] & PCI_MSIX_BIRMASK;
+        unsigned int type;
+        unsigned int offset = msix->tables[i] & ~PCI_MSIX_BIRMASK;
+        unsigned int size =
+            (i == VPCI_MSIX_TABLE) ? max_entries * PCI_MSIX_ENTRY_SIZE
+                                   : ROUNDUP(DIV_ROUND_UP(max_entries, 8), 8);
+
+        if ( bir >= ARRAY_SIZE(pdev->vpci->header.bars) )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table with out of range BIR %u\n",
+                   &pdev->sbdf, name, bir);
+ invalid:
+            xfree(msix);
+            return -ENODEV;
+        }
+
+        type = bars[bir].type;
+        if ( type != VPCI_BAR_MEM32 && type != VPCI_BAR_MEM64_LO )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table at invalid BAR%u with type %u\n",
+                   &pdev->sbdf, name, bir, type);
+            goto invalid;
+        }
+
+        if ( (uint64_t)offset + size > bars[bir].size )
+        {
+            printk(XENLOG_ERR DEV_BUG_PREFIX
+                   "%pp: MSI-X %s table offset %#x size %#x outside of BAR%u size %#lx\n",
+                   &pdev->sbdf, name, offset, size, bir, bars[bir].size);
+            goto invalid;
+        }
+    }
+
     rc = vpci_add_register(pdev->vpci, control_read, control_write,
                            msix_control_reg(msix_offset), 2, msix);
     if ( rc )
@@ -732,11 +778,6 @@ static int cf_check init_msix(struct pci_dev *pdev)
     msix->max_entries = max_entries;
     msix->pdev = pdev;
 
-    msix->tables[VPCI_MSIX_TABLE] =
-        pci_conf_read32(pdev->sbdf, msix_table_offset_reg(msix_offset));
-    msix->tables[VPCI_MSIX_PBA] =
-        pci_conf_read32(pdev->sbdf, msix_pba_offset_reg(msix_offset));
-
     for ( i = 0; i < max_entries; i++)
     {
         msix->entries[i].masked = true;
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 544d45cb9d..f78cdafa2c 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -57,6 +57,9 @@ static inline void
 debugtrace_printk(const char *fmt, ...) {}
 #endif
 
+/* Common log prefixes for platform related issues. */
+#define DEV_BUG_PREFIX "DEVICE BUG: "
+
 /* Allows us to use '%p' as general-purpose machine-word format char. */
 #define _p(_x) ((void *)(unsigned long)(_x))
 extern void printk(const char *fmt, ...)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:44:53 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148074.1480222 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ93-0005Hw-ND; Wed, 22 Oct 2025 13:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148074.1480222; Wed, 22 Oct 2025 13: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 1vBZ93-0005Ho-Ka; Wed, 22 Oct 2025 13:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1148074;
 Wed, 22 Oct 2025 13: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 1vBZ92-0005Hi-SB
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ92-00EJcP-25
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ92-008mBk-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=zAIF2oGV0sqe8IwOTuAsnJvfCnDWmcKwgO+fVmVtivA=; b=xSQeyDKTUOjgtrzmXM18ByVKEc
	Ks2KJh0RdnJdQAWJhrQZ04UOgO4DmvC3nz7EArGwlxeJP/Dv5zGPZcmzrBrC2TBUyYxmsApCHoyFz
	n7cQtLdtkUKc2UZxaQgYBhWpPu7cr/Po28em2b+SAD6exOokW/VOTjXOe7SzJ0xARZWM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/HWP: adjust feature_hdc's section annotation
Message-Id: <E1vBZ92-008mBk-2S@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:44:52 +0000

commit 117df4219161acc8399d4bd696cf962c798cbd72
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:28:08 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:08 2025 +0200

    x86/HWP: adjust feature_hdc's section annotation
    
    The variable can be cleared (set to false) by a non-init function's error
    path (hwp_init_msrs()).
    
    Fixes: 99c4570f8209 ("cpufreq: Add Hardware P-State (HWP) driver")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    master commit: 4676e09b3c3b2750aef3d6ec7e43b632d4800ab9
    master date: 2025-10-13 10:41:35 +0200
---
 xen/arch/x86/acpi/cpufreq/hwp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 59b57a4cef..1380989f30 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -17,7 +17,7 @@ static bool __ro_after_init hwp_in_use;
 static bool __ro_after_init feature_hwp_notification;
 static bool __ro_after_init feature_hwp_activity_window;
 
-static bool __ro_after_init feature_hdc;
+static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:45:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148075.1480226 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ9E-0005KA-Oq; Wed, 22 Oct 2025 13:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148075.1480226; Wed, 22 Oct 2025 13: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 1vBZ9E-0005K2-M5; Wed, 22 Oct 2025 13:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1148075;
 Wed, 22 Oct 2025 13: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 1vBZ9D-0005Ju-2c
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ9C-00EJcr-2Z
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ9C-008mCs-2u
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=erZsVJLZN69Qd1treuxkP0WZthvR+xJib9+uAtfIt2I=; b=ERdK8kJtSbm/YVHKSm4klYB/Nn
	31IyT9qWkgKbyGDfmMmHyBSJNQQpXOaUXgRbCf2KwiB7vTSH+G/Ormsa669rfDwU2iGJ/BnnpA351
	FCtkXCAMhTqOLz3hrYWD7xs4/s9lvbUkA6vuSlO82CevedksdWT2oXIUeRf39rEv/Pqg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] VT-d: check bus_to_context_maddr()'s return value
Message-Id: <E1vBZ9C-008mCs-2u@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:45:02 +0000

commit de5a58a22ef3e7a9660f7a8cdc7f9ba48960399a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 21 15:28:19 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:19 2025 +0200

    VT-d: check bus_to_context_maddr()'s return value
    
    The function returning zero is an error indication; we shouldn't try to
    map MFN 0 and then treat that page as a context table.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef5b718cf81a2448118b86b86777f9430739445d
    master date: 2025-10-13 16:50:01 +0200
---
 xen/drivers/passthrough/vtd/iommu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index f28de36458..1013475f7f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1495,6 +1495,11 @@ int domain_context_mapping_one(
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        spin_unlock(&iommu->lock);
+        return -ENOMEM;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
     old = (lctxt = *context).full;
@@ -1887,6 +1892,12 @@ int domain_context_unmap_one(
     spin_lock(&iommu->lock);
 
     maddr = bus_to_context_maddr(iommu, bus);
+    if ( !maddr )
+    {
+        ASSERT_UNREACHABLE();
+        spin_unlock(&iommu->lock);
+        return 0;
+    }
     context_entries = (struct context_entry *)map_vtd_domain_page(maddr);
     context = &context_entries[devfn];
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:45:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148076.1480232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ9O-0005MJ-Qe; Wed, 22 Oct 2025 13:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148076.1480232; Wed, 22 Oct 2025 13: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 1vBZ9O-0005M9-NX; Wed, 22 Oct 2025 13:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1148076;
 Wed, 22 Oct 2025 13: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 1vBZ9N-0005M1-3K
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ9M-00EJd1-2o
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ9N-008mEQ-0A
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=Ik/Ur3GzWDkhA5WZhq9QzjuMzLCctcVrrAZc4mlru0o=; b=jjh4vKmUlbiSynG2TiNPjoIn5a
	kENGV/TiLS9q5ixnuzONil1V6a3CfJnFYEUs7ou4sOoH2h61SVJYwmRNFFMRd8OkuSG67tcVFlUxO
	kXVVeUit5zEhqCtL1YFUBv33sipFVxHFTT5+vAGQjehed6OXi+gvBa8gU/ZQQrRDY5bs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/boot: Fix edd=off to skip mbr
Message-Id: <E1vBZ9N-008mEQ-0A@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:45:13 +0000

commit 67b8f4622131c38885720db6b8c3d6b64875f623
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Oct 21 15:28:31 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:31 2025 +0200

    x86/boot: Fix edd=off to skip mbr
    
    When the fixes commit re-arranged the code, it made edd=off jump to the
    mbr code instead of returning from the function.  Previously edd_done
    was immediately before ret and skipped the MBR check.
    
    Replace edd_done with .Ledd_mbr_sig for the start of the MBR checking,
    and replace .Ledd_mbr_sig_skip with .Ledd_done to exit from the function.
    
    edd=off jumps to .Ledd_done to return from the function, and internal
    jumps go to .Ledd_mbr_sig to check edd=skipmbr.
    
    Fixes: 5ec164fd61bd ("x86/boot: re-arrange how/when we do disk I/O")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 02e656f7c8fd63828307a4eac633958d82b36116
    master date: 2025-10-16 10:25:27 +0200
---
 xen/arch/x86/boot/edd.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 3df712bce1..02437511b2 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -25,7 +25,7 @@
 
 get_edd:
         cmpb    $2, bootsym(opt_edd)            # edd=off ?
-        je      edd_done
+        je      .Ledd_done
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
@@ -48,7 +48,7 @@ edd_check_ext:
         movb    $0x41, %ah                      # 0x41 Check Extensions Present
         movw    $0x55AA, %bx                    # magic
         int     $0x13                           # make the call
-        jc      edd_done                        # no more BIOS devices
+        jc      .Ledd_mbr_sig                   # no more BIOS devices
 
         cmpw    $0xAA55, %bx                    # is magic right?
         jne     edd_next                        # nope, next...
@@ -96,13 +96,13 @@ edd_legacy_done:
 
 edd_next:
         incb    %dl                             # increment to next device
-        jz      edd_done
+        jz      .Ledd_mbr_sig
         cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
         jb      edd_check_ext
 
-edd_done:
+.Ledd_mbr_sig:
         cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
-        je      .Ledd_mbr_sig_skip
+        je      .Ledd_done
 
 # Read the first sector of each BIOS disk device and store the 4-byte signature
 .Ledd_mbr_sig_start:
@@ -160,7 +160,7 @@ edd_done:
         jb      .Ledd_mbr_sig_read
 .Ledd_mbr_sig_done:
         popw    %es
-.Ledd_mbr_sig_skip:
+.Ledd_done:
         ret
 
 GLOBAL(boot_edd_info_nr)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:45:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148077.1480235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ9Y-0005OQ-RV; Wed, 22 Oct 2025 13:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148077.1480235; Wed, 22 Oct 2025 13: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 1vBZ9Y-0005OI-Ot; Wed, 22 Oct 2025 13:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1148077;
 Wed, 22 Oct 2025 13: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 1vBZ9X-0005OA-7x
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ9W-00EJd8-34
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ9X-008mFr-0P
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=Ou5uXPyzgGj1KGAm4a1aXhEIf/8l+n//h5dliiFfM2U=; b=Kz9ksfVd9qK3ahZqOM/hJqhfks
	66lm+rr+hgCJqqWt2BrsRVyT8keVZJFnaN9n7PCwnpXjGtuATCmlESkPfKufpfcQp3CXp8Dwsgda8
	P69tiRcxpbDK+6Y3YUsrTwyIC1us6IUMNLCbdhO+4wca3V9AqHtBbM0bIvqA3gOcV3JM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/viridian: Enforce bounds check in vpmask_set()
Message-Id: <E1vBZ9X-008mFr-0P@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:45:23 +0000

commit 965fdf7b4278392c35888c4949a98d7cc650280d
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:28:49 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:28:49 2025 +0200

    x86/viridian: Enforce bounds check in vpmask_set()
    
    Callers can pass vp/mask values which exceed the size of vpmask->mask.  Ensure
    we only set bits which are within bounds.
    
    This is XSA-475 / CVE-2025-58147.
    
    Fixes: b4124682db6e ("viridian: add ExProcessorMasks variants of the flush hypercalls")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 36e90c4ef1f2667dc8159c634fb00d393fc2d857
    master date: 2025-10-21 14:09:37 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index a41a70e37a..41e93ef20f 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -562,7 +562,8 @@ static void vpmask_set(struct hypercall_vpmask *vpmask, unsigned int vp,
 
         if ( mask & 1 )
         {
-            ASSERT(vp < HVM_MAX_VCPUS);
+            if ( vp >= HVM_MAX_VCPUS )
+                break;
             __set_bit(vp, vpmask->mask);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:45:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148078.1480239 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ9i-0005Qi-Sx; Wed, 22 Oct 2025 13:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148078.1480239; Wed, 22 Oct 2025 13:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ9i-0005Qa-QM; Wed, 22 Oct 2025 13:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1148078;
 Wed, 22 Oct 2025 13: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 1vBZ9h-0005QS-8O
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ9h-00EJdD-07
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ9h-008mGu-0f
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=icr+1/pbH54UyeV7q8e/cvNXFZ758m/8w/K06CqNO1g=; b=gp9//BAi0s/9KSjF+Eulz5CFlw
	JlQLuUjmnXaxSl0s00CvaHz+B9v8WBHBoYRqbo7ImrLM6+NdSCELLu4TjkGpbh0jT8ZbSVdFGi/6Y
	EtqBHmZwKyAFfU680ER5Zm1AMvJ0G0xTBOFvukXC0mq8QnFdNu56o5h3zjBod2xgAiiA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/viridian: Enforce bounds check in send_ipi()
Message-Id: <E1vBZ9h-008mGu-0f@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:45:33 +0000

commit 5177ae067243dad9d1146f39f7a73b3ec4abb75c
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Oct 21 15:29:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 21 15:29:01 2025 +0200

    x86/viridian: Enforce bounds check in send_ipi()
    
    Callers can pass in a vpmask which exceeds d->max_vcpus.  Prevent out-of-bound
    reads of d->vcpu[].
    
    This is XSA-475 / CVE-2025-58148.
    
    Fixes: 728acba1ba4a ("viridian: use hypercall_vpmask in hvcall_ipi()")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cc64c245023c3ff8e388c1c96aed3faed6fd00cb
    master date: 2025-10-21 14:10:13 +0200
---
 xen/arch/x86/hvm/viridian/viridian.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 41e93ef20f..d45751365f 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -577,26 +577,6 @@ static void vpmask_fill(struct hypercall_vpmask *vpmask)
     bitmap_fill(vpmask->mask, HVM_MAX_VCPUS);
 }
 
-static unsigned int vpmask_first(const struct hypercall_vpmask *vpmask)
-{
-    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
-}
-
-static unsigned int vpmask_next(const struct hypercall_vpmask *vpmask,
-                                unsigned int vp)
-{
-    /*
-     * If vp + 1 > HVM_MAX_VCPUS then find_next_bit() will return
-     * HVM_MAX_VCPUS, ensuring the for_each_vp ( ... ) loop terminates.
-     */
-    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
-}
-
-#define for_each_vp(vpmask, vp) \
-	for ( (vp) = vpmask_first(vpmask); \
-	      (vp) < HVM_MAX_VCPUS; \
-	      (vp) = vpmask_next(vpmask, vp) )
-
 static unsigned int vpmask_nr(const struct hypercall_vpmask *vpmask)
 {
     return bitmap_weight(vpmask->mask, HVM_MAX_VCPUS);
@@ -813,7 +793,7 @@ static void send_ipi(struct hypercall_vpmask *vpmask, uint8_t vector)
     if ( nr > 1 )
         cpu_raise_softirq_batch_begin();
 
-    for_each_vp ( vpmask, vp )
+    for_each_set_bit ( vp, vpmask->mask, currd->max_vcpus )
     {
         struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 22 13:45:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Oct 2025 13:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1148079.1480243 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ9s-0005St-UD; Wed, 22 Oct 2025 13:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1148079.1480243; Wed, 22 Oct 2025 13:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vBZ9s-0005Sl-Rh; Wed, 22 Oct 2025 13:45:44 +0000
Received: by outflank-mailman (input) for mailman id 1148079;
 Wed, 22 Oct 2025 13: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 1vBZ9r-0005Sd-BL
 for xen-changelog@lists.xenproject.org; Wed, 22 Oct 2025 13: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 1vBZ9r-00EJdg-0O
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vBZ9r-008mHn-0w
 for xen-changelog@lists.xenproject.org;
 Wed, 22 Oct 2025 13: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=qeIIDSf+BVEqlvcDOc2Omp9EzGzjS6oLvimm2uFhksw=; b=vVmJLlGQvDn1yV4XvTvBAJ3OS2
	EjZ3Sf+ouE0udt5/Ezv98W9FuFiVSbpeNgEVSdeKTO2o5sMeyfovfyL27BXMiLUnaG5YuUEkhrwNY
	Cqwu1GUv9zz81dJggnxg6TI5Uq0vRbCfZ7bqcqa5cYiVOWK14borsSucqLHtadsU5SRk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/vpci: fix backport of 53859596c0d3
Message-Id: <E1vBZ9r-008mHn-0w@xenbits.xenproject.org>
Date: Wed, 22 Oct 2025 13:45:43 +0000

commit 8a62bb04e27fe1e3e59d6551df5452c4e27683bd
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Oct 22 13:44:01 2025 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 22 13:44:01 2025 +0200

    xen/vpci: fix backport of 53859596c0d3
    
    Commit 53859596c0d3 depends on the behavioral change introduced in
    ee2eb6849d50 that inverted the initialization of the MSI-X and header vPCI
    handlers.  53859596c0d3 requires the header to be initialized before MSI-X.
    
    Change the order of initialization and adjust init_msix() to carve holes
    for the MSI-X tables if necessary, since it will now run after the BARs
    have been possibly mapped into the domain p2m.
    
    Fixes: 50b649c74272 ("vpci/msix: improve handling of bogus MSI-X capabilities")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/vpci/header.c | 2 +-
 xen/drivers/vpci/msix.c   | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 1f48f2aac6..b002eb2072 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -1016,7 +1016,7 @@ static int cf_check init_header(struct pci_dev *pdev)
     pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
     return rc;
 }
-REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_MIDDLE);
+REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_HIGH);
 
 /*
  * Local variables:
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 7d6e691b36..140f5ab284 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -790,9 +790,14 @@ static int cf_check init_msix(struct pci_dev *pdev)
     pdev->vpci->msix = msix;
     list_add(&msix->next, &d->arch.hvm.msix_tables);
 
-    return 0;
+    /*
+     * vPCI header initialization will have mapped the whole BAR into the
+     * p2m, as MSI-X capability was not yet initialized.  Crave a hole for
+     * the MSI-X table here, so that Xen can trap accesses.
+     */
+    return vpci_make_msix_hole(pdev);
 }
-REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_HIGH);
+REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_MIDDLE);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 12:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 12:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150275.1481470 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGye-0005RA-BZ; Fri, 24 Oct 2025 12:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150275.1481470; Fri, 24 Oct 2025 12:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGye-0005R2-8r; Fri, 24 Oct 2025 12:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1150275;
 Fri, 24 Oct 2025 12: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 1vCGyc-0005Qw-EI
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 12: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 1vCGyc-00HRdm-0V
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCGyc-00ER76-10
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12: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=NiuNI9hmGXAsYtzTuoiF4iQwfO2X3g/yDVyxJ0MqOWk=; b=4i14yyLU18qpB+z3UOwG7W1YNc
	jh1alGaBANNbIOv4ltnkJr6H0TJ2ynjVwGxlHX+2jNd6kZq+SNRrcMJR1tcT0mXy7GBjahK4REzuQ
	wv3ybsCYkUUfyJwVSHA3IPEvrt+vjYj0gaBFYl4+CBSlupI8uX9LZcpXQe++NoyP9E1A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCGyc-00ER76-10@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 12:33:02 +0000

commit 421432b822184f990cd9ef157bbc2a24cfe96727
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:21:35 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_pci.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 2ea2caeb66..49d272d0de 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2001,7 +2001,8 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0, irq = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
+    unsigned int irq = 0;
     int i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2031,7 +2032,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2040,7 +2042,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2050,7 +2052,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 12:33:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 12:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150276.1481474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGyo-0005Sx-Cn; Fri, 24 Oct 2025 12:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150276.1481474; Fri, 24 Oct 2025 12:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGyo-0005Sp-AF; Fri, 24 Oct 2025 12:33:14 +0000
Received: by outflank-mailman (input) for mailman id 1150276;
 Fri, 24 Oct 2025 12: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 1vCGym-0005Sc-Kt
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 12: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 1vCGym-00HRdq-1L
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCGym-00ER8l-1s
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cPDZCyTxtEdSAVUtpCNOvKKhiOiw+pEeBddvc/2DgEY=; b=abkWAzF4TSCUZfsbKHoy0169io
	2QyqAl9K6bgo1o3Pf8N03KwDNDpg7aMlX4J0gT9irszwSRayQArMNDXpdnZDvP6AeU2KvRB1Aykhp
	TA9Uw0FuprzNV0zNCuA4NZQkk8p8PHAfQn42kyUWRVWubylq9kfF+YnEMTqiEinQREds=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCGym-00ER8l-1s@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 12:33:12 +0000

commit ff9de4517afc8a998f5d4d950418ecf0d18fa23c
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:22:41 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 1647fd6f47..7af602224a 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2179,7 +2179,7 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
     int  irq = 0, i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2209,7 +2209,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2218,7 +2219,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2228,7 +2229,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 12:33:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 12:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150277.1481479 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGyy-0005V3-ER; Fri, 24 Oct 2025 12:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150277.1481479; Fri, 24 Oct 2025 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGyy-0005Ur-BY; Fri, 24 Oct 2025 12:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1150277;
 Fri, 24 Oct 2025 12: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 1vCGyw-0005Ub-TU
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 12: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 1vCGyw-00HReB-2C
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCGyw-00ERAW-2j
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zX9wb0BuzCZSXRa3qlRgwJA4fFcx/kYkLxI+vLNV7Ys=; b=xda4iKNfFtw6DlFvMj92E2PK5q
	wFDSZMz0+ZeS1nCDFTk27gC/2ZoM7nAE3gR2cDt+riVF/ES+206/4jpghiWBxRl9/XJB7kUSDaxzo
	Q/NwPxNsNW4ETG/8mv0jbOgfqO7SZl7OljCNHh0e5tPqr2kGrElVLvVC8cUp69XFiM+o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCGyw-00ERAW-2j@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 12:33:22 +0000

commit 20cda53ff1453d1029dc0ebdd1e873674c637d76
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:22:55 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 96cb4da079..729d3b4c63 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2168,7 +2168,7 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
     int  irq = 0, i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2198,7 +2198,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2207,7 +2208,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2217,7 +2218,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 12:33:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 12:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150278.1481481 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGz8-0005XE-FP; Fri, 24 Oct 2025 12:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150278.1481481; Fri, 24 Oct 2025 12: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 1vCGz8-0005X6-Cu; Fri, 24 Oct 2025 12:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1150278;
 Fri, 24 Oct 2025 12: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 1vCGz7-0005Wx-62
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 12: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 1vCGz6-00HReH-35
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCGz7-00ERGO-0O
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bbALtIK+hYg1cue3cp8IXC5flmo8zwp8RIqsAPMAdMA=; b=5EDaLi5TzzKCKzW/3HeEHAs7Ut
	l0mXg+gAreKJrq3Ar4kCSY7ZoMOvzFwUzCjX5tEqHJi44MozWklFue93OHMTrgoXs/rOkYNbyefAc
	klDFDMRsPmrxWHw9crD1n7Ekc6e5JHon9TIWh6hxrOI/GlCV3Jy05awGvP45HRXnQFK8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCGz7-00ERGO-0O@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 12:33:33 +0000

commit 832ecbff8ec4cfbf39632a23b60db85dae4cfab9
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:23:01 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 96cb4da079..729d3b4c63 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2168,7 +2168,7 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
     int  irq = 0, i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2198,7 +2198,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2207,7 +2208,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2217,7 +2218,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 12:33:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 12:33:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150279.1481486 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGzJ-0005ZV-Gp; Fri, 24 Oct 2025 12:33:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150279.1481486; Fri, 24 Oct 2025 12:33:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCGzJ-0005ZN-EH; Fri, 24 Oct 2025 12:33:45 +0000
Received: by outflank-mailman (input) for mailman id 1150279;
 Fri, 24 Oct 2025 12: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 1vCGzH-0005ZF-ER
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 12: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 1vCGzH-00HReL-0h
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCGzH-00ERIL-1E
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 12: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=ctTh0mk2SW+RD8P/ETdDIYwDxbj8IkjbF3UUvo1Q9Q8=; b=5LzP6g6VL3ziWKr2PWhrbpIJLB
	xQDa8ZAcqgu+acuOsj1UA+04IPjEP9Z4dXhDFri6iNJ8wz9n32gH0WzKmwOBwaI1izQKyhTN8vFev
	cXszals7CapQCzS6XYGqjNZLkY0ZMrWu8wH21VS4D0vS+/l1RT9P8n8FJKYtl1XDm+pA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCGzH-00ERIL-1E@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 12:33:43 +0000

commit 14b0ce576874031d17959cf1df65917d6e838523
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:23:34 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:23:46 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index f4c4f17545..37e2e26247 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -1995,7 +1995,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
         char *sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pci->domain,
                                      pci->bus, pci->dev, pci->func);
         FILE *f = fopen(sysfs_path, "r");
-        unsigned int start = 0, end = 0, flags = 0, size = 0;
+        uint64_t start = 0, end = 0, flags = 0, size = 0;
         int irq = 0;
         int i;
 
@@ -2004,7 +2004,8 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
             goto skip1;
         }
         for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-            if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+            if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                       &start, &end, &flags) != 3)
                 continue;
             size = end - start + 1;
             if (start) {
@@ -2012,7 +2013,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
                     rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 0);
                     if (rc < 0)
                         LOGED(ERROR, domainid,
-                              "xc_domain_ioport_permission error 0x%x/0x%x",
+                              "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                               start,
                               size);
                 } else {
@@ -2020,7 +2021,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
                                                     (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 0);
                     if (rc < 0)
                         LOGED(ERROR, domainid,
-                              "xc_domain_iomem_permission error 0x%x/0x%x",
+                              "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                               start,
                               size);
                 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 13:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 13:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150381.1481540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCI5L-0000WL-Gx; Fri, 24 Oct 2025 13:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150381.1481540; Fri, 24 Oct 2025 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 1vCI5L-0000WC-E4; Fri, 24 Oct 2025 13:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1150381;
 Fri, 24 Oct 2025 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 1vCI5K-0000W6-Ba
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 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 1vCI5K-00HStF-09
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCI5K-00EbDN-0V
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 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=iKCIhlkiCL5AwZNSbo294ijXVW0RS1lySLCUk8qYizQ=; b=PtQ1xuSUiAkZfS89y94yMVf5Mg
	0JiM7R3dGQkhnn/S2xnicaguNVQzlFYknxqB0+oyhvl7LQb1umybZvwFAxkmKO3Alt8mGn2stE4CQ
	X3WfeFEU5LngBXYGNR5VoLIKeNRi69u2BfrvGL8WuZJM4FDM2fZZ0QVVEEUYWUP+aVro=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCI5K-00EbDN-0V@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 13:44:02 +0000

commit 14b0ce576874031d17959cf1df65917d6e838523
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:23:34 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:23:46 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index f4c4f17545..37e2e26247 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -1995,7 +1995,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
         char *sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pci->domain,
                                      pci->bus, pci->dev, pci->func);
         FILE *f = fopen(sysfs_path, "r");
-        unsigned int start = 0, end = 0, flags = 0, size = 0;
+        uint64_t start = 0, end = 0, flags = 0, size = 0;
         int irq = 0;
         int i;
 
@@ -2004,7 +2004,8 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
             goto skip1;
         }
         for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-            if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+            if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                       &start, &end, &flags) != 3)
                 continue;
             size = end - start + 1;
             if (start) {
@@ -2012,7 +2013,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
                     rc = xc_domain_ioport_permission(ctx->xch, domid, start, size, 0);
                     if (rc < 0)
                         LOGED(ERROR, domainid,
-                              "xc_domain_ioport_permission error 0x%x/0x%x",
+                              "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                               start,
                               size);
                 } else {
@@ -2020,7 +2021,7 @@ static void do_pci_remove(libxl__egc *egc, pci_remove_state *prs)
                                                     (size+(XC_PAGE_SIZE-1))>>XC_PAGE_SHIFT, 0);
                     if (rc < 0)
                         LOGED(ERROR, domainid,
-                              "xc_domain_iomem_permission error 0x%x/0x%x",
+                              "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                               start,
                               size);
                 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 18:33:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 18:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150785.1481787 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCMb1-0008ON-Iz; Fri, 24 Oct 2025 18:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150785.1481787; Fri, 24 Oct 2025 18: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 1vCMb1-0008OE-Fd; Fri, 24 Oct 2025 18:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1150785;
 Fri, 24 Oct 2025 18: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 1vCMb0-0008O8-9B
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 18: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 1vCMb0-00HYvy-03
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 18:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCMb0-00FHeu-0X
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 18: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=eXI3cC5CelYRRXoQcuh+Bxi2bvgPFDERbll/fSlSu0o=; b=w/VQA6vXl9LYsQUaY1Ue+iv9tm
	wGK/ErPD7hZ/cdGK4Gavlm7r7YKUYA4tnTEwd3ZVPzKNT4eaA0qg3oAf45XdmkvngR6A/nF/yXrjz
	B1hNwr9Pxo2NYumjw4NvJf7FW6F9alfDwBWvrCVn91giqi5tksJ/6sCovYuhVCs1eMs8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCMb0-00FHeu-0X@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 18:33:02 +0000

commit 832ecbff8ec4cfbf39632a23b60db85dae4cfab9
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:23:01 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 96cb4da079..729d3b4c63 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2168,7 +2168,7 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
     int  irq = 0, i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2198,7 +2198,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2207,7 +2208,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2217,7 +2218,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Fri Oct 24 20:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Oct 2025 20:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1150885.1481840 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCO7r-0006hw-I7; Fri, 24 Oct 2025 20:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1150885.1481840; Fri, 24 Oct 2025 20:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vCO7r-0006ho-FY; Fri, 24 Oct 2025 20:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1150885;
 Fri, 24 Oct 2025 20: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 1vCO7p-0006hg-NR
 for xen-changelog@lists.xenproject.org; Fri, 24 Oct 2025 20: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 1vCO7p-00Haip-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 20:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vCO7p-00FUVU-1z
 for xen-changelog@lists.xenproject.org;
 Fri, 24 Oct 2025 20: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=ooWlB3JY2MHvz5/XUe4jKunYgaUA23RYYH4tMmrx7T4=; b=MTMYwxfpRUwLVoQHbQgd0kNJqU
	O4sJgzfoxJ7seqCl71XVciKRvmOI7e245VkqepAYPQpCvN82RJX25jCP0hukW9SMMiO74Jb+E19EY
	ArVmLxsEEuafAEO8zIZzjNReQ8vi7MgwqrZ3o0+GGTXFMxthNG0twlpHncyZNvIeK5nk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vCO7p-00FUVU-1z@xenbits.xenproject.org>
Date: Fri, 24 Oct 2025 20:11:01 +0000

commit 421432b822184f990cd9ef157bbc2a24cfe96727
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:21:35 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_pci.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 2ea2caeb66..49d272d0de 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2001,7 +2001,8 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0, irq = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
+    unsigned int irq = 0;
     int i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2031,7 +2032,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2040,7 +2042,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2050,7 +2052,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 09:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 09:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151484.1482012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDJli-00037G-Um; Mon, 27 Oct 2025 09:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151484.1482012; Mon, 27 Oct 2025 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 1vDJli-000378-Qm; Mon, 27 Oct 2025 09:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1151484;
 Mon, 27 Oct 2025 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 1vDJlh-00036w-JW
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 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 1vDJlh-004e5Q-16
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 09:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDJlh-005XmX-1O
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 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=ttPFszKmq69kok7G8AZOS8O3TD0MGX6fol0x8C3KshE=; b=afXSb+jruwnqShF3Jt6jRNsb/2
	zYv766yp/KCW6sGlRvdsDx1zJ5sCR0NKcvIqVR/2NT61cAWvENMZ6kCjKZ8TdarI18Jq7hT1LS3pO
	E/48WAlJGBaz7GR4NmMkAd/wP5f1PffuJdm0TCB4zQlkazO3XzBvOuO2klVQP+wNodRc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: require at least json-c 0.15
Message-Id: <E1vDJlh-005XmX-1O@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 09:44:01 +0000

commit 4b8a10e18692a6f99f04b2f30efe9a16e1ad50a9
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Thu Oct 23 10:57:30 2025 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Oct 27 10:36:20 2025 +0100

    tools: require at least json-c 0.15
    
    If not available, fallback to using YAJL.
    
    The code is using json_c_visit() which was introduced in 0.13.
    json_object_new_null() and json_object_new_uint64() where added to
    0.14. And the last one json_object_new_array_ext() was introduced in
    0.15.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 CHANGELOG.md       |  4 ++--
 README             |  3 ++-
 tools/configure    | 16 ++++++++--------
 tools/configure.ac |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0cf9ad2d95..fc4f6d7c8a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,8 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - Debian Trixie added to CI.  Debian Bullseye retired from CI for RISC-V due
    to the baseline change.
  - Linux based device model stubdomains are now fully supported.
- - New dependency on library json-c, the toolstack will prefer it to `YAJL`
-   when available.
+ - New dependency on library json-c 0.15 or later, the toolstack will prefer it
+   to `YAJL` when available.
 
  - On x86:
    - Restrict the cache flushing done as a result of guest physical memory map
diff --git a/README b/README
index eaee78bd73..53a4d5c2ae 100644
--- a/README
+++ b/README
@@ -53,7 +53,8 @@ provided by your OS distributor:
     * Development install of Python 2.7 or later (e.g., python-dev)
     * Development install of curses (e.g., libncurses-dev)
     * Development install of uuid (e.g. uuid-dev)
-    * Development install of json-c (e.g. libjson-c-dev) or yajl (e.g. libyajl-dev)
+    * Development install of json-c 0.15 or later (e.g. libjson-c-dev)
+      or yajl (e.g. libyajl-dev)
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
diff --git a/tools/configure b/tools/configure
index 0eb7a0ab6a..d460f25529 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9642,12 +9642,12 @@ if test -n "$libjsonc_CFLAGS"; then
     pkg_cv_libjsonc_CFLAGS="$libjsonc_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c >= 0.15\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c >= 0.15") 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null`
+  pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c >= 0.15" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -9659,12 +9659,12 @@ if test -n "$libjsonc_LIBS"; then
     pkg_cv_libjsonc_LIBS="$libjsonc_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c >= 0.15\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c >= 0.15") 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null`
+  pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c >= 0.15" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -9685,9 +9685,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1`
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c >= 0.15" 2>&1`
         else
-	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1`
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c >= 0.15" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$libjsonc_PKG_ERRORS" >&5
diff --git a/tools/configure.ac b/tools/configure.ac
index 7267d02a04..285b4ea128 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -424,7 +424,7 @@ AC_SUBST([ZLIB_CFLAGS])
 AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
-PKG_CHECK_MODULES([libjsonc], [json-c],
+PKG_CHECK_MODULES([libjsonc], [json-c >= 0.15],
     [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])],
     [AC_CHECK_LIB([yajl], [yajl_alloc],
         [AC_SUBST([YAJL_LIBS],[-lyajl])
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 10:33:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 10:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151505.1482034 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDKX9-00035t-Ld; Mon, 27 Oct 2025 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151505.1482034; Mon, 27 Oct 2025 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 1vDKX9-00035m-J2; Mon, 27 Oct 2025 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1151505;
 Mon, 27 Oct 2025 10: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 1vDKX7-00035e-TG
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 10: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 1vDKX7-004f0r-1p
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 10:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDKX7-005dc3-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 10:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2NoaTmbHuDHd2baJERFLOPC7S4nqIwrOpGsHAsxjKqY=; b=AfmP5O8Vmknnolr2pMLWUmvAiJ
	ZqEOaa3TTmpvJS3h/It0j+hODcBo1EnHib6AFL/5Bwnb5XKEGECe6uEtf8j2YlwPLh2pXcMYPmOwU
	f9CS71fWp5/73o0cr9vyVJpympw1cL5AB9An3wUwQRNA1F9gmlb/xvsUgp0leDYVY53A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: require at least json-c 0.15
Message-Id: <E1vDKX7-005dc3-2J@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 10:33:01 +0000

commit 4b8a10e18692a6f99f04b2f30efe9a16e1ad50a9
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Thu Oct 23 10:57:30 2025 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Oct 27 10:36:20 2025 +0100

    tools: require at least json-c 0.15
    
    If not available, fallback to using YAJL.
    
    The code is using json_c_visit() which was introduced in 0.13.
    json_object_new_null() and json_object_new_uint64() where added to
    0.14. And the last one json_object_new_array_ext() was introduced in
    0.15.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 CHANGELOG.md       |  4 ++--
 README             |  3 ++-
 tools/configure    | 16 ++++++++--------
 tools/configure.ac |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0cf9ad2d95..fc4f6d7c8a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,8 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - Debian Trixie added to CI.  Debian Bullseye retired from CI for RISC-V due
    to the baseline change.
  - Linux based device model stubdomains are now fully supported.
- - New dependency on library json-c, the toolstack will prefer it to `YAJL`
-   when available.
+ - New dependency on library json-c 0.15 or later, the toolstack will prefer it
+   to `YAJL` when available.
 
  - On x86:
    - Restrict the cache flushing done as a result of guest physical memory map
diff --git a/README b/README
index eaee78bd73..53a4d5c2ae 100644
--- a/README
+++ b/README
@@ -53,7 +53,8 @@ provided by your OS distributor:
     * Development install of Python 2.7 or later (e.g., python-dev)
     * Development install of curses (e.g., libncurses-dev)
     * Development install of uuid (e.g. uuid-dev)
-    * Development install of json-c (e.g. libjson-c-dev) or yajl (e.g. libyajl-dev)
+    * Development install of json-c 0.15 or later (e.g. libjson-c-dev)
+      or yajl (e.g. libyajl-dev)
     * Development install of libaio (e.g. libaio-dev) version 0.3.107 or
       greater.
     * Development install of GLib v2.0 (e.g. libglib2.0-dev)
diff --git a/tools/configure b/tools/configure
index 0eb7a0ab6a..d460f25529 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9642,12 +9642,12 @@ if test -n "$libjsonc_CFLAGS"; then
     pkg_cv_libjsonc_CFLAGS="$libjsonc_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c >= 0.15\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c >= 0.15") 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null`
+  pkg_cv_libjsonc_CFLAGS=`$PKG_CONFIG --cflags "json-c >= 0.15" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -9659,12 +9659,12 @@ if test -n "$libjsonc_LIBS"; then
     pkg_cv_libjsonc_LIBS="$libjsonc_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c >= 0.15\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "json-c >= 0.15") 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null`
+  pkg_cv_libjsonc_LIBS=`$PKG_CONFIG --libs "json-c >= 0.15" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -9685,9 +9685,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1`
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c >= 0.15" 2>&1`
         else
-	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1`
+	        libjsonc_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c >= 0.15" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$libjsonc_PKG_ERRORS" >&5
diff --git a/tools/configure.ac b/tools/configure.ac
index 7267d02a04..285b4ea128 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -424,7 +424,7 @@ AC_SUBST([ZLIB_CFLAGS])
 AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
 AX_CHECK_PTHREAD
-PKG_CHECK_MODULES([libjsonc], [json-c],
+PKG_CHECK_MODULES([libjsonc], [json-c >= 0.15],
     [AC_DEFINE([HAVE_LIBJSONC], [1], [Use library json-c])],
     [AC_CHECK_LIB([yajl], [yajl_alloc],
         [AC_SUBST([YAJL_LIBS],[-lyajl])
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 14:44:09 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 14:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151653.1482173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDOS3-00078T-HN; Mon, 27 Oct 2025 14:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151653.1482173; Mon, 27 Oct 2025 14:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDOS3-00078L-Ei; Mon, 27 Oct 2025 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1151653;
 Mon, 27 Oct 2025 14: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 1vDOS1-00078C-Sf
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 14: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 1vDOS1-004jhH-1z
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 14:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDOS1-006AFC-2S
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 14: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=dkTeAWv2UR4yTEqfo5+qw5qH0aGF6avruXrK46MVECI=; b=cz7JdRvbpfLhCi/Sgqme9wQf7v
	lSq6YMU5FMpICcJUUxyUw1I7Y/OhBmw2FPmxjJrKSEhFG8BRyuYTVu2XMxl3Ed8fnI3Z/VTy7BxWH
	K8C6MGiomxIIJtNgHO9gp9TN8WdONwRV9ptFNna1SD5P2fbxQ6pVOBFoqVBAfcJFwDqI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] automation/eclair: Make report browsing URL configurable.
Message-Id: <E1vDOS1-006AFC-2S@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 14:44:01 +0000

commit 3324a6dbb25bb2975c35f4f2b20c6725f2a7724b
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Jul 7 17:28:26 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 13:03:52 2025 +0000

    automation/eclair: Make report browsing URL configurable.
    
    Currently, the URL where the ECLAIR MISRA C scan reports are saved
    is hardcoded; making it configurable allows multiple runners and storage
    servers to be used without resorting to publishing all artifacts
    to the same report server.
    
    Additionally, reports will be accessed publicly by using a proxy,
    therefore the address that needs to be printed in GitLab analysis logs
    is that of the public url, rather than the location where they are stored.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    [stefano: remove unneeded exports]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit bea38de1bdda68bbcc2a865f1bcd5bce8e2a521e)
---
 automation/eclair_analysis/ECLAIR/action.helpers  | 10 ++++----
 automation/eclair_analysis/ECLAIR/action.settings | 30 +++++++++++++++++------
 automation/gitlab-ci/analyze.yaml                 |  1 +
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
index 9d4ae1f979..3a4c9d2b28 100644
--- a/automation/eclair_analysis/ECLAIR/action.helpers
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -58,7 +58,7 @@ summary() {
         ;;
     esac
 
-    currentDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
+    currentDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
     if [ -z "${newReports}" ]; then
         fixedMsg="No fixed reports as there is no baseline"
         unfixedMsg="Unfixed reports: ${unfixedReports}"
@@ -69,11 +69,11 @@ summary() {
         unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
         case "${event}" in
         pull_request | auto_pull_request)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=base
             ;;
         push)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=previous
             ;;
         *)
@@ -92,7 +92,7 @@ summary() {
 ${fixedMsg}${eol}
 ${unfixedMsg}                                                                              ${eol}
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 <h3>${jobHeadline}</h3>
 <a href="${indexHtmlUrl}">Browse analysis summary</a>
@@ -106,7 +106,7 @@ EOF
         fi
         cat <<EOF >"${summaryTxt}"
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 Analysis Summary
 
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index 1577368b61..a990437725 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -14,9 +14,6 @@ autoPRRepository="${AUTO_PR_REPOSITORY:-}"
 # Customized
 autoPRBranch="${AUTO_PR_BRANCH:-}"
 
-# Customized
-artifactsRoot=/var/local/eclair
-
 case "${ci}" in
 github)
     # To be customized
@@ -166,16 +163,35 @@ esac
 
 ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
 
-artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
+# Artifacts URL served by the eclair_report server
+if [ -z "${ECLAIR_ECDF_DIR}" ]
+then
+  echo "WARNING: No ecdf dir supplied, using default"
+fi
+artifactsEcdfDir="${ECLAIR_ECDF_DIR:-/var/local/eclair/xen-project.ecdf}"
+artifactsDir="${artifactsEcdfDir}/${repository}/ECLAIR_${ANALYSIS_KIND}"
 subDir="${subDir}${variantSubDir}"
 jobHeadline="${jobHeadline}${variantHeadline}"
 
-# Customized
-eclairReportUrlPrefix=https://saas.eclairit.com:3787
+# Remote eclair_report hosting server
+if [ -z "${ECLAIR_REPORT_HOST}" ]
+then
+  echo "WARNING: No eclair_report host supplied, using default"
+fi
+
+# URL to browse eclair reports
+if [ -z "${ECLAIR_ANALYSIS_RESULTS}" ]
+then
+  echo "WARNING: No URL to browse analysis results is set, using default"
+fi
+
+eclairReportHost="${ECLAIR_REPORT_HOST:-saas.eclairit.com:3787}"
+eclairReportUrlPrefix="https://${eclairReportHost}"
+eclairResultsUrl="${ECLAIR_ANALYSIS_RESULTS:-${eclairReportUrlPrefix}}"
 
 jobDir="${artifactsDir}/${subDir}/${jobId}"
 updateLog="${analysisOutputDir}/update.log"
 cleanRegressionsLog="${analysisOutputDir}/clean_regressions.log"
 commentLog="${analysisOutputDir}/comment.json"
-indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+indexHtmlUrl="${eclairResultsUrl}/fs${jobDir}/index.html"
 summaryTxt="${analysisOutputDir}/summary.txt"
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index 02e0ea692c..2d7062671f 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,6 +8,7 @@
     ENABLE_ECLAIR_BOT: "n"
     AUTO_PR_BRANCH: "staging"
     AUTO_PR_REPOSITORY: "xen-project/xen"
+    ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
   script:
     - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
   artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 14:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 14:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151654.1482177 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDOSD-0007A9-Iv; Mon, 27 Oct 2025 14:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151654.1482177; Mon, 27 Oct 2025 14:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDOSD-0007A1-G2; Mon, 27 Oct 2025 14:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1151654;
 Mon, 27 Oct 2025 14: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 1vDOSC-00079e-4P
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 14: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 1vDOSB-004jhL-2s
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDOSC-006AKI-09
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 14:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B6q29ZTK5zLehzfK9VUnOqPnyIR5ZgyinN5l4jBlNYY=; b=sLDZLWhK8xbo7QWSSsqUNc/BQ+
	vFmqw/CvaH94pBSaOVPiqavW49rzHPlbD75o7VDIrJg2UWoy/H50pae/wwY1HjVcVw1PCMBqxRtyX
	m4kJWFMrNg1FCfXNe2Xf9EBIGnehCiKnHe864NrPEYSe2FNbXSww8Wc/wEFQqYgpdh0E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] automation/eclair: Make report browsing URL configurable.
Message-Id: <E1vDOSC-006AKI-09@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 14:44:12 +0000

commit 55ed136a54eaf0e1ea6711b76776738f439a5875
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Jul 7 17:28:26 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 14:37:06 2025 +0000

    automation/eclair: Make report browsing URL configurable.
    
    Currently, the URL where the ECLAIR MISRA C scan reports are saved
    is hardcoded; making it configurable allows multiple runners and storage
    servers to be used without resorting to publishing all artifacts
    to the same report server.
    
    Additionally, reports will be accessed publicly by using a proxy,
    therefore the address that needs to be printed in GitLab analysis logs
    is that of the public url, rather than the location where they are stored.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    [stefano: remove unneeded exports]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit bea38de1bdda68bbcc2a865f1bcd5bce8e2a521e)
---
 automation/eclair_analysis/ECLAIR/action.helpers  | 10 ++++----
 automation/eclair_analysis/ECLAIR/action.settings | 30 +++++++++++++++++------
 automation/gitlab-ci/analyze.yaml                 |  1 +
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
index 9d4ae1f979..3a4c9d2b28 100644
--- a/automation/eclair_analysis/ECLAIR/action.helpers
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -58,7 +58,7 @@ summary() {
         ;;
     esac
 
-    currentDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
+    currentDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
     if [ -z "${newReports}" ]; then
         fixedMsg="No fixed reports as there is no baseline"
         unfixedMsg="Unfixed reports: ${unfixedReports}"
@@ -69,11 +69,11 @@ summary() {
         unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
         case "${event}" in
         pull_request | auto_pull_request)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=base
             ;;
         push)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=previous
             ;;
         *)
@@ -92,7 +92,7 @@ summary() {
 ${fixedMsg}${eol}
 ${unfixedMsg}                                                                              ${eol}
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 <h3>${jobHeadline}</h3>
 <a href="${indexHtmlUrl}">Browse analysis summary</a>
@@ -106,7 +106,7 @@ EOF
         fi
         cat <<EOF >"${summaryTxt}"
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 Analysis Summary
 
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index 1577368b61..a990437725 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -14,9 +14,6 @@ autoPRRepository="${AUTO_PR_REPOSITORY:-}"
 # Customized
 autoPRBranch="${AUTO_PR_BRANCH:-}"
 
-# Customized
-artifactsRoot=/var/local/eclair
-
 case "${ci}" in
 github)
     # To be customized
@@ -166,16 +163,35 @@ esac
 
 ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
 
-artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
+# Artifacts URL served by the eclair_report server
+if [ -z "${ECLAIR_ECDF_DIR}" ]
+then
+  echo "WARNING: No ecdf dir supplied, using default"
+fi
+artifactsEcdfDir="${ECLAIR_ECDF_DIR:-/var/local/eclair/xen-project.ecdf}"
+artifactsDir="${artifactsEcdfDir}/${repository}/ECLAIR_${ANALYSIS_KIND}"
 subDir="${subDir}${variantSubDir}"
 jobHeadline="${jobHeadline}${variantHeadline}"
 
-# Customized
-eclairReportUrlPrefix=https://saas.eclairit.com:3787
+# Remote eclair_report hosting server
+if [ -z "${ECLAIR_REPORT_HOST}" ]
+then
+  echo "WARNING: No eclair_report host supplied, using default"
+fi
+
+# URL to browse eclair reports
+if [ -z "${ECLAIR_ANALYSIS_RESULTS}" ]
+then
+  echo "WARNING: No URL to browse analysis results is set, using default"
+fi
+
+eclairReportHost="${ECLAIR_REPORT_HOST:-saas.eclairit.com:3787}"
+eclairReportUrlPrefix="https://${eclairReportHost}"
+eclairResultsUrl="${ECLAIR_ANALYSIS_RESULTS:-${eclairReportUrlPrefix}}"
 
 jobDir="${artifactsDir}/${subDir}/${jobId}"
 updateLog="${analysisOutputDir}/update.log"
 cleanRegressionsLog="${analysisOutputDir}/clean_regressions.log"
 commentLog="${analysisOutputDir}/comment.json"
-indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+indexHtmlUrl="${eclairResultsUrl}/fs${jobDir}/index.html"
 summaryTxt="${analysisOutputDir}/summary.txt"
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index 02e0ea692c..2d7062671f 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,6 +8,7 @@
     ENABLE_ECLAIR_BOT: "n"
     AUTO_PR_BRANCH: "staging"
     AUTO_PR_REPOSITORY: "xen-project/xen"
+    ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
   script:
     - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
   artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 14:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 14:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151655.1482181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDOSN-0007Ca-Js; Mon, 27 Oct 2025 14:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151655.1482181; Mon, 27 Oct 2025 14:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDOSN-0007CS-HL; Mon, 27 Oct 2025 14:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1151655;
 Mon, 27 Oct 2025 14: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 1vDOSM-0007CH-Bp
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 14: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 1vDOSM-004jhh-0R
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDOSM-006AMA-10
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 14:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7xT9MCimz2ftf2FuXnhrqgp1H88CHhDTuT7H3y9w/nA=; b=5PJc3apYy3lNr1cYvluOlv6VKy
	nB4okeVWUZm4RkmsY8hxoQsYZbddlFoaRY4snINbEGXtP9U6EnWfUEGwZJ+DBnpk4uM1IAjd+AnNa
	7tXd3rKaM0XyfzAo5eWyDJwcbG8soHHZnxUYLUpSrkuw1mntyeoHsP0SmIMQtp1dFrQI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] automation/eclair: Make report browsing URL configurable.
Message-Id: <E1vDOSM-006AMA-10@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 14:44:22 +0000

commit a52a37324b1ccc73d2053906a2578060fe35919d
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Jul 7 17:28:26 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 14:38:31 2025 +0000

    automation/eclair: Make report browsing URL configurable.
    
    Currently, the URL where the ECLAIR MISRA C scan reports are saved
    is hardcoded; making it configurable allows multiple runners and storage
    servers to be used without resorting to publishing all artifacts
    to the same report server.
    
    Additionally, reports will be accessed publicly by using a proxy,
    therefore the address that needs to be printed in GitLab analysis logs
    is that of the public url, rather than the location where they are stored.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    [stefano: remove unneeded exports]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit bea38de1bdda68bbcc2a865f1bcd5bce8e2a521e)
---
 automation/eclair_analysis/ECLAIR/action.helpers  | 10 ++++----
 automation/eclair_analysis/ECLAIR/action.settings | 30 +++++++++++++++++------
 automation/gitlab-ci/analyze.yaml                 |  1 +
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
index df9bf2bd11..762d3cc4be 100644
--- a/automation/eclair_analysis/ECLAIR/action.helpers
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -58,7 +58,7 @@ summary() {
         ;;
     esac
 
-    currentDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
+    currentDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
     if [ -z "${newReports}" ]; then
         fixedMsg="No fixed reports as there is no baseline"
         unfixedMsg="Unfixed reports: ${unfixedReports}"
@@ -69,11 +69,11 @@ summary() {
         unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
         case "${event}" in
         pull_request | auto_pull_request)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=base
             ;;
         push)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=previous
             ;;
         *)
@@ -92,7 +92,7 @@ summary() {
 ${fixedMsg}${eol}
 ${unfixedMsg}                                                                              ${eol}
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 <h3>${jobHeadline}</h3>
 <a href="${indexHtmlUrl}">Browse analysis summary</a>
@@ -106,7 +106,7 @@ EOF
         fi
         cat <<EOF >"${summaryTxt}"
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 Analysis Summary
 
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index f96368ffc7..475cccfc27 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -14,9 +14,6 @@ autoPRRepository="${AUTO_PR_REPOSITORY:-}"
 # Customized
 autoPRBranch="${AUTO_PR_BRANCH:-}"
 
-# Customized
-artifactsRoot=/var/local/eclair
-
 case "${ci}" in
 github)
     # To be customized
@@ -166,15 +163,34 @@ esac
 
 ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
 
-artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
+# Artifacts URL served by the eclair_report server
+if [ -z "${ECLAIR_ECDF_DIR}" ]
+then
+  echo "WARNING: No ecdf dir supplied, using default"
+fi
+artifactsEcdfDir="${ECLAIR_ECDF_DIR:-/var/local/eclair/xen-project.ecdf}"
+artifactsDir="${artifactsEcdfDir}/${repository}/ECLAIR_${ANALYSIS_KIND}"
 subDir="${subDir}${variantSubDir}"
 jobHeadline="${jobHeadline}${variantHeadline}"
 
-# Customized
-eclairReportUrlPrefix=https://saas.eclairit.com:3787
+# Remote eclair_report hosting server
+if [ -z "${ECLAIR_REPORT_HOST}" ]
+then
+  echo "WARNING: No eclair_report host supplied, using default"
+fi
+
+# URL to browse eclair reports
+if [ -z "${ECLAIR_ANALYSIS_RESULTS}" ]
+then
+  echo "WARNING: No URL to browse analysis results is set, using default"
+fi
+
+eclairReportHost="${ECLAIR_REPORT_HOST:-saas.eclairit.com:3787}"
+eclairReportUrlPrefix="https://${eclairReportHost}"
+eclairResultsUrl="${ECLAIR_ANALYSIS_RESULTS:-${eclairReportUrlPrefix}}"
 
 jobDir="${artifactsDir}/${subDir}/${jobId}"
 updateLog="${analysisOutputDir}/update.log"
 commentLog="${analysisOutputDir}/comment.json"
-indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+indexHtmlUrl="${eclairResultsUrl}/fs${jobDir}/index.html"
 summaryTxt="${analysisOutputDir}/summary.txt"
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index bd9a68de31..6aa6cf9d25 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,6 +8,7 @@
     ENABLE_ECLAIR_BOT: "n"
     AUTO_PR_BRANCH: "staging"
     AUTO_PR_REPOSITORY: "xen-project/xen"
+    ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
   script:
     - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
   artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 16:22:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 16:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151676.1482194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDPys-0002pg-GE; Mon, 27 Oct 2025 16:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151676.1482194; Mon, 27 Oct 2025 16: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 1vDPys-0002pY-Dg; Mon, 27 Oct 2025 16:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1151676;
 Mon, 27 Oct 2025 16: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 1vDPyr-0002pS-Mf
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 16: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 1vDPyr-004lyx-1O
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDPyr-006PZr-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16: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=8jcAkpUgw+ioRgqC0i9I5eY2mQm35xxPykl5QVVbERI=; b=OObGfwtLnLfq/wtu9YgBarXjr6
	5X8+Xj+RS/Q0Hm0ned1CfolbVEP3mAwvnLfK3UNlxmzo4EtAWtx77Q0zxpqlAPmXFPRIygQ1ggLBf
	aElcc+qrVZkZxczuvAZiEaVs3facZMESN9SDwh/TB/zxp9E8IFEP3xoPhbg+oPsRqDBo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vDPyr-006PZr-1v@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 16:22:01 +0000

commit ff9de4517afc8a998f5d4d950418ecf0d18fa23c
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:22:41 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 1647fd6f47..7af602224a 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2179,7 +2179,7 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
     int  irq = 0, i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2209,7 +2209,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2218,7 +2219,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2228,7 +2229,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 16:22:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 16:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151677.1482198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDPz2-0002r8-Hf; Mon, 27 Oct 2025 16:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151677.1482198; Mon, 27 Oct 2025 16: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 1vDPz2-0002r0-F2; Mon, 27 Oct 2025 16:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1151677;
 Mon, 27 Oct 2025 16: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 1vDPz2-0002qs-0S
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 16: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 1vDPz1-004m1E-1u
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDPz1-006PbA-2D
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16: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=gorHH+3m5mcgdWpBvLC/6Wm/k3inu0pbtWLpZnxgxZ8=; b=dveAR04Vf+fWqHm1OG7muh9RkB
	PsjI+nA4gYTOKuiMWxGs/JUzVgkxa6tif8zcU3aAq4QhkDOn5MWE9Z+Lb/v9UgcTzgzNQ0vIlvGQt
	fc2Ng6T4ky74pbaS3l2wb3KoszNpMEvKtQ3+upvgvBuZ0Q8hT3c6A25jm+2Cf2p0N3hs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] automation/eclair: Make report browsing URL configurable.
Message-Id: <E1vDPz1-006PbA-2D@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 16:22:11 +0000

commit 3324a6dbb25bb2975c35f4f2b20c6725f2a7724b
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Jul 7 17:28:26 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 13:03:52 2025 +0000

    automation/eclair: Make report browsing URL configurable.
    
    Currently, the URL where the ECLAIR MISRA C scan reports are saved
    is hardcoded; making it configurable allows multiple runners and storage
    servers to be used without resorting to publishing all artifacts
    to the same report server.
    
    Additionally, reports will be accessed publicly by using a proxy,
    therefore the address that needs to be printed in GitLab analysis logs
    is that of the public url, rather than the location where they are stored.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    [stefano: remove unneeded exports]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit bea38de1bdda68bbcc2a865f1bcd5bce8e2a521e)
---
 automation/eclair_analysis/ECLAIR/action.helpers  | 10 ++++----
 automation/eclair_analysis/ECLAIR/action.settings | 30 +++++++++++++++++------
 automation/gitlab-ci/analyze.yaml                 |  1 +
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
index 9d4ae1f979..3a4c9d2b28 100644
--- a/automation/eclair_analysis/ECLAIR/action.helpers
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -58,7 +58,7 @@ summary() {
         ;;
     esac
 
-    currentDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
+    currentDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
     if [ -z "${newReports}" ]; then
         fixedMsg="No fixed reports as there is no baseline"
         unfixedMsg="Unfixed reports: ${unfixedReports}"
@@ -69,11 +69,11 @@ summary() {
         unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
         case "${event}" in
         pull_request | auto_pull_request)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=base
             ;;
         push)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=previous
             ;;
         *)
@@ -92,7 +92,7 @@ summary() {
 ${fixedMsg}${eol}
 ${unfixedMsg}                                                                              ${eol}
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 <h3>${jobHeadline}</h3>
 <a href="${indexHtmlUrl}">Browse analysis summary</a>
@@ -106,7 +106,7 @@ EOF
         fi
         cat <<EOF >"${summaryTxt}"
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 Analysis Summary
 
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index 1577368b61..a990437725 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -14,9 +14,6 @@ autoPRRepository="${AUTO_PR_REPOSITORY:-}"
 # Customized
 autoPRBranch="${AUTO_PR_BRANCH:-}"
 
-# Customized
-artifactsRoot=/var/local/eclair
-
 case "${ci}" in
 github)
     # To be customized
@@ -166,16 +163,35 @@ esac
 
 ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
 
-artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
+# Artifacts URL served by the eclair_report server
+if [ -z "${ECLAIR_ECDF_DIR}" ]
+then
+  echo "WARNING: No ecdf dir supplied, using default"
+fi
+artifactsEcdfDir="${ECLAIR_ECDF_DIR:-/var/local/eclair/xen-project.ecdf}"
+artifactsDir="${artifactsEcdfDir}/${repository}/ECLAIR_${ANALYSIS_KIND}"
 subDir="${subDir}${variantSubDir}"
 jobHeadline="${jobHeadline}${variantHeadline}"
 
-# Customized
-eclairReportUrlPrefix=https://saas.eclairit.com:3787
+# Remote eclair_report hosting server
+if [ -z "${ECLAIR_REPORT_HOST}" ]
+then
+  echo "WARNING: No eclair_report host supplied, using default"
+fi
+
+# URL to browse eclair reports
+if [ -z "${ECLAIR_ANALYSIS_RESULTS}" ]
+then
+  echo "WARNING: No URL to browse analysis results is set, using default"
+fi
+
+eclairReportHost="${ECLAIR_REPORT_HOST:-saas.eclairit.com:3787}"
+eclairReportUrlPrefix="https://${eclairReportHost}"
+eclairResultsUrl="${ECLAIR_ANALYSIS_RESULTS:-${eclairReportUrlPrefix}}"
 
 jobDir="${artifactsDir}/${subDir}/${jobId}"
 updateLog="${analysisOutputDir}/update.log"
 cleanRegressionsLog="${analysisOutputDir}/clean_regressions.log"
 commentLog="${analysisOutputDir}/comment.json"
-indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+indexHtmlUrl="${eclairResultsUrl}/fs${jobDir}/index.html"
 summaryTxt="${analysisOutputDir}/summary.txt"
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index 02e0ea692c..2d7062671f 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,6 +8,7 @@
     ENABLE_ECLAIR_BOT: "n"
     AUTO_PR_BRANCH: "staging"
     AUTO_PR_REPOSITORY: "xen-project/xen"
+    ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
   script:
     - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
   artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 16:44:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 16:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151689.1482213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQKB-0005p6-8D; Mon, 27 Oct 2025 16:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151689.1482213; Mon, 27 Oct 2025 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 1vDQKB-0005oy-5a; Mon, 27 Oct 2025 16:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1151689;
 Mon, 27 Oct 2025 16: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 1vDQKA-0005os-3z
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 16: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 1vDQK9-004mN0-2q
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDQKA-006T0B-08
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=33W7Qyt+CHoejEP8uXI1tLfVpcVbp8DoKKi9qYx4w04=; b=oEeuAV0WPpsuC5bUNGoI8FxpNv
	7VExP+iDo/5XpMwfZFvjRtnTM873AvGztaLG+dsCER535GPzW5wR3iEAGqQStRJbszxv7OORCLJ2G
	myjED2Bqx4UBtY6Ul4+I2mp4I2X+GH2gczjsAx0y9dYwb6bj646qnrJOQcop3AYeb3Wc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] tools/libs/light: fix BAR memory address truncation
Message-Id: <E1vDQKA-006T0B-08@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 16:44:02 +0000

commit 20cda53ff1453d1029dc0ebdd1e873674c637d76
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Fri Oct 24 13:21:35 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 24 13:22:55 2025 +0100

    tools/libs/light: fix BAR memory address truncation
    
    64-bit BAR memory address is truncated when removing a passthrough
    pci device from guest since it uses "unsigned int".
    
    So, change to use 64-bit type to fix this problem.
    
    This is XSA-476 / CVE-2025-58149.
    
    Fixes: b0a1af61678b ("libxenlight: implement pci passthrough")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit 421432b822184f990cd9ef157bbc2a24cfe96727)
---
 tools/libs/light/libxl_pci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 96cb4da079..729d3b4c63 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -2168,7 +2168,7 @@ static void pci_remove_detached(libxl__egc *egc,
 {
     STATE_AO_GC(prs->aodev->ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int start = 0, end = 0, flags = 0, size = 0;
+    uint64_t start = 0, end = 0, flags = 0, size = 0;
     int  irq = 0, i, stubdomid = 0;
     const char *sysfs_path;
     FILE *f;
@@ -2198,7 +2198,8 @@ static void pci_remove_detached(libxl__egc *egc,
     }
 
     for (i = 0; i < PROC_PCI_NUM_RESOURCES; i++) {
-        if (fscanf(f, "0x%x 0x%x 0x%x\n", &start, &end, &flags) != 3)
+        if (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n",
+                   &start, &end, &flags) != 3)
             continue;
         size = end - start + 1;
         if (start) {
@@ -2207,7 +2208,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                  size, 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_ioport_permission error 0x%x/0x%x",
+                          "xc_domain_ioport_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             } else {
@@ -2217,7 +2218,7 @@ static void pci_remove_detached(libxl__egc *egc,
                                                 0);
                 if (rc < 0)
                     LOGED(ERROR, domid,
-                          "xc_domain_iomem_permission error 0x%x/0x%x",
+                          "xc_domain_iomem_permission error %#"PRIx64"/%#"PRIx64,
                           start,
                           size);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 16:44:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 16:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151690.1482216 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQKL-0005qt-9U; Mon, 27 Oct 2025 16:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151690.1482216; Mon, 27 Oct 2025 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 1vDQKL-0005qm-6x; Mon, 27 Oct 2025 16:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1151690;
 Mon, 27 Oct 2025 16: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 1vDQKK-0005qW-6P
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 16: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 1vDQKJ-004mN6-37
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDQKK-006T62-0R
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iWbdkeH7KD6w/MIS2VJuoA2pnZJWurXNu7bTZAWdlNk=; b=XGgVoWpBr96ZrcXjtNmLayA9Jv
	1dzttOQ1E6bRLFN/RgnL8iHCD3i7kOSX29Jsm3zDoCo1Le5cydKSRoZbG4KD4aTUZHHpMjVYcDflN
	Arcjw+vjzrZUfmOGbHMsZCVchB+L8Q+DPuUcQiG46b1z45OHmGH7HMffpn9/LWbBG4Vs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] automation/eclair: Make report browsing URL configurable.
Message-Id: <E1vDQKK-006T62-0R@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 16:44:12 +0000

commit 55ed136a54eaf0e1ea6711b76776738f439a5875
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Jul 7 17:28:26 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 14:37:06 2025 +0000

    automation/eclair: Make report browsing URL configurable.
    
    Currently, the URL where the ECLAIR MISRA C scan reports are saved
    is hardcoded; making it configurable allows multiple runners and storage
    servers to be used without resorting to publishing all artifacts
    to the same report server.
    
    Additionally, reports will be accessed publicly by using a proxy,
    therefore the address that needs to be printed in GitLab analysis logs
    is that of the public url, rather than the location where they are stored.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    [stefano: remove unneeded exports]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit bea38de1bdda68bbcc2a865f1bcd5bce8e2a521e)
---
 automation/eclair_analysis/ECLAIR/action.helpers  | 10 ++++----
 automation/eclair_analysis/ECLAIR/action.settings | 30 +++++++++++++++++------
 automation/gitlab-ci/analyze.yaml                 |  1 +
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
index 9d4ae1f979..3a4c9d2b28 100644
--- a/automation/eclair_analysis/ECLAIR/action.helpers
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -58,7 +58,7 @@ summary() {
         ;;
     esac
 
-    currentDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
+    currentDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
     if [ -z "${newReports}" ]; then
         fixedMsg="No fixed reports as there is no baseline"
         unfixedMsg="Unfixed reports: ${unfixedReports}"
@@ -69,11 +69,11 @@ summary() {
         unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
         case "${event}" in
         pull_request | auto_pull_request)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=base
             ;;
         push)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=previous
             ;;
         *)
@@ -92,7 +92,7 @@ summary() {
 ${fixedMsg}${eol}
 ${unfixedMsg}                                                                              ${eol}
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 <h3>${jobHeadline}</h3>
 <a href="${indexHtmlUrl}">Browse analysis summary</a>
@@ -106,7 +106,7 @@ EOF
         fi
         cat <<EOF >"${summaryTxt}"
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 Analysis Summary
 
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index 1577368b61..a990437725 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -14,9 +14,6 @@ autoPRRepository="${AUTO_PR_REPOSITORY:-}"
 # Customized
 autoPRBranch="${AUTO_PR_BRANCH:-}"
 
-# Customized
-artifactsRoot=/var/local/eclair
-
 case "${ci}" in
 github)
     # To be customized
@@ -166,16 +163,35 @@ esac
 
 ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
 
-artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
+# Artifacts URL served by the eclair_report server
+if [ -z "${ECLAIR_ECDF_DIR}" ]
+then
+  echo "WARNING: No ecdf dir supplied, using default"
+fi
+artifactsEcdfDir="${ECLAIR_ECDF_DIR:-/var/local/eclair/xen-project.ecdf}"
+artifactsDir="${artifactsEcdfDir}/${repository}/ECLAIR_${ANALYSIS_KIND}"
 subDir="${subDir}${variantSubDir}"
 jobHeadline="${jobHeadline}${variantHeadline}"
 
-# Customized
-eclairReportUrlPrefix=https://saas.eclairit.com:3787
+# Remote eclair_report hosting server
+if [ -z "${ECLAIR_REPORT_HOST}" ]
+then
+  echo "WARNING: No eclair_report host supplied, using default"
+fi
+
+# URL to browse eclair reports
+if [ -z "${ECLAIR_ANALYSIS_RESULTS}" ]
+then
+  echo "WARNING: No URL to browse analysis results is set, using default"
+fi
+
+eclairReportHost="${ECLAIR_REPORT_HOST:-saas.eclairit.com:3787}"
+eclairReportUrlPrefix="https://${eclairReportHost}"
+eclairResultsUrl="${ECLAIR_ANALYSIS_RESULTS:-${eclairReportUrlPrefix}}"
 
 jobDir="${artifactsDir}/${subDir}/${jobId}"
 updateLog="${analysisOutputDir}/update.log"
 cleanRegressionsLog="${analysisOutputDir}/clean_regressions.log"
 commentLog="${analysisOutputDir}/comment.json"
-indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+indexHtmlUrl="${eclairResultsUrl}/fs${jobDir}/index.html"
 summaryTxt="${analysisOutputDir}/summary.txt"
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index 02e0ea692c..2d7062671f 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,6 +8,7 @@
     ENABLE_ECLAIR_BOT: "n"
     AUTO_PR_BRANCH: "staging"
     AUTO_PR_REPOSITORY: "xen-project/xen"
+    ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
   script:
     - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
   artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 16:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 16:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151691.1482221 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQKV-0005t2-BZ; Mon, 27 Oct 2025 16:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151691.1482221; Mon, 27 Oct 2025 16:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQKV-0005su-8P; Mon, 27 Oct 2025 16:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1151691;
 Mon, 27 Oct 2025 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 1vDQKU-0005sk-Ej
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 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 1vDQKU-004mNT-0i
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDQKU-006T7o-1F
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 16:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TSuEkA6NgjIESHxsvKKmQxvy3Yqmz+otneRKtRuXiSg=; b=QqvJDwu7CEBjUKBdFKB0htqDH8
	UQaeb52YjkVbwHabK7euSp6dWBHaXi8rscOQAdJZkf4nlPlDqAOsP6SyCzAbcd8qW/Q8fjBCKhhvw
	ipcinHWNgo646wAQwFv8CyKarfqhMJMnLHE6PjOhhjchLNBUD88EVMDVeNtQOIA5eq0M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] automation/eclair: Make report browsing URL configurable.
Message-Id: <E1vDQKU-006T7o-1F@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 16:44:22 +0000

commit a52a37324b1ccc73d2053906a2578060fe35919d
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Mon Jul 7 17:28:26 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 14:38:31 2025 +0000

    automation/eclair: Make report browsing URL configurable.
    
    Currently, the URL where the ECLAIR MISRA C scan reports are saved
    is hardcoded; making it configurable allows multiple runners and storage
    servers to be used without resorting to publishing all artifacts
    to the same report server.
    
    Additionally, reports will be accessed publicly by using a proxy,
    therefore the address that needs to be printed in GitLab analysis logs
    is that of the public url, rather than the location where they are stored.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    [stefano: remove unneeded exports]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit bea38de1bdda68bbcc2a865f1bcd5bce8e2a521e)
---
 automation/eclair_analysis/ECLAIR/action.helpers  | 10 ++++----
 automation/eclair_analysis/ECLAIR/action.settings | 30 +++++++++++++++++------
 automation/gitlab-ci/analyze.yaml                 |  1 +
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
index df9bf2bd11..762d3cc4be 100644
--- a/automation/eclair_analysis/ECLAIR/action.helpers
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -58,7 +58,7 @@ summary() {
         ;;
     esac
 
-    currentDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
+    currentDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
     if [ -z "${newReports}" ]; then
         fixedMsg="No fixed reports as there is no baseline"
         unfixedMsg="Unfixed reports: ${unfixedReports}"
@@ -69,11 +69,11 @@ summary() {
         unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
         case "${event}" in
         pull_request | auto_pull_request)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=base
             ;;
         push)
-            referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
+            referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=previous
             ;;
         *)
@@ -92,7 +92,7 @@ summary() {
 ${fixedMsg}${eol}
 ${unfixedMsg}                                                                              ${eol}
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 <h3>${jobHeadline}</h3>
 <a href="${indexHtmlUrl}">Browse analysis summary</a>
@@ -106,7 +106,7 @@ EOF
         fi
         cat <<EOF >"${summaryTxt}"
 <a href="https://www.bugseng.com/eclair">
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 Analysis Summary
 
diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index f96368ffc7..475cccfc27 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -14,9 +14,6 @@ autoPRRepository="${AUTO_PR_REPOSITORY:-}"
 # Customized
 autoPRBranch="${AUTO_PR_BRANCH:-}"
 
-# Customized
-artifactsRoot=/var/local/eclair
-
 case "${ci}" in
 github)
     # To be customized
@@ -166,15 +163,34 @@ esac
 
 ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
 
-artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
+# Artifacts URL served by the eclair_report server
+if [ -z "${ECLAIR_ECDF_DIR}" ]
+then
+  echo "WARNING: No ecdf dir supplied, using default"
+fi
+artifactsEcdfDir="${ECLAIR_ECDF_DIR:-/var/local/eclair/xen-project.ecdf}"
+artifactsDir="${artifactsEcdfDir}/${repository}/ECLAIR_${ANALYSIS_KIND}"
 subDir="${subDir}${variantSubDir}"
 jobHeadline="${jobHeadline}${variantHeadline}"
 
-# Customized
-eclairReportUrlPrefix=https://saas.eclairit.com:3787
+# Remote eclair_report hosting server
+if [ -z "${ECLAIR_REPORT_HOST}" ]
+then
+  echo "WARNING: No eclair_report host supplied, using default"
+fi
+
+# URL to browse eclair reports
+if [ -z "${ECLAIR_ANALYSIS_RESULTS}" ]
+then
+  echo "WARNING: No URL to browse analysis results is set, using default"
+fi
+
+eclairReportHost="${ECLAIR_REPORT_HOST:-saas.eclairit.com:3787}"
+eclairReportUrlPrefix="https://${eclairReportHost}"
+eclairResultsUrl="${ECLAIR_ANALYSIS_RESULTS:-${eclairReportUrlPrefix}}"
 
 jobDir="${artifactsDir}/${subDir}/${jobId}"
 updateLog="${analysisOutputDir}/update.log"
 commentLog="${analysisOutputDir}/comment.json"
-indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+indexHtmlUrl="${eclairResultsUrl}/fs${jobDir}/index.html"
 summaryTxt="${analysisOutputDir}/summary.txt"
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index bd9a68de31..6aa6cf9d25 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,6 +8,7 @@
     ENABLE_ECLAIR_BOT: "n"
     AUTO_PR_BRANCH: "staging"
     AUTO_PR_REPOSITORY: "xen-project/xen"
+    ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
   script:
     - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
   artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 17:11:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 17:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151692.1482225 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkJ-0000w1-3x; Mon, 27 Oct 2025 17:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151692.1482225; Mon, 27 Oct 2025 17:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkJ-0000vt-19; Mon, 27 Oct 2025 17:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1151692;
 Mon, 27 Oct 2025 17: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 1vDQkH-0000vn-Rc
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 17: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 1vDQkH-004mpY-1n
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDQkH-006bNa-2L
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bMstSZyelNowEt+Q52bOHTBvA3Zlzjyn14vjCDvD4Ss=; b=iD76BOk0EztNV96briRaSBcnQS
	ixNdbBvopl7VCe7d7DFFX/rGVGW4Or0AL1twSb3tgVfzAyEKj14ZClncU7H5C+QxURZXtGHBMHCQw
	azrsFqwAZ/UdsuJyOer3qZfvuXpWg/rnUQk6XgfFla6oq66RmMCEKyX2B9zcSFc8oAUA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: correct PG_log_dirty definition again
Message-Id: <E1vDQkH-006bNa-2L@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 17:11:01 +0000

commit 816db17db1a080fe48992e7b727ca2a40b81ef79
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 15:49:44 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:49:44 2025 +0100

    x86/mm: correct PG_log_dirty definition again
    
    The earlier change wasn't correct as far as shim-exclusive mode goes:
    Shadow mode is still to be enabled permitted there, yet the generic
    paging-log-dirty (and more generally domctl) part of the code still is
    unwanted (and cannot be used anyway, as domctl_lock_acquire() isn't
    available).
    
    Fixes: 2ae8a68df21e ("x86/mm: correct PG_log_dirty definition")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/include/asm/paging.h | 2 +-
 xen/include/hypercall-defs.c      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 1b0694bb36..0c06b0a7a8 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -55,7 +55,7 @@
 #define PG_translate   0
 #define PG_external    0
 #endif
-#ifdef CONFIG_PAGING
+#if defined(CONFIG_PAGING) && !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 /* Enable log dirty mode */
 #define PG_log_dirty   (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shift)
 #else
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index 8370b4b289..cef08eeec1 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -197,7 +197,7 @@ dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_buf_t *bufs)
 #ifdef CONFIG_SYSCTL
 sysctl(xen_sysctl_t *u_sysctl)
 #endif
-#if defined(CONFIG_X86) && defined(CONFIG_PAGING)
+#if defined(CONFIG_X86) && defined(CONFIG_PAGING) && !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 paging_domctl_cont(xen_domctl_t *u_domctl)
 #endif
 #ifndef CONFIG_PV_SHIM_EXCLUSIVE
@@ -298,7 +298,7 @@ dm_op                              compat   do       compat   do       do
 hypfs_op                           do       do       do       do       do
 #endif
 mca                                do       do       -        -        -
-#if defined(CONFIG_X86) && defined(CONFIG_PAGING)
+#if defined(CONFIG_X86) && defined(CONFIG_PAGING) && !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 paging_domctl_cont                 do       do       do       do       -
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 17:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 17:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151693.1482228 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkT-0000yD-59; Mon, 27 Oct 2025 17:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151693.1482228; Mon, 27 Oct 2025 17:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkT-0000y5-2U; Mon, 27 Oct 2025 17:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1151693;
 Mon, 27 Oct 2025 17: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 1vDQkR-0000xv-Sr
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 17: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 1vDQkR-004mpc-26
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDQkR-006bOl-2c
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+FnXlycJlViVegnAawr63yLNGlFQekmJK7C7klNiNc0=; b=EbTY0x08jFB/WpWsX6NOXu+R6z
	7gi1y2Mbr+dLtspK5663XtdTWbCt/ZQ50YNjbcxjkZ2hkg8aYu6Mwew11BFEPP94Qb1JOZc59TmdC
	PlV4NAbMsTW3Iy8P2GUTISKEq29GVqf3zR4soZpOXJ3FnP30H27UUS82Ge8D7hjID4AM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: deal with unused channels
Message-Id: <E1vDQkR-006bOl-2c@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 17:11:11 +0000

commit 24f608dc909ed6b6fefb6c35b6de39e851bba6eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 15:51:03 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:51:03 2025 +0100

    x86/HPET: deal with unused channels
    
    Keeping channels enabled when they're unused is only causing problems:
    Extra interrupts harm performance, and extra nested interrupts could even
    have caused worse problems. However, on all Intel hardware I looked at
    closely, a 0->1 transition of the enable bit causes an immediate IRQ.
    Hence disabling channels isn't a good idea there. Set a "long" timeout
    instead.
    
    Along with that also "clear" the channel's "next event", for it to be
    properly written by whatever the next user is going to want (possibly
    avoiding too early an IRQ).
    
    Further, along the same lines, don't enable channels early when starting
    up an IRQ. This doesn't need to happen earlier than from
    set_channel_irq_affinity() (once a channel goes into use the very first
    time). This eliminates a single instance of
    
    (XEN) [VT-D]INTR-REMAP: Request device [0000:00:1f.0] fault index 0
    (XEN) [VT-D]INTR-REMAP: reason 25 - Blocked a compatibility format interrupt request
    
    during boot. (Why exactly there's only one instance, when we use multiple
    counters and hence multiple IRQs, I can't tell. My understanding would be
    that this was due to __hpet_setup_msi_irq() being called only after
    request_irq() [and hence the .startup handler], yet that should have
    affected all channels.)
    
    Fixes: 3ba523ff957c ("CPUIDLE: enable MSI capable HPET for timer broadcast")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hpet.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index d05b5eb136..1a84a37bb9 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -295,12 +295,6 @@ static int hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
     return 0;
 }
 
-static unsigned int cf_check hpet_msi_startup(struct irq_desc *desc)
-{
-    hpet_msi_unmask(desc);
-    return 0;
-}
-
 #define hpet_msi_shutdown hpet_msi_mask
 
 static void cf_check hpet_msi_set_affinity(
@@ -326,7 +320,7 @@ static void cf_check hpet_msi_set_affinity(
  */
 static hw_irq_controller hpet_msi_type = {
     .typename   = "HPET-MSI",
-    .startup    = hpet_msi_startup,
+    .startup    = irq_startup_none,
     .shutdown   = hpet_msi_shutdown,
     .enable	    = hpet_msi_unmask,
     .disable    = hpet_msi_mask,
@@ -526,6 +520,8 @@ static void hpet_detach_channel(unsigned int cpu,
         spin_unlock_irq(&ch->lock);
     else if ( (next = cpumask_first(ch->cpumask)) >= nr_cpu_ids )
     {
+        hpet_write32(hpet_read32(HPET_COUNTER), HPET_Tn_CMP(ch->idx));
+        ch->next_event = STIME_MAX;
         ch->cpu = -1;
         clear_bit(HPET_EVT_USED_BIT, &ch->flags);
         spin_unlock_irq(&ch->lock);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 17:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 17:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151694.1482233 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkd-00013d-8E; Mon, 27 Oct 2025 17:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151694.1482233; Mon, 27 Oct 2025 17:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkd-00013V-5a; Mon, 27 Oct 2025 17:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1151694;
 Mon, 27 Oct 2025 17: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 1vDQkc-00012A-0f
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 17: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 1vDQkb-004mpz-2S
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDQkb-006bQb-2y
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17: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=GJFslpciaJVkmweO/47ga8+THgQYcBO/JDgO/1zxk/w=; b=o6a/FPR0Bh9H94Sp8SzZ7Kb2gN
	vZhKqysnOvdeVopASjdA95hwuZNz+/K86s9b0KYUsBWeY3ZY8P6WOEGjYLEsH+q7nmWMylDeosPLO
	rv/GIUqgtQ9iTev3i506/1w3zbqlqpleq0OVUCe1HpspX0plGUnsFwFavf1KDG9BOjP8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: use single, global, low-priority vector for broadcast IRQ
Message-Id: <E1vDQkb-006bQb-2y@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 17:11:21 +0000

commit 8ef32772b5483ef2d45aee5adc5ba485077c7fbb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 15:51:42 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:51:42 2025 +0100

    x86/HPET: use single, global, low-priority vector for broadcast IRQ
    
    Using dynamically allocated / maintained vectors has several downsides:
    - possible nesting of IRQs due to the effects of IRQ migration,
    - reduction of vectors available for devices,
    - IRQs not moving as intended if there's shortage of vectors,
    - higher runtime overhead.
    
    As the vector also doesn't need to be of any priority (first and foremost
    it really shouldn't be of higher or same priority as the timer IRQ, as
    that raises TIMER_SOFTIRQ anyway), simply use the lowest one above the
    legacy range. The vector needs reserving early, until it is known whether
    it actually is used. If it isn't, it's made available for general use.
    
    With a fixed vector, less updating is now necessary in
    set_channel_irq_affinity(); in particular channels don't need transiently
    masking anymore, as the necessary update is now atomic. To fully leverage
    this, however, we want to stop using hpet_msi_set_affinity() there. With
    the transient masking dropped, we're no longer at risk of missing events.
    
    AMD interrupt remapping code so far didn't "return" a consistent MSI
    address when translating an MSI message. Clear respective fields there, to
    keep the related assertion in set_channel_irq_affinity() from triggering.
    
    Fixes: 996576b965cc ("xen: allow up to 16383 cpus")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hpet.c                      | 87 +++++++++++++++++++++++++-------
 xen/arch/x86/include/asm/hpet.h          |  1 +
 xen/arch/x86/include/asm/irq-vectors.h   |  3 ++
 xen/arch/x86/include/asm/irq.h           |  1 +
 xen/arch/x86/irq.c                       | 13 +++++
 xen/arch/x86/time.c                      |  2 +
 xen/drivers/passthrough/amd/iommu_intr.c |  7 +++
 7 files changed, 96 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1a84a37bb9..6d5e6fb530 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -9,17 +9,19 @@
 #include <xen/timer.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
+#include <xen/cpuidle.h>
 #include <xen/irq.h>
 #include <xen/numa.h>
 #include <xen/param.h>
 #include <xen/sched.h>
 
 #include <asm/apic.h>
-#include <asm/fixmap.h>
 #include <asm/div64.h>
+#include <asm/fixmap.h>
+#include <asm/genapic.h>
 #include <asm/hpet.h>
+#include <asm/irq-vectors.h>
 #include <asm/msi.h>
-#include <xen/cpuidle.h>
 
 #define MAX_DELTA_NS MILLISECS(10*1000)
 #define MIN_DELTA_NS MICROSECS(20)
@@ -251,10 +253,9 @@ static void cf_check hpet_interrupt_handler(int irq, void *data)
     ch->event_handler(ch);
 }
 
-static void cf_check hpet_msi_unmask(struct irq_desc *desc)
+static void hpet_enable_channel(struct hpet_event_channel *ch)
 {
     u32 cfg;
-    struct hpet_event_channel *ch = desc->action->dev_id;
 
     cfg = hpet_read32(HPET_Tn_CFG(ch->idx));
     cfg |= HPET_TN_ENABLE;
@@ -262,6 +263,11 @@ static void cf_check hpet_msi_unmask(struct irq_desc *desc)
     ch->msi.msi_attrib.host_masked = 0;
 }
 
+static void cf_check hpet_msi_unmask(struct irq_desc *desc)
+{
+    hpet_enable_channel(desc->action->dev_id);
+}
+
 static void cf_check hpet_msi_mask(struct irq_desc *desc)
 {
     u32 cfg;
@@ -303,15 +309,13 @@ static void cf_check hpet_msi_set_affinity(
     struct hpet_event_channel *ch = desc->action->dev_id;
     struct msi_msg msg = ch->msi.msg;
 
-    msg.dest32 = set_desc_affinity(desc, mask);
-    if ( msg.dest32 == BAD_APICID )
-        return;
+    /* This really is only for dump_irqs(). */
+    cpumask_copy(desc->arch.cpu_mask, mask);
 
-    msg.data &= ~MSI_DATA_VECTOR_MASK;
-    msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
+    msg.dest32 = cpu_mask_to_apicid(mask);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(msg.dest32);
-    if ( msg.data != ch->msi.msg.data || msg.dest32 != ch->msi.msg.dest32 )
+    if ( msg.dest32 != ch->msi.msg.dest32 )
         hpet_msi_write(ch, &msg);
 }
 
@@ -324,7 +328,7 @@ static hw_irq_controller hpet_msi_type = {
     .shutdown   = hpet_msi_shutdown,
     .enable	    = hpet_msi_unmask,
     .disable    = hpet_msi_mask,
-    .ack        = ack_nonmaskable_msi_irq,
+    .ack        = irq_actor_none,
     .end        = end_nonmaskable_irq,
     .set_affinity   = hpet_msi_set_affinity,
 };
@@ -343,6 +347,16 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
     u32 cfg = hpet_read32(HPET_Tn_CFG(ch->idx));
     irq_desc_t *desc = irq_to_desc(ch->msi.irq);
 
+    clear_irq_vector(ch->msi.irq);
+    /*
+     * Technically we don't want to bind the IRQ to any CPU yet, but we need to
+     * specify at least one online one here.  Use the BSP.
+     */
+    ret = bind_irq_vector(ch->msi.irq, HPET_BROADCAST_VECTOR, cpumask_of(0));
+    if ( ret )
+        return ret;
+    cpumask_setall(desc->affinity);
+
     if ( iommu_intremap != iommu_intremap_off )
     {
         ch->msi.hpet_id = hpet_blockid;
@@ -472,19 +486,50 @@ static struct hpet_event_channel *hpet_get_channel(unsigned int cpu)
 static void set_channel_irq_affinity(struct hpet_event_channel *ch)
 {
     struct irq_desc *desc = irq_to_desc(ch->msi.irq);
+    struct msi_msg msg = ch->msi.msg;
 
     ASSERT(!local_irq_is_enabled());
     spin_lock(&desc->lock);
-    hpet_msi_mask(desc);
-    hpet_msi_set_affinity(desc, cpumask_of(ch->cpu));
-    hpet_msi_unmask(desc);
+
+    per_cpu(vector_irq, ch->cpu)[HPET_BROADCAST_VECTOR] = ch->msi.irq;
+
+    /*
+     * Open-coding a reduced form of hpet_msi_set_affinity() here.  With the
+     * actual update below (either of the IRTE or of [just] message address;
+     * with interrupt remapping message address/data don't change) now being
+     * atomic, we can avoid masking the IRQ around the update.  As a result
+     * we're no longer at risk of missing IRQs (provided hpet_broadcast_enter()
+     * keeps setting the new deadline only afterwards).
+     */
+    cpumask_copy(desc->arch.cpu_mask, cpumask_of(ch->cpu));
+
     spin_unlock(&desc->lock);
 
-    spin_unlock(&ch->lock);
+    msg.dest32 = cpu_physical_id(ch->cpu);
+    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
+    msg.address_lo |= MSI_ADDR_DEST_ID(msg.dest32);
+    if ( msg.dest32 != ch->msi.msg.dest32 )
+    {
+        ch->msi.msg = msg;
 
-    /* We may have missed an interrupt due to the temporary masking. */
-    if ( ch->event_handler && ch->next_event < NOW() )
-        ch->event_handler(ch);
+        if ( iommu_intremap != iommu_intremap_off )
+        {
+            int rc = iommu_update_ire_from_msi(&ch->msi, &msg);
+
+            ASSERT(rc <= 0);
+            if ( rc >= 0 )
+            {
+                ASSERT(msg.data == hpet_read32(HPET_Tn_ROUTE(ch->idx)));
+                ASSERT(msg.address_lo ==
+                       hpet_read32(HPET_Tn_ROUTE(ch->idx) + 4));
+            }
+        }
+        else
+            hpet_write32(msg.address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
+    }
+
+    hpet_enable_channel(ch);
+    spin_unlock(&ch->lock);
 }
 
 static void hpet_attach_channel(unsigned int cpu,
@@ -622,6 +667,12 @@ void __init hpet_broadcast_init(void)
         hpet_events->flags = HPET_EVT_LEGACY;
 }
 
+void __init hpet_broadcast_late_init(void)
+{
+    if ( !num_hpets_used )
+        free_lopriority_vector(HPET_BROADCAST_VECTOR);
+}
+
 void hpet_broadcast_resume(void)
 {
     u32 cfg;
diff --git a/xen/arch/x86/include/asm/hpet.h b/xen/arch/x86/include/asm/hpet.h
index c402c63168..73f34050da 100644
--- a/xen/arch/x86/include/asm/hpet.h
+++ b/xen/arch/x86/include/asm/hpet.h
@@ -90,6 +90,7 @@ void hpet_disable_legacy_replacement_mode(void);
  * rather than using the LAPIC timer. Used for Cx state entry.
  */
 void hpet_broadcast_init(void);
+void hpet_broadcast_late_init(void);
 void hpet_broadcast_resume(void);
 void cf_check hpet_broadcast_enter(void);
 void cf_check hpet_broadcast_exit(void);
diff --git a/xen/arch/x86/include/asm/irq-vectors.h b/xen/arch/x86/include/asm/irq-vectors.h
index f546aedd87..d75d1c5671 100644
--- a/xen/arch/x86/include/asm/irq-vectors.h
+++ b/xen/arch/x86/include/asm/irq-vectors.h
@@ -22,6 +22,9 @@
 #define FIRST_LEGACY_VECTOR     FIRST_DYNAMIC_VECTOR
 #define LAST_LEGACY_VECTOR      (FIRST_LEGACY_VECTOR + 0xf)
 
+/* HPET broadcast is statically allocated and wants to be low priority. */
+#define HPET_BROADCAST_VECTOR   (LAST_LEGACY_VECTOR + 1)
+
 #ifdef CONFIG_PV32
 #define HYPERCALL_VECTOR        0x82
 #endif
diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 8c81f66434..7315150b66 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -116,6 +116,7 @@ void cf_check call_function_interrupt(void);
 void cf_check irq_move_cleanup_interrupt(void);
 
 uint8_t alloc_hipriority_vector(void);
+void free_lopriority_vector(uint8_t vector);
 
 void set_direct_apic_vector(uint8_t vector, void (*handler)(void));
 void alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void));
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 556134f85a..ba2f02eb0c 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -468,6 +468,12 @@ int __init init_irq_data(void)
           vector++ )
         __set_bit(vector, used_vectors);
 
+    /*
+     * Prevent the HPET broadcast vector from being used, until it is known
+     * whether it's actually needed.
+     */
+    __set_bit(HPET_BROADCAST_VECTOR, used_vectors);
+
     return 0;
 }
 
@@ -991,6 +997,13 @@ void alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void))
     spin_unlock(&lock);
 }
 
+/* This could free any vectors, but is needed only for low-prio ones. */
+void __init free_lopriority_vector(uint8_t vector)
+{
+    ASSERT(vector < FIRST_HIPRIORITY_VECTOR);
+    clear_bit(vector, used_vectors);
+}
+
 static void cf_check irq_ratelimit_timer_fn(void *data)
 {
     struct irq_desc *desc, *tmp;
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 59129f419d..ece9ae0b34 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2675,6 +2675,8 @@ static int __init cf_check disable_pit_irq(void)
                "Force enable with 'cpuidle'.\n");
     }
 
+    hpet_broadcast_late_init();
+
     return 0;
 }
 __initcall(disable_pit_irq);
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 7dae89bcc0..2e22ee1ffe 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -551,6 +551,13 @@ int cf_check amd_iommu_msi_msg_update_ire(
         for ( i = 1; i < nr; ++i )
             msi_desc[i].remap_index = msi_desc->remap_index + i;
         msg->data = data;
+        /*
+         * While the low address bits don't matter, "canonicalize" the address
+         * by zapping the bits that were transferred to the IRTE.  This way
+         * callers can check for there actually needing to be an update to
+         * wherever the address is put.
+         */
+        msg->address_lo &= ~(MSI_ADDR_DESTMODE_MASK | MSI_ADDR_DEST_ID_MASK);
     }
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 17:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 17:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151695.1482236 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkn-00017T-9P; Mon, 27 Oct 2025 17:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151695.1482236; Mon, 27 Oct 2025 17:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDQkn-00017L-6z; Mon, 27 Oct 2025 17:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1151695;
 Mon, 27 Oct 2025 17: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 1vDQkm-00015e-2e
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 17: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 1vDQkl-004mq5-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDQkm-006bRe-04
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 17:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oZVtelGDQWuqrRFo8aTM8JBD2pawCSGhO+hJwuLo6yo=; b=UXZ9K0pg9OS3LnfOJ8i8NP0ziP
	eiKSgJUsud2jSroAAfzLpXtU4l25Uy0ftm42Wmw0HmgOoZpZn/8aMCIqdAA2/Kcn47tmqCL18md3S
	PBe9dx1fcsttDyhPucq7ULoTwgE0H9n7LG2XkV8g+LA21Tv/io6acYq9kWXMfzOe2SHk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/pci: prevent infinite loop for faulty SR-IOV cards
Message-Id: <E1vDQkm-006bRe-04@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 17:11:32 +0000

commit f7091c0e1fd43877621d4eb2c1c4106797b3c551
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Mon Oct 27 15:52:20 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:52:20 2025 +0100

    xen/pci: prevent infinite loop for faulty SR-IOV cards
    
    If a SR-IOV card presents an I/O space inside a BAR the
    code will continue to loop on the same card.
    This is due to the missing increment of the cycle variable.
    
    Fixes: a1a6d59862f4 ("pci: split code to size BARs from pci_add_device")
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 3edcfa8a04..52c22fa50c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -746,6 +746,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
                     printk(XENLOG_WARNING
                            "SR-IOV device %pp with vf BAR%u in IO space\n",
                            &pdev->sbdf, i);
+                    ++i;
                     continue;
                 }
                 ret = pci_size_mem_bar(pdev->sbdf, idx, NULL,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 22:44:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 22:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151893.1482421 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDVwY-0000AU-TZ; Mon, 27 Oct 2025 22:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151893.1482421; Mon, 27 Oct 2025 22: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 1vDVwY-0000AM-Qu; Mon, 27 Oct 2025 22:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1151893;
 Mon, 27 Oct 2025 22: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 1vDVwY-0000AA-9P
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 22: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 1vDVwX-004syQ-2z
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 22:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDVwY-007DZb-0H
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 22:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PAiAn+CpPFNLFXrsTLMD1TncV+qqOYPnjvXR/a4m0dY=; b=Cz9Jj4FyLTkoq47JHGosIxle2u
	eluXmpXSFV2ObtockCHIGQ9IyJelE2NhbGMoZx8l4bF+2FycYv5cDQJkJMjb/yuDtPz1YZjZsjflF
	N66ny/+DXM0MiBiwFRLJbNwpaQBsUNra2En7E4wLn+ci8P9zvFgj1uwlA10f8fxQbtNE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Support LLVM raw profile versions 5, 6, 7, 8, 9, and 10
Message-Id: <E1vDVwY-007DZb-0H@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 22:44:02 +0000

commit 186c02e85961bea97415ae41d5ac22e70a2c98b5
Author:     Saman Dehghan <samaan.dehghan@gmail.com>
AuthorDate: Mon Oct 27 16:30:51 2025 -0500
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 22:29:06 2025 +0000

    xen: Support LLVM raw profile versions 5, 6, 7, 8, 9, and 10
    
    This change enables compatibility for measuring code coverage
    with Clang versions 11 through 20 by supporting their respective raw
    profile formats.
    
    1- Added support for LLVM raw profile versions 5, 6, 7, 8, 9, and 10.
    2- Initialized llvm_profile_header for all versions based on llvm source
       code in compiler-rt/include/profile/InstrProfData.inc for each version.
    3- We tested this patch for all Clang versions from 11 through 20
       on x86 platform.
    4- Fixed linking warnings related to LLVM profile sections in x86.
    
    Signed-off-by: Saman Dehghan <samaan.dehghan@gmail.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Tested-by: Wentao Zhang <wentaoz5@illinois.edu>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/xen.lds.S     |  6 ++++++
 xen/common/coverage/llvm.c | 54 ++++++++++++++++++++++++++++++++++++++++------
 xen/include/xen/xen.lds.h  | 13 +++++++++++
 3 files changed, 67 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 966e514f20..5d02f83a40 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -186,6 +186,8 @@ SECTIONS
   } PHDR(note) PHDR(text)
 #endif
 
+  LLVM_COV_RO_DATA
+
   _erodata = .;
 
   . = ALIGN(SECTION_ALIGN);
@@ -323,6 +325,8 @@ SECTIONS
        *(.data .data.*)
   } PHDR(text)
 
+  LLVM_COV_RW_DATA
+
   DECL_SECTION(.bss) {
        __bss_start = .;
        *(.bss.page_aligned*)
@@ -357,6 +361,8 @@ SECTIONS
 
   DWARF2_DEBUG_SECTIONS
 
+  LLVM_COV_DEBUG
+
 #ifdef CONFIG_HYPERV_GUEST
   hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE - XEN_VIRT_START + __XEN_VIRT_START);
 #endif
diff --git a/xen/common/coverage/llvm.c b/xen/common/coverage/llvm.c
index 517b2aa8c2..532889c857 100644
--- a/xen/common/coverage/llvm.c
+++ b/xen/common/coverage/llvm.c
@@ -44,27 +44,65 @@
     ((uint64_t)'f' << 16) | ((uint64_t)'R' << 8)  | ((uint64_t)129)
 #endif
 
-#define LLVM_PROFILE_VERSION    4
+#if __clang_major__ >= 19 && __clang_major__ <= 20
+#define LLVM_PROFILE_VERSION    10
+#define LLVM_PROFILE_NUM_KINDS  3
+#elif __clang_major__ == 18
+#define LLVM_PROFILE_VERSION    9
 #define LLVM_PROFILE_NUM_KINDS  2
+#elif __clang_major__ >= 14
+#define LLVM_PROFILE_VERSION    8
+#define LLVM_PROFILE_NUM_KINDS  2
+#elif __clang_major__ == 13
+#define LLVM_PROFILE_VERSION    7
+#define LLVM_PROFILE_NUM_KINDS  2
+#elif __clang_major__ >= 11
+#define LLVM_PROFILE_VERSION    5
+#define LLVM_PROFILE_NUM_KINDS  2
+#else
+#error "LLVM coverage selected but an unsupported clang version is used"
+#endif
 
 struct llvm_profile_data {
     uint64_t name_ref;
     uint64_t function_hash;
-    void *counter;
+    void *relative_counter;
+#if LLVM_PROFILE_VERSION >= 9
+    void *relative_bitmap;
+#endif
     void *function;
     void *values;
     uint32_t nr_counters;
     uint16_t nr_value_sites[LLVM_PROFILE_NUM_KINDS];
+#if LLVM_PROFILE_VERSION >= 9
+    uint32_t numbitmap_bytes;
+#endif
 };
 
 struct llvm_profile_header {
     uint64_t magic;
     uint64_t version;
-    uint64_t data_size;
-    uint64_t counters_size;
+#if LLVM_PROFILE_VERSION >= 7
+    uint64_t binary_ids_size;
+#endif
+    uint64_t num_data;
+    uint64_t padding_bytes_before_counters;
+    uint64_t num_counters;
+    uint64_t padding_bytes_after_counters;
+#if LLVM_PROFILE_VERSION >= 9
+    uint64_t num_bitmap_bytes;
+    uint64_t padding_bytes_after_bitmap_bytes;
+#endif
     uint64_t names_size;
     uint64_t counters_delta;
+#if LLVM_PROFILE_VERSION >= 9
+    uint64_t bitmap_delta;
+#endif
     uint64_t names_delta;
+#if LLVM_PROFILE_VERSION == 10
+    uint64_t num_vtables;
+    uint64_t vnames_size;
+#endif
     uint64_t value_kind_last;
 };
 
@@ -107,10 +145,14 @@ static int cf_check dump(
     struct llvm_profile_header header = {
         .magic = LLVM_PROFILE_MAGIC,
         .version = LLVM_PROFILE_VERSION,
-        .data_size = (END_DATA - START_DATA) / sizeof(struct llvm_profile_data),
-        .counters_size = (END_COUNTERS - START_COUNTERS) / sizeof(uint64_t),
+        .num_data = DIV_ROUND_UP(END_DATA - START_DATA, sizeof(struct llvm_profile_data)),
+        .num_counters = DIV_ROUND_UP(END_COUNTERS - START_COUNTERS, sizeof(uint64_t)),
         .names_size = END_NAMES - START_NAMES,
+#if LLVM_PROFILE_VERSION >= 8
+        .counters_delta = START_COUNTERS - START_DATA,
+#else
         .counters_delta = (uintptr_t)START_COUNTERS,
+#endif
         .names_delta = (uintptr_t)START_NAMES,
         .value_kind_last = LLVM_PROFILE_NUM_KINDS - 1,
     };
diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index b126dfe887..d80c895959 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -81,6 +81,19 @@
   .stab.index 0 : { *(.stab.index) }         \
   .stab.indexstr 0 : { *(.stab.indexstr) }
 
+/* Clang coverage sections. */
+#define LLVM_COV_RW_DATA                                   \
+    DECL_SECTION(__llvm_prf_cnts) { *(__llvm_prf_cnts) }   \
+    DECL_SECTION(__llvm_prf_data) { *(__llvm_prf_data) }   \
+    DECL_SECTION(__llvm_prf_bits) { *(__llvm_prf_bits) }
+
+#define LLVM_COV_RO_DATA                                   \
+    DECL_SECTION(__llvm_prf_names) { *(__llvm_prf_names) }
+
+#define LLVM_COV_DEBUG                                     \
+    DECL_DEBUG(__llvm_covfun, 8)                           \
+    DECL_DEBUG(__llvm_covmap, 8)
+
 /*
  * ELF sections.
  *
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 22:55:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 22:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151905.1482435 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDW7C-0002CE-Sn; Mon, 27 Oct 2025 22:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151905.1482435; Mon, 27 Oct 2025 22: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 1vDW7C-0002C6-Q9; Mon, 27 Oct 2025 22:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1151905;
 Mon, 27 Oct 2025 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 1vDW7C-0002C0-38
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 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 1vDW7B-004t9y-2d
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 22:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDW7B-007Exo-38
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 22: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=D/uVyQRwN3FmUGSxVtrphZnYOKMrXVTKUplidUYc3HM=; b=yuN5srELsMeG5QgZHcVfgZzpL+
	k/gaQm33d3elxCj6WDETKRY9fHPcybMWVnntZ8nLfR4l33STvelmVnXoyI9ry+V1CgL/WQ9P8WPtQ
	65V+0774JMzogJu55vfam+mXYAjREFikL0E78lwEj7BzpRgMo7bKPxU3zC0fmgNDqL14=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: fix randconfig build problems after introducing SYSCTL
Message-Id: <E1vDW7B-007Exo-38@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 22:55:01 +0000

commit 6c80f0dd1bbc1fd514bae0dfcba4bdea2125ed25
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Wed Oct 22 16:21:30 2025 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon Oct 27 15:41:58 2025 -0700

    xen: fix randconfig build problems after introducing SYSCTL
    
    Fix a few randconfig build breakages that started appearing after the
    SYSCTL patch series.
    
    First, reintroduce depends on !PV_SHIM_EXCLUSIVE for HVM, as it was
    before 568f806cba4c.
    
    Also, add depends on !PV_SHIM_EXCLUSIVE for SYSCTL, that way the
    behavior goes back to what it was before 34317c508294.
    
    Fixes: 568f806cba4c ("xen/x86: remove "depends on !PV_SHIM_EXCLUSIVE"")
    Fixes: 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    CC: jbeulich@suse.com
    CC: andrew.cooper3@citrix.com
    CC: roger.pau@citrix.com
    CC: Penny.Zheng@amd.com
---
 xen/arch/x86/hvm/Kconfig | 1 +
 xen/common/Kconfig       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig
index 5cb9f29042..f10a2b3744 100644
--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -1,5 +1,6 @@
 menuconfig HVM
 	bool "HVM support"
+	depends on !PV_SHIM_EXCLUSIVE
 	default !PV_SHIM
 	select COMPAT
 	select IOREQ_SERVER
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 76f9ce705f..53f681bbb2 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -653,6 +653,7 @@ menu "Supported hypercall interfaces"
 
 config SYSCTL
 	bool "Enable sysctl hypercall"
+	depends on !PV_SHIM_EXCLUSIVE
 	default y
 	help
 	  This option shall only be disabled on some dom0less systems, or
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 23:44:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 23:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151908.1482439 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWsd-0000JN-8e; Mon, 27 Oct 2025 23:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151908.1482439; Mon, 27 Oct 2025 23: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 1vDWsd-0000JE-60; Mon, 27 Oct 2025 23:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1151908;
 Mon, 27 Oct 2025 23: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 1vDWsb-0000J8-M7
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 23: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 1vDWsb-004u6b-1Q
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDWsb-007LjK-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x9zoHeCEyBIgMbw25WJeDHXaXB5HDjAszgvYNPLXq5M=; b=V+7VYYouojubm+eK7D93W2uckK
	5i5qOR4sG3pGGPxz0wLTrMhuwjndvgb/EUyIwSatc7+3x9nCIorJYKHQTo3Vl1y5mHKdrx6JC9hGp
	BeAGrBzkCItrPdZY0l0hYXiLNMvZCvVBkgg1ZuKbao9Vj3fbZOnZMhrxQfc7FdSm9o1U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: correct PG_log_dirty definition again
Message-Id: <E1vDWsb-007LjK-1v@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 23:44:01 +0000

commit 816db17db1a080fe48992e7b727ca2a40b81ef79
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 15:49:44 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:49:44 2025 +0100

    x86/mm: correct PG_log_dirty definition again
    
    The earlier change wasn't correct as far as shim-exclusive mode goes:
    Shadow mode is still to be enabled permitted there, yet the generic
    paging-log-dirty (and more generally domctl) part of the code still is
    unwanted (and cannot be used anyway, as domctl_lock_acquire() isn't
    available).
    
    Fixes: 2ae8a68df21e ("x86/mm: correct PG_log_dirty definition")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/include/asm/paging.h | 2 +-
 xen/include/hypercall-defs.c      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 1b0694bb36..0c06b0a7a8 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -55,7 +55,7 @@
 #define PG_translate   0
 #define PG_external    0
 #endif
-#ifdef CONFIG_PAGING
+#if defined(CONFIG_PAGING) && !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 /* Enable log dirty mode */
 #define PG_log_dirty   (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shift)
 #else
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index 8370b4b289..cef08eeec1 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -197,7 +197,7 @@ dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_buf_t *bufs)
 #ifdef CONFIG_SYSCTL
 sysctl(xen_sysctl_t *u_sysctl)
 #endif
-#if defined(CONFIG_X86) && defined(CONFIG_PAGING)
+#if defined(CONFIG_X86) && defined(CONFIG_PAGING) && !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 paging_domctl_cont(xen_domctl_t *u_domctl)
 #endif
 #ifndef CONFIG_PV_SHIM_EXCLUSIVE
@@ -298,7 +298,7 @@ dm_op                              compat   do       compat   do       do
 hypfs_op                           do       do       do       do       do
 #endif
 mca                                do       do       -        -        -
-#if defined(CONFIG_X86) && defined(CONFIG_PAGING)
+#if defined(CONFIG_X86) && defined(CONFIG_PAGING) && !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 paging_domctl_cont                 do       do       do       do       -
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 23:44:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 23:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151909.1482443 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWsn-0000LQ-Ca; Mon, 27 Oct 2025 23:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151909.1482443; Mon, 27 Oct 2025 23: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 1vDWsn-0000LJ-9m; Mon, 27 Oct 2025 23:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1151909;
 Mon, 27 Oct 2025 23: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 1vDWsl-0000L7-PQ
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 23: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 1vDWsl-004u6u-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDWsl-007LnD-2F
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3ee1n5U8bBnXcdabCRdR4P7dQtkhM7HfFsgVgRGxGGM=; b=mFl2s+oY2R3r6q85YHvqfFQ6Et
	5QVNKnxZXDncX+MxaB5tO47I6rNxtcKOelbJg5UnJRoB/hNgkEUj6XzYJrbG35vcJ/9dySVOsZ9yK
	v77JohxRE6MkKKe61Ipzx7TfRss1pgbW8Er3WReuXXZblqZLgbSC4Ec16XkW29qoKQy0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: deal with unused channels
Message-Id: <E1vDWsl-007LnD-2F@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 23:44:11 +0000

commit 24f608dc909ed6b6fefb6c35b6de39e851bba6eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 15:51:03 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:51:03 2025 +0100

    x86/HPET: deal with unused channels
    
    Keeping channels enabled when they're unused is only causing problems:
    Extra interrupts harm performance, and extra nested interrupts could even
    have caused worse problems. However, on all Intel hardware I looked at
    closely, a 0->1 transition of the enable bit causes an immediate IRQ.
    Hence disabling channels isn't a good idea there. Set a "long" timeout
    instead.
    
    Along with that also "clear" the channel's "next event", for it to be
    properly written by whatever the next user is going to want (possibly
    avoiding too early an IRQ).
    
    Further, along the same lines, don't enable channels early when starting
    up an IRQ. This doesn't need to happen earlier than from
    set_channel_irq_affinity() (once a channel goes into use the very first
    time). This eliminates a single instance of
    
    (XEN) [VT-D]INTR-REMAP: Request device [0000:00:1f.0] fault index 0
    (XEN) [VT-D]INTR-REMAP: reason 25 - Blocked a compatibility format interrupt request
    
    during boot. (Why exactly there's only one instance, when we use multiple
    counters and hence multiple IRQs, I can't tell. My understanding would be
    that this was due to __hpet_setup_msi_irq() being called only after
    request_irq() [and hence the .startup handler], yet that should have
    affected all channels.)
    
    Fixes: 3ba523ff957c ("CPUIDLE: enable MSI capable HPET for timer broadcast")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hpet.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index d05b5eb136..1a84a37bb9 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -295,12 +295,6 @@ static int hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
     return 0;
 }
 
-static unsigned int cf_check hpet_msi_startup(struct irq_desc *desc)
-{
-    hpet_msi_unmask(desc);
-    return 0;
-}
-
 #define hpet_msi_shutdown hpet_msi_mask
 
 static void cf_check hpet_msi_set_affinity(
@@ -326,7 +320,7 @@ static void cf_check hpet_msi_set_affinity(
  */
 static hw_irq_controller hpet_msi_type = {
     .typename   = "HPET-MSI",
-    .startup    = hpet_msi_startup,
+    .startup    = irq_startup_none,
     .shutdown   = hpet_msi_shutdown,
     .enable	    = hpet_msi_unmask,
     .disable    = hpet_msi_mask,
@@ -526,6 +520,8 @@ static void hpet_detach_channel(unsigned int cpu,
         spin_unlock_irq(&ch->lock);
     else if ( (next = cpumask_first(ch->cpumask)) >= nr_cpu_ids )
     {
+        hpet_write32(hpet_read32(HPET_COUNTER), HPET_Tn_CMP(ch->idx));
+        ch->next_event = STIME_MAX;
         ch->cpu = -1;
         clear_bit(HPET_EVT_USED_BIT, &ch->flags);
         spin_unlock_irq(&ch->lock);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 23:44:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 23:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151910.1482448 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWsx-0000Ns-ES; Mon, 27 Oct 2025 23:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151910.1482448; Mon, 27 Oct 2025 23:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWsx-0000Nk-BP; Mon, 27 Oct 2025 23:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1151910;
 Mon, 27 Oct 2025 23:44: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 1vDWsv-0000NY-Sq
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 23: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 1vDWsv-004u73-28
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDWsv-007Lp7-2d
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ntEoQuAtOoHT2006X85k03aHCgqjyym5GqnJ1JvWTWw=; b=uUhb48O26ReewB9wUPMSdjvy3I
	2Ov1K/Xxy/2OAMJRfTIAffCY/Vp/eEER/KfA3SCfm3Ae+9Y8t2D2Mfqss/VZPTCaqbTmZcHYTKlpa
	Zvnp3KqZJLO0fJuneGT7W0TcNOOcJWA6hBVRGl9yrK0k/fDQ+4Olvptk/aXKeJKrSXKc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: use single, global, low-priority vector for broadcast IRQ
Message-Id: <E1vDWsv-007Lp7-2d@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 23:44:21 +0000

commit 8ef32772b5483ef2d45aee5adc5ba485077c7fbb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 27 15:51:42 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:51:42 2025 +0100

    x86/HPET: use single, global, low-priority vector for broadcast IRQ
    
    Using dynamically allocated / maintained vectors has several downsides:
    - possible nesting of IRQs due to the effects of IRQ migration,
    - reduction of vectors available for devices,
    - IRQs not moving as intended if there's shortage of vectors,
    - higher runtime overhead.
    
    As the vector also doesn't need to be of any priority (first and foremost
    it really shouldn't be of higher or same priority as the timer IRQ, as
    that raises TIMER_SOFTIRQ anyway), simply use the lowest one above the
    legacy range. The vector needs reserving early, until it is known whether
    it actually is used. If it isn't, it's made available for general use.
    
    With a fixed vector, less updating is now necessary in
    set_channel_irq_affinity(); in particular channels don't need transiently
    masking anymore, as the necessary update is now atomic. To fully leverage
    this, however, we want to stop using hpet_msi_set_affinity() there. With
    the transient masking dropped, we're no longer at risk of missing events.
    
    AMD interrupt remapping code so far didn't "return" a consistent MSI
    address when translating an MSI message. Clear respective fields there, to
    keep the related assertion in set_channel_irq_affinity() from triggering.
    
    Fixes: 996576b965cc ("xen: allow up to 16383 cpus")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hpet.c                      | 87 +++++++++++++++++++++++++-------
 xen/arch/x86/include/asm/hpet.h          |  1 +
 xen/arch/x86/include/asm/irq-vectors.h   |  3 ++
 xen/arch/x86/include/asm/irq.h           |  1 +
 xen/arch/x86/irq.c                       | 13 +++++
 xen/arch/x86/time.c                      |  2 +
 xen/drivers/passthrough/amd/iommu_intr.c |  7 +++
 7 files changed, 96 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1a84a37bb9..6d5e6fb530 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -9,17 +9,19 @@
 #include <xen/timer.h>
 #include <xen/smp.h>
 #include <xen/softirq.h>
+#include <xen/cpuidle.h>
 #include <xen/irq.h>
 #include <xen/numa.h>
 #include <xen/param.h>
 #include <xen/sched.h>
 
 #include <asm/apic.h>
-#include <asm/fixmap.h>
 #include <asm/div64.h>
+#include <asm/fixmap.h>
+#include <asm/genapic.h>
 #include <asm/hpet.h>
+#include <asm/irq-vectors.h>
 #include <asm/msi.h>
-#include <xen/cpuidle.h>
 
 #define MAX_DELTA_NS MILLISECS(10*1000)
 #define MIN_DELTA_NS MICROSECS(20)
@@ -251,10 +253,9 @@ static void cf_check hpet_interrupt_handler(int irq, void *data)
     ch->event_handler(ch);
 }
 
-static void cf_check hpet_msi_unmask(struct irq_desc *desc)
+static void hpet_enable_channel(struct hpet_event_channel *ch)
 {
     u32 cfg;
-    struct hpet_event_channel *ch = desc->action->dev_id;
 
     cfg = hpet_read32(HPET_Tn_CFG(ch->idx));
     cfg |= HPET_TN_ENABLE;
@@ -262,6 +263,11 @@ static void cf_check hpet_msi_unmask(struct irq_desc *desc)
     ch->msi.msi_attrib.host_masked = 0;
 }
 
+static void cf_check hpet_msi_unmask(struct irq_desc *desc)
+{
+    hpet_enable_channel(desc->action->dev_id);
+}
+
 static void cf_check hpet_msi_mask(struct irq_desc *desc)
 {
     u32 cfg;
@@ -303,15 +309,13 @@ static void cf_check hpet_msi_set_affinity(
     struct hpet_event_channel *ch = desc->action->dev_id;
     struct msi_msg msg = ch->msi.msg;
 
-    msg.dest32 = set_desc_affinity(desc, mask);
-    if ( msg.dest32 == BAD_APICID )
-        return;
+    /* This really is only for dump_irqs(). */
+    cpumask_copy(desc->arch.cpu_mask, mask);
 
-    msg.data &= ~MSI_DATA_VECTOR_MASK;
-    msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
+    msg.dest32 = cpu_mask_to_apicid(mask);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(msg.dest32);
-    if ( msg.data != ch->msi.msg.data || msg.dest32 != ch->msi.msg.dest32 )
+    if ( msg.dest32 != ch->msi.msg.dest32 )
         hpet_msi_write(ch, &msg);
 }
 
@@ -324,7 +328,7 @@ static hw_irq_controller hpet_msi_type = {
     .shutdown   = hpet_msi_shutdown,
     .enable	    = hpet_msi_unmask,
     .disable    = hpet_msi_mask,
-    .ack        = ack_nonmaskable_msi_irq,
+    .ack        = irq_actor_none,
     .end        = end_nonmaskable_irq,
     .set_affinity   = hpet_msi_set_affinity,
 };
@@ -343,6 +347,16 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
     u32 cfg = hpet_read32(HPET_Tn_CFG(ch->idx));
     irq_desc_t *desc = irq_to_desc(ch->msi.irq);
 
+    clear_irq_vector(ch->msi.irq);
+    /*
+     * Technically we don't want to bind the IRQ to any CPU yet, but we need to
+     * specify at least one online one here.  Use the BSP.
+     */
+    ret = bind_irq_vector(ch->msi.irq, HPET_BROADCAST_VECTOR, cpumask_of(0));
+    if ( ret )
+        return ret;
+    cpumask_setall(desc->affinity);
+
     if ( iommu_intremap != iommu_intremap_off )
     {
         ch->msi.hpet_id = hpet_blockid;
@@ -472,19 +486,50 @@ static struct hpet_event_channel *hpet_get_channel(unsigned int cpu)
 static void set_channel_irq_affinity(struct hpet_event_channel *ch)
 {
     struct irq_desc *desc = irq_to_desc(ch->msi.irq);
+    struct msi_msg msg = ch->msi.msg;
 
     ASSERT(!local_irq_is_enabled());
     spin_lock(&desc->lock);
-    hpet_msi_mask(desc);
-    hpet_msi_set_affinity(desc, cpumask_of(ch->cpu));
-    hpet_msi_unmask(desc);
+
+    per_cpu(vector_irq, ch->cpu)[HPET_BROADCAST_VECTOR] = ch->msi.irq;
+
+    /*
+     * Open-coding a reduced form of hpet_msi_set_affinity() here.  With the
+     * actual update below (either of the IRTE or of [just] message address;
+     * with interrupt remapping message address/data don't change) now being
+     * atomic, we can avoid masking the IRQ around the update.  As a result
+     * we're no longer at risk of missing IRQs (provided hpet_broadcast_enter()
+     * keeps setting the new deadline only afterwards).
+     */
+    cpumask_copy(desc->arch.cpu_mask, cpumask_of(ch->cpu));
+
     spin_unlock(&desc->lock);
 
-    spin_unlock(&ch->lock);
+    msg.dest32 = cpu_physical_id(ch->cpu);
+    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
+    msg.address_lo |= MSI_ADDR_DEST_ID(msg.dest32);
+    if ( msg.dest32 != ch->msi.msg.dest32 )
+    {
+        ch->msi.msg = msg;
 
-    /* We may have missed an interrupt due to the temporary masking. */
-    if ( ch->event_handler && ch->next_event < NOW() )
-        ch->event_handler(ch);
+        if ( iommu_intremap != iommu_intremap_off )
+        {
+            int rc = iommu_update_ire_from_msi(&ch->msi, &msg);
+
+            ASSERT(rc <= 0);
+            if ( rc >= 0 )
+            {
+                ASSERT(msg.data == hpet_read32(HPET_Tn_ROUTE(ch->idx)));
+                ASSERT(msg.address_lo ==
+                       hpet_read32(HPET_Tn_ROUTE(ch->idx) + 4));
+            }
+        }
+        else
+            hpet_write32(msg.address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
+    }
+
+    hpet_enable_channel(ch);
+    spin_unlock(&ch->lock);
 }
 
 static void hpet_attach_channel(unsigned int cpu,
@@ -622,6 +667,12 @@ void __init hpet_broadcast_init(void)
         hpet_events->flags = HPET_EVT_LEGACY;
 }
 
+void __init hpet_broadcast_late_init(void)
+{
+    if ( !num_hpets_used )
+        free_lopriority_vector(HPET_BROADCAST_VECTOR);
+}
+
 void hpet_broadcast_resume(void)
 {
     u32 cfg;
diff --git a/xen/arch/x86/include/asm/hpet.h b/xen/arch/x86/include/asm/hpet.h
index c402c63168..73f34050da 100644
--- a/xen/arch/x86/include/asm/hpet.h
+++ b/xen/arch/x86/include/asm/hpet.h
@@ -90,6 +90,7 @@ void hpet_disable_legacy_replacement_mode(void);
  * rather than using the LAPIC timer. Used for Cx state entry.
  */
 void hpet_broadcast_init(void);
+void hpet_broadcast_late_init(void);
 void hpet_broadcast_resume(void);
 void cf_check hpet_broadcast_enter(void);
 void cf_check hpet_broadcast_exit(void);
diff --git a/xen/arch/x86/include/asm/irq-vectors.h b/xen/arch/x86/include/asm/irq-vectors.h
index f546aedd87..d75d1c5671 100644
--- a/xen/arch/x86/include/asm/irq-vectors.h
+++ b/xen/arch/x86/include/asm/irq-vectors.h
@@ -22,6 +22,9 @@
 #define FIRST_LEGACY_VECTOR     FIRST_DYNAMIC_VECTOR
 #define LAST_LEGACY_VECTOR      (FIRST_LEGACY_VECTOR + 0xf)
 
+/* HPET broadcast is statically allocated and wants to be low priority. */
+#define HPET_BROADCAST_VECTOR   (LAST_LEGACY_VECTOR + 1)
+
 #ifdef CONFIG_PV32
 #define HYPERCALL_VECTOR        0x82
 #endif
diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 8c81f66434..7315150b66 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -116,6 +116,7 @@ void cf_check call_function_interrupt(void);
 void cf_check irq_move_cleanup_interrupt(void);
 
 uint8_t alloc_hipriority_vector(void);
+void free_lopriority_vector(uint8_t vector);
 
 void set_direct_apic_vector(uint8_t vector, void (*handler)(void));
 void alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void));
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 556134f85a..ba2f02eb0c 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -468,6 +468,12 @@ int __init init_irq_data(void)
           vector++ )
         __set_bit(vector, used_vectors);
 
+    /*
+     * Prevent the HPET broadcast vector from being used, until it is known
+     * whether it's actually needed.
+     */
+    __set_bit(HPET_BROADCAST_VECTOR, used_vectors);
+
     return 0;
 }
 
@@ -991,6 +997,13 @@ void alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void))
     spin_unlock(&lock);
 }
 
+/* This could free any vectors, but is needed only for low-prio ones. */
+void __init free_lopriority_vector(uint8_t vector)
+{
+    ASSERT(vector < FIRST_HIPRIORITY_VECTOR);
+    clear_bit(vector, used_vectors);
+}
+
 static void cf_check irq_ratelimit_timer_fn(void *data)
 {
     struct irq_desc *desc, *tmp;
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 59129f419d..ece9ae0b34 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2675,6 +2675,8 @@ static int __init cf_check disable_pit_irq(void)
                "Force enable with 'cpuidle'.\n");
     }
 
+    hpet_broadcast_late_init();
+
     return 0;
 }
 __initcall(disable_pit_irq);
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 7dae89bcc0..2e22ee1ffe 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -551,6 +551,13 @@ int cf_check amd_iommu_msi_msg_update_ire(
         for ( i = 1; i < nr; ++i )
             msi_desc[i].remap_index = msi_desc->remap_index + i;
         msg->data = data;
+        /*
+         * While the low address bits don't matter, "canonicalize" the address
+         * by zapping the bits that were transferred to the IRTE.  This way
+         * callers can check for there actually needing to be an update to
+         * wherever the address is put.
+         */
+        msg->address_lo &= ~(MSI_ADDR_DESTMODE_MASK | MSI_ADDR_DEST_ID_MASK);
     }
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 23:44:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 23:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151911.1482451 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWt7-0000QE-FS; Mon, 27 Oct 2025 23:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151911.1482451; Mon, 27 Oct 2025 23:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWt7-0000Q6-Cn; Mon, 27 Oct 2025 23:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1151911;
 Mon, 27 Oct 2025 23: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 1vDWt6-0000Py-03
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 23: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 1vDWt5-004u7P-2S
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDWt5-007Lr5-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UUy5Nk9k+kqK5/mmyFm/EapDjNhQRBWS6j0wXXZwNGk=; b=3m5eNQtVTJ88ehZfd583iLknry
	UqWVA6c1Z/2n423pjBvLB7w7aMXaajA5ZZ8ANFcpo+p2zN5nUGzpwSN8XuyyNa/vFZeHDWYRZoGQi
	O4LCeoIunFzvFZgYqJO/zU5zaMCJO2G5tf/minBlMqK2G1hWEpyhUFp/ehkGG8uOjguw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/pci: prevent infinite loop for faulty SR-IOV cards
Message-Id: <E1vDWt5-007Lr5-2x@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 23:44:31 +0000

commit f7091c0e1fd43877621d4eb2c1c4106797b3c551
Author:     Frediano Ziglio <frediano.ziglio@cloud.com>
AuthorDate: Mon Oct 27 15:52:20 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 27 15:52:20 2025 +0100

    xen/pci: prevent infinite loop for faulty SR-IOV cards
    
    If a SR-IOV card presents an I/O space inside a BAR the
    code will continue to loop on the same card.
    This is due to the missing increment of the cycle variable.
    
    Fixes: a1a6d59862f4 ("pci: split code to size BARs from pci_add_device")
    Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 3edcfa8a04..52c22fa50c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -746,6 +746,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
                     printk(XENLOG_WARNING
                            "SR-IOV device %pp with vf BAR%u in IO space\n",
                            &pdev->sbdf, i);
+                    ++i;
                     continue;
                 }
                 ret = pci_size_mem_bar(pdev->sbdf, idx, NULL,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 27 23:44:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Oct 2025 23:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151912.1482455 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWtH-0000SH-Gk; Mon, 27 Oct 2025 23:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151912.1482455; Mon, 27 Oct 2025 23:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDWtH-0000S9-ED; Mon, 27 Oct 2025 23:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1151912;
 Mon, 27 Oct 2025 23: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 1vDWtG-0000Rz-2z
 for xen-changelog@lists.xenproject.org; Mon, 27 Oct 2025 23: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 1vDWtF-004u7Z-2m
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDWtG-007Lt6-03
 for xen-changelog@lists.xenproject.org;
 Mon, 27 Oct 2025 23: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=InrdaF4KfxwcV7m8D+nDKyGUzZE7Gr1t9ra9yYi1cVk=; b=inYMzuiG9IG+307AIKDZk0dEdk
	ByQPJQ6yZjkJXD1edGAUeQ4vIMJt5/VyrocUUEdC74Xie17aU+5jkCA424Woze3bqGNgCFgh3cqfg
	gW1JjKxTxRzkten4YUCQpn9mvtgB34/bRq65qp36p8mCYYkkLLeyVeJ3XyFkfmnjzwPg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Support LLVM raw profile versions 5, 6, 7, 8, 9, and 10
Message-Id: <E1vDWtG-007Lt6-03@xenbits.xenproject.org>
Date: Mon, 27 Oct 2025 23:44:42 +0000

commit 186c02e85961bea97415ae41d5ac22e70a2c98b5
Author:     Saman Dehghan <samaan.dehghan@gmail.com>
AuthorDate: Mon Oct 27 16:30:51 2025 -0500
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Oct 27 22:29:06 2025 +0000

    xen: Support LLVM raw profile versions 5, 6, 7, 8, 9, and 10
    
    This change enables compatibility for measuring code coverage
    with Clang versions 11 through 20 by supporting their respective raw
    profile formats.
    
    1- Added support for LLVM raw profile versions 5, 6, 7, 8, 9, and 10.
    2- Initialized llvm_profile_header for all versions based on llvm source
       code in compiler-rt/include/profile/InstrProfData.inc for each version.
    3- We tested this patch for all Clang versions from 11 through 20
       on x86 platform.
    4- Fixed linking warnings related to LLVM profile sections in x86.
    
    Signed-off-by: Saman Dehghan <samaan.dehghan@gmail.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Tested-by: Wentao Zhang <wentaoz5@illinois.edu>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/xen.lds.S     |  6 ++++++
 xen/common/coverage/llvm.c | 54 ++++++++++++++++++++++++++++++++++++++++------
 xen/include/xen/xen.lds.h  | 13 +++++++++++
 3 files changed, 67 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 966e514f20..5d02f83a40 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -186,6 +186,8 @@ SECTIONS
   } PHDR(note) PHDR(text)
 #endif
 
+  LLVM_COV_RO_DATA
+
   _erodata = .;
 
   . = ALIGN(SECTION_ALIGN);
@@ -323,6 +325,8 @@ SECTIONS
        *(.data .data.*)
   } PHDR(text)
 
+  LLVM_COV_RW_DATA
+
   DECL_SECTION(.bss) {
        __bss_start = .;
        *(.bss.page_aligned*)
@@ -357,6 +361,8 @@ SECTIONS
 
   DWARF2_DEBUG_SECTIONS
 
+  LLVM_COV_DEBUG
+
 #ifdef CONFIG_HYPERV_GUEST
   hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE - XEN_VIRT_START + __XEN_VIRT_START);
 #endif
diff --git a/xen/common/coverage/llvm.c b/xen/common/coverage/llvm.c
index 517b2aa8c2..532889c857 100644
--- a/xen/common/coverage/llvm.c
+++ b/xen/common/coverage/llvm.c
@@ -44,27 +44,65 @@
     ((uint64_t)'f' << 16) | ((uint64_t)'R' << 8)  | ((uint64_t)129)
 #endif
 
-#define LLVM_PROFILE_VERSION    4
+#if __clang_major__ >= 19 && __clang_major__ <= 20
+#define LLVM_PROFILE_VERSION    10
+#define LLVM_PROFILE_NUM_KINDS  3
+#elif __clang_major__ == 18
+#define LLVM_PROFILE_VERSION    9
 #define LLVM_PROFILE_NUM_KINDS  2
+#elif __clang_major__ >= 14
+#define LLVM_PROFILE_VERSION    8
+#define LLVM_PROFILE_NUM_KINDS  2
+#elif __clang_major__ == 13
+#define LLVM_PROFILE_VERSION    7
+#define LLVM_PROFILE_NUM_KINDS  2
+#elif __clang_major__ >= 11
+#define LLVM_PROFILE_VERSION    5
+#define LLVM_PROFILE_NUM_KINDS  2
+#else
+#error "LLVM coverage selected but an unsupported clang version is used"
+#endif
 
 struct llvm_profile_data {
     uint64_t name_ref;
     uint64_t function_hash;
-    void *counter;
+    void *relative_counter;
+#if LLVM_PROFILE_VERSION >= 9
+    void *relative_bitmap;
+#endif
     void *function;
     void *values;
     uint32_t nr_counters;
     uint16_t nr_value_sites[LLVM_PROFILE_NUM_KINDS];
+#if LLVM_PROFILE_VERSION >= 9
+    uint32_t numbitmap_bytes;
+#endif
 };
 
 struct llvm_profile_header {
     uint64_t magic;
     uint64_t version;
-    uint64_t data_size;
-    uint64_t counters_size;
+#if LLVM_PROFILE_VERSION >= 7
+    uint64_t binary_ids_size;
+#endif
+    uint64_t num_data;
+    uint64_t padding_bytes_before_counters;
+    uint64_t num_counters;
+    uint64_t padding_bytes_after_counters;
+#if LLVM_PROFILE_VERSION >= 9
+    uint64_t num_bitmap_bytes;
+    uint64_t padding_bytes_after_bitmap_bytes;
+#endif
     uint64_t names_size;
     uint64_t counters_delta;
+#if LLVM_PROFILE_VERSION >= 9
+    uint64_t bitmap_delta;
+#endif
     uint64_t names_delta;
+#if LLVM_PROFILE_VERSION == 10
+    uint64_t num_vtables;
+    uint64_t vnames_size;
+#endif
     uint64_t value_kind_last;
 };
 
@@ -107,10 +145,14 @@ static int cf_check dump(
     struct llvm_profile_header header = {
         .magic = LLVM_PROFILE_MAGIC,
         .version = LLVM_PROFILE_VERSION,
-        .data_size = (END_DATA - START_DATA) / sizeof(struct llvm_profile_data),
-        .counters_size = (END_COUNTERS - START_COUNTERS) / sizeof(uint64_t),
+        .num_data = DIV_ROUND_UP(END_DATA - START_DATA, sizeof(struct llvm_profile_data)),
+        .num_counters = DIV_ROUND_UP(END_COUNTERS - START_COUNTERS, sizeof(uint64_t)),
         .names_size = END_NAMES - START_NAMES,
+#if LLVM_PROFILE_VERSION >= 8
+        .counters_delta = START_COUNTERS - START_DATA,
+#else
         .counters_delta = (uintptr_t)START_COUNTERS,
+#endif
         .names_delta = (uintptr_t)START_NAMES,
         .value_kind_last = LLVM_PROFILE_NUM_KINDS - 1,
     };
diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index b126dfe887..d80c895959 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -81,6 +81,19 @@
   .stab.index 0 : { *(.stab.index) }         \
   .stab.indexstr 0 : { *(.stab.indexstr) }
 
+/* Clang coverage sections. */
+#define LLVM_COV_RW_DATA                                   \
+    DECL_SECTION(__llvm_prf_cnts) { *(__llvm_prf_cnts) }   \
+    DECL_SECTION(__llvm_prf_data) { *(__llvm_prf_data) }   \
+    DECL_SECTION(__llvm_prf_bits) { *(__llvm_prf_bits) }
+
+#define LLVM_COV_RO_DATA                                   \
+    DECL_SECTION(__llvm_prf_names) { *(__llvm_prf_names) }
+
+#define LLVM_COV_DEBUG                                     \
+    DECL_DEBUG(__llvm_covfun, 8)                           \
+    DECL_DEBUG(__llvm_covmap, 8)
+
 /*
  * ELF sections.
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 01:00:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 01:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1151924.1482470 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDY4B-0002We-5x; Tue, 28 Oct 2025 01:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1151924.1482470; Tue, 28 Oct 2025 01: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 1vDY4B-0002Vv-2k; Tue, 28 Oct 2025 01:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1151924;
 Tue, 28 Oct 2025 01: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 1vDY4A-00023e-A2
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 01: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 1vDY4A-004wNp-04
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 01:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDY4A-007UHA-0b
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 01:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eiq+2puhRcBuIHUwtz4w46T8Htr8SzLciWyXx+iVnSE=; b=DYp4czpwwzZTjePhNPNKamyDbf
	pg++9fbTCmb5owfSlcC1TRh64s2qimLZCK1EBPX/XucvxXz73CuTmvUDN5sE0m7chEooSYFBMQhsM
	RmZT4+OPCcSlc+Ne88+LPpwKPs+zteNMlsucaMMK8RUc8LBtPWmQrVSzeOX/nkY/MT9g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: fix randconfig build problems after introducing SYSCTL
Message-Id: <E1vDY4A-007UHA-0b@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 01:00:02 +0000

commit 6c80f0dd1bbc1fd514bae0dfcba4bdea2125ed25
Author:     Stefano Stabellini <stefano.stabellini@amd.com>
AuthorDate: Wed Oct 22 16:21:30 2025 -0700
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon Oct 27 15:41:58 2025 -0700

    xen: fix randconfig build problems after introducing SYSCTL
    
    Fix a few randconfig build breakages that started appearing after the
    SYSCTL patch series.
    
    First, reintroduce depends on !PV_SHIM_EXCLUSIVE for HVM, as it was
    before 568f806cba4c.
    
    Also, add depends on !PV_SHIM_EXCLUSIVE for SYSCTL, that way the
    behavior goes back to what it was before 34317c508294.
    
    Fixes: 568f806cba4c ("xen/x86: remove "depends on !PV_SHIM_EXCLUSIVE"")
    Fixes: 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    CC: jbeulich@suse.com
    CC: andrew.cooper3@citrix.com
    CC: roger.pau@citrix.com
    CC: Penny.Zheng@amd.com
---
 xen/arch/x86/hvm/Kconfig | 1 +
 xen/common/Kconfig       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig
index 5cb9f29042..f10a2b3744 100644
--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -1,5 +1,6 @@
 menuconfig HVM
 	bool "HVM support"
+	depends on !PV_SHIM_EXCLUSIVE
 	default !PV_SHIM
 	select COMPAT
 	select IOREQ_SERVER
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 76f9ce705f..53f681bbb2 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -653,6 +653,7 @@ menu "Supported hypercall interfaces"
 
 config SYSCTL
 	bool "Enable sysctl hypercall"
+	depends on !PV_SHIM_EXCLUSIVE
 	default y
 	help
 	  This option shall only be disabled on some dom0less systems, or
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 15:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 15:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152213.1482715 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDlLt-0005RP-2G; Tue, 28 Oct 2025 15:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152213.1482715; Tue, 28 Oct 2025 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 1vDlLs-0005RH-Vy; Tue, 28 Oct 2025 15:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1152213;
 Tue, 28 Oct 2025 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 1vDlLs-0005RB-HC
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 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 1vDlLs-006JzZ-0x
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDlLs-009IcF-1T
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 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=BVLvar3tHmokBWA0xcd1t3caJzlZH3V5zTWtZu6ydEA=; b=RyPVREuuCEhnt3SvrKXRa/pDtP
	n6eBpDv2Wsv6OMUUFMtUEmPlgrGjZiSZoOh3TbHH5PUDG5EIirf5pvYWx68atlm48JPyozeB2bfA9
	OXkVOFTSzp1MTXaLjcr9svKoPbs19C8AnpJ0S+osGh3KUwjJF3ch4iJ+d7KuXb5p9Njw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Refine TLB flush fix for AMD Fam17h CPUs
Message-Id: <E1vDlLs-009IcF-1T@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 15:11:12 +0000

commit 4e0849c6f2bc69cf19a9f6ea04e74194628890d2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:01:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Refine TLB flush fix for AMD Fam17h CPUs
    
    In the time since Xen discovered this, Linux stubled on it too and AMD
    produced a narrower fix, limited to Fam17h CPUs only.  To my knowledge,
    there's no erratum or other public statement from AMD on the matter.
    
    Adjust Xen to match the narrower fix.
    
    Link: https://lore.kernel.org/lkml/ZyulbYuvrkshfsd2@antipodes/T/#u
    Fixes: f19a199281a2 ("x86/AMD: flush TLB after ucode update")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c    | 14 +++++++++++---
 xen/arch/x86/flushtlb.c             |  3 +--
 xen/arch/x86/include/asm/flushtlb.h |  5 +++++
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 59332da2b8..4578101824 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -306,10 +306,18 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
     sig->rev = rev;
 
     /*
-     * Some processors leave the ucode blob mapping as UC after the update.
-     * Flush the mapping to regain normal cacheability.
+     * Fam17h processors leave the mapping of the ucode as UC after the
+     * update.  Flush the mapping to regain normal cacheability.
+     *
+     * We do not know the granularity of mapping, and at 3200 bytes in size
+     * there is a good chance of crossing a 4k page boundary.  Shoot-down the
+     * start and end just to be safe.
      */
-    flush_area_local(patch, FLUSH_TLB_GLOBAL | FLUSH_ORDER(0));
+    if ( boot_cpu_data.family == 0x17 )
+    {
+        invlpg(patch);
+        invlpg((const void *)patch + F17H_MPB_MAX_SIZE - 1);
+    }
 
     /* check current patch id and patch's id for match */
     if ( hw_err || (rev != patch->patch_id) )
diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 94b2a30e8d..09e676c151 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -222,8 +222,7 @@ unsigned int flush_area_local(const void *va, unsigned int flags)
                 }
             }
             else
-                asm volatile ( "invlpg %0"
-                               : : "m" (*(const char *)(va)) : "memory" );
+                invlpg(va);
         }
         else
             do_tlb_flush();
diff --git a/xen/arch/x86/include/asm/flushtlb.h b/xen/arch/x86/include/asm/flushtlb.h
index 019d886f2b..7bcbca2b7f 100644
--- a/xen/arch/x86/include/asm/flushtlb.h
+++ b/xen/arch/x86/include/asm/flushtlb.h
@@ -98,6 +98,11 @@ static inline unsigned long read_cr3(void)
     return cr3;
 }
 
+static inline void invlpg(const void *p)
+{
+    asm volatile ( "invlpg %0" :: "m" (*(const char *)p) : "memory" );
+}
+
 /* Write pagetable base and implicitly tick the tlbflush clock. */
 void switch_cr3_cr4(unsigned long cr3, unsigned long cr4);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 15:11:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 15:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152212.1482712 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDlLj-0005Pi-10; Tue, 28 Oct 2025 15:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152212.1482712; Tue, 28 Oct 2025 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 1vDlLi-0005Pa-UY; Tue, 28 Oct 2025 15:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1152212;
 Tue, 28 Oct 2025 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 1vDlLi-0005PU-GG
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 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 1vDlLi-006JzP-0d
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDlLi-009Ib8-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 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=b64Q6lLKXUUE8u6DAi+TRDPbikUx2o1DxwRbUOE21bE=; b=Y+7lNKPeGtestdkKpEOYR+dl/J
	pqgglGZCLYeFCF2TqWsFcgBnE9qayDAGZbGNEzva5n6JNkF1jDCGMP/Sy9xNHT/QCdLn6hP+Zjt6/
	+UPlushc2fYLhqQzsLdmCT1a80vrjnjS0MUKtgKJD1Msa4H9/R/+dhJ+WltKpWTKxEa4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDlLi-009Ib8-1A@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 15:11:02 +0000

commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 1b093bc98a..2705bb43c9 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -392,10 +392,10 @@ static int control_thread_fn(const struct microcode_patch *patch,
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 15:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 15:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152214.1482719 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDlM3-0005Tp-3b; Tue, 28 Oct 2025 15:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152214.1482719; Tue, 28 Oct 2025 15: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 1vDlM3-0005Th-17; Tue, 28 Oct 2025 15:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1152214;
 Tue, 28 Oct 2025 15: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 1vDlM2-0005TW-KI
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 15: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 1vDlM2-006Jzd-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDlM2-009IeB-1m
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15: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=aLPx4Kr9QUrHao8tFb/X/kFqUBrDDP7Te+vGVWUhz4E=; b=f9QqaEUXsDo9iDgcS9fNhJX9+Z
	FEjUq6qRFOtOak3YR1sNL+pZIGgixYsZzUUtInXZEg50EPNTtnm+u8BSx0j1rr8DGlNku5plJ4JAm
	Qfx6Xlsu1Y8R2zYYllJS9ltgQDgfnuUA9jbtPM5dlPDUEkCUUBL79/sVrwOT/nWGGO10=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDlM2-009IeB-1m@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 15:11:22 +0000

commit b3f015b8bad6e17300e299fe20beeef33be0007f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 4578101824..ba03401c24 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -270,6 +273,42 @@ static int cf_check amd_compare(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits_cpu(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static int cf_check apply_microcode(const struct microcode_patch *patch,
                                     unsigned int flags)
 {
@@ -299,6 +338,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
         return -ENXIO;
     }
 
+    if ( !ucode_force && !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 15:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 15:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152215.1482725 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDlMD-0005WD-5e; Tue, 28 Oct 2025 15:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152215.1482725; Tue, 28 Oct 2025 15: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 1vDlMD-0005W6-2T; Tue, 28 Oct 2025 15:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1152215;
 Tue, 28 Oct 2025 15: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 1vDlMC-0005Vy-NR
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 15: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 1vDlMC-006Jzn-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDlMC-009If5-28
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15: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=fK54XWZiiRpp/Pg2sl86GXQKL5lW+4fkVe6GmBekWIM=; b=wh1XMmuILVCBOxF8WSowtbYgKB
	3O0dXbHMiRHBNBM+RquZ0YJLwG8mYhxpuYWtzeNtJdO+OKAzdpBDn+7kti7G7rx3RbMQb0BLEqlIm
	mqk/1Dj/m8ZxyLyHCYto5Juy62fxkBgYBmvkHeEGA+GO/7kl8FA60/4sE+UC3kLs/pGg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDlMC-009If5-28@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 15:11:32 +0000

commit c2529496d07326f7a234c0c8e565bc8ec87d7836
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 9 +++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 28a98321c7..34004ce282 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2826,9 +2826,10 @@ stop_machine context. In NMI handler, even NMIs are blocked, which is
 considered safer. The default value is `true`.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ba03401c24..f331d9dfee 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -125,7 +125,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.family < 0x17 ||
+    if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
          !opt_digest_check )
         return true;
 
@@ -571,7 +571,12 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check && boot_cpu_data.family >= 0x17 )
+    /*
+     * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects Zen1-5
+     * CPUs.  Taint Xen if digest checking is turned off.
+     */
+    if ( boot_cpu_data.family >= 0x17 && boot_cpu_data.family <= 0x1a &&
+         !opt_digest_check )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 15:11:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 15:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152216.1482728 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDlMO-0005Ye-6m; Tue, 28 Oct 2025 15:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152216.1482728; Tue, 28 Oct 2025 15:11:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDlMO-0005YW-4A; Tue, 28 Oct 2025 15:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1152216;
 Tue, 28 Oct 2025 15: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 1vDlMM-0005YP-QZ
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 15: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 1vDlMM-006K0A-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDlMM-009IgE-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 15: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=n0515E2sbC0lFHAbNNymQyRb95xIDhlUPA42693jkbU=; b=2fTJW32wdZYwRYZUB7lExj0+Wt
	b83b6zjzZZWIi33I9scFisey101/n4BCBcC3r0tcrCXNqB3m76Ik8rjGorLrSwnEvgW4748r2s0b0
	ixilYG49AhzMfMlNbO4SIv2BJVEXacWQDcnMWD6AhVqIIXNBz22JggUyOSZW2lO2Gvns=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDlMM-009IgE-2R@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 15:11:42 +0000

commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index f331d9dfee..d72b9556f6 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -101,6 +101,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -122,11 +123,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -603,3 +604,82 @@ static void __init __constructor test_digests_sorted(void)
     }
 }
 #endif /* CONFIG_SELF_TESTS */
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.family < 0x17 ||
+         boot_cpu_data.family > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.family, boot_cpu_data.model,
+               boot_cpu_data.stepping, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 2705bb43c9..1d1a5aa4b0 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -750,6 +750,8 @@ static int __init early_microcode_load(struct boot_info *bi)
     int idx = opt_mod_idx;
     int rc;
 
+    amd_check_entrysign();
+
     /*
      * Cmdline parsing ensures this invariant holds, so that we don't end up
      * trying to mix multiple ways of finding the microcode.
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index f5e2bfee00..e6c965dc99 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -81,8 +81,10 @@ extern bool opt_digest_check;
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
+void amd_check_entrysign(void);
 #else
 static inline void ucode_probe_amd(struct microcode_ops *ops) {}
+static inline void amd_check_entrysign(void) {}
 #endif
 
 #ifdef CONFIG_INTEL
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 16:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 16:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152251.1482768 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmSb-0007uX-Qo; Tue, 28 Oct 2025 16:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152251.1482768; Tue, 28 Oct 2025 16:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmSb-0007uP-NM; Tue, 28 Oct 2025 16:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1152251;
 Tue, 28 Oct 2025 16: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 1vDmSa-0007uF-J7
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 16: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 1vDmSa-006Lo5-0z
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDmSa-009Sco-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FxS3bKqNvfoWr7qi78RxuldkfaT+IFRLsn3HeJGfMCs=; b=tGUhyDzc4iDwE/WdKfdQ+9nEwm
	mIkMSqkrr9abEfYW4WqMi7iowD8Ddbpj0GuzUnFUP1NPd+7fvUpGiw6JsvKmTmA1Jwmi4BLaJuDvy
	YdT9+6hsBxSyH9uxcs3PChJfFDChAWvgrdNy9St8oURuwIMY9KO925+D0WDAaI0ooG6Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Refine TLB flush fix for AMD Fam17h CPUs
Message-Id: <E1vDmSa-009Sco-1I@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 16:22:12 +0000

commit 4e0849c6f2bc69cf19a9f6ea04e74194628890d2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:01:46 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Refine TLB flush fix for AMD Fam17h CPUs
    
    In the time since Xen discovered this, Linux stubled on it too and AMD
    produced a narrower fix, limited to Fam17h CPUs only.  To my knowledge,
    there's no erratum or other public statement from AMD on the matter.
    
    Adjust Xen to match the narrower fix.
    
    Link: https://lore.kernel.org/lkml/ZyulbYuvrkshfsd2@antipodes/T/#u
    Fixes: f19a199281a2 ("x86/AMD: flush TLB after ucode update")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c    | 14 +++++++++++---
 xen/arch/x86/flushtlb.c             |  3 +--
 xen/arch/x86/include/asm/flushtlb.h |  5 +++++
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 59332da2b8..4578101824 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -306,10 +306,18 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
     sig->rev = rev;
 
     /*
-     * Some processors leave the ucode blob mapping as UC after the update.
-     * Flush the mapping to regain normal cacheability.
+     * Fam17h processors leave the mapping of the ucode as UC after the
+     * update.  Flush the mapping to regain normal cacheability.
+     *
+     * We do not know the granularity of mapping, and at 3200 bytes in size
+     * there is a good chance of crossing a 4k page boundary.  Shoot-down the
+     * start and end just to be safe.
      */
-    flush_area_local(patch, FLUSH_TLB_GLOBAL | FLUSH_ORDER(0));
+    if ( boot_cpu_data.family == 0x17 )
+    {
+        invlpg(patch);
+        invlpg((const void *)patch + F17H_MPB_MAX_SIZE - 1);
+    }
 
     /* check current patch id and patch's id for match */
     if ( hw_err || (rev != patch->patch_id) )
diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 94b2a30e8d..09e676c151 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -222,8 +222,7 @@ unsigned int flush_area_local(const void *va, unsigned int flags)
                 }
             }
             else
-                asm volatile ( "invlpg %0"
-                               : : "m" (*(const char *)(va)) : "memory" );
+                invlpg(va);
         }
         else
             do_tlb_flush();
diff --git a/xen/arch/x86/include/asm/flushtlb.h b/xen/arch/x86/include/asm/flushtlb.h
index 019d886f2b..7bcbca2b7f 100644
--- a/xen/arch/x86/include/asm/flushtlb.h
+++ b/xen/arch/x86/include/asm/flushtlb.h
@@ -98,6 +98,11 @@ static inline unsigned long read_cr3(void)
     return cr3;
 }
 
+static inline void invlpg(const void *p)
+{
+    asm volatile ( "invlpg %0" :: "m" (*(const char *)p) : "memory" );
+}
+
 /* Write pagetable base and implicitly tick the tlbflush clock. */
 void switch_cr3_cr4(unsigned long cr3, unsigned long cr4);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 16:22:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 16:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152250.1482761 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmSR-0007sU-NI; Tue, 28 Oct 2025 16:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152250.1482761; Tue, 28 Oct 2025 16:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmSR-0007sM-Kd; Tue, 28 Oct 2025 16:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1152250;
 Tue, 28 Oct 2025 16: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 1vDmSQ-0007sG-DW
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 16: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 1vDmSQ-006Lmm-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDmSQ-009SbZ-0z
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uqxxaqycSXQAs6t+6JeySbia49gvBFDlmzRvDudStSg=; b=Ei4uuLv2EuWf/KlkHAKV7CDzqo
	pnIAAWTtFBEErhS0ezFTrZ2VR9exR3/8jeQ3NfGiGheRNgNZ1fLRWypm80Rr2T2bto76kOvRy2GRj
	0L9rCc7Q+M1yrTv8NdPIT+ncsqTT5c80rPkQn63bibYErzE36pR0LD7pZ701OL5oKoMg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDmSQ-009SbZ-0z@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 16:22:02 +0000

commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 1b093bc98a..2705bb43c9 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -392,10 +392,10 @@ static int control_thread_fn(const struct microcode_patch *patch,
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 16:22:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 16:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152252.1482770 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmSm-0007x5-RF; Tue, 28 Oct 2025 16:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152252.1482770; Tue, 28 Oct 2025 16:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmSm-0007wx-Oj; Tue, 28 Oct 2025 16:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1152252;
 Tue, 28 Oct 2025 16: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 1vDmSk-0007wj-M1
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 16: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 1vDmSk-006Lo9-1H
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDmSk-009Sfb-1p
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8vKy0j1IqWr4/rGvtmZ5SGHI0ebV5EUbRr5sDP5gkpM=; b=GlKhV8yTLOOW3ovMnIPVrKY2eF
	EvU/D0YCT09IUwjA1Vph6TOjruiTfgmO4B/B87MVV6+WRw9fBiEvUTJpkU1DqK1KaOwspKWVkCzn9
	fnr/SqzFQmpBrWOzJRT1IqgcAwSd5awbpye48k19QijNR4m4HU/QCapIF7rkBoRartNY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDmSk-009Sfb-1p@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 16:22:22 +0000

commit b3f015b8bad6e17300e299fe20beeef33be0007f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 4578101824..ba03401c24 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -270,6 +273,42 @@ static int cf_check amd_compare(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits_cpu(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static int cf_check apply_microcode(const struct microcode_patch *patch,
                                     unsigned int flags)
 {
@@ -299,6 +338,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
         return -ENXIO;
     }
 
+    if ( !ucode_force && !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 16:22:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 16:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152253.1482774 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmSw-0007zT-Sd; Tue, 28 Oct 2025 16:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152253.1482774; Tue, 28 Oct 2025 16: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 1vDmSw-0007zL-Q6; Tue, 28 Oct 2025 16:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1152253;
 Tue, 28 Oct 2025 16: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 1vDmSu-0007z5-OC
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 16: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 1vDmSu-006LoD-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDmSu-009SgY-27
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XYsAY0ZSbm6Kb1j+lyeNjhB83HeH2wCNGZb4MLdGpZ0=; b=daI4cTx9lAy2DP6J7xO9odl1L7
	DgyAIFUiae9Xc2Cxtbty2+gnTraYEitvuBQznYwZ5rXCZE2oPRdf51XblC/HRiPiT2F5psmCqEYqR
	nS02SdQjcWqgYUJgKhVAWB7BLEdu1E+NbQx5U42MsiOPczl4scDRNCJ5+sshVMY1GKEo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDmSu-009SgY-27@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 16:22:32 +0000

commit c2529496d07326f7a234c0c8e565bc8ec87d7836
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 9 +++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 28a98321c7..34004ce282 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2826,9 +2826,10 @@ stop_machine context. In NMI handler, even NMIs are blocked, which is
 considered safer. The default value is `true`.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ba03401c24..f331d9dfee 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -125,7 +125,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.family < 0x17 ||
+    if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
          !opt_digest_check )
         return true;
 
@@ -571,7 +571,12 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check && boot_cpu_data.family >= 0x17 )
+    /*
+     * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects Zen1-5
+     * CPUs.  Taint Xen if digest checking is turned off.
+     */
+    if ( boot_cpu_data.family >= 0x17 && boot_cpu_data.family <= 0x1a &&
+         !opt_digest_check )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 16:22:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 16:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152254.1482778 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDmT6-00081Z-UE; Tue, 28 Oct 2025 16:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152254.1482778; Tue, 28 Oct 2025 16: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 1vDmT6-00081R-Ra; Tue, 28 Oct 2025 16:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1152254;
 Tue, 28 Oct 2025 16: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 1vDmT4-00081H-RH
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 16: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 1vDmT4-006Lof-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDmT4-009ShQ-2V
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 16: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=/z1W4lkDpeL+pt/7rceLnUHV4OlJORy1mmr2jI5D9R4=; b=WdCgAPX8Qoz+ofsSHez7scb0mQ
	JdjwQNDeB381SDPtgKH13bvSuA0eduyi4twr+xkeQ7qZqTbOsLlK79R1FRRMJCkt6ji5eorUdm8Xf
	wTFW4onhnLY74D3X7mTKggx2QTCB60YvDOkcAjXM4u5P/FFp2L9PnJb8o8pCu2gwri2A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDmT4-009ShQ-2V@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 16:22:42 +0000

commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 14:56:55 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index f331d9dfee..d72b9556f6 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -101,6 +101,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -122,11 +123,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -603,3 +604,82 @@ static void __init __constructor test_digests_sorted(void)
     }
 }
 #endif /* CONFIG_SELF_TESTS */
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.family < 0x17 ||
+         boot_cpu_data.family > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.family, boot_cpu_data.model,
+               boot_cpu_data.stepping, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 2705bb43c9..1d1a5aa4b0 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -750,6 +750,8 @@ static int __init early_microcode_load(struct boot_info *bi)
     int idx = opt_mod_idx;
     int rc;
 
+    amd_check_entrysign();
+
     /*
      * Cmdline parsing ensures this invariant holds, so that we don't end up
      * trying to mix multiple ways of finding the microcode.
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index f5e2bfee00..e6c965dc99 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -81,8 +81,10 @@ extern bool opt_digest_check;
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
+void amd_check_entrysign(void);
 #else
 static inline void ucode_probe_amd(struct microcode_ops *ops) {}
+static inline void amd_check_entrysign(void) {}
 #endif
 
 #ifdef CONFIG_INTEL
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:11:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152394.1482857 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq23-0004tG-My; Tue, 28 Oct 2025 20:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152394.1482857; Tue, 28 Oct 2025 20:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq23-0004t8-KQ; Tue, 28 Oct 2025 20:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1152394;
 Tue, 28 Oct 2025 20: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 1vDq22-0004t2-9B
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20: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 1vDq21-006QDm-38
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq22-009wTW-0R
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gnqHzvUS4smC95/u/eW2s0hI4RXl4yERh3W8IuqDFBM=; b=nda6sbVeuxwmw5Exp9DGFUxgrW
	tYNo1DDFML7fd1kUpuc/Gcr8kCUb4NXv3nEET07RwH1cExY5gk6cM8oFZUj+caQvQXiN3Xueojbf1
	C+zug9awSzxQaXBqDipCjOHFPsvfDcSGFJjDooXe8XI5qNGBrLnSGxNP9y7Ce8NARvq0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDq22-009wTW-0R@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:11:02 +0000

commit c0513e461db7580531f384cc40c7d961414c89b5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index e43075dcb5..ff94f18961 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -520,7 +520,7 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
     if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
-               "Microcode patch additional digest checks disabled");
+               "Microcode patch additional digest checks disabled\n");
         add_taint(TAINT_CPU_OUT_OF_SPEC);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152395.1482861 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2D-0004vD-Or; Tue, 28 Oct 2025 20:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152395.1482861; Tue, 28 Oct 2025 20:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2D-0004v5-Lp; Tue, 28 Oct 2025 20:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1152395;
 Tue, 28 Oct 2025 20: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 1vDq2C-0004ut-9s
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20: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 1vDq2C-006QDq-0E
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq2C-009wUp-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D8oWFvVGCkDn6qZZyXYdRFmFzmG2YHa8YE96NQJdzj8=; b=DhEdNBCfyZrhQKwYdxui0rz8C6
	QPr5DmazLCUnHM8QgEbZItGcuKTKKtBIzj5aKH5vGbJX1ZPe4l/bBn52Ia3Yz3nFheotdZ3FEK4Uy
	xdHWLWfMkHCST+SZwmXsONLXgSI2UtscC4gpem7QX7yZVgeL8cTSg02NC/eM7wwycr6g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDq2C-009wUp-0j@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:11:12 +0000

commit 701c5a88adfb01917a670f4888b7fa28d5b6e59f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 82e2b3ab1e..29defac748 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -392,10 +392,10 @@ static int control_thread_fn(const struct microcode_patch *patch,
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152396.1482865 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2N-0004y4-SK; Tue, 28 Oct 2025 20:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152396.1482865; Tue, 28 Oct 2025 20:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2N-0004xw-PY; Tue, 28 Oct 2025 20:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1152396;
 Tue, 28 Oct 2025 20: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 1vDq2M-0004xg-CS
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20: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 1vDq2M-006QDx-0V
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq2M-009wWf-13
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZbEgQ1kJTfZjEr3EkxwZ3yUU2unhAfXVJYhdD6NkQGg=; b=gvstYveAJAzxXxRWeNPdqougSi
	FsbXMKtuhKcCJAfajCdIE9whqFCqQG6mFA/uiBpuAzRb48vlLzJazOKuA4r918jWkQJDQ7QLLf+PR
	sE1qheDlYkTQI4tK3dF5Se8j2wBLX6Sb53k3gzKpUUYCoEML+3wWaOZOeB9mO8g69fjE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDq2M-009wWf-13@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:11:22 +0000

commit 07c7069cb26a38622344f1a4bd8ef9c96ea60583
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ff94f18961..bfeb81f596 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -271,6 +274,42 @@ static int cf_check amd_compare(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits_cpu(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static int cf_check apply_microcode(const struct microcode_patch *patch,
                                     unsigned int flags)
 {
@@ -300,6 +339,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
         return -ENXIO;
     }
 
+    if ( !ucode_force && !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152397.1482870 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2X-00050D-Tc; Tue, 28 Oct 2025 20:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152397.1482870; Tue, 28 Oct 2025 20: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 1vDq2X-000505-Qw; Tue, 28 Oct 2025 20:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1152397;
 Tue, 28 Oct 2025 20: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 1vDq2W-0004zy-G8
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20: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 1vDq2W-006QE3-0p
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq2W-009wXJ-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20: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=4g5KiBGrF9Hc+vitLlBzghmCCJolJkpEReYIQFg8k/U=; b=5qFAHPq3Y5XXFPRXRzVIIPuVJE
	hLICTXRZQUUrMFk/PA1zlilwNLqvsktGHlf8YVOLSZjvFsrp7roQhtc4uAMKFf87bZ5j17bYjp48a
	7yhnDT0fp2+awz2BG+8ucYZmBOkOnflPKTUt81aHuoQ0i/jJD197ePvCyYNxU/DCowLI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDq2W-009wXJ-1M@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:11:32 +0000

commit f42dff8429566c40e268c16e7266baa4fc7d4be7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 9 +++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index dba5d7f31e..ff7bc7e861 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2772,9 +2772,10 @@ stop_machine context. In NMI handler, even NMIs are blocked, which is
 considered safer. The default value is `true`.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index bfeb81f596..eeb51bbfe7 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
@@ -564,7 +564,12 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
+    /*
+     * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects Zen1-5
+     * CPUs.  Taint Xen if digest checking is turned off.
+     */
+    if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+         !opt_digest_check )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:11:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152398.1482875 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2h-00052U-Vb; Tue, 28 Oct 2025 20:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152398.1482875; Tue, 28 Oct 2025 20: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 1vDq2h-00052K-SG; Tue, 28 Oct 2025 20:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1152398;
 Tue, 28 Oct 2025 20: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 1vDq2g-00052A-IZ
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20: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 1vDq2g-006QE7-17
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq2g-009wXt-1e
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20: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=V9EA6zV70pvrlgm4T3Cwryi4e/sYXXeFyPoNJ9+99Ro=; b=BYPwxLcQm1rK9a/GzssGIAL0OD
	jyH+AT7onF4LCXQeEjrf2qOmcODjSe0g3zXiej5f5CQ5Y9KHCZ6ev300/X+exGKTHHEfJq6wOi2V6
	PepKRQ7esIHTylQ/w9i9+B+ilgAED+7nMkcRLg9jVGy4wZy2Y8bVR5aYfxqhc/lEDPYw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDq2g-009wXt-1e@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:11:42 +0000

commit c173a771886de55ff53d62a3fec80804e65dc4ac
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index eeb51bbfe7..36934304c1 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -596,3 +597,82 @@ static void __init __constructor test_digests_sorted(void)
     }
 }
 #endif /* CONFIG_SELF_TESTS */
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 29defac748..3afbc2eff8 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -750,6 +750,8 @@ static int __init early_microcode_load(struct boot_info *bi)
     int idx = opt_mod_idx;
     int rc;
 
+    amd_check_entrysign();
+
     /*
      * Cmdline parsing ensures this invariant holds, so that we don't end up
      * trying to mix multiple ways of finding the microcode.
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index f5e2bfee00..e6c965dc99 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -81,8 +81,10 @@ extern bool opt_digest_check;
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
+void amd_check_entrysign(void);
 #else
 static inline void ucode_probe_amd(struct microcode_ops *ops) {}
+static inline void amd_check_entrysign(void) {}
 #endif
 
 #ifdef CONFIG_INTEL
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:11:54 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152399.1482879 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2s-00054W-0j; Tue, 28 Oct 2025 20:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152399.1482879; Tue, 28 Oct 2025 20:11:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq2r-00054N-Tg; Tue, 28 Oct 2025 20:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1152399;
 Tue, 28 Oct 2025 20:11: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 1vDq2r-00054D-0I
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:11: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 1vDq2q-006QEU-2W
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq2q-009wa6-34
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20: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=0nfWhXBNqhkPi2oUTe1K2yvNcs8/Qyp5KI9OwOGW+xE=; b=qEtqsae/fJgTMJhV/QL7flcUau
	6/1UTlsJYqvHdiq/xBHgU5Mn+6/H8QzU9EiVIxn4+n7LE5wiyNRnXwptvtY5DWgFMgXdIPINgMrcb
	vpirl9cNS4INknWMEqd4t6ObkVRONk9Don18mf919IRtBXbMFTytFKfIhH44+/tj8Tpk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDq2q-009wa6-34@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:11:52 +0000

commit ea1b8f9d2a6531539227d5812a200f16c22c3fe4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index f25d74fccb..83965e9574 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -512,7 +512,7 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
     if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
-               "Microcode patch additional digest checks disabled");
+               "Microcode patch additional digest checks disabled\n");
         add_taint(TAINT_CPU_OUT_OF_SPEC);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:12:04 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152400.1482881 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq32-00056g-1M; Tue, 28 Oct 2025 20:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152400.1482881; Tue, 28 Oct 2025 20: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 1vDq31-00056Y-V3; Tue, 28 Oct 2025 20:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1152400;
 Tue, 28 Oct 2025 20:12: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 1vDq31-00056S-2y
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:12: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 1vDq30-006QFT-2m
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq31-009wbn-06
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sohw3Pjd2xGaahsvNEGFq++Q0BsQDxE8tWp8BmzzhtQ=; b=kIpmu0thpFb3cVasi/ur3eF2dZ
	C8b/SOxJ+0Y5ZMTV1zzwHq5TcBe4RUNZ57nxw0JhhFeiNf+o3UV0lFIlLOIMCCUtR8xBkFWYJqGU/
	SXbjuFHhhMIkf7B+GUnkgZO8UY6oIwMMHyeqbu2rRSjHEBTtFLvI3WOjMVnDQH0R3aB0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDq31-009wbn-06@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:12:03 +0000

commit 4f5b3cde2323aad813ce5726b70d11046cc5968a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index cae3d1ee3d..ebdab38588 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -503,10 +503,10 @@ static int control_thread_fn(const struct microcode_patch *patch)
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:12:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152401.1482885 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq3C-00058x-2e; Tue, 28 Oct 2025 20:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152401.1482885; Tue, 28 Oct 2025 20: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 1vDq3C-00058q-09; Tue, 28 Oct 2025 20:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1152401;
 Tue, 28 Oct 2025 20:12: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 1vDq3B-00058f-5k
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:12: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 1vDq3A-006QGm-33
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq3B-009wcq-0N
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xkpfm/ARQc8kHPN/G1dKiNSXk6zfk+UhzSv6AQGfQlU=; b=jwzy9GEe4QcJqtAX1QmKmIzowL
	O6Qr7Isp8EXUnALMOZgrUJL+tUH4A6juuCVx88d7BYaLUBkSIxlVcVH2B0uptHK6i62UqOG8p36Kn
	dX3mizWl8JqQ8wEQvZadTaoROwY9KOydk+IL6yJHblC0y4Vbt0hG5lfxH3bk647cGy0M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDq3B-009wcq-0N@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:12:13 +0000

commit aabe803e8ee8ea84d9e39fbfb35924b7b5d71eba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 83965e9574..3fcc6793d8 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -267,6 +270,42 @@ static enum microcode_match_result compare_header(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static enum microcode_match_result cf_check compare_patch(
     const struct microcode_patch *new, const struct microcode_patch *old)
 {
@@ -303,6 +342,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch)
         return -ENXIO;
     }
 
+    if ( !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:12:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152402.1482891 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq3M-0005Be-6I; Tue, 28 Oct 2025 20:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152402.1482891; Tue, 28 Oct 2025 20: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 1vDq3M-0005BV-3B; Tue, 28 Oct 2025 20:12:24 +0000
Received: by outflank-mailman (input) for mailman id 1152402;
 Tue, 28 Oct 2025 20:12: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 1vDq3L-0005BJ-8S
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:12: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 1vDq3L-006QGq-06
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq3L-009wdZ-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ssJNxcdnA6ZdSW2n0sM3O/4P0S/5m540SWWAoh8h6i4=; b=A1I/1nPYIgsl6u4dvcYLXl2TJh
	+k9/gd5xPuojIxOyYe/AUqwZ8WLM7WYZR8NSLZ/2Nv4CSiQpZR+FJI7ZARZDEhHwNTd6IHTPUaw2U
	tAuLHWoIWSgJWunzPRwVp5OrGjCMz1YiKJN8E59luc8P/ZUOn6TqMe2GIIWRtC65wBa0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDq3L-009wdZ-0f@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:12:23 +0000

commit b179b98a2e1ea336eb206bd24eb28388f5d08fb9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 9 +++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 99cc60a061..625caf9b7b 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2713,9 +2713,10 @@ of the same version, and this allows for easy testing of the late microcode
 loading path.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 3fcc6793d8..2b1d8cbddb 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
@@ -556,7 +556,12 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
+    /*
+     * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects Zen1-5
+     * CPUs.  Taint Xen if digest checking is turned off.
+     */
+    if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+         !opt_digest_check )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:12:35 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152403.1482895 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq3X-0005Dh-7m; Tue, 28 Oct 2025 20:12:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152403.1482895; Tue, 28 Oct 2025 20:12: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 1vDq3X-0005Da-4d; Tue, 28 Oct 2025 20:12:35 +0000
Received: by outflank-mailman (input) for mailman id 1152403;
 Tue, 28 Oct 2025 20:12: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 1vDq3V-0005DS-C3
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:12: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 1vDq3V-006QGu-0P
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq3V-009weF-0v
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s6XJpvGXz/Ok8TmlGZlnRSAFLOwh2rJEgjV4PCwFQnQ=; b=dneTGLAQNlK80GcMbgf69T11/7
	z/QsVtkoNF5d2dKoIeylFuYLd6fPMU8s5iozOvk+m8ZKcYsR8YTzeuVU5koPZFE34U9FOStzG3usR
	lutZMdeX050h1RpVgjtoPkXMkz8z7O5/swBf6Hk1D4b4JHaEBmBKyzDala75xBWlq2a0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDq3V-009weF-0v@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:12:33 +0000

commit fe2b68f205ae36bb3ef61fa2ae4deb5ea7450d61
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 2b1d8cbddb..6969ae734d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -588,3 +589,82 @@ static void __init __constructor test_digests_sorted(void)
     }
 }
 #endif /* CONFIG_SELF_TESTS */
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index ebdab38588..e2d8ab8b24 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -904,6 +904,8 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
+    amd_check_entrysign();
+
     microcode_grab_module(module_map, mbi, mods);
 
     if ( ucode_mod.mod_end || ucode_blob.size )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index ef134724d8..084fbdc814 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -74,8 +74,10 @@ extern bool opt_digest_check;
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
+void amd_check_entrysign(void);
 #else
 static inline void ucode_probe_amd(struct microcode_ops *ops) {}
+static inline void amd_check_entrysign(void) {}
 #endif
 
 #ifdef CONFIG_INTEL
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:12:45 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:12:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152404.1482898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq3h-0005Fh-8v; Tue, 28 Oct 2025 20:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152404.1482898; Tue, 28 Oct 2025 20:12: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 1vDq3h-0005FZ-6A; Tue, 28 Oct 2025 20:12:45 +0000
Received: by outflank-mailman (input) for mailman id 1152404;
 Tue, 28 Oct 2025 20:12: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 1vDq3f-0005FR-Q5
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:12: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 1vDq3f-006QH4-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq3f-009wfr-2N
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=it6TsVKx961Ewr06L+KS7sPF4U8AgweFRQo4ImxcdJs=; b=h1lchR+jOiy1SnWA8OdzN/z/V4
	VjOhaInx0O7oBka+5AxTCGl6AzwlPhoPHTDIhYq2to8pk0neMZZHDmw/dkc6qh1cGfkYfg+UVSDTM
	UyVhQq5wFmDwa4rRAZa0MOQhq2jo0WzxUM7f20Rd7P8Qu0HDIPT0Bf/+GNydMzvWf1LM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDq3f-009wfr-2N@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:12:43 +0000

commit d04a36f2e4c4141dd79e4f5b6518120a83e75ccb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index fce38404d5..c0cafb29a0 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -874,7 +874,7 @@ int __init early_microcode_init(unsigned long *module_map,
              boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
-                   "Microcode patch additional digest checks disabled");
+                   "Microcode patch additional digest checks disabled\n");
             add_taint(TAINT_CPU_OUT_OF_SPEC);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:12:55 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152405.1482902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq3r-0005Hu-A4; Tue, 28 Oct 2025 20:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152405.1482902; Tue, 28 Oct 2025 20:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq3r-0005Hm-7T; Tue, 28 Oct 2025 20:12:55 +0000
Received: by outflank-mailman (input) for mailman id 1152405;
 Tue, 28 Oct 2025 20:12: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 1vDq3p-0005HZ-Sb
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:12: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 1vDq3p-006QHU-28
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq3p-009wgR-2g
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:12:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eoH4CnkJ58ih5nXmySzBPIxW4hOY8A8iLPkXOrQ9N0k=; b=LcH+zdmweX40qvaK6DNlwhsJEc
	/DfOnU3aPoguECCc8cpFeYgvxeFUyit/KJD8ONRK0T1y7pKDr+C2p232wuxTVYQQ1/EAwrre2BiQj
	d6wJ4a562SGQ6MS3Iq4+SXDz8pKRGPQbBV4onG3E84Bas/3mpWu7IxNb5Ez54AI5HBPs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDq3p-009wgR-2g@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:12:53 +0000

commit f0fcf6979f3f88a19b9aa9b11aa98feec7430256
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index c0cafb29a0..0e776264f3 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -503,10 +503,10 @@ static int control_thread_fn(const struct microcode_patch *patch)
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:13:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:13:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152406.1482906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq41-0005K3-BL; Tue, 28 Oct 2025 20:13:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152406.1482906; Tue, 28 Oct 2025 20:13:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq41-0005Jw-8l; Tue, 28 Oct 2025 20:13:05 +0000
Received: by outflank-mailman (input) for mailman id 1152406;
 Tue, 28 Oct 2025 20:13: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 1vDq3z-0005Jh-VE
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20: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 1vDq3z-006QHk-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq3z-009whg-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vJnYZWpw+QFAL3ei/lLtSFab4R3UNhu7seP+ntr5Z3c=; b=GDTugQWeUfZQAPtXYLleOtNeOq
	3QvuryamcvTwFWCMeAo0YvJjlKrC6rVOubSYxFtBhuiyP0MrypVXA3GTzjTfg7B0f9IBdTWXsnmnm
	+fXJ9fAfGmCvRq3O9huvXY+izEpwC8SeXS3mrD0/IjAoZvgh7Fzjv8KZn25u12coQHSg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDq3z-009whg-2x@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:13:03 +0000

commit 87466121fd64f6043278947cdc80ad218c9a9c34
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 48466403ba..18c025d65d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -267,6 +270,42 @@ static enum microcode_match_result compare_header(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static enum microcode_match_result cf_check compare_patch(
     const struct microcode_patch *new, const struct microcode_patch *old)
 {
@@ -303,6 +342,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch)
         return -ENXIO;
     }
 
+    if ( !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:13:15 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:13:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152407.1482909 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4B-0005MO-Cy; Tue, 28 Oct 2025 20:13:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152407.1482909; Tue, 28 Oct 2025 20:13:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4B-0005MG-AH; Tue, 28 Oct 2025 20:13:15 +0000
Received: by outflank-mailman (input) for mailman id 1152407;
 Tue, 28 Oct 2025 20:13: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 1vDq4A-0005M7-1e
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:13: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 1vDq49-006QHo-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq4A-009wjk-00
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13: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=706hIf7tjEU8qd36631YoltulvFZ+HwF9k9cNoWmRmg=; b=Sl0FbkbFjIM/vFeF03F0pb+e0B
	KUZA32On6U2f0VryCrlg/cv4WanzRxKgD6lJmhPimz02fiede5dWi7iU1Drn0OqKl4NW99uxAqHo3
	OZ6boH6vCWMZr/xaJkNc4ktrRk9KiwtigxpIJEPi65qoAvzRCdtQVOOb/nVzOHLoJgIM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDq4A-009wjk-00@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:13:14 +0000

commit 4112b5c6a2443f41f9b6047168d64ae897ffe616
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 2 +-
 xen/arch/x86/cpu/microcode/core.c | 8 ++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index bb04d3d124..63ff245c6a 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2683,9 +2683,10 @@ of the same version, and this allows for easy testing of the late microcode
 loading path.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 18c025d65d..45a7d4cc03 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 0e776264f3..22330099df 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -870,8 +870,12 @@ int __init early_microcode_init(unsigned long *module_map,
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
-        if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 )
+        /*
+         * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects
+         * Zen1-5 CPUs.  Taint Xen if digest checking is turned off.
+         */
+        if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+             !opt_digest_check )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:13:25 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:13:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152408.1482914 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4L-0005P6-Fj; Tue, 28 Oct 2025 20:13:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152408.1482914; Tue, 28 Oct 2025 20:13:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4L-0005Oy-Cw; Tue, 28 Oct 2025 20:13:25 +0000
Received: by outflank-mailman (input) for mailman id 1152408;
 Tue, 28 Oct 2025 20:13: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 1vDq4K-0005Oo-4j
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:13: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 1vDq4J-006QHt-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq4K-009wkX-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13: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=ryuBitX9ca7CZ35S+uGFRCMQgaGb6cdBOlkSerCu/FE=; b=qz7LAk5JZyw7j9Znvr+Eqp+bQx
	utS+ml6KbERinzej0UGlQqpJmNv2ZwtVq0C0/wYcSKnHTU9zKCWtG5a0ZKJdUUCku8bhwu22UyOUU
	FcaPyHl/qUOupPgTSiZ8qVrUxu/j4KmPsQeBeS4IsyALphwLooOjJJpi99Ti2g+s5doc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDq4K-009wkX-0G@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:13:24 +0000

commit f6b0a04a432d2f1ba9c4d5317e4a010b58c401db
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 45a7d4cc03..62b32ccb0c 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -553,3 +554,82 @@ const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .apply_microcode                  = apply_microcode,
     .compare_patch                    = compare_patch,
 };
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 22330099df..e882e3e011 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -922,6 +922,8 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
+    amd_check_entrysign();
+
     microcode_grab_module(module_map, mbi, mods);
 
     if ( ucode_mod.mod_end || ucode_blob.size )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 158cbda9cc..c8730da5d8 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -69,6 +69,8 @@ extern bool opt_digest_check;
  */
 bool intel_can_load_microcode(void);
 
+void amd_check_entrysign(void);
+
 extern const struct microcode_ops amd_ucode_ops, intel_ucode_ops;
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:13:36 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:13:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152409.1482918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4W-0005RF-Gw; Tue, 28 Oct 2025 20:13:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152409.1482918; Tue, 28 Oct 2025 20:13:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4W-0005R7-EN; Tue, 28 Oct 2025 20:13:36 +0000
Received: by outflank-mailman (input) for mailman id 1152409;
 Tue, 28 Oct 2025 20:13: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 1vDq4U-0005Qz-JF
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:13: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 1vDq4U-006QHy-1C
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq4U-009wm4-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13: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=jX166Gu4KDehGZ5iXEAmZhaz9VGWsNc+QM8yD0lFmYQ=; b=Cwf4loGF105t+EvHpxw4rT95Cp
	h3odVC6707B93Rb5SGW0DQvnjgMZE35ye3xqh6gSMhgKI0vZkiFKEW+ZDhW308MA7m9UPUGTUDyFj
	6DYrfsc2eqkBDf8fpcj/O+uTnKtB7n6+ANyZwihu/Q7ktpA8ItDDgwaZ0Jc+EpVUXMfg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDq4U-009wm4-1l@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:13:34 +0000

commit f8724eb81d85184020c8cff4a2e5a799a7d0619e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index e2975afa54..ac28ef0c8c 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -808,7 +808,7 @@ int __init early_microcode_init(void)
              boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
-                   "Microcode patch additional digest checks disabled");
+                   "Microcode patch additional digest checks disabled\n");
             add_taint(TAINT_CPU_OUT_OF_SPEC);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:13:46 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:13:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152410.1482921 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4g-0005TR-IJ; Tue, 28 Oct 2025 20:13:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152410.1482921; Tue, 28 Oct 2025 20:13:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4g-0005TJ-Fl; Tue, 28 Oct 2025 20:13:46 +0000
Received: by outflank-mailman (input) for mailman id 1152410;
 Tue, 28 Oct 2025 20:13: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 1vDq4e-0005TB-Lt
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:13: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 1vDq4e-006QIL-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq4e-009wn6-22
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13: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=rEoyjPv8148RvYqkeolfyz2m8I4qM37e2nQt7MY9Ns0=; b=H0j7qHXstBWI3Isp0i4ix9wopg
	spL4RHhcEYqVzRgKd6YTmI5SIgbtj8EybXaLg2nrAwKKpb4xyGhfKjP1kZv9njCR6fCknqAjeQWYH
	kLqgJY1WjIJT3jN4mv602A2VRglZAV+t251XqgB2K1emakdgoO52AsGHPiBsXgMLgn/Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDq4e-009wn6-22@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:13:44 +0000

commit 4201f837745e5d0e2cf4cc6663086ea8435a695d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index ac28ef0c8c..51bb625ba8 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -501,10 +501,10 @@ static int control_thread_fn(const struct microcode_patch *patch)
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:13:56 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:13:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152411.1482926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4q-0005X2-Jc; Tue, 28 Oct 2025 20:13:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152411.1482926; Tue, 28 Oct 2025 20:13:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq4q-0005Wu-H4; Tue, 28 Oct 2025 20:13:56 +0000
Received: by outflank-mailman (input) for mailman id 1152411;
 Tue, 28 Oct 2025 20:13: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 1vDq4o-0005Vw-OT
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:13: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 1vDq4o-006QIP-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq4o-009wnh-2H
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:13: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=IjV/R9hbGAAYqm2+Z1K8KkztgrXm1GxwGcGD8ZITaQA=; b=HIoxbnXTXYmphhMPCVe2WB95c3
	j7nerAcSs0XUHJz+svURtubU1KqK32huQ6pVS0wRIL/rrFtJ6pp/mP8b5Du/zSQe7nIrhQvv3hsej
	IR3KYsdh5D353Vp6xWpum1HWByy+KMvva1E1pqUA6TlQXHnIHL2m42bHmV048w672n6g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDq4o-009wnh-2H@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:13:54 +0000

commit 0cbf79d2f68dc8411bd3e8de0111e8cdd4526f27
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 13ca27d544..9c28aa0620 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -263,6 +266,42 @@ static enum microcode_match_result compare_header(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static enum microcode_match_result cf_check compare_patch(
     const struct microcode_patch *new, const struct microcode_patch *old)
 {
@@ -299,6 +338,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch)
         return -ENXIO;
     }
 
+    if ( !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:14:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:14:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152412.1482930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq50-0005Z9-L8; Tue, 28 Oct 2025 20:14:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152412.1482930; Tue, 28 Oct 2025 20:14:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq50-0005Z1-IQ; Tue, 28 Oct 2025 20:14:06 +0000
Received: by outflank-mailman (input) for mailman id 1152412;
 Tue, 28 Oct 2025 20:14: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 1vDq4y-0005Yr-R8
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:14: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 1vDq4y-006QIf-1y
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:14:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq4y-009wrF-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:14: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=jZUbR6CJBXejexciLb5yXLlM4J054qcdD383dJhfRFU=; b=f1balyVaRWoCtICxDpk7mdEpTA
	dRBaFqt/Sx8o5auMh/DwoPtyUHoM5Qi7zZ1yVax5my9sSZvn923hUwtfEFD0y/krcscllFhbeY+Kd
	yQqD0Bzq6ggyEfRy60CNO3dR12DYyskKonBVfVLZDP6gtllsQgoUPfHhksxcSpdcrQ2Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDq4y-009wrF-2Y@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:14:04 +0000

commit 4f12a18da1c246d6ba4560fb175526cca595ca40
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 2 +-
 xen/arch/x86/cpu/microcode/core.c | 8 ++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index d7310cbb46..4f2907eb67 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2626,9 +2626,10 @@ of the same version, and this allows for easy testing of the late microcode
 loading path.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 9c28aa0620..ea843d8627 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 51bb625ba8..2e0be54eaa 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -804,8 +804,12 @@ int __init early_microcode_init(void)
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
-        if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 )
+        /*
+         * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects
+         * Zen1-5 CPUs.  Taint Xen if digest checking is turned off.
+         */
+        if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+             !opt_digest_check )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 20:14:16 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 20:14:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152413.1482933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq5A-0005bh-MX; Tue, 28 Oct 2025 20:14:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152413.1482933; Tue, 28 Oct 2025 20:14:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDq5A-0005bZ-Jo; Tue, 28 Oct 2025 20:14:16 +0000
Received: by outflank-mailman (input) for mailman id 1152413;
 Tue, 28 Oct 2025 20:14: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 1vDq58-0005bL-Th
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 20:14: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 1vDq58-006QIj-2E
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:14:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDq58-009wu1-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 20:14: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=v/yRgWXNIqcFcXOSloFkoZMoqnqXrDxZDjM/uW1ZAog=; b=kyBvNiiBJYZ1CFLL3Lww3NYuhj
	thQvyCJ6XOTbKdFvsM+jay7VuaLaeIsg4gudnE+tmeSDOd1Xfr7eS+POmKATxrOmVpMobvfR+afo5
	dCflp4KGjU2SDfwE9Z7+8Ah4f49o65e4aWi8h1C9f70/J7xMECJ8yHuRDWYoxlAYKqJE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDq58-009wu1-2o@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 20:14:14 +0000

commit acc6440d0c6c0b729ab7a7a027409b24f5846962
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ea843d8627..3d94a7e1c3 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -545,3 +546,82 @@ const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .apply_microcode                  = apply_microcode,
     .compare_patch                    = compare_patch,
 };
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 2e0be54eaa..8bfd27add5 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -836,6 +836,8 @@ int __init early_microcode_init(void)
 
     printk(XENLOG_INFO "BSP microcode revision: 0x%08x\n", this_cpu(cpu_sig).rev);
 
+    amd_check_entrysign();
+
     if ( ucode_mod.mod_end || ucode_blob.size )
         rc = early_microcode_update_cpu();
 
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 79d7e37cc6..4b662a08ec 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -56,6 +56,8 @@ struct microcode_ops {
 
 extern bool opt_digest_check;
 
+void amd_check_entrysign(void);
+
 extern const struct microcode_ops amd_ucode_ops, intel_ucode_ops;
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 21:22:06 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 21:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152433.1482959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDr8k-0006Xq-MN; Tue, 28 Oct 2025 21:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152433.1482959; Tue, 28 Oct 2025 21:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDr8k-0006Xi-JT; Tue, 28 Oct 2025 21:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1152433;
 Tue, 28 Oct 2025 21: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 1vDr8j-0006Xc-VH
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 21: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 1vDr8j-006RSW-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDr8j-00A46E-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ho8GQ7YUhOjAsJSYRPpPqVU2mTXsKPF1gg7VLwidtlk=; b=VRiTfIODp3tnyGsAke7WZUhqvE
	VqrrOY0owdOeoFWFptBbn3S711Om7js5jN0roCXc8f3IFM1NRcIyK8G8eaDkfh3ARzA2cqgZ3Kch6
	5SwrBH3rgYczvn5ugAgJaHUo37wbo3HdT/bGODvfa77JLkVYxrlWJ7AL4DniPfLrLrgk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDr8j-00A46E-2Z@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 21:22:01 +0000

commit f8724eb81d85184020c8cff4a2e5a799a7d0619e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index e2975afa54..ac28ef0c8c 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -808,7 +808,7 @@ int __init early_microcode_init(void)
              boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
-                   "Microcode patch additional digest checks disabled");
+                   "Microcode patch additional digest checks disabled\n");
             add_taint(TAINT_CPU_OUT_OF_SPEC);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 21:22:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 21:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152434.1482962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDr8u-0006Zk-Ng; Tue, 28 Oct 2025 21:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152434.1482962; Tue, 28 Oct 2025 21: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 1vDr8u-0006Zc-Ko; Tue, 28 Oct 2025 21:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1152434;
 Tue, 28 Oct 2025 21: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 1vDr8u-0006ZW-0N
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 21: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 1vDr8t-006RUD-2W
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDr8t-00A48c-35
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21: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=ssaFm3osWh64BvkQaG0YdtG3J1udjUN96Cnlz56isOY=; b=uz+R4ed9kVTeUWwCmH5V5sQr1i
	qKCfZ66PUoVaCk58+uV1HoY549fu1MD9HcB7D1qCBMrKSGS9hi/gJ5dGCT1cF9j2TZzsiJVIrXAew
	19G7MjtKYpxmD9+y5dbCW+LEiXqJpdlUArWWH9xbyJ6zSoJwurxRjrD27ZTMyX2OJVeE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDr8t-00A48c-35@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 21:22:11 +0000

commit 4201f837745e5d0e2cf4cc6663086ea8435a695d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index ac28ef0c8c..51bb625ba8 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -501,10 +501,10 @@ static int control_thread_fn(const struct microcode_patch *patch)
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 21:22:22 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 21:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152435.1482966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDr94-0006bv-PL; Tue, 28 Oct 2025 21:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152435.1482966; Tue, 28 Oct 2025 21:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDr94-0006bn-ME; Tue, 28 Oct 2025 21:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1152435;
 Tue, 28 Oct 2025 21: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 1vDr94-0006bd-5F
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 21: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 1vDr93-006RUH-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDr94-00A49J-07
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21: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=eWPvK+KY+wA5/RlKGPUPTZpj8xHdc3NLECat2aQJiVQ=; b=3NKJnGtuhj3QXjz0j1qeq2SgI3
	gFAo9LI2BLjAk9BGWOnb1ljYKpyq9xg79sLiVT2ktjnrQZg79/8hMiN+fuSo05W+ZCtUl8XWN4yer
	2Gi9E1uo8nWnDNZoXJox3rDrk4S6sUC3SB7trtVToC6wZB3qhaYIZp7MF8GcqXfa2Fe4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDr94-00A49J-07@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 21:22:22 +0000

commit 0cbf79d2f68dc8411bd3e8de0111e8cdd4526f27
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 13ca27d544..9c28aa0620 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -263,6 +266,42 @@ static enum microcode_match_result compare_header(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static enum microcode_match_result cf_check compare_patch(
     const struct microcode_patch *new, const struct microcode_patch *old)
 {
@@ -299,6 +338,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch)
         return -ENXIO;
     }
 
+    if ( !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 21:22:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 21:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152436.1482970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDr9F-0006eK-Qo; Tue, 28 Oct 2025 21:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152436.1482970; Tue, 28 Oct 2025 21: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 1vDr9F-0006eC-Nl; Tue, 28 Oct 2025 21:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1152436;
 Tue, 28 Oct 2025 21: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 1vDr9E-0006e3-9h
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 21: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 1vDr9E-006RUL-0E
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDr9E-00A4AR-0a
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21: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=IvWM3GpDf7u+ms4C0C3rKEdgm9Tt9nmSVNBgWBCZ59c=; b=uHxLprAl6M+6KTUm+vOdCalnoU
	q5x7yjPtElM64UscW2P9ijw9F0zD+Eb/ZKzfdKQnqQPdN+AM8VrNk8WD2y/4eGp8HQ697qu1c/3z8
	jn8t3xKOWCodAovcr2fb55b3XYwRy/9tRsrMdeLOJg/pnHZhTOnCoc1u4EkRpZxJ5fzg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDr9E-00A4AR-0a@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 21:22:32 +0000

commit 4f12a18da1c246d6ba4560fb175526cca595ca40
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 2 +-
 xen/arch/x86/cpu/microcode/core.c | 8 ++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index d7310cbb46..4f2907eb67 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2626,9 +2626,10 @@ of the same version, and this allows for easy testing of the late microcode
 loading path.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 9c28aa0620..ea843d8627 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 51bb625ba8..2e0be54eaa 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -804,8 +804,12 @@ int __init early_microcode_init(void)
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
-        if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 )
+        /*
+         * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects
+         * Zen1-5 CPUs.  Taint Xen if digest checking is turned off.
+         */
+        if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+             !opt_digest_check )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 21:22:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 21:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152437.1482974 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDr9P-0006gT-S8; Tue, 28 Oct 2025 21:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152437.1482974; Tue, 28 Oct 2025 21: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 1vDr9P-0006gL-PH; Tue, 28 Oct 2025 21:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1152437;
 Tue, 28 Oct 2025 21: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 1vDr9O-0006gD-DV
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 21: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 1vDr9O-006RUV-0b
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDr9O-00A4BE-13
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 21: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=aweU3e6S/96dd9Ab9BiBUfNAP+GSJJJLYrAa6ni7w/E=; b=cfCNYIHd63Mi1cxiycAIe838Bf
	N6A6vlmboaxYuye4/PBqo7EfYAZZScwfhEugmVThu0JLSnTuz6OefJZ+dW/Bcrp+/nypHFDXCN5MR
	zqAJvh4UnZKpPYpG6St+ceY0N4l2Nia7SPvx1PffkWlQOd3yK6py+BKUAOmkdPykjxgI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDr9O-00A4BE-13@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 21:22:42 +0000

commit acc6440d0c6c0b729ab7a7a027409b24f5846962
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:42 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ea843d8627..3d94a7e1c3 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -545,3 +546,82 @@ const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .apply_microcode                  = apply_microcode,
     .compare_patch                    = compare_patch,
 };
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 2e0be54eaa..8bfd27add5 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -836,6 +836,8 @@ int __init early_microcode_init(void)
 
     printk(XENLOG_INFO "BSP microcode revision: 0x%08x\n", this_cpu(cpu_sig).rev);
 
+    amd_check_entrysign();
+
     if ( ucode_mod.mod_end || ucode_blob.size )
         rc = early_microcode_update_cpu();
 
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 79d7e37cc6..4b662a08ec 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -56,6 +56,8 @@ struct microcode_ops {
 
 extern bool opt_digest_check;
 
+void amd_check_entrysign(void);
+
 extern const struct microcode_ops amd_ucode_ops, intel_ucode_ops;
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:22:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152442.1482978 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDs4p-00055C-Sd; Tue, 28 Oct 2025 22:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152442.1482978; Tue, 28 Oct 2025 22: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 1vDs4p-000554-Pk; Tue, 28 Oct 2025 22:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1152442;
 Tue, 28 Oct 2025 22: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 1vDs4o-00054w-G1
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDs4o-006SVm-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDs4o-00AAbI-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vxgIpXdO/a9V73vwcfQDVsEN3JMMsQZ1mNHZh2vcX8Y=; b=Msg2tUAFLXXwmbBSJxAPqdmeZa
	oY5itsycw8qUGWTpz5JS2oBW786fwl4umG0Jam7mTW8wlo9gRu4pbk6ztJP9GCY1pQk+t9WBBnjJr
	g7qEaa68fWkyTobJ3D8JYFf3G17IJn7a1Ui31ow3h4bUDceA47tSuvtyDP9oDIHXdQmY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDs4o-00AAbI-0L@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:22:02 +0000

commit c0513e461db7580531f384cc40c7d961414c89b5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index e43075dcb5..ff94f18961 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -520,7 +520,7 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
     if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
-               "Microcode patch additional digest checks disabled");
+               "Microcode patch additional digest checks disabled\n");
         add_taint(TAINT_CPU_OUT_OF_SPEC);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:22:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152443.1482982 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDs4z-00057Q-W1; Tue, 28 Oct 2025 22:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152443.1482982; Tue, 28 Oct 2025 22:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDs4z-00057I-T0; Tue, 28 Oct 2025 22:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1152443;
 Tue, 28 Oct 2025 22: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 1vDs4y-000570-IL
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDs4y-006SX5-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDs4y-00AAcP-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EpJdO7iPsRe5mB6NMaZAaOpFGx7FKWPtfmd/4XHXUuA=; b=ZezLZTSy2LfCGy77wbOmPYzwel
	pHWh4C62/PjnHTD6PtH9w3+86hWmQGoFObpqAp7QQiFzG6zJJKuAtikZFAr61Mf1ZMjE6tEBvEISG
	LxyJcp6nE5rbiAtc/2YKM5ULXyNfSd5HEfXpuZqUcwLaOR7Xm8z7ls3EZojIJWytxNHE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDs4y-00AAcP-1A@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:22:12 +0000

commit 701c5a88adfb01917a670f4888b7fa28d5b6e59f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 82e2b3ab1e..29defac748 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -392,10 +392,10 @@ static int control_thread_fn(const struct microcode_patch *patch,
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:22:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152444.1482986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDs5A-00059y-1E; Tue, 28 Oct 2025 22:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152444.1482986; Tue, 28 Oct 2025 22:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDs59-00059q-UU; Tue, 28 Oct 2025 22:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1152444;
 Tue, 28 Oct 2025 22: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 1vDs58-00059e-MS
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDs58-006SX9-1V
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDs58-00AAd0-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22: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=5+r/5hHr0ijwlUp+QUk8gLjenoAxKlcIVbpJiEQh6sk=; b=IksuYzKnMNNKY7ccoYsI7bigz7
	pxLIgYvkBIoD6b/qybqn4mv0tyzkbl6+JRm11QuobFBwDmuFuOaph2ZZL9rGBYSKGfMQwpOqN9/J/
	Z0GPs4bFM0msI5omwAIoHVjHtAOBioTHLLG0uTdr75OJY6XKa4NHvESA7uiSQv7ALP5s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDs58-00AAd0-1g@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:22:22 +0000

commit 07c7069cb26a38622344f1a4bd8ef9c96ea60583
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index ff94f18961..bfeb81f596 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -271,6 +274,42 @@ static int cf_check amd_compare(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits_cpu(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static int cf_check apply_microcode(const struct microcode_patch *patch,
                                     unsigned int flags)
 {
@@ -300,6 +339,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
         return -ENXIO;
     }
 
+    if ( !ucode_force && !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:22:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152445.1482990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDs5K-0005CF-2D; Tue, 28 Oct 2025 22:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152445.1482990; Tue, 28 Oct 2025 22: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 1vDs5J-0005C7-Vs; Tue, 28 Oct 2025 22:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1152445;
 Tue, 28 Oct 2025 22: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 1vDs5I-0005Bz-Sv
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDs5I-006SXD-1y
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDs5I-00AAeB-2L
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22: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=Zh3zQc+0ZKGrIsIWtgfT2ES0YzZ/XjcpzJFsW7KZFJM=; b=CcvnQs3UPcrSdsuFy82Do8/62C
	voMo0XKEXJBLoiU9ugFPrWXGGabWFb8N0hGhru7uiYkH2y+V2Srx7yRMDV/nnWTRbRiKg/IgJky5G
	pV6S9dyJi1j2fwnclc8Oh8pKho6SNcmPKNMKqaKvSzHiDHP91BjuML/kcrIr+ifoCWVs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDs5I-00AAeB-2L@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:22:32 +0000

commit f42dff8429566c40e268c16e7266baa4fc7d4be7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 9 +++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index dba5d7f31e..ff7bc7e861 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2772,9 +2772,10 @@ stop_machine context. In NMI handler, even NMIs are blocked, which is
 considered safer. The default value is `true`.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index bfeb81f596..eeb51bbfe7 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
@@ -564,7 +564,12 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
+    /*
+     * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects Zen1-5
+     * CPUs.  Taint Xen if digest checking is turned off.
+     */
+    if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+         !opt_digest_check )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:22:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152446.1482995 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDs5U-0005EM-4o; Tue, 28 Oct 2025 22:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152446.1482995; Tue, 28 Oct 2025 22: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 1vDs5U-0005EE-0x; Tue, 28 Oct 2025 22:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1152446;
 Tue, 28 Oct 2025 22: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 1vDs5S-0005E4-To
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDs5S-006SXN-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDs5S-00AAgw-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22: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=vkvjEt2NqnV4mJSOjVrCrXozJf6iZ2ZT8gztJ1K6mD0=; b=LghHey17qUcVnP5KzD6IOwQXUu
	J4AD4vq8RyR4iLOAhiutoDtjzPN8i8jP84bd6ibTycz5qKhKk5FT42ALZwdSmpy+0dRoTeib2QV8s
	eF0oZuHu2xXACz6a6/I0WX6Dq5gPEswqbM7o1EFatjGdzf7S/QTo3TimOfPoFrZ/uW9s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDs5S-00AAgw-2o@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:22:42 +0000

commit c173a771886de55ff53d62a3fec80804e65dc4ac
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 15:48:07 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index eeb51bbfe7..36934304c1 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -596,3 +597,82 @@ static void __init __constructor test_digests_sorted(void)
     }
 }
 #endif /* CONFIG_SELF_TESTS */
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 29defac748..3afbc2eff8 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -750,6 +750,8 @@ static int __init early_microcode_load(struct boot_info *bi)
     int idx = opt_mod_idx;
     int rc;
 
+    amd_check_entrysign();
+
     /*
      * Cmdline parsing ensures this invariant holds, so that we don't end up
      * trying to mix multiple ways of finding the microcode.
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index f5e2bfee00..e6c965dc99 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -81,8 +81,10 @@ extern bool opt_digest_check;
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
+void amd_check_entrysign(void);
 #else
 static inline void ucode_probe_amd(struct microcode_ops *ops) {}
+static inline void amd_check_entrysign(void) {}
 #endif
 
 #ifdef CONFIG_INTEL
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:33:05 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152448.1482998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDsFT-0006O0-RW; Tue, 28 Oct 2025 22:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152448.1482998; Tue, 28 Oct 2025 22: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 1vDsFT-0006Ns-Ow; Tue, 28 Oct 2025 22:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1152448;
 Tue, 28 Oct 2025 22: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 1vDsFR-0006Nm-Vf
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDsFR-006SiD-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDsFR-00ABhY-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jYSIlxjYpqt8IBdOZKP+aTJH8n/gkb1SRgCDZivnhfk=; b=IXf98ChQKEU3Ps1oQf9KUmsJ3w
	Rf/80W0klxZzYXHk4sQ298SU+X8JdIDwztxCVgtq40qjfy9HfQMkC+gxRGmWEE0fNepb6HnCcW1B9
	ZLA7G47h6TTnwckjPY2usmQ0t2p1UMzENG5w8EQKa6Zt4ywrFq1aRjj2h8V2jt4zQvWc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDsFR-00ABhY-2p@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:33:01 +0000

commit d04a36f2e4c4141dd79e4f5b6518120a83e75ccb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index fce38404d5..c0cafb29a0 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -874,7 +874,7 @@ int __init early_microcode_init(unsigned long *module_map,
              boot_cpu_data.x86 >= 0x17 )
         {
             printk(XENLOG_WARNING
-                   "Microcode patch additional digest checks disabled");
+                   "Microcode patch additional digest checks disabled\n");
             add_taint(TAINT_CPU_OUT_OF_SPEC);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:33:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152449.1483001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDsFd-0006QC-Tl; Tue, 28 Oct 2025 22:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152449.1483001; Tue, 28 Oct 2025 22: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 1vDsFd-0006Q5-QQ; Tue, 28 Oct 2025 22:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1152449;
 Tue, 28 Oct 2025 22: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 1vDsFc-0006Pp-0p
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDsFb-006SiJ-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDsFb-00ABi2-36
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NTMMUhIN0RgpK/8OPEFPZDZS5z8+iMfhC9HPzM9HAeY=; b=SndaNTUEZ2hMcQPkXrOyZznLPf
	UEynMhUA3gXyBRh1rF9FfHs/ymVFDD7B8VtSSOphjJNy8esq+dkEkDgR0Xefc6/r0Knq5k+yOTvUE
	UVa0U0HDCJdVskT2N31f6H0AC9SnmebHB/ZDdpzOmIaGQZy1ipQALCfgFqXF1FIRDWPw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDsFb-00ABi2-36@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:33:11 +0000

commit f0fcf6979f3f88a19b9aa9b11aa98feec7430256
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index c0cafb29a0..0e776264f3 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -503,10 +503,10 @@ static int control_thread_fn(const struct microcode_patch *patch)
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:33:24 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152450.1483006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDsFo-0006T1-08; Tue, 28 Oct 2025 22:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152450.1483006; Tue, 28 Oct 2025 22: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 1vDsFn-0006St-Tn; Tue, 28 Oct 2025 22:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1152450;
 Tue, 28 Oct 2025 22: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 1vDsFm-0006Sk-3Y
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDsFl-006SiO-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDsFm-00ABjr-09
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22: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=AiwmxPojmwQFxL8f7EP2NkCXVyq0AVMe+9TklarztkM=; b=CJwjYzRoikXa1r3tBJUqCmWP/Y
	8ogLbRguZG/U3pplCae3+lbQTnSAHtgF+lJuqwfCqhqzJ97pKwsmS0YPkDxecsXIiI0XzvZHCa/4F
	8GlpUVgjnGAdYN3+33pFmfWuUyCKdNJJNKpUiIUphE+v5Palk1rgsdusGCDKRygoOXnE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDsFm-00ABjr-09@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:33:22 +0000

commit 87466121fd64f6043278947cdc80ad218c9a9c34
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 48466403ba..18c025d65d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -267,6 +270,42 @@ static enum microcode_match_result compare_header(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static enum microcode_match_result cf_check compare_patch(
     const struct microcode_patch *new, const struct microcode_patch *old)
 {
@@ -303,6 +342,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch)
         return -ENXIO;
     }
 
+    if ( !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:33:34 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152451.1483011 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDsFy-0006VA-29; Tue, 28 Oct 2025 22:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152451.1483011; Tue, 28 Oct 2025 22: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 1vDsFx-0006Uz-VA; Tue, 28 Oct 2025 22:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1152451;
 Tue, 28 Oct 2025 22: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 1vDsFw-0006Ut-7T
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDsFv-006SiT-3B
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDsFw-00ABkh-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22: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=ZPPDkhQ1icQLDCrz6bUjWem6ZB1BgIoWUGCA4qrxmn0=; b=xDjj2LwSC5f640EG2C6+MVIIRy
	VG1JLrSS9dDULGAxo8Raw5J129hfahiYaDukAeK8UAcdo1Nz+8FzWvceZnL+aY7CLhY7ATW7/I034
	XBbY3xRe1yv+LeewAFnjDecssJEHcZ1sWUJaFRZD0Kr8hyxJlS/gmoxeLVN0Jymk1714=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDsFw-00ABkh-0S@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:33:32 +0000

commit 4112b5c6a2443f41f9b6047168d64ae897ffe616
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 2 +-
 xen/arch/x86/cpu/microcode/core.c | 8 ++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index bb04d3d124..63ff245c6a 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2683,9 +2683,10 @@ of the same version, and this allows for easy testing of the late microcode
 loading path.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 18c025d65d..45a7d4cc03 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 0e776264f3..22330099df 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -870,8 +870,12 @@ int __init early_microcode_init(unsigned long *module_map,
     switch ( c->x86_vendor )
     {
     case X86_VENDOR_AMD:
-        if ( !opt_digest_check &&
-             boot_cpu_data.x86 >= 0x17 )
+        /*
+         * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects
+         * Zen1-5 CPUs.  Taint Xen if digest checking is turned off.
+         */
+        if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+             !opt_digest_check )
         {
             printk(XENLOG_WARNING
                    "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Oct 28 22:33:44 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Oct 2025 22:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152452.1483014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDsG8-0006XI-2q; Tue, 28 Oct 2025 22:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152452.1483014; Tue, 28 Oct 2025 22: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 1vDsG8-0006XA-0J; Tue, 28 Oct 2025 22:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1152452;
 Tue, 28 Oct 2025 22: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 1vDsG6-0006X0-AF
 for xen-changelog@lists.xenproject.org; Tue, 28 Oct 2025 22: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 1vDsG6-006SiX-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDsG6-00ABlR-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 28 Oct 2025 22: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=715KKNcqzOtilBeKFPyKeTnIEetiC2CAYGXup/befH4=; b=k/vA5XU2Qx8RnMg0hUT40yTeIF
	FoyqE/JisbKHbR7pfhgv/MLHVTgeYVG/7/Em0SP5VcQrpOim9sLBxuGgTaJzT49o86uRdvw7v8fKs
	Jy0O5HsfcmFT8WmguL6d0dpEebuOUTIr7hyYIgYYyRA44XyA+NXby9z4NfyMiIggptqE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDsG6-00ABlR-0n@xenbits.xenproject.org>
Date: Tue, 28 Oct 2025 22:33:42 +0000

commit f6b0a04a432d2f1ba9c4d5317e4a010b58c401db
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:18:20 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 45a7d4cc03..62b32ccb0c 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -553,3 +554,82 @@ const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .apply_microcode                  = apply_microcode,
     .compare_patch                    = compare_patch,
 };
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 22330099df..e882e3e011 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -922,6 +922,8 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
+    amd_check_entrysign();
+
     microcode_grab_module(module_map, mbi, mods);
 
     if ( ucode_mod.mod_end || ucode_blob.size )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 158cbda9cc..c8730da5d8 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -69,6 +69,8 @@ extern bool opt_digest_check;
  */
 bool intel_can_load_microcode(void);
 
+void amd_check_entrysign(void);
+
 extern const struct microcode_ops amd_ucode_ops, intel_ucode_ops;
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Wed Oct 29 01:11:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2025 01:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152517.1483067 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuiN-0003F6-CA; Wed, 29 Oct 2025 01:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152517.1483067; Wed, 29 Oct 2025 01:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuiN-0003Ex-9H; Wed, 29 Oct 2025 01:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1152517;
 Wed, 29 Oct 2025 01: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 1vDuiM-0003Eq-0M
 for xen-changelog@lists.xenproject.org; Wed, 29 Oct 2025 01: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 1vDuiL-007cYC-2T
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDuiL-00ATii-30
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Xt0l1sKoa6gHJOiibcY5Q6RIcZQZUhRyZ1ImQcooAzc=; b=l8gmV8VIu4dLRlwnPNx5IRnEUX
	X0AY6vEzeHmaePPhFzhQGJD0ZCJniqjDLVtEJoqtvusLFvOWoYO9WYtGB75UMi6ytBFwfRqd42W6P
	GIGWE64CTs/9p5Sj9rHln/Lq34aZ1sbhfUIwVLfRW1vsLq68x26kfC8O13WJRpVtqajE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/ucode: Fix missing printk() newline in ucode_probe_amd()
Message-Id: <E1vDuiL-00ATii-30@xenbits.xenproject.org>
Date: Wed, 29 Oct 2025 01:11:01 +0000

commit ea1b8f9d2a6531539227d5812a200f16c22c3fe4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 16 12:17:29 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Fix missing printk() newline in ucode_probe_amd()
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit dc645cdf7d374933052fb933748a7502e06b007e)
---
 xen/arch/x86/cpu/microcode/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index f25d74fccb..83965e9574 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -512,7 +512,7 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
     if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
     {
         printk(XENLOG_WARNING
-               "Microcode patch additional digest checks disabled");
+               "Microcode patch additional digest checks disabled\n");
         add_taint(TAINT_CPU_OUT_OF_SPEC);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 29 01:11:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2025 01:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152518.1483072 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuiX-0003Gw-DC; Wed, 29 Oct 2025 01:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152518.1483072; Wed, 29 Oct 2025 01:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuiX-0003Go-Ac; Wed, 29 Oct 2025 01:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1152518;
 Wed, 29 Oct 2025 01: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 1vDuiW-0003Gc-4h
 for xen-changelog@lists.xenproject.org; Wed, 29 Oct 2025 01: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 1vDuiV-007cYM-2l
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDuiW-00ATjM-05
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3Zf5Skc03Si7mp6518SKl+qKPNwZv4LDFhpRhoSry3I=; b=2zbLySaBd26X84bdDn7Sqky+Rq
	1lV0HFJEkRvklbQIChG4pu8Ub30tiQgJl98Jlwl5HcpBlqf0FgzowQLCi8jHJ3mTBn2DbKMY4luYk
	PP8DgsF4/UPsgSnjovjR4znG6ue5N+2yMQpTgn3h5cUVI81hw1GJSz8YN8zvnshG2SvQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/ucode: Abort parallel load early on any control thread error
Message-Id: <E1vDuiW-00ATjM-05@xenbits.xenproject.org>
Date: Wed, 29 Oct 2025 01:11:12 +0000

commit 4f5b3cde2323aad813ce5726b70d11046cc5968a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:59:49 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Abort parallel load early on any control thread error
    
    EIO is not the only error that ucode_ops.apply_microcode() can produce.
    EINVAL, EEXISTS and ENXIO can be generated too, each of which mean that Xen is
    unhappy in some way with the proposed blob.
    
    Some of these can be bypassed with --force, which will cause the parallel load
    to be attempted.
    
    Fixes: 5ed12565aa32 ("microcode: rendezvous CPUs in NMI handler and load ucode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit e0bb712a28a93e5acd8b0ea5e7336a92d42bb740)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index cae3d1ee3d..ebdab38588 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -503,10 +503,10 @@ static int control_thread_fn(const struct microcode_patch *patch)
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
 
-    if ( ret == -EIO )
+    if ( ret )
     {
         printk(XENLOG_ERR
-               "Late loading aborted: CPU%u failed to update ucode\n", cpu);
+               "Late loading aborted: CPU%u failed to update ucode: %d\n", cpu, ret);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 29 01:11:23 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2025 01:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152519.1483076 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuih-0003Jd-EV; Wed, 29 Oct 2025 01:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152519.1483076; Wed, 29 Oct 2025 01:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuih-0003JV-Bu; Wed, 29 Oct 2025 01:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1152519;
 Wed, 29 Oct 2025 01: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 1vDuig-0003JL-5U
 for xen-changelog@lists.xenproject.org; Wed, 29 Oct 2025 01: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 1vDuif-007cYQ-32
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDuig-00ATmC-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ewC30yL11CSFMRNhPBzvnL9M9HaXjUZsMD9ikNOO7wg=; b=qk06xuSrnipsDjYCuA6SvXvNpb
	ZVmP1aYNxUzjphE/nOXoLa1Dy3kB68tPx7iIX+eEA2ebYH/nWto9pOFfJHS1yVndfdZup6pNwJmN0
	cC7hFS5hnH9cu180xcTXRo98sK5TqVI52G3FZKW1qvAhTsCDV14yuYsjWPrYuhfwWBm8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/ucode: Cross check the minimum revision
Message-Id: <E1vDuig-00ATmC-0M@xenbits.xenproject.org>
Date: Wed, 29 Oct 2025 01:11:22 +0000

commit aabe803e8ee8ea84d9e39fbfb35924b7b5d71eba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 17 17:24:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Cross check the minimum revision
    
    For Zen3-5 microcode blobs signed with the updated signature scheme, the
    checksum field has been reused to be a min_revision field, referring to the
    microcode revision which fixed Entrysign (SB-7033, CVE-2024-36347).
    
    Cross-check this when trying to load microcode, but allow --force to override
    it.  If the signature scheme is genuinely different, a #GP will occur.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit b3f015b8bad6e17300e299fe20beeef33be0007f)
    [Note: --force doesn't exist in this version of Xen]
---
 xen/arch/x86/cpu/microcode/amd.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 83965e9574..3fcc6793d8 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -42,7 +42,10 @@ struct microcode_patch {
     uint8_t  mc_patch_data_id[2];
     uint8_t  mc_patch_data_len;
     uint8_t  init_flag;
-    uint32_t mc_patch_data_checksum;
+    union {
+        uint32_t checksum; /* Fam12h and earlier */
+        uint32_t min_rev;  /* Zen3-5, post Entrysign */
+    };
     uint32_t nb_dev_id;
     uint32_t sb_dev_id;
     uint16_t processor_rev_id;
@@ -267,6 +270,42 @@ static enum microcode_match_result compare_header(
     return compare_revisions(old->patch_id, new->patch_id);
 }
 
+/*
+ * Check whether this patch has a minimum revision given, and whether the
+ * condition is satisfied.
+ *
+ * In linux-firmware for CPUs suffering from the Entrysign vulnerability,
+ * ucodes signed with the updated signature algorithm have reused the checksum
+ * field as a min-revision field.  From public archives, the checksum field
+ * appears to have been unused since Fam12h.
+ *
+ * Returns false if there is a min revision given, and it suggests that that
+ * the patch cannot be loaded on the current system.  True otherwise.
+ */
+static bool check_min_rev(const struct microcode_patch *patch)
+{
+    ASSERT(microcode_fits(patch));
+
+    if ( patch->processor_rev_id < 0xa000 || /* pre Zen3? */
+         patch->min_rev == 0 )               /* No min rev specified */
+        return true;
+
+    /*
+     * Sanity check, as this is a reused field.  If this is a true
+     * min_revision field, it will differ only in the bottom byte from the
+     * patch_id.  Otherwise, it's probably a checksum.
+     */
+    if ( (patch->patch_id ^ patch->min_rev) & ~0xff )
+    {
+        printk(XENLOG_WARNING
+               "microcode: patch %#x has unexpected min_rev %#x\n",
+               patch->patch_id, patch->min_rev);
+        return true;
+    }
+
+    return this_cpu(cpu_sig).rev >= patch->min_rev;
+}
+
 static enum microcode_match_result cf_check compare_patch(
     const struct microcode_patch *new, const struct microcode_patch *old)
 {
@@ -303,6 +342,14 @@ static int cf_check apply_microcode(const struct microcode_patch *patch)
         return -ENXIO;
     }
 
+    if ( !check_min_rev(patch) )
+    {
+        printk(XENLOG_ERR
+               "microcode: CPU%u current rev %#x below patch min_rev %#x\n",
+               cpu, sig->rev, patch->min_rev);
+        return -ENXIO;
+    }
+
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)patch);
 
     /* get patch id after patching */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 29 01:11:33 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2025 01:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152520.1483080 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuir-0003MV-HT; Wed, 29 Oct 2025 01:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152520.1483080; Wed, 29 Oct 2025 01: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 1vDuir-0003MN-Ef; Wed, 29 Oct 2025 01:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1152520;
 Wed, 29 Oct 2025 01: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 1vDuiq-0003MF-8g
 for xen-changelog@lists.xenproject.org; Wed, 29 Oct 2025 01: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 1vDuiq-007cYY-07
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDuiq-00ATn8-0e
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7skNuCaprbRUZzXWMVN2EEJwGR310XcbIKaN4idjS6Y=; b=ejUMGxbA6YPwkEprEcnXEn3k96
	EpVCzFXmkHWna57jmDvg5fABxmq7NnnIfII3UJ3fBIwK7q+4bO+H+yRD1VuM6JyJIpUnPI6RgeB0n
	8aXhpOelBpXrIJX0ZF/9HbW2zBd9VmLPi31M/Gid/uyhTM6EweMY9wkZmrosEhGgOld0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/ucode: Refine the boundary checks for Entrysign
Message-Id: <E1vDuiq-00ATn8-0e@xenbits.xenproject.org>
Date: Wed, 29 Oct 2025 01:11:32 +0000

commit b179b98a2e1ea336eb206bd24eb28388f5d08fb9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 27 19:59:47 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Refine the boundary checks for Entrysign
    
    After initial publication, the SB-7033 / CVE-2024-36347 bulletin was updated
    to list Zen5 CPUs as vulnerable.  Use Fam1ah as an upper bound, and adjust the
    command line documentation.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    Fixes: 630e8875ab36 ("x86/ucode: Perform extra SHA2 checks on AMD Fam17h/19h microcode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit c2529496d07326f7a234c0c8e565bc8ec87d7836)
---
 docs/misc/xen-command-line.pandoc | 7 ++++---
 xen/arch/x86/cpu/microcode/amd.c  | 9 +++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 99cc60a061..625caf9b7b 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2713,9 +2713,10 @@ of the same version, and this allows for easy testing of the late microcode
 loading path.
 
 The `digest-check=` option is active by default and controls whether to
-perform additional authenticity checks.  Collisions in the signature algorithm
-used by AMD Fam17h/19h processors have been found.  Xen contains a table of
-digests of microcode patches with known-good provenance, and will block
+perform additional authenticity checks.  The Entrysign vulnerability (AMD
+SB-7033, CVE-2024-36347) on Zen1-5 processors allows forging the signature on
+arbitrary microcode such that it is accepted by the CPU.  Xen contains a table
+of digests of microcode patches with known-good provenance, and will block
 loading of patches that do not match.
 
 ### unrestricted_guest (Intel)
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 3fcc6793d8..2b1d8cbddb 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -126,7 +126,7 @@ static bool check_digest(const struct container_microcode *mc)
      * microcode updates.  Mitigate by checking the digest of the patch
      * against a list of known provenance.
      */
-    if ( boot_cpu_data.x86 < 0x17 ||
+    if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
          !opt_digest_check )
         return true;
 
@@ -556,7 +556,12 @@ static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
 {
-    if ( !opt_digest_check && boot_cpu_data.x86 >= 0x17 )
+    /*
+     * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects Zen1-5
+     * CPUs.  Taint Xen if digest checking is turned off.
+     */
+    if ( boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 <= 0x1a &&
+         !opt_digest_check )
     {
         printk(XENLOG_WARNING
                "Microcode patch additional digest checks disabled\n");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 29 01:11:43 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2025 01:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152521.1483083 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vDuj1-0003Oa-IU; Wed, 29 Oct 2025 01:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152521.1483083; Wed, 29 Oct 2025 01: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 1vDuj1-0003OU-Fz; Wed, 29 Oct 2025 01:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1152521;
 Wed, 29 Oct 2025 01: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 1vDuj0-0003OM-Br
 for xen-changelog@lists.xenproject.org; Wed, 29 Oct 2025 01: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 1vDuj0-007cYd-0R
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vDuj0-00AToT-0x
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 01:11:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PNESuHMonYXi8wIqqrwV9kR48g2dyW0ssylNHsHyX6E=; b=G9ZdBMXYreAWe4EwSwe80PDOQH
	gTLpl4EEY1juEXcZPZtHSABH9metJZKcAREL94eakTmscIo9cmVwjn98Tx4S1CnAOHkbqKKh+pAyL
	RFdqZtt4z7W/Znr7TuP0g/kverl8A7ZQozJPds7LtHrbUa0HOLvfZc2E9/cRwE6hAGJU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/ucode: Relax digest check when Entrysign is fixed in firmware
Message-Id: <E1vDuj0-00AToT-0x@xenbits.xenproject.org>
Date: Wed, 29 Oct 2025 01:11:42 +0000

commit fe2b68f205ae36bb3ef61fa2ae4deb5ea7450d61
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 28 23:17:13 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 28 18:17:45 2025 +0000

    x86/ucode: Relax digest check when Entrysign is fixed in firmware
    
    When Entrysign has been mitigated in firwmare, it is believed to be safe to
    rely on the CPU patchloader again.  This avoids us needing to maintain the
    digest table for all new microcode indefinitely.
    
    Relax the digest check when firmware looks to be up to date, and leave behind
    a clear message when not.
    
    When the Zen6 (also Fam1ah processors) model numbers are known, they'll want
    excluding from the range.
    
    This is best-effort only.  If a malicious microcode has been loaded prior to
    Xen running, then all bets are off.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    (cherry picked from commit ff8228ab46582855eae78dd4cb62bba0e7e1fcba)
---
 xen/arch/x86/cpu/microcode/amd.c     | 86 ++++++++++++++++++++++++++++++++++--
 xen/arch/x86/cpu/microcode/core.c    |  2 +
 xen/arch/x86/cpu/microcode/private.h |  2 +
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 2b1d8cbddb..6969ae734d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -102,6 +102,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
+static bool __ro_after_init entrysign_mitigiated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -123,11 +124,11 @@ static bool check_digest(const struct container_microcode *mc)
 
     /*
      * Zen1 thru Zen5 CPUs are known to use a weak signature algorithm on
-     * microcode updates.  Mitigate by checking the digest of the patch
-     * against a list of known provenance.
+     * microcode updates.  If this has not been mitigated in firmware, check
+     * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.x86 < 0x17 || boot_cpu_data.x86 > 0x1a ||
-         !opt_digest_check )
+         entrysign_mitigiated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -588,3 +589,82 @@ static void __init __constructor test_digests_sorted(void)
     }
 }
 #endif /* CONFIG_SELF_TESTS */
+
+/*
+ * The Entrysign vulnerability affects all Zen1 thru Zen5 CPUs.  Firmware
+ * fixes were produced from Nov 2024.  Zen3 thru Zen5 can continue to take
+ * OS-loadable microcode updates using a new signature scheme, as long as
+ * firmware has been updated first.
+ */
+void __init amd_check_entrysign(void)
+{
+    unsigned int curr_rev;
+    uint8_t fixed_rev;
+
+    if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.x86 < 0x17 ||
+         boot_cpu_data.x86 > 0x1a )
+        return;
+
+    /*
+     * Table taken from Linux, which is the only known source of information
+     * about client revisions.  Note, Linux expresses "last-vulnerable-rev"
+     * while Xen wants "first-fixed-rev".
+     */
+    curr_rev = this_cpu(cpu_sig).rev;
+    switch ( curr_rev >> 8 )
+    {
+    case 0x080012: fixed_rev = 0x78; break;
+    case 0x080082: fixed_rev = 0x10; break;
+    case 0x083010: fixed_rev = 0x7d; break;
+    case 0x086001: fixed_rev = 0x0f; break;
+    case 0x086081: fixed_rev = 0x09; break;
+    case 0x087010: fixed_rev = 0x35; break;
+    case 0x08a000: fixed_rev = 0x0b; break;
+    case 0x0a0010: fixed_rev = 0x7b; break;
+    case 0x0a0011: fixed_rev = 0xdb; break;
+    case 0x0a0012: fixed_rev = 0x44; break;
+    case 0x0a0082: fixed_rev = 0x0f; break;
+    case 0x0a1011: fixed_rev = 0x54; break;
+    case 0x0a1012: fixed_rev = 0x4f; break;
+    case 0x0a1081: fixed_rev = 0x0a; break;
+    case 0x0a2010: fixed_rev = 0x30; break;
+    case 0x0a2012: fixed_rev = 0x13; break;
+    case 0x0a4041: fixed_rev = 0x0a; break;
+    case 0x0a5000: fixed_rev = 0x14; break;
+    case 0x0a6012: fixed_rev = 0x0b; break;
+    case 0x0a7041: fixed_rev = 0x0a; break;
+    case 0x0a7052: fixed_rev = 0x09; break;
+    case 0x0a7080: fixed_rev = 0x0a; break;
+    case 0x0a70c0: fixed_rev = 0x0a; break;
+    case 0x0aa001: fixed_rev = 0x17; break;
+    case 0x0aa002: fixed_rev = 0x19; break;
+    case 0x0b0021: fixed_rev = 0x47; break;
+    case 0x0b1010: fixed_rev = 0x47; break;
+    case 0x0b2040: fixed_rev = 0x32; break;
+    case 0x0b4040: fixed_rev = 0x32; break;
+    case 0x0b6000: fixed_rev = 0x32; break;
+    case 0x0b7000: fixed_rev = 0x32; break;
+    default:
+        printk(XENLOG_WARNING
+               "Unrecognised CPU %02x-%02x-%02x ucode 0x%08x, assuming vulnerable to Entrysign\n",
+               boot_cpu_data.x86, boot_cpu_data.x86_model,
+               boot_cpu_data.x86_mask, curr_rev);
+        return;
+    }
+
+    /*
+     * This check is best-effort.  If the platform looks to be out of date, it
+     * probably is.  If the platform looks to be fixed, it either genuinely
+     * is, or malware has gotten in before Xen booted and all bets are off.
+     */
+    if ( (uint8_t)curr_rev >= fixed_rev )
+    {
+        entrysign_mitigiated_in_firmware = true;
+        return;
+    }
+
+    printk(XENLOG_WARNING
+           "WARNING: Platform vulnerable to Entrysign (SB-7033, CVE-2024-36347) - firmware update required\n");
+    add_taint(TAINT_CPU_OUT_OF_SPEC);
+}
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index ebdab38588..e2d8ab8b24 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -904,6 +904,8 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
+    amd_check_entrysign();
+
     microcode_grab_module(module_map, mbi, mods);
 
     if ( ucode_mod.mod_end || ucode_blob.size )
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index ef134724d8..084fbdc814 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -74,8 +74,10 @@ extern bool opt_digest_check;
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
+void amd_check_entrysign(void);
 #else
 static inline void ucode_probe_amd(struct microcode_ops *ops) {}
+static inline void amd_check_entrysign(void) {}
 #endif
 
 #ifdef CONFIG_INTEL
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Oct 29 09:55:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2025 09:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152581.1483118 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vE2tT-0006zf-Oj; Wed, 29 Oct 2025 09:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152581.1483118; Wed, 29 Oct 2025 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 1vE2tT-0006zW-Lo; Wed, 29 Oct 2025 09:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1152581;
 Wed, 29 Oct 2025 09: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 1vE2tS-0006zQ-HQ
 for xen-changelog@lists.xenproject.org; Wed, 29 Oct 2025 09: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 1vE2tS-007nSr-0n
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 09:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vE2tS-00BUjo-0w
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 09:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8E+Z7cpJklI9LoCWODvLPWaXDUDaRDTuwBHaiADrSVY=; b=iko8unLaCu6i5bsvYur5yJBxMH
	BT9PTCiubIj/WgTjNWlMqQtiYV/Hwc4caOzvC0u+EqVHNtLW908Lq/9DGTpjGQqSP/RPln8ym0kSP
	y4AZV2sZk695aMyYeyKlq/ozkzsC7CzIoK6v29/yB/TwViFFQx1LOPkoKsqDNKxJ4Qxo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: replace handle_hpet_broadcast()'s on-stack cpumask_t
Message-Id: <E1vE2tS-00BUjo-0w@xenbits.xenproject.org>
Date: Wed, 29 Oct 2025 09:55:02 +0000

commit 80c7c6716476b009188271350a9fc04fa763362e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 29 09:02:53 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 29 09:02:53 2025 +0100

    x86/HPET: replace handle_hpet_broadcast()'s on-stack cpumask_t
    
    With large NR_CPUS on-stack cpumask_t variables are problematic. Now that
    the IRQ handler can't be invoked in a nested manner anymore, we can
    instead use a per-CPU variable. While we can't use scratch_cpumask in code
    invoked from IRQ handlers, simply amend that one with a HPET-special form.
    (Note that only one of the two IRQ handling functions can come into play
    at any one time.)
    
    Fixes: 996576b965cc ("xen: allow up to 16383 cpus")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hpet.c            | 8 ++++----
 xen/arch/x86/include/asm/smp.h | 1 +
 xen/arch/x86/smpboot.c         | 7 +++++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 6d5e6fb530..a69abe2650 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -196,7 +196,7 @@ static void evt_do_broadcast(cpumask_t *mask)
 
 static void cf_check handle_hpet_broadcast(struct hpet_event_channel *ch)
 {
-    cpumask_t mask;
+    cpumask_t *scratch = this_cpu(hpet_scratch_cpumask);
     s_time_t now, next_event;
     unsigned int cpu;
     unsigned long flags;
@@ -209,7 +209,7 @@ again:
     spin_unlock_irqrestore(&ch->lock, flags);
 
     next_event = STIME_MAX;
-    cpumask_clear(&mask);
+    cpumask_clear(scratch);
     now = NOW();
 
     /* find all expired events */
@@ -218,13 +218,13 @@ again:
         s_time_t deadline = ACCESS_ONCE(per_cpu(timer_deadline, cpu));
 
         if ( deadline <= now )
-            __cpumask_set_cpu(cpu, &mask);
+            __cpumask_set_cpu(cpu, scratch);
         else if ( deadline < next_event )
             next_event = deadline;
     }
 
     /* wakeup the cpus which have an expired event. */
-    evt_do_broadcast(&mask);
+    evt_do_broadcast(scratch);
 
     if ( next_event != STIME_MAX )
     {
diff --git a/xen/arch/x86/include/asm/smp.h b/xen/arch/x86/include/asm/smp.h
index c8c7960134..60eb4ac254 100644
--- a/xen/arch/x86/include/asm/smp.h
+++ b/xen/arch/x86/include/asm/smp.h
@@ -22,6 +22,7 @@
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 DECLARE_PER_CPU(cpumask_var_t, scratch_cpumask);
+DECLARE_PER_CPU(cpumask_var_t, hpet_scratch_cpumask);
 DECLARE_PER_CPU(cpumask_var_t, send_ipi_cpumask);
 
 /*
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index efb5adb3a1..8d3161248d 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -55,6 +55,9 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_mask);
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, scratch_cpumask);
 static cpumask_t scratch_cpu0mask;
 
+DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, hpet_scratch_cpumask);
+static cpumask_t hpet_scratch_cpu0mask;
+
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, send_ipi_cpumask);
 static cpumask_t send_ipi_cpu0mask;
 
@@ -976,6 +979,8 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
         FREE_CPUMASK_VAR(per_cpu(cpu_core_mask, cpu));
         if ( per_cpu(scratch_cpumask, cpu) != &scratch_cpu0mask )
             FREE_CPUMASK_VAR(per_cpu(scratch_cpumask, cpu));
+        if ( per_cpu(hpet_scratch_cpumask, cpu) != &hpet_scratch_cpu0mask )
+            FREE_CPUMASK_VAR(per_cpu(hpet_scratch_cpumask, cpu));
         if ( per_cpu(send_ipi_cpumask, cpu) != &send_ipi_cpu0mask )
             FREE_CPUMASK_VAR(per_cpu(send_ipi_cpumask, cpu));
     }
@@ -1112,6 +1117,7 @@ static int cpu_smpboot_alloc(unsigned int cpu)
     if ( !(cond_zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, cpu)) &&
            cond_zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) &&
            cond_alloc_cpumask_var(&per_cpu(scratch_cpumask, cpu)) &&
+           cond_alloc_cpumask_var(&per_cpu(hpet_scratch_cpumask, cpu)) &&
            cond_alloc_cpumask_var(&per_cpu(send_ipi_cpumask, cpu))) )
         goto out;
 
@@ -1239,6 +1245,7 @@ void __init smp_prepare_boot_cpu(void)
     cpumask_set_cpu(cpu, &cpu_present_map);
 #if NR_CPUS > 2 * BITS_PER_LONG
     per_cpu(scratch_cpumask, cpu) = &scratch_cpu0mask;
+    per_cpu(hpet_scratch_cpumask, cpu) = &hpet_scratch_cpu0mask;
     per_cpu(send_ipi_cpumask, cpu) = &send_ipi_cpu0mask;
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 29 11:11:10 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Oct 2025 11:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1152736.1483262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vE451-00078w-HA; Wed, 29 Oct 2025 11:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1152736.1483262; Wed, 29 Oct 2025 11: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 1vE451-00078o-EQ; Wed, 29 Oct 2025 11:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1152736;
 Wed, 29 Oct 2025 11: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 1vE450-00078i-Es
 for xen-changelog@lists.xenproject.org; Wed, 29 Oct 2025 11: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 1vE450-007p0f-0e
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 11:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vE450-00Bdis-0o
 for xen-changelog@lists.xenproject.org;
 Wed, 29 Oct 2025 11: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=bbngXlKORDOIbqa1495yybj289gtbUpufYu7A5atEPM=; b=o4fcQgFEO1erqEPnHOwXqnoyw9
	kG+LxafG3fbyZpONCfXC8uSAT6UT4lUXnpbrjUuiedlfvAYgQ4xisM/eImFmlO6H28BTOluFAPyFr
	711B2QiDpvNxex2bREM8BRE7D/wTajq69m+xxz+89iAANNVww/0r8SVLeg8wHTxPn/Vc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: replace handle_hpet_broadcast()'s on-stack cpumask_t
Message-Id: <E1vE450-00Bdis-0o@xenbits.xenproject.org>
Date: Wed, 29 Oct 2025 11:11:02 +0000

commit 80c7c6716476b009188271350a9fc04fa763362e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 29 09:02:53 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 29 09:02:53 2025 +0100

    x86/HPET: replace handle_hpet_broadcast()'s on-stack cpumask_t
    
    With large NR_CPUS on-stack cpumask_t variables are problematic. Now that
    the IRQ handler can't be invoked in a nested manner anymore, we can
    instead use a per-CPU variable. While we can't use scratch_cpumask in code
    invoked from IRQ handlers, simply amend that one with a HPET-special form.
    (Note that only one of the two IRQ handling functions can come into play
    at any one time.)
    
    Fixes: 996576b965cc ("xen: allow up to 16383 cpus")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hpet.c            | 8 ++++----
 xen/arch/x86/include/asm/smp.h | 1 +
 xen/arch/x86/smpboot.c         | 7 +++++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 6d5e6fb530..a69abe2650 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -196,7 +196,7 @@ static void evt_do_broadcast(cpumask_t *mask)
 
 static void cf_check handle_hpet_broadcast(struct hpet_event_channel *ch)
 {
-    cpumask_t mask;
+    cpumask_t *scratch = this_cpu(hpet_scratch_cpumask);
     s_time_t now, next_event;
     unsigned int cpu;
     unsigned long flags;
@@ -209,7 +209,7 @@ again:
     spin_unlock_irqrestore(&ch->lock, flags);
 
     next_event = STIME_MAX;
-    cpumask_clear(&mask);
+    cpumask_clear(scratch);
     now = NOW();
 
     /* find all expired events */
@@ -218,13 +218,13 @@ again:
         s_time_t deadline = ACCESS_ONCE(per_cpu(timer_deadline, cpu));
 
         if ( deadline <= now )
-            __cpumask_set_cpu(cpu, &mask);
+            __cpumask_set_cpu(cpu, scratch);
         else if ( deadline < next_event )
             next_event = deadline;
     }
 
     /* wakeup the cpus which have an expired event. */
-    evt_do_broadcast(&mask);
+    evt_do_broadcast(scratch);
 
     if ( next_event != STIME_MAX )
     {
diff --git a/xen/arch/x86/include/asm/smp.h b/xen/arch/x86/include/asm/smp.h
index c8c7960134..60eb4ac254 100644
--- a/xen/arch/x86/include/asm/smp.h
+++ b/xen/arch/x86/include/asm/smp.h
@@ -22,6 +22,7 @@
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 DECLARE_PER_CPU(cpumask_var_t, scratch_cpumask);
+DECLARE_PER_CPU(cpumask_var_t, hpet_scratch_cpumask);
 DECLARE_PER_CPU(cpumask_var_t, send_ipi_cpumask);
 
 /*
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index efb5adb3a1..8d3161248d 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -55,6 +55,9 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_mask);
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, scratch_cpumask);
 static cpumask_t scratch_cpu0mask;
 
+DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, hpet_scratch_cpumask);
+static cpumask_t hpet_scratch_cpu0mask;
+
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, send_ipi_cpumask);
 static cpumask_t send_ipi_cpu0mask;
 
@@ -976,6 +979,8 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
         FREE_CPUMASK_VAR(per_cpu(cpu_core_mask, cpu));
         if ( per_cpu(scratch_cpumask, cpu) != &scratch_cpu0mask )
             FREE_CPUMASK_VAR(per_cpu(scratch_cpumask, cpu));
+        if ( per_cpu(hpet_scratch_cpumask, cpu) != &hpet_scratch_cpu0mask )
+            FREE_CPUMASK_VAR(per_cpu(hpet_scratch_cpumask, cpu));
         if ( per_cpu(send_ipi_cpumask, cpu) != &send_ipi_cpu0mask )
             FREE_CPUMASK_VAR(per_cpu(send_ipi_cpumask, cpu));
     }
@@ -1112,6 +1117,7 @@ static int cpu_smpboot_alloc(unsigned int cpu)
     if ( !(cond_zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, cpu)) &&
            cond_zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) &&
            cond_alloc_cpumask_var(&per_cpu(scratch_cpumask, cpu)) &&
+           cond_alloc_cpumask_var(&per_cpu(hpet_scratch_cpumask, cpu)) &&
            cond_alloc_cpumask_var(&per_cpu(send_ipi_cpumask, cpu))) )
         goto out;
 
@@ -1239,6 +1245,7 @@ void __init smp_prepare_boot_cpu(void)
     cpumask_set_cpu(cpu, &cpu_present_map);
 #if NR_CPUS > 2 * BITS_PER_LONG
     per_cpu(scratch_cpumask, cpu) = &scratch_cpu0mask;
+    per_cpu(hpet_scratch_cpumask, cpu) = &hpet_scratch_cpu0mask;
     per_cpu(send_ipi_cpumask, cpu) = &send_ipi_cpu0mask;
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 31 08:55:08 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Oct 2025 08:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1154090.1484197 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vEkuU-00063j-Mj; Fri, 31 Oct 2025 08:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1154090.1484197; Fri, 31 Oct 2025 08:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vEkuU-00063a-J5; Fri, 31 Oct 2025 08:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1154090;
 Fri, 31 Oct 2025 08: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 1vEkuU-00063U-0u
 for xen-changelog@lists.xenproject.org; Fri, 31 Oct 2025 08: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 1vEkuT-00Axkb-2B
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 08:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vEkuT-00HGrI-2i
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 08:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Xz7KjvjH4ebtGuSnOZ4zbUYzt9KMa+xmj96XKuu9Vr0=; b=ZYI+xGj6src+2wrr0c8bZQBdF2
	wNxlv/BnD5GBaDNySCvpbUdOEk5VFDziX2TQ8PIsTnvnU8GZE+eQVU0e8ce1xDcdwfN618iRTO0hF
	wTBQso1YA+sxId9grQ9gE+agOiNyGvwqZqWMYQpa1ipWnY5OpuSPzNnc0nlyj37VGlVQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] symbols: avoid emitting "end" symbols for data items
Message-Id: <E1vEkuT-00HGrI-2i@xenbits.xenproject.org>
Date: Fri, 31 Oct 2025 08:55:01 +0000

commit 6eede548df21c0ed1f7fae7781805370fb024af5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 31 08:37:57 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 31 08:37:57 2025 +0100

    symbols: avoid emitting "end" symbols for data items
    
    symbols-dummy.c and the generated .xen-syms.?.S may place their symbols in
    different sections: Like for all C files, -fdata-sections may be in effect
    there. As a result, besides these symbols moving, there may then also be
    different amounts of "end" symbols inserted between them. While the
    movement is likely not problematic, the change in table size is - linking
    passes 2 and 3 want no address (and hence no size) changes between them.
    
    As, at least right now, the "end" symbols are useful only for code, limit
    their emission accordingly. When data symbols are emitted (i.e. when
    LIVEPATCH=y), this obviously also has a positive effect on overall table
    size (I'm seeing almost 600 entries going away in the build I'm looking
    at).
    
    Fixes: d3b637fba31b ("symbols: arrange to know where functions end")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/tools/symbols.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 399edc8578..7685866b97 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -176,10 +176,9 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 		*sym++ = '#';
 	}
 	strcpy(sym, str);
-	if (sort_by_name || map_only) {
+	if (sort_by_name || map_only)
 		s->orig_symbol = strdup(SYMBOL_NAME(s));
-		s->type = stype; /* As s->sym[0] ends mangled. */
-	}
+	s->type = stype; /* As s->sym[0] may end up mangled. */
 	s->sym[0] = stype;
 	s->typed = strcmp(type, "FUNC") == 0 ||
 	           strcmp(type, "OBJECT") == 0 ||
@@ -313,6 +312,7 @@ static int compare_name_orig(const void *p1, const void *p2)
 static bool want_symbol_end(unsigned int idx)
 {
 	return table[idx].size &&
+	       toupper(table[idx].type) == 'T' &&
 	       (idx + 1 == table_cnt ||
 	        table[idx].addr + table[idx].size < table[idx + 1].addr);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 31 08:55:12 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Oct 2025 08:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1154091.1484199 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vEkue-00065S-NO; Fri, 31 Oct 2025 08:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1154091.1484199; Fri, 31 Oct 2025 08:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vEkue-00065K-KP; Fri, 31 Oct 2025 08:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1154091;
 Fri, 31 Oct 2025 08: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 1vEkud-000658-W8
 for xen-changelog@lists.xenproject.org; Fri, 31 Oct 2025 08: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 1vEkud-00Axki-2T
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 08:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vEkud-00HGsQ-30
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 08:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=78QN4nU+NQ6TWK1zBHzffcnsHHddOV28gKc5N0oaBfM=; b=ZtqqOv+KObLxd4bhhWPLj6peTx
	vX8Oig63X7hctjks3qvm75qGeeWouSnM/K/6HUPEtJBkEH6TMDlqD3Xz7l0RoaXo0wshu24Knzvfb
	qfWPt97LO8ZwVZwnVmFygJZ6qGa8A5wKhdm7wOxyyb83KCJA3Pz+be0uVnVGP9Bfqh6w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: Remove Shawn Anastasio as PPC64 maintainer
Message-Id: <E1vEkud-00HGsQ-30@xenbits.xenproject.org>
Date: Fri, 31 Oct 2025 08:55:11 +0000

commit b0274cce2843e4cc0a36784707ed2665b768b7ff
Author:     Timothy Pearson <tpearson@raptorengineering.com>
AuthorDate: Fri Oct 31 08:38:27 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 31 08:38:27 2025 +0100

    MAINTAINERS: Remove Shawn Anastasio as PPC64 maintainer
    
    Shawn is no longer with Raptor Engineering.  For now, add myself as PPC64
    reviewer.
    
    Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index ecd3f40df8..ad4de908b8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -472,7 +472,7 @@ F:	xen/drivers/cpufreq/
 F:	xen/include/acpi/cpufreq/
 
 PPC64
-M:	Shawn Anastasio <sanastasio@raptorengineering.com>
+R:	Timothy Pearson <tpearson@raptorengineering.com>
 F:	xen/arch/ppc/
 
 PUBLIC I/O INTERFACES AND PV DRIVERS DESIGNS
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 31 09:55:07 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Oct 2025 09:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1154139.1484242 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vElqa-0007Yo-EL; Fri, 31 Oct 2025 09:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1154139.1484242; Fri, 31 Oct 2025 09: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 1vElqa-0007Yd-Bn; Fri, 31 Oct 2025 09:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1154139;
 Fri, 31 Oct 2025 09: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 1vElqY-0007YX-9H
 for xen-changelog@lists.xenproject.org; Fri, 31 Oct 2025 09: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 1vElqY-00Aysa-02
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 09:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vElqY-00HODR-0Y
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 09:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rJsNWDAJrDPpJY2r3PaO+a3yTZNmGMZ8eTyHTM3Ticc=; b=gDpOjY7jp06+cBE9ShnNco9TJi
	MUwwPUAGX/NzKE7vcPrAvQLPKsJZXCBx54YmDgYyhYa9U3jWR896PrP263PZqnA3VbONwJlhT+5r7
	c3ItlwvE1XHl9jthCKxWaBBS0vPM2MhTcPVCFjA8eCTeA1Y6/o4Tl9hsKBfa4IpgSJNw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] symbols: avoid emitting "end" symbols for data items
Message-Id: <E1vElqY-00HODR-0Y@xenbits.xenproject.org>
Date: Fri, 31 Oct 2025 09:55:02 +0000

commit 6eede548df21c0ed1f7fae7781805370fb024af5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 31 08:37:57 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 31 08:37:57 2025 +0100

    symbols: avoid emitting "end" symbols for data items
    
    symbols-dummy.c and the generated .xen-syms.?.S may place their symbols in
    different sections: Like for all C files, -fdata-sections may be in effect
    there. As a result, besides these symbols moving, there may then also be
    different amounts of "end" symbols inserted between them. While the
    movement is likely not problematic, the change in table size is - linking
    passes 2 and 3 want no address (and hence no size) changes between them.
    
    As, at least right now, the "end" symbols are useful only for code, limit
    their emission accordingly. When data symbols are emitted (i.e. when
    LIVEPATCH=y), this obviously also has a positive effect on overall table
    size (I'm seeing almost 600 entries going away in the build I'm looking
    at).
    
    Fixes: d3b637fba31b ("symbols: arrange to know where functions end")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Tested-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/tools/symbols.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 399edc8578..7685866b97 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -176,10 +176,9 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 		*sym++ = '#';
 	}
 	strcpy(sym, str);
-	if (sort_by_name || map_only) {
+	if (sort_by_name || map_only)
 		s->orig_symbol = strdup(SYMBOL_NAME(s));
-		s->type = stype; /* As s->sym[0] ends mangled. */
-	}
+	s->type = stype; /* As s->sym[0] may end up mangled. */
 	s->sym[0] = stype;
 	s->typed = strcmp(type, "FUNC") == 0 ||
 	           strcmp(type, "OBJECT") == 0 ||
@@ -313,6 +312,7 @@ static int compare_name_orig(const void *p1, const void *p2)
 static bool want_symbol_end(unsigned int idx)
 {
 	return table[idx].size &&
+	       toupper(table[idx].type) == 'T' &&
 	       (idx + 1 == table_cnt ||
 	        table[idx].addr + table[idx].size < table[idx + 1].addr);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 31 09:55:14 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Oct 2025 09:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1154140.1484247 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vElqk-0007ag-Fm; Fri, 31 Oct 2025 09:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1154140.1484247; Fri, 31 Oct 2025 09:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vElqk-0007aX-DB; Fri, 31 Oct 2025 09:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1154140;
 Fri, 31 Oct 2025 09: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 1vElqi-0007aG-Ao
 for xen-changelog@lists.xenproject.org; Fri, 31 Oct 2025 09: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 1vElqi-00Aysj-0K
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 09:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vElqi-00HOEs-0r
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 09:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AP73fXN4Yu2VlTS1S+fSArTzaoY0Zb1PmhV0PLNz4es=; b=utezWEbrTRipcnQHfwUUpKzZHK
	yIoIVuth5Gftwp5QABkBnd3HIdM36AJ3dUKtRsLrHI2ILiMhYHL9NXTBbAMbq3qR4lFQ+s5sJC8nf
	teFzuokAlw5cCkiMzWMXslJE6B91O3ufqQPXbsSz9h9frpgOFwFpsBlGYh/4fyVdGJis=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: Remove Shawn Anastasio as PPC64 maintainer
Message-Id: <E1vElqi-00HOEs-0r@xenbits.xenproject.org>
Date: Fri, 31 Oct 2025 09:55:12 +0000

commit b0274cce2843e4cc0a36784707ed2665b768b7ff
Author:     Timothy Pearson <tpearson@raptorengineering.com>
AuthorDate: Fri Oct 31 08:38:27 2025 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 31 08:38:27 2025 +0100

    MAINTAINERS: Remove Shawn Anastasio as PPC64 maintainer
    
    Shawn is no longer with Raptor Engineering.  For now, add myself as PPC64
    reviewer.
    
    Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index ecd3f40df8..ad4de908b8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -472,7 +472,7 @@ F:	xen/drivers/cpufreq/
 F:	xen/include/acpi/cpufreq/
 
 PPC64
-M:	Shawn Anastasio <sanastasio@raptorengineering.com>
+R:	Timothy Pearson <tpearson@raptorengineering.com>
 F:	xen/arch/ppc/
 
 PUBLIC I/O INTERFACES AND PV DRIVERS DESIGNS
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 31 17:22:11 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Oct 2025 17:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1154478.1484461 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vEsp9-0003dw-NP; Fri, 31 Oct 2025 17:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1154478.1484461; Fri, 31 Oct 2025 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 1vEsp9-0003do-Kn; Fri, 31 Oct 2025 17:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1154478;
 Fri, 31 Oct 2025 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 1vEsp8-0003di-1L
 for xen-changelog@lists.xenproject.org; Fri, 31 Oct 2025 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 1vEsp7-00B7VB-2P
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 17:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vEsp7-000pTk-2p
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 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=k3qt/bVzMqGMdVLbGi25a8M+7j9vINa/pg48vRxNdxw=; b=q2ITAGuTGwL0I0mgrOo9WfbIqK
	q9ffgkI6PH7Ud9caPjLq7Ie2wf0Szzav1rP7PH4vku1O0VkP0w17oegVfqCPz595zeEG+CLKPbmOr
	5iL7Xlf2ta8GkFwktNjjjWWe/Lc/1hy+ZBS1xkZq4AAL8qZQ2pjsv17Ak0awRXBcw5qs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Update Xen version to 4.21.0-rc3
Message-Id: <E1vEsp7-000pTk-2p@xenbits.xenproject.org>
Date: Fri, 31 Oct 2025 17:22:01 +0000

commit 9632ce6fe5b288244d2550cd2e619a55c5168bf8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 31 17:16:30 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 31 17:16:30 2025 +0000

    Update Xen version to 4.21.0-rc3
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index a0bd29fe11..ddcee8835c 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 ?= .0-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .0-rc3$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 31 17:22:13 2025
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Oct 2025 17:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1154479.1484464 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vEspJ-0003fS-Oq; Fri, 31 Oct 2025 17:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1154479.1484464; Fri, 31 Oct 2025 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 1vEspJ-0003fK-M9; Fri, 31 Oct 2025 17:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1154479;
 Fri, 31 Oct 2025 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 1vEspI-0003f8-7u
 for xen-changelog@lists.xenproject.org; Fri, 31 Oct 2025 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 1vEspI-00B7X3-02
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 17:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vEspI-000pUu-0a
 for xen-changelog@lists.xenproject.org;
 Fri, 31 Oct 2025 17: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=9J+7bjx7F+hJPPLo62x6cfz725JslMFyEa/XlgDS410=; b=K/f618lTo0lXe/cI60sXbG3V1V
	KfcSZbaJpdNhgDhOjSE9K292pwJJizAZvh95WnH71SzRDdv3mg4Pb1RLd+nV66D58tVj747UMxWst
	p2zLy4CaK/a6a9p9sx2d1FiTLy/1FbV3iAA7Kj6t6M+IvaFaYq8eq7PYvniHPOq8UTPM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] CI: Fix microcode loading on Xen 4.20
Message-Id: <E1vEspI-000pUu-0a@xenbits.xenproject.org>
Date: Fri, 31 Oct 2025 17:22:12 +0000

commit efee710407b8c6eee5b2820f2e37136b8b21724c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 28 19:39:21 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 31 17:13:58 2025 +0000

    CI: Fix microcode loading on Xen 4.20
    
    CONFIG_UCODE_SCAN_DEFAULT only exists in Xen 4.21.  In older versions of xen,
    use ucode=scan on the command line.
    
    Fixes: 690655a511cd ("CI: Include microcode for x86 hardware jobs")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml                | 1 -
 automation/scripts/qubes-x86-64.sh             | 4 ++--
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 5d382bcd24..5f0acda942 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -306,7 +306,6 @@ alpine-3.18-gcc-debug:
       CONFIG_ARGO=y
       CONFIG_UBSAN=y
       CONFIG_UBSAN_FATAL=y
-      CONFIG_UCODE_SCAN_DEFAULT=y
       CONFIG_XHCI=y
 
 debian-12-x86_64-gcc-debug:
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index e20a38e4f3..7a8b12cca4 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -247,14 +247,14 @@ TFTP=/scratch/gitlab-runner/tftp
 CONTROLLER=control@thor.testnet
 
 echo "
-multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts
+multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot ucode=scan $extra_xen_opts
 module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
 module2 --nounzip (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
 
 echo "#!ipxe
 
-kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts || reboot
+kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot ucode=scan $extra_xen_opts || reboot
 module /gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen || reboot
 module /gitlab-ci/initrd-dom0 || reboot
 boot
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index e68b0ce61f..468143376d 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -15,7 +15,7 @@ WORKDIR="${PWD}"
 TEST="$1"
 PASS_MSG="Test passed: ${TEST}"
 XEN_CMD_DOM0="dom0=pvh dom0_max_vcpus=4 dom0_mem=4G"
-XEN_CMD_XEN="sched=null loglvl=all guest_loglvl=all console_timestamps=boot"
+XEN_CMD_XEN="sched=null loglvl=all guest_loglvl=all console_timestamps=boot ucode=scan"
 XEN_CMD_EXTRA=""
 DOM0_CMD=""
 DOMU_CMD=""
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


