From xen-changelog-bounces@lists.xenproject.org Mon Jan 05 11:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jan 2026 11:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1195333.1513293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vcjAt-0001ke-5I; Mon, 05 Jan 2026 11:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1195333.1513293; Mon, 05 Jan 2026 11:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vcjAt-0001kW-2m; Mon, 05 Jan 2026 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1195333;
 Mon, 05 Jan 2026 11: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 1vcjAr-0001kQ-WE
 for xen-changelog@lists.xenproject.org; Mon, 05 Jan 2026 11: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 1vcjAr-00ACZf-26
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 11:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vcjAr-009YYb-2r
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 11:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3IHK8NUC5kZQr6c1ojk9bPueigaG9QcpbCayZdp/u0I=; b=OntAO0WW0ouT3xBUklwMX+cBpt
	tm3wSfhfRzdFmRB4I+5qezyX/SQX+Wgy3BbefyL6nmatIdmZQT4/ps5SkhoKhUVaff7AFeW/Y0ymf
	wcJZ1yNlkMQafeUZ4WBFkZ4KAkUUKns7S+TKq2tpH70KgXxuFlLeDtVQdjE7xRrqRdhY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Set ThumbEE as not present in PFR0
Message-Id: <E1vcjAr-009YYb-2r@xenbits.xenproject.org>
Date: Mon, 05 Jan 2026 11:55:01 +0000

commit 1ecb5946bdf8797d43ac6730c708bd105fdb0be4
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Dec 9 10:37:55 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jan 5 10:33:03 2026 +0000

    xen/arm: Set ThumbEE as not present in PFR0
    
    Force ThumbEE support to not available in the version of the PFR0
    register value we present to guest.
    Xen does not support ThumbEE and will trap all access to ThumbEE
    registers so do not report it being supported if the hardware supports
    it.
    
    Fixes: 5bbe1fe413f9 ("ARM: Drop ThumbEE support")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/cpufeature.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index 1a80738571..94d14fb6a9 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -227,6 +227,9 @@ static int __init create_domain_cpuinfo(void)
 #endif
     domain_cpuinfo.pfr32.amu = 0;
 
+    /* Hide ThumbEE support */
+    domain_cpuinfo.pfr32.thumbee = 0;
+
     /* Hide RAS support as Xen does not support it */
 #ifdef CONFIG_ARM_64
     domain_cpuinfo.pfr64.ras = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 05 20:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jan 2026 20:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1195736.1513648 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vcrQp-0006pD-E2; Mon, 05 Jan 2026 20:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1195736.1513648; Mon, 05 Jan 2026 20:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vcrQp-0006p3-Ar; Mon, 05 Jan 2026 20:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1195736;
 Mon, 05 Jan 2026 20: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 1vcrQo-0006ox-1X
 for xen-changelog@lists.xenproject.org; Mon, 05 Jan 2026 20: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 1vcrQn-00AMsS-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 20:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vcrQn-00A7kt-2R
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 20:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4ql+M75pyOIXpwHk4/uQa/z81abcGDy/Y0M5CLJJ+ng=; b=27mHA6Q2UrqeWlpLaa2iy4PJUG
	lR3FPbHYsAUHSNojvaPxhhGIwdclit/mWFTryLQ1QgPgm4uSsEr5Bc5fN4SQdsDQFoKpr/6BloYy8
	eX4skDG15e8j2BshbU5jhxjja07OsRh/le+7ljrHayzTYUKIQmMLx/bTc5iQK45T1rwg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: rework deviation to address varargs MISRA violations
Message-Id: <E1vcrQn-00A7kt-2R@xenbits.xenproject.org>
Date: Mon, 05 Jan 2026 20:44:01 +0000

commit c89b864a8ec7317457458ff514eb1bfe778ebed8
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Wed Dec 31 12:22:52 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jan 5 20:34:36 2026 +0000

    xen: rework deviation to address varargs MISRA violations
    
    MISRA C Rule 17.1 prohibits the use of the features that support
    variadic functions. Make the deviation already in place for controlled
    use of such features more general, relying on the presence of the
    `format' attribute on the function declaration.
    
    Add attributes where missing in order to avoid special-casing
    certain functions that use variadic arguments.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 12 +++++-------
 docs/misra/deviations.rst                        |  6 ++++--
 xen/common/libelf/libelf-private.h               |  4 +++-
 xen/drivers/char/console.c                       |  4 +++-
 4 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 219ba6993b..7dee4a488d 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -570,13 +570,11 @@ safe."
 # Series 17.
 #
 
--doc_begin="printf()-like functions are allowed to use the variadic features provided by stdarg.h."
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printk\\(.*\\)$)))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printf\\(.*\\)$)))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(panic)&&kind(function))))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(elf_call_log_callback)&&kind(function))))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(vprintk_common)&&kind(function))))"}
--config=MC3A2.R17.1,macros+={hide , "^va_(arg|start|copy|end)$"}
+-doc_begin="printf()-like or scanf()-like functions are allowed to use the variadic features provided by stdarg.h,
+provided that they are declared using the `format' attribute."
+-decl_selector+={format_attr, "property(format)"}
+-config=MC3A2.R17.1,reports+={deliberate, "any_area(^.*va_list.*$&&context(ancestor_or_self(format_attr)))"}
+-config=MC3A2.R17.1,macros+={deliberate , "^va_(arg|start|copy|end)$"}
 -doc_end
 
 -doc_begin="Not using the return value of a function does not endanger safety if it coincides with an actual argument."
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index b3431ef24e..0d90f5886e 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -570,8 +570,10 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR.
 
    * - R17.1
-     - printf()-like functions  are allowed to use the variadic features provided
-       by `stdarg.h`.
+     - printf()-like or scanf()-like functions are allowed to use the variadic
+       features provided by `stdarg.h`, provided that they are declared using
+       __attribute__((format(...))) which enables compiler type-checking of
+       the variadic parameters.
      - Tagged as `deliberate` for ECLAIR.
 
    * - R17.7
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index e5c9cc1099..c19b628069 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -84,7 +84,9 @@
 #define elf_err(elf, fmt, args ... )                    \
     elf_call_log_callback(elf, 1, fmt , ## args );
 
-void elf_call_log_callback(struct elf_binary*, bool iserr, const char *fmt,...);
+void
+__attribute__ ((format (printf, 3, 4)))
+elf_call_log_callback(struct elf_binary *elf, bool iserr, const char *fmt, ...);
 
 #define safe_strcpy(d,s)                        \
 do { strncpy((d),(s),sizeof((d))-1);            \
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index a996051035..2bdb4d5fb4 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -969,7 +969,9 @@ static void printk_start_of_line(const char *prefix)
     __putstr(tstr);
 }
 
-static void vprintk_common(const char *fmt, va_list args, const char *prefix)
+static void
+__attribute__ ((format (printf, 1, 0)))
+vprintk_common(const char *fmt, va_list args, const char *prefix)
 {
     struct vps {
         bool continued, do_print;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 05 21:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jan 2026 21:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1195782.1513691 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vcsMt-0007uQ-BG; Mon, 05 Jan 2026 21:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1195782.1513691; Mon, 05 Jan 2026 21: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 1vcsMt-0007uJ-8T; Mon, 05 Jan 2026 21:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1195782;
 Mon, 05 Jan 2026 21: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 1vcsMr-0007uD-VP
 for xen-changelog@lists.xenproject.org; Mon, 05 Jan 2026 21: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 1vcsMr-00ANum-1u
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 21:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vcsMr-00ABet-2h
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 21: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=zvcrOUtVqk5dcSEyo72EiaZffkbMvObLPQdqra8EUek=; b=b03LrceyZUJ6jMMW42mbH1VPzA
	eycBpgTijUL+kqtX5ghzQVXw6wEFuZIVd/v3YkMYs64v41TRWItXkjS4tKcnvlowXO1EthVPm7OBa
	zL81q989sejai/KulRqQGsZdKjUPCi+pjyj2LdYopSbCeFmhHdIMCOaK/diRd6OaZdB8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Set ThumbEE as not present in PFR0
Message-Id: <E1vcsMr-00ABet-2h@xenbits.xenproject.org>
Date: Mon, 05 Jan 2026 21:44:01 +0000

commit 1ecb5946bdf8797d43ac6730c708bd105fdb0be4
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Dec 9 10:37:55 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jan 5 10:33:03 2026 +0000

    xen/arm: Set ThumbEE as not present in PFR0
    
    Force ThumbEE support to not available in the version of the PFR0
    register value we present to guest.
    Xen does not support ThumbEE and will trap all access to ThumbEE
    registers so do not report it being supported if the hardware supports
    it.
    
    Fixes: 5bbe1fe413f9 ("ARM: Drop ThumbEE support")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/cpufeature.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index 1a80738571..94d14fb6a9 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -227,6 +227,9 @@ static int __init create_domain_cpuinfo(void)
 #endif
     domain_cpuinfo.pfr32.amu = 0;
 
+    /* Hide ThumbEE support */
+    domain_cpuinfo.pfr32.thumbee = 0;
+
     /* Hide RAS support as Xen does not support it */
 #ifdef CONFIG_ARM_64
     domain_cpuinfo.pfr64.ras = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 05 21:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Jan 2026 21:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1195783.1513694 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vcsN3-0007w2-CQ; Mon, 05 Jan 2026 21:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1195783.1513694; Mon, 05 Jan 2026 21: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 1vcsN3-0007vw-9w; Mon, 05 Jan 2026 21:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1195783;
 Mon, 05 Jan 2026 21: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 1vcsN2-0007vj-0r
 for xen-changelog@lists.xenproject.org; Mon, 05 Jan 2026 21: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 1vcsN1-00ANvD-2I
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 21:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vcsN1-00ABiB-30
 for xen-changelog@lists.xenproject.org;
 Mon, 05 Jan 2026 21: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=N/EIvua0Eqz9do6YQ5m49D8Xi9d5nwR4bZotVGoZvhs=; b=eozUFxU2kP+dqhZnyJHz+OT1fi
	1/tugpzLfz65GzwNkEp8LfohPeEibopuf+Q1R1IWumAPfQkwomh8L7V/EWab9/tuIVem3Pgn9ZsOB
	4TfZ8f9NE/DjjBZevWSn0ZVLlLiEq8pNM9oXAjlnriXqJ9AdTWv6d1BIAU+MIo8NzoSo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: rework deviation to address varargs MISRA violations
Message-Id: <E1vcsN1-00ABiB-30@xenbits.xenproject.org>
Date: Mon, 05 Jan 2026 21:44:11 +0000

commit c89b864a8ec7317457458ff514eb1bfe778ebed8
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Wed Dec 31 12:22:52 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Jan 5 20:34:36 2026 +0000

    xen: rework deviation to address varargs MISRA violations
    
    MISRA C Rule 17.1 prohibits the use of the features that support
    variadic functions. Make the deviation already in place for controlled
    use of such features more general, relying on the presence of the
    `format' attribute on the function declaration.
    
    Add attributes where missing in order to avoid special-casing
    certain functions that use variadic arguments.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 12 +++++-------
 docs/misra/deviations.rst                        |  6 ++++--
 xen/common/libelf/libelf-private.h               |  4 +++-
 xen/drivers/char/console.c                       |  4 +++-
 4 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 219ba6993b..7dee4a488d 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -570,13 +570,11 @@ safe."
 # Series 17.
 #
 
--doc_begin="printf()-like functions are allowed to use the variadic features provided by stdarg.h."
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printk\\(.*\\)$)))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printf\\(.*\\)$)))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(panic)&&kind(function))))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(elf_call_log_callback)&&kind(function))))"}
--config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(vprintk_common)&&kind(function))))"}
--config=MC3A2.R17.1,macros+={hide , "^va_(arg|start|copy|end)$"}
+-doc_begin="printf()-like or scanf()-like functions are allowed to use the variadic features provided by stdarg.h,
+provided that they are declared using the `format' attribute."
+-decl_selector+={format_attr, "property(format)"}
+-config=MC3A2.R17.1,reports+={deliberate, "any_area(^.*va_list.*$&&context(ancestor_or_self(format_attr)))"}
+-config=MC3A2.R17.1,macros+={deliberate , "^va_(arg|start|copy|end)$"}
 -doc_end
 
 -doc_begin="Not using the return value of a function does not endanger safety if it coincides with an actual argument."
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index b3431ef24e..0d90f5886e 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -570,8 +570,10 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR.
 
    * - R17.1
-     - printf()-like functions  are allowed to use the variadic features provided
-       by `stdarg.h`.
+     - printf()-like or scanf()-like functions are allowed to use the variadic
+       features provided by `stdarg.h`, provided that they are declared using
+       __attribute__((format(...))) which enables compiler type-checking of
+       the variadic parameters.
      - Tagged as `deliberate` for ECLAIR.
 
    * - R17.7
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
index e5c9cc1099..c19b628069 100644
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -84,7 +84,9 @@
 #define elf_err(elf, fmt, args ... )                    \
     elf_call_log_callback(elf, 1, fmt , ## args );
 
-void elf_call_log_callback(struct elf_binary*, bool iserr, const char *fmt,...);
+void
+__attribute__ ((format (printf, 3, 4)))
+elf_call_log_callback(struct elf_binary *elf, bool iserr, const char *fmt, ...);
 
 #define safe_strcpy(d,s)                        \
 do { strncpy((d),(s),sizeof((d))-1);            \
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index a996051035..2bdb4d5fb4 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -969,7 +969,9 @@ static void printk_start_of_line(const char *prefix)
     __putstr(tstr);
 }
 
-static void vprintk_common(const char *fmt, va_list args, const char *prefix)
+static void
+__attribute__ ((format (printf, 1, 0)))
+vprintk_common(const char *fmt, va_list args, const char *prefix)
 {
     struct vps {
         bool continued, do_print;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 13:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 13:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196072.1513929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd6q0-0000Sl-C3; Tue, 06 Jan 2026 13:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196072.1513929; Tue, 06 Jan 2026 13:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd6q0-0000Sd-9D; Tue, 06 Jan 2026 13:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1196072;
 Tue, 06 Jan 2026 13:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vd6py-0000SX-8I
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 13:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd6px-00Bo0l-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd6py-00B5WQ-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 13:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zneBEsqu7pc5uGE9fWzPtYeH2hCgUBjbOBK2BdA4Sn8=; b=2jwmnvo6hu5wlmAWFQy9s20yAv
	22Pc4WxvLg8XsuPov/4myp9JNq9JePYKxO9niFo+5txNHUy35OB7XlTgsYkhoEz8ywWNYBmx2XzPj
	Q1mu4BLrItzVatpsDBCFWM8FLlLOM16SYBzDvGy4a5Qx+ooa7v477UAzr5b8myvLthZ0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul/test: use vpath uniformly for access to code living elsewhere
Message-Id: <E1vd6py-00B5WQ-0S@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 13:11:02 +0000

commit 89e6f0540e9d3c713c7c2966ae9ae069272ca305
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 6 09:38:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 09:38:55 2026 +0100

    x86emul/test: use vpath uniformly for access to code living elsewhere
    
    Replace the remaining non-local symlink-ing (i.e. of core emulator files)
    as well, to avoid mixing approaches. (The symlink-ing of test blob sources
    needs to remain for the time being.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/Makefile | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 3e02580a35..376cfe244d 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -11,6 +11,11 @@ all:
 run: $(TARGET)
 	./$(TARGET)
 
+# Add the core emulator to the build
+vpath x86_emulate/%.c $(XEN_ROOT)/xen/arch/x86
+vpath x86_emulate/%.h $(XEN_ROOT)/xen/arch/x86
+HOSTCFLAGS += -iquote $(XEN_ROOT)/xen/arch/x86
+
 # Add libx86 to the build
 vpath %.c $(XEN_ROOT)/xen/lib/x86
 
@@ -287,12 +292,8 @@ else
 run32 clean32: %32: %
 endif
 
-.PHONY: x86_emulate
 x86_emulate:
 	mkdir -p $@
-	ln -sf $(XEN_ROOT)/xen/arch/x86/$@/*.[ch] $@/
-
-x86_emulate/%: x86_emulate ;
 
 HOSTCFLAGS-x86_64 := -fno-PIE
 $(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-pie)
@@ -307,6 +308,8 @@ x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h $
 $(OBJS): %.o: %.c $(x86_emulate.h)
 	$(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $<
 
+$(filter x86_emulate/%.o,$(OBJS)): x86_emulate
+
 x86-emulate.o: x86_emulate/x86_emulate.c
 x86-emulate.o x86_emulate/%.o: HOSTCFLAGS += -D__XEN_TOOLS__
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 13:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 13:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196073.1513932 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd6qA-0000UG-DB; Tue, 06 Jan 2026 13:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196073.1513932; Tue, 06 Jan 2026 13:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd6qA-0000U8-AX; Tue, 06 Jan 2026 13:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1196073;
 Tue, 06 Jan 2026 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 1vd6q8-0000Ts-Al
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 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 1vd6q8-00Bo0q-03
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd6q8-00B5Y8-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 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=4QO0wZ9t8zvmyUOXUeOLTHuVfpA2qqCcGvCr3SwXrks=; b=yjINKuQ8iXqGDVtd1VRxkyqBqw
	EkYChSyhTyoryYE1S8ojxe7gz8p8g3xxFfkjnwv6VzOyvRUBDyNgn5+7dWJcr7UgHUzclIBZZON8q
	FhkaJoTgOVZWImCiDUl6ovBs99OAd1cZn+O495ZXArv+0D68eryBlRnat2ExNozh5qCg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul/fuzz: use vpath uniformly for access to code living elsewhere
Message-Id: <E1vd6q8-00B5Y8-0o@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 13:11:12 +0000

commit 04eaf572322eaf53a7f23e3d59a41f7fb0bd3a2f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 6 09:39:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 09:39:48 2026 +0100

    x86emul/fuzz: use vpath uniformly for access to code living elsewhere
    
    Replace the remaining symlink-ing (of test harness and core emulator
    files) as well, to avoid mixing approaches. This way various explicit
    dependencies can also go away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/x86_instruction_emulator/Makefile | 40 +++++++++++++---------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile
index 524644ec28..d104b15f4f 100644
--- a/tools/fuzz/x86_instruction_emulator/Makefile
+++ b/tools/fuzz/x86_instruction_emulator/Makefile
@@ -8,22 +8,23 @@ else
 x86-insn-fuzz-all:
 endif
 
-# Add libx86 to the build
-vpath %.c $(XEN_ROOT)/xen/lib/x86
+CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__
 
-x86_emulate: FORCE
-	mkdir -p $@
-	ln -sf $(XEN_ROOT)/xen/arch/x86/$@/*.[ch] $@/
+# Add the core emulator to the build
+vpath x86_emulate/%.c $(XEN_ROOT)/xen/arch/x86
+vpath x86_emulate/%.h $(XEN_ROOT)/xen/arch/x86
+CFLAGS += -iquote $(XEN_ROOT)/xen/arch/x86
 
-x86_emulate/%.c: x86_emulate ;
-x86_emulate/%.h: x86_emulate ;
+# Add the emulator test harness to the build
+vpath %.c ../../tests/x86_emulator
+vpath %.h ../../tests/x86_emulator
+CFLAGS += -iquote ../../tests/x86_emulator
 
-%.c: $(XEN_ROOT)/tools/tests/x86_emulator/%.c FORCE
-	ln -nsf $< $@
-%.h: $(XEN_ROOT)/tools/tests/x86_emulator/%.h FORCE
-	ln -nsf $< $@
+# Add libx86 to the build
+vpath %.c $(XEN_ROOT)/xen/lib/x86
 
-CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -iquote .
+x86_emulate:
+	mkdir -p $@
 
 GCOV_FLAGS := --coverage
 %-cov.o: %.c
@@ -33,18 +34,13 @@ OBJS := fuzz-emul.o x86-emulate.o
 OBJS += x86_emulate/0f01.o x86_emulate/0fae.o x86_emulate/0fc7.o
 OBJS += x86_emulate/decode.o x86_emulate/fpu.o
 
-WRAPPED = $(shell sed -n 's,^ *WRAP(\([[:alnum:]_]*\));,\1,p' x86-emulate.h)
-
-private.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h
-
-x86-emulate.h: x86_emulate/x86_emulate.h
-x86-emulate.o x86-emulate-cov.o: x86_emulate/x86_emulate.c $(private.h)
-fuzz-emul.o fuzz-emul-cov.o wrappers.o: x86-emulate.h
+WRAPPED = $(shell sed -n 's,^ *WRAP(\([[:alnum:]_]*\));,\1,p' \
+                      ../../tests/x86_emulator/x86-emulate.h)
 
-$(filter x86_emulate/%.o,$(OBJS)): x86_emulate/%.o: x86_emulate/%.c $(private.h)
+$(filter x86_emulate/%.o,$(OBJS)): x86_emulate/%.o: x86_emulate/%.c x86_emulate
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -o $@ $< $(APPEND_CFLAGS)
 
-$(patsubst %.o,%-cov.o,$(filter x86_emulate/%.o,$(OBJS))): x86_emulate/%-cov.o: x86_emulate/%.c $(private.h)
+$(patsubst %.o,%-cov.o,$(filter x86_emulate/%.o,$(OBJS))): x86_emulate/%-cov.o: x86_emulate/%.c x86_emulate
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) $(GCOV_FLAGS) -c -o $@ $< $(APPEND_CFLAGS)
 
 x86-insn-fuzzer.a: $(OBJS) cpuid.o
@@ -70,7 +66,7 @@ distclean: clean
 clean:
 	rm -f *.a *.o $(DEPS_RM) *.gcda *.gcno *.gcov
 	rm -f afl-harness afl-harness-cov libfuzzer-harness
-	rm -rf x86_emulate x86-emulate.c x86-emulate.h wrappers.c
+	rm -rf x86_emulate
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 13:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 13:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196074.1513936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd6qJ-0000Wd-Em; Tue, 06 Jan 2026 13:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196074.1513936; Tue, 06 Jan 2026 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 1vd6qJ-0000WW-Bw; Tue, 06 Jan 2026 13:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1196074;
 Tue, 06 Jan 2026 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 1vd6qI-0000WK-Dj
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 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 1vd6qI-00Bo0u-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd6qI-00B5Yt-19
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 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=kwviOkFWbSve+1INwkGtFjXirXxGbkE9KBrXOyH0A+E=; b=NumjUGCwuPpneIf+mYPanf7zNj
	931vdlxjPt20kAHbomCNdE3IgqkOomatdR4/T1dbevQOVTZffHVufqV8BQIvC5yXg2W/+BEnZ7aK0
	sumkIq18oojCMJRfAmCLLPKhkUJnQFamhPJN9t8d/NV+KAa/lHBu59OQQLBGn0tWaMOY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: vcpu_vgic_free() updates
Message-Id: <E1vd6qI-00B5Yt-19@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 13:11:22 +0000

commit 42a43638a416567e13af9e5ae01e0ef327061cd6
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Jan 6 09:40:32 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 10:55:56 2026 +0100

    xen/arm: vcpu_vgic_free() updates
    
    Use XFREE() instead of xfree() so that vcpu_vgic_free() can be idempotent.
    With XFREE(), vgic_vcpu->private_irqs is set to NULL, so calling
    vcpu_vgic_free() a second time is not an issue.
    
    Update the prototype of vcpu_vgic_free() to return void to satisfy MISRA
    Rule 17.7, since the return value of vcpu_vgic_free() is not used by any
    callers.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/vgic.h | 2 +-
 xen/arch/arm/vgic.c             | 5 ++---
 xen/arch/arm/vgic/vgic-init.c   | 4 +---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index 31b3d3e5ec..6f9ab1c98c 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -418,7 +418,7 @@ int domain_vgic_register(struct domain *d, unsigned int *mmio_count);
 int domain_vgic_init(struct domain *d, unsigned int nr_spis);
 void domain_vgic_free(struct domain *d);
 int vcpu_vgic_init(struct vcpu *v);
-int vcpu_vgic_free(struct vcpu *v);
+void vcpu_vgic_free(struct vcpu *v);
 
 void vgic_inject_irq(struct domain *d, struct vcpu *v, unsigned int virq,
                      bool level);
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 3ebdf9953f..6647071ad4 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -390,10 +390,9 @@ int vcpu_vgic_init(struct vcpu *v)
     return 0;
 }
 
-int vcpu_vgic_free(struct vcpu *v)
+void vcpu_vgic_free(struct vcpu *v)
 {
-    xfree(v->arch.vgic.private_irqs);
-    return 0;
+    XFREE(v->arch.vgic.private_irqs);
 }
 
 struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq)
diff --git a/xen/arch/arm/vgic/vgic-init.c b/xen/arch/arm/vgic/vgic-init.c
index f8d7d3a226..aef526f2e7 100644
--- a/xen/arch/arm/vgic/vgic-init.c
+++ b/xen/arch/arm/vgic/vgic-init.c
@@ -239,13 +239,11 @@ void domain_vgic_free(struct domain *d)
     dist->nr_spis = 0;
 }
 
-int vcpu_vgic_free(struct vcpu *v)
+void vcpu_vgic_free(struct vcpu *v)
 {
     struct vgic_cpu *vgic_cpu = &v->arch.vgic;
 
     INIT_LIST_HEAD(&vgic_cpu->ap_list_head);
-
-    return 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 13:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196075.1513941 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd6qT-0000Yn-GB; Tue, 06 Jan 2026 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196075.1513941; Tue, 06 Jan 2026 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 1vd6qT-0000Yf-DU; Tue, 06 Jan 2026 13:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1196075;
 Tue, 06 Jan 2026 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 1vd6qS-0000YV-IE
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 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 1vd6qS-00Bo1U-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd6qS-00B5Zz-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 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=UZeRpSvYcTwnnzSExzZBk4zODG1gIpqNmK4afraaNNU=; b=tbYFrX7S2wBR9awlzHiYXo+11l
	cNjW5cFxdEbeu+eyP/vzUjYAsg3cQipyymTdHxst5Kc9BVfI82rNpv5TBCC2knAvFOQ4E/eCds0c8
	9lOPULmj1GIo0jBOPZ9plremDCn/H7qgLM6mLLv7sx/6kkamPe/UbmX7lKiGh2RgpDvQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add RISC-V virtual SBI base extension support for guests
Message-Id: <E1vd6qS-00B5Zz-1S@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 13:11:32 +0000

commit aaa1607b167e5884e8ca98a28ac05726cf05fbc2
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Jan 6 09:41:21 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 10:55:56 2026 +0100

    xen/riscv: add RISC-V virtual SBI base extension support for guests
    
    Add support of virtual SBI base extension calls for RISC-V guests, delegating
    hardware-specific queries to the underlying SBI and handling version and
    firmware ID queries directly.
    
    The changes include:
    1. Define new SBI base extension function IDs (SBI_EXT_BASE_GET_MVENDORID,
       SBI_EXT_BASE_GET_MARCHID, SBI_EXT_BASE_GET_MIMPID).
    2. Introduce XEN_SBI_VER_MAJOR, XEN_SBI_VER_MINOR for imeplenataion of
       SBI_EXT_BASE_GET_SPEC_VERSION.
    4. Introduce SBI_XEN_IMPID to implement SBI_EXT_BASE_GET_IMP_ID.
    5. Implement handling of SBI base extension functions, including version,
       firmware ID, and machine-specific queries.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/sbi.h     |  6 +++
 xen/arch/riscv/vsbi/Makefile         |  1 +
 xen/arch/riscv/vsbi/base-extension.c | 82 ++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+)

diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index 751bae6d66..79f7ff5c55 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -14,6 +14,9 @@
 
 #include <xen/cpumask.h>
 
+/* SBI-defined implementation ID */
+#define SBI_XEN_IMPID 7
+
 #define SBI_EXT_0_1_SET_TIMER               0x0
 #define SBI_EXT_0_1_CONSOLE_PUTCHAR         0x1
 #define SBI_EXT_0_1_CONSOLE_GETCHAR         0x2
@@ -32,6 +35,9 @@
 #define SBI_EXT_BASE_GET_IMP_ID         0x1
 #define SBI_EXT_BASE_GET_IMP_VERSION    0x2
 #define SBI_EXT_BASE_PROBE_EXT          0x3
+#define SBI_EXT_BASE_GET_MVENDORID      0x4
+#define SBI_EXT_BASE_GET_MARCHID        0x5
+#define SBI_EXT_BASE_GET_MIMPID         0x6
 
 /* SBI function IDs for RFENCE extension */
 #define SBI_EXT_RFENCE_REMOTE_FENCE_I           0x0
diff --git a/xen/arch/riscv/vsbi/Makefile b/xen/arch/riscv/vsbi/Makefile
index bc5755cb13..8ce470f787 100644
--- a/xen/arch/riscv/vsbi/Makefile
+++ b/xen/arch/riscv/vsbi/Makefile
@@ -1,2 +1,3 @@
+obj-y += base-extension.o
 obj-y += core.o
 obj-y += legacy-extension.o
diff --git a/xen/arch/riscv/vsbi/base-extension.c b/xen/arch/riscv/vsbi/base-extension.c
new file mode 100644
index 0000000000..41a95ae188
--- /dev/null
+++ b/xen/arch/riscv/vsbi/base-extension.c
@@ -0,0 +1,82 @@
+
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/lib.h>
+#include <xen/sched.h>
+#include <xen/version.h>
+
+#include <asm/processor.h>
+#include <asm/sbi.h>
+#include <asm/vsbi.h>
+
+/* Xen-controlled SBI version reported to guests */
+#define XEN_SBI_VER_MAJOR 0
+#define XEN_SBI_VER_MINOR 2
+
+static int vsbi_base_ecall_handler(unsigned long eid, unsigned long fid,
+                                   struct cpu_user_regs *regs)
+{
+    int ret = 0;
+    struct sbiret sbi_ret;
+
+    ASSERT(eid == SBI_EXT_BASE);
+
+    switch ( fid )
+    {
+    case SBI_EXT_BASE_GET_SPEC_VERSION:
+        regs->a1 = MASK_INSR(XEN_SBI_VER_MAJOR, SBI_SPEC_VERSION_MAJOR_MASK) |
+                   XEN_SBI_VER_MINOR;
+        break;
+
+    case SBI_EXT_BASE_GET_IMP_ID:
+        regs->a1 = SBI_XEN_IMPID;
+        break;
+
+    case SBI_EXT_BASE_GET_IMP_VERSION:
+        regs->a1 = (xen_major_version() << 16) | xen_minor_version();
+        break;
+
+    case SBI_EXT_BASE_GET_MVENDORID:
+    case SBI_EXT_BASE_GET_MARCHID:
+    case SBI_EXT_BASE_GET_MIMPID:
+        if ( is_hardware_domain(current->domain) )
+        {
+            sbi_ret = sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0, 0);
+            ret = sbi_ret.error;
+            regs->a1 = sbi_ret.value;
+        }
+        else
+            /*
+             * vSBI should present a consistent, virtualized view to guests.
+             * In particular, DomU-visible data must remain stable across
+             * migration and must not expose hardware-specific details.
+             *
+             * These register(s) must be readable in any implementation,
+             * but a value of 0 can be returned to indicate the field
+             * is not implemented.
+             */
+            regs->a1 = 0;
+
+        break;
+
+    case SBI_EXT_BASE_PROBE_EXT:
+        regs->a1 = vsbi_find_extension(regs->a0) ? 1 : 0;
+        break;
+
+    default:
+        /*
+         * TODO: domain_crash() is acceptable here while things are still under
+         * development.
+         * It shouldn't stay like this in the end though: guests should not
+         * be punished like this for something Xen hasn't implemented.
+         */
+        domain_crash(current->domain,
+                     "%s: Unsupported ecall: EID: #%#lx FID: #%lu\n",
+                     __func__, eid, fid);
+        break;
+    }
+
+    return ret;
+}
+
+VSBI_EXT(base, SBI_EXT_BASE, SBI_EXT_BASE, vsbi_base_ecall_handler)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 14:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 14:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196236.1514095 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd7wg-0000L3-Sk; Tue, 06 Jan 2026 14:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196236.1514095; Tue, 06 Jan 2026 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 1vd7wg-0000Kv-Q0; Tue, 06 Jan 2026 14:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1196236;
 Tue, 06 Jan 2026 14: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 1vd7wf-0000Kp-JY
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 14: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 1vd7wf-00BpQK-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 14:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd7wf-00B9WN-1d
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 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=dRis/cF3Y1L9/toWfn4AnEss2kWThDcrCyTYVJ4ESlw=; b=zkQqOarE/zcExRZ7uzeCDKiAVw
	ADCHbzwIHDswsqJZP2pGThtWpbeXZHx9c9T6TPF73Cuum2LJmFN76CId3tE6E7PWsyGsSyMzytqE/
	X8n/n917PI5iKIb/DAj1aiCwglKmwYNsEffIHHk1Hw6Zwewm9IpFZFWAIFiqMXO7g1OU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul/test: use vpath uniformly for access to code living elsewhere
Message-Id: <E1vd7wf-00B9WN-1d@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 14:22:01 +0000

commit 89e6f0540e9d3c713c7c2966ae9ae069272ca305
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 6 09:38:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 09:38:55 2026 +0100

    x86emul/test: use vpath uniformly for access to code living elsewhere
    
    Replace the remaining non-local symlink-ing (i.e. of core emulator files)
    as well, to avoid mixing approaches. (The symlink-ing of test blob sources
    needs to remain for the time being.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/Makefile | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 3e02580a35..376cfe244d 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -11,6 +11,11 @@ all:
 run: $(TARGET)
 	./$(TARGET)
 
+# Add the core emulator to the build
+vpath x86_emulate/%.c $(XEN_ROOT)/xen/arch/x86
+vpath x86_emulate/%.h $(XEN_ROOT)/xen/arch/x86
+HOSTCFLAGS += -iquote $(XEN_ROOT)/xen/arch/x86
+
 # Add libx86 to the build
 vpath %.c $(XEN_ROOT)/xen/lib/x86
 
@@ -287,12 +292,8 @@ else
 run32 clean32: %32: %
 endif
 
-.PHONY: x86_emulate
 x86_emulate:
 	mkdir -p $@
-	ln -sf $(XEN_ROOT)/xen/arch/x86/$@/*.[ch] $@/
-
-x86_emulate/%: x86_emulate ;
 
 HOSTCFLAGS-x86_64 := -fno-PIE
 $(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-pie)
@@ -307,6 +308,8 @@ x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h $
 $(OBJS): %.o: %.c $(x86_emulate.h)
 	$(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $<
 
+$(filter x86_emulate/%.o,$(OBJS)): x86_emulate
+
 x86-emulate.o: x86_emulate/x86_emulate.c
 x86-emulate.o x86_emulate/%.o: HOSTCFLAGS += -D__XEN_TOOLS__
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 14:22:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 14:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196237.1514099 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd7wq-0000NO-UO; Tue, 06 Jan 2026 14:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196237.1514099; Tue, 06 Jan 2026 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 1vd7wq-0000Mu-RV; Tue, 06 Jan 2026 14:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1196237;
 Tue, 06 Jan 2026 14: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 1vd7wp-0000Mg-NV
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 14: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 1vd7wp-00BpQf-1H
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 14:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd7wp-00B9Wx-1w
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 14: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=KWZMry6RLLPqHj29qCPF/LaNPY/egxpQfW93lCDy5pw=; b=k2zwV2mnJrczdPJipHCfUOYMdL
	2jm+pW6e7fqYncCgMx3IVPUoyHWeaSyXnzofV9vWv3Pg9ZWd3PdQaIVD5nMRUpIYz2Y1ssgJan+Dc
	3CEfiXAGzhF8mAWVPSvo1BofWXXvRr9Cjgq9ONe+LCAN7XxhvruprX/f1N6rBoqaHWsw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul/fuzz: use vpath uniformly for access to code living elsewhere
Message-Id: <E1vd7wp-00B9Wx-1w@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 14:22:11 +0000

commit 04eaf572322eaf53a7f23e3d59a41f7fb0bd3a2f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 6 09:39:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 09:39:48 2026 +0100

    x86emul/fuzz: use vpath uniformly for access to code living elsewhere
    
    Replace the remaining symlink-ing (of test harness and core emulator
    files) as well, to avoid mixing approaches. This way various explicit
    dependencies can also go away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/x86_instruction_emulator/Makefile | 40 +++++++++++++---------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile
index 524644ec28..d104b15f4f 100644
--- a/tools/fuzz/x86_instruction_emulator/Makefile
+++ b/tools/fuzz/x86_instruction_emulator/Makefile
@@ -8,22 +8,23 @@ else
 x86-insn-fuzz-all:
 endif
 
-# Add libx86 to the build
-vpath %.c $(XEN_ROOT)/xen/lib/x86
+CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__
 
-x86_emulate: FORCE
-	mkdir -p $@
-	ln -sf $(XEN_ROOT)/xen/arch/x86/$@/*.[ch] $@/
+# Add the core emulator to the build
+vpath x86_emulate/%.c $(XEN_ROOT)/xen/arch/x86
+vpath x86_emulate/%.h $(XEN_ROOT)/xen/arch/x86
+CFLAGS += -iquote $(XEN_ROOT)/xen/arch/x86
 
-x86_emulate/%.c: x86_emulate ;
-x86_emulate/%.h: x86_emulate ;
+# Add the emulator test harness to the build
+vpath %.c ../../tests/x86_emulator
+vpath %.h ../../tests/x86_emulator
+CFLAGS += -iquote ../../tests/x86_emulator
 
-%.c: $(XEN_ROOT)/tools/tests/x86_emulator/%.c FORCE
-	ln -nsf $< $@
-%.h: $(XEN_ROOT)/tools/tests/x86_emulator/%.h FORCE
-	ln -nsf $< $@
+# Add libx86 to the build
+vpath %.c $(XEN_ROOT)/xen/lib/x86
 
-CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -iquote .
+x86_emulate:
+	mkdir -p $@
 
 GCOV_FLAGS := --coverage
 %-cov.o: %.c
@@ -33,18 +34,13 @@ OBJS := fuzz-emul.o x86-emulate.o
 OBJS += x86_emulate/0f01.o x86_emulate/0fae.o x86_emulate/0fc7.o
 OBJS += x86_emulate/decode.o x86_emulate/fpu.o
 
-WRAPPED = $(shell sed -n 's,^ *WRAP(\([[:alnum:]_]*\));,\1,p' x86-emulate.h)
-
-private.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h
-
-x86-emulate.h: x86_emulate/x86_emulate.h
-x86-emulate.o x86-emulate-cov.o: x86_emulate/x86_emulate.c $(private.h)
-fuzz-emul.o fuzz-emul-cov.o wrappers.o: x86-emulate.h
+WRAPPED = $(shell sed -n 's,^ *WRAP(\([[:alnum:]_]*\));,\1,p' \
+                      ../../tests/x86_emulator/x86-emulate.h)
 
-$(filter x86_emulate/%.o,$(OBJS)): x86_emulate/%.o: x86_emulate/%.c $(private.h)
+$(filter x86_emulate/%.o,$(OBJS)): x86_emulate/%.o: x86_emulate/%.c x86_emulate
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -o $@ $< $(APPEND_CFLAGS)
 
-$(patsubst %.o,%-cov.o,$(filter x86_emulate/%.o,$(OBJS))): x86_emulate/%-cov.o: x86_emulate/%.c $(private.h)
+$(patsubst %.o,%-cov.o,$(filter x86_emulate/%.o,$(OBJS))): x86_emulate/%-cov.o: x86_emulate/%.c x86_emulate
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) $(GCOV_FLAGS) -c -o $@ $< $(APPEND_CFLAGS)
 
 x86-insn-fuzzer.a: $(OBJS) cpuid.o
@@ -70,7 +66,7 @@ distclean: clean
 clean:
 	rm -f *.a *.o $(DEPS_RM) *.gcda *.gcno *.gcov
 	rm -f afl-harness afl-harness-cov libfuzzer-harness
-	rm -rf x86_emulate x86-emulate.c x86-emulate.h wrappers.c
+	rm -rf x86_emulate
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 14:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 14:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196238.1514103 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd7x1-0000QI-0P; Tue, 06 Jan 2026 14:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196238.1514103; Tue, 06 Jan 2026 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 1vd7x0-0000QA-UB; Tue, 06 Jan 2026 14:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1196238;
 Tue, 06 Jan 2026 14:22: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 1vd7wz-0000Q1-Pm
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 14:22: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 1vd7wz-00BpQo-1Z
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 14:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd7wz-00B9XX-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 14:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HPvgrPc2a0J2vYa6Egey3TGR/DCH6izeVZZtVNNVrZM=; b=f4b3WQ3Hzw5CeVh+2tWYugVv6P
	E+36HvcSbz+O0nmB/ISlKdaxeSwCiH7G3mH3E1+owrWTeAinYlnyYlc5X8aeBgqNdQdt0GYFUFnUt
	ekSoPmNn6cMAwctXookRmFw118PSuW6DhDx0t+XB5bCXwksYvxdkbIiejrKojj71VD6k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: vcpu_vgic_free() updates
Message-Id: <E1vd7wz-00B9XX-2O@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 14:22:21 +0000

commit 42a43638a416567e13af9e5ae01e0ef327061cd6
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Jan 6 09:40:32 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 10:55:56 2026 +0100

    xen/arm: vcpu_vgic_free() updates
    
    Use XFREE() instead of xfree() so that vcpu_vgic_free() can be idempotent.
    With XFREE(), vgic_vcpu->private_irqs is set to NULL, so calling
    vcpu_vgic_free() a second time is not an issue.
    
    Update the prototype of vcpu_vgic_free() to return void to satisfy MISRA
    Rule 17.7, since the return value of vcpu_vgic_free() is not used by any
    callers.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/vgic.h | 2 +-
 xen/arch/arm/vgic.c             | 5 ++---
 xen/arch/arm/vgic/vgic-init.c   | 4 +---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index 31b3d3e5ec..6f9ab1c98c 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -418,7 +418,7 @@ int domain_vgic_register(struct domain *d, unsigned int *mmio_count);
 int domain_vgic_init(struct domain *d, unsigned int nr_spis);
 void domain_vgic_free(struct domain *d);
 int vcpu_vgic_init(struct vcpu *v);
-int vcpu_vgic_free(struct vcpu *v);
+void vcpu_vgic_free(struct vcpu *v);
 
 void vgic_inject_irq(struct domain *d, struct vcpu *v, unsigned int virq,
                      bool level);
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 3ebdf9953f..6647071ad4 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -390,10 +390,9 @@ int vcpu_vgic_init(struct vcpu *v)
     return 0;
 }
 
-int vcpu_vgic_free(struct vcpu *v)
+void vcpu_vgic_free(struct vcpu *v)
 {
-    xfree(v->arch.vgic.private_irqs);
-    return 0;
+    XFREE(v->arch.vgic.private_irqs);
 }
 
 struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq)
diff --git a/xen/arch/arm/vgic/vgic-init.c b/xen/arch/arm/vgic/vgic-init.c
index f8d7d3a226..aef526f2e7 100644
--- a/xen/arch/arm/vgic/vgic-init.c
+++ b/xen/arch/arm/vgic/vgic-init.c
@@ -239,13 +239,11 @@ void domain_vgic_free(struct domain *d)
     dist->nr_spis = 0;
 }
 
-int vcpu_vgic_free(struct vcpu *v)
+void vcpu_vgic_free(struct vcpu *v)
 {
     struct vgic_cpu *vgic_cpu = &v->arch.vgic;
 
     INIT_LIST_HEAD(&vgic_cpu->ap_list_head);
-
-    return 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 06 14:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Jan 2026 14:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196239.1514107 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vd7xB-0000SN-1p; Tue, 06 Jan 2026 14:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196239.1514107; Tue, 06 Jan 2026 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 1vd7xA-0000SF-VX; Tue, 06 Jan 2026 14:22:32 +0000
Received: by outflank-mailman (input) for mailman id 1196239;
 Tue, 06 Jan 2026 14:22: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 1vd7x9-0000S7-UT
 for xen-changelog@lists.xenproject.org; Tue, 06 Jan 2026 14:22: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 1vd7x9-00BpRC-1q
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 14:22:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vd7x9-00B9YC-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 06 Jan 2026 14:22: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=8t2jhGC+8eSEoQeskQMzMkfSEbOcNdDOezhFFC+EHVk=; b=sOWi0PObbj57zSuZ2oH0BaR37T
	/ockpVXqBWTIBn/aZ1hVsYpnW8J4JbPwcrFbcsY8VlsgJeyR/5Uyl3bd6ERm5pzTpqNVZmfu1B2SG
	6jK/YSolQji/fU/qOTSLe0ugOx1RddyyZH6lJZcOBN533Vt2l8ysrBAIjwvBbwD1jeFg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add RISC-V virtual SBI base extension support for guests
Message-Id: <E1vd7x9-00B9YC-2f@xenbits.xenproject.org>
Date: Tue, 06 Jan 2026 14:22:31 +0000

commit aaa1607b167e5884e8ca98a28ac05726cf05fbc2
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Jan 6 09:41:21 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 6 10:55:56 2026 +0100

    xen/riscv: add RISC-V virtual SBI base extension support for guests
    
    Add support of virtual SBI base extension calls for RISC-V guests, delegating
    hardware-specific queries to the underlying SBI and handling version and
    firmware ID queries directly.
    
    The changes include:
    1. Define new SBI base extension function IDs (SBI_EXT_BASE_GET_MVENDORID,
       SBI_EXT_BASE_GET_MARCHID, SBI_EXT_BASE_GET_MIMPID).
    2. Introduce XEN_SBI_VER_MAJOR, XEN_SBI_VER_MINOR for imeplenataion of
       SBI_EXT_BASE_GET_SPEC_VERSION.
    4. Introduce SBI_XEN_IMPID to implement SBI_EXT_BASE_GET_IMP_ID.
    5. Implement handling of SBI base extension functions, including version,
       firmware ID, and machine-specific queries.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/sbi.h     |  6 +++
 xen/arch/riscv/vsbi/Makefile         |  1 +
 xen/arch/riscv/vsbi/base-extension.c | 82 ++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+)

diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index 751bae6d66..79f7ff5c55 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -14,6 +14,9 @@
 
 #include <xen/cpumask.h>
 
+/* SBI-defined implementation ID */
+#define SBI_XEN_IMPID 7
+
 #define SBI_EXT_0_1_SET_TIMER               0x0
 #define SBI_EXT_0_1_CONSOLE_PUTCHAR         0x1
 #define SBI_EXT_0_1_CONSOLE_GETCHAR         0x2
@@ -32,6 +35,9 @@
 #define SBI_EXT_BASE_GET_IMP_ID         0x1
 #define SBI_EXT_BASE_GET_IMP_VERSION    0x2
 #define SBI_EXT_BASE_PROBE_EXT          0x3
+#define SBI_EXT_BASE_GET_MVENDORID      0x4
+#define SBI_EXT_BASE_GET_MARCHID        0x5
+#define SBI_EXT_BASE_GET_MIMPID         0x6
 
 /* SBI function IDs for RFENCE extension */
 #define SBI_EXT_RFENCE_REMOTE_FENCE_I           0x0
diff --git a/xen/arch/riscv/vsbi/Makefile b/xen/arch/riscv/vsbi/Makefile
index bc5755cb13..8ce470f787 100644
--- a/xen/arch/riscv/vsbi/Makefile
+++ b/xen/arch/riscv/vsbi/Makefile
@@ -1,2 +1,3 @@
+obj-y += base-extension.o
 obj-y += core.o
 obj-y += legacy-extension.o
diff --git a/xen/arch/riscv/vsbi/base-extension.c b/xen/arch/riscv/vsbi/base-extension.c
new file mode 100644
index 0000000000..41a95ae188
--- /dev/null
+++ b/xen/arch/riscv/vsbi/base-extension.c
@@ -0,0 +1,82 @@
+
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/lib.h>
+#include <xen/sched.h>
+#include <xen/version.h>
+
+#include <asm/processor.h>
+#include <asm/sbi.h>
+#include <asm/vsbi.h>
+
+/* Xen-controlled SBI version reported to guests */
+#define XEN_SBI_VER_MAJOR 0
+#define XEN_SBI_VER_MINOR 2
+
+static int vsbi_base_ecall_handler(unsigned long eid, unsigned long fid,
+                                   struct cpu_user_regs *regs)
+{
+    int ret = 0;
+    struct sbiret sbi_ret;
+
+    ASSERT(eid == SBI_EXT_BASE);
+
+    switch ( fid )
+    {
+    case SBI_EXT_BASE_GET_SPEC_VERSION:
+        regs->a1 = MASK_INSR(XEN_SBI_VER_MAJOR, SBI_SPEC_VERSION_MAJOR_MASK) |
+                   XEN_SBI_VER_MINOR;
+        break;
+
+    case SBI_EXT_BASE_GET_IMP_ID:
+        regs->a1 = SBI_XEN_IMPID;
+        break;
+
+    case SBI_EXT_BASE_GET_IMP_VERSION:
+        regs->a1 = (xen_major_version() << 16) | xen_minor_version();
+        break;
+
+    case SBI_EXT_BASE_GET_MVENDORID:
+    case SBI_EXT_BASE_GET_MARCHID:
+    case SBI_EXT_BASE_GET_MIMPID:
+        if ( is_hardware_domain(current->domain) )
+        {
+            sbi_ret = sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0, 0);
+            ret = sbi_ret.error;
+            regs->a1 = sbi_ret.value;
+        }
+        else
+            /*
+             * vSBI should present a consistent, virtualized view to guests.
+             * In particular, DomU-visible data must remain stable across
+             * migration and must not expose hardware-specific details.
+             *
+             * These register(s) must be readable in any implementation,
+             * but a value of 0 can be returned to indicate the field
+             * is not implemented.
+             */
+            regs->a1 = 0;
+
+        break;
+
+    case SBI_EXT_BASE_PROBE_EXT:
+        regs->a1 = vsbi_find_extension(regs->a0) ? 1 : 0;
+        break;
+
+    default:
+        /*
+         * TODO: domain_crash() is acceptable here while things are still under
+         * development.
+         * It shouldn't stay like this in the end though: guests should not
+         * be punished like this for something Xen hasn't implemented.
+         */
+        domain_crash(current->domain,
+                     "%s: Unsupported ecall: EID: #%#lx FID: #%lu\n",
+                     __func__, eid, fid);
+        break;
+    }
+
+    return ret;
+}
+
+VSBI_EXT(base, SBI_EXT_BASE, SBI_EXT_BASE, vsbi_base_ecall_handler)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 11:55:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 11:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196682.1514421 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdS7y-0003o8-TH; Wed, 07 Jan 2026 11:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196682.1514421; Wed, 07 Jan 2026 11: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 1vdS7y-0003o0-Q5; Wed, 07 Jan 2026 11:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1196682;
 Wed, 07 Jan 2026 11: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 1vdS7x-0003nu-VX
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 11:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdS7x-00DOVP-1z
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdS7x-00COEt-2W
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5yPTMGYNEhGL/GUV410gU6YXaBQGGvLKq6dCwKibpx4=; b=7PVyJgpb6EoOWEu+wDOOiTyr8m
	25ssndI+bjL2JHpTK1mOifY/JgUF+T4jEcljBUmMIKqR/oLyFXrFP94GSsRWw6G2iWsSTadTzBLpn
	lnSTxwAhwOK9zGabyfZ57WAVKnLuZWrSxXqOimCdINsZCf3DP+vNtAtduNt8kHbATixk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Fix endian handling in muldiv64.c
Message-Id: <E1vdS7x-00COEt-2W@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 11:55:01 +0000

commit b56a894e99098b71d9e41781cd3a283e097b0942
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:39:03 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    xen: Fix endian handling in muldiv64.c
    
    WORDS_BIGENDIAN is a QEMU-ism.  In the very dim and distant past, we had a
    fork of QEMU living in xen.git which wired WORDS_BIGENDIAN in the userspace
    part of the build, but nothing ever wired it up in the hypervisor build.
    
    Fixes: 86d5da49a6f7 ("[HVM] Support multiple HVM time device models coming soon.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/lib/muldiv64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index 79411f5d59..f281578c09 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -13,10 +13,12 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
     union {
         uint64_t ll;
         struct {
-#ifdef WORDS_BIGENDIAN
+#if defined(__BIG_ENDIAN)
             uint32_t high, low;
-#else
+#elif defined(__LITTLE_ENDIAN)
             uint32_t low, high;
+#else
+# error Unknown Endianness
 #endif
         } l;
     } u, res;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 11:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 11:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196683.1514424 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdS88-0003pu-U5; Wed, 07 Jan 2026 11:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196683.1514424; Wed, 07 Jan 2026 11: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 1vdS88-0003pm-RY; Wed, 07 Jan 2026 11:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1196683;
 Wed, 07 Jan 2026 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 1vdS88-0003pa-39
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 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 1vdS87-00DOVT-2T
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdS87-00COGS-36
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lDuTdikDW6u3hwlGNsvnVt1SsdDe9nL3fXAGzIFibzI=; b=vn/CvBUI5b6IVP5e1g0MRWNj57
	+p7YHC1x3SlXRk2ke6fGNyAClNB1I26eqKosJ/H80TBXJHudyXU7sfemELvZUYevr1NYshR8CYtvs
	HSrOXLtofiXdfY3EVyVFYMojTF+B52mSReBeuLPSJjPTCEeP6/fmTdJ6d4Fnj/Nq5UEg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/time: Sort headers
Message-Id: <E1vdS87-00COGS-36@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 11:55:11 +0000

commit 1ae6c79de10a510fe989eea32a5e813c99bbeeaa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:40:12 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    arm/time: Sort headers
    
    ... in preparation for a logical change.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/time.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 3710eab109..03dc5b51a8 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -8,26 +8,27 @@
  * Copyright (c) 2011 Citrix Systems.
  */
 
+#include <xen/acpi.h>
 #include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/device_tree.h>
+#include <xen/event.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#include <xen/softirq.h>
+#include <xen/notifier.h>
 #include <xen/sched.h>
-#include <xen/time.h>
-#include <xen/delay.h>
 #include <xen/sched.h>
-#include <xen/event.h>
-#include <xen/acpi.h>
-#include <xen/cpu.h>
-#include <xen/notifier.h>
+#include <xen/softirq.h>
+#include <xen/time.h>
+
+#include <asm/cpufeature.h>
+#include <asm/platform.h>
 #include <asm/system.h>
 #include <asm/time.h>
 #include <asm/vgic.h>
-#include <asm/cpufeature.h>
-#include <asm/platform.h>
 
 uint64_t __read_mostly boot_count;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 11:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 11:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196684.1514429 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdS8J-0003sE-Vf; Wed, 07 Jan 2026 11:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196684.1514429; Wed, 07 Jan 2026 11: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 1vdS8J-0003s6-T3; Wed, 07 Jan 2026 11:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1196684;
 Wed, 07 Jan 2026 11: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 1vdS8I-0003ry-5l
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 11: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 1vdS8H-00DOVa-2k
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdS8I-00COHX-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11: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=iQR+DLIzTSyvwXmaeTDuM5q5qLPEbsDl0Fm1kVWM/7E=; b=fuo+RL1wf8HDjpPwquyH2mc2Je
	ayMYbIX5v45XWoWMc4Se/Z2Bajo1b2ZjA9FHgmsbpFfq6LEknku2YU/MLV09+xaxzuVBmMLvHzvH7
	Vnah708Suqs0wocHpyFufbw4cnkWnEk+hSHd7D8OPqrOWB8RBh0kz/J6eKojPzujDZDk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: Sort headers
Message-Id: <E1vdS8I-00COHX-0M@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 11:55:22 +0000

commit fe0e477e2556eba6f915f6ca1014de6045edad08
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:40:18 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    x86/time: Sort headers
    
    ... in preparation for a logical change.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/emul-i8254.c | 12 ++++++------
 xen/arch/x86/time.c       | 42 ++++++++++++++++++++++--------------------
 2 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index 144aa168a3..c16ed0bead 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -24,19 +24,19 @@
  * IN THE SOFTWARE.
  */
 
-#include <xen/types.h>
-#include <xen/mm.h>
-#include <xen/xmalloc.h>
-#include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/trace.h>
-#include <asm/time.h>
+#include <xen/xmalloc.h>
+
+#include <asm/current.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
 #include <asm/hvm/vpt.h>
-#include <asm/current.h>
+#include <asm/time.h>
 
 #define domain_vpit(x) (&(x)->arch.vpit)
 #define vcpu_vpit(x)   (domain_vpit((x)->domain))
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ece9ae0b34..1aeb144c83 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -9,38 +9,40 @@
  * Copyright (c) 1991, 1992, 1995  Linus Torvalds
  */
 
+#include <xen/cpuidle.h>
+#include <xen/efi.h>
 #include <xen/errno.h>
 #include <xen/event.h>
-#include <xen/sched.h>
-#include <xen/lib.h>
+#include <xen/guest_access.h>
 #include <xen/init.h>
-#include <xen/param.h>
-#include <xen/time.h>
-#include <xen/timer.h>
-#include <xen/smp.h>
 #include <xen/irq.h>
+#include <xen/keyhandler.h>
+#include <xen/lib.h>
+#include <xen/param.h>
 #include <xen/pci_ids.h>
+#include <xen/sched.h>
+#include <xen/smp.h>
 #include <xen/softirq.h>
-#include <xen/efi.h>
-#include <xen/cpuidle.h>
 #include <xen/symbols.h>
-#include <xen/keyhandler.h>
-#include <xen/guest_access.h>
+#include <xen/time.h>
+#include <xen/timer.h>
+
+#include <asm/acpi.h>
 #include <asm/apic.h>
-#include <asm/io.h>
-#include <asm/iocap.h>
-#include <asm/msr.h>
-#include <asm/mpspec.h>
-#include <asm/processor.h>
+#include <asm/div64.h>
 #include <asm/fixmap.h>
 #include <asm/guest.h>
-#include <asm/mc146818rtc.h>
-#include <asm/mwait.h>
-#include <asm/div64.h>
-#include <asm/acpi.h>
 #include <asm/hpet.h>
 #include <asm/io-ports.h>
-#include <asm/setup.h> /* for early_time_init */
+#include <asm/io.h>
+#include <asm/iocap.h>
+#include <asm/mc146818rtc.h>
+#include <asm/mpspec.h>
+#include <asm/msr.h>
+#include <asm/mwait.h>
+#include <asm/processor.h>
+#include <asm/setup.h>
+
 #include <public/arch-x86/cpuid.h>
 
 /* opt_clocksource: Force clocksource to one of: pit, hpet, acpi. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 11:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 11:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196685.1514434 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdS8U-0003u7-1R; Wed, 07 Jan 2026 11:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196685.1514434; Wed, 07 Jan 2026 11:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdS8T-0003tz-UV; Wed, 07 Jan 2026 11:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1196685;
 Wed, 07 Jan 2026 11: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 1vdS8S-0003tr-AH
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 11: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 1vdS8R-00DOXd-3D
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdS8S-00COIJ-0d
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11: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=GeamsnsuEflH+Madz3RUKMlRnNsvANmXyV8BOE7gSt8=; b=otq7AuBCCO9hpKZH0lFF7fm3Z3
	W0AWxPxrbAuDr2X+vGqtneWuPoJur3kZbQBgkMYahFwkwlee1gGooaz0llHIgeWqwrACbyCcjj4Zf
	Mjp7qzKXCS5OJnVNnY2z7Tv1yE8Ktye/liinTjX5U6hCLViiF3Ggw+P+dUGusHWp+Oog=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Split muldiv64() out of lib.h
Message-Id: <E1vdS8S-00COIJ-0d@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 11:55:32 +0000

commit 7a459b8df79bff067b1f89fae0b28105ba578b28
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:41:34 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    xen: Split muldiv64() out of lib.h
    
    muldiv64() has 7 users across all architectures, and is limited to time
    handling functions.  Therefore, move it's declaration out of lib.h into a
    dedicated header.
    
    Rename the library function to generic_muldiv64(), as x86 is going to provide
    an arch_muldiv64() in a subsequent change.
    
    Explain what the function does, including the limitations; x86's version will
    suffer a divide error rather than truncate the result to 64 bits.
    
    Annotate it with attr_const, not that this allows the optimiser to improve any
    of Xen's current users.  Add one selftest to check the internal precision,
    putting it in bitops.c for want of any better place to put it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/time.c               |  2 +-
 xen/arch/riscv/include/asm/time.h |  4 ++--
 xen/arch/x86/emul-i8254.c         |  2 +-
 xen/arch/x86/time.c               |  2 +-
 xen/common/bitops.c               | 12 ++++++++++++
 xen/include/xen/lib.h             |  2 --
 xen/include/xen/muldiv64.h        | 18 ++++++++++++++++++
 xen/lib/muldiv64.c                |  5 ++---
 8 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 03dc5b51a8..cc3fcf47b6 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -16,8 +16,8 @@
 #include <xen/event.h>
 #include <xen/init.h>
 #include <xen/irq.h>
-#include <xen/lib.h>
 #include <xen/mm.h>
+#include <xen/muldiv64.h>
 #include <xen/notifier.h>
 #include <xen/sched.h>
 #include <xen/sched.h>
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index 63bdd471cc..1e7801e2ea 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -3,8 +3,8 @@
 #define ASM__RISCV__TIME_H
 
 #include <xen/bug.h>
-#include <xen/lib.h>
-#include <xen/types.h>
+#include <xen/muldiv64.h>
+
 #include <asm/csr.h>
 
 /* Clock cycles count at Xen startup */
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index c16ed0bead..ceb0ef721e 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -25,8 +25,8 @@
  */
 
 #include <xen/errno.h>
-#include <xen/lib.h>
 #include <xen/mm.h>
+#include <xen/muldiv64.h>
 #include <xen/sched.h>
 #include <xen/trace.h>
 #include <xen/xmalloc.h>
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 1aeb144c83..36d990f7f4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -17,7 +17,7 @@
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/keyhandler.h>
-#include <xen/lib.h>
+#include <xen/muldiv64.h>
 #include <xen/param.h>
 #include <xen/pci_ids.h>
 #include <xen/sched.h>
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 14e6265037..e46ea1d3ec 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -247,3 +247,15 @@ static void __init __constructor test_bitops(void)
     test_multiple_bits_set();
     test_hweight();
 }
+
+#include <xen/muldiv64.h>
+
+/* Not a bitop, but here in lieu of any any better location */
+static void __init __constructor test_muldiv64(void)
+{
+    uint64_t res = muldiv64(0xffffffffffffffffULL,
+                            HIDE(0xffffffffU),
+                            HIDE(0xffffffffU));
+    if ( res != 0xffffffffffffffffULL )
+        panic("muldiv64(), expecting -1ULL, got %#"PRIx64"\n", res);
+}
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 559e87636c..bb0fd446b4 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -136,8 +136,6 @@ unsigned long long simple_strtoull(
 
 unsigned long long parse_size_and_unit(const char *s, const char **ps);
 
-uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
-
 /*
  * A slightly more typesafe variant of cmpxchg() when the entities dealt with
  * are pointers.
diff --git a/xen/include/xen/muldiv64.h b/xen/include/xen/muldiv64.h
new file mode 100644
index 0000000000..6141f5c401
--- /dev/null
+++ b/xen/include/xen/muldiv64.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef XEN_MULDIV64_H
+#define XEN_MULDIV64_H
+
+#include <xen/stdint.h>
+
+uint64_t attr_const generic_muldiv64(uint64_t a, uint32_t b, uint32_t c);
+
+/*
+ * Calculate a * b / c using at least 96-bit internal precision.  The
+ * behaviour is undefined if the end result does not fit in a uint64_t.
+ */
+static inline uint64_t attr_const muldiv64(uint64_t a, uint32_t b, uint32_t c)
+{
+    return generic_muldiv64(a, b, c);
+}
+
+#endif /* XEN_MULDIV64_H */
diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index f281578c09..545a9bad19 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -1,7 +1,6 @@
-#include <xen/lib.h>
+#include <xen/muldiv64.h>
 
-/* Compute with 96 bit intermediate result: (a*b)/c */
-uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
+uint64_t generic_muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
 #ifdef CONFIG_X86
     asm ( "mulq %1; divq %2" : "+a" (a)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 11:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 11:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196686.1514437 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdS8e-0003x8-4I; Wed, 07 Jan 2026 11:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196686.1514437; Wed, 07 Jan 2026 11:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdS8e-0003x0-1k; Wed, 07 Jan 2026 11:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1196686;
 Wed, 07 Jan 2026 11: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 1vdS8c-0003wm-Dq
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 11: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 1vdS8c-00DOXh-0N
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdS8c-00COIo-15
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 11:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4mbL4zDf1mnqrasF6Pwq/MFc3iAb/Cz7Q7zh2Xu813Y=; b=e8AZnJEUMs911qqwdJ0It1ksMe
	jl6NB4wQ39IMzQukKfUysV4YslHRwRVSRw4yIgBP2M4HLbEzpQLqfnhbnXPPmh1EXmjSwhgIvgV1Y
	kvNIc8pkRwcbm2KcOT9x1z44WoFup2ZSN90li3uQD5WDZqpCprDCNIed1dc64xvIaOdo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Move x86-ism out of muldiv64.c
Message-Id: <E1vdS8c-00COIo-15@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 11:55:42 +0000

commit 65efa94cf547fa9d1d2bcf2f6c01ce3c9a69aa86
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 23 23:47:43 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    xen: Move x86-ism out of muldiv64.c
    
    Having an #ifdef CONFIG_X86 section in a common library is rude.
    
    Furthermore, for x86 the main logic is 6 bytes, meaning it's ripe for
    inlining.  Create an x86-specific asm/muldiv.h implementing arch_muldiv64().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/muldiv64.h | 20 ++++++++++++++++++++
 xen/include/xen/muldiv64.h          |  8 ++++++++
 xen/lib/muldiv64.c                  |  8 --------
 3 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/muldiv64.h b/xen/arch/x86/include/asm/muldiv64.h
new file mode 100644
index 0000000000..07449292ff
--- /dev/null
+++ b/xen/arch/x86/include/asm/muldiv64.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef X86_MULDIV64_H
+#define X86_MULDIV64_H
+
+#include <xen/stdint.h>
+
+static inline uint64_t attr_const arch_muldiv64(uint64_t a, uint32_t b, uint32_t c)
+{
+    asm_inline (
+        "mulq %[b]\n\t"
+        "divq %[c]"
+        : "+a" (a)
+        : [b] "rm" ((uint64_t)b), [c] "rm" ((uint64_t)c)
+        : "rdx" );
+
+    return a;
+}
+#define arch_muldiv64 arch_muldiv64
+
+#endif /* X86_MULDIV64_H */
diff --git a/xen/include/xen/muldiv64.h b/xen/include/xen/muldiv64.h
index 6141f5c401..8243b97279 100644
--- a/xen/include/xen/muldiv64.h
+++ b/xen/include/xen/muldiv64.h
@@ -4,6 +4,10 @@
 
 #include <xen/stdint.h>
 
+#if __has_include(<asm/muldiv64.h>)
+# include <asm/muldiv64.h>
+#endif
+
 uint64_t attr_const generic_muldiv64(uint64_t a, uint32_t b, uint32_t c);
 
 /*
@@ -12,7 +16,11 @@ uint64_t attr_const generic_muldiv64(uint64_t a, uint32_t b, uint32_t c);
  */
 static inline uint64_t attr_const muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
+#ifdef arch_muldiv64
+    return arch_muldiv64(a, b, c);
+#else
     return generic_muldiv64(a, b, c);
+#endif
 }
 
 #endif /* XEN_MULDIV64_H */
diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index 545a9bad19..53847a6ed4 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -2,13 +2,6 @@
 
 uint64_t generic_muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
-#ifdef CONFIG_X86
-    asm ( "mulq %1; divq %2" : "+a" (a)
-                             : "rm" ((uint64_t)b), "rm" ((uint64_t)c)
-                             : "rdx" );
-
-    return a;
-#else
     union {
         uint64_t ll;
         struct {
@@ -31,7 +24,6 @@ uint64_t generic_muldiv64(uint64_t a, uint32_t b, uint32_t c)
     res.l.low = (((rh % c) << 32) + (uint32_t)rl) / c;
 
     return res.ll;
-#endif
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 14:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 14:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196720.1514452 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdUFb-000399-GT; Wed, 07 Jan 2026 14:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196720.1514452; Wed, 07 Jan 2026 14:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdUFb-000390-DV; Wed, 07 Jan 2026 14:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1196720;
 Wed, 07 Jan 2026 14:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdUFa-00038u-CM
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 14:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdUFZ-00DR54-3A
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 14:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdUFa-00CWAh-0Z
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 14:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WtDwAVqsUVdcE8VdOKk9AIKQjDmLBywz72NkETDFJlg=; b=Y2jXyoH45IHfrlhUXhavB6w+RU
	baHFgQ32M0+KDmhg84oA52FO2CAQcKUYQtKoiXmpNY1G86ODMWHZIzvbfslbccCxAIF48VqHX0+Ic
	nSk1ZLqP4lLWMtvUa3SXJD2cg3JvnWNaObvsF9qr3qp9KL7A9OYvM93ytdUVJRVEHKsQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/AMD: avoid REP MOVSB for Zen3/4
Message-Id: <E1vdUFa-00CWAh-0Z@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 14:11:02 +0000

commit cb3ae9445ab07261188f1d4a54ca5741bc962cf2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 11:56:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 7 14:45:27 2026 +0100

    x86/AMD: avoid REP MOVSB for Zen3/4
    
    Zen2 (which doesn't expose ERMS) through Zen4 have sub-optimal aliasing
    detection for REP MOVS, and fall back to a unit-at-a-time loop when the
    two pointers have differing bottom 5 bits.  While both forms are
    affected, this makes REP MOVSB 8 times slower than REP MOVSQ.
    
    memcpy() has a high likelihood of encountering this slowpath, so avoid
    using REP MOVSB.  This undoes the ERMS optimisation added in commit
    d6397bd0e11c which turns out to be an anti-optimisation on these
    microarchitectures.
    
    However, retain the use of ERMS-based REP MOVSB in other cases such as
    copy_page_hot() where there parameter alignment is known to avoid the
    slowpath.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/amd.c                 | 4 ++++
 xen/arch/x86/cpu/intel.c               | 3 +++
 xen/arch/x86/include/asm/cpufeatures.h | 3 ++-
 xen/arch/x86/lib/memcpy.S              | 2 +-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 47c109f898..928d6bd168 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1269,6 +1269,10 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	check_syscfg_dram_mod_en();
 
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS)
+	    && c->family != 0x19 /* Zen3/4 */)
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
+
 	amd_log_freq(c);
 }
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 6f71365b7e..863edac4cd 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -684,6 +684,9 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	 */
 	if (c == &boot_cpu_data && c->vfm == INTEL_SKYLAKE_X)
 		setup_clear_cpu_cap(X86_FEATURE_CLWB);
+
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS))
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
 }
 
 const struct cpu_dev __initconst_cf_clobber intel_cpu_dev = {
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 0a98676c16..65534863c7 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -7,7 +7,7 @@
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
 /* Synthetic words follow the featureset words. */
-#define X86_NR_SYNTH 1
+#define X86_NR_SYNTH 2
 #define X86_SYNTH(x) (FSCAPINTS * 32 + (x))
 
 /* Synthetic features */
@@ -43,6 +43,7 @@ XEN_CPUFEATURE(IBPB_ENTRY_PV,     X86_SYNTH(28)) /* MSR_PRED_CMD used by Xen for
 XEN_CPUFEATURE(IBPB_ENTRY_HVM,    X86_SYNTH(29)) /* MSR_PRED_CMD used by Xen for HVM */
 XEN_CPUFEATURE(USE_VMCALL,        X86_SYNTH(30)) /* Use VMCALL instead of VMMCALL */
 XEN_CPUFEATURE(PDX_COMPRESSION,   X86_SYNTH(31)) /* PDX compression */
+XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy() */
 
 /* Bug words follow the synthetic words. */
 #define X86_NR_BUG 1
diff --git a/xen/arch/x86/lib/memcpy.S b/xen/arch/x86/lib/memcpy.S
index aaee012126..eefbb8c9ee 100644
--- a/xen/arch/x86/lib/memcpy.S
+++ b/xen/arch/x86/lib/memcpy.S
@@ -10,7 +10,7 @@ FUNC(memcpy)
          * precautions were taken).
          */
         ALTERNATIVE "and $7, %edx; shr $3, %rcx", \
-                    STR(rep movsb; RET), X86_FEATURE_ERMS
+                    STR(rep movsb; RET), X86_FEATURE_XEN_REP_MOVSB
         rep movsq
         or      %edx, %ecx
         jz      1f
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 14:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 14:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196721.1514457 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdUFl-0003BC-I4; Wed, 07 Jan 2026 14:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196721.1514457; Wed, 07 Jan 2026 14:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdUFl-0003B0-Eo; Wed, 07 Jan 2026 14:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1196721;
 Wed, 07 Jan 2026 14:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdUFk-0003An-Cs
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 14:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdUFk-00DR5B-0D
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 14:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdUFk-00CWCV-12
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 14:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Bw9dDn8noTni0g3ePIhCs+JiMlaQQEdQ6DXgp6HY0co=; b=2DAId8GAKF4jiYbUax4ixJICJQ
	OUoxirkPl/rLOYx+znj71jwKwQ7lXIJw2SrHQjy8jbnua7i/ifdgMqNWyjSbuE+GF6tomEYQt2AOq
	ElVpOv45VfRe9ojnAwbSXU3t4XnnnOoiBMO+9azmO3F8fjv22hRrje2yXGW1s5iWDw10=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu-policy: enable build of fuzzing harness by default
Message-Id: <E1vdUFk-00CWCV-12@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 14:11:12 +0000

commit 62412a235b577e095ce0277e60960f5a7f13a57c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 11:59:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 7 14:45:27 2026 +0100

    x86/cpu-policy: enable build of fuzzing harness by default
    
    ... on x86, to make sure its bit-rotting can be limited at least a little.
    
    Since on Ubuntu fread()'s return value needs evaluating, adjust the code
    there to also skip the test when there's no data at all.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/Makefile                       | 2 ++
 tools/fuzz/cpu-policy/afl-policy-fuzzer.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/fuzz/Makefile b/tools/fuzz/Makefile
index 85213dc895..eb70b24624 100644
--- a/tools/fuzz/Makefile
+++ b/tools/fuzz/Makefile
@@ -5,5 +5,7 @@ SUBDIRS-y :=
 SUBDIRS-y += libelf
 SUBDIRS-y += x86_instruction_emulator
 
+SUBDIRS-$(CONFIG_X86_64) += cpu-policy
+
 .PHONY: all clean distclean install uninstall
 all clean distclean install uninstall: %: subdirs-%
diff --git a/tools/fuzz/cpu-policy/afl-policy-fuzzer.c b/tools/fuzz/cpu-policy/afl-policy-fuzzer.c
index 7d8467b4b2..b890308fb8 100644
--- a/tools/fuzz/cpu-policy/afl-policy-fuzzer.c
+++ b/tools/fuzz/cpu-policy/afl-policy-fuzzer.c
@@ -133,6 +133,7 @@ int main(int argc, char **argv)
 #endif
     {
         struct cpu_policy *cp = NULL;
+        size_t size;
 
         if ( fp != stdin )
         {
@@ -150,9 +151,9 @@ int main(int argc, char **argv)
         if ( !cp )
             goto skip;
 
-        fread(cp, sizeof(*cp), 1, fp);
+        size = fread(cp, sizeof(*cp), 1, fp);
 
-        if ( !feof(fp) )
+        if ( !size || !feof(fp) )
             goto skip;
 
         check_policy(cp);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 15:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 15:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196801.1514519 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMJ-0006Do-LH; Wed, 07 Jan 2026 15:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196801.1514519; Wed, 07 Jan 2026 15:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMJ-0006Dg-IP; Wed, 07 Jan 2026 15:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1196801;
 Wed, 07 Jan 2026 15: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 1vdVMI-0006DO-Ab
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 15: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 1vdVMH-00DSNp-32
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVMI-00Caca-0T
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15: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=yf/H5wzXcA+A76mxdHPaTAJcNW7sMdnVx0JfIiCtN+I=; b=LYCf6le0Q1ZbQjg95SGc+coGiB
	Q8XrZg5AFJmTzvACGfCsYKB4NjnRPog9pbnhlbkgK3ZMz+PfgzCveGbLNzdNH4dTP5+6bY/wFLuPL
	cnQslHckD+k64S7Pc+3p755Xpk5wFDoUtgptuHWRgcHHkp78AmNUBDwWokoSnc20aoWM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Fix endian handling in muldiv64.c
Message-Id: <E1vdVMI-00Caca-0T@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 15:22:02 +0000

commit b56a894e99098b71d9e41781cd3a283e097b0942
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:39:03 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    xen: Fix endian handling in muldiv64.c
    
    WORDS_BIGENDIAN is a QEMU-ism.  In the very dim and distant past, we had a
    fork of QEMU living in xen.git which wired WORDS_BIGENDIAN in the userspace
    part of the build, but nothing ever wired it up in the hypervisor build.
    
    Fixes: 86d5da49a6f7 ("[HVM] Support multiple HVM time device models coming soon.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/lib/muldiv64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index 79411f5d59..f281578c09 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -13,10 +13,12 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
     union {
         uint64_t ll;
         struct {
-#ifdef WORDS_BIGENDIAN
+#if defined(__BIG_ENDIAN)
             uint32_t high, low;
-#else
+#elif defined(__LITTLE_ENDIAN)
             uint32_t low, high;
+#else
+# error Unknown Endianness
 #endif
         } l;
     } u, res;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 15:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 15:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196803.1514523 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMT-0006JX-Ml; Wed, 07 Jan 2026 15:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196803.1514523; Wed, 07 Jan 2026 15:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMT-0006JP-Jo; Wed, 07 Jan 2026 15:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1196803;
 Wed, 07 Jan 2026 15:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdVMS-0006J5-Bq
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 15: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 1vdVMS-00DSNx-09
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVMS-00CadO-0u
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15: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=LmPbf1cTK9/yfrWUXfQ3ylARPL0NYSpsy7LYYeq8bVo=; b=JtzKvP76tzykvolicwCajiKORu
	e+qEUikXFu7Jp0liF25y3aspmyrF5uPV3L6E5fdr+98ulK6ZoQlL3MCB1YK/GnuKd6GxBI1Nd4XdN
	24Ev6otigLmxxBmUghsltf5Z2QQl3zZ1hAJ+wIkOPPUCBfb5GzK+pMEiQVOZHm8UiW8A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/time: Sort headers
Message-Id: <E1vdVMS-00CadO-0u@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 15:22:12 +0000

commit 1ae6c79de10a510fe989eea32a5e813c99bbeeaa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:40:12 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    arm/time: Sort headers
    
    ... in preparation for a logical change.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/time.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 3710eab109..03dc5b51a8 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -8,26 +8,27 @@
  * Copyright (c) 2011 Citrix Systems.
  */
 
+#include <xen/acpi.h>
 #include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/device_tree.h>
+#include <xen/event.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#include <xen/softirq.h>
+#include <xen/notifier.h>
 #include <xen/sched.h>
-#include <xen/time.h>
-#include <xen/delay.h>
 #include <xen/sched.h>
-#include <xen/event.h>
-#include <xen/acpi.h>
-#include <xen/cpu.h>
-#include <xen/notifier.h>
+#include <xen/softirq.h>
+#include <xen/time.h>
+
+#include <asm/cpufeature.h>
+#include <asm/platform.h>
 #include <asm/system.h>
 #include <asm/time.h>
 #include <asm/vgic.h>
-#include <asm/cpufeature.h>
-#include <asm/platform.h>
 
 uint64_t __read_mostly boot_count;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 15:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 15:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196804.1514527 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMd-0006MN-Ny; Wed, 07 Jan 2026 15:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196804.1514527; Wed, 07 Jan 2026 15:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMd-0006MF-LL; Wed, 07 Jan 2026 15:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1196804;
 Wed, 07 Jan 2026 15:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdVMc-0006M9-FP
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 15:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVMc-00DSO3-0W
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVMc-00Cadm-1F
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SIVA0/6+zEl9fLGIt6JQqVC7TdyMRxRor4trJKpDxCc=; b=vJ74mzwBmHk5jcTWlrz4bT/MHP
	L7/OJWzd59yyQYztyg3JopzNrInwMXat2cjMi/OTi2Qf+luV9zphiO5PnwaFwBmAIUgdXaDcHeGqg
	Uh2SW7k+QU5Oe9AtSxO3pGgBbM25kRf0rwSDGn52p8UhGT5qpA8yR0zsyMsJpJ9/GJDs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: Sort headers
Message-Id: <E1vdVMc-00Cadm-1F@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 15:22:22 +0000

commit fe0e477e2556eba6f915f6ca1014de6045edad08
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:40:18 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    x86/time: Sort headers
    
    ... in preparation for a logical change.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/emul-i8254.c | 12 ++++++------
 xen/arch/x86/time.c       | 42 ++++++++++++++++++++++--------------------
 2 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index 144aa168a3..c16ed0bead 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -24,19 +24,19 @@
  * IN THE SOFTWARE.
  */
 
-#include <xen/types.h>
-#include <xen/mm.h>
-#include <xen/xmalloc.h>
-#include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/lib.h>
+#include <xen/mm.h>
 #include <xen/sched.h>
 #include <xen/trace.h>
-#include <asm/time.h>
+#include <xen/xmalloc.h>
+
+#include <asm/current.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
 #include <asm/hvm/vpt.h>
-#include <asm/current.h>
+#include <asm/time.h>
 
 #define domain_vpit(x) (&(x)->arch.vpit)
 #define vcpu_vpit(x)   (domain_vpit((x)->domain))
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ece9ae0b34..1aeb144c83 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -9,38 +9,40 @@
  * Copyright (c) 1991, 1992, 1995  Linus Torvalds
  */
 
+#include <xen/cpuidle.h>
+#include <xen/efi.h>
 #include <xen/errno.h>
 #include <xen/event.h>
-#include <xen/sched.h>
-#include <xen/lib.h>
+#include <xen/guest_access.h>
 #include <xen/init.h>
-#include <xen/param.h>
-#include <xen/time.h>
-#include <xen/timer.h>
-#include <xen/smp.h>
 #include <xen/irq.h>
+#include <xen/keyhandler.h>
+#include <xen/lib.h>
+#include <xen/param.h>
 #include <xen/pci_ids.h>
+#include <xen/sched.h>
+#include <xen/smp.h>
 #include <xen/softirq.h>
-#include <xen/efi.h>
-#include <xen/cpuidle.h>
 #include <xen/symbols.h>
-#include <xen/keyhandler.h>
-#include <xen/guest_access.h>
+#include <xen/time.h>
+#include <xen/timer.h>
+
+#include <asm/acpi.h>
 #include <asm/apic.h>
-#include <asm/io.h>
-#include <asm/iocap.h>
-#include <asm/msr.h>
-#include <asm/mpspec.h>
-#include <asm/processor.h>
+#include <asm/div64.h>
 #include <asm/fixmap.h>
 #include <asm/guest.h>
-#include <asm/mc146818rtc.h>
-#include <asm/mwait.h>
-#include <asm/div64.h>
-#include <asm/acpi.h>
 #include <asm/hpet.h>
 #include <asm/io-ports.h>
-#include <asm/setup.h> /* for early_time_init */
+#include <asm/io.h>
+#include <asm/iocap.h>
+#include <asm/mc146818rtc.h>
+#include <asm/mpspec.h>
+#include <asm/msr.h>
+#include <asm/mwait.h>
+#include <asm/processor.h>
+#include <asm/setup.h>
+
 #include <public/arch-x86/cpuid.h>
 
 /* opt_clocksource: Force clocksource to one of: pit, hpet, acpi. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 15:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 15:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196806.1514531 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMn-0006RK-Pl; Wed, 07 Jan 2026 15:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196806.1514531; Wed, 07 Jan 2026 15: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 1vdVMn-0006RD-Mh; Wed, 07 Jan 2026 15:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1196806;
 Wed, 07 Jan 2026 15: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 1vdVMm-0006R0-Kn
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 15: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 1vdVMm-00DSO7-0s
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVMm-00Cae8-1e
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15: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=+EGROMi69T8VetM0Y2KtsE+qTy2bVFKo6TrCGf0SaOM=; b=qgisXwNMAgtaFUzBuu9C02YTAl
	WfckW1KNRS4tDcVl1NuFZdOyJMBA9KcVNXZiQh/5u7VQqPnhrPeUXqc07ZubHTve4czVkXnbEWazK
	DLY0UYvI64WU1O5RT2r2QyKs+Sy/BWCjbBzGKQ2uoLaKK6V327KoO3nX8MFm46BEbUyo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Split muldiv64() out of lib.h
Message-Id: <E1vdVMm-00Cae8-1e@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 15:22:32 +0000

commit 7a459b8df79bff067b1f89fae0b28105ba578b28
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 29 11:41:34 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    xen: Split muldiv64() out of lib.h
    
    muldiv64() has 7 users across all architectures, and is limited to time
    handling functions.  Therefore, move it's declaration out of lib.h into a
    dedicated header.
    
    Rename the library function to generic_muldiv64(), as x86 is going to provide
    an arch_muldiv64() in a subsequent change.
    
    Explain what the function does, including the limitations; x86's version will
    suffer a divide error rather than truncate the result to 64 bits.
    
    Annotate it with attr_const, not that this allows the optimiser to improve any
    of Xen's current users.  Add one selftest to check the internal precision,
    putting it in bitops.c for want of any better place to put it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/time.c               |  2 +-
 xen/arch/riscv/include/asm/time.h |  4 ++--
 xen/arch/x86/emul-i8254.c         |  2 +-
 xen/arch/x86/time.c               |  2 +-
 xen/common/bitops.c               | 12 ++++++++++++
 xen/include/xen/lib.h             |  2 --
 xen/include/xen/muldiv64.h        | 18 ++++++++++++++++++
 xen/lib/muldiv64.c                |  5 ++---
 8 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 03dc5b51a8..cc3fcf47b6 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -16,8 +16,8 @@
 #include <xen/event.h>
 #include <xen/init.h>
 #include <xen/irq.h>
-#include <xen/lib.h>
 #include <xen/mm.h>
+#include <xen/muldiv64.h>
 #include <xen/notifier.h>
 #include <xen/sched.h>
 #include <xen/sched.h>
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index 63bdd471cc..1e7801e2ea 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -3,8 +3,8 @@
 #define ASM__RISCV__TIME_H
 
 #include <xen/bug.h>
-#include <xen/lib.h>
-#include <xen/types.h>
+#include <xen/muldiv64.h>
+
 #include <asm/csr.h>
 
 /* Clock cycles count at Xen startup */
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index c16ed0bead..ceb0ef721e 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -25,8 +25,8 @@
  */
 
 #include <xen/errno.h>
-#include <xen/lib.h>
 #include <xen/mm.h>
+#include <xen/muldiv64.h>
 #include <xen/sched.h>
 #include <xen/trace.h>
 #include <xen/xmalloc.h>
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 1aeb144c83..36d990f7f4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -17,7 +17,7 @@
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/keyhandler.h>
-#include <xen/lib.h>
+#include <xen/muldiv64.h>
 #include <xen/param.h>
 #include <xen/pci_ids.h>
 #include <xen/sched.h>
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 14e6265037..e46ea1d3ec 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -247,3 +247,15 @@ static void __init __constructor test_bitops(void)
     test_multiple_bits_set();
     test_hweight();
 }
+
+#include <xen/muldiv64.h>
+
+/* Not a bitop, but here in lieu of any any better location */
+static void __init __constructor test_muldiv64(void)
+{
+    uint64_t res = muldiv64(0xffffffffffffffffULL,
+                            HIDE(0xffffffffU),
+                            HIDE(0xffffffffU));
+    if ( res != 0xffffffffffffffffULL )
+        panic("muldiv64(), expecting -1ULL, got %#"PRIx64"\n", res);
+}
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 559e87636c..bb0fd446b4 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -136,8 +136,6 @@ unsigned long long simple_strtoull(
 
 unsigned long long parse_size_and_unit(const char *s, const char **ps);
 
-uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
-
 /*
  * A slightly more typesafe variant of cmpxchg() when the entities dealt with
  * are pointers.
diff --git a/xen/include/xen/muldiv64.h b/xen/include/xen/muldiv64.h
new file mode 100644
index 0000000000..6141f5c401
--- /dev/null
+++ b/xen/include/xen/muldiv64.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef XEN_MULDIV64_H
+#define XEN_MULDIV64_H
+
+#include <xen/stdint.h>
+
+uint64_t attr_const generic_muldiv64(uint64_t a, uint32_t b, uint32_t c);
+
+/*
+ * Calculate a * b / c using at least 96-bit internal precision.  The
+ * behaviour is undefined if the end result does not fit in a uint64_t.
+ */
+static inline uint64_t attr_const muldiv64(uint64_t a, uint32_t b, uint32_t c)
+{
+    return generic_muldiv64(a, b, c);
+}
+
+#endif /* XEN_MULDIV64_H */
diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index f281578c09..545a9bad19 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -1,7 +1,6 @@
-#include <xen/lib.h>
+#include <xen/muldiv64.h>
 
-/* Compute with 96 bit intermediate result: (a*b)/c */
-uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
+uint64_t generic_muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
 #ifdef CONFIG_X86
     asm ( "mulq %1; divq %2" : "+a" (a)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 15:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 15:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196808.1514536 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVMx-0006U5-Rk; Wed, 07 Jan 2026 15:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196808.1514536; Wed, 07 Jan 2026 15: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 1vdVMx-0006Tx-OC; Wed, 07 Jan 2026 15:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1196808;
 Wed, 07 Jan 2026 15: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 1vdVMw-0006Tn-MD
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 15: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 1vdVMw-00DSOB-1C
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVMw-00CaeW-1y
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15: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=EqzMSebFNw1r5JhFzpOwNa/DiyQ+jXl/bNtAlmMHvG4=; b=S4IWds7WnrqM3aOKvyavczQaKd
	2HKPzeSUlTf+Y12Lx/Ne+rYHUqAmBlI7gTJdsDG4HIoglKNhnCUTpRkABi2cWxgyL3DR8a6hQnTr8
	j0JNy8ACTPjLKw8wH8IzoPHQRO96f6TBWZxSUKdpj/AUHiPcvElyjsU2W6MsYT43oaRg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Move x86-ism out of muldiv64.c
Message-Id: <E1vdVMw-00CaeW-1y@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 15:22:42 +0000

commit 65efa94cf547fa9d1d2bcf2f6c01ce3c9a69aa86
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 23 23:47:43 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 7 11:53:01 2026 +0000

    xen: Move x86-ism out of muldiv64.c
    
    Having an #ifdef CONFIG_X86 section in a common library is rude.
    
    Furthermore, for x86 the main logic is 6 bytes, meaning it's ripe for
    inlining.  Create an x86-specific asm/muldiv.h implementing arch_muldiv64().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/muldiv64.h | 20 ++++++++++++++++++++
 xen/include/xen/muldiv64.h          |  8 ++++++++
 xen/lib/muldiv64.c                  |  8 --------
 3 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/muldiv64.h b/xen/arch/x86/include/asm/muldiv64.h
new file mode 100644
index 0000000000..07449292ff
--- /dev/null
+++ b/xen/arch/x86/include/asm/muldiv64.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef X86_MULDIV64_H
+#define X86_MULDIV64_H
+
+#include <xen/stdint.h>
+
+static inline uint64_t attr_const arch_muldiv64(uint64_t a, uint32_t b, uint32_t c)
+{
+    asm_inline (
+        "mulq %[b]\n\t"
+        "divq %[c]"
+        : "+a" (a)
+        : [b] "rm" ((uint64_t)b), [c] "rm" ((uint64_t)c)
+        : "rdx" );
+
+    return a;
+}
+#define arch_muldiv64 arch_muldiv64
+
+#endif /* X86_MULDIV64_H */
diff --git a/xen/include/xen/muldiv64.h b/xen/include/xen/muldiv64.h
index 6141f5c401..8243b97279 100644
--- a/xen/include/xen/muldiv64.h
+++ b/xen/include/xen/muldiv64.h
@@ -4,6 +4,10 @@
 
 #include <xen/stdint.h>
 
+#if __has_include(<asm/muldiv64.h>)
+# include <asm/muldiv64.h>
+#endif
+
 uint64_t attr_const generic_muldiv64(uint64_t a, uint32_t b, uint32_t c);
 
 /*
@@ -12,7 +16,11 @@ uint64_t attr_const generic_muldiv64(uint64_t a, uint32_t b, uint32_t c);
  */
 static inline uint64_t attr_const muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
+#ifdef arch_muldiv64
+    return arch_muldiv64(a, b, c);
+#else
     return generic_muldiv64(a, b, c);
+#endif
 }
 
 #endif /* XEN_MULDIV64_H */
diff --git a/xen/lib/muldiv64.c b/xen/lib/muldiv64.c
index 545a9bad19..53847a6ed4 100644
--- a/xen/lib/muldiv64.c
+++ b/xen/lib/muldiv64.c
@@ -2,13 +2,6 @@
 
 uint64_t generic_muldiv64(uint64_t a, uint32_t b, uint32_t c)
 {
-#ifdef CONFIG_X86
-    asm ( "mulq %1; divq %2" : "+a" (a)
-                             : "rm" ((uint64_t)b), "rm" ((uint64_t)c)
-                             : "rdx" );
-
-    return a;
-#else
     union {
         uint64_t ll;
         struct {
@@ -31,7 +24,6 @@ uint64_t generic_muldiv64(uint64_t a, uint32_t b, uint32_t c)
     res.l.low = (((rh % c) << 32) + (uint32_t)rl) / c;
 
     return res.ll;
-#endif
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 15:22:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 15:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196810.1514539 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVN7-0006XF-TH; Wed, 07 Jan 2026 15:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196810.1514539; Wed, 07 Jan 2026 15: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 1vdVN7-0006X7-Qn; Wed, 07 Jan 2026 15:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1196810;
 Wed, 07 Jan 2026 15: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 1vdVN6-0006Wu-PK
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 15: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 1vdVN6-00DSOd-1T
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVN6-00Caet-2I
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15: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=st/Xee+yaQlp9N5lFL8uqTIp4oc258O29bby21CDRBs=; b=MVHG13XMtN7MmyviL/kWZ5z2PG
	+Z8iD4U/Qx7VD1WxO5NRSjDSyPNPTP6QvvcOfm+foS2NPucBDqONKE/B8lTwMCL3iGVwpCeVrbwDL
	s7Wqd9FxIY03ENRdZBV+cMRn0uLf2DUN1TB2k3cPbof9I7UEi7YpcTMis/8DghHOkmu4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/AMD: avoid REP MOVSB for Zen3/4
Message-Id: <E1vdVN6-00Caet-2I@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 15:22:52 +0000

commit cb3ae9445ab07261188f1d4a54ca5741bc962cf2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 11:56:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 7 14:45:27 2026 +0100

    x86/AMD: avoid REP MOVSB for Zen3/4
    
    Zen2 (which doesn't expose ERMS) through Zen4 have sub-optimal aliasing
    detection for REP MOVS, and fall back to a unit-at-a-time loop when the
    two pointers have differing bottom 5 bits.  While both forms are
    affected, this makes REP MOVSB 8 times slower than REP MOVSQ.
    
    memcpy() has a high likelihood of encountering this slowpath, so avoid
    using REP MOVSB.  This undoes the ERMS optimisation added in commit
    d6397bd0e11c which turns out to be an anti-optimisation on these
    microarchitectures.
    
    However, retain the use of ERMS-based REP MOVSB in other cases such as
    copy_page_hot() where there parameter alignment is known to avoid the
    slowpath.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/amd.c                 | 4 ++++
 xen/arch/x86/cpu/intel.c               | 3 +++
 xen/arch/x86/include/asm/cpufeatures.h | 3 ++-
 xen/arch/x86/lib/memcpy.S              | 2 +-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 47c109f898..928d6bd168 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1269,6 +1269,10 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	check_syscfg_dram_mod_en();
 
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS)
+	    && c->family != 0x19 /* Zen3/4 */)
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
+
 	amd_log_freq(c);
 }
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 6f71365b7e..863edac4cd 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -684,6 +684,9 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	 */
 	if (c == &boot_cpu_data && c->vfm == INTEL_SKYLAKE_X)
 		setup_clear_cpu_cap(X86_FEATURE_CLWB);
+
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS))
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
 }
 
 const struct cpu_dev __initconst_cf_clobber intel_cpu_dev = {
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 0a98676c16..65534863c7 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -7,7 +7,7 @@
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
 /* Synthetic words follow the featureset words. */
-#define X86_NR_SYNTH 1
+#define X86_NR_SYNTH 2
 #define X86_SYNTH(x) (FSCAPINTS * 32 + (x))
 
 /* Synthetic features */
@@ -43,6 +43,7 @@ XEN_CPUFEATURE(IBPB_ENTRY_PV,     X86_SYNTH(28)) /* MSR_PRED_CMD used by Xen for
 XEN_CPUFEATURE(IBPB_ENTRY_HVM,    X86_SYNTH(29)) /* MSR_PRED_CMD used by Xen for HVM */
 XEN_CPUFEATURE(USE_VMCALL,        X86_SYNTH(30)) /* Use VMCALL instead of VMMCALL */
 XEN_CPUFEATURE(PDX_COMPRESSION,   X86_SYNTH(31)) /* PDX compression */
+XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy() */
 
 /* Bug words follow the synthetic words. */
 #define X86_NR_BUG 1
diff --git a/xen/arch/x86/lib/memcpy.S b/xen/arch/x86/lib/memcpy.S
index aaee012126..eefbb8c9ee 100644
--- a/xen/arch/x86/lib/memcpy.S
+++ b/xen/arch/x86/lib/memcpy.S
@@ -10,7 +10,7 @@ FUNC(memcpy)
          * precautions were taken).
          */
         ALTERNATIVE "and $7, %edx; shr $3, %rcx", \
-                    STR(rep movsb; RET), X86_FEATURE_ERMS
+                    STR(rep movsb; RET), X86_FEATURE_XEN_REP_MOVSB
         rep movsq
         or      %edx, %ecx
         jz      1f
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 15:23:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 15:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1196812.1514543 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdVNH-0006Zw-Uj; Wed, 07 Jan 2026 15:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1196812.1514543; Wed, 07 Jan 2026 15: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 1vdVNH-0006Zo-S7; Wed, 07 Jan 2026 15:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1196812;
 Wed, 07 Jan 2026 15: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 1vdVNG-0006Za-SH
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 15: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 1vdVNG-00DSOv-1m
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdVNG-00Cafg-2Z
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 15: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=/ZZLNeaKQg9AGXpNTfBCi5mFbfFLxDkwwwZOLEiMWMs=; b=YM6D54emSVoYadV/pz9GIECIa1
	7XBGWChQOYPolcFioR4Ntqi8EVB7iUgeOLb/1S5RElzuvBQrDX1LJqJTotMSj3KM49oBJ6rby1P+V
	brkMyEdxq+7Pu6ym4DrGtAM9bGFu3kJcyPufqYIEXU57T80phgNTDSZbKlkAT75FLBfE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu-policy: enable build of fuzzing harness by default
Message-Id: <E1vdVNG-00Cafg-2Z@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 15:23:02 +0000

commit 62412a235b577e095ce0277e60960f5a7f13a57c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 11:59:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 7 14:45:27 2026 +0100

    x86/cpu-policy: enable build of fuzzing harness by default
    
    ... on x86, to make sure its bit-rotting can be limited at least a little.
    
    Since on Ubuntu fread()'s return value needs evaluating, adjust the code
    there to also skip the test when there's no data at all.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/Makefile                       | 2 ++
 tools/fuzz/cpu-policy/afl-policy-fuzzer.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/fuzz/Makefile b/tools/fuzz/Makefile
index 85213dc895..eb70b24624 100644
--- a/tools/fuzz/Makefile
+++ b/tools/fuzz/Makefile
@@ -5,5 +5,7 @@ SUBDIRS-y :=
 SUBDIRS-y += libelf
 SUBDIRS-y += x86_instruction_emulator
 
+SUBDIRS-$(CONFIG_X86_64) += cpu-policy
+
 .PHONY: all clean distclean install uninstall
 all clean distclean install uninstall: %: subdirs-%
diff --git a/tools/fuzz/cpu-policy/afl-policy-fuzzer.c b/tools/fuzz/cpu-policy/afl-policy-fuzzer.c
index 7d8467b4b2..b890308fb8 100644
--- a/tools/fuzz/cpu-policy/afl-policy-fuzzer.c
+++ b/tools/fuzz/cpu-policy/afl-policy-fuzzer.c
@@ -133,6 +133,7 @@ int main(int argc, char **argv)
 #endif
     {
         struct cpu_policy *cp = NULL;
+        size_t size;
 
         if ( fp != stdin )
         {
@@ -150,9 +151,9 @@ int main(int argc, char **argv)
         if ( !cp )
             goto skip;
 
-        fread(cp, sizeof(*cp), 1, fp);
+        size = fread(cp, sizeof(*cp), 1, fp);
 
-        if ( !feof(fp) )
+        if ( !size || !feof(fp) )
             goto skip;
 
         check_policy(cp);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 20:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 20:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197219.1514816 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdZry-0005Ka-UP; Wed, 07 Jan 2026 20:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197219.1514816; Wed, 07 Jan 2026 20: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 1vdZry-0005KS-Rt; Wed, 07 Jan 2026 20:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1197219;
 Wed, 07 Jan 2026 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 1vdZrx-0005KM-QH
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 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 1vdZrx-00DYQo-1S
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 20:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdZrx-00Czk1-2D
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 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=o0n7d8Jb8Tlf5c5A9tDr0goNB+Fccvp1D+V2t31rZ04=; b=10InFDuawDPQyoAJk3aTB68Qvz
	8/hHTNSds+jy9DtiD9h6qnv6IgbLnL623gbtAtGZxwIFq+nnMU1V0OtFmkUAG9rOMeZp1+ZZCaIqF
	fmiRxiEETDyVC6oQYW9LMjbtL8rdO6e4AKfw7GbGrMkga9dk+XC+6JfGA4aNp96Hth3k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mm: reject XENMEM_claim_pages when using LLC coloring
Message-Id: <E1vdZrx-00Czk1-2D@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 20:11:01 +0000

commit b068cafc737d51c76b40d3f9f821017bfa15814c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Dec 24 10:05:17 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Jan 7 15:54:33 2026 +0100

    xen/mm: reject XENMEM_claim_pages when using LLC coloring
    
    The coloring allocator ignores claims; reject the usage of the hypercall if
    LLC coloring is enabled.  Note that the usage of alloc_color_heap_page() is
    selected at boot time, and it's a system wide decision.  Once enabled all
    domains will use alloc_color_heap_page() for allocations, which ignores any
    outstanding claims.
    
    The hypercall can be enabled if/when LLC coloring is adjusted to support
    claims.
    
    Fixes: 95debe51a936 ("xen: add cache coloring allocator for domains")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index ae805ccbe4..10becf7c1f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -16,6 +16,7 @@
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
+#include <xen/llc-coloring.h>
 #include <xen/mem_access.h>
 #include <xen/mm.h>
 #include <xen/numa.h>
@@ -1660,6 +1661,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case XENMEM_claim_pages:
+        if ( llc_coloring_enabled )
+            return -EOPNOTSUPP;
+
         if ( unlikely(start_extent) )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 20:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 20:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197220.1514821 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdZs8-0005Mc-Vs; Wed, 07 Jan 2026 20:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197220.1514821; Wed, 07 Jan 2026 20:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdZs8-0005MU-TF; Wed, 07 Jan 2026 20:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1197220;
 Wed, 07 Jan 2026 20: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 1vdZs7-0005MI-Rx
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 20: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 1vdZs7-00DYQs-1l
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 20:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdZs7-00CzkQ-2Z
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 20: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=TKDB98xse9vJ+bnA8YTSYBANxeUZ7iyALc4AHyckOWk=; b=aLF9pgM0UVXzk32ExZo16hXEES
	m2wU2ykJ7r69M8AZOXO0QZmdLEmBWt7MwKZE4CvrP8yqjjI8tMYOaM+iRjDg02QCXg2UeXv7KG+Yp
	AWdP5y+OBM8BSHmdLwV65jAQtbp1i0AzcgYWiqZRcGhhyHrR+kC3W2Th/liBGgTwrQIs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libs/xg: allow caller to provide extra memflags for populate physmap
Message-Id: <E1vdZs7-00CzkQ-2Z@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 20:11:11 +0000

commit a76278016ef709fb89fa01b0540fbfb2f1ef7d3a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Dec 12 09:38:37 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Jan 7 18:24:51 2026 +0100

    libs/xg: allow caller to provide extra memflags for populate physmap
    
    Introduce an additional memflags field to the xc_dom_image and
    xc_sr_context structures and use it to pass additional memflags to use when
    populating the domain physmap.
    
    No meaningful usages of this new field are added as part of the patch.  The
    only know usage will be from the XAPI domain builder, which lives in a
    different repository.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenguest.h             |  8 +++++++-
 tools/libs/guest/xg_dom_x86.c        | 13 ++++++++-----
 tools/libs/guest/xg_nomigrate.c      |  3 ++-
 tools/libs/guest/xg_sr_common.h      |  3 +++
 tools/libs/guest/xg_sr_restore.c     |  9 ++++++---
 tools/libs/light/libxl_save_helper.c |  2 +-
 6 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index c88958faa9..7c3b8b0983 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -242,6 +242,9 @@ struct xc_dom_image {
 
     /* Number of vCPUs */
     unsigned int max_vcpus;
+
+    /* Caller provided memflags to use when populating physmap. */
+    unsigned int memflags;
 };
 
 /* --- arch specific hooks ----------------------------------------- */
@@ -611,6 +614,8 @@ struct restore_callbacks {
  *        specific data
  * @param send_back_fd Only used for XC_STREAM_COLO.  Contains backchannel to
  *        the source side.
+ * @param memflags Optional memflags to pass in
+ *        xc_domain_populate_physmap{_exact}() calls.
  * @return 0 on success, -1 on failure
  */
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
@@ -618,7 +623,8 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       uint32_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, uint32_t console_domid,
                       xc_stream_type_t stream_type,
-                      struct restore_callbacks *callbacks, int send_back_fd);
+                      struct restore_callbacks *callbacks, int send_back_fd,
+                      unsigned int memflags);
 
 /**
  * This function will create a domain for a paravirtualized Linux
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index a82b481a12..268936efe2 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -1260,14 +1260,15 @@ static int meminit_pv(struct xc_dom_image *dom)
     /* allocate guest memory */
     for ( i = 0; i < nr_vmemranges; i++ )
     {
-        unsigned int memflags;
+        unsigned int memflags = dom->memflags;
         uint64_t pages, super_pages;
         unsigned int pnode = vnode_to_pnode[vmemranges[i].nid];
         xen_pfn_t extents[SUPERPAGE_BATCH_SIZE];
         xen_pfn_t pfn_base_idx;
 
-        memflags = 0;
-        if ( pnode != XC_NUMA_NO_NODE )
+        if ( pnode != XC_NUMA_NO_NODE &&
+             /* Only set the node if the caller hasn't done so. */
+             XENMEMF_get_node(memflags) == XENMEMF_get_node(0) )
             memflags |= XENMEMF_exact_node(pnode);
 
         pages = (vmemranges[i].end - vmemranges[i].start) >> PAGE_SHIFT;
@@ -1354,7 +1355,7 @@ static int meminit_hvm(struct xc_dom_image *dom)
     int rc;
     unsigned long stat_normal_pages = 0, stat_2mb_pages = 0,
         stat_1gb_pages = 0;
-    unsigned int memflags = 0;
+    unsigned int memflags = dom->memflags;
     int claim_enabled = dom->claim_enabled;
     uint64_t total_pages;
     xen_vmemrange_t dummy_vmemrange[2];
@@ -1500,7 +1501,9 @@ static int meminit_hvm(struct xc_dom_image *dom)
         unsigned int vnode = vmemranges[vmemid].nid;
         unsigned int pnode = vnode_to_pnode[vnode];
 
-        if ( pnode != XC_NUMA_NO_NODE )
+        if ( pnode != XC_NUMA_NO_NODE &&
+             /* Only set the node if the caller hasn't done so. */
+             XENMEMF_get_node(new_memflags) == XENMEMF_get_node(0) )
             new_memflags |= XENMEMF_exact_node(pnode);
 
         end_pages = vmemranges[vmemid].end >> PAGE_SHIFT;
diff --git a/tools/libs/guest/xg_nomigrate.c b/tools/libs/guest/xg_nomigrate.c
index 6795c62ddc..9790d2b4a8 100644
--- a/tools/libs/guest/xg_nomigrate.c
+++ b/tools/libs/guest/xg_nomigrate.c
@@ -33,7 +33,8 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       uint32_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, uint32_t console_domid,
                       xc_stream_type_t stream_type,
-                      struct restore_callbacks *callbacks, int send_back_fd)
+                      struct restore_callbacks *callbacks, int send_back_fd,
+                      unsigned int memflags)
 {
     errno = ENOSYS;
     return -1;
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 0e419c3a96..f1573aefcb 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -295,6 +295,9 @@ struct xc_sr_context
 
             /* Sender has invoked verify mode on the stream. */
             bool verify;
+
+            /* memflags to pass to xc_domain_populate_physmap{_exact}(). */
+            unsigned int memflags;
         } restore;
     };
 
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index 4aed5cf4ac..e148fc594a 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -141,7 +141,8 @@ static bool populate_small_superpage(struct xc_sr_context *ctx, xen_pfn_t gfn)
     xen_pfn_t mfn = gfn;
 
     if ( xc_domain_populate_physmap_exact(
-         ctx->xch, ctx->domid, 1, SMALL_SUPERPAGE_ORDER, 0, &mfn) )
+         ctx->xch, ctx->domid, 1, SMALL_SUPERPAGE_ORDER, ctx->restore.memflags,
+         &mfn) )
         return false;
 
     /*
@@ -217,7 +218,7 @@ int populate_pfns(struct xc_sr_context *ctx, unsigned int count,
     if ( nr_pfns )
     {
         rc = xc_domain_populate_physmap_exact(
-            xch, ctx->domid, nr_pfns, 0, 0, mfns);
+            xch, ctx->domid, nr_pfns, 0, ctx->restore.memflags, mfns);
         if ( rc )
         {
             PERROR("Failed to populate physmap");
@@ -901,7 +902,8 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       uint32_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_gfn, uint32_t console_domid,
                       xc_stream_type_t stream_type,
-                      struct restore_callbacks *callbacks, int send_back_fd)
+                      struct restore_callbacks *callbacks, int send_back_fd,
+                      unsigned int memflags)
 {
     bool hvm;
     xen_pfn_t nr_pfns;
@@ -918,6 +920,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     ctx.restore.xenstore_domid = store_domid;
     ctx.restore.callbacks = callbacks;
     ctx.restore.send_back_fd = send_back_fd;
+    ctx.restore.memflags = memflags;
 
     /* Sanity check stream_type-related parameters */
     switch ( stream_type )
diff --git a/tools/libs/light/libxl_save_helper.c b/tools/libs/light/libxl_save_helper.c
index 65dff389bf..64bdeb3b32 100644
--- a/tools/libs/light/libxl_save_helper.c
+++ b/tools/libs/light/libxl_save_helper.c
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
 
         r = xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn,
                               store_domid, console_evtchn, &console_mfn,
-                              console_domid, stream_type, &cb, send_back_fd);
+                              console_domid, stream_type, &cb, send_back_fd, 0);
         helper_stub_restore_results(store_mfn,console_mfn,0);
         complete(r);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 20:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 20:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197221.1514825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdZsJ-0005PT-1G; Wed, 07 Jan 2026 20:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197221.1514825; Wed, 07 Jan 2026 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 1vdZsI-0005PM-Ue; Wed, 07 Jan 2026 20:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1197221;
 Wed, 07 Jan 2026 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 1vdZsI-0005P8-00
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 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 1vdZsH-00DYQw-2A
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 20:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdZsH-00CzlR-2r
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 20: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=ZFfKgFx2VYwsFemWrFQ0IFmXJApP5D+nl38MLyxznbk=; b=RsaVxNs/2M6Pz7tnEazMsrcMkw
	GJYIytZABHs3tf2jnJ1MJ9Rx6uM4ztluTSuhL0Zed3UasGrbPJAMDS5/cJUPCzuj2HXS933nP1bvt
	48cwKe0/9pkPYEpW4p44DfkAod8LFXfYeuSU1e9JawY8luUzcBntyRv5iL00tl33BzFM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
Message-Id: <E1vdZsH-00CzlR-2r@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 20:11:21 +0000

commit cfb767759b21096fa499d6889d5987c93ebb6cfd
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Dec 3 11:18:59 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Jan 7 19:50:04 2026 +0100

    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 21:11:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 21:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197243.1514839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdao3-0004Kv-A4; Wed, 07 Jan 2026 21:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197243.1514839; Wed, 07 Jan 2026 21:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdao3-0004Km-6q; Wed, 07 Jan 2026 21:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1197243;
 Wed, 07 Jan 2026 21: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 1vdao1-0004Kg-Hx
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 21: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 1vdao1-00DZYH-0e
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 21:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdao1-00D37K-1P
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 21: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=Y5y27uzYR297wc+UYHDo7aixO7EjKnr004pRoiSIcX0=; b=rCVrKGmNKZ7PetRxkwTvGOGQ70
	yVsIEQ8OTz2fAgZJJDxrDToedh4+qdarfEUTr3a36Rb2hG2O6/UGdFRa2BFKonqYnbePEchQM4SNY
	4DKYlh5MuyS49wlNkCVvbGTkTuWxXCvbBES3shq7GZiAtk8NXe5uc4PkXf1i+j8mNeTs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: reject XENMEM_claim_pages when using LLC coloring
Message-Id: <E1vdao1-00D37K-1P@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 21:11:01 +0000

commit b068cafc737d51c76b40d3f9f821017bfa15814c
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Dec 24 10:05:17 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Jan 7 15:54:33 2026 +0100

    xen/mm: reject XENMEM_claim_pages when using LLC coloring
    
    The coloring allocator ignores claims; reject the usage of the hypercall if
    LLC coloring is enabled.  Note that the usage of alloc_color_heap_page() is
    selected at boot time, and it's a system wide decision.  Once enabled all
    domains will use alloc_color_heap_page() for allocations, which ignores any
    outstanding claims.
    
    The hypercall can be enabled if/when LLC coloring is adjusted to support
    claims.
    
    Fixes: 95debe51a936 ("xen: add cache coloring allocator for domains")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index ae805ccbe4..10becf7c1f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -16,6 +16,7 @@
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
+#include <xen/llc-coloring.h>
 #include <xen/mem_access.h>
 #include <xen/mm.h>
 #include <xen/numa.h>
@@ -1660,6 +1661,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case XENMEM_claim_pages:
+        if ( llc_coloring_enabled )
+            return -EOPNOTSUPP;
+
         if ( unlikely(start_extent) )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 21:11:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 21:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197244.1514842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdaoD-0004NS-CV; Wed, 07 Jan 2026 21:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197244.1514842; Wed, 07 Jan 2026 21:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdaoD-0004NI-9y; Wed, 07 Jan 2026 21:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1197244;
 Wed, 07 Jan 2026 21: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 1vdaoB-0004N6-NJ
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 21: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 1vdaoB-00DZYP-17
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 21:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdaoB-00D37q-1l
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 21: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=9LKWvmnawZY1iqi6wJI7s8U0lWQyECNIaANc7D8+9LA=; b=5HnwPhUAq+twvLDm1EsrNuP5x9
	EtZCIf+c2hq1acK8Ndhs2qA2a8MVinwP8h+4ZDIzGOKIxiHOCs9YJLG8h7R5t4hfueLM+XMsS1Gg7
	4DaEGff1gydyJZ6o0b5pJ2PHjO1eYRrb7ySaqjNNrDryWQkkMLoXc7ZA4d2LvFmRp3uw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libs/xg: allow caller to provide extra memflags for populate physmap
Message-Id: <E1vdaoB-00D37q-1l@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 21:11:11 +0000

commit a76278016ef709fb89fa01b0540fbfb2f1ef7d3a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Dec 12 09:38:37 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Jan 7 18:24:51 2026 +0100

    libs/xg: allow caller to provide extra memflags for populate physmap
    
    Introduce an additional memflags field to the xc_dom_image and
    xc_sr_context structures and use it to pass additional memflags to use when
    populating the domain physmap.
    
    No meaningful usages of this new field are added as part of the patch.  The
    only know usage will be from the XAPI domain builder, which lives in a
    different repository.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/include/xenguest.h             |  8 +++++++-
 tools/libs/guest/xg_dom_x86.c        | 13 ++++++++-----
 tools/libs/guest/xg_nomigrate.c      |  3 ++-
 tools/libs/guest/xg_sr_common.h      |  3 +++
 tools/libs/guest/xg_sr_restore.c     |  9 ++++++---
 tools/libs/light/libxl_save_helper.c |  2 +-
 6 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index c88958faa9..7c3b8b0983 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -242,6 +242,9 @@ struct xc_dom_image {
 
     /* Number of vCPUs */
     unsigned int max_vcpus;
+
+    /* Caller provided memflags to use when populating physmap. */
+    unsigned int memflags;
 };
 
 /* --- arch specific hooks ----------------------------------------- */
@@ -611,6 +614,8 @@ struct restore_callbacks {
  *        specific data
  * @param send_back_fd Only used for XC_STREAM_COLO.  Contains backchannel to
  *        the source side.
+ * @param memflags Optional memflags to pass in
+ *        xc_domain_populate_physmap{_exact}() calls.
  * @return 0 on success, -1 on failure
  */
 int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
@@ -618,7 +623,8 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       uint32_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, uint32_t console_domid,
                       xc_stream_type_t stream_type,
-                      struct restore_callbacks *callbacks, int send_back_fd);
+                      struct restore_callbacks *callbacks, int send_back_fd,
+                      unsigned int memflags);
 
 /**
  * This function will create a domain for a paravirtualized Linux
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index a82b481a12..268936efe2 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -1260,14 +1260,15 @@ static int meminit_pv(struct xc_dom_image *dom)
     /* allocate guest memory */
     for ( i = 0; i < nr_vmemranges; i++ )
     {
-        unsigned int memflags;
+        unsigned int memflags = dom->memflags;
         uint64_t pages, super_pages;
         unsigned int pnode = vnode_to_pnode[vmemranges[i].nid];
         xen_pfn_t extents[SUPERPAGE_BATCH_SIZE];
         xen_pfn_t pfn_base_idx;
 
-        memflags = 0;
-        if ( pnode != XC_NUMA_NO_NODE )
+        if ( pnode != XC_NUMA_NO_NODE &&
+             /* Only set the node if the caller hasn't done so. */
+             XENMEMF_get_node(memflags) == XENMEMF_get_node(0) )
             memflags |= XENMEMF_exact_node(pnode);
 
         pages = (vmemranges[i].end - vmemranges[i].start) >> PAGE_SHIFT;
@@ -1354,7 +1355,7 @@ static int meminit_hvm(struct xc_dom_image *dom)
     int rc;
     unsigned long stat_normal_pages = 0, stat_2mb_pages = 0,
         stat_1gb_pages = 0;
-    unsigned int memflags = 0;
+    unsigned int memflags = dom->memflags;
     int claim_enabled = dom->claim_enabled;
     uint64_t total_pages;
     xen_vmemrange_t dummy_vmemrange[2];
@@ -1500,7 +1501,9 @@ static int meminit_hvm(struct xc_dom_image *dom)
         unsigned int vnode = vmemranges[vmemid].nid;
         unsigned int pnode = vnode_to_pnode[vnode];
 
-        if ( pnode != XC_NUMA_NO_NODE )
+        if ( pnode != XC_NUMA_NO_NODE &&
+             /* Only set the node if the caller hasn't done so. */
+             XENMEMF_get_node(new_memflags) == XENMEMF_get_node(0) )
             new_memflags |= XENMEMF_exact_node(pnode);
 
         end_pages = vmemranges[vmemid].end >> PAGE_SHIFT;
diff --git a/tools/libs/guest/xg_nomigrate.c b/tools/libs/guest/xg_nomigrate.c
index 6795c62ddc..9790d2b4a8 100644
--- a/tools/libs/guest/xg_nomigrate.c
+++ b/tools/libs/guest/xg_nomigrate.c
@@ -33,7 +33,8 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       uint32_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, uint32_t console_domid,
                       xc_stream_type_t stream_type,
-                      struct restore_callbacks *callbacks, int send_back_fd)
+                      struct restore_callbacks *callbacks, int send_back_fd,
+                      unsigned int memflags)
 {
     errno = ENOSYS;
     return -1;
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 0e419c3a96..f1573aefcb 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -295,6 +295,9 @@ struct xc_sr_context
 
             /* Sender has invoked verify mode on the stream. */
             bool verify;
+
+            /* memflags to pass to xc_domain_populate_physmap{_exact}(). */
+            unsigned int memflags;
         } restore;
     };
 
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index 4aed5cf4ac..e148fc594a 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -141,7 +141,8 @@ static bool populate_small_superpage(struct xc_sr_context *ctx, xen_pfn_t gfn)
     xen_pfn_t mfn = gfn;
 
     if ( xc_domain_populate_physmap_exact(
-         ctx->xch, ctx->domid, 1, SMALL_SUPERPAGE_ORDER, 0, &mfn) )
+         ctx->xch, ctx->domid, 1, SMALL_SUPERPAGE_ORDER, ctx->restore.memflags,
+         &mfn) )
         return false;
 
     /*
@@ -217,7 +218,7 @@ int populate_pfns(struct xc_sr_context *ctx, unsigned int count,
     if ( nr_pfns )
     {
         rc = xc_domain_populate_physmap_exact(
-            xch, ctx->domid, nr_pfns, 0, 0, mfns);
+            xch, ctx->domid, nr_pfns, 0, ctx->restore.memflags, mfns);
         if ( rc )
         {
             PERROR("Failed to populate physmap");
@@ -901,7 +902,8 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       uint32_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_gfn, uint32_t console_domid,
                       xc_stream_type_t stream_type,
-                      struct restore_callbacks *callbacks, int send_back_fd)
+                      struct restore_callbacks *callbacks, int send_back_fd,
+                      unsigned int memflags)
 {
     bool hvm;
     xen_pfn_t nr_pfns;
@@ -918,6 +920,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     ctx.restore.xenstore_domid = store_domid;
     ctx.restore.callbacks = callbacks;
     ctx.restore.send_back_fd = send_back_fd;
+    ctx.restore.memflags = memflags;
 
     /* Sanity check stream_type-related parameters */
     switch ( stream_type )
diff --git a/tools/libs/light/libxl_save_helper.c b/tools/libs/light/libxl_save_helper.c
index 65dff389bf..64bdeb3b32 100644
--- a/tools/libs/light/libxl_save_helper.c
+++ b/tools/libs/light/libxl_save_helper.c
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
 
         r = xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn,
                               store_domid, console_evtchn, &console_mfn,
-                              console_domid, stream_type, &cb, send_back_fd);
+                              console_domid, stream_type, &cb, send_back_fd, 0);
         helper_stub_restore_results(store_mfn,console_mfn,0);
         complete(r);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 07 21:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Jan 2026 21:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197245.1514847 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdaoN-0004Pp-Ed; Wed, 07 Jan 2026 21:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197245.1514847; Wed, 07 Jan 2026 21:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdaoN-0004Pi-CF; Wed, 07 Jan 2026 21:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1197245;
 Wed, 07 Jan 2026 21:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdaoL-0004PR-OL
 for xen-changelog@lists.xenproject.org; Wed, 07 Jan 2026 21:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdaoL-00DZYZ-1P
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 21:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdaoL-00D38T-2D
 for xen-changelog@lists.xenproject.org;
 Wed, 07 Jan 2026 21: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=aieZlD5ULHsVHuP2EYfkmkh2bILxPPfeD4nTSumnpUA=; b=jSR8SFyw1uzo0+X92xu5/Xk6Ke
	KRuHkuNdXAHjDd5QWUR/O7ugbckBvMhqPq/CHlXF54IKdoIJJER6toHmxl9c/RjVj+eo5B+Hvz6JA
	orJ96wFEPSYPtqIJnbcI4c8Ospt30rXGldc+jcmj5xr1HIOeuaHhmPskPx394hRb31Bw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
Message-Id: <E1vdaoL-00D38T-2D@xenbits.xenproject.org>
Date: Wed, 07 Jan 2026 21:11:21 +0000

commit cfb767759b21096fa499d6889d5987c93ebb6cfd
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Dec 3 11:18:59 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed Jan 7 19:50:04 2026 +0100

    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 07:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 07:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197313.1514864 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLV-000160-Ef; Thu, 08 Jan 2026 07:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197313.1514864; Thu, 08 Jan 2026 07:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLV-00015s-Bv; Thu, 08 Jan 2026 07:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1197313;
 Thu, 08 Jan 2026 07: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 1vdkLT-00015c-Ql
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 07: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 1vdkLT-00EspQ-1d
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkLT-00DeDf-2R
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sTa1oP+mqPf0XOabYErp1OPuq5g1cVUbago7kcPMFw0=; b=mQ0DsYnm6QHYduCmeAivH5RU+a
	J0V0ZDiSVmYC26vf5Ray8q9ardrebjvC0YrWDi4lX3l+Fq2qdkhErGCcsQT1rTJgIVgzdmG6AmtOC
	WxGV76oyhoJoC0ucr/o/qeL95ZRVtUfb6ApXqY7eGnCjfQCxAawRi9rREXzgmMt5wkcA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: move ats_device() to the sole file it's used from
Message-Id: <E1vdkLT-00DeDf-2R@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 07:22:11 +0000

commit f3759045b0391af5fd51f3086240ac9c1e1723de
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:59:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: move ats_device() to the sole file it's used from
    
    ..., thus allowing it to become static, and thus reducing scope overlap
    between it and pci_ats_device(). There's nothing x86-specific about this
    function anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h  |  2 --
 xen/drivers/passthrough/vtd/iommu.c   | 27 +++++++++++++++++++++++++++
 xen/drivers/passthrough/vtd/x86/ats.c | 26 --------------------------
 3 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 74e12a2e50..f621bf84db 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -65,8 +65,6 @@ struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
 struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id);
 struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
-int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
-
 int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
                          u64 addr, unsigned int size_order, u64 type);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 79874aaa22..53e9165fc7 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1458,6 +1458,33 @@ static void __hwdom_init cf_check intel_iommu_hwdom_init(struct domain *d)
     }
 }
 
+static int ats_device(const struct pci_dev *pdev,
+                      const struct acpi_drhd_unit *drhd)
+{
+    unsigned int pos, expfl = 0;
+
+    if ( !ats_enabled || !iommu_qinval )
+        return 0;
+
+    if ( !ecap_queued_inval(drhd->iommu->ecap) ||
+         !ecap_dev_iotlb(drhd->iommu->ecap) )
+        return 0;
+
+    pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_EXP);
+    if ( pos )
+        expfl = pci_conf_read16(pdev->sbdf, pos + PCI_EXP_FLAGS);
+
+    if ( MASK_EXTR(expfl, PCI_EXP_FLAGS_TYPE) != PCI_EXP_TYPE_RC_END &&
+         !acpi_find_matched_atsr_unit(pdev) )
+        return 0;
+
+    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    if ( pos )
+        drhd->iommu->flush_dev_iotlb = true;
+
+    return pos;
+}
+
 /*
  * This function returns
  * - a negative errno value upon error,
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index d728057a5f..5292505740 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -28,32 +28,6 @@
 #include "../extern.h"
 #include "../../ats.h"
 
-int ats_device(const struct pci_dev *pdev, const struct acpi_drhd_unit *drhd)
-{
-    unsigned int pos, expfl = 0;
-
-    if ( !ats_enabled || !iommu_qinval )
-        return 0;
-
-    if ( !ecap_queued_inval(drhd->iommu->ecap) ||
-         !ecap_dev_iotlb(drhd->iommu->ecap) )
-        return 0;
-
-    pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_EXP);
-    if ( pos )
-        expfl = pci_conf_read16(pdev->sbdf, pos + PCI_EXP_FLAGS);
-
-    if ( MASK_EXTR(expfl, PCI_EXP_FLAGS_TYPE) != PCI_EXP_TYPE_RC_END &&
-         !acpi_find_matched_atsr_unit(pdev) )
-        return 0;
-
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
-    if ( pos )
-        drhd->iommu->flush_dev_iotlb = true;
-
-    return pos;
-}
-
 static bool device_in_domain(const struct vtd_iommu *iommu,
                              const struct pci_dev *pdev, uint16_t did)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 07:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 07:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197312.1514861 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLK-00014h-DA; Thu, 08 Jan 2026 07:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197312.1514861; Thu, 08 Jan 2026 07:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLK-00014Z-AP; Thu, 08 Jan 2026 07:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1197312;
 Thu, 08 Jan 2026 07: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 1vdkLJ-00014T-Oz
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 07:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkLJ-00Esp6-1K
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkLJ-00DeCl-23
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qo4e2sGtqfEKi/xBGj4Ipg5Vkt/fTBWCCg+zJhNzt3g=; b=j6d95fU8D8QzZSXMmqcXUI1UtH
	6A5u8e3nzvwzgNgYx41Fq7xUJia3V23Qkm9ych75vbAD3TSlwvM4YJYCvsGEyMYeyKekBe6n3cFWe
	AfYOevDEUOJjGlKTL6CPzb74odY3P76NPZKDZqcwaxuna5cQYSNhbXO152QUaXIbZPbY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: replace find_ats_dev_drhd()
Message-Id: <E1vdkLJ-00DeCl-23@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 07:22:01 +0000

commit 050db338376370cf1dc453f64a0dfc5e329a139a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:58:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: replace find_ats_dev_drhd()
    
    All callers only care about boolean outcome. For this there's no point
    in allocating a duplicate of the respective DRHD structure; a simple
    boolean suffices (which eventually may want to become a count, such that
    the "any ATS devices assigned state" can also clear again). With that
    boolean, remove respective parameters from internal helper functions
    right away, as those have access to the flag through another parameter.
    (While the corresponding hook can have the parameter dropped too then,
    leave this for a separate change, to limit scope here.)
    
    No functional effect intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h  |  2 --
 xen/drivers/passthrough/vtd/iommu.c   | 41 +++++++++++------------------------
 xen/drivers/passthrough/vtd/iommu.h   |  1 +
 xen/drivers/passthrough/vtd/x86/ats.c | 25 ++-------------------
 4 files changed, 16 insertions(+), 53 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index c16583c951..74e12a2e50 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -65,8 +65,6 @@ struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
 struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id);
 struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
-struct acpi_drhd_unit *find_ats_dev_drhd(struct vtd_iommu *iommu);
-
 int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
 
 int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 90f36ac22b..79874aaa22 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -627,8 +627,7 @@ int cf_check vtd_flush_iotlb_reg(
 }
 
 static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
-                                                 bool flush_non_present_entry,
-                                                 bool flush_dev_iotlb)
+                                                 bool flush_non_present_entry)
 {
     int status;
 
@@ -636,7 +635,7 @@ static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH,
-                                flush_non_present_entry, flush_dev_iotlb);
+                                flush_non_present_entry, iommu->flush_dev_iotlb);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -645,8 +644,7 @@ static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
 }
 
 static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
-                                              bool flush_non_present_entry,
-                                              bool flush_dev_iotlb)
+                                              bool flush_non_present_entry)
 {
     int status;
 
@@ -654,7 +652,7 @@ static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH,
-                                flush_non_present_entry, flush_dev_iotlb);
+                                flush_non_present_entry, iommu->flush_dev_iotlb);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -664,26 +662,23 @@ static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
 
 static int __must_check iommu_flush_iotlb_psi(struct vtd_iommu *iommu, u16 did,
                                               u64 addr, unsigned int order,
-                                              bool flush_non_present_entry,
-                                              bool flush_dev_iotlb)
+                                              bool flush_non_present_entry)
 {
     int status;
 
     /* Fallback to domain selective flush if no PSI support */
     if ( !cap_pgsel_inv(iommu->cap) )
-        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry,
-                                     flush_dev_iotlb);
+        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry);
 
     /* Fallback to domain selective flush if size is too big */
     if ( order > cap_max_amask_val(iommu->cap) )
-        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry,
-                                     flush_dev_iotlb);
+        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry);
 
     /* apply platform specific errata workarounds */
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, addr, order, DMA_TLB_PSI_FLUSH,
-                                flush_non_present_entry, flush_dev_iotlb);
+                                flush_non_present_entry, iommu->flush_dev_iotlb);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -695,7 +690,6 @@ static int __must_check iommu_flush_all(void)
 {
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
-    bool flush_dev_iotlb;
     int rc = 0;
 
     if ( iommu_non_coherent )
@@ -707,8 +701,7 @@ static int __must_check iommu_flush_all(void)
 
         iommu = drhd->iommu;
         context_rc = iommu_flush_context_global(iommu, 0);
-        flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
-        iotlb_rc = iommu_flush_iotlb_global(iommu, 0, flush_dev_iotlb);
+        iotlb_rc = iommu_flush_iotlb_global(iommu, 0);
 
         /*
          * The current logic for returns:
@@ -738,7 +731,6 @@ static int __must_check cf_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct domain_iommu *hd = dom_iommu(d);
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
-    bool flush_dev_iotlb;
     int iommu_domid;
     int ret = 0;
 
@@ -766,21 +758,18 @@ static int __must_check cf_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
         if ( !test_bit(iommu->index, hd->arch.vtd.iommu_bitmap) )
             continue;
 
-        flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
         iommu_domid = get_iommu_did(d->domain_id, iommu, !d->is_dying);
         if ( iommu_domid == -1 )
             continue;
 
         if ( !page_count || (page_count & (page_count - 1)) ||
              dfn_eq(dfn, INVALID_DFN) || !IS_ALIGNED(dfn_x(dfn), page_count) )
-            rc = iommu_flush_iotlb_dsi(iommu, iommu_domid,
-                                       0, flush_dev_iotlb);
+            rc = iommu_flush_iotlb_dsi(iommu, iommu_domid, 0);
         else
             rc = iommu_flush_iotlb_psi(iommu, iommu_domid,
                                        dfn_to_daddr(dfn),
                                        get_order_from_pages(page_count),
-                                       !(flush_flags & IOMMU_FLUSHF_modified),
-                                       flush_dev_iotlb);
+                                       !(flush_flags & IOMMU_FLUSHF_modified));
 
         if ( rc > 0 )
             iommu_flush_write_buffer(iommu);
@@ -1491,7 +1480,6 @@ int domain_context_mapping_one(
     uint16_t seg = iommu->drhd->segment, prev_did = 0;
     struct domain *prev_dom = NULL;
     int rc, ret;
-    bool flush_dev_iotlb;
 
     if ( QUARANTINE_SKIP(domain, pgd_maddr) )
         return 0;
@@ -1613,8 +1601,7 @@ int domain_context_mapping_one(
 
     rc = iommu_flush_context_device(iommu, prev_did, PCI_BDF(bus, devfn),
                                     DMA_CCMD_MASK_NOBIT, !prev_dom);
-    flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
-    ret = iommu_flush_iotlb_dsi(iommu, prev_did, !prev_dom, flush_dev_iotlb);
+    ret = iommu_flush_iotlb_dsi(iommu, prev_did, !prev_dom);
 
     /*
      * The current logic for returns:
@@ -1852,7 +1839,6 @@ int domain_context_unmap_one(
     struct context_entry *context, *context_entries;
     u64 maddr;
     int iommu_domid, rc, ret;
-    bool flush_dev_iotlb;
 
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
@@ -1884,8 +1870,7 @@ int domain_context_unmap_one(
                                     PCI_BDF(bus, devfn),
                                     DMA_CCMD_MASK_NOBIT, 0);
 
-    flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
-    ret = iommu_flush_iotlb_dsi(iommu, iommu_domid, 0, flush_dev_iotlb);
+    ret = iommu_flush_iotlb_dsi(iommu, iommu_domid, 0);
 
     /*
      * The current logic for returns:
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 4f41360c53..0d96b76bce 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -484,6 +484,7 @@ struct vtd_iommu {
     spinlock_t register_lock; /* protect iommu register handling */
     u64 root_maddr; /* root entry machine address */
     nodeid_t node;
+    bool flush_dev_iotlb;
     struct msi_desc msi;
     struct acpi_drhd_unit *drhd;
 
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index 61052ef580..d728057a5f 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -28,22 +28,8 @@
 #include "../extern.h"
 #include "../../ats.h"
 
-static LIST_HEAD(ats_dev_drhd_units);
-
-struct acpi_drhd_unit *find_ats_dev_drhd(struct vtd_iommu *iommu)
-{
-    struct acpi_drhd_unit *drhd;
-    list_for_each_entry ( drhd, &ats_dev_drhd_units, list )
-    {
-        if ( drhd->iommu == iommu )
-            return drhd;
-    }
-    return NULL;
-}
-
 int ats_device(const struct pci_dev *pdev, const struct acpi_drhd_unit *drhd)
 {
-    struct acpi_drhd_unit *ats_drhd;
     unsigned int pos, expfl = 0;
 
     if ( !ats_enabled || !iommu_qinval )
@@ -61,17 +47,10 @@ int ats_device(const struct pci_dev *pdev, const struct acpi_drhd_unit *drhd)
          !acpi_find_matched_atsr_unit(pdev) )
         return 0;
 
-    ats_drhd = find_ats_dev_drhd(drhd->iommu);
     pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    if ( pos )
+        drhd->iommu->flush_dev_iotlb = true;
 
-    if ( pos && (ats_drhd == NULL) )
-    {
-        ats_drhd = xmalloc(struct acpi_drhd_unit);
-        if ( !ats_drhd )
-            return -ENOMEM;
-        *ats_drhd = *drhd;
-        list_add_tail(&ats_drhd->list, &ats_dev_drhd_units);
-    }
     return pos;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 07:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 07:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197314.1514868 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLf-000199-H6; Thu, 08 Jan 2026 07:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197314.1514868; Thu, 08 Jan 2026 07:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLf-000191-EZ; Thu, 08 Jan 2026 07:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1197314;
 Thu, 08 Jan 2026 07:22: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 1vdkLd-00018r-Tf
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 07:22: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 1vdkLd-00EspU-1x
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkLd-00DeED-2j
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U7Rblqi2j9OcnyNw31Xga3hpLyW6NU9eew76/bZRZ0w=; b=Q+qnS0opINpagfLyby+aYsQtJQ
	nDCH2ATWjeACvQdCNmlIT9PVmWq+5kXlC+Nd5h9sgs2hXMHsxy1H6mM+RsWBuK/kqSfBDl8DBvxhI
	LN3Dsk2a9iBaytZ89L9r8XSq/5F/9EaYBmYU5S83Y2wincHdPl0F7zc6p2JbwiCzBT0w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: move dev_invalidate_iotlb() to the sole file it's used from
Message-Id: <E1vdkLd-00DeED-2j@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 07:22:21 +0000

commit 15b90f90b4452f36d10bbcefd2444c3fb801cbbc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:59:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: move dev_invalidate_iotlb() to the sole file it's used from
    
    ..., thus allowing it and qinval_device_iotlb_sync() to become static.
    There's nothing x86-specific about the function anyway. While moving,
    adjust types to better match ./CODING_STYLE (albeit use of fixed-width
    types for parameters is retained to limit the effective change).
    
    Append a UL to a constant while moving, to please Misra. Also insert
    blank lines in the switch(), between non-fall-through case blocks.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h     |   6 --
 xen/drivers/passthrough/vtd/qinval.c     | 102 ++++++++++++++++++++++++-
 xen/drivers/passthrough/vtd/x86/Makefile |   1 -
 xen/drivers/passthrough/vtd/x86/ats.c    | 123 -------------------------------
 4 files changed, 100 insertions(+), 132 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index f621bf84db..4df26df6d4 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -65,12 +65,6 @@ struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
 struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id);
 struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
-int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
-                         u64 addr, unsigned int size_order, u64 type);
-
-int __must_check qinval_device_iotlb_sync(struct vtd_iommu *iommu,
-                                          struct pci_dev *pdev,
-                                          u16 did, u16 size, u64 addr);
 
 uint64_t alloc_pgtable_maddr(unsigned long npages, nodeid_t node);
 void free_pgtable_maddr(u64 maddr);
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 036f3e8505..c79927b09f 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -251,8 +251,9 @@ static int __must_check dev_invalidate_sync(struct vtd_iommu *iommu,
     return rc;
 }
 
-int qinval_device_iotlb_sync(struct vtd_iommu *iommu, struct pci_dev *pdev,
-                             u16 did, u16 size, u64 addr)
+static int qinval_device_iotlb_sync(struct vtd_iommu *iommu,
+                                    struct pci_dev *pdev, uint16_t did,
+                                    uint16_t size, paddr_t addr)
 {
     unsigned long flags;
     unsigned int index;
@@ -282,6 +283,103 @@ int qinval_device_iotlb_sync(struct vtd_iommu *iommu, struct pci_dev *pdev,
     return dev_invalidate_sync(iommu, pdev, did);
 }
 
+static bool device_in_domain(const struct vtd_iommu *iommu,
+                             const struct pci_dev *pdev, uint16_t did)
+{
+    struct root_entry *root_entry;
+    struct context_entry *ctxt_entry = NULL;
+    unsigned int tt;
+    bool found = false;
+
+    if ( unlikely(!iommu->root_maddr) )
+    {
+        ASSERT_UNREACHABLE();
+        return false;
+    }
+
+    root_entry = map_vtd_domain_page(iommu->root_maddr);
+    if ( !root_present(root_entry[pdev->bus]) )
+        goto out;
+
+    ctxt_entry = map_vtd_domain_page(root_entry[pdev->bus].val);
+    if ( context_domain_id(ctxt_entry[pdev->devfn]) != did )
+        goto out;
+
+    tt = context_translation_type(ctxt_entry[pdev->devfn]);
+    if ( tt != CONTEXT_TT_DEV_IOTLB )
+        goto out;
+
+    found = true;
+ out:
+    if ( root_entry )
+        unmap_vtd_domain_page(root_entry);
+
+    if ( ctxt_entry )
+        unmap_vtd_domain_page(ctxt_entry);
+
+    return found;
+}
+
+static int dev_invalidate_iotlb(struct vtd_iommu *iommu, uint16_t did,
+                                paddr_t addr, unsigned int size_order,
+                                uint64_t type)
+{
+    struct pci_dev *pdev, *temp;
+    int ret = 0;
+
+    if ( !ecap_dev_iotlb(iommu->ecap) )
+        return ret;
+
+    list_for_each_entry_safe ( pdev, temp, &iommu->ats_devices, ats.list )
+    {
+        bool sbit;
+        int rc = 0;
+
+        switch ( type )
+        {
+        case DMA_TLB_DSI_FLUSH:
+            if ( !device_in_domain(iommu, pdev, did) )
+                break;
+            /* fall through if DSI condition met */
+        case DMA_TLB_GLOBAL_FLUSH:
+            /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
+            sbit = 1;
+            addr = (~0UL << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFFUL;
+            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
+            break;
+
+        case DMA_TLB_PSI_FLUSH:
+            if ( !device_in_domain(iommu, pdev, did) )
+                break;
+
+            /* if size <= 4K, set sbit = 0, else set sbit = 1 */
+            sbit = size_order ? 1 : 0;
+
+            /* clear lower bits */
+            addr &= ~0UL << PAGE_SHIFT_4K;
+
+            /* if sbit == 1, zero out size_order bit and set lower bits to 1 */
+            if ( sbit )
+            {
+                addr &= ~((u64)PAGE_SIZE_4K << (size_order - 1));
+                addr |= (((u64)1 << (size_order - 1)) - 1) << PAGE_SHIFT_4K;
+            }
+
+            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
+            break;
+
+        default:
+            dprintk(XENLOG_WARNING VTDPREFIX, "invalid vt-d flush type\n");
+            return -EOPNOTSUPP;
+        }
+
+        if ( !ret )
+            ret = rc;
+    }
+
+    return ret;
+}
+
 static int __must_check queue_invalidate_iec_sync(struct vtd_iommu *iommu,
                                                   u8 granu, u8 im, u16 iidx)
 {
diff --git a/xen/drivers/passthrough/vtd/x86/Makefile b/xen/drivers/passthrough/vtd/x86/Makefile
index fe20a0b019..85243e3aa7 100644
--- a/xen/drivers/passthrough/vtd/x86/Makefile
+++ b/xen/drivers/passthrough/vtd/x86/Makefile
@@ -1,2 +1 @@
-obj-y += ats.o
 obj-y += vtd.o
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
deleted file mode 100644
index 5292505740..0000000000
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2006, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Allen Kay <allen.m.kay@intel.com>
- */
-
-#include <xen/sched.h>
-#include <xen/iommu.h>
-#include <xen/time.h>
-#include <xen/pci.h>
-#include <xen/pci_regs.h>
-#include <asm/msi.h>
-#include "../iommu.h"
-#include "../dmar.h"
-#include "../vtd.h"
-#include "../extern.h"
-#include "../../ats.h"
-
-static bool device_in_domain(const struct vtd_iommu *iommu,
-                             const struct pci_dev *pdev, uint16_t did)
-{
-    struct root_entry *root_entry;
-    struct context_entry *ctxt_entry = NULL;
-    unsigned int tt;
-    bool found = false;
-
-    if ( unlikely(!iommu->root_maddr) )
-    {
-        ASSERT_UNREACHABLE();
-        return false;
-    }
-
-    root_entry = map_vtd_domain_page(iommu->root_maddr);
-    if ( !root_present(root_entry[pdev->bus]) )
-        goto out;
-
-    ctxt_entry = map_vtd_domain_page(root_entry[pdev->bus].val);
-    if ( context_domain_id(ctxt_entry[pdev->devfn]) != did )
-        goto out;
-
-    tt = context_translation_type(ctxt_entry[pdev->devfn]);
-    if ( tt != CONTEXT_TT_DEV_IOTLB )
-        goto out;
-
-    found = true;
-out:
-    if ( root_entry )
-        unmap_vtd_domain_page(root_entry);
-
-    if ( ctxt_entry )
-        unmap_vtd_domain_page(ctxt_entry);
-
-    return found;
-}
-
-int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
-    u64 addr, unsigned int size_order, u64 type)
-{
-    struct pci_dev *pdev, *temp;
-    int ret = 0;
-
-    if ( !ecap_dev_iotlb(iommu->ecap) )
-        return ret;
-
-    list_for_each_entry_safe( pdev, temp, &iommu->ats_devices, ats.list )
-    {
-        bool sbit;
-        int rc = 0;
-
-        switch ( type )
-        {
-        case DMA_TLB_DSI_FLUSH:
-            if ( !device_in_domain(iommu, pdev, did) )
-                break;
-            /* fall through if DSI condition met */
-        case DMA_TLB_GLOBAL_FLUSH:
-            /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
-            sbit = 1;
-            addr = (~0UL << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFF;
-            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
-            break;
-        case DMA_TLB_PSI_FLUSH:
-            if ( !device_in_domain(iommu, pdev, did) )
-                break;
-
-            /* if size <= 4K, set sbit = 0, else set sbit = 1 */
-            sbit = size_order ? 1 : 0;
-
-            /* clear lower bits */
-            addr &= ~0UL << PAGE_SHIFT_4K;
-
-            /* if sbit == 1, zero out size_order bit and set lower bits to 1 */
-            if ( sbit )
-            {
-                addr &= ~((u64)PAGE_SIZE_4K << (size_order - 1));
-                addr |= (((u64)1 << (size_order - 1)) - 1) << PAGE_SHIFT_4K;
-            }
-
-            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
-            break;
-        default:
-            dprintk(XENLOG_WARNING VTDPREFIX, "invalid vt-d flush type\n");
-            return -EOPNOTSUPP;
-        }
-
-        if ( !ret )
-            ret = rc;
-    }
-
-    return ret;
-}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 07:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 07:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197315.1514873 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLp-0001BU-Ij; Thu, 08 Jan 2026 07:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197315.1514873; Thu, 08 Jan 2026 07: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 1vdkLp-0001BM-GD; Thu, 08 Jan 2026 07:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1197315;
 Thu, 08 Jan 2026 07:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdkLo-0001B5-0z
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 07:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkLn-00EspY-2I
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkLn-00DeEu-34
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22: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=r/jVhl5rv9A5wm5b82y6Hm1JqMFttCDSrDzBRjMG3D8=; b=El/Xrrkd7Qd3sXD2g6ZaLz5qWr
	vk/q+USPWYsQd6QzcSw0BOeDKBKdD1CWM+x1PaMQpFptX1LcUlk5rKzNb443p8GQcVKs8U1IYcPp5
	0QEwsYESB1FHT3ETVmFg1S5TYKjidBV3A4XuW8yiOnNtYnnlcs36qJAPKpAzZbQ59Aio=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: move {,un}map_vtd_domain_page()
Message-Id: <E1vdkLn-00DeEu-34@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 07:22:31 +0000

commit 227475c278699a62bfcf7d3a19349efe47f30712
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:59:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: move {,un}map_vtd_domain_page()
    
    ..., thus allowing them to become static. There's nothing x86-specific
    about these functions anyway.
    
    Since only the "iommu_inclusive_mapping" parameter declaration would be
    left in the file, move that as well. There's nothing VT-d specific about
    it (anymore?): "dom0-iommu=map-inclusive" is similarly generic, and
    documentation also doesn't say anything.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 docs/misc/xen-command-line.pandoc        |  2 +-
 xen/drivers/passthrough/vtd/Makefile     |  2 --
 xen/drivers/passthrough/vtd/extern.h     | 13 +++++++--
 xen/drivers/passthrough/vtd/x86/Makefile |  1 -
 xen/drivers/passthrough/vtd/x86/vtd.c    | 48 --------------------------------
 xen/drivers/passthrough/x86/iommu.c      |  7 +++++
 6 files changed, 19 insertions(+), 54 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 805da22c44..bbbdf6a5bb 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1651,7 +1651,7 @@ Specify the timeout of the device IOTLB invalidation in milliseconds.
 By default, the timeout is 1000 ms. When you see error 'Queue invalidate
 wait descriptor timed out', try increasing this value.
 
-### iommu_inclusive_mapping
+### iommu_inclusive_mapping (x86)
 > `= <boolean>`
 
 **WARNING: This command line option is deprecated, and superseded by
diff --git a/xen/drivers/passthrough/vtd/Makefile b/xen/drivers/passthrough/vtd/Makefile
index fde7555fac..3204546f11 100644
--- a/xen/drivers/passthrough/vtd/Makefile
+++ b/xen/drivers/passthrough/vtd/Makefile
@@ -1,5 +1,3 @@
-obj-$(CONFIG_X86) += x86/
-
 obj-y += iommu.o
 obj-y += dmar.o
 obj-y += utils.o
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 4df26df6d4..65f81a8bf1 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -21,6 +21,7 @@
 #define DRIVERS__PASSTHROUGH__VTD__EXTERN_H
 
 #include "dmar.h"
+#include <xen/domain_page.h>
 #include <xen/keyhandler.h>
 
 #define VTDPREFIX "[VT-D]"
@@ -68,8 +69,6 @@ struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
 uint64_t alloc_pgtable_maddr(unsigned long npages, nodeid_t node);
 void free_pgtable_maddr(u64 maddr);
-void *map_vtd_domain_page(u64 maddr);
-void unmap_vtd_domain_page(const void *va);
 int domain_context_mapping_one(struct domain *domain, struct vtd_iommu *iommu,
                                uint8_t bus, uint8_t devfn,
                                const struct pci_dev *pdev, domid_t domid,
@@ -79,6 +78,16 @@ int domain_context_unmap_one(struct domain *domain, struct vtd_iommu *iommu,
 int cf_check intel_iommu_get_reserved_device_memory(
     iommu_grdm_t *func, void *ctxt);
 
+static inline void *map_vtd_domain_page(paddr_t maddr)
+{
+    return map_domain_page(_mfn(paddr_to_pfn(maddr)));
+}
+
+static inline void unmap_vtd_domain_page(const void *va)
+{
+    unmap_domain_page(va);
+}
+
 unsigned int cf_check io_apic_read_remap_rte(
     unsigned int apic, unsigned int reg);
 void cf_check io_apic_write_remap_rte(
diff --git a/xen/drivers/passthrough/vtd/x86/Makefile b/xen/drivers/passthrough/vtd/x86/Makefile
deleted file mode 100644
index 85243e3aa7..0000000000
--- a/xen/drivers/passthrough/vtd/x86/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-obj-y += vtd.o
diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c
deleted file mode 100644
index 76f12adc23..0000000000
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2008, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) Allen Kay <allen.m.kay@intel.com>
- * Copyright (C) Weidong Han <weidong.han@intel.com>
- */
-
-#include <xen/param.h>
-#include <xen/sched.h>
-#include <xen/softirq.h>
-#include <xen/domain_page.h>
-#include <asm/paging.h>
-#include <xen/iommu.h>
-#include <xen/irq.h>
-#include <xen/numa.h>
-#include <asm/fixmap.h>
-#include "../iommu.h"
-#include "../dmar.h"
-#include "../vtd.h"
-#include "../extern.h"
-
-/*
- * iommu_inclusive_mapping: when set, all memory below 4GB is included in dom0
- * 1:1 iommu mappings except xen and unusable regions.
- */
-boolean_param("iommu_inclusive_mapping", iommu_hwdom_inclusive);
-
-void *map_vtd_domain_page(u64 maddr)
-{
-    return map_domain_page(_mfn(paddr_to_pfn(maddr)));
-}
-
-void unmap_vtd_domain_page(const void *va)
-{
-    unmap_domain_page(va);
-}
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index 0954cc4922..951f1f30b7 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -19,6 +19,7 @@
 #include <xen/paging.h>
 #include <xen/guest_access.h>
 #include <xen/event.h>
+#include <xen/param.h>
 #include <xen/softirq.h>
 #include <xen/vm_event.h>
 #include <xsm/xsm.h>
@@ -36,6 +37,12 @@ bool __initdata iommu_superpages = true;
 
 enum iommu_intremap __read_mostly iommu_intremap = iommu_intremap_full;
 
+/*
+ * iommu_inclusive_mapping: When set, all memory below 4GB is included in dom0
+ * 1:1 iommu mappings except xen and unusable regions.
+ */
+boolean_param("iommu_inclusive_mapping", iommu_hwdom_inclusive);
+
 #ifdef CONFIG_PV
 /* Possible unfiltered LAPIC/MSI messages from untrusted sources? */
 bool __read_mostly untrusted_msi;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 07:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 07:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197316.1514877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkLz-0001Dk-KC; Thu, 08 Jan 2026 07:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197316.1514877; Thu, 08 Jan 2026 07: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 1vdkLz-0001Dc-Hb; Thu, 08 Jan 2026 07:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1197316;
 Thu, 08 Jan 2026 07: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 1vdkLy-0001DU-4f
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 07: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 1vdkLx-00Espe-2d
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkLy-00DeFa-0B
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07: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=VQZ7n/JzqEzYvOuGdvFTZGZc2lzPDjVXk4zwOE48zgI=; b=N19KSNWr9g6E8y4IGqMbdesOXz
	GUCOb06b6+EEqnEj9VxRpKqtiqeaeyaWoyoJlYhhnLSPa+29z9sp8QED1csVLNAjd2yNQ7e71eA9x
	sxFMmsZnC+TxLO5s0SmbG9NpH57S/0B0O2IVAl4TTiyB9AKdz38+u9g9bKxhGCAsH2ts=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: drop flush_dev_iotlb parameter from IOTLB flush hook
Message-Id: <E1vdkLy-00DeFa-0B@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 07:22:42 +0000

commit 673d9dd8a590fa61dd9ffed48c3c64ee3b0a23ff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 16:00:19 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: drop flush_dev_iotlb parameter from IOTLB flush hook
    
    All call sites pass it using the flag from the IOMMU which they also
    pass.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h | 3 +--
 xen/drivers/passthrough/vtd/iommu.c  | 9 ++++-----
 xen/drivers/passthrough/vtd/iommu.h  | 3 +--
 xen/drivers/passthrough/vtd/qinval.c | 7 +++----
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 65f81a8bf1..1a9a439fb5 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -57,8 +57,7 @@ int __must_check cf_check vtd_flush_context_reg(
     uint8_t function_mask, uint64_t type, bool flush_non_present_entry);
 int __must_check cf_check vtd_flush_iotlb_reg(
     struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
-    unsigned int size_order, uint64_t type, bool flush_non_present_entry,
-    bool flush_dev_iotlb);
+    unsigned int size_order, uint64_t type, bool flush_non_present_entry);
 
 struct vtd_iommu *ioapic_to_iommu(unsigned int apic_id);
 struct vtd_iommu *hpet_to_iommu(unsigned int hpet_id);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 53e9165fc7..e7049456bf 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -569,8 +569,7 @@ static int __must_check iommu_flush_context_device(struct vtd_iommu *iommu,
 /* return value determine if we need a write buffer flush */
 int cf_check vtd_flush_iotlb_reg(
     struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
-    unsigned int size_order, uint64_t type, bool flush_non_present_entry,
-    bool flush_dev_iotlb)
+    unsigned int size_order, uint64_t type, bool flush_non_present_entry)
 {
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
     uint64_t val = type | DMA_TLB_IVT;
@@ -635,7 +634,7 @@ static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH,
-                                flush_non_present_entry, iommu->flush_dev_iotlb);
+                                flush_non_present_entry);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -652,7 +651,7 @@ static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH,
-                                flush_non_present_entry, iommu->flush_dev_iotlb);
+                                flush_non_present_entry);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -678,7 +677,7 @@ static int __must_check iommu_flush_iotlb_psi(struct vtd_iommu *iommu, u16 did,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, addr, order, DMA_TLB_PSI_FLUSH,
-                                flush_non_present_entry, iommu->flush_dev_iotlb);
+                                flush_non_present_entry);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 0d96b76bce..ccb00889d7 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -502,8 +502,7 @@ struct vtd_iommu {
                                     bool non_present_entry_flush);
         int __must_check (*iotlb)(struct vtd_iommu *iommu, u16 did, u64 addr,
                                   unsigned int size_order, u64 type,
-                                  bool flush_non_present_entry,
-                                  bool flush_dev_iotlb);
+                                  bool flush_non_present_entry);
     } flush;
 
     struct list_head ats_devices;
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index c79927b09f..1dde44b105 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -452,7 +452,7 @@ static int __must_check cf_check flush_context_qi(
 
 static int __must_check cf_check flush_iotlb_qi(
     struct vtd_iommu *iommu, u16 did, u64 addr, unsigned int size_order,
-    u64 type, bool flush_non_present_entry, bool flush_dev_iotlb)
+    u64 type, bool flush_non_present_entry)
 {
     u8 dr = 0, dw = 0;
     int ret = 0, rc;
@@ -478,7 +478,7 @@ static int __must_check cf_check flush_iotlb_qi(
     if ( !ret )
         ret = rc;
 
-    if ( flush_dev_iotlb )
+    if ( iommu->flush_dev_iotlb )
     {
         rc = dev_invalidate_iotlb(iommu, did, addr, size_order, type);
         if ( !ret )
@@ -573,8 +573,7 @@ static int cf_check vtd_flush_context_noop(
 
 static int cf_check vtd_flush_iotlb_noop(
     struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
-    unsigned int size_order, uint64_t type, bool flush_non_present_entry,
-    bool flush_dev_iotlb)
+    unsigned int size_order, uint64_t type, bool flush_non_present_entry)
 {
     WARN();
     return -EIO;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 07:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 07:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197317.1514881 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdkM9-0001G1-LO; Thu, 08 Jan 2026 07:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197317.1514881; Thu, 08 Jan 2026 07: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 1vdkM9-0001Ft-Ix; Thu, 08 Jan 2026 07:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1197317;
 Thu, 08 Jan 2026 07: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 1vdkM8-0001Fl-7M
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 07: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 1vdkM7-00Espq-2w
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdkM8-00DeG8-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 07: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=Le5de4LtTaQc54Tqv/1BY33zyDpKG3C+aNs/xxQIL2I=; b=VhwdWlHXJxFCevvTW5Jw6IBkNx
	kxLj4dasr9pw+dMjcX1wp2PrN8WrVaC5MuSNEL4uWyrf9etYr6srfqX0ZPFeZvZcBTe3jdikk2tJl
	YQYA4ZGwJUuiACR413HKZ5/QpolHQilTh/BziXC06aPl0CsCx3xPpOHG6P4jCxhSrEqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI/ATS: tidy {en,dis}able_ats_device() a little
Message-Id: <E1vdkM8-00DeG8-0U@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 07:22:52 +0000

commit 31bebd739bfe6ac2c33ff5bfa4b4c2bac2cc670b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 16:00:37 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    PCI/ATS: tidy {en,dis}able_ats_device() a little
    
    Use appropriate types for the control register value as well as the
    capability position. Constify a pointer. Use "else" in favor of encoding
    the opposite condition of the earlier if().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/ats.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/ats.c b/xen/drivers/passthrough/ats.c
index 0da183d057..c20bfc8ee7 100644
--- a/xen/drivers/passthrough/ats.c
+++ b/xen/drivers/passthrough/ats.c
@@ -23,10 +23,9 @@ boolean_param("ats", ats_enabled);
 
 int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
 {
-    u32 value;
-    int pos;
+    uint16_t value;
+    unsigned int pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
     BUG_ON(!pos);
 
     if ( iommu_verbose )
@@ -35,7 +34,7 @@ int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
     value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CTL);
     if ( value & ATS_ENABLE )
     {
-        struct pci_dev *other;
+        const struct pci_dev *other;
 
         list_for_each_entry ( other, ats_list, ats.list )
             if ( other == pdev )
@@ -44,8 +43,7 @@ int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
                 break;
             }
     }
-
-    if ( !(value & ATS_ENABLE) )
+    else
     {
         value |= ATS_ENABLE;
         pci_conf_write16(pdev->sbdf, pos + ATS_REG_CTL, value);
@@ -69,7 +67,7 @@ int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
 
 void disable_ats_device(struct pci_dev *pdev)
 {
-    u32 value;
+    uint16_t value;
 
     BUG_ON(!pdev->ats.cap_pos);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 11:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 11:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197594.1515077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdo5a-0006qm-Vr; Thu, 08 Jan 2026 11:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197594.1515077; Thu, 08 Jan 2026 11: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 1vdo5a-0006qe-Sw; Thu, 08 Jan 2026 11:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1197594;
 Thu, 08 Jan 2026 11: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 1vdo5Z-0006qY-TN
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 11: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 1vdo5Z-00ExxK-1X
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 11:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdo5Z-00DuGB-2I
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 11: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=QOD7ArstBkbZzo9hS1OOgPshFLYjRNXgpFgInMA9AO8=; b=GvDGNlD1SzQ6smX9jG7O+VZFmX
	BFbgtqeqnvRCakHdYmubro9dPfy1ym25cUkQH6Vtq+AHQytw+eNkwXJ+x8XH5G9Mvyr7ZX3lrIuS+
	FtIt/+hpaTY3YI0xpZhE02W1mtvLqqwENWeeMh3CwsGaOpUCC+zHbLXtvkZwHzGZbiIw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vdo5Z-00DuGB-2I@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 11:22:01 +0000

commit c9491ea21a433168ef69639183a01848877cea14
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Dec 4 19:22:40 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Jan 8 11:05:30 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 2433230ac7..759f3273d3 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2015,11 +2015,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 11:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 11:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197595.1515081 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdo5l-0006sZ-0p; Thu, 08 Jan 2026 11:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197595.1515081; Thu, 08 Jan 2026 11: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 1vdo5k-0006sR-UV; Thu, 08 Jan 2026 11:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1197595;
 Thu, 08 Jan 2026 11: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 1vdo5j-0006sH-Se
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 11: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 1vdo5j-00Exxn-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 11:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdo5j-00DuGz-2e
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 11: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=Y9r0Qwf3aunzHF5zpGkbzuGwP+o/NvP3ZigjJTacQ6M=; b=enTdMXfLtCWBcMpAFwrXIdlzBB
	dgnRMF3XaAAFsAZrMGB8RM5QkVjJEdUSsQx4pYikQfahSIBMH/o/s/uUB6l763LAFthb1sMlXwMCF
	D9NOOsPmoxrs3BK/yeltZ015PWmuuWyMsHOmFeMWEVvBEMS2mYyhYaaO4DTIYSzIHRjY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vdo5j-00DuGz-2e@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 11:22:11 +0000

commit 75d29d9b5e226bafa0fbf9fba25623229660b81e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Dec 22 12:16:13 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Jan 8 11:05:30 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c | 55 +++++++++++++++++++++++++------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1f67b88a89..2efc11ce09 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -515,30 +515,6 @@ unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->outstanding_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages || pages <= 0 )
-        goto out;
-
-    spin_lock(&heap_lock);
-    BUG_ON(outstanding_claims < d->outstanding_pages);
-    if ( d->outstanding_pages < pages )
-    {
-        /* `pages` exceeds the domain's outstanding count. Zero it out. */
-        outstanding_claims -= d->outstanding_pages;
-        d->outstanding_pages = 0;
-    }
-    else
-    {
-        outstanding_claims -= pages;
-        d->outstanding_pages -= pages;
-    }
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -548,9 +524,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1071,6 +1048,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1f77e0869b..d922c908c2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -413,7 +413,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 11:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 11:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197596.1515088 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdo5v-0006v6-32; Thu, 08 Jan 2026 11:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197596.1515088; Thu, 08 Jan 2026 11: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 1vdo5u-0006uv-Vv; Thu, 08 Jan 2026 11:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1197596;
 Thu, 08 Jan 2026 11: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 1vdo5t-0006up-Vi
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 11:22: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 1vdo5t-00Exxt-28
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 11:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdo5t-00DuHS-2w
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 11:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l3HXHnLkEB7J4+tG7SRCPUwm233hO03wDNynMzzo8Zo=; b=xxf1SQjEzI4ALaNivzeqlp2OIm
	RtjGhcY3a6jAwrjhgQxHP1BLnN70Ad6Xtq/02IiLZoWRMWxOV+upLJiZA2okiiwRoe6kYPn/HWC5g
	GkFQ4ZkYeJSkMheg+GELUnh+pH3lwlyEsPQ4kl9DEmlAok7ZiAFUuvklf03pc20LWsYI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vdo5t-00DuHS-2w@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 11:22:21 +0000

commit bdd5f35cf20c7397a7f74fb80446c136688e3145
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 8 10:16:55 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Jan 8 11:05:30 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 7eccadf7aa..d69a83b089 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1310,7 +1310,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:11:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197657.1515122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpn4-0004Dm-6R; Thu, 08 Jan 2026 13:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197657.1515122; Thu, 08 Jan 2026 13: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 1vdpn4-0004De-3c; Thu, 08 Jan 2026 13:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1197657;
 Thu, 08 Jan 2026 13: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 1vdpn3-0004DY-IF
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13: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 1vdpn3-00F065-0i
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpn3-00E2ho-1U
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13: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=y2h5HBgP9DxqekgnMA1K30hiABzfBEFNaPenHjJ8nYU=; b=BTw5hjN64coz4QNYv0Sjt4AHzo
	Ui4nHmAGZG9hVGza8Q80YK0AQ5K4XJJywwJSCDOVlJZdhmBZw8owRSJ7HQb11FIaXmLVkcIYg1j6U
	lFueYWLsVCZgIcZBZvUpnpjFMe8sWc4bFKnY0CyMqX+TXFmyhWNzCkpyTjN3VhPApLZ4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: replace find_ats_dev_drhd()
Message-Id: <E1vdpn3-00E2ho-1U@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:11:01 +0000

commit 050db338376370cf1dc453f64a0dfc5e329a139a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:58:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: replace find_ats_dev_drhd()
    
    All callers only care about boolean outcome. For this there's no point
    in allocating a duplicate of the respective DRHD structure; a simple
    boolean suffices (which eventually may want to become a count, such that
    the "any ATS devices assigned state" can also clear again). With that
    boolean, remove respective parameters from internal helper functions
    right away, as those have access to the flag through another parameter.
    (While the corresponding hook can have the parameter dropped too then,
    leave this for a separate change, to limit scope here.)
    
    No functional effect intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h  |  2 --
 xen/drivers/passthrough/vtd/iommu.c   | 41 +++++++++++------------------------
 xen/drivers/passthrough/vtd/iommu.h   |  1 +
 xen/drivers/passthrough/vtd/x86/ats.c | 25 ++-------------------
 4 files changed, 16 insertions(+), 53 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index c16583c951..74e12a2e50 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -65,8 +65,6 @@ struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
 struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id);
 struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
-struct acpi_drhd_unit *find_ats_dev_drhd(struct vtd_iommu *iommu);
-
 int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
 
 int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 90f36ac22b..79874aaa22 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -627,8 +627,7 @@ int cf_check vtd_flush_iotlb_reg(
 }
 
 static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
-                                                 bool flush_non_present_entry,
-                                                 bool flush_dev_iotlb)
+                                                 bool flush_non_present_entry)
 {
     int status;
 
@@ -636,7 +635,7 @@ static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH,
-                                flush_non_present_entry, flush_dev_iotlb);
+                                flush_non_present_entry, iommu->flush_dev_iotlb);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -645,8 +644,7 @@ static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
 }
 
 static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
-                                              bool flush_non_present_entry,
-                                              bool flush_dev_iotlb)
+                                              bool flush_non_present_entry)
 {
     int status;
 
@@ -654,7 +652,7 @@ static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH,
-                                flush_non_present_entry, flush_dev_iotlb);
+                                flush_non_present_entry, iommu->flush_dev_iotlb);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -664,26 +662,23 @@ static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
 
 static int __must_check iommu_flush_iotlb_psi(struct vtd_iommu *iommu, u16 did,
                                               u64 addr, unsigned int order,
-                                              bool flush_non_present_entry,
-                                              bool flush_dev_iotlb)
+                                              bool flush_non_present_entry)
 {
     int status;
 
     /* Fallback to domain selective flush if no PSI support */
     if ( !cap_pgsel_inv(iommu->cap) )
-        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry,
-                                     flush_dev_iotlb);
+        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry);
 
     /* Fallback to domain selective flush if size is too big */
     if ( order > cap_max_amask_val(iommu->cap) )
-        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry,
-                                     flush_dev_iotlb);
+        return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry);
 
     /* apply platform specific errata workarounds */
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, addr, order, DMA_TLB_PSI_FLUSH,
-                                flush_non_present_entry, flush_dev_iotlb);
+                                flush_non_present_entry, iommu->flush_dev_iotlb);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -695,7 +690,6 @@ static int __must_check iommu_flush_all(void)
 {
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
-    bool flush_dev_iotlb;
     int rc = 0;
 
     if ( iommu_non_coherent )
@@ -707,8 +701,7 @@ static int __must_check iommu_flush_all(void)
 
         iommu = drhd->iommu;
         context_rc = iommu_flush_context_global(iommu, 0);
-        flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
-        iotlb_rc = iommu_flush_iotlb_global(iommu, 0, flush_dev_iotlb);
+        iotlb_rc = iommu_flush_iotlb_global(iommu, 0);
 
         /*
          * The current logic for returns:
@@ -738,7 +731,6 @@ static int __must_check cf_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
     struct domain_iommu *hd = dom_iommu(d);
     struct acpi_drhd_unit *drhd;
     struct vtd_iommu *iommu;
-    bool flush_dev_iotlb;
     int iommu_domid;
     int ret = 0;
 
@@ -766,21 +758,18 @@ static int __must_check cf_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
         if ( !test_bit(iommu->index, hd->arch.vtd.iommu_bitmap) )
             continue;
 
-        flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
         iommu_domid = get_iommu_did(d->domain_id, iommu, !d->is_dying);
         if ( iommu_domid == -1 )
             continue;
 
         if ( !page_count || (page_count & (page_count - 1)) ||
              dfn_eq(dfn, INVALID_DFN) || !IS_ALIGNED(dfn_x(dfn), page_count) )
-            rc = iommu_flush_iotlb_dsi(iommu, iommu_domid,
-                                       0, flush_dev_iotlb);
+            rc = iommu_flush_iotlb_dsi(iommu, iommu_domid, 0);
         else
             rc = iommu_flush_iotlb_psi(iommu, iommu_domid,
                                        dfn_to_daddr(dfn),
                                        get_order_from_pages(page_count),
-                                       !(flush_flags & IOMMU_FLUSHF_modified),
-                                       flush_dev_iotlb);
+                                       !(flush_flags & IOMMU_FLUSHF_modified));
 
         if ( rc > 0 )
             iommu_flush_write_buffer(iommu);
@@ -1491,7 +1480,6 @@ int domain_context_mapping_one(
     uint16_t seg = iommu->drhd->segment, prev_did = 0;
     struct domain *prev_dom = NULL;
     int rc, ret;
-    bool flush_dev_iotlb;
 
     if ( QUARANTINE_SKIP(domain, pgd_maddr) )
         return 0;
@@ -1613,8 +1601,7 @@ int domain_context_mapping_one(
 
     rc = iommu_flush_context_device(iommu, prev_did, PCI_BDF(bus, devfn),
                                     DMA_CCMD_MASK_NOBIT, !prev_dom);
-    flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
-    ret = iommu_flush_iotlb_dsi(iommu, prev_did, !prev_dom, flush_dev_iotlb);
+    ret = iommu_flush_iotlb_dsi(iommu, prev_did, !prev_dom);
 
     /*
      * The current logic for returns:
@@ -1852,7 +1839,6 @@ int domain_context_unmap_one(
     struct context_entry *context, *context_entries;
     u64 maddr;
     int iommu_domid, rc, ret;
-    bool flush_dev_iotlb;
 
     ASSERT(pcidevs_locked());
     spin_lock(&iommu->lock);
@@ -1884,8 +1870,7 @@ int domain_context_unmap_one(
                                     PCI_BDF(bus, devfn),
                                     DMA_CCMD_MASK_NOBIT, 0);
 
-    flush_dev_iotlb = !!find_ats_dev_drhd(iommu);
-    ret = iommu_flush_iotlb_dsi(iommu, iommu_domid, 0, flush_dev_iotlb);
+    ret = iommu_flush_iotlb_dsi(iommu, iommu_domid, 0);
 
     /*
      * The current logic for returns:
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 4f41360c53..0d96b76bce 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -484,6 +484,7 @@ struct vtd_iommu {
     spinlock_t register_lock; /* protect iommu register handling */
     u64 root_maddr; /* root entry machine address */
     nodeid_t node;
+    bool flush_dev_iotlb;
     struct msi_desc msi;
     struct acpi_drhd_unit *drhd;
 
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index 61052ef580..d728057a5f 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -28,22 +28,8 @@
 #include "../extern.h"
 #include "../../ats.h"
 
-static LIST_HEAD(ats_dev_drhd_units);
-
-struct acpi_drhd_unit *find_ats_dev_drhd(struct vtd_iommu *iommu)
-{
-    struct acpi_drhd_unit *drhd;
-    list_for_each_entry ( drhd, &ats_dev_drhd_units, list )
-    {
-        if ( drhd->iommu == iommu )
-            return drhd;
-    }
-    return NULL;
-}
-
 int ats_device(const struct pci_dev *pdev, const struct acpi_drhd_unit *drhd)
 {
-    struct acpi_drhd_unit *ats_drhd;
     unsigned int pos, expfl = 0;
 
     if ( !ats_enabled || !iommu_qinval )
@@ -61,17 +47,10 @@ int ats_device(const struct pci_dev *pdev, const struct acpi_drhd_unit *drhd)
          !acpi_find_matched_atsr_unit(pdev) )
         return 0;
 
-    ats_drhd = find_ats_dev_drhd(drhd->iommu);
     pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    if ( pos )
+        drhd->iommu->flush_dev_iotlb = true;
 
-    if ( pos && (ats_drhd == NULL) )
-    {
-        ats_drhd = xmalloc(struct acpi_drhd_unit);
-        if ( !ats_drhd )
-            return -ENOMEM;
-        *ats_drhd = *drhd;
-        list_add_tail(&ats_drhd->list, &ats_dev_drhd_units);
-    }
     return pos;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197658.1515126 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpnF-0004FY-7a; Thu, 08 Jan 2026 13:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197658.1515126; Thu, 08 Jan 2026 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 1vdpnF-0004FO-52; Thu, 08 Jan 2026 13:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1197658;
 Thu, 08 Jan 2026 13: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 1vdpnD-0004F6-NR
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13: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 1vdpnD-00F06c-1H
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpnD-00E2ie-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13: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=jHUMws4/RLGzd8fDeSkhQ6wnnZN9DI4WZcg69HxZXTE=; b=lKXZEa0QbeqKDVCI2SZeDbT9ng
	IBVEU1t/dzrQyOMxsMIghMRPR5fLKsULOR61/SwrpmxifYXACDFDlXs15EiLTYXrXnmqg1ox2KTzb
	b8jwV0mvexFjUJWMS+ZU9qklgrTaHJLAqLiQ4dWi9UJ0svksMf5C0K1A3oZCG/rGSBp4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: move ats_device() to the sole file it's used from
Message-Id: <E1vdpnD-00E2ie-1p@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:11:11 +0000

commit f3759045b0391af5fd51f3086240ac9c1e1723de
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:59:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: move ats_device() to the sole file it's used from
    
    ..., thus allowing it to become static, and thus reducing scope overlap
    between it and pci_ats_device(). There's nothing x86-specific about this
    function anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h  |  2 --
 xen/drivers/passthrough/vtd/iommu.c   | 27 +++++++++++++++++++++++++++
 xen/drivers/passthrough/vtd/x86/ats.c | 26 --------------------------
 3 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 74e12a2e50..f621bf84db 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -65,8 +65,6 @@ struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
 struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id);
 struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
-int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
-
 int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
                          u64 addr, unsigned int size_order, u64 type);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 79874aaa22..53e9165fc7 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1458,6 +1458,33 @@ static void __hwdom_init cf_check intel_iommu_hwdom_init(struct domain *d)
     }
 }
 
+static int ats_device(const struct pci_dev *pdev,
+                      const struct acpi_drhd_unit *drhd)
+{
+    unsigned int pos, expfl = 0;
+
+    if ( !ats_enabled || !iommu_qinval )
+        return 0;
+
+    if ( !ecap_queued_inval(drhd->iommu->ecap) ||
+         !ecap_dev_iotlb(drhd->iommu->ecap) )
+        return 0;
+
+    pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_EXP);
+    if ( pos )
+        expfl = pci_conf_read16(pdev->sbdf, pos + PCI_EXP_FLAGS);
+
+    if ( MASK_EXTR(expfl, PCI_EXP_FLAGS_TYPE) != PCI_EXP_TYPE_RC_END &&
+         !acpi_find_matched_atsr_unit(pdev) )
+        return 0;
+
+    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    if ( pos )
+        drhd->iommu->flush_dev_iotlb = true;
+
+    return pos;
+}
+
 /*
  * This function returns
  * - a negative errno value upon error,
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index d728057a5f..5292505740 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -28,32 +28,6 @@
 #include "../extern.h"
 #include "../../ats.h"
 
-int ats_device(const struct pci_dev *pdev, const struct acpi_drhd_unit *drhd)
-{
-    unsigned int pos, expfl = 0;
-
-    if ( !ats_enabled || !iommu_qinval )
-        return 0;
-
-    if ( !ecap_queued_inval(drhd->iommu->ecap) ||
-         !ecap_dev_iotlb(drhd->iommu->ecap) )
-        return 0;
-
-    pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_EXP);
-    if ( pos )
-        expfl = pci_conf_read16(pdev->sbdf, pos + PCI_EXP_FLAGS);
-
-    if ( MASK_EXTR(expfl, PCI_EXP_FLAGS_TYPE) != PCI_EXP_TYPE_RC_END &&
-         !acpi_find_matched_atsr_unit(pdev) )
-        return 0;
-
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
-    if ( pos )
-        drhd->iommu->flush_dev_iotlb = true;
-
-    return pos;
-}
-
 static bool device_in_domain(const struct vtd_iommu *iommu,
                              const struct pci_dev *pdev, uint16_t did)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197659.1515130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpnP-0004IC-AP; Thu, 08 Jan 2026 13:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197659.1515130; Thu, 08 Jan 2026 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 1vdpnP-0004I3-6I; Thu, 08 Jan 2026 13:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1197659;
 Thu, 08 Jan 2026 13:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdpnN-0004Hn-Ph
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpnN-00F06i-1X
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpnN-00E2k8-2N
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13: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=X2SyglRqaORpforacWeUF+NONySnPiaG5ovxbHKt56Y=; b=UAO280vPB4IOs+g4hDxr2LtEx0
	mvB9lze2lSDU7XyyskxF+TTtfAbCI+RU1q0SCLdZujamAQZSX8atIy/CfwrUgOMnN0fgIgTuqV7C0
	EaU2cGuaPa8QPjKu5EuzVFYEKVZPQ/XWNdmz4Lkvx2aGhvyue7xoeYNbgth+4lB83fZo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: move dev_invalidate_iotlb() to the sole file it's used from
Message-Id: <E1vdpnN-00E2k8-2N@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:11:21 +0000

commit 15b90f90b4452f36d10bbcefd2444c3fb801cbbc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:59:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: move dev_invalidate_iotlb() to the sole file it's used from
    
    ..., thus allowing it and qinval_device_iotlb_sync() to become static.
    There's nothing x86-specific about the function anyway. While moving,
    adjust types to better match ./CODING_STYLE (albeit use of fixed-width
    types for parameters is retained to limit the effective change).
    
    Append a UL to a constant while moving, to please Misra. Also insert
    blank lines in the switch(), between non-fall-through case blocks.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h     |   6 --
 xen/drivers/passthrough/vtd/qinval.c     | 102 ++++++++++++++++++++++++-
 xen/drivers/passthrough/vtd/x86/Makefile |   1 -
 xen/drivers/passthrough/vtd/x86/ats.c    | 123 -------------------------------
 4 files changed, 100 insertions(+), 132 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index f621bf84db..4df26df6d4 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -65,12 +65,6 @@ struct acpi_drhd_unit *ioapic_to_drhd(unsigned int apic_id);
 struct acpi_drhd_unit *hpet_to_drhd(unsigned int hpet_id);
 struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
-int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
-                         u64 addr, unsigned int size_order, u64 type);
-
-int __must_check qinval_device_iotlb_sync(struct vtd_iommu *iommu,
-                                          struct pci_dev *pdev,
-                                          u16 did, u16 size, u64 addr);
 
 uint64_t alloc_pgtable_maddr(unsigned long npages, nodeid_t node);
 void free_pgtable_maddr(u64 maddr);
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 036f3e8505..c79927b09f 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -251,8 +251,9 @@ static int __must_check dev_invalidate_sync(struct vtd_iommu *iommu,
     return rc;
 }
 
-int qinval_device_iotlb_sync(struct vtd_iommu *iommu, struct pci_dev *pdev,
-                             u16 did, u16 size, u64 addr)
+static int qinval_device_iotlb_sync(struct vtd_iommu *iommu,
+                                    struct pci_dev *pdev, uint16_t did,
+                                    uint16_t size, paddr_t addr)
 {
     unsigned long flags;
     unsigned int index;
@@ -282,6 +283,103 @@ int qinval_device_iotlb_sync(struct vtd_iommu *iommu, struct pci_dev *pdev,
     return dev_invalidate_sync(iommu, pdev, did);
 }
 
+static bool device_in_domain(const struct vtd_iommu *iommu,
+                             const struct pci_dev *pdev, uint16_t did)
+{
+    struct root_entry *root_entry;
+    struct context_entry *ctxt_entry = NULL;
+    unsigned int tt;
+    bool found = false;
+
+    if ( unlikely(!iommu->root_maddr) )
+    {
+        ASSERT_UNREACHABLE();
+        return false;
+    }
+
+    root_entry = map_vtd_domain_page(iommu->root_maddr);
+    if ( !root_present(root_entry[pdev->bus]) )
+        goto out;
+
+    ctxt_entry = map_vtd_domain_page(root_entry[pdev->bus].val);
+    if ( context_domain_id(ctxt_entry[pdev->devfn]) != did )
+        goto out;
+
+    tt = context_translation_type(ctxt_entry[pdev->devfn]);
+    if ( tt != CONTEXT_TT_DEV_IOTLB )
+        goto out;
+
+    found = true;
+ out:
+    if ( root_entry )
+        unmap_vtd_domain_page(root_entry);
+
+    if ( ctxt_entry )
+        unmap_vtd_domain_page(ctxt_entry);
+
+    return found;
+}
+
+static int dev_invalidate_iotlb(struct vtd_iommu *iommu, uint16_t did,
+                                paddr_t addr, unsigned int size_order,
+                                uint64_t type)
+{
+    struct pci_dev *pdev, *temp;
+    int ret = 0;
+
+    if ( !ecap_dev_iotlb(iommu->ecap) )
+        return ret;
+
+    list_for_each_entry_safe ( pdev, temp, &iommu->ats_devices, ats.list )
+    {
+        bool sbit;
+        int rc = 0;
+
+        switch ( type )
+        {
+        case DMA_TLB_DSI_FLUSH:
+            if ( !device_in_domain(iommu, pdev, did) )
+                break;
+            /* fall through if DSI condition met */
+        case DMA_TLB_GLOBAL_FLUSH:
+            /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
+            sbit = 1;
+            addr = (~0UL << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFFUL;
+            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
+            break;
+
+        case DMA_TLB_PSI_FLUSH:
+            if ( !device_in_domain(iommu, pdev, did) )
+                break;
+
+            /* if size <= 4K, set sbit = 0, else set sbit = 1 */
+            sbit = size_order ? 1 : 0;
+
+            /* clear lower bits */
+            addr &= ~0UL << PAGE_SHIFT_4K;
+
+            /* if sbit == 1, zero out size_order bit and set lower bits to 1 */
+            if ( sbit )
+            {
+                addr &= ~((u64)PAGE_SIZE_4K << (size_order - 1));
+                addr |= (((u64)1 << (size_order - 1)) - 1) << PAGE_SHIFT_4K;
+            }
+
+            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
+            break;
+
+        default:
+            dprintk(XENLOG_WARNING VTDPREFIX, "invalid vt-d flush type\n");
+            return -EOPNOTSUPP;
+        }
+
+        if ( !ret )
+            ret = rc;
+    }
+
+    return ret;
+}
+
 static int __must_check queue_invalidate_iec_sync(struct vtd_iommu *iommu,
                                                   u8 granu, u8 im, u16 iidx)
 {
diff --git a/xen/drivers/passthrough/vtd/x86/Makefile b/xen/drivers/passthrough/vtd/x86/Makefile
index fe20a0b019..85243e3aa7 100644
--- a/xen/drivers/passthrough/vtd/x86/Makefile
+++ b/xen/drivers/passthrough/vtd/x86/Makefile
@@ -1,2 +1 @@
-obj-y += ats.o
 obj-y += vtd.o
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
deleted file mode 100644
index 5292505740..0000000000
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2006, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Allen Kay <allen.m.kay@intel.com>
- */
-
-#include <xen/sched.h>
-#include <xen/iommu.h>
-#include <xen/time.h>
-#include <xen/pci.h>
-#include <xen/pci_regs.h>
-#include <asm/msi.h>
-#include "../iommu.h"
-#include "../dmar.h"
-#include "../vtd.h"
-#include "../extern.h"
-#include "../../ats.h"
-
-static bool device_in_domain(const struct vtd_iommu *iommu,
-                             const struct pci_dev *pdev, uint16_t did)
-{
-    struct root_entry *root_entry;
-    struct context_entry *ctxt_entry = NULL;
-    unsigned int tt;
-    bool found = false;
-
-    if ( unlikely(!iommu->root_maddr) )
-    {
-        ASSERT_UNREACHABLE();
-        return false;
-    }
-
-    root_entry = map_vtd_domain_page(iommu->root_maddr);
-    if ( !root_present(root_entry[pdev->bus]) )
-        goto out;
-
-    ctxt_entry = map_vtd_domain_page(root_entry[pdev->bus].val);
-    if ( context_domain_id(ctxt_entry[pdev->devfn]) != did )
-        goto out;
-
-    tt = context_translation_type(ctxt_entry[pdev->devfn]);
-    if ( tt != CONTEXT_TT_DEV_IOTLB )
-        goto out;
-
-    found = true;
-out:
-    if ( root_entry )
-        unmap_vtd_domain_page(root_entry);
-
-    if ( ctxt_entry )
-        unmap_vtd_domain_page(ctxt_entry);
-
-    return found;
-}
-
-int dev_invalidate_iotlb(struct vtd_iommu *iommu, u16 did,
-    u64 addr, unsigned int size_order, u64 type)
-{
-    struct pci_dev *pdev, *temp;
-    int ret = 0;
-
-    if ( !ecap_dev_iotlb(iommu->ecap) )
-        return ret;
-
-    list_for_each_entry_safe( pdev, temp, &iommu->ats_devices, ats.list )
-    {
-        bool sbit;
-        int rc = 0;
-
-        switch ( type )
-        {
-        case DMA_TLB_DSI_FLUSH:
-            if ( !device_in_domain(iommu, pdev, did) )
-                break;
-            /* fall through if DSI condition met */
-        case DMA_TLB_GLOBAL_FLUSH:
-            /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
-            sbit = 1;
-            addr = (~0UL << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFF;
-            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
-            break;
-        case DMA_TLB_PSI_FLUSH:
-            if ( !device_in_domain(iommu, pdev, did) )
-                break;
-
-            /* if size <= 4K, set sbit = 0, else set sbit = 1 */
-            sbit = size_order ? 1 : 0;
-
-            /* clear lower bits */
-            addr &= ~0UL << PAGE_SHIFT_4K;
-
-            /* if sbit == 1, zero out size_order bit and set lower bits to 1 */
-            if ( sbit )
-            {
-                addr &= ~((u64)PAGE_SIZE_4K << (size_order - 1));
-                addr |= (((u64)1 << (size_order - 1)) - 1) << PAGE_SHIFT_4K;
-            }
-
-            rc = qinval_device_iotlb_sync(iommu, pdev, did, sbit, addr);
-            break;
-        default:
-            dprintk(XENLOG_WARNING VTDPREFIX, "invalid vt-d flush type\n");
-            return -EOPNOTSUPP;
-        }
-
-        if ( !ret )
-            ret = rc;
-    }
-
-    return ret;
-}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197660.1515133 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpnZ-0004Kr-Bc; Thu, 08 Jan 2026 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197660.1515133; Thu, 08 Jan 2026 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 1vdpnZ-0004Kk-8y; Thu, 08 Jan 2026 13:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1197660;
 Thu, 08 Jan 2026 13:11:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdpnX-0004Ka-Sw
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13:11:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpnX-00F06q-1r
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpnX-00E2kn-2f
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1g7ENARXtEHC5TYYTwYxsBHKjrV+9dDEQIA3/FqBiv8=; b=IekNLNdPVuEBlJO4cmMwDb0nRc
	vbYD4+9lNXxluzwiQ+JdnQC0ThuL6qOqAKgxnt0/BMq7rGuJP+UMYu/dr5Tu9sf53k+OsWJkngUAB
	eYtu6EmhG1sJtlr6ksuTm4vdGvDPDVMrKvq5goc4h1HeA2Uv9yIZeFhpi9zV9pgXsmfU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: move {,un}map_vtd_domain_page()
Message-Id: <E1vdpnX-00E2kn-2f@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:11:31 +0000

commit 227475c278699a62bfcf7d3a19349efe47f30712
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 15:59:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: move {,un}map_vtd_domain_page()
    
    ..., thus allowing them to become static. There's nothing x86-specific
    about these functions anyway.
    
    Since only the "iommu_inclusive_mapping" parameter declaration would be
    left in the file, move that as well. There's nothing VT-d specific about
    it (anymore?): "dom0-iommu=map-inclusive" is similarly generic, and
    documentation also doesn't say anything.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 docs/misc/xen-command-line.pandoc        |  2 +-
 xen/drivers/passthrough/vtd/Makefile     |  2 --
 xen/drivers/passthrough/vtd/extern.h     | 13 +++++++--
 xen/drivers/passthrough/vtd/x86/Makefile |  1 -
 xen/drivers/passthrough/vtd/x86/vtd.c    | 48 --------------------------------
 xen/drivers/passthrough/x86/iommu.c      |  7 +++++
 6 files changed, 19 insertions(+), 54 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 805da22c44..bbbdf6a5bb 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1651,7 +1651,7 @@ Specify the timeout of the device IOTLB invalidation in milliseconds.
 By default, the timeout is 1000 ms. When you see error 'Queue invalidate
 wait descriptor timed out', try increasing this value.
 
-### iommu_inclusive_mapping
+### iommu_inclusive_mapping (x86)
 > `= <boolean>`
 
 **WARNING: This command line option is deprecated, and superseded by
diff --git a/xen/drivers/passthrough/vtd/Makefile b/xen/drivers/passthrough/vtd/Makefile
index fde7555fac..3204546f11 100644
--- a/xen/drivers/passthrough/vtd/Makefile
+++ b/xen/drivers/passthrough/vtd/Makefile
@@ -1,5 +1,3 @@
-obj-$(CONFIG_X86) += x86/
-
 obj-y += iommu.o
 obj-y += dmar.o
 obj-y += utils.o
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 4df26df6d4..65f81a8bf1 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -21,6 +21,7 @@
 #define DRIVERS__PASSTHROUGH__VTD__EXTERN_H
 
 #include "dmar.h"
+#include <xen/domain_page.h>
 #include <xen/keyhandler.h>
 
 #define VTDPREFIX "[VT-D]"
@@ -68,8 +69,6 @@ struct acpi_rhsa_unit *drhd_to_rhsa(const struct acpi_drhd_unit *drhd);
 
 uint64_t alloc_pgtable_maddr(unsigned long npages, nodeid_t node);
 void free_pgtable_maddr(u64 maddr);
-void *map_vtd_domain_page(u64 maddr);
-void unmap_vtd_domain_page(const void *va);
 int domain_context_mapping_one(struct domain *domain, struct vtd_iommu *iommu,
                                uint8_t bus, uint8_t devfn,
                                const struct pci_dev *pdev, domid_t domid,
@@ -79,6 +78,16 @@ int domain_context_unmap_one(struct domain *domain, struct vtd_iommu *iommu,
 int cf_check intel_iommu_get_reserved_device_memory(
     iommu_grdm_t *func, void *ctxt);
 
+static inline void *map_vtd_domain_page(paddr_t maddr)
+{
+    return map_domain_page(_mfn(paddr_to_pfn(maddr)));
+}
+
+static inline void unmap_vtd_domain_page(const void *va)
+{
+    unmap_domain_page(va);
+}
+
 unsigned int cf_check io_apic_read_remap_rte(
     unsigned int apic, unsigned int reg);
 void cf_check io_apic_write_remap_rte(
diff --git a/xen/drivers/passthrough/vtd/x86/Makefile b/xen/drivers/passthrough/vtd/x86/Makefile
deleted file mode 100644
index 85243e3aa7..0000000000
--- a/xen/drivers/passthrough/vtd/x86/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-obj-y += vtd.o
diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c
deleted file mode 100644
index 76f12adc23..0000000000
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2008, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) Allen Kay <allen.m.kay@intel.com>
- * Copyright (C) Weidong Han <weidong.han@intel.com>
- */
-
-#include <xen/param.h>
-#include <xen/sched.h>
-#include <xen/softirq.h>
-#include <xen/domain_page.h>
-#include <asm/paging.h>
-#include <xen/iommu.h>
-#include <xen/irq.h>
-#include <xen/numa.h>
-#include <asm/fixmap.h>
-#include "../iommu.h"
-#include "../dmar.h"
-#include "../vtd.h"
-#include "../extern.h"
-
-/*
- * iommu_inclusive_mapping: when set, all memory below 4GB is included in dom0
- * 1:1 iommu mappings except xen and unusable regions.
- */
-boolean_param("iommu_inclusive_mapping", iommu_hwdom_inclusive);
-
-void *map_vtd_domain_page(u64 maddr)
-{
-    return map_domain_page(_mfn(paddr_to_pfn(maddr)));
-}
-
-void unmap_vtd_domain_page(const void *va)
-{
-    unmap_domain_page(va);
-}
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index 0954cc4922..951f1f30b7 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -19,6 +19,7 @@
 #include <xen/paging.h>
 #include <xen/guest_access.h>
 #include <xen/event.h>
+#include <xen/param.h>
 #include <xen/softirq.h>
 #include <xen/vm_event.h>
 #include <xsm/xsm.h>
@@ -36,6 +37,12 @@ bool __initdata iommu_superpages = true;
 
 enum iommu_intremap __read_mostly iommu_intremap = iommu_intremap_full;
 
+/*
+ * iommu_inclusive_mapping: When set, all memory below 4GB is included in dom0
+ * 1:1 iommu mappings except xen and unusable regions.
+ */
+boolean_param("iommu_inclusive_mapping", iommu_hwdom_inclusive);
+
 #ifdef CONFIG_PV
 /* Possible unfiltered LAPIC/MSI messages from untrusted sources? */
 bool __read_mostly untrusted_msi;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197661.1515139 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpnj-0004N9-DY; Thu, 08 Jan 2026 13:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197661.1515139; Thu, 08 Jan 2026 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 1vdpnj-0004Mz-AQ; Thu, 08 Jan 2026 13:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1197661;
 Thu, 08 Jan 2026 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 1vdpni-0004Ms-1w
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 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 1vdpnh-00F070-2O
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpnh-00E2lM-2y
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MXy9dvCHiZ3FI3qb9Myz1ZynpI+au5zd7lQ8bc1jKfY=; b=koidUK4FbNaw967Mv8yqIOFT6+
	VjYJjJpzcSADYplGNl/PtXqiCQfBbboMNu4mMRQbX7mB2HjQk8BRxqKXJm4Kv8lFaozTROJk6iUmN
	AQBKcqaEkk5xPq4QqPe/tbJOiQxGP0eFSJw57uMczi85mmY/Mcrn9lgAI4cMrY/8k5i8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: drop flush_dev_iotlb parameter from IOTLB flush hook
Message-Id: <E1vdpnh-00E2lM-2y@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:11:41 +0000

commit 673d9dd8a590fa61dd9ffed48c3c64ee3b0a23ff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 16:00:19 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    VT-d: drop flush_dev_iotlb parameter from IOTLB flush hook
    
    All call sites pass it using the flag from the IOMMU which they also
    pass.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/extern.h | 3 +--
 xen/drivers/passthrough/vtd/iommu.c  | 9 ++++-----
 xen/drivers/passthrough/vtd/iommu.h  | 3 +--
 xen/drivers/passthrough/vtd/qinval.c | 7 +++----
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 65f81a8bf1..1a9a439fb5 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -57,8 +57,7 @@ int __must_check cf_check vtd_flush_context_reg(
     uint8_t function_mask, uint64_t type, bool flush_non_present_entry);
 int __must_check cf_check vtd_flush_iotlb_reg(
     struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
-    unsigned int size_order, uint64_t type, bool flush_non_present_entry,
-    bool flush_dev_iotlb);
+    unsigned int size_order, uint64_t type, bool flush_non_present_entry);
 
 struct vtd_iommu *ioapic_to_iommu(unsigned int apic_id);
 struct vtd_iommu *hpet_to_iommu(unsigned int hpet_id);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 53e9165fc7..e7049456bf 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -569,8 +569,7 @@ static int __must_check iommu_flush_context_device(struct vtd_iommu *iommu,
 /* return value determine if we need a write buffer flush */
 int cf_check vtd_flush_iotlb_reg(
     struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
-    unsigned int size_order, uint64_t type, bool flush_non_present_entry,
-    bool flush_dev_iotlb)
+    unsigned int size_order, uint64_t type, bool flush_non_present_entry)
 {
     int tlb_offset = ecap_iotlb_offset(iommu->ecap);
     uint64_t val = type | DMA_TLB_IVT;
@@ -635,7 +634,7 @@ static int __must_check iommu_flush_iotlb_global(struct vtd_iommu *iommu,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH,
-                                flush_non_present_entry, iommu->flush_dev_iotlb);
+                                flush_non_present_entry);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -652,7 +651,7 @@ static int __must_check iommu_flush_iotlb_dsi(struct vtd_iommu *iommu, u16 did,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH,
-                                flush_non_present_entry, iommu->flush_dev_iotlb);
+                                flush_non_present_entry);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
@@ -678,7 +677,7 @@ static int __must_check iommu_flush_iotlb_psi(struct vtd_iommu *iommu, u16 did,
     vtd_ops_preamble_quirk(iommu);
 
     status = iommu->flush.iotlb(iommu, did, addr, order, DMA_TLB_PSI_FLUSH,
-                                flush_non_present_entry, iommu->flush_dev_iotlb);
+                                flush_non_present_entry);
 
     /* undo platform specific errata workarounds */
     vtd_ops_postamble_quirk(iommu);
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 0d96b76bce..ccb00889d7 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -502,8 +502,7 @@ struct vtd_iommu {
                                     bool non_present_entry_flush);
         int __must_check (*iotlb)(struct vtd_iommu *iommu, u16 did, u64 addr,
                                   unsigned int size_order, u64 type,
-                                  bool flush_non_present_entry,
-                                  bool flush_dev_iotlb);
+                                  bool flush_non_present_entry);
     } flush;
 
     struct list_head ats_devices;
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index c79927b09f..1dde44b105 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -452,7 +452,7 @@ static int __must_check cf_check flush_context_qi(
 
 static int __must_check cf_check flush_iotlb_qi(
     struct vtd_iommu *iommu, u16 did, u64 addr, unsigned int size_order,
-    u64 type, bool flush_non_present_entry, bool flush_dev_iotlb)
+    u64 type, bool flush_non_present_entry)
 {
     u8 dr = 0, dw = 0;
     int ret = 0, rc;
@@ -478,7 +478,7 @@ static int __must_check cf_check flush_iotlb_qi(
     if ( !ret )
         ret = rc;
 
-    if ( flush_dev_iotlb )
+    if ( iommu->flush_dev_iotlb )
     {
         rc = dev_invalidate_iotlb(iommu, did, addr, size_order, type);
         if ( !ret )
@@ -573,8 +573,7 @@ static int cf_check vtd_flush_context_noop(
 
 static int cf_check vtd_flush_iotlb_noop(
     struct vtd_iommu *iommu, uint16_t did, uint64_t addr,
-    unsigned int size_order, uint64_t type, bool flush_non_present_entry,
-    bool flush_dev_iotlb)
+    unsigned int size_order, uint64_t type, bool flush_non_present_entry)
 {
     WARN();
     return -EIO;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:11:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197662.1515142 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpnt-0004Qs-EP; Thu, 08 Jan 2026 13:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197662.1515142; Thu, 08 Jan 2026 13: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 1vdpnt-0004Qk-Bk; Thu, 08 Jan 2026 13:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1197662;
 Thu, 08 Jan 2026 13:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdpns-0004QY-4z
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpnr-00F078-2g
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpns-00E2ls-0G
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13: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=jGsZDDDsE2IjT+JU8b6bTVg7jjry18vpByQDGpUE81M=; b=RolWzcGMZEnAMWAH903df33fiJ
	t0zUqqgGMmCQiOltipTpPxIp2DYj/9xDHcQt+ZBv/sMSrjJVaa1vMqhpC4CZaq1MusAOu80WZMQpT
	fwuwl6kxIV5SW63y8hWhjBufXX5SAkuMHYMmlFbyyaVtFpSKcYP5tg/9wV2s7IFLCsVw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI/ATS: tidy {en,dis}able_ats_device() a little
Message-Id: <E1vdpns-00E2ls-0G@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:11:52 +0000

commit 31bebd739bfe6ac2c33ff5bfa4b4c2bac2cc670b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 7 16:00:37 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 8 08:07:19 2026 +0100

    PCI/ATS: tidy {en,dis}able_ats_device() a little
    
    Use appropriate types for the control register value as well as the
    capability position. Constify a pointer. Use "else" in favor of encoding
    the opposite condition of the earlier if().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/ats.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/ats.c b/xen/drivers/passthrough/ats.c
index 0da183d057..c20bfc8ee7 100644
--- a/xen/drivers/passthrough/ats.c
+++ b/xen/drivers/passthrough/ats.c
@@ -23,10 +23,9 @@ boolean_param("ats", ats_enabled);
 
 int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
 {
-    u32 value;
-    int pos;
+    uint16_t value;
+    unsigned int pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
     BUG_ON(!pos);
 
     if ( iommu_verbose )
@@ -35,7 +34,7 @@ int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
     value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CTL);
     if ( value & ATS_ENABLE )
     {
-        struct pci_dev *other;
+        const struct pci_dev *other;
 
         list_for_each_entry ( other, ats_list, ats.list )
             if ( other == pdev )
@@ -44,8 +43,7 @@ int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
                 break;
             }
     }
-
-    if ( !(value & ATS_ENABLE) )
+    else
     {
         value |= ATS_ENABLE;
         pci_conf_write16(pdev->sbdf, pos + ATS_REG_CTL, value);
@@ -69,7 +67,7 @@ int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
 
 void disable_ats_device(struct pci_dev *pdev)
 {
-    u32 value;
+    uint16_t value;
 
     BUG_ON(!pdev->ats.cap_pos);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:12:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197663.1515146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpo3-0004TR-Ft; Thu, 08 Jan 2026 13:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197663.1515146; Thu, 08 Jan 2026 13:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpo3-0004TK-D4; Thu, 08 Jan 2026 13:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1197663;
 Thu, 08 Jan 2026 13:12:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdpo2-0004TC-9u
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13:12:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpo1-00F07Q-31
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpo2-00E2mw-0Y
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:12:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IIwzdr+eBh6bnFttzCQtQPjR23Xd0be0IwU9yRClhuk=; b=bx8n6DFZ1QkHyGDci1qNeY8aoo
	5WK3PACpOsGKDsnCp6yx3/p+EawZ5bFfoez3dSNyM1+PXBHyLTZ/wroFhHSlHWHsBEGoBxJ9bfWvg
	X82o0PMRr216SO2roH6/3iayTZGC2SpTfT21aKGOom1D3utIdndFxaZBLWl+sUCPJAOE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vdpo2-00E2mw-0Y@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:12:02 +0000

commit c9491ea21a433168ef69639183a01848877cea14
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Dec 4 19:22:40 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Jan 8 11:05:30 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 2433230ac7..759f3273d3 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2015,11 +2015,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:12:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197664.1515150 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpoD-0004VW-H1; Thu, 08 Jan 2026 13:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197664.1515150; Thu, 08 Jan 2026 13:12:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpoD-0004VO-EZ; Thu, 08 Jan 2026 13:12:13 +0000
Received: by outflank-mailman (input) for mailman id 1197664;
 Thu, 08 Jan 2026 13:12:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdpoC-0004VG-By
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13:12:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpoC-00F07r-0B
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpoC-00E2nd-0u
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:12:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4pN/J96whnO0Ze78D9jbFk2U81ZTwX/v0zusafGZ6zs=; b=yBZ0yRnxyQQl5DfsNMm8VJQgui
	fKMAI1vi8uoJ2M4s8BgriU7gcxShbjWWzySlN2PNYWvjOT49Vd5lE5Kn2Ek2Jf257rs6neZqr6L/H
	9ctdI0bMYNwoNjkxYAB0wMVQKUYLKmA2Uueg68MK+Wt51oNKVK26KXBlgDcDb9kloLvA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vdpoC-00E2nd-0u@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:12:12 +0000

commit 75d29d9b5e226bafa0fbf9fba25623229660b81e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Dec 22 12:16:13 2025 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Jan 8 11:05:30 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c | 55 +++++++++++++++++++++++++------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1f67b88a89..2efc11ce09 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -515,30 +515,6 @@ unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->outstanding_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages || pages <= 0 )
-        goto out;
-
-    spin_lock(&heap_lock);
-    BUG_ON(outstanding_claims < d->outstanding_pages);
-    if ( d->outstanding_pages < pages )
-    {
-        /* `pages` exceeds the domain's outstanding count. Zero it out. */
-        outstanding_claims -= d->outstanding_pages;
-        d->outstanding_pages = 0;
-    }
-    else
-    {
-        outstanding_claims -= pages;
-        d->outstanding_pages -= pages;
-    }
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -548,9 +524,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1071,6 +1048,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1f77e0869b..d922c908c2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -413,7 +413,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 13:12:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 13:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1197665.1515154 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpoN-0004YR-Js; Thu, 08 Jan 2026 13:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1197665.1515154; Thu, 08 Jan 2026 13:12:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdpoN-0004YJ-HI; Thu, 08 Jan 2026 13:12:23 +0000
Received: by outflank-mailman (input) for mailman id 1197665;
 Thu, 08 Jan 2026 13:12:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdpoM-0004YB-Ek
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 13:12:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpoM-00F07x-0S
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdpoM-00E2pt-1H
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 13:12:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AYtfhm2RSyy/uhF0DssqxUODADZFKV9H69+wA33pJi4=; b=HXJ+X7SB9zX35NXk5cwlJpAQup
	c4p+u1O2ferYVSDNgyECovRMIkSm4uNtqdnVj2+iNRyK++8hlITtoB25a+ca8R4n9sXnybYlOt2hE
	9ovzERaXh5UgvYOVcV5oNWEgMCN1UpdPmcOhoZJOcELaL5nJqofdeXiANUVgwa9JJ1jA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vdpoM-00E2pt-1H@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 13:12:22 +0000

commit bdd5f35cf20c7397a7f74fb80446c136688e3145
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 8 10:16:55 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Jan 8 11:05:30 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 7eccadf7aa..d69a83b089 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1310,7 +1310,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 22:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 22:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198202.1515358 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdyjb-0005S0-2J; Thu, 08 Jan 2026 22:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198202.1515358; Thu, 08 Jan 2026 22:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdyja-0005Rs-Vv; Thu, 08 Jan 2026 22:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1198202;
 Thu, 08 Jan 2026 22: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 1vdyjZ-0005Rm-MS
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 22: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 1vdyjZ-00FBNn-10
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 22:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdyjZ-00Ejoc-1o
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 22: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=uTYGw85tXEAARenn/3g5a3s9TBA1Hg6EGw1zk9lcAa0=; b=tdBMpDRRPoq0oaJOU7Ytbpc+mm
	51mTtwn6j6FOBbV3XWvrttNHb5mpzt8yoIDHS9iqbiq8pPnaQN9WFZOKgOJNpSn0rNkTzW0nKSZHq
	eWIJ1ivH9xwlQWuiNVLoGZ8WwsNO1mhmc/Nl9ivs428rZntm0TNVTCafx2ddQg18cApM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] misra: allow using binary literals in c99 as an extension.
Message-Id: <E1vdyjZ-00Ejoc-1o@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 22:44:01 +0000

commit bbad59569e06e4dad21d09195990e48c6409db7b
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Jan 6 18:50:08 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 8 18:50:27 2026 +0000

    misra: allow using binary literals in c99 as an extension.
    
    There is consensus towards using more binary literals in Xen,
    so they are enabled both for X86_64 and ARM64.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/toolchain.ecl | 5 +++++
 docs/misra/C-language-toolchain.rst             | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
index 4bc88aa029..da00c2198a 100644
--- a/automation/eclair_analysis/ECLAIR/toolchain.ecl
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -332,3 +332,8 @@ ext_sizeof_alignof_void_type"
 -doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
 -config=STD.inclexpd,behavior={c99, GCC_X86_64, "specified"}
 -doc_end
+
+-doc_begin="See Section \"6.65 Binary Constants using the '0b' Prefix\" of "GCC_MANUAL"."
+-config=STD.ltrlbin,behavior={c99, GCC_ARM64, "specified"}
+-config=STD.ltrlbin,behavior={c99, GCC_X86_64, "specified"}
+-doc_end
diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index ec0c9953be..5d418e262a 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -218,6 +218,10 @@ The table columns are as follows:
      - All architectures
      - See Section "6.3 Labels as Values" of GCC_MANUAL.
 
+   * - Binary constants
+     - ARM64, X86_64
+     - See Section "6.65 Binary Constants using the '0b' Prefix"
+
 Translation Limits
 __________________
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 22:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 22:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198203.1515362 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdyjl-0005TK-3m; Thu, 08 Jan 2026 22:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198203.1515362; Thu, 08 Jan 2026 22: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 1vdyjl-0005TC-18; Thu, 08 Jan 2026 22:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1198203;
 Thu, 08 Jan 2026 22:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vdyjj-0005Su-Qb
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 22: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 1vdyjj-00FBO5-1T
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 22:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdyjj-00EjrA-26
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 22: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=xPQxvQRWiCbKpSaxF09On5o2CavMdvKw4dWNufjHSUA=; b=DVBSyzfKY8brqYXzULhsF2KaWS
	7r8D5qhDh1E+0Umc2L/wUSNfheii3XjgJK9sNitiM8u6pAcvASzvZteDooIFTHJ3qcwXDN8q0P4Yk
	cXWcb3f9jRXye+gPcezipqtDRWnGnrEfMiqEW49XVyqVVEidz3ObbHMou3rs4tHSy2mQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: switch KBL console into polling mode
Message-Id: <E1vdyjj-00EjrA-26@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 22:44:11 +0000

commit 474e0d7493169966036f9b5e9a8018a482ae96de
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Dec 8 16:35:13 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 8 18:50:27 2026 +0000

    CI: switch KBL console into polling mode
    
    In an attempt to debug/workaround occasional console freeze, switch it
    to polling mode. If that helps, it will narrow down the search.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 automation/gitlab-ci/test.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 338fc99a8a..275c01c19f 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -165,7 +165,7 @@
   variables:
     PCIDEV: "00:1f.6"
     PCIDEV_INTR: "MSI"
-    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,0"
     SUT_ADDR: test-3.testnet
   tags:
     - qubes-hw3
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 23:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 23:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198224.1515366 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdzfg-0003fF-23; Thu, 08 Jan 2026 23:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198224.1515366; Thu, 08 Jan 2026 23:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdzff-0003f7-Vg; Thu, 08 Jan 2026 23:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1198224;
 Thu, 08 Jan 2026 23: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 1vdzfe-0003f1-DW
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 23: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 1vdzfd-00FCc5-3C
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 23:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdzfe-00EnBf-0j
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 23: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=28ekKNm5oDNlSZ0jPdnsrKA0igNA78MzZkIWkSkZN/E=; b=Bfz3FtkQbm79Y1Au5U0fG/0FtV
	NMdwUk2jVUCzcRLvY9CoZFE4KKLDQMyqMEzwxb7fTWfxMUyeiH5bkZQYbsqPzKTWxyTQWLK2Wt1aH
	UyPyBFHV1Sjc6y/Gxl39gNliF0+L3X30xnIz6T9OeRhWYMBy1LpayJAemfoWEv+6nns8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] misra: allow using binary literals in c99 as an extension.
Message-Id: <E1vdzfe-00EnBf-0j@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 23:44:02 +0000

commit bbad59569e06e4dad21d09195990e48c6409db7b
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue Jan 6 18:50:08 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 8 18:50:27 2026 +0000

    misra: allow using binary literals in c99 as an extension.
    
    There is consensus towards using more binary literals in Xen,
    so they are enabled both for X86_64 and ARM64.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/toolchain.ecl | 5 +++++
 docs/misra/C-language-toolchain.rst             | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
index 4bc88aa029..da00c2198a 100644
--- a/automation/eclair_analysis/ECLAIR/toolchain.ecl
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -332,3 +332,8 @@ ext_sizeof_alignof_void_type"
 -doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
 -config=STD.inclexpd,behavior={c99, GCC_X86_64, "specified"}
 -doc_end
+
+-doc_begin="See Section \"6.65 Binary Constants using the '0b' Prefix\" of "GCC_MANUAL"."
+-config=STD.ltrlbin,behavior={c99, GCC_ARM64, "specified"}
+-config=STD.ltrlbin,behavior={c99, GCC_X86_64, "specified"}
+-doc_end
diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index ec0c9953be..5d418e262a 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -218,6 +218,10 @@ The table columns are as follows:
      - All architectures
      - See Section "6.3 Labels as Values" of GCC_MANUAL.
 
+   * - Binary constants
+     - ARM64, X86_64
+     - See Section "6.65 Binary Constants using the '0b' Prefix"
+
 Translation Limits
 __________________
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 08 23:44:18 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Jan 2026 23:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198225.1515370 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdzfq-0003gz-3a; Thu, 08 Jan 2026 23:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198225.1515370; Thu, 08 Jan 2026 23:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vdzfq-0003gr-0w; Thu, 08 Jan 2026 23:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1198225;
 Thu, 08 Jan 2026 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 1vdzfo-0003gd-GO
 for xen-changelog@lists.xenproject.org; Thu, 08 Jan 2026 23: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 1vdzfo-00FCcB-0c
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 23:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vdzfo-00EnEP-14
 for xen-changelog@lists.xenproject.org;
 Thu, 08 Jan 2026 23: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=5OT3A4n7joMUV0u5JNnTMIcOx1U02uA4i2syNRniguo=; b=GK5NdJagwgktcVbN099JZVdMGc
	LJenHBltvWhUan3gw5U5MM2a/yL9zCSU4dVo1nYxedIU6MDb3OMAMvzuGT4mGEDWNf7uGjBDKHpgs
	S7e3A2XkySD5v83GMBtfviZipAhRmaVVd/SnLYTlahdxvQJc+wGjvnOod8rnwHCFmyhQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: switch KBL console into polling mode
Message-Id: <E1vdzfo-00EnEP-14@xenbits.xenproject.org>
Date: Thu, 08 Jan 2026 23:44:12 +0000

commit 474e0d7493169966036f9b5e9a8018a482ae96de
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Dec 8 16:35:13 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 8 18:50:27 2026 +0000

    CI: switch KBL console into polling mode
    
    In an attempt to debug/workaround occasional console freeze, switch it
    to polling mode. If that helps, it will narrow down the search.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 automation/gitlab-ci/test.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 338fc99a8a..275c01c19f 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -165,7 +165,7 @@
   variables:
     PCIDEV: "00:1f.6"
     PCIDEV_INTR: "MSI"
-    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,msi"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1,pci,0"
     SUT_ADDR: test-3.testnet
   tags:
     - qubes-hw3
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 15:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 15:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198977.1515734 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEeh-0007ac-Ry; Fri, 09 Jan 2026 15:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198977.1515734; Fri, 09 Jan 2026 15: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 1veEeh-0007aU-P3; Fri, 09 Jan 2026 15:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1198977;
 Fri, 09 Jan 2026 15:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veEeg-0007aO-DR
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 15:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEeg-00GdAg-0C
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEeg-00FfUx-0u
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HPP07hGc5Yu3/VFNI+fWH7K5fL0AbLVUyoaik/ec70E=; b=Zba5zckucsAreyCm07y3fv2LdP
	bLkc/xaAsCVzipy89OF3ZN33cs3kjs7noitKUP0vRUVCKyzxYZiePvMf3Sh4c3dRxvSfFN6q0q0CS
	n0PTVdhfU9WmeXk5yl99xRkYaKt3PSU3FHQsb5ERx8MXO/3DxTvj2nuFPOBQmGwzjXEc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: optimize the size of struct vcpu
Message-Id: <E1veEeg-00FfUx-0u@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 15:44:02 +0000

commit b7d3accd92c7fd8665fb255f8b25417adb43ff4f
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Jan 7 17:28:58 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen/arm: optimize the size of struct vcpu
    
    When CONFIG_NEW_VGIC=y and CONFIG_ARM_64=y, the size of struct vcpu
    exceeds one page, which requires allocating two pages and led to the
    introduction of MAX_PAGES_PER_VCPU.
    
    To remove the need for MAX_PAGES_PER_VCPU, the vgic member of NEW_VGIC's
    struct vgic_cpu member private_irqs is changed to a pointer to struct
    vgic_irq.
    As a result, the size of struct vcpu for Arm64 is reduced to 2176 bytes
    in the case when CONFIG_ARM_64=y and CONFIG_NEW_VGIC=y, compared to 3840
    bytes (without these changes and with CONFIG_ARM_64=y) and 4736 bytes
    (without these changes and with both CONFIG_ARM_64=y and CONFIG_NEW_VGIC=y).
    Note that all numbers are based on defconfig with the mentioned options
    enabled or disabled as specified.
    
    Since the private_irqs member is now a pointer, vcpu_vgic_init() and
    vcpu_vgic_free() are updated to allocate and free private_irqs instance.
    
    As struct vcpu now fits into one page, drop MAX_PAGES_PER_VCPU.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain.c               | 23 ++++-------------------
 xen/arch/arm/include/asm/new_vgic.h |  2 +-
 xen/arch/arm/vgic/vgic-init.c       |  7 +++++++
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 47973f99d9..64b935b680 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -473,36 +473,21 @@ void dump_pageframe_info(struct domain *d)
 
 }
 
-/*
- * The new VGIC has a bigger per-IRQ structure, so we need more than one
- * page on ARM64. Cowardly increase the limit in this case.
- */
-#if defined(CONFIG_NEW_VGIC) && defined(CONFIG_ARM_64)
-#define MAX_PAGES_PER_VCPU  2
-#else
-#define MAX_PAGES_PER_VCPU  1
-#endif
-
 struct vcpu *alloc_vcpu_struct(const struct domain *d)
 {
     struct vcpu *v;
 
-    BUILD_BUG_ON(sizeof(*v) > MAX_PAGES_PER_VCPU * PAGE_SIZE);
-    v = alloc_xenheap_pages(get_order_from_bytes(sizeof(*v)), 0);
+    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
+    v = alloc_xenheap_page();
     if ( v != NULL )
-    {
-        unsigned int i;
-
-        for ( i = 0; i < DIV_ROUND_UP(sizeof(*v), PAGE_SIZE); i++ )
-            clear_page((void *)v + i * PAGE_SIZE);
-    }
+        clear_page(v);
 
     return v;
 }
 
 void free_vcpu_struct(struct vcpu *v)
 {
-    free_xenheap_pages(v, get_order_from_bytes(sizeof(*v)));
+    free_xenheap_page(v);
 }
 
 int arch_vcpu_create(struct vcpu *v)
diff --git a/xen/arch/arm/include/asm/new_vgic.h b/xen/arch/arm/include/asm/new_vgic.h
index 1e76213893..6f7af0e02b 100644
--- a/xen/arch/arm/include/asm/new_vgic.h
+++ b/xen/arch/arm/include/asm/new_vgic.h
@@ -155,7 +155,7 @@ struct vgic_dist {
 };
 
 struct vgic_cpu {
-    struct vgic_irq private_irqs[VGIC_NR_PRIVATE_IRQS];
+    struct vgic_irq *private_irqs;
 
     struct list_head ap_list_head;
     spinlock_t ap_list_lock;    /* Protects the ap_list */
diff --git a/xen/arch/arm/vgic/vgic-init.c b/xen/arch/arm/vgic/vgic-init.c
index aef526f2e7..4eb49d9224 100644
--- a/xen/arch/arm/vgic/vgic-init.c
+++ b/xen/arch/arm/vgic/vgic-init.c
@@ -202,6 +202,11 @@ int vcpu_vgic_init(struct vcpu *v)
 {
     int ret = 0;
 
+    v->arch.vgic.private_irqs =
+        xzalloc_array(struct vgic_irq, VGIC_NR_PRIVATE_IRQS);
+    if ( !v->arch.vgic.private_irqs )
+        return -ENOMEM;
+
     vgic_vcpu_early_init(v);
 
     if ( gic_hw_version() == GIC_V2 )
@@ -244,6 +249,8 @@ void vcpu_vgic_free(struct vcpu *v)
     struct vgic_cpu *vgic_cpu = &v->arch.vgic;
 
     INIT_LIST_HEAD(&vgic_cpu->ap_list_head);
+
+    XFREE(v->arch.vgic.private_irqs);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 15:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 15:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198978.1515737 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEer-0007cI-TB; Fri, 09 Jan 2026 15:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198978.1515737; Fri, 09 Jan 2026 15:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEer-0007cA-QV; Fri, 09 Jan 2026 15:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1198978;
 Fri, 09 Jan 2026 15:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veEeq-0007bs-Fg
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 15:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEeq-00GdAm-0X
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEeq-00FfYE-1L
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mTLQJbwu7P4vX4KRhoJ3uMktuyv+nj7/HpiFFM3WcqY=; b=SUI75UFUjdGahDwbREjOIO1C1T
	Ej9a+neaZHC/sg5N/Q4q7UxUzbfs6tSuLjQXTryt81Q13NkIihyhWIVKp56jLJh0092Jj30mjVSeb
	Y78dDMJP++H7qKBCU6inlL9/9fBfd1bPcSnqNPb3eJBK5F3GA18ccEa2fqSPbZ6lHBjs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: move alloc/free_vcpu_struct() to common code
Message-Id: <E1veEeq-00FfYE-1L@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 15:44:12 +0000

commit a6fccf74e18d6cc388d54802e7e30ede3cdb7525
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Jan 7 17:28:59 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen: move alloc/free_vcpu_struct() to common code
    
    alloc_vcpu_struct() and free_vcpu_struct() contain little
    architecture-specific logic and are suitable for sharing across
    architectures. Move both helpers to common code.
    
    To support the remaining architectural differences, introduce
    arch_vcpu_struct_memflags(), allowing architectures to override the
    memory flags passed to alloc_xenheap_pages(). This is currently needed
    by x86, which may require MEMF_bits(32) for HVM guests using shadow
    paging.
    
    The ARM implementation of alloc/free_vcpu_struct() is removed and
    replaced by the common version. Stub implementations are also dropped
    from PPC and RISC-V.
    
    Now that the size of struct vcpu for Arm64 is smaller than PAGE_SIZE,
    MAX_PAGES_PER_VCPU is no longer needed and is removed.
    
    Finally, make alloc_vcpu_struct() and free_vcpu_struct() static to
    common/domain.c, as they are no longer used outside common code.
    
    No functional changes.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain.c             | 17 -----------------
 xen/arch/ppc/stubs.c              | 10 ----------
 xen/arch/riscv/stubs.c            | 10 ----------
 xen/arch/x86/domain.c             | 24 ------------------------
 xen/arch/x86/include/asm/domain.h | 12 ++++++++++++
 xen/common/domain.c               | 20 ++++++++++++++++++++
 xen/include/xen/domain.h          |  4 ----
 7 files changed, 32 insertions(+), 65 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 64b935b680..507df807ed 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -473,23 +473,6 @@ void dump_pageframe_info(struct domain *d)
 
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    struct vcpu *v;
-
-    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
-    v = alloc_xenheap_page();
-    if ( v != NULL )
-        clear_page(v);
-
-    return v;
-}
-
-void free_vcpu_struct(struct vcpu *v)
-{
-    free_xenheap_page(v);
-}
-
 int arch_vcpu_create(struct vcpu *v)
 {
     int rc = 0;
diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c
index 9953ea1c6c..f7f6e7ed97 100644
--- a/xen/arch/ppc/stubs.c
+++ b/xen/arch/ppc/stubs.c
@@ -152,11 +152,6 @@ void dump_pageframe_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
-void free_vcpu_struct(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_vcpu_create(struct vcpu *v)
 {
     BUG_ON("unimplemented");
@@ -264,11 +259,6 @@ void vcpu_kick(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    BUG_ON("unimplemented");
-}
-
 unsigned long
 hypercall_create_continuation(unsigned int op, const char *format, ...)
 {
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index 164fc091b2..29bdb65afb 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -121,11 +121,6 @@ void dump_pageframe_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
-void free_vcpu_struct(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_vcpu_create(struct vcpu *v)
 {
     BUG_ON("unimplemented");
@@ -233,11 +228,6 @@ void vcpu_kick(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    BUG_ON("unimplemented");
-}
-
 unsigned long
 hypercall_create_continuation(unsigned int op, const char *format, ...)
 {
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 7632d5e2d6..c29a6b0dec 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -493,30 +493,6 @@ unsigned int arch_domain_struct_memflags(void)
     return MEMF_bits(bits);
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    struct vcpu *v;
-    /*
-     * This structure contains embedded PAE PDPTEs, used when an HVM guest
-     * runs on shadow pagetables outside of 64-bit mode. In this case the CPU
-     * may require that the shadow CR3 points below 4GB, and hence the whole
-     * structure must satisfy this restriction. Thus we specify MEMF_bits(32).
-     */
-    unsigned int memflags =
-        (is_hvm_domain(d) && paging_mode_shadow(d)) ? MEMF_bits(32) : 0;
-
-    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
-    v = alloc_xenheap_pages(0, memflags);
-    if ( v != NULL )
-        clear_page(v);
-    return v;
-}
-
-void free_vcpu_struct(struct vcpu *v)
-{
-    free_xenheap_page(v);
-}
-
 /* Initialise various registers to their architectural INIT/RESET state. */
 void arch_vcpu_regs_init(struct vcpu *v)
 {
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 16cd45cc32..effb23a234 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -15,6 +15,18 @@
 unsigned int arch_domain_struct_memflags(void);
 #define arch_domain_struct_memflags arch_domain_struct_memflags
 
+/*
+ * This structure contains embedded PAE PDPTEs, used when an HVM guest
+ * runs on shadow pagetables outside of 64-bit mode. In this case the CPU
+ * may require that the shadow CR3 points below 4GB, and hence the whole
+ * structure must satisfy this restriction. Thus we specify MEMF_bits(32).
+ */
+#define arch_vcpu_struct_memflags(d) ({                                 \
+    const struct domain *d_ = (d);                                      \
+                                                                        \
+    (is_hvm_domain(d_) && paging_mode_shadow(d_) ? MEMF_bits(32) : 0);  \
+})
+
 #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
 
 /*
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 93c71bc766..655d9590f8 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -316,6 +316,26 @@ static void vcpu_info_reset(struct vcpu *v)
          : &dummy_vcpu_info);
 }
 
+static struct vcpu *alloc_vcpu_struct(const struct domain *d)
+{
+#ifndef arch_vcpu_struct_memflags
+# define arch_vcpu_struct_memflags(d) ((void)(d), 0)
+#endif
+    struct vcpu *v;
+
+    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
+    v = alloc_xenheap_pages(0, arch_vcpu_struct_memflags(d));
+    if ( v )
+        clear_page(v);
+
+    return v;
+}
+
+static void free_vcpu_struct(struct vcpu *v)
+{
+    free_xenheap_page(v);
+}
+
 static void vmtrace_free_buffer(struct vcpu *v)
 {
     const struct domain *d = v->domain;
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 8aab05ae93..644f5ac3f2 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -70,10 +70,6 @@ void domid_free(domid_t domid);
 struct domain *alloc_domain_struct(void);
 void free_domain_struct(struct domain *d);
 
-/* Allocate/free a VCPU structure. */
-struct vcpu *alloc_vcpu_struct(const struct domain *d);
-void free_vcpu_struct(struct vcpu *v);
-
 /* Allocate/free a PIRQ structure. */
 #ifndef alloc_pirq_struct
 struct pirq *alloc_pirq_struct(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 15:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 15:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198979.1515743 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEf1-0007eL-VV; Fri, 09 Jan 2026 15:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198979.1515743; Fri, 09 Jan 2026 15:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEf1-0007eD-Rw; Fri, 09 Jan 2026 15:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1198979;
 Fri, 09 Jan 2026 15:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veEf0-0007e6-IU
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 15:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEf0-00GdAr-0o
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEf0-00FfZw-1d
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+QKuGiSvFI0Hpm6ttv//KqK1bJ2vnAGwikMrAF2zHRM=; b=QBBor70hUgVyvBa/JtBZyfpgXv
	vRpkYpicE8tm0pSmOJRqs66mwu6muQtBk7OR1W5UHRIToe6vHk9l2V2k2rVzKGVd9PBxlBTgIwNgi
	Qj+sO7ahw/EZwnpYD7AxrEEiZ2O0cF5L+3Cx60m/iG31uBSGBTK0QsE5yi0IM9SIr/Rk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: make {alloc,free}_domain_struct() static
Message-Id: <E1veEf0-00FfZw-1d@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 15:44:22 +0000

commit 7099115b798d75529f5c58d1a05b894e32e5a895
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Jan 7 17:29:00 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen/common: make {alloc,free}_domain_struct() static
    
    As {alloc,free}_domain_struct() are used only within domain.c,
    they can be declared static and their declarations removed
    from xen/domain.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/domain.c      | 42 +++++++++++++++++++++---------------------
 xen/include/xen/domain.h |  4 ----
 2 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 655d9590f8..ed4b6175de 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -316,6 +316,27 @@ static void vcpu_info_reset(struct vcpu *v)
          : &dummy_vcpu_info);
 }
 
+static struct domain *alloc_domain_struct(void)
+{
+#ifndef arch_domain_struct_memflags
+# define arch_domain_struct_memflags() 0
+#endif
+
+    struct domain *d = alloc_xenheap_pages(0, arch_domain_struct_memflags());
+
+    BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
+
+    if ( d )
+        clear_page(d);
+
+    return d;
+}
+
+static void free_domain_struct(struct domain *d)
+{
+    free_xenheap_page(d);
+}
+
 static struct vcpu *alloc_vcpu_struct(const struct domain *d)
 {
 #ifndef arch_vcpu_struct_memflags
@@ -819,27 +840,6 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
     return arch_sanitise_domain_config(config);
 }
 
-struct domain *alloc_domain_struct(void)
-{
-#ifndef arch_domain_struct_memflags
-# define arch_domain_struct_memflags() 0
-#endif
-
-    struct domain *d = alloc_xenheap_pages(0, arch_domain_struct_memflags());
-
-    BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
-
-    if ( d )
-        clear_page(d);
-
-    return d;
-}
-
-void free_domain_struct(struct domain *d)
-{
-    free_xenheap_page(d);
-}
-
 struct domain *domain_create(domid_t domid,
                              struct xen_domctl_createdomain *config,
                              unsigned int flags)
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 644f5ac3f2..273717c31b 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -66,10 +66,6 @@ void domid_free(domid_t domid);
  * Arch-specifics.
  */
 
-/* Allocate/free a domain structure. */
-struct domain *alloc_domain_struct(void);
-void free_domain_struct(struct domain *d);
-
 /* Allocate/free a PIRQ structure. */
 #ifndef alloc_pirq_struct
 struct pirq *alloc_pirq_struct(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 15:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 15:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198980.1515747 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEfC-0007gp-09; Fri, 09 Jan 2026 15:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198980.1515747; Fri, 09 Jan 2026 15: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 1veEfB-0007gf-TP; Fri, 09 Jan 2026 15:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1198980;
 Fri, 09 Jan 2026 15:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veEfA-0007gT-LT
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 15:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEfA-00GdBF-17
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEfA-00FfbM-1u
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YCjmEibShUNyc52TvtqSwtfSFp37MKCOmn7Jg57UCxU=; b=a9lHxbHVdDPk1QEelcMFOCe8bj
	R5EmmC8HXPH41VFayV+i0oFpVvmiGcBHI3zPYunvHcWx/EJ+SCpOS7Lrk+lkgAGtfsmuopP4qkaDK
	s0DwWxwyyDJkoFlxI5ZLwXJ1UOm1SDo/9kFZw+Ocdw563qpTjtCb5PtDESEZnZmuP0Eg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Correct comment about struct vcpu memflags restriction
Message-Id: <E1veEfA-00FfbM-1u@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 15:44:32 +0000

commit d2be48728a640c14a8179d88b9ec87d007a785c4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 23 12:44:02 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    x86: Correct comment about struct vcpu memflags restriction
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index effb23a234..94b0cf7f1d 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -17,7 +17,7 @@ unsigned int arch_domain_struct_memflags(void);
 
 /*
  * This structure contains embedded PAE PDPTEs, used when an HVM guest
- * runs on shadow pagetables outside of 64-bit mode. In this case the CPU
+ * runs on shadow pagetables outside of Long mode. In this case the CPU
  * may require that the shadow CR3 points below 4GB, and hence the whole
  * structure must satisfy this restriction. Thus we specify MEMF_bits(32).
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 15:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 15:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198981.1515750 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEfM-0007jI-1A; Fri, 09 Jan 2026 15:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198981.1515750; Fri, 09 Jan 2026 15:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEfL-0007jA-Um; Fri, 09 Jan 2026 15:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1198981;
 Fri, 09 Jan 2026 15:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veEfK-0007j2-OI
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 15:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEfK-00GdBL-1O
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEfK-00Ffcd-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h090/bASOjYweB9mRWsSK/3Xmg2QjD5n2KHeTGqNfdo=; b=rmcBzdao5xPxkf/YM73/HFsgi7
	xVvBdBXrPuBLL1q7A0bSwCu3NtXsYLpywm5kdDr1MHxlOoW7okjgqLbOMQ/qfcY0K1AEIgQ6jt43R
	aiN/QjgJGF4iPVdiP40YX1p5LGsyxhH0lC1qRgipohFWvJKk/xZ6YBe1nJ2L34HjoVO4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/gen_hypercall: Leave a breadcrumb in xen-hypercall-defs.h
Message-Id: <E1veEfK-00Ffcd-2D@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 15:44:42 +0000

commit 913f40f4d1a5929024756a9c029d15df097982bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 19:08:44 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen/gen_hypercall: Leave a breadcrumb in xen-hypercall-defs.h
    
    When Cscope-ing through Xen, one occasionally finds themselves in
    xen-hypercall-defs.h and needing to find the originating file.
    
    This is substantially magic, and even reading the Makefile that produces
    xen-hypercall-defs.h is of little help if you're not aware of of the %.i : %.c
    pattern rule, and that the header is generated from a .c file in practice.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/scripts/gen_hypercall.awk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/scripts/gen_hypercall.awk b/xen/scripts/gen_hypercall.awk
index b544fe1c4d..c137f8fc4e 100644
--- a/xen/scripts/gen_hypercall.awk
+++ b/xen/scripts/gen_hypercall.awk
@@ -4,7 +4,7 @@
 BEGIN {
     printf("#ifndef XEN_HYPERCALL_DEFS_H\n");
     printf("#define XEN_HYPERCALL_DEFS_H\n\n");
-    printf("/* Generated file, do not edit! */\n\n");
+    printf("/* Automatically generated from xen/include/hypercall-defs.c - do not edit! */\n\n");
     e = 0;
     n = 0;
     p = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 15:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 15:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1198982.1515755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veEfW-0007lP-36; Fri, 09 Jan 2026 15:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1198982.1515755; Fri, 09 Jan 2026 15: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 1veEfV-0007lH-WE; Fri, 09 Jan 2026 15:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1198982;
 Fri, 09 Jan 2026 15: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 1veEfU-0007l9-RI
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 15: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 1veEfU-00GdBR-1i
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veEfU-00Ffdu-2W
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 15: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=fXVEISqbIj6y3ntf9u08pUAEmEQ41/0dEoj8bPiMzBk=; b=vOJr6gnuMQV4NZpCOg/AzoT5F5
	qmNFhhVxKwuBoSKp1UbTf+d3ucDILjuecM1LZVabFYZmURQ6MiLoq7v4rKO0lDLJlZoscKt+hM23e
	/6yUpvde3erBHThLLNDQdqnjT2owIRoZRqWbe/RawWidTLRblha3zVXvakB5juKQ2BA8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MISRA: Extend the R3.1 deviation for URLs to include git://
Message-Id: <E1veEfU-00Ffdu-2W@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 15:44:52 +0000

commit fe0ede8fe4ac19f6b5f8ab3428f78d1c19fc3f71
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 7 12:42:07 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    MISRA: Extend the R3.1 deviation for URLs to include git://
    
    xen/drivers/passthrough/arm/ipmmu-vmsa.c contains a git:// URL in a block
    comment.  This is also not an example of commented out code, so shouldn't be
    considered a R3.1 violation.
    
    Extend the regex to include git://, and swap hyperlink for URL in the
    associated documentation to be more precise.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++--
 docs/misra/deviations.rst                        | 4 ++--
 docs/misra/rules.rst                             | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 7dee4a488d..30c3239069 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -58,9 +58,9 @@ removed by the compiler, the resulting slowdown is negligible."
 # Series 3.
 #
 
--doc_begin="Comments starting with '/*' and containing hyperlinks are safe as
+-doc_begin="Comments starting with '/*' and containing URLs are safe as
 they are not instances of commented-out code."
--config=MC3A2.R3.1,reports+={safe, "first_area(text(^.*https?://.*$))"}
+-config=MC3A2.R3.1,reports+={safe, "first_area(text(^.*(https?|git)://.*$))"}
 -doc_end
 
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 0d90f5886e..17c21537f2 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -117,8 +117,8 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR.
 
    * - R3.1
-     - Comments starting with '/\*' and containing hyperlinks are safe as they
-       are not instances of commented-out code.
+     - Comments starting with '/\*' and containing URLs are safe as they are
+       not instances of commented-out code.
      - Tagged as `safe` for ECLAIR.
 
    * - R5.3
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 4e94251887..b3e929307d 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -143,7 +143,7 @@ maintainers if you want to suggest a change.
      - Required
      - The character sequences /* and // shall not be used within a
        comment
-     - Comments containing hyperlinks inside C-style block comments are safe
+     - Comments containing URLs inside C-style block comments are safe
 
    * - `Rule 3.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_03_02.c>`_
      - Required
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 16:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 16:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199050.1515781 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFlP-0000jS-DT; Fri, 09 Jan 2026 16:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199050.1515781; Fri, 09 Jan 2026 16:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFlP-0000jL-AR; Fri, 09 Jan 2026 16:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1199050;
 Fri, 09 Jan 2026 16:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veFlO-0000jF-2v
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 16:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFlN-00GeuS-2L
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFlN-00Fntv-39
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16: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=7G905ctVecj/nDRLCUhr7AjtVFwvaEYbTJuwDh9sBpw=; b=6h1ur0csCiLLzkmLLxbZoECYfL
	uQ0VJSGQGEip/++7NBQHnb1J5znhaBXE3/tIkVTnT6GbIe3/ne+45k4Jqd6WwvnsTMaC52cvMJa7l
	GPKF3KlR+KLlOzFfvT++5pdx/eyOmiHKTZ7qsieVM6T9Iex7Ni5ev6HhSAIMeFK5++No=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: optimize the size of struct vcpu
Message-Id: <E1veFlN-00Fntv-39@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 16:55:01 +0000

commit b7d3accd92c7fd8665fb255f8b25417adb43ff4f
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Jan 7 17:28:58 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen/arm: optimize the size of struct vcpu
    
    When CONFIG_NEW_VGIC=y and CONFIG_ARM_64=y, the size of struct vcpu
    exceeds one page, which requires allocating two pages and led to the
    introduction of MAX_PAGES_PER_VCPU.
    
    To remove the need for MAX_PAGES_PER_VCPU, the vgic member of NEW_VGIC's
    struct vgic_cpu member private_irqs is changed to a pointer to struct
    vgic_irq.
    As a result, the size of struct vcpu for Arm64 is reduced to 2176 bytes
    in the case when CONFIG_ARM_64=y and CONFIG_NEW_VGIC=y, compared to 3840
    bytes (without these changes and with CONFIG_ARM_64=y) and 4736 bytes
    (without these changes and with both CONFIG_ARM_64=y and CONFIG_NEW_VGIC=y).
    Note that all numbers are based on defconfig with the mentioned options
    enabled or disabled as specified.
    
    Since the private_irqs member is now a pointer, vcpu_vgic_init() and
    vcpu_vgic_free() are updated to allocate and free private_irqs instance.
    
    As struct vcpu now fits into one page, drop MAX_PAGES_PER_VCPU.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain.c               | 23 ++++-------------------
 xen/arch/arm/include/asm/new_vgic.h |  2 +-
 xen/arch/arm/vgic/vgic-init.c       |  7 +++++++
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 47973f99d9..64b935b680 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -473,36 +473,21 @@ void dump_pageframe_info(struct domain *d)
 
 }
 
-/*
- * The new VGIC has a bigger per-IRQ structure, so we need more than one
- * page on ARM64. Cowardly increase the limit in this case.
- */
-#if defined(CONFIG_NEW_VGIC) && defined(CONFIG_ARM_64)
-#define MAX_PAGES_PER_VCPU  2
-#else
-#define MAX_PAGES_PER_VCPU  1
-#endif
-
 struct vcpu *alloc_vcpu_struct(const struct domain *d)
 {
     struct vcpu *v;
 
-    BUILD_BUG_ON(sizeof(*v) > MAX_PAGES_PER_VCPU * PAGE_SIZE);
-    v = alloc_xenheap_pages(get_order_from_bytes(sizeof(*v)), 0);
+    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
+    v = alloc_xenheap_page();
     if ( v != NULL )
-    {
-        unsigned int i;
-
-        for ( i = 0; i < DIV_ROUND_UP(sizeof(*v), PAGE_SIZE); i++ )
-            clear_page((void *)v + i * PAGE_SIZE);
-    }
+        clear_page(v);
 
     return v;
 }
 
 void free_vcpu_struct(struct vcpu *v)
 {
-    free_xenheap_pages(v, get_order_from_bytes(sizeof(*v)));
+    free_xenheap_page(v);
 }
 
 int arch_vcpu_create(struct vcpu *v)
diff --git a/xen/arch/arm/include/asm/new_vgic.h b/xen/arch/arm/include/asm/new_vgic.h
index 1e76213893..6f7af0e02b 100644
--- a/xen/arch/arm/include/asm/new_vgic.h
+++ b/xen/arch/arm/include/asm/new_vgic.h
@@ -155,7 +155,7 @@ struct vgic_dist {
 };
 
 struct vgic_cpu {
-    struct vgic_irq private_irqs[VGIC_NR_PRIVATE_IRQS];
+    struct vgic_irq *private_irqs;
 
     struct list_head ap_list_head;
     spinlock_t ap_list_lock;    /* Protects the ap_list */
diff --git a/xen/arch/arm/vgic/vgic-init.c b/xen/arch/arm/vgic/vgic-init.c
index aef526f2e7..4eb49d9224 100644
--- a/xen/arch/arm/vgic/vgic-init.c
+++ b/xen/arch/arm/vgic/vgic-init.c
@@ -202,6 +202,11 @@ int vcpu_vgic_init(struct vcpu *v)
 {
     int ret = 0;
 
+    v->arch.vgic.private_irqs =
+        xzalloc_array(struct vgic_irq, VGIC_NR_PRIVATE_IRQS);
+    if ( !v->arch.vgic.private_irqs )
+        return -ENOMEM;
+
     vgic_vcpu_early_init(v);
 
     if ( gic_hw_version() == GIC_V2 )
@@ -244,6 +249,8 @@ void vcpu_vgic_free(struct vcpu *v)
     struct vgic_cpu *vgic_cpu = &v->arch.vgic;
 
     INIT_LIST_HEAD(&vgic_cpu->ap_list_head);
+
+    XFREE(v->arch.vgic.private_irqs);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 16:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 16:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199051.1515784 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFlZ-0000lA-Ek; Fri, 09 Jan 2026 16:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199051.1515784; Fri, 09 Jan 2026 16: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 1veFlZ-0000l2-CA; Fri, 09 Jan 2026 16:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1199051;
 Fri, 09 Jan 2026 16: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 1veFlY-0000kq-5C
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 16: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 1veFlX-00GeuW-2i
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFlY-00Fo0l-0G
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16: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=NvuIgS0yephzLMkSXRVfZj4ZasqOrOJ7He1sSgm2b1k=; b=Y3c+lE4pmrgdV2euaq4hPiRZdI
	l6qjAnrooxaem5+OOa4wTqw0q2d0flB5UwtRegm3my7pELgzJjEaQuK0rJtD63voN959n816hl8vc
	yv86ugtF6RS5wEL0m8hBKCDNjmpwdviMiiUljkLFXZxRtZfoK/00H3gwVngGRQJV1gi4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: move alloc/free_vcpu_struct() to common code
Message-Id: <E1veFlY-00Fo0l-0G@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 16:55:12 +0000

commit a6fccf74e18d6cc388d54802e7e30ede3cdb7525
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Jan 7 17:28:59 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen: move alloc/free_vcpu_struct() to common code
    
    alloc_vcpu_struct() and free_vcpu_struct() contain little
    architecture-specific logic and are suitable for sharing across
    architectures. Move both helpers to common code.
    
    To support the remaining architectural differences, introduce
    arch_vcpu_struct_memflags(), allowing architectures to override the
    memory flags passed to alloc_xenheap_pages(). This is currently needed
    by x86, which may require MEMF_bits(32) for HVM guests using shadow
    paging.
    
    The ARM implementation of alloc/free_vcpu_struct() is removed and
    replaced by the common version. Stub implementations are also dropped
    from PPC and RISC-V.
    
    Now that the size of struct vcpu for Arm64 is smaller than PAGE_SIZE,
    MAX_PAGES_PER_VCPU is no longer needed and is removed.
    
    Finally, make alloc_vcpu_struct() and free_vcpu_struct() static to
    common/domain.c, as they are no longer used outside common code.
    
    No functional changes.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain.c             | 17 -----------------
 xen/arch/ppc/stubs.c              | 10 ----------
 xen/arch/riscv/stubs.c            | 10 ----------
 xen/arch/x86/domain.c             | 24 ------------------------
 xen/arch/x86/include/asm/domain.h | 12 ++++++++++++
 xen/common/domain.c               | 20 ++++++++++++++++++++
 xen/include/xen/domain.h          |  4 ----
 7 files changed, 32 insertions(+), 65 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 64b935b680..507df807ed 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -473,23 +473,6 @@ void dump_pageframe_info(struct domain *d)
 
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    struct vcpu *v;
-
-    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
-    v = alloc_xenheap_page();
-    if ( v != NULL )
-        clear_page(v);
-
-    return v;
-}
-
-void free_vcpu_struct(struct vcpu *v)
-{
-    free_xenheap_page(v);
-}
-
 int arch_vcpu_create(struct vcpu *v)
 {
     int rc = 0;
diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c
index 9953ea1c6c..f7f6e7ed97 100644
--- a/xen/arch/ppc/stubs.c
+++ b/xen/arch/ppc/stubs.c
@@ -152,11 +152,6 @@ void dump_pageframe_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
-void free_vcpu_struct(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_vcpu_create(struct vcpu *v)
 {
     BUG_ON("unimplemented");
@@ -264,11 +259,6 @@ void vcpu_kick(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    BUG_ON("unimplemented");
-}
-
 unsigned long
 hypercall_create_continuation(unsigned int op, const char *format, ...)
 {
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index 164fc091b2..29bdb65afb 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -121,11 +121,6 @@ void dump_pageframe_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
-void free_vcpu_struct(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_vcpu_create(struct vcpu *v)
 {
     BUG_ON("unimplemented");
@@ -233,11 +228,6 @@ void vcpu_kick(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    BUG_ON("unimplemented");
-}
-
 unsigned long
 hypercall_create_continuation(unsigned int op, const char *format, ...)
 {
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 7632d5e2d6..c29a6b0dec 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -493,30 +493,6 @@ unsigned int arch_domain_struct_memflags(void)
     return MEMF_bits(bits);
 }
 
-struct vcpu *alloc_vcpu_struct(const struct domain *d)
-{
-    struct vcpu *v;
-    /*
-     * This structure contains embedded PAE PDPTEs, used when an HVM guest
-     * runs on shadow pagetables outside of 64-bit mode. In this case the CPU
-     * may require that the shadow CR3 points below 4GB, and hence the whole
-     * structure must satisfy this restriction. Thus we specify MEMF_bits(32).
-     */
-    unsigned int memflags =
-        (is_hvm_domain(d) && paging_mode_shadow(d)) ? MEMF_bits(32) : 0;
-
-    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
-    v = alloc_xenheap_pages(0, memflags);
-    if ( v != NULL )
-        clear_page(v);
-    return v;
-}
-
-void free_vcpu_struct(struct vcpu *v)
-{
-    free_xenheap_page(v);
-}
-
 /* Initialise various registers to their architectural INIT/RESET state. */
 void arch_vcpu_regs_init(struct vcpu *v)
 {
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 16cd45cc32..effb23a234 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -15,6 +15,18 @@
 unsigned int arch_domain_struct_memflags(void);
 #define arch_domain_struct_memflags arch_domain_struct_memflags
 
+/*
+ * This structure contains embedded PAE PDPTEs, used when an HVM guest
+ * runs on shadow pagetables outside of 64-bit mode. In this case the CPU
+ * may require that the shadow CR3 points below 4GB, and hence the whole
+ * structure must satisfy this restriction. Thus we specify MEMF_bits(32).
+ */
+#define arch_vcpu_struct_memflags(d) ({                                 \
+    const struct domain *d_ = (d);                                      \
+                                                                        \
+    (is_hvm_domain(d_) && paging_mode_shadow(d_) ? MEMF_bits(32) : 0);  \
+})
+
 #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
 
 /*
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 93c71bc766..655d9590f8 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -316,6 +316,26 @@ static void vcpu_info_reset(struct vcpu *v)
          : &dummy_vcpu_info);
 }
 
+static struct vcpu *alloc_vcpu_struct(const struct domain *d)
+{
+#ifndef arch_vcpu_struct_memflags
+# define arch_vcpu_struct_memflags(d) ((void)(d), 0)
+#endif
+    struct vcpu *v;
+
+    BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE);
+    v = alloc_xenheap_pages(0, arch_vcpu_struct_memflags(d));
+    if ( v )
+        clear_page(v);
+
+    return v;
+}
+
+static void free_vcpu_struct(struct vcpu *v)
+{
+    free_xenheap_page(v);
+}
+
 static void vmtrace_free_buffer(struct vcpu *v)
 {
     const struct domain *d = v->domain;
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 8aab05ae93..644f5ac3f2 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -70,10 +70,6 @@ void domid_free(domid_t domid);
 struct domain *alloc_domain_struct(void);
 void free_domain_struct(struct domain *d);
 
-/* Allocate/free a VCPU structure. */
-struct vcpu *alloc_vcpu_struct(const struct domain *d);
-void free_vcpu_struct(struct vcpu *v);
-
 /* Allocate/free a PIRQ structure. */
 #ifndef alloc_pirq_struct
 struct pirq *alloc_pirq_struct(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 16:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 16:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199052.1515789 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFlj-0000nD-G4; Fri, 09 Jan 2026 16:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199052.1515789; Fri, 09 Jan 2026 16: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 1veFlj-0000n5-DW; Fri, 09 Jan 2026 16:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1199052;
 Fri, 09 Jan 2026 16: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 1veFli-0000my-8T
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 16: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 1veFlh-00Geuc-32
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFli-00Fo1W-0b
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16: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=nQPDVJzCk6uuRYbtPucquWNpPheUrwHnOd4il2lqsxw=; b=QroSDDvcNEB4VthdXJWbkGqdVb
	4KKr6JdfoeQaugBvJ6T7dcMKJfi/4AubjsOgUVzrkzGkH/A7tD7YG8qu1EJxYyBB5y1MuyKD1ON2c
	rR9Z1COfmbxzh8VCFHcSsBee8h7KGt+YFmXQYmMxuTV59uU2OoDdJs+72UOmcJT1JajE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: make {alloc,free}_domain_struct() static
Message-Id: <E1veFli-00Fo1W-0b@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 16:55:22 +0000

commit 7099115b798d75529f5c58d1a05b894e32e5a895
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Jan 7 17:29:00 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen/common: make {alloc,free}_domain_struct() static
    
    As {alloc,free}_domain_struct() are used only within domain.c,
    they can be declared static and their declarations removed
    from xen/domain.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/domain.c      | 42 +++++++++++++++++++++---------------------
 xen/include/xen/domain.h |  4 ----
 2 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 655d9590f8..ed4b6175de 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -316,6 +316,27 @@ static void vcpu_info_reset(struct vcpu *v)
          : &dummy_vcpu_info);
 }
 
+static struct domain *alloc_domain_struct(void)
+{
+#ifndef arch_domain_struct_memflags
+# define arch_domain_struct_memflags() 0
+#endif
+
+    struct domain *d = alloc_xenheap_pages(0, arch_domain_struct_memflags());
+
+    BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
+
+    if ( d )
+        clear_page(d);
+
+    return d;
+}
+
+static void free_domain_struct(struct domain *d)
+{
+    free_xenheap_page(d);
+}
+
 static struct vcpu *alloc_vcpu_struct(const struct domain *d)
 {
 #ifndef arch_vcpu_struct_memflags
@@ -819,27 +840,6 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
     return arch_sanitise_domain_config(config);
 }
 
-struct domain *alloc_domain_struct(void)
-{
-#ifndef arch_domain_struct_memflags
-# define arch_domain_struct_memflags() 0
-#endif
-
-    struct domain *d = alloc_xenheap_pages(0, arch_domain_struct_memflags());
-
-    BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
-
-    if ( d )
-        clear_page(d);
-
-    return d;
-}
-
-void free_domain_struct(struct domain *d)
-{
-    free_xenheap_page(d);
-}
-
 struct domain *domain_create(domid_t domid,
                              struct xen_domctl_createdomain *config,
                              unsigned int flags)
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 644f5ac3f2..273717c31b 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -66,10 +66,6 @@ void domid_free(domid_t domid);
  * Arch-specifics.
  */
 
-/* Allocate/free a domain structure. */
-struct domain *alloc_domain_struct(void);
-void free_domain_struct(struct domain *d);
-
 /* Allocate/free a PIRQ structure. */
 #ifndef alloc_pirq_struct
 struct pirq *alloc_pirq_struct(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 16:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 16:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199053.1515793 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFlt-0000pZ-Hg; Fri, 09 Jan 2026 16:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199053.1515793; Fri, 09 Jan 2026 16: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 1veFlt-0000pR-Eo; Fri, 09 Jan 2026 16:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1199053;
 Fri, 09 Jan 2026 16: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 1veFls-0000pE-Bp
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 16: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 1veFls-00Gewv-07
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFls-00Fo6y-0u
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16: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=1+rkS4RIlvyMwxnAjwtIRzhh9iF8N9uTpgDcVnyAkms=; b=hXrMnhzSikcqy8IzC4rJnkZW3L
	9R3lI4tUTQZg2Y2vD7pcn8slIpCKuVCH38GxSMIBez3oX5o48lzw1N7mYl+8OkkIbnreWNS7BanYK
	/u/XG8HYjliqjv0VIIUKatvUqr6MzGpR/4wDvozSvvkY3msAcb8vifSWK+/0oext5BFk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Correct comment about struct vcpu memflags restriction
Message-Id: <E1veFls-00Fo6y-0u@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 16:55:32 +0000

commit d2be48728a640c14a8179d88b9ec87d007a785c4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 23 12:44:02 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    x86: Correct comment about struct vcpu memflags restriction
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index effb23a234..94b0cf7f1d 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -17,7 +17,7 @@ unsigned int arch_domain_struct_memflags(void);
 
 /*
  * This structure contains embedded PAE PDPTEs, used when an HVM guest
- * runs on shadow pagetables outside of 64-bit mode. In this case the CPU
+ * runs on shadow pagetables outside of Long mode. In this case the CPU
  * may require that the shadow CR3 points below 4GB, and hence the whole
  * structure must satisfy this restriction. Thus we specify MEMF_bits(32).
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 16:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 16:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199054.1515797 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFm3-0000s7-In; Fri, 09 Jan 2026 16:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199054.1515797; Fri, 09 Jan 2026 16: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 1veFm3-0000rz-GB; Fri, 09 Jan 2026 16:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1199054;
 Fri, 09 Jan 2026 16: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 1veFm2-0000rs-Du
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 16: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 1veFm2-00Gewz-0O
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFm2-00FoOn-1D
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=g7AL8ElHlfbe6208/zAEhlQOCQvlJbkmkOPuV5eypro=; b=vtZr0EXj4/VQu7Y6Apgy0EkJ2e
	BhX3H3nj2BHuBzMVOfg/nCe7mHDrnlXFgArILzh3+5V84tijG8hYoxtGxj2by83dWWQFhMU2rLAyo
	z6cW+5L1BakhHEqwjkr47G+pua9BNv39XBP2X9YV4H8672OKusF0xRjKJPaC6mV8NPzY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/gen_hypercall: Leave a breadcrumb in xen-hypercall-defs.h
Message-Id: <E1veFm2-00FoOn-1D@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 16:55:42 +0000

commit 913f40f4d1a5929024756a9c029d15df097982bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 19:08:44 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    xen/gen_hypercall: Leave a breadcrumb in xen-hypercall-defs.h
    
    When Cscope-ing through Xen, one occasionally finds themselves in
    xen-hypercall-defs.h and needing to find the originating file.
    
    This is substantially magic, and even reading the Makefile that produces
    xen-hypercall-defs.h is of little help if you're not aware of of the %.i : %.c
    pattern rule, and that the header is generated from a .c file in practice.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/scripts/gen_hypercall.awk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/scripts/gen_hypercall.awk b/xen/scripts/gen_hypercall.awk
index b544fe1c4d..c137f8fc4e 100644
--- a/xen/scripts/gen_hypercall.awk
+++ b/xen/scripts/gen_hypercall.awk
@@ -4,7 +4,7 @@
 BEGIN {
     printf("#ifndef XEN_HYPERCALL_DEFS_H\n");
     printf("#define XEN_HYPERCALL_DEFS_H\n\n");
-    printf("/* Generated file, do not edit! */\n\n");
+    printf("/* Automatically generated from xen/include/hypercall-defs.c - do not edit! */\n\n");
     e = 0;
     n = 0;
     p = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 16:55:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 16:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199055.1515801 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFmD-0000uH-KE; Fri, 09 Jan 2026 16:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199055.1515801; Fri, 09 Jan 2026 16:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veFmD-0000uA-Hb; Fri, 09 Jan 2026 16:55:53 +0000
Received: by outflank-mailman (input) for mailman id 1199055;
 Fri, 09 Jan 2026 16:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veFmC-0000tv-Hr
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 16:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFmC-00Gex6-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veFmC-00FoQJ-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 16:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YhB2Q9hPYpLEDp7dRbt8rXoVYsTJZPO2YK4HDcsq89s=; b=mTdmLKQXwsMvuT7MSQNAbGDjiB
	qEnI6o7coyMWIJ9KAlXLPTjpqM3yr5PtpIswrzDP0faULPBfhzhbMjVUZ6o12CR915bWWMp6s68mg
	yABKCViUlKTNpoe+xL0wKgiZOz4d6efzXr7DfiHLfLiYsB+zY4OrI/rKvf9cWgsXSQgw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MISRA: Extend the R3.1 deviation for URLs to include git://
Message-Id: <E1veFmC-00FoQJ-1U@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 16:55:52 +0000

commit fe0ede8fe4ac19f6b5f8ab3428f78d1c19fc3f71
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 7 12:42:07 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 14:24:24 2026 +0000

    MISRA: Extend the R3.1 deviation for URLs to include git://
    
    xen/drivers/passthrough/arm/ipmmu-vmsa.c contains a git:// URL in a block
    comment.  This is also not an example of commented out code, so shouldn't be
    considered a R3.1 violation.
    
    Extend the regex to include git://, and swap hyperlink for URL in the
    associated documentation to be more precise.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++--
 docs/misra/deviations.rst                        | 4 ++--
 docs/misra/rules.rst                             | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 7dee4a488d..30c3239069 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -58,9 +58,9 @@ removed by the compiler, the resulting slowdown is negligible."
 # Series 3.
 #
 
--doc_begin="Comments starting with '/*' and containing hyperlinks are safe as
+-doc_begin="Comments starting with '/*' and containing URLs are safe as
 they are not instances of commented-out code."
--config=MC3A2.R3.1,reports+={safe, "first_area(text(^.*https?://.*$))"}
+-config=MC3A2.R3.1,reports+={safe, "first_area(text(^.*(https?|git)://.*$))"}
 -doc_end
 
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 0d90f5886e..17c21537f2 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -117,8 +117,8 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR.
 
    * - R3.1
-     - Comments starting with '/\*' and containing hyperlinks are safe as they
-       are not instances of commented-out code.
+     - Comments starting with '/\*' and containing URLs are safe as they are
+       not instances of commented-out code.
      - Tagged as `safe` for ECLAIR.
 
    * - R5.3
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 4e94251887..b3e929307d 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -143,7 +143,7 @@ maintainers if you want to suggest a change.
      - Required
      - The character sequences /* and // shall not be used within a
        comment
-     - Comments containing hyperlinks inside C-style block comments are safe
+     - Comments containing URLs inside C-style block comments are safe
 
    * - `Rule 3.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_03_02.c>`_
      - Required
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 19:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 19:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199150.1515825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veIEJ-0003CO-KS; Fri, 09 Jan 2026 19:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199150.1515825; Fri, 09 Jan 2026 19:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veIEJ-0003CH-HD; Fri, 09 Jan 2026 19:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1199150;
 Fri, 09 Jan 2026 19:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1veIEH-0003CB-Sq
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 19:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veIEH-00GheV-1o
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 19:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veIEH-00FzTl-2b
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 19:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WBjTL277/1+atXD7g+bR6zIxIWU2Wh6TUNl4A1hSOiE=; b=bkvaL6mTLvHMrRe6hBUfsMf3oa
	RP/muJKo1Th9V4FR7jeH+21AanlMCgqwue083cTiLEW85ggZ6S1SfFP9KiYBjY8PzCU6rTxW7euaB
	ZmUzY5hbTtBNQKR/6dZxJSvsOR1vXJZRjqEtzScJ5J/zg3zfNbKs7Zza+4DPza0J7xOs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Drop xenoprofile support
Message-Id: <E1veIEH-00FzTl-2b@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 19:33:01 +0000

commit 69e8aaf9cce2253a5fd088bc64e9139dcbb47f8a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 18:54:45 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 19:05:45 2026 +0000

    xen: Drop xenoprofile support
    
    The most recent xenoprof change was 300ef0cb4fde ("x86: Add Xenoprofile
    support for AMD Family16h") in 2013, despite there being 42 changes worth of
    other cleanup/rearranging since then.
    
    Oprofile themselves dropped Xen support in commit 0c142c3a096d ("Remove
    opcontrol and the GUI and processor models dependent on it") in 2014, as part
    of releasing version 1.0 and switching over to using operf based on the Linux
    perf_event subsystem.  Linux's version of this patch was merged in commit
    24880bef417f ("Merge tag 'oprofile-removal-5.12'") in 2021.
    
    Drop xenoprof and all supporting infrastructure, including the hypercall, the
    XSM hook and flask vectors which lose their only caller, and even shrinks
    struct domain by one pointer which wasn't properly excluded in
    !CONFIG_XENOPROF builds.
    
    Retain the public xenoprof.h header as it is ABI, but note that the
    functionality is removed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 CHANGELOG.md                            |   3 +
 docs/misc/xen-command-line.pandoc       |   6 -
 tools/flask/policy/modules/dom0.te      |   2 -
 xen/arch/x86/Makefile                   |   1 -
 xen/arch/x86/cpu/vpmu_amd.c             |   9 -
 xen/arch/x86/cpu/vpmu_intel.c           |   6 -
 xen/arch/x86/hvm/svm/entry.S            |   1 -
 xen/arch/x86/hvm/svm/svm.c              |   2 -
 xen/arch/x86/hvm/vmx/vmx.c              |   9 -
 xen/arch/x86/include/asm/vpmu.h         |   2 +-
 xen/arch/x86/include/asm/xenoprof.h     |  95 ----
 xen/arch/x86/oprofile/Makefile          |   6 -
 xen/arch/x86/oprofile/backtrace.c       | 145 -----
 xen/arch/x86/oprofile/nmi_int.c         | 485 ----------------
 xen/arch/x86/oprofile/op_counter.h      |  41 --
 xen/arch/x86/oprofile/op_model_athlon.c | 547 ------------------
 xen/arch/x86/oprofile/op_model_p4.c     | 721 -----------------------
 xen/arch/x86/oprofile/op_model_ppro.c   | 348 ------------
 xen/arch/x86/oprofile/op_x86_model.h    |  58 --
 xen/arch/x86/oprofile/xenoprof.c        | 106 ----
 xen/arch/x86/traps.c                    |   4 -
 xen/common/Kconfig                      |  11 -
 xen/common/Makefile                     |   1 -
 xen/common/compat/xenoprof.c            |  42 --
 xen/common/domain.c                     |   6 -
 xen/common/xenoprof.c                   | 977 --------------------------------
 xen/include/Makefile                    |   1 -
 xen/include/hypercall-defs.c            |   6 -
 xen/include/public/xen.h                |   2 +-
 xen/include/public/xenoprof.h           |   2 +-
 xen/include/xen/sched.h                 |   3 -
 xen/include/xen/xenoprof.h              |  49 --
 xen/include/xsm/dummy.h                 |   7 -
 xen/include/xsm/xsm.h                   |   7 -
 xen/xsm/dummy.c                         |   2 -
 xen/xsm/flask/hooks.c                   |  35 --
 xen/xsm/flask/policy/access_vectors     |   4 -
 37 files changed, 6 insertions(+), 3746 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3aaf598623..1663f6878e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - The cpuid_mask_* command line options for legacy AMD CPUs.  These were
      deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from
      2011 onwards.
+   - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
+     prior to the version 1.0 release, and there has been no development since
+     before then in Xen.
 
 ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
 
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index bbbdf6a5bb..50d7edb248 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -508,12 +508,6 @@ character, but for xen to keep the console.
 
 > Default: `power`
 
-### cpu_type (x86)
-> `= arch_perfmon`
-
-If set, force use of the performance counters for oprofile, rather than detecting
-available support.
-
 ### cpufreq
 > `= none | {{ <boolean> | xen } { [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfreq>]]] } [,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]] | amd-cppc[:[active][,verbose]]`
 
diff --git a/tools/flask/policy/modules/dom0.te b/tools/flask/policy/modules/dom0.te
index ad2b4f9ea7..d30edf8be1 100644
--- a/tools/flask/policy/modules/dom0.te
+++ b/tools/flask/policy/modules/dom0.te
@@ -21,8 +21,6 @@ allow dom0_t xen_t:xen {
 	writeconsole
 	readapic
 	writeapic
-	privprofile
-	nonprivprofile
 	kexec
 	firmware
 	sleep
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 1fc651146f..d8b41cec16 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -7,7 +7,6 @@ obj-$(CONFIG_GUEST) += guest/
 obj-$(CONFIG_HVM) += hvm/
 obj-y += lib/
 obj-y += mm/
-obj-$(CONFIG_XENOPROF) += oprofile/
 obj-$(CONFIG_PV) += pv/
 obj-y += x86_64/
 obj-y += x86_emulate/
diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index fa157d45dd..d1f6bd5495 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -12,7 +12,6 @@
 
 #include <xen/err.h>
 #include <xen/sched.h>
-#include <xen/xenoprof.h>
 
 #include <asm/apic.h>
 #include <asm/hvm/save.h>
@@ -363,8 +362,6 @@ static int cf_check amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     if ( (type == MSR_TYPE_CTRL) &&
         is_pmu_enabled(msr_content) && !vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
-        if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
-            return 0;
         vpmu_set(vpmu, VPMU_RUNNING);
 
         if ( is_svm_vcpu(v) && is_msr_bitmap_on(vpmu) )
@@ -378,7 +375,6 @@ static int cf_check amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( is_svm_vcpu(v) && is_msr_bitmap_on(vpmu) )
              amd_vpmu_unset_msr_bitmap(v);
-        release_pmu_ownership(PMU_OWNER_HVM);
     }
 
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
@@ -426,9 +422,6 @@ static void cf_check amd_vpmu_destroy(struct vcpu *v)
     vpmu->context = NULL;
     vpmu->priv_context = NULL;
 
-    if ( vpmu_is_set(vpmu, VPMU_RUNNING) )
-        release_pmu_ownership(PMU_OWNER_HVM);
-
     vpmu_clear(vpmu);
 }
 
@@ -449,8 +442,6 @@ static void cf_check amd_vpmu_dump(const struct vcpu *v)
     }
 
     printk("(");
-    if ( vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-        printk("PASSIVE_DOMAIN_ALLOCATED, ");
     if ( vpmu_is_set(vpmu, VPMU_FROZEN) )
         printk("FROZEN, ");
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 7ce98ee42e..1e3b06ef8e 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -9,7 +9,6 @@
 
 #include <xen/err.h>
 #include <xen/sched.h>
-#include <xen/xenoprof.h>
 #include <asm/system.h>
 #include <asm/regs.h>
 #include <asm/apic.h>
@@ -441,9 +440,6 @@ static int cf_check core2_vpmu_alloc_resource(struct vcpu *v)
     struct xen_pmu_intel_ctxt *core2_vpmu_cxt = NULL;
     uint64_t *p = NULL;
 
-    if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
-        return 0;
-
     if ( is_vmx_vcpu(v) )
     {
         if ( vmx_add_host_load_msr(v, MSR_CORE_PERF_GLOBAL_CTRL, 0) )
@@ -487,7 +483,6 @@ static int cf_check core2_vpmu_alloc_resource(struct vcpu *v)
     return 1;
 
 out_err:
-    release_pmu_ownership(PMU_OWNER_HVM);
 
     xfree(core2_vpmu_cxt);
     xfree(p);
@@ -814,7 +809,6 @@ static void cf_check core2_vpmu_destroy(struct vcpu *v)
     vpmu->priv_context = NULL;
     if ( is_vmx_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v);
-    release_pmu_ownership(PMU_OWNER_HVM);
     vpmu_clear(vpmu);
 }
 
diff --git a/xen/arch/x86/hvm/svm/entry.S b/xen/arch/x86/hvm/svm/entry.S
index 610c64bf4c..af8db23b03 100644
--- a/xen/arch/x86/hvm/svm/entry.S
+++ b/xen/arch/x86/hvm/svm/entry.S
@@ -155,7 +155,6 @@ __UNLIKELY_END(nsvm_hap)
          * to safely resolve any Spectre-v1 concerns in the above logic.
          */
         stgi
-LABEL(svm_stgi_label, 0)
         call svm_vmexit_handler
         jmp  .Lsvm_do_resume
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 1208999454..da113f488b 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -36,7 +36,6 @@
 #include <asm/paging.h>
 #include <asm/processor.h>
 #include <asm/x86_emulate.h>
-#include <asm/xenoprof.h>
 
 #include <public/sched.h>
 
@@ -1152,7 +1151,6 @@ static int cf_check svm_vcpu_initialise(struct vcpu *v)
 static void cf_check svm_vcpu_destroy(struct vcpu *v)
 {
     svm_destroy_vmcb(v);
-    passive_domain_destroy(v);
 }
 
 /*
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 05b59cb8e4..f4beac192d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -48,7 +48,6 @@
 #include <asm/spec_ctrl.h>
 #include <asm/stubs.h>
 #include <asm/x86_emulate.h>
-#include <asm/xenoprof.h>
 
 #include <public/arch-x86/cpuid.h>
 #include <public/hvm/ioreq.h>
@@ -692,7 +691,6 @@ static void cf_check vmx_vcpu_destroy(struct vcpu *v)
      */
     vmx_vcpu_disable_pml(v);
     vmx_destroy_vmcs(v);
-    passive_domain_destroy(v);
 }
 
 /*
@@ -3560,9 +3558,6 @@ static int cf_check vmx_msr_read_intercept(
         break;
 
     default:
-        if ( passive_domain_do_rdmsr(msr, msr_content) )
-            goto done;
-
         if ( vmx_read_guest_msr(curr, msr, msr_content) == 0 )
             break;
 
@@ -3582,7 +3577,6 @@ static int cf_check vmx_msr_read_intercept(
         goto gp_fault;
     }
 
-done:
     HVM_DBG_LOG(DBG_LEVEL_MSR, "returns: ecx=%#x, msr_value=%#"PRIx64,
                 msr, *msr_content);
     return X86EMUL_OKAY;
@@ -3875,9 +3869,6 @@ static int cf_check vmx_msr_write_intercept(
         break;
 
     default:
-        if ( passive_domain_do_wrmsr(msr, msr_content) )
-            return X86EMUL_OKAY;
-
         if ( vmx_write_guest_msr(v, msr, msr_content) == 0 ||
              is_last_branch_msr(msr) )
             break;
diff --git a/xen/arch/x86/include/asm/vpmu.h b/xen/arch/x86/include/asm/vpmu.h
index dae9b43dac..d4504201fe 100644
--- a/xen/arch/x86/include/asm/vpmu.h
+++ b/xen/arch/x86/include/asm/vpmu.h
@@ -65,7 +65,7 @@ struct vpmu_struct {
 #define VPMU_RUNNING                        0x0008
 #define VPMU_CONTEXT_SAVE                   0x0010  /* Force context save */
 #define VPMU_FROZEN                         0x0020  /* Stop counters while VCPU is not running */
-#define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x0040
+/* 0x0040 available */
 /* PV(H) guests: VPMU registers are accessed by guest from shared page */
 #define VPMU_CACHED                         0x0080
 #define VPMU_AVAILABLE                      0x0100
diff --git a/xen/arch/x86/include/asm/xenoprof.h b/xen/arch/x86/include/asm/xenoprof.h
deleted file mode 100644
index dc6f822d32..0000000000
--- a/xen/arch/x86/include/asm/xenoprof.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/******************************************************************************
- * asm-x86/xenoprof.h
- * xenoprof x86 arch specific header file
- *
- * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- */
-
-#ifndef __ASM_X86_XENOPROF_H__
-#define __ASM_X86_XENOPROF_H__
-
-struct vcpu;
-
-#ifdef CONFIG_XENOPROF
-
-#include <public/xen.h>
-
-int nmi_reserve_counters(void);
-int nmi_setup_events(void);
-int nmi_enable_virq(void);
-int nmi_start(void);
-void nmi_stop(void);
-void nmi_disable_virq(void);
-void nmi_release_counters(void);
-
-int xenoprof_arch_init(int *num_events, char *cpu_type);
-#define xenoprof_arch_reserve_counters()        nmi_reserve_counters()
-#define xenoprof_arch_setup_events()            nmi_setup_events()
-#define xenoprof_arch_enable_virq()             nmi_enable_virq()
-#define xenoprof_arch_start()                   nmi_start()
-#define xenoprof_arch_stop()                    nmi_stop()
-#define xenoprof_arch_disable_virq()            nmi_disable_virq()
-#define xenoprof_arch_release_counters()        nmi_release_counters()
-
-int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
-
-struct cpu_user_regs;
-
-/* AMD IBS support */
-void ibs_init(void);
-extern u32 ibs_caps;
-
-int xenoprofile_get_mode(struct vcpu *, const struct cpu_user_regs *);
-
-static inline int xenoprof_backtrace_supported(void)
-{
-    return 1;
-}
-
-void xenoprof_backtrace(struct vcpu *, const struct cpu_user_regs *,
-                        unsigned long depth, int mode);
-
-int passive_domain_do_rdmsr(unsigned int msr, uint64_t *msr_content);
-int passive_domain_do_wrmsr(unsigned int msr, uint64_t msr_content);
-void passive_domain_destroy(struct vcpu *v);
-
-bool nmi_oprofile_send_virq(void);
-
-#else
-
-static inline int passive_domain_do_rdmsr(unsigned int msr,
-                                          uint64_t *msr_content)
-{
-    return 0;
-}
-
-static inline int passive_domain_do_wrmsr(unsigned int msr,
-                                          uint64_t msr_content)
-{
-    return 0;
-}
-
-static inline void passive_domain_destroy(struct vcpu *v) {}
-
-static inline bool nmi_oprofile_send_virq(void)
-{
-    return false;
-}
-
-#endif /* CONFIG_XENOPROF */
-
-#endif /* __ASM_X86_XENOPROF_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/x86/oprofile/Makefile b/xen/arch/x86/oprofile/Makefile
deleted file mode 100644
index 956e3d1b5d..0000000000
--- a/xen/arch/x86/oprofile/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-obj-y += xenoprof.o
-obj-y += nmi_int.o
-obj-y += op_model_p4.o
-obj-y += op_model_ppro.o
-obj-y += op_model_athlon.o
-obj-y += backtrace.o
diff --git a/xen/arch/x86/oprofile/backtrace.c b/xen/arch/x86/oprofile/backtrace.c
deleted file mode 100644
index 61de18c8d5..0000000000
--- a/xen/arch/x86/oprofile/backtrace.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * @file backtrace.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- * @author David Smith
- * Modified for Xen by Amitabha Roy
- *
- */
-
-#include <xen/types.h>
-#include <asm/page.h>
-#include <xen/xenoprof.h>
-#include <xen/guest_access.h>
-
-struct __packed frame_head {
-    struct frame_head * ebp;
-    unsigned long ret;
-};
-typedef struct frame_head frame_head_t;
-
-struct __packed frame_head_32bit {
-    uint32_t ebp;
-    uint32_t ret;
-};
-typedef struct frame_head_32bit frame_head32_t;
-
-static struct frame_head *
-dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
-                          int mode)
-{
-    if (!xenoprof_add_trace(vcpu, head->ret, mode))
-        return 0;
-    
-    /* frame pointers should strictly progress back up the stack
-     * (towards higher addresses) */
-    if (head >= head->ebp)
-        return NULL;
-    
-    return head->ebp;
-}
-
-static inline int is_32bit_vcpu(struct vcpu *vcpu)
-{
-    if (is_hvm_vcpu(vcpu))
-        return !hvm_long_mode_active(vcpu);
-    else
-        return is_pv_32bit_vcpu(vcpu);
-}
-
-static struct frame_head *
-dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,
-                     int mode)
-{
-    /* Also check accessibility of one struct frame_head beyond. */
-    frame_head_t bufhead[2];
-
-    if ( is_32bit_vcpu(vcpu) )
-    {
-        frame_head32_t bufhead32[2];
-
-        if ( raw_copy_from_guest(bufhead32, head, sizeof(bufhead32)) )
-            return 0;
-        bufhead[0].ebp = (struct frame_head *)(unsigned long)bufhead32[0].ebp;
-        bufhead[0].ret = bufhead32[0].ret;
-    }
-    else if ( raw_copy_from_guest(bufhead, head, sizeof(bufhead)) )
-        return 0;
-    
-    if ( !xenoprof_add_trace(vcpu, bufhead[0].ret, mode) )
-        return 0;
-    
-    /* frame pointers should strictly progress back up the stack
-     * (towards higher addresses) */
-    if ( head >= bufhead[0].ebp )
-        return NULL;
-    
-    return bufhead[0].ebp;
-}
-
-/*
- * |             | /\ Higher addresses
- * |             |
- * --------------- stack base (address of current_thread_info)
- * | thread info |
- * .             .
- * |    stack    |
- * --------------- saved regs->ebp value if valid (frame_head address)
- * .             .
- * --------------- saved regs->rsp value if x86_64
- * |             |
- * --------------- struct pt_regs * stored on stack if 32-bit
- * |             |
- * .             .
- * |             |
- * --------------- %esp
- * |             |
- * |             | \/ Lower addresses
- *
- * Thus, regs (or regs->rsp for x86_64) <-> stack base restricts the
- * valid(ish) ebp values. Note: (1) for x86_64, NMI and several other
- * exceptions use special stacks, maintained by the interrupt stack table
- * (IST). These stacks are set up in trap_init() in
- * arch/x86_64/kernel/traps.c. Thus, for x86_64, regs now does not point
- * to the kernel stack; instead, it points to some location on the NMI
- * stack. On the other hand, regs->rsp is the stack pointer saved when the
- * NMI occurred. (2) For 32-bit, regs->esp is not valid because the
- * processor does not save %esp on the kernel stack when interrupts occur
- * in the kernel mode.
- */
-#if defined(CONFIG_FRAME_POINTER)
-static int valid_hypervisor_stack(const struct frame_head *head,
-				  const struct cpu_user_regs *regs)
-{
-    unsigned long headaddr = (unsigned long)head;
-    unsigned long stack = (unsigned long)regs->rsp;
-    unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
-
-    return headaddr > stack && headaddr < stack_base;
-}
-#else
-/* without fp, it's just junk */
-static int valid_hypervisor_stack(const struct frame_head *head,
-				  const struct cpu_user_regs *regs)
-{
-    return 0;
-}
-#endif
-
-void xenoprof_backtrace(struct vcpu *vcpu, const struct cpu_user_regs *regs,
-			unsigned long depth, int mode)
-{
-    const struct frame_head *head = (void *)regs->rbp;
-
-    if (mode > 1) {
-        while (depth-- && valid_hypervisor_stack(head, regs))
-            head = dump_hypervisor_backtrace(vcpu, head, mode);
-        return;
-    }
-
-    while (depth-- && head)
-        head = dump_guest_backtrace(vcpu, head, mode);
-}
diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
deleted file mode 100644
index 1d6454cf39..0000000000
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ /dev/null
@@ -1,485 +0,0 @@
-/**
- * @file nmi_int.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- *
- * Modified for Xen: by Aravind Menon & Jose Renato Santos
- *   These modifications are:
- *   Copyright (C) 2005 Hewlett-Packard Co.
- */
-
-#include <xen/event.h>
-#include <xen/types.h>
-#include <xen/errno.h>
-#include <xen/init.h>
-#include <xen/param.h>
-#include <xen/string.h>
-#include <xen/delay.h>
-#include <xen/xenoprof.h>
-#include <xen/xvmalloc.h>
-
-#include <public/xenoprof.h>
-
-#include <asm/msr.h>
-#include <asm/apic.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-#include <asm/nmi.h>
-
-#include "op_counter.h"
-#include "op_x86_model.h"
-
-struct op_counter_config counter_config[OP_MAX_COUNTER];
-struct op_ibs_config ibs_config;
-
-struct op_x86_model_spec const *__read_mostly model;
-static struct op_msrs cpu_msrs[NR_CPUS];
-static unsigned long saved_lvtpc[NR_CPUS];
-
-static const char *cpu_type;
-
-static DEFINE_PER_CPU(struct vcpu *, nmi_cont_vcpu);
-
-static int passive_domain_msr_op_checks(unsigned int msr, int *typep, int *indexp)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(current);
-	if ( model == NULL )
-		return 0;
-	if ( model->is_arch_pmu_msr == NULL )
-		return 0;
-	if ( !model->is_arch_pmu_msr(msr, typep, indexp) )
-		return 0;
-
-	if ( !vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-		if ( ! model->allocated_msr(current) )
-			return 0;
-	return 1;
-}
-
-int passive_domain_do_rdmsr(unsigned int msr, uint64_t *msr_content)
-{
-	int type, index;
-
-	if ( !passive_domain_msr_op_checks(msr, &type, &index))
-		return 0;
-
-	model->load_msr(current, type, index, msr_content);
-	return 1;
-}
-
-int passive_domain_do_wrmsr(unsigned int msr, uint64_t msr_content)
-{
-	int type, index;
-
-	if ( !passive_domain_msr_op_checks(msr, &type, &index))
-		return 0;
-
-	model->save_msr(current, type, index, msr_content);
-	return 1;
-}
-
-void passive_domain_destroy(struct vcpu *v)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(v);
-	if ( vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-		model->free_msr(v);
-}
-
-bool nmi_oprofile_send_virq(void)
-{
-	struct vcpu *v = xchg(&this_cpu(nmi_cont_vcpu), NULL);
-
-	if (v)
-		send_guest_vcpu_virq(v, VIRQ_XENOPROF);
-
-	return v;
-}
-
-static int cf_check nmi_callback(const struct cpu_user_regs *regs, int cpu)
-{
-	int xen_mode, ovf;
-
-	ovf = model->check_ctrs(cpu, &cpu_msrs[cpu], regs);
-	xen_mode = ring_0(regs);
-	if (ovf && is_active(current->domain) && !xen_mode &&
-	    !this_cpu(nmi_cont_vcpu)) {
-		this_cpu(nmi_cont_vcpu) = current;
-		trigger_nmi_continuation();
-	}
-
-	if ( ovf == 2 )
-		current->arch.nmi_pending = true;
-	return 1;
-}
-
-
-static void nmi_cpu_save_registers(struct op_msrs *msrs)
-{
-	unsigned int const nr_ctrs = model->num_counters;
-	unsigned int const nr_ctrls = model->num_controls;
-	struct op_msr *counters = msrs->counters;
-	struct op_msr *controls = msrs->controls;
-	unsigned int i;
-
-	for (i = 0; i < nr_ctrs; ++i) {
-		rdmsrl(counters[i].addr, counters[i].value);
-	}
-
-	for (i = 0; i < nr_ctrls; ++i) {
-		rdmsrl(controls[i].addr, controls[i].value);
-	}
-}
-
-
-static void cf_check nmi_save_registers(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs * msrs = &cpu_msrs[cpu];
-	model->fill_in_addresses(msrs);
-	nmi_cpu_save_registers(msrs);
-}
-
-
-static void free_msrs(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < nr_cpu_ids; ++i) {
-		XVFREE(cpu_msrs[i].counters);
-		XVFREE(cpu_msrs[i].controls);
-	}
-}
-
-
-static int allocate_msrs(void)
-{
-	unsigned int i;
-	int success = 1;
-
-	for_each_online_cpu (i) {
-		cpu_msrs[i].counters = xvmalloc_array(struct op_msr,
-						      model->num_counters);
-		if (!cpu_msrs[i].counters) {
-			success = 0;
-			break;
-		}
-		cpu_msrs[i].controls = xvmalloc_array(struct op_msr,
-						      model->num_controls);
-		if (!cpu_msrs[i].controls) {
-			success = 0;
-			break;
-		}
-	}
-
-	if (!success)
-		free_msrs();
-
-	return success;
-}
-
-
-static void cf_check nmi_cpu_setup(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs * msrs = &cpu_msrs[cpu];
-	model->setup_ctrs(msrs);
-}
-
-
-int nmi_setup_events(void)
-{
-	on_each_cpu(nmi_cpu_setup, NULL, 1);
-	return 0;
-}
-
-int nmi_reserve_counters(void)
-{
-	if (!allocate_msrs())
-		return -ENOMEM;
-
-	/*
-	 * We need to be careful to install our NMI handler
-	 * without actually triggering any NMIs as this will
-	 * break the core code horrifically.
-	 */
-	if (reserve_lapic_nmi() < 0) {
-		free_msrs();
-		return -EBUSY;
-	}
-	/* We need to serialize save and setup for HT because the subset
-	 * of msrs are distinct for save and setup operations
-	 */
-	on_each_cpu(nmi_save_registers, NULL, 1);
-	return 0;
-}
-
-int nmi_enable_virq(void)
-{
-	set_nmi_callback(nmi_callback);
-	return 0;
-}
-
-
-void nmi_disable_virq(void)
-{
-	unset_nmi_callback();
-}
-
-
-static void nmi_restore_registers(struct op_msrs * msrs)
-{
-	unsigned int const nr_ctrs = model->num_counters;
-	unsigned int const nr_ctrls = model->num_controls;
-	struct op_msr * counters = msrs->counters;
-	struct op_msr * controls = msrs->controls;
-	unsigned int i;
-
-	for (i = 0; i < nr_ctrls; ++i) {
-		wrmsrl(controls[i].addr, controls[i].value);
-	}
-
-	for (i = 0; i < nr_ctrs; ++i) {
-		wrmsrl(counters[i].addr, counters[i].value);
-	}
-}
-
-
-static void cf_check nmi_cpu_shutdown(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs * msrs = &cpu_msrs[cpu];
-	nmi_restore_registers(msrs);
-}
-
-
-void nmi_release_counters(void)
-{
-	on_each_cpu(nmi_cpu_shutdown, NULL, 1);
-	release_lapic_nmi();
-	free_msrs();
-}
-
-
-static void cf_check nmi_cpu_start(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs const * msrs = &cpu_msrs[cpu];
-	saved_lvtpc[cpu] = apic_read(APIC_LVTPC);
-	apic_write(APIC_LVTPC, APIC_DM_NMI);
-	model->start(msrs);
-}
-
-
-int nmi_start(void)
-{
-	on_each_cpu(nmi_cpu_start, NULL, 1);
-	return 0;
-}
-
-
-static void cf_check nmi_cpu_stop(void *dummy)
-{
-	unsigned int v;
-	int cpu = smp_processor_id();
-	struct op_msrs const * msrs = &cpu_msrs[cpu];
-	model->stop(msrs);
-
-	/* restoring APIC_LVTPC can trigger an apic error because the delivery
-	 * mode and vector nr combination can be illegal. That's by design: on
-	 * power on apic lvt contain a zero vector nr which are legal only for
-	 * NMI delivery mode. So inhibit apic err before restoring lvtpc
-	 */
-	if ( (apic_read(APIC_LVTPC) & APIC_DM_MASK) != APIC_DM_NMI
-	     || (apic_read(APIC_LVTPC) & APIC_LVT_MASKED) )
-	{
-		printk("nmi_stop: APIC not good %ul\n", apic_read(APIC_LVTPC));
-		mdelay(5000);
-	}
-	v = apic_read(APIC_LVTERR);
-	apic_write(APIC_LVTERR, v | APIC_LVT_MASKED);
-	apic_write(APIC_LVTPC, saved_lvtpc[cpu]);
-	apic_write(APIC_LVTERR, v);
-}
-
-
-void nmi_stop(void)
-{
-	on_each_cpu(nmi_cpu_stop, NULL, 1);
-}
-
-
-static int __init p4_init(const char **cpu_type)
-{
-	unsigned int cpu_model = current_cpu_data.x86_model;
-
-	if ((cpu_model > 6) || (cpu_model == 5)) {
-		printk("xenoprof: Initialization failed. "
-		       "Intel processor model %u for pentium 4 family is not "
-		       "supported\n", cpu_model);
-		return 0;
-	}
-
-	switch (current_cpu_data.x86_num_siblings) {
-		case 1:
-			*cpu_type = "i386/p4";
-			model = &op_p4_spec;
-			return 1;
-
-		case 2:
-			*cpu_type = "i386/p4-ht";
-			model = &op_p4_ht2_spec;
-			return 1;
-	}
-
-	printk("Xenoprof ERROR: P4 HyperThreading detected with > 2 threads\n");
-
-	return 0;
-}
-
-
-static int force_arch_perfmon;
-
-static int __init cf_check force_cpu_type(const char *str)
-{
-	if (!strcmp(str, "arch_perfmon")) {
-		force_arch_perfmon = 1;
-		printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
-	}
-	else
-		return -EINVAL;
-
-	return 0;
-}
-custom_param("cpu_type", force_cpu_type);
-
-static int __init ppro_init(const char **cpu_type)
-{
-	if (force_arch_perfmon && cpu_has_arch_perfmon)
-		return 0;
-
-	switch (current_cpu_data.x86_model) {
-	case 14:
-		*cpu_type = "i386/core";
-		break;
-	case 15:
-		*cpu_type = "i386/core_2";
-		ppro_has_global_ctrl = 1;
-		break;
-	default:
-		/* Unknown */
-		return 0;
-	}
-
-	model = &op_ppro_spec;
-	return 1;
-}
-
-static int __init arch_perfmon_init(const char **cpu_type)
-{
-	if (!cpu_has_arch_perfmon)
-		return 0;
-	*cpu_type = "i386/arch_perfmon";
-	model = &op_arch_perfmon_spec;
-	arch_perfmon_setup_counters();
-	ppro_has_global_ctrl = 1;
-	return 1;
-}
-
-static int __init cf_check nmi_init(void)
-{
-	unsigned int vendor = current_cpu_data.x86_vendor;
-	unsigned int family = current_cpu_data.x86;
-
-	if (!cpu_has_apic) {
-		printk("xenoprof: Initialization failed. No APIC\n");
-		return -ENODEV;
-	}
-
-	switch (vendor) {
-		case X86_VENDOR_AMD:
-			/* Needs to be at least an Athlon (or hammer in 32bit mode) */
-
-			switch (family) {
-			default:
-				printk("xenoprof: Initialization failed. "
-				       "AMD processor family %u is not "
-				       "supported\n", family);
-				return -ENODEV;
-			case 0xf:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/hammer";
-				break;
-			case 0x10:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family10";
-				ibs_init();
-				break;
-			case 0x11:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family11h";
-				break;
-                        case 0x12:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family12h";
-				break;
-			case 0x14:
-                                model = &op_athlon_spec;
-                                cpu_type = "x86-64/family14h";
-                                break;
-                        case 0x15:
-                                model = &op_amd_fam15h_spec;
-                                cpu_type = "x86-64/family15h";
-                                break;
-			case 0x16:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family16h";
-				break;
-			}
-			break;
-
-		case X86_VENDOR_INTEL:
-			switch (family) {
-				/* Pentium IV */
-				case 0xf:
-					p4_init(&cpu_type);
-					break;
-
-				/* A P6-class processor */
-				case 6:
-					ppro_init(&cpu_type);
-					break;
-
-				default:
-				break;
-			}
-			if (!cpu_type && !arch_perfmon_init(&cpu_type)) {
-				printk("xenoprof: Initialization failed. "
-				       "Intel processor family %u model %d is not supported\n",
-				       family, current_cpu_data.x86_model);
-				return -ENODEV;
-			}
-			break;
-
-		default:
-			printk("xenoprof: Initialization failed. "
-			       "Unsupported processor. Unknown vendor %u\n",
-				vendor);
-			return -ENODEV;
-	}
-
-	return 0;
-}
-
-__initcall(nmi_init);
-
-int xenoprof_arch_init(int *num_events, char *_cpu_type)
-{
-	if (cpu_type == NULL)
-		return -ENODEV;
-	*num_events = model->num_counters;
-	strlcpy(_cpu_type, cpu_type, XENOPROF_CPU_TYPE_SIZE);
-	return 0;
-}
diff --git a/xen/arch/x86/oprofile/op_counter.h b/xen/arch/x86/oprofile/op_counter.h
deleted file mode 100644
index b515ac9ebc..0000000000
--- a/xen/arch/x86/oprofile/op_counter.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * @file op_counter.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- */
- 
-#ifndef OP_COUNTER_H
-#define OP_COUNTER_H
- 
-#define OP_MAX_COUNTER 8
- 
-/* Per-perfctr configuration as set via
- * oprofilefs.
- */
-struct op_counter_config {
-        unsigned long count;
-        unsigned long enabled;
-        unsigned long event;
-        unsigned long kernel;
-        unsigned long user;
-        unsigned long unit_mask;
-};
-
-extern struct op_counter_config counter_config[];
-
-/* AMD IBS configuration */
-struct op_ibs_config {
-    unsigned long op_enabled;
-    unsigned long fetch_enabled;
-    unsigned long max_cnt_fetch;
-    unsigned long max_cnt_op;
-    unsigned long rand_en;
-    unsigned long dispatched_ops;
-};
-
-extern struct op_ibs_config ibs_config;
-
-#endif /* OP_COUNTER_H */
diff --git a/xen/arch/x86/oprofile/op_model_athlon.c b/xen/arch/x86/oprofile/op_model_athlon.c
deleted file mode 100644
index 4c016624a6..0000000000
--- a/xen/arch/x86/oprofile/op_model_athlon.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/**
- * @file op_model_athlon.h
- * athlon / K7 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- * @author Philippe Elie
- * @author Graydon Hoare
- */
-
-#include <xen/sched.h>
-#include <xen/types.h>
-#include <asm/msr.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/processor.h>
-#include <xen/xenoprof.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-#include <xen/pci_regs.h>
-#include <xen/pci_ids.h>
-
-#include "op_x86_model.h"
-#include "op_counter.h"
-
-#define K7_NUM_COUNTERS 4
-#define K7_NUM_CONTROLS 4
-
-#define FAM15H_NUM_COUNTERS 6
-#define FAM15H_NUM_CONTROLS 6
-
-#define MAX_COUNTERS FAM15H_NUM_COUNTERS
-
-#define CTR_READ(msr_content,msrs,c) do {rdmsrl(msrs->counters[(c)].addr, (msr_content));} while (0)
-#define CTR_WRITE(l,msrs,c) wrmsr(msrs->counters[(c)].addr, -(l))
-#define CTR_OVERFLOWED(n) (!((n) & (1ULL<<31)))
-
-#define CTRL_READ(msr_content,msrs,c) do {rdmsrl(msrs->controls[(c)].addr, (msr_content));} while (0)
-#define CTRL_WRITE(msr_content,msrs,c) do {wrmsrl(msrs->controls[(c)].addr, (msr_content));} while (0)
-#define CTRL_SET_ACTIVE(n) (n |= (1ULL<<22))
-#define CTRL_SET_INACTIVE(n) (n &= ~(1ULL<<22))
-#define CTRL_CLEAR(val) (val &= (1ULL<<21))
-#define CTRL_SET_ENABLE(val) (val |= 1ULL<<20)
-#define CTRL_SET_USR(val,u) (val |= ((u & 1) << 16))
-#define CTRL_SET_KERN(val,k) (val |= ((k & 1) << 17))
-#define CTRL_SET_UM(val, m) (val |= ((m & 0xff) << 8))
-#define CTRL_SET_EVENT(val, e) (val |= (((e >> 8) & 0xf) | (e & 0xff)))
-#define CTRL_SET_HOST_ONLY(val, h) (val |= ((h & 0x1ULL) << 41))
-#define CTRL_SET_GUEST_ONLY(val, h) (val |= ((h & 0x1ULL) << 40))
-
-static unsigned long reset_value[MAX_COUNTERS];
-
-extern char svm_stgi_label[];
-
-u32 ibs_caps = 0;
-static u64 ibs_op_ctl;
-
-/* IBS cpuid feature detection */
-#define IBS_CPUID_FEATURES              0x8000001b
-
-/* IBS MSRs */
-#define MSR_AMD64_IBSFETCHCTL           0xc0011030
-#define MSR_AMD64_IBSFETCHLINAD         0xc0011031
-#define MSR_AMD64_IBSFETCHPHYSAD        0xc0011032
-#define MSR_AMD64_IBSOPCTL              0xc0011033
-#define MSR_AMD64_IBSOPRIP              0xc0011034
-#define MSR_AMD64_IBSOPDATA             0xc0011035
-#define MSR_AMD64_IBSOPDATA2            0xc0011036
-#define MSR_AMD64_IBSOPDATA3            0xc0011037
-#define MSR_AMD64_IBSDCLINAD            0xc0011038
-#define MSR_AMD64_IBSDCPHYSAD           0xc0011039
-#define MSR_AMD64_IBSCTL                0xc001103a
-
-/*
- * Same bit mask as for IBS cpuid feature flags (Fn8000_001B_EAX), but
- * bit 0 is used to indicate the existence of IBS.
- */
-#define IBS_CAPS_AVAIL                  (1LL<<0)
-#define IBS_CAPS_RDWROPCNT              (1LL<<3)
-#define IBS_CAPS_OPCNT                  (1LL<<4)
-
-/* IBS randomization macros */
-#define IBS_RANDOM_BITS                 12
-#define IBS_RANDOM_MASK                 ((1ULL << IBS_RANDOM_BITS) - 1)
-#define IBS_RANDOM_MAXCNT_OFFSET        (1ULL << (IBS_RANDOM_BITS - 5))
-
-/* IbsFetchCtl bits/masks */
-#define IBS_FETCH_RAND_EN               (1ULL<<57)
-#define IBS_FETCH_VAL                   (1ULL<<49)
-#define IBS_FETCH_ENABLE                (1ULL<<48)
-#define IBS_FETCH_CNT                   0xFFFF0000ULL
-#define IBS_FETCH_MAX_CNT               0x0000FFFFULL
-
-/* IbsOpCtl bits */
-#define IBS_OP_CNT_CTL                  (1ULL<<19)
-#define IBS_OP_VAL                      (1ULL<<18)
-#define IBS_OP_ENABLE                   (1ULL<<17)
-#define IBS_OP_MAX_CNT                  0x0000FFFFULL
-
-/* IBS sample identifier */
-#define IBS_FETCH_CODE                  13
-#define IBS_OP_CODE                     14
-
-#define clamp(val, min, max) ({			\
-	typeof(val) __val = (val);		\
-	typeof(min) __min = (min);		\
-	typeof(max) __max = (max);		\
-	(void) (&__val == &__min);		\
-	(void) (&__val == &__max);		\
-	__val = __val < __min ? __min: __val;	\
-	__val > __max ? __max: __val; })
-
-/*
- * 16-bit Linear Feedback Shift Register (LFSR)
- */
-static unsigned int lfsr_random(void)
-{
-    static unsigned int lfsr_value = 0xF00D;
-    unsigned int bit;
-
-    /* Compute next bit to shift in */
-    bit = ((lfsr_value >> 0) ^
-           (lfsr_value >> 2) ^
-           (lfsr_value >> 3) ^
-           (lfsr_value >> 5)) & 0x0001;
-
-    /* Advance to next register value */
-    lfsr_value = (lfsr_value >> 1) | (bit << 15);
-
-    return lfsr_value;
-}
-
-/*
- * IBS software randomization
- *
- * The IBS periodic op counter is randomized in software. The lower 12
- * bits of the 20 bit counter are randomized. IbsOpCurCnt is
- * initialized with a 12 bit random value.
- */
-static inline u64 op_amd_randomize_ibs_op(u64 val)
-{
-    unsigned int random = lfsr_random();
-
-    if (!(ibs_caps & IBS_CAPS_RDWROPCNT))
-        /*
-         * Work around if the hw can not write to IbsOpCurCnt
-         *
-         * Randomize the lower 8 bits of the 16 bit
-         * IbsOpMaxCnt [15:0] value in the range of -128 to
-         * +127 by adding/subtracting an offset to the
-         * maximum count (IbsOpMaxCnt).
-         *
-         * To avoid over or underflows and protect upper bits
-         * starting at bit 16, the initial value for
-         * IbsOpMaxCnt must fit in the range from 0x0081 to
-         * 0xff80.
-         */
-        val += (int8_t)(random >> 4);
-    else
-        val |= (u64)(random & IBS_RANDOM_MASK) << 32;
-
-    return val;
-}
-
-static void cf_check athlon_fill_in_addresses(struct op_msrs * const msrs)
-{
-	msrs->counters[0].addr = MSR_K7_PERFCTR0;
-	msrs->counters[1].addr = MSR_K7_PERFCTR1;
-	msrs->counters[2].addr = MSR_K7_PERFCTR2;
-	msrs->counters[3].addr = MSR_K7_PERFCTR3;
-
-	msrs->controls[0].addr = MSR_K7_EVNTSEL0;
-	msrs->controls[1].addr = MSR_K7_EVNTSEL1;
-	msrs->controls[2].addr = MSR_K7_EVNTSEL2;
-	msrs->controls[3].addr = MSR_K7_EVNTSEL3;
-}
-
-static void cf_check fam15h_fill_in_addresses(struct op_msrs * const msrs)
-{
-	msrs->counters[0].addr = MSR_AMD_FAM15H_PERFCTR0;
-	msrs->counters[1].addr = MSR_AMD_FAM15H_PERFCTR1;
-	msrs->counters[2].addr = MSR_AMD_FAM15H_PERFCTR2;
-	msrs->counters[3].addr = MSR_AMD_FAM15H_PERFCTR3;
-	msrs->counters[4].addr = MSR_AMD_FAM15H_PERFCTR4;
-	msrs->counters[5].addr = MSR_AMD_FAM15H_PERFCTR5;
-
-	msrs->controls[0].addr = MSR_AMD_FAM15H_EVNTSEL0;
-	msrs->controls[1].addr = MSR_AMD_FAM15H_EVNTSEL1;
-	msrs->controls[2].addr = MSR_AMD_FAM15H_EVNTSEL2;
-	msrs->controls[3].addr = MSR_AMD_FAM15H_EVNTSEL3;
-	msrs->controls[4].addr = MSR_AMD_FAM15H_EVNTSEL4;
-	msrs->controls[5].addr = MSR_AMD_FAM15H_EVNTSEL5;
-}
-
-static void cf_check athlon_setup_ctrs(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-	unsigned int const nr_ctrs = model->num_counters;
-	unsigned int const nr_ctrls = model->num_controls;
- 
-	/* clear all counters */
-	for (i = 0 ; i < nr_ctrls; ++i) {
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_CLEAR(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-	
-	/* avoid a false detection of ctr overflows in NMI handler */
-	for (i = 0; i < nr_ctrs; ++i) {
-		CTR_WRITE(1, msrs, i);
-	}
-
-	/* enable active counters */
-	for (i = 0; i < nr_ctrs; ++i) {
-		if (counter_config[i].enabled) {
-			reset_value[i] = counter_config[i].count;
-
-			CTR_WRITE(counter_config[i].count, msrs, i);
-
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_CLEAR(msr_content);
-			CTRL_SET_ENABLE(msr_content);
-			CTRL_SET_USR(msr_content, counter_config[i].user);
-			CTRL_SET_KERN(msr_content, counter_config[i].kernel);
-			CTRL_SET_UM(msr_content, counter_config[i].unit_mask);
-			CTRL_SET_EVENT(msr_content, counter_config[i].event);
-			CTRL_SET_HOST_ONLY(msr_content, 0);
-			CTRL_SET_GUEST_ONLY(msr_content, 0);
-			CTRL_WRITE(msr_content, msrs, i);
-		} else {
-			reset_value[i] = 0;
-		}
-	}
-}
-
-static inline void
-ibs_log_event(u64 data, struct cpu_user_regs const * const regs, int mode)
-{
-	struct vcpu *v = current;
-	u32 temp = 0;
-
-	temp = data & 0xFFFFFFFF;
-	xenoprof_log_event(v, regs, temp, mode, 0);
-	
-	temp = (data >> 32) & 0xFFFFFFFF;
-	xenoprof_log_event(v, regs, temp, mode, 0);
-	
-}
-
-static inline int handle_ibs(int mode, struct cpu_user_regs const * const regs)
-{
-	u64 val, ctl;
-	struct vcpu *v = current;
-
-	if (!ibs_caps)
-		return 1;
-
-	if (ibs_config.fetch_enabled) {
-		rdmsrl(MSR_AMD64_IBSFETCHCTL, ctl);
-		if (ctl & IBS_FETCH_VAL) {
-			rdmsrl(MSR_AMD64_IBSFETCHLINAD, val);
-			xenoprof_log_event(v, regs, IBS_FETCH_CODE, mode, 0);
-			xenoprof_log_event(v, regs, val, mode, 0);
-
-			ibs_log_event(val, regs, mode);
-			ibs_log_event(ctl, regs, mode);
-
-			rdmsrl(MSR_AMD64_IBSFETCHPHYSAD, val);
-			ibs_log_event(val, regs, mode);
-		
-			/* reenable the IRQ */
-			ctl &= ~(IBS_FETCH_VAL | IBS_FETCH_CNT);
-			ctl |= IBS_FETCH_ENABLE;
-			wrmsrl(MSR_AMD64_IBSFETCHCTL, ctl);
-		}
-	}
-
-	if (ibs_config.op_enabled) {
-		rdmsrl(MSR_AMD64_IBSOPCTL, ctl);
-		if (ctl & IBS_OP_VAL) {
-
-			rdmsrl(MSR_AMD64_IBSOPRIP, val);
-			xenoprof_log_event(v, regs, IBS_OP_CODE, mode, 0);
-			xenoprof_log_event(v, regs, val, mode, 0);
-			
-			ibs_log_event(val, regs, mode);
-
-			rdmsrl(MSR_AMD64_IBSOPDATA, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSOPDATA2, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSOPDATA3, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSDCLINAD, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSDCPHYSAD, val);
-			ibs_log_event(val, regs, mode);
-
-			/* reenable the IRQ */
-			ctl = op_amd_randomize_ibs_op(ibs_op_ctl);
-			wrmsrl(MSR_AMD64_IBSOPCTL, ctl);
-		}
-	}
-
-    return 1;
-}
-
-static int cf_check athlon_check_ctrs(
-	unsigned int const cpu, struct op_msrs const * const msrs,
-	struct cpu_user_regs const * const regs)
-
-{
-	uint64_t msr_content;
-	int i;
-	unsigned long eip = regs->rip;
-	int mode = 0;
-	struct vcpu *v = current;
-	unsigned int const nr_ctrs = model->num_counters;
-
-#ifdef CONFIG_AMD_SVM
-	struct cpu_user_regs *guest_regs = guest_cpu_user_regs();
-
-	if (!guest_mode(regs) &&
-	    (eip == (unsigned long)svm_stgi_label)) {
-		/* SVM guest was running when NMI occurred */
-		ASSERT(is_hvm_vcpu(v));
-		eip = guest_regs->rip;
-		mode = xenoprofile_get_mode(v, guest_regs);
-	} else
-#endif
-		mode = xenoprofile_get_mode(v, regs);
-
-	for (i = 0 ; i < nr_ctrs; ++i) {
-		CTR_READ(msr_content, msrs, i);
-		if (CTR_OVERFLOWED(msr_content)) {
-			xenoprof_log_event(current, regs, eip, mode, i);
-			CTR_WRITE(reset_value[i], msrs, i);
-		}
-	}
-
-	/* See op_model_ppro.c */
-	return handle_ibs(mode, regs);
-}
-
-static inline void start_ibs(void)
-{
-	u64 val = 0;
-
-	if (!ibs_caps)
-		return;
-
-	if (ibs_config.fetch_enabled) {
-		val = (ibs_config.max_cnt_fetch >> 4) & IBS_FETCH_MAX_CNT;
-		val |= ibs_config.rand_en ? IBS_FETCH_RAND_EN : 0;
-		val |= IBS_FETCH_ENABLE;
-		wrmsrl(MSR_AMD64_IBSFETCHCTL, val);
-	}
-
-	if (ibs_config.op_enabled) {
-		ibs_op_ctl = ibs_config.max_cnt_op >> 4;
-		if (!(ibs_caps & IBS_CAPS_RDWROPCNT)) {
-			/*
-			 * IbsOpCurCnt not supported.  See
-			 * op_amd_randomize_ibs_op() for details.
-			 */
-			ibs_op_ctl = clamp((unsigned long long)ibs_op_ctl, 
-							0x0081ULL, 0xFF80ULL);
-		} else {
-			/*
-			 * The start value is randomized with a
-			 * positive offset, we need to compensate it
-			 * with the half of the randomized range. Also
-			 * avoid underflows.
-			 */
-		ibs_op_ctl = min(ibs_op_ctl + IBS_RANDOM_MAXCNT_OFFSET,
-					IBS_OP_MAX_CNT);
-		}
-		if (ibs_caps & IBS_CAPS_OPCNT && ibs_config.dispatched_ops)
-			ibs_op_ctl |= IBS_OP_CNT_CTL;
-		ibs_op_ctl |= IBS_OP_ENABLE;
-		val = op_amd_randomize_ibs_op(ibs_op_ctl);
-		wrmsrl(MSR_AMD64_IBSOPCTL, val);
-	}
-}
- 
-static void cf_check athlon_start(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-	unsigned int const nr_ctrs = model->num_counters;
-	for (i = 0 ; i < nr_ctrs ; ++i) {
-		if (reset_value[i]) {
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_SET_ACTIVE(msr_content);
-			CTRL_WRITE(msr_content, msrs, i);
-		}
-	}
-	start_ibs();
-}
-
-static void stop_ibs(void)
-{
-	if (!ibs_caps)
-		return;
-
-	if (ibs_config.fetch_enabled)
-		/* clear max count and enable */
-		wrmsrl(MSR_AMD64_IBSFETCHCTL, 0);
-
-	if (ibs_config.op_enabled)
-		/* clear max count and enable */
-		wrmsrl(MSR_AMD64_IBSOPCTL, 0);
-}
-
-static void cf_check athlon_stop(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-	unsigned int const nr_ctrs = model->num_counters;
-
-	/* Subtle: stop on all counters to avoid race with
-	 * setting our pm callback */
-	for (i = 0 ; i < nr_ctrs ; ++i) {
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_SET_INACTIVE(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-
-	stop_ibs();
-}
-
-#define IBSCTL_LVTOFFSETVAL             (1 << 8)
-#define APIC_EILVT_MSG_NMI              0x4
-#define APIC_EILVT_LVTOFF_IBS           1
-#define APIC_EILVTn(n)                  (0x500 + 0x10 * n)
-static inline void __init cf_check init_ibs_nmi_per_cpu(void *arg)
-{
-	unsigned long reg;
-
-	reg = (APIC_EILVT_LVTOFF_IBS << 4) + APIC_EILVTn(0);
-	apic_write(reg, APIC_EILVT_MSG_NMI << 8);
-}
-
-#define PCI_DEVICE_ID_AMD_10H_NB_MISC   0x1203
-#define IBSCTL                          0x1cc
-static int __init init_ibs_nmi(void)
-{
-	int bus, dev, func;
-	u32 id, value;
-	u16 vendor_id, dev_id;
-	int nodes;
-
-	/* per CPU setup */
-	on_each_cpu(init_ibs_nmi_per_cpu, NULL, 1);
-
-	nodes = 0;
-	for (bus = 0; bus < 256; bus++) {
-		for (dev = 0; dev < 32; dev++) {
-			for (func = 0; func < 8; func++) {
-				id = pci_conf_read32(PCI_SBDF(0, bus, dev, func),
-						     PCI_VENDOR_ID);
-
-				vendor_id = id & 0xffff;
-				dev_id = (id >> 16) & 0xffff;
-
-				if ((vendor_id == PCI_VENDOR_ID_AMD) &&
-					(dev_id == PCI_DEVICE_ID_AMD_10H_NB_MISC)) {
-
-					pci_conf_write32(
-						PCI_SBDF(0, bus, dev, func),
-						IBSCTL,
-						IBSCTL_LVTOFFSETVAL | APIC_EILVT_LVTOFF_IBS);
-
-					value = pci_conf_read32(PCI_SBDF(0, bus, dev, func),
-								IBSCTL);
-
-					if (value != (IBSCTL_LVTOFFSETVAL |
-						APIC_EILVT_LVTOFF_IBS)) {
-						printk("Xenoprofile: Failed to setup IBS LVT offset, "
-							"IBSCTL = %#x\n", value);
-						return 1;
-					}
-					nodes++;
-				}
-			}
-		}
-	}
-
-	if (!nodes) {
-		printk("Xenoprofile: No CPU node configured for IBS\n");
-		return 1;
-	}
-
-	return 0;
-}
-
-static void __init get_ibs_caps(void)
-{
-	if (!boot_cpu_has(X86_FEATURE_IBS))
-		return;
-
-    /* check IBS cpuid feature flags */
-	if (current_cpu_data.extended_cpuid_level >= IBS_CPUID_FEATURES)
-		ibs_caps = cpuid_eax(IBS_CPUID_FEATURES);
-	if (!(ibs_caps & IBS_CAPS_AVAIL))
-		/* cpuid flags not valid */
-		ibs_caps = 0;
-}
-
-void __init ibs_init(void)
-{
-	get_ibs_caps();
-
-	if ( !ibs_caps )
-		return;
-
-	if (init_ibs_nmi()) {
-		ibs_caps = 0;
-		return;
-	}
-
-	printk("Xenoprofile: AMD IBS detected (%#x)\n",
-		(unsigned)ibs_caps);
-}
-
-struct op_x86_model_spec const op_athlon_spec = {
-	.num_counters = K7_NUM_COUNTERS,
-	.num_controls = K7_NUM_CONTROLS,
-	.fill_in_addresses = &athlon_fill_in_addresses,
-	.setup_ctrs = &athlon_setup_ctrs,
-	.check_ctrs = &athlon_check_ctrs,
-	.start = &athlon_start,
-	.stop = &athlon_stop
-};
-
-struct op_x86_model_spec const op_amd_fam15h_spec = {
-	.num_counters = FAM15H_NUM_COUNTERS,
-	.num_controls = FAM15H_NUM_CONTROLS,
-	.fill_in_addresses = &fam15h_fill_in_addresses,
-	.setup_ctrs = &athlon_setup_ctrs,
-	.check_ctrs = &athlon_check_ctrs,
-	.start = &athlon_start,
-	.stop = &athlon_stop
-};
diff --git a/xen/arch/x86/oprofile/op_model_p4.c b/xen/arch/x86/oprofile/op_model_p4.c
deleted file mode 100644
index d047258644..0000000000
--- a/xen/arch/x86/oprofile/op_model_p4.c
+++ /dev/null
@@ -1,721 +0,0 @@
-/**
- * @file op_model_p4.c
- * P4 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author Graydon Hoare
- */
-
-#include <xen/types.h>
-#include <asm/msr.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/processor.h>
-#include <xen/xenoprof.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-
-#include "op_x86_model.h"
-#include "op_counter.h"
-
-#define NUM_EVENTS 39
-
-#define NUM_COUNTERS_NON_HT 8
-#define NUM_ESCRS_NON_HT 45
-#define NUM_CCCRS_NON_HT 18
-#define NUM_CONTROLS_NON_HT (NUM_ESCRS_NON_HT + NUM_CCCRS_NON_HT)
-
-#define NUM_COUNTERS_HT2 4
-#define NUM_ESCRS_HT2 23
-#define NUM_CCCRS_HT2 9
-#define NUM_CONTROLS_HT2 (NUM_ESCRS_HT2 + NUM_CCCRS_HT2)
-
-static unsigned int num_counters = NUM_COUNTERS_NON_HT;
-
-
-/* this has to be checked dynamically since the
-   hyper-threadedness of a chip is discovered at
-   kernel boot-time. */
-static inline void setup_num_counters(void)
-{
-	if (boot_cpu_data.x86_num_siblings == 2) 	/* XXX */
-		num_counters = NUM_COUNTERS_HT2;
-}
-
-static int inline addr_increment(void)
-{
-	return boot_cpu_data.x86_num_siblings == 2 ? 2 : 1;
-}
-
-
-/* tables to simulate simplified hardware view of p4 registers */
-struct p4_counter_binding {
-	int virt_counter;
-	int counter_address;
-	int cccr_address;
-};
-
-struct p4_event_binding {
-	int escr_select;  /* value to put in CCCR */
-	int event_select; /* value to put in ESCR */
-	struct {
-		int virt_counter; /* for this counter... */
-		int escr_address; /* use this ESCR       */
-	} bindings[2];
-};
-
-/* nb: these CTR_* defines are a duplicate of defines in
-   event/i386.p4*events. */
-
-
-#define CTR_BPU_0      (1 << 0)
-#define CTR_MS_0       (1 << 1)
-#define CTR_FLAME_0    (1 << 2)
-#define CTR_IQ_4       (1 << 3)
-#define CTR_BPU_2      (1 << 4)
-#define CTR_MS_2       (1 << 5)
-#define CTR_FLAME_2    (1 << 6)
-#define CTR_IQ_5       (1 << 7)
-
-static struct p4_counter_binding p4_counters [NUM_COUNTERS_NON_HT] = {
-	{ CTR_BPU_0,   MSR_P4_BPU_PERFCTR0,   MSR_P4_BPU_CCCR0 },
-	{ CTR_MS_0,    MSR_P4_MS_PERFCTR0,    MSR_P4_MS_CCCR0 },
-	{ CTR_FLAME_0, MSR_P4_FLAME_PERFCTR0, MSR_P4_FLAME_CCCR0 },
-	{ CTR_IQ_4,    MSR_P4_IQ_PERFCTR4,    MSR_P4_IQ_CCCR4 },
-	{ CTR_BPU_2,   MSR_P4_BPU_PERFCTR2,   MSR_P4_BPU_CCCR2 },
-	{ CTR_MS_2,    MSR_P4_MS_PERFCTR2,    MSR_P4_MS_CCCR2 },
-	{ CTR_FLAME_2, MSR_P4_FLAME_PERFCTR2, MSR_P4_FLAME_CCCR2 },
-	{ CTR_IQ_5,    MSR_P4_IQ_PERFCTR5,    MSR_P4_IQ_CCCR5 }
-};
-
-#define NUM_UNUSED_CCCRS	NUM_CCCRS_NON_HT - NUM_COUNTERS_NON_HT
-
-/* All cccr we don't use. */
-static int p4_unused_cccr[NUM_UNUSED_CCCRS] = {
-	MSR_P4_BPU_CCCR1,	MSR_P4_BPU_CCCR3,
-	MSR_P4_MS_CCCR1,	MSR_P4_MS_CCCR3,
-	MSR_P4_FLAME_CCCR1,	MSR_P4_FLAME_CCCR3,
-	MSR_P4_IQ_CCCR0,	MSR_P4_IQ_CCCR1,
-	MSR_P4_IQ_CCCR2,	MSR_P4_IQ_CCCR3
-};
-
-/* p4 event codes in libop/op_event.h are indices into this table. */
-
-static const struct p4_event_binding p4_events[NUM_EVENTS] = {
-	
-	{ /* BRANCH_RETIRED */
-		0x05, 0x06, 
-		{ {CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  {CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-	
-	{ /* MISPRED_BRANCH_RETIRED */
-		0x04, 0x03, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR0},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
-	},
-	
-	{ /* TC_DELIVER_MODE */
-		0x01, 0x01,
-		{ { CTR_MS_0, MSR_P4_TC_ESCR0},  
-		  { CTR_MS_2, MSR_P4_TC_ESCR1} }
-	},
-	
-	{ /* BPU_FETCH_REQUEST */
-		0x00, 0x03, 
-		{ { CTR_BPU_0, MSR_P4_BPU_ESCR0},
-		  { CTR_BPU_2, MSR_P4_BPU_ESCR1} }
-	},
-
-	{ /* ITLB_REFERENCE */
-		0x03, 0x18,
-		{ { CTR_BPU_0, MSR_P4_ITLB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_ITLB_ESCR1} }
-	},
-
-	{ /* MEMORY_CANCEL */
-		0x05, 0x02,
-		{ { CTR_FLAME_0, MSR_P4_DAC_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_DAC_ESCR1} }
-	},
-
-	{ /* MEMORY_COMPLETE */
-		0x02, 0x08,
-		{ { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
-	},
-
-	{ /* LOAD_PORT_REPLAY */
-		0x02, 0x04, 
-		{ { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
-	},
-
-	{ /* STORE_PORT_REPLAY */
-		0x02, 0x05,
-		{ { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
-	},
-
-	{ /* MOB_LOAD_REPLAY */
-		0x02, 0x03,
-		{ { CTR_BPU_0, MSR_P4_MOB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_MOB_ESCR1} }
-	},
-
-	{ /* PAGE_WALK_TYPE */
-		0x04, 0x01,
-		{ { CTR_BPU_0, MSR_P4_PMH_ESCR0},
-		  { CTR_BPU_2, MSR_P4_PMH_ESCR1} }
-	},
-
-	{ /* BSQ_CACHE_REFERENCE */
-		0x07, 0x0c, 
-		{ { CTR_BPU_0, MSR_P4_BSU_ESCR0},
-		  { CTR_BPU_2, MSR_P4_BSU_ESCR1} }
-	},
-
-	{ /* IOQ_ALLOCATION */
-		0x06, 0x03, 
-		{ { CTR_BPU_0, MSR_P4_FSB_ESCR0},
-		  { 0, 0 } }
-	},
-
-	{ /* IOQ_ACTIVE_ENTRIES */
-		0x06, 0x1a, 
-		{ { CTR_BPU_2, MSR_P4_FSB_ESCR1},
-		  { 0, 0 } }
-	},
-
-	{ /* FSB_DATA_ACTIVITY */
-		0x06, 0x17, 
-		{ { CTR_BPU_0, MSR_P4_FSB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_FSB_ESCR1} }
-	},
-
-	{ /* BSQ_ALLOCATION */
-		0x07, 0x05, 
-		{ { CTR_BPU_0, MSR_P4_BSU_ESCR0},
-		  { 0, 0 } }
-	},
-
-	{ /* BSQ_ACTIVE_ENTRIES */
-		0x07, 0x06,
-		{ { CTR_BPU_2, MSR_P4_BSU_ESCR1 /* guess */},  
-		  { 0, 0 } }
-	},
-
-	{ /* X87_ASSIST */
-		0x05, 0x03, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* SSE_INPUT_ASSIST */
-		0x01, 0x34,
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* PACKED_SP_UOP */
-		0x01, 0x08, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* PACKED_DP_UOP */
-		0x01, 0x0c, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* SCALAR_SP_UOP */
-		0x01, 0x0a, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* SCALAR_DP_UOP */
-		0x01, 0x0e,
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* 64BIT_MMX_UOP */
-		0x01, 0x02, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* 128BIT_MMX_UOP */
-		0x01, 0x1a, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* X87_FP_UOP */
-		0x01, 0x04, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* X87_SIMD_MOVES_UOP */
-		0x01, 0x2e, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* MACHINE_CLEAR */
-		0x05, 0x02, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* GLOBAL_POWER_EVENTS */
-		0x06, 0x13 /* older manual says 0x05, newer 0x13 */,
-		{ { CTR_BPU_0, MSR_P4_FSB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_FSB_ESCR1} }
-	},
-  
-	{ /* TC_MS_XFER */
-		0x00, 0x05, 
-		{ { CTR_MS_0, MSR_P4_MS_ESCR0},
-		  { CTR_MS_2, MSR_P4_MS_ESCR1} }
-	},
-
-	{ /* UOP_QUEUE_WRITES */
-		0x00, 0x09,
-		{ { CTR_MS_0, MSR_P4_MS_ESCR0},
-		  { CTR_MS_2, MSR_P4_MS_ESCR1} }
-	},
-
-	{ /* FRONT_END_EVENT */
-		0x05, 0x08,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* EXECUTION_EVENT */
-		0x05, 0x0c,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* REPLAY_EVENT */
-		0x05, 0x09,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* INSTR_RETIRED */
-		0x04, 0x02, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR0},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
-	},
-
-	{ /* UOPS_RETIRED */
-		0x04, 0x01,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR0},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
-	},
-
-	{ /* UOP_TYPE */    
-		0x02, 0x02, 
-		{ { CTR_IQ_4, MSR_P4_RAT_ESCR0},
-		  { CTR_IQ_5, MSR_P4_RAT_ESCR1} }
-	},
-
-	{ /* RETIRED_MISPRED_BRANCH_TYPE */
-		0x02, 0x05, 
-		{ { CTR_MS_0, MSR_P4_TBPU_ESCR0},
-		  { CTR_MS_2, MSR_P4_TBPU_ESCR1} }
-	},
-
-	{ /* RETIRED_BRANCH_TYPE */
-		0x02, 0x04,
-		{ { CTR_MS_0, MSR_P4_TBPU_ESCR0},
-		  { CTR_MS_2, MSR_P4_TBPU_ESCR1} }
-	}
-};
-
-
-#define MISC_PMC_ENABLED_P(x) ((x) & 1ULL << 7)
-
-#define ESCR_RESERVED_BITS 0x80000003ULL
-#define ESCR_CLEAR(escr) ((escr) &= ESCR_RESERVED_BITS)
-#define ESCR_SET_USR_0(escr, usr) ((escr) |= (((usr) & 1ULL) << 2))
-#define ESCR_SET_OS_0(escr, os) ((escr) |= (((os) & 1ULL) << 3))
-#define ESCR_SET_USR_1(escr, usr) ((escr) |= (((usr) & 1ULL)))
-#define ESCR_SET_OS_1(escr, os) ((escr) |= (((os) & 1ULL) << 1))
-#define ESCR_SET_EVENT_SELECT(escr, sel) ((escr) |= (((sel) & 0x3fULL) << 25))
-#define ESCR_SET_EVENT_MASK(escr, mask) ((escr) |= (((mask) & 0xffffULL) << 9))
-#define ESCR_READ(escr,ev,i) do {rdmsrl(ev->bindings[(i)].escr_address, (escr));} while (0)
-#define ESCR_WRITE(escr,ev,i) do {wrmsrl(ev->bindings[(i)].escr_address, (escr));} while (0)
-
-#define CCCR_RESERVED_BITS 0x38030FFFULL
-#define CCCR_CLEAR(cccr) ((cccr) &= CCCR_RESERVED_BITS)
-#define CCCR_SET_REQUIRED_BITS(cccr) ((cccr) |= 0x00030000ULL)
-#define CCCR_SET_ESCR_SELECT(cccr, sel) ((cccr) |= (((sel) & 0x07ULL) << 13))
-#define CCCR_SET_PMI_OVF_0(cccr) ((cccr) |= (1ULL<<26))
-#define CCCR_SET_PMI_OVF_1(cccr) ((cccr) |= (1ULL<<27))
-#define CCCR_SET_ENABLE(cccr) ((cccr) |= (1ULL<<12))
-#define CCCR_SET_DISABLE(cccr) ((cccr) &= ~(1ULL<<12))
-#define CCCR_READ(msr_content, i) do {rdmsrl(p4_counters[(i)].cccr_address, (msr_content));} while (0)
-#define CCCR_WRITE(msr_content, i) do {wrmsrl(p4_counters[(i)].cccr_address, (msr_content));} while (0)
-#define CCCR_OVF_P(cccr) ((cccr) & (1ULL<<31))
-#define CCCR_CLEAR_OVF(cccr) ((cccr) &= (~(1ULL<<31)))
-
-#define CTR_READ(msr_content,i) do {rdmsrl(p4_counters[(i)].counter_address, (msr_content));} while (0)
-#define CTR_WRITE(msr_content,i) do {wrmsrl(p4_counters[(i)].counter_address, -(msr_content));} while (0)
-#define CTR_OVERFLOW_P(ctr) (!((ctr) & 0x80000000ULL))
-
-
-/* this assigns a "stagger" to the current CPU, which is used throughout
-   the code in this module as an extra array offset, to select the "even"
-   or "odd" part of all the divided resources. */
-static unsigned int get_stagger(void)
-{
-	int cpu = smp_processor_id();
-	return (cpu != cpumask_first(per_cpu(cpu_sibling_mask, cpu)));
-}
-
-
-/* finally, mediate access to a real hardware counter
-   by passing a "virtual" counter numer to this macro,
-   along with your stagger setting. */
-#define VIRT_CTR(stagger, i) ((i) + ((num_counters) * (stagger)))
-
-static unsigned long reset_value[NUM_COUNTERS_NON_HT];
-
-
-static void cf_check p4_fill_in_addresses(struct op_msrs * const msrs)
-{
-	unsigned int i;
-	unsigned int addr, stag;
-
-	setup_num_counters();
-	stag = get_stagger();
-
-	/* the counter registers we pay attention to */
-	for (i = 0; i < num_counters; ++i) {
-		msrs->counters[i].addr = 
-			p4_counters[VIRT_CTR(stag, i)].counter_address;
-	}
-
-	/* FIXME: bad feeling, we don't save the 10 counters we don't use. */
-
-	/* 18 CCCR registers */
-	for (i = 0, addr = MSR_P4_BPU_CCCR0 + stag;
-	     addr <= MSR_P4_IQ_CCCR5; ++i, addr += addr_increment()) {
-		msrs->controls[i].addr = addr;
-	}
-	
-	/* 43 ESCR registers in three or four discontiguous group */
-	for (addr = MSR_P4_BSU_ESCR0 + stag;
-	     addr < MSR_P4_IQ_ESCR0; ++i, addr += addr_increment()) {
-		msrs->controls[i].addr = addr;
-	}
-
-	/* no IQ_ESCR0/1 on some models, we save a seconde time BSU_ESCR0/1
-	 * to avoid special case in nmi_{save|restore}_registers() */
-	if (boot_cpu_data.x86_model >= 0x3) {
-		for (addr = MSR_P4_BSU_ESCR0 + stag;
-		     addr <= MSR_P4_BSU_ESCR1; ++i, addr += addr_increment()) {
-			msrs->controls[i].addr = addr;
-		}
-	} else {
-		for (addr = MSR_P4_IQ_ESCR0 + stag;
-		     addr <= MSR_P4_IQ_ESCR1; ++i, addr += addr_increment()) {
-			msrs->controls[i].addr = addr;
-		}
-	}
-
-	for (addr = MSR_P4_RAT_ESCR0 + stag;
-	     addr <= MSR_P4_SSU_ESCR0; ++i, addr += addr_increment()) {
-		msrs->controls[i].addr = addr;
-	}
-	
-	for (addr = MSR_P4_MS_ESCR0 + stag;
-	     addr <= MSR_P4_TC_ESCR1; ++i, addr += addr_increment()) { 
-		msrs->controls[i].addr = addr;
-	}
-	
-	for (addr = MSR_P4_IX_ESCR0 + stag;
-	     addr <= MSR_P4_CRU_ESCR3; ++i, addr += addr_increment()) { 
-		msrs->controls[i].addr = addr;
-	}
-
-	/* there are 2 remaining non-contiguously located ESCRs */
-
-	if (num_counters == NUM_COUNTERS_NON_HT) {		
-		/* standard non-HT CPUs handle both remaining ESCRs*/
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR5;
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR4;
-
-	} else if (stag == 0) {
-		/* HT CPUs give the first remainder to the even thread, as
-		   the 32nd control register */
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR4;
-
-	} else {
-		/* and two copies of the second to the odd thread,
-		   for the 22st and 23nd control registers */
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR5;
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR5;
-	}
-}
-
-
-static void pmc_setup_one_p4_counter(unsigned int ctr)
-{
-	int i;
-	int const maxbind = 2;
-	uint64_t cccr = 0;
-	uint64_t escr = 0;
-	unsigned int counter_bit;
-	const struct p4_event_binding *ev = NULL;
-	unsigned int stag;
-
-	stag = get_stagger();
-	
-	/* convert from counter *number* to counter *bit* */
-	counter_bit = 1 << VIRT_CTR(stag, ctr);
-	
-	/* find our event binding structure. */
-	if (counter_config[ctr].event <= 0 || counter_config[ctr].event > NUM_EVENTS) {
-		printk(KERN_ERR "oprofile: P4 event code %#lx out of range\n",
-		       counter_config[ctr].event);
-		return;
-	}
-	
-	ev = &(p4_events[counter_config[ctr].event - 1]);
-	
-	for (i = 0; i < maxbind; i++) {
-		if (ev->bindings[i].virt_counter & counter_bit) {
-
-			/* modify ESCR */
-			ESCR_READ(escr, ev, i);
-			ESCR_CLEAR(escr);
-			if (stag == 0) {
-				ESCR_SET_USR_0(escr, counter_config[ctr].user);
-				ESCR_SET_OS_0(escr, counter_config[ctr].kernel);
-			} else {
-				ESCR_SET_USR_1(escr, counter_config[ctr].user);
-				ESCR_SET_OS_1(escr, counter_config[ctr].kernel);
-			}
-			ESCR_SET_EVENT_SELECT(escr, ev->event_select);
-			ESCR_SET_EVENT_MASK(escr, counter_config[ctr].unit_mask);			
-			ESCR_WRITE(escr, ev, i);
-		       
-			/* modify CCCR */
-			CCCR_READ(cccr, VIRT_CTR(stag, ctr));
-			CCCR_CLEAR(cccr);
-			CCCR_SET_REQUIRED_BITS(cccr);
-			CCCR_SET_ESCR_SELECT(cccr, ev->escr_select);
-			if (stag == 0) {
-				CCCR_SET_PMI_OVF_0(cccr);
-			} else {
-				CCCR_SET_PMI_OVF_1(cccr);
-			}
-			CCCR_WRITE(cccr, VIRT_CTR(stag, ctr));
-			return;
-		}
-	}
-
-	printk(KERN_ERR 
-	       "oprofile: P4 event code %#lx no binding, stag %d ctr %d\n",
-	       counter_config[ctr].event, stag, ctr);
-}
-
-
-static void cf_check p4_setup_ctrs(struct op_msrs const * const msrs)
-{
-	unsigned int i;
-	uint64_t msr_content;
-	unsigned int addr;
-	unsigned int stag;
-
-	stag = get_stagger();
-
-	rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
-	if (! MISC_PMC_ENABLED_P(msr_content)) {
-		printk(KERN_ERR "oprofile: P4 PMC not available\n");
-		return;
-	}
-
-	/* clear the cccrs we will use */
-	for (i = 0 ; i < num_counters ; i++) {
-		rdmsrl(p4_counters[VIRT_CTR(stag, i)].cccr_address, msr_content);
-		CCCR_CLEAR(msr_content);
-		CCCR_SET_REQUIRED_BITS(msr_content);
-		wrmsrl(p4_counters[VIRT_CTR(stag, i)].cccr_address, msr_content);
-	}
-
-	/* clear cccrs outside our concern */
-	for (i = stag ; i < NUM_UNUSED_CCCRS ; i += addr_increment()) {
-		rdmsrl(p4_unused_cccr[i], msr_content);
-		CCCR_CLEAR(msr_content);
-		CCCR_SET_REQUIRED_BITS(msr_content);
-		wrmsrl(p4_unused_cccr[i], msr_content);
-	}
-
-	/* clear all escrs (including those outside our concern) */
-	for (addr = MSR_P4_BSU_ESCR0 + stag;
-	     addr <  MSR_P4_IQ_ESCR0; addr += addr_increment()) {
-		wrmsrl(addr, 0x0ULL);
-	}
-
-	/* On older models clear also MSR_P4_IQ_ESCR0/1 */
-	if (boot_cpu_data.x86_model < 0x3) {
-		wrmsrl(MSR_P4_IQ_ESCR0, 0x0ULL);
-		wrmsrl(MSR_P4_IQ_ESCR1, 0x0ULL);
-	}
-
-	for (addr = MSR_P4_RAT_ESCR0 + stag;
-	     addr <= MSR_P4_SSU_ESCR0; ++i, addr += addr_increment()) {
-		wrmsrl(addr, 0x0ULL);
-	}
-	
-	for (addr = MSR_P4_MS_ESCR0 + stag;
-	     addr <= MSR_P4_TC_ESCR1; addr += addr_increment()){ 
-		wrmsrl(addr, 0x0ULL);
-	}
-	
-	for (addr = MSR_P4_IX_ESCR0 + stag;
-	     addr <= MSR_P4_CRU_ESCR3; addr += addr_increment()){ 
-		wrmsrl(addr, 0x0ULL);
-	}
-
-	if (num_counters == NUM_COUNTERS_NON_HT) {		
-		wrmsrl(MSR_P4_CRU_ESCR4, 0x0ULL);
-		wrmsrl(MSR_P4_CRU_ESCR5, 0x0ULL);
-	} else if (stag == 0) {
-		wrmsrl(MSR_P4_CRU_ESCR4, 0x0ULL);
-	} else {
-		wrmsrl(MSR_P4_CRU_ESCR5, 0x0ULL);
-	}		
-	
-	/* setup all counters */
-	for (i = 0 ; i < num_counters ; ++i) {
-		if (counter_config[i].enabled) {
-			reset_value[i] = counter_config[i].count;
-			pmc_setup_one_p4_counter(i);
-			CTR_WRITE(counter_config[i].count, VIRT_CTR(stag, i));
-		} else {
-			reset_value[i] = 0;
-		}
-	}
-}
-
-static int cf_check p4_check_ctrs(
-	unsigned int const cpu, struct op_msrs const * const msrs,
-	struct cpu_user_regs const * const regs)
-{
-	unsigned long ctr, stag, real;
-	uint64_t msr_content;
-	int i;
-	int ovf = 0;
-	unsigned long eip = regs->rip;
-	int mode = xenoprofile_get_mode(current, regs);
-
-	stag = get_stagger();
-
-	for (i = 0; i < num_counters; ++i) {
-		
-		if (!reset_value[i]) 
-			continue;
-
-		/* 
-		 * there is some eccentricity in the hardware which
-		 * requires that we perform 2 extra corrections:
-		 *
-		 * - check both the CCCR:OVF flag for overflow and the
-		 *   counter high bit for un-flagged overflows.
-		 *
-		 * - write the counter back twice to ensure it gets
-		 *   updated properly.
-		 * 
-		 * the former seems to be related to extra NMIs happening
-		 * during the current NMI; the latter is reported as errata
-		 * N15 in intel doc 249199-029, pentium 4 specification
-		 * update, though their suggested work-around does not
-		 * appear to solve the problem.
-		 */
-		
-		real = VIRT_CTR(stag, i);
-
-		CCCR_READ(msr_content, real);
- 		CTR_READ(ctr, real);
-		if (CCCR_OVF_P(msr_content) || CTR_OVERFLOW_P(ctr)) {
-			xenoprof_log_event(current, regs, eip, mode, i);
-			CTR_WRITE(reset_value[i], real);
-			CCCR_CLEAR_OVF(msr_content);
-			CCCR_WRITE(msr_content, real);
- 			CTR_WRITE(reset_value[i], real);
-			ovf = 1;
-		}
-	}
-
-	/* P4 quirk: you have to re-unmask the apic vector */
-	apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
-
-	return ovf;
-}
-
-
-static void cf_check p4_start(struct op_msrs const * const msrs)
-{
-	unsigned int stag;
-	uint64_t msr_content;
-	int i;
-
-	stag = get_stagger();
-
-	for (i = 0; i < num_counters; ++i) {
-		if (!reset_value[i])
-			continue;
-		CCCR_READ(msr_content, VIRT_CTR(stag, i));
-		CCCR_SET_ENABLE(msr_content);
-		CCCR_WRITE(msr_content, VIRT_CTR(stag, i));
-	}
-}
-
-
-static void cf_check p4_stop(struct op_msrs const * const msrs)
-{
-	unsigned int stag;
-	uint64_t msr_content;
-	int i;
-
-	stag = get_stagger();
-
-	for (i = 0; i < num_counters; ++i) {
-		CCCR_READ(msr_content, VIRT_CTR(stag, i));
-		CCCR_SET_DISABLE(msr_content);
-		CCCR_WRITE(msr_content, VIRT_CTR(stag, i));
-	}
-}
-
-
-struct op_x86_model_spec const op_p4_ht2_spec = {
-	.num_counters = NUM_COUNTERS_HT2,
-	.num_controls = NUM_CONTROLS_HT2,
-	.fill_in_addresses = &p4_fill_in_addresses,
-	.setup_ctrs = &p4_setup_ctrs,
-	.check_ctrs = &p4_check_ctrs,
-	.start = &p4_start,
-	.stop = &p4_stop
-};
-
-
-struct op_x86_model_spec const op_p4_spec = {
-	.num_counters = NUM_COUNTERS_NON_HT,
-	.num_controls = NUM_CONTROLS_NON_HT,
-	.fill_in_addresses = &p4_fill_in_addresses,
-	.setup_ctrs = &p4_setup_ctrs,
-	.check_ctrs = &p4_check_ctrs,
-	.start = &p4_start,
-	.stop = &p4_stop
-};
diff --git a/xen/arch/x86/oprofile/op_model_ppro.c b/xen/arch/x86/oprofile/op_model_ppro.c
deleted file mode 100644
index 4bbb4502c7..0000000000
--- a/xen/arch/x86/oprofile/op_model_ppro.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/**
- * @file op_model_ppro.h
- * pentium pro / P6 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- * @author Philippe Elie
- * @author Graydon Hoare
- */
-
-#include <xen/sched.h>
-#include <xen/types.h>
-#include <xen/xenoprof.h>
-#include <xen/xvmalloc.h>
-
-#include <asm/msr.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/processor.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-#include <asm/vpmu.h>
-
-#include "op_x86_model.h"
-#include "op_counter.h"
-
-struct arch_msr_pair {
-    u64 counter;
-    u64 control;
-};
-
-/*
- * Intel "Architectural Performance Monitoring" CPUID
- * detection/enumeration details:
- */
-union cpuid10_eax {
-	struct {
-		unsigned int version_id:8;
-		unsigned int num_counters:8;
-		unsigned int bit_width:8;
-		unsigned int mask_length:8;
-	} split;
-	unsigned int full;
-};
-
-static int num_counters = 2;
-static int counter_width = 32;
-
-#define CTR_OVERFLOWED(n) (!((n) & (1ULL<<(counter_width-1))))
-
-#define CTRL_READ(msr_content,msrs,c) do {rdmsrl((msrs->controls[(c)].addr), (msr_content));} while (0)
-#define CTRL_WRITE(msr_content,msrs,c) do {wrmsrl((msrs->controls[(c)].addr), (msr_content));} while (0)
-#define CTRL_SET_ACTIVE(n) (n |= (1ULL<<22))
-#define CTRL_SET_INACTIVE(n) (n &= ~(1ULL<<22))
-#define CTRL_CLEAR(x) (x &= (1ULL<<21))
-#define CTRL_SET_ENABLE(val) (val |= 1ULL<<20)
-#define CTRL_SET_USR(val,u) (val |= ((u & 1ULL) << 16))
-#define CTRL_SET_KERN(val,k) (val |= ((k & 1ULL) << 17))
-#define CTRL_SET_UM(val, m) (val |= (m << 8))
-#define CTRL_SET_EVENT(val, e) (val |= e)
-#define IS_ACTIVE(val) (val & (1ULL << 22) )
-#define IS_ENABLE(val) (val & (1ULL << 20) )
-static unsigned long reset_value[OP_MAX_COUNTER];
-int ppro_has_global_ctrl = 0;
-
-static void cf_check ppro_fill_in_addresses(struct op_msrs * const msrs)
-{
-	int i;
-
-	for (i = 0; i < num_counters; i++)
-		msrs->counters[i].addr = MSR_P6_PERFCTR(i);
-	for (i = 0; i < num_counters; i++)
-		msrs->controls[i].addr = MSR_P6_EVNTSEL(i);
-}
-
-
-static void cf_check ppro_setup_ctrs(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-
-	if (cpu_has_arch_perfmon) {
-		union cpuid10_eax eax;
-		eax.full = cpuid_eax(0xa);
-
-		/*
-		 * For Core2 (family 6, model 15), don't reset the
-		 * counter width:
-		 */
-		if (!(eax.split.version_id == 0 &&
-			current_cpu_data.x86 == 6 &&
-				current_cpu_data.x86_model == 15)) {
-
-			if (counter_width < eax.split.bit_width)
-				counter_width = eax.split.bit_width;
-		}
-	}
-
-	/* clear all counters */
-	for (i = 0 ; i < num_counters; ++i) {
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_CLEAR(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-
-	/* avoid a false detection of ctr overflows in NMI handler */
-	for (i = 0; i < num_counters; ++i)
-		wrmsrl(msrs->counters[i].addr, ~0x0ULL);
-
-	/* enable active counters */
-	for (i = 0; i < num_counters; ++i) {
-		if (counter_config[i].enabled) {
-			reset_value[i] = counter_config[i].count;
-
-			wrmsrl(msrs->counters[i].addr, -reset_value[i]);
-
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_CLEAR(msr_content);
-			CTRL_SET_ENABLE(msr_content);
-			CTRL_SET_USR(msr_content, counter_config[i].user);
-			CTRL_SET_KERN(msr_content, counter_config[i].kernel);
-			CTRL_SET_UM(msr_content, counter_config[i].unit_mask);
-			CTRL_SET_EVENT(msr_content, counter_config[i].event);
-			CTRL_WRITE(msr_content, msrs, i);
-		} else {
-			reset_value[i] = 0;
-		}
-	}
-}
-
-static int cf_check ppro_check_ctrs(
-	unsigned int const cpu, struct op_msrs const * const msrs,
-	struct cpu_user_regs const * const regs)
-{
-	u64 val;
-	int i;
-	int ovf = 0;
-	unsigned long eip = regs->rip;
-	int mode = xenoprofile_get_mode(current, regs);
-	struct arch_msr_pair *msrs_content = vcpu_vpmu(current)->context;
-
-	for (i = 0 ; i < num_counters; ++i) {
-		if (!reset_value[i])
-			continue;
-		rdmsrl(msrs->counters[i].addr, val);
-		if (CTR_OVERFLOWED(val)) {
-			xenoprof_log_event(current, regs, eip, mode, i);
-			wrmsrl(msrs->counters[i].addr, -reset_value[i]);
-			if ( is_passive(current->domain) && (mode != 2) &&
-				vpmu_is_set(vcpu_vpmu(current),
-                                            VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-			{
-				if ( IS_ACTIVE(msrs_content[i].control) )
-				{
-					msrs_content[i].counter = val;
-					if ( IS_ENABLE(msrs_content[i].control) )
-						ovf = 2;
-				}
-			}
-			if ( !ovf )
-				ovf = 1;
-		}
-	}
-
-	/* Only P6 based Pentium M need to re-unmask the apic vector but it
-	 * doesn't hurt other P6 variant */
-	apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
-
-	return ovf;
-}
-
-
-static void cf_check ppro_start(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-
-	for (i = 0; i < num_counters; ++i) {
-		if (reset_value[i]) {
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_SET_ACTIVE(msr_content);
-			CTRL_WRITE(msr_content, msrs, i);
-		}
-	}
-    /* Global Control MSR is enabled by default when system power on.
-     * However, this may not hold true when xenoprof starts to run.
-     */
-    if ( ppro_has_global_ctrl )
-        wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, (1ULL<<num_counters) - 1);
-}
-
-
-static void cf_check ppro_stop(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-
-	for (i = 0; i < num_counters; ++i) {
-		if (!reset_value[i])
-			continue;
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_SET_INACTIVE(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-    if ( ppro_has_global_ctrl )
-        wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0x0ULL);
-}
-
-static int cf_check ppro_is_arch_pmu_msr(u64 msr_index, int *type, int *index)
-{
-	if ( (msr_index >= MSR_IA32_PERFCTR0) &&
-            (msr_index < (MSR_IA32_PERFCTR0 + num_counters)) )
-	{
-		*type = MSR_TYPE_ARCH_COUNTER;
-		*index = msr_index - MSR_IA32_PERFCTR0;
-		return 1;
-        }
-        if ( (msr_index >= MSR_P6_EVNTSEL(0)) &&
-            (msr_index < (MSR_P6_EVNTSEL(num_counters))) )
-        {
-		*type = MSR_TYPE_ARCH_CTRL;
-		*index = msr_index - MSR_P6_EVNTSEL(0);
-		return 1;
-        }
-
-        return 0;
-}
-
-static int cf_check ppro_allocate_msr(struct vcpu *v)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(v);
-	struct arch_msr_pair *msr_content;
-
-	msr_content = xvzalloc_array(struct arch_msr_pair, num_counters);
-	if ( !msr_content )
-		goto out;
-	vpmu->context = (void *)msr_content;
-	vpmu_clear(vpmu);
-	vpmu_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED);
-	return 1;
-out:
-	printk(XENLOG_G_WARNING "Insufficient memory for oprofile,"
-	       " oprofile is unavailable on dom%d vcpu%d\n",
-	       v->vcpu_id, v->domain->domain_id);
-	return 0;
-}
-
-static void cf_check ppro_free_msr(struct vcpu *v)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(v);
-
-	if ( !vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-		return;
-	XVFREE(vpmu->context);
-	vpmu_reset(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED);
-}
-
-static void cf_check ppro_load_msr(
-	struct vcpu *v, int type, int index, u64 *msr_content)
-{
-	struct arch_msr_pair *msrs = vcpu_vpmu(v)->context;
-	switch ( type )
-	{
-	case MSR_TYPE_ARCH_COUNTER:
-		*msr_content = msrs[index].counter;
-		break;
-	case MSR_TYPE_ARCH_CTRL:
-		*msr_content = msrs[index].control;
-		break;
-	}
-}
-
-static void cf_check ppro_save_msr(
-	struct vcpu *v, int type, int index, u64 msr_content)
-{
-	struct arch_msr_pair *msrs = vcpu_vpmu(v)->context;
-
-	switch ( type )
-	{
-	case MSR_TYPE_ARCH_COUNTER:
-		msrs[index].counter = msr_content;
-		break;
-	case MSR_TYPE_ARCH_CTRL:
-		msrs[index].control = msr_content;
-		break;
-	}
-}
-
-/*
- * Architectural performance monitoring.
- *
- * Newer Intel CPUs (Core1+) have support for architectural
- * events described in CPUID 0xA. See the IA32 SDM Vol3b.18 for details.
- * The advantage of this is that it can be done without knowing about
- * the specific CPU.
- */
-void arch_perfmon_setup_counters(void)
-{
-	union cpuid10_eax eax;
-
-	eax.full = cpuid_eax(0xa);
-
-	/* Workaround for BIOS bugs in 6/15. Taken from perfmon2 */
-	if (eax.split.version_id == 0 && current_cpu_data.x86 == 6 &&
-	    current_cpu_data.x86_model == 15) {
-		eax.split.version_id = 2;
-		eax.split.num_counters = 2;
-		eax.split.bit_width = 40;
-	}
-
-	num_counters = min_t(u8, eax.split.num_counters, OP_MAX_COUNTER);
-
-	op_arch_perfmon_spec.num_counters = num_counters;
-	op_arch_perfmon_spec.num_controls = num_counters;
-	op_ppro_spec.num_counters = num_counters;
-	op_ppro_spec.num_controls = num_counters;
-}
-
-struct op_x86_model_spec __read_mostly op_ppro_spec = {
-	.num_counters = 2,
-	.num_controls = 2,
-	.fill_in_addresses = &ppro_fill_in_addresses,
-	.setup_ctrs = &ppro_setup_ctrs,
-	.check_ctrs = &ppro_check_ctrs,
-	.start = &ppro_start,
-	.stop = &ppro_stop,
-	.is_arch_pmu_msr = &ppro_is_arch_pmu_msr,
-	.allocated_msr = &ppro_allocate_msr,
-	.free_msr = &ppro_free_msr,
-	.load_msr = &ppro_load_msr,
-	.save_msr = &ppro_save_msr
-};
-
-struct op_x86_model_spec __read_mostly op_arch_perfmon_spec = {
-	/* num_counters/num_controls filled in at runtime */
-	.fill_in_addresses = &ppro_fill_in_addresses,
-	.setup_ctrs = &ppro_setup_ctrs,
-	.check_ctrs = &ppro_check_ctrs,
-	.start = &ppro_start,
-	.stop = &ppro_stop,
-	.is_arch_pmu_msr = &ppro_is_arch_pmu_msr,
-	.allocated_msr = &ppro_allocate_msr,
-	.free_msr = &ppro_free_msr,
-	.load_msr = &ppro_load_msr,
-	.save_msr = &ppro_save_msr
-};
diff --git a/xen/arch/x86/oprofile/op_x86_model.h b/xen/arch/x86/oprofile/op_x86_model.h
deleted file mode 100644
index 35bc3c1e22..0000000000
--- a/xen/arch/x86/oprofile/op_x86_model.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @file op_x86_model.h
- * interface to x86 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author Graydon Hoare
- */
-
-#ifndef OP_X86_MODEL_H
-#define OP_X86_MODEL_H
-
-struct op_msr {
-	unsigned long addr;
-	uint64_t value;
-};
-
-struct op_msrs {
-	struct op_msr * counters;
-	struct op_msr * controls;
-};
-
-struct pt_regs;
-
-/* The model vtable abstracts the differences between
- * various x86 CPU model's perfctr support.
- */
-struct op_x86_model_spec {
-	unsigned int num_counters;
-	unsigned int num_controls;
-	void (*fill_in_addresses)(struct op_msrs * const msrs);
-	void (*setup_ctrs)(struct op_msrs const * const msrs);
-	int (*check_ctrs)(unsigned int const cpu, 
-			  struct op_msrs const * const msrs,
-			  struct cpu_user_regs const * const regs);
-	void (*start)(struct op_msrs const * const msrs);
-	void (*stop)(struct op_msrs const * const msrs);
-	int (*is_arch_pmu_msr)(u64 msr_index, int *type, int *index);
-	int (*allocated_msr)(struct vcpu *v);
-	void (*free_msr)(struct vcpu *v);
-	void (*load_msr)(struct vcpu * const v, int type, int index, u64 *msr_content);
-        void (*save_msr)(struct vcpu * const v, int type, int index, u64 msr_content);
-};
-
-extern struct op_x86_model_spec op_ppro_spec;
-extern struct op_x86_model_spec op_arch_perfmon_spec;
-extern struct op_x86_model_spec const op_p4_spec;
-extern struct op_x86_model_spec const op_p4_ht2_spec;
-extern struct op_x86_model_spec const op_athlon_spec;
-extern struct op_x86_model_spec const op_amd_fam15h_spec;
-
-void arch_perfmon_setup_counters(void);
-
-extern int ppro_has_global_ctrl;
-extern struct op_x86_model_spec const *model;
-
-#endif /* OP_X86_MODEL_H */
diff --git a/xen/arch/x86/oprofile/xenoprof.c b/xen/arch/x86/oprofile/xenoprof.c
deleted file mode 100644
index 7f2525bfb4..0000000000
--- a/xen/arch/x86/oprofile/xenoprof.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2005 Hewlett-Packard Co.
- * written by Aravind Menon & Jose Renato Santos
- *            (email: xenoprof@groups.hp.com)
- *
- * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- * x86 specific part
- */
-
-#include <xen/guest_access.h>
-#include <xen/sched.h>
-#include <xen/xenoprof.h>
-#include <public/xenoprof.h>
-
-#include "op_counter.h"
-
-int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
-{
-    struct xenoprof_counter counter;
-
-    if ( copy_from_guest(&counter, arg, 1) )
-        return -EFAULT;
-
-    if ( counter.ind >= OP_MAX_COUNTER )
-        return -E2BIG;
-
-    counter_config[counter.ind].count     = counter.count;
-    counter_config[counter.ind].enabled   = counter.enabled;
-    counter_config[counter.ind].event     = counter.event;
-    counter_config[counter.ind].kernel    = counter.kernel;
-    counter_config[counter.ind].user      = counter.user;
-    counter_config[counter.ind].unit_mask = counter.unit_mask;
-
-    return 0;
-}
-
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
-{
-    struct xenoprof_ibs_counter ibs_counter;
-
-    if ( copy_from_guest(&ibs_counter, arg, 1) )
-        return -EFAULT;
-
-    ibs_config.op_enabled = ibs_counter.op_enabled;
-    ibs_config.fetch_enabled = ibs_counter.fetch_enabled;
-    ibs_config.max_cnt_fetch = ibs_counter.max_cnt_fetch;
-    ibs_config.max_cnt_op = ibs_counter.max_cnt_op;
-    ibs_config.rand_en = ibs_counter.rand_en;
-    ibs_config.dispatched_ops = ibs_counter.dispatched_ops;
-
-    return 0;
-}
-
-#ifdef CONFIG_COMPAT
-#include <compat/xenoprof.h>
-
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
-{
-    struct compat_oprof_counter counter;
-
-    if ( copy_from_guest(&counter, arg, 1) )
-        return -EFAULT;
-
-    if ( counter.ind >= OP_MAX_COUNTER )
-        return -E2BIG;
-
-    counter_config[counter.ind].count     = counter.count;
-    counter_config[counter.ind].enabled   = counter.enabled;
-    counter_config[counter.ind].event     = counter.event;
-    counter_config[counter.ind].kernel    = counter.kernel;
-    counter_config[counter.ind].user      = counter.user;
-    counter_config[counter.ind].unit_mask = counter.unit_mask;
-
-    return 0;
-}
-#endif
-
-int xenoprofile_get_mode(struct vcpu *curr, const struct cpu_user_regs *regs)
-{
-    if ( !guest_mode(regs) )
-        return 2;
-
-    if ( !is_hvm_vcpu(curr) )
-        return guest_kernel_mode(curr, regs);
-
-    switch ( hvm_guest_x86_mode(curr) )
-    {
-    case X86_MODE_REAL:
-        return 1;
-    case X86_MODE_VM86:
-        return 0;
-    default: /* 16BIT | 32BIT | 64BIT */
-        return hvm_get_cpl(curr) != 3;
-    }
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6ba7ae5202..f621b99a5f 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -50,7 +50,6 @@
 #include <asm/system.h>
 #include <asm/traps.h>
 #include <asm/uaccess.h>
-#include <asm/xenoprof.h>
 
 /*
  * opt_nmi: one of 'ignore', 'dom0', or 'fatal'.
@@ -1943,9 +1942,6 @@ bool nmi_check_continuation(void)
     if ( pci_serr_nmicont() )
         ret = true;
 
-    if ( nmi_oprofile_send_virq() )
-        ret = true;
-
     return ret;
 }
 
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 401d5046f6..38320b248a 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -374,17 +374,6 @@ config EFI_SET_VIRTUAL_ADDRESS_MAP
 
       If unsure, say N.
 
-config XENOPROF
-	bool "Xen Oprofile Support" if EXPERT
-	depends on X86
-	help
-	  Xen OProfile (Xenoprof) is a system-wide profiler for Xen virtual
-	  machine environments, capable of profiling the Xen virtual machine
-	  monitor, multiple Linux guest operating systems, and applications
-	  running on them.
-
-	  If unsure, say Y.
-
 config XSM
 	bool "Xen Security Modules support"
 	default ARM
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 8486c0b510..92c97d641e 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -63,7 +63,6 @@ obj-$(CONFIG_HAS_VMAP) += vmap.o
 obj-y += vsprintf.o
 obj-y += wait.o
 obj-bin-y += warning.init.o
-obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
 
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 unzstd earlycpio,$(n).init.o)
diff --git a/xen/common/compat/xenoprof.c b/xen/common/compat/xenoprof.c
deleted file mode 100644
index 8fbd86c24c..0000000000
--- a/xen/common/compat/xenoprof.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * compat/xenoprof.c
- */
-
-#include <compat/xenoprof.h>
-
-#define COMPAT
-#define ret_t int
-
-#define do_xenoprof_op compat_xenoprof_op
-
-#define xen_oprof_init xenoprof_init
-CHECK_oprof_init;
-#undef xen_oprof_init
-


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 21:11:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 21:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199201.1515829 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veJl8-0005u1-Bf; Fri, 09 Jan 2026 21:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199201.1515829; Fri, 09 Jan 2026 21: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 1veJl8-0005tu-8o; Fri, 09 Jan 2026 21:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1199201;
 Fri, 09 Jan 2026 21: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 1veJl7-0005to-Js
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 21: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 1veJl7-00GjYn-0s
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 21:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veJl7-00G5nX-1I
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 21: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=WBjTL277/1+atXD7g+bR6zIxIWU2Wh6TUNl4A1hSOiE=; b=llD4JH1th/tRGh9JJkaKwCH0oX
	gAyWA3JkM4I78/ucQ/cSgjirDQxoR6pml9AwE243VFWyVp2bJrnuZt4Lta/CfqY2DN9ve3Uzxm2Hl
	QbcqKkU8Yw0FAN+aJ3LQQmIW0X5so21h6lcmP1pw89tQkCcRAAAAi+mL2LPQCk6a/buw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Drop xenoprofile support
Message-Id: <E1veJl7-00G5nX-1I@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 21:11:01 +0000

commit 69e8aaf9cce2253a5fd088bc64e9139dcbb47f8a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 18:54:45 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 19:05:45 2026 +0000

    xen: Drop xenoprofile support
    
    The most recent xenoprof change was 300ef0cb4fde ("x86: Add Xenoprofile
    support for AMD Family16h") in 2013, despite there being 42 changes worth of
    other cleanup/rearranging since then.
    
    Oprofile themselves dropped Xen support in commit 0c142c3a096d ("Remove
    opcontrol and the GUI and processor models dependent on it") in 2014, as part
    of releasing version 1.0 and switching over to using operf based on the Linux
    perf_event subsystem.  Linux's version of this patch was merged in commit
    24880bef417f ("Merge tag 'oprofile-removal-5.12'") in 2021.
    
    Drop xenoprof and all supporting infrastructure, including the hypercall, the
    XSM hook and flask vectors which lose their only caller, and even shrinks
    struct domain by one pointer which wasn't properly excluded in
    !CONFIG_XENOPROF builds.
    
    Retain the public xenoprof.h header as it is ABI, but note that the
    functionality is removed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 CHANGELOG.md                            |   3 +
 docs/misc/xen-command-line.pandoc       |   6 -
 tools/flask/policy/modules/dom0.te      |   2 -
 xen/arch/x86/Makefile                   |   1 -
 xen/arch/x86/cpu/vpmu_amd.c             |   9 -
 xen/arch/x86/cpu/vpmu_intel.c           |   6 -
 xen/arch/x86/hvm/svm/entry.S            |   1 -
 xen/arch/x86/hvm/svm/svm.c              |   2 -
 xen/arch/x86/hvm/vmx/vmx.c              |   9 -
 xen/arch/x86/include/asm/vpmu.h         |   2 +-
 xen/arch/x86/include/asm/xenoprof.h     |  95 ----
 xen/arch/x86/oprofile/Makefile          |   6 -
 xen/arch/x86/oprofile/backtrace.c       | 145 -----
 xen/arch/x86/oprofile/nmi_int.c         | 485 ----------------
 xen/arch/x86/oprofile/op_counter.h      |  41 --
 xen/arch/x86/oprofile/op_model_athlon.c | 547 ------------------
 xen/arch/x86/oprofile/op_model_p4.c     | 721 -----------------------
 xen/arch/x86/oprofile/op_model_ppro.c   | 348 ------------
 xen/arch/x86/oprofile/op_x86_model.h    |  58 --
 xen/arch/x86/oprofile/xenoprof.c        | 106 ----
 xen/arch/x86/traps.c                    |   4 -
 xen/common/Kconfig                      |  11 -
 xen/common/Makefile                     |   1 -
 xen/common/compat/xenoprof.c            |  42 --
 xen/common/domain.c                     |   6 -
 xen/common/xenoprof.c                   | 977 --------------------------------
 xen/include/Makefile                    |   1 -
 xen/include/hypercall-defs.c            |   6 -
 xen/include/public/xen.h                |   2 +-
 xen/include/public/xenoprof.h           |   2 +-
 xen/include/xen/sched.h                 |   3 -
 xen/include/xen/xenoprof.h              |  49 --
 xen/include/xsm/dummy.h                 |   7 -
 xen/include/xsm/xsm.h                   |   7 -
 xen/xsm/dummy.c                         |   2 -
 xen/xsm/flask/hooks.c                   |  35 --
 xen/xsm/flask/policy/access_vectors     |   4 -
 37 files changed, 6 insertions(+), 3746 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3aaf598623..1663f6878e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - The cpuid_mask_* command line options for legacy AMD CPUs.  These were
      deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from
      2011 onwards.
+   - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
+     prior to the version 1.0 release, and there has been no development since
+     before then in Xen.
 
 ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
 
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index bbbdf6a5bb..50d7edb248 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -508,12 +508,6 @@ character, but for xen to keep the console.
 
 > Default: `power`
 
-### cpu_type (x86)
-> `= arch_perfmon`
-
-If set, force use of the performance counters for oprofile, rather than detecting
-available support.
-
 ### cpufreq
 > `= none | {{ <boolean> | xen } { [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfreq>]]] } [,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]] | amd-cppc[:[active][,verbose]]`
 
diff --git a/tools/flask/policy/modules/dom0.te b/tools/flask/policy/modules/dom0.te
index ad2b4f9ea7..d30edf8be1 100644
--- a/tools/flask/policy/modules/dom0.te
+++ b/tools/flask/policy/modules/dom0.te
@@ -21,8 +21,6 @@ allow dom0_t xen_t:xen {
 	writeconsole
 	readapic
 	writeapic
-	privprofile
-	nonprivprofile
 	kexec
 	firmware
 	sleep
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 1fc651146f..d8b41cec16 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -7,7 +7,6 @@ obj-$(CONFIG_GUEST) += guest/
 obj-$(CONFIG_HVM) += hvm/
 obj-y += lib/
 obj-y += mm/
-obj-$(CONFIG_XENOPROF) += oprofile/
 obj-$(CONFIG_PV) += pv/
 obj-y += x86_64/
 obj-y += x86_emulate/
diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index fa157d45dd..d1f6bd5495 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -12,7 +12,6 @@
 
 #include <xen/err.h>
 #include <xen/sched.h>
-#include <xen/xenoprof.h>
 
 #include <asm/apic.h>
 #include <asm/hvm/save.h>
@@ -363,8 +362,6 @@ static int cf_check amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     if ( (type == MSR_TYPE_CTRL) &&
         is_pmu_enabled(msr_content) && !vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
-        if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
-            return 0;
         vpmu_set(vpmu, VPMU_RUNNING);
 
         if ( is_svm_vcpu(v) && is_msr_bitmap_on(vpmu) )
@@ -378,7 +375,6 @@ static int cf_check amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( is_svm_vcpu(v) && is_msr_bitmap_on(vpmu) )
              amd_vpmu_unset_msr_bitmap(v);
-        release_pmu_ownership(PMU_OWNER_HVM);
     }
 
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
@@ -426,9 +422,6 @@ static void cf_check amd_vpmu_destroy(struct vcpu *v)
     vpmu->context = NULL;
     vpmu->priv_context = NULL;
 
-    if ( vpmu_is_set(vpmu, VPMU_RUNNING) )
-        release_pmu_ownership(PMU_OWNER_HVM);
-
     vpmu_clear(vpmu);
 }
 
@@ -449,8 +442,6 @@ static void cf_check amd_vpmu_dump(const struct vcpu *v)
     }
 
     printk("(");
-    if ( vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-        printk("PASSIVE_DOMAIN_ALLOCATED, ");
     if ( vpmu_is_set(vpmu, VPMU_FROZEN) )
         printk("FROZEN, ");
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 7ce98ee42e..1e3b06ef8e 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -9,7 +9,6 @@
 
 #include <xen/err.h>
 #include <xen/sched.h>
-#include <xen/xenoprof.h>
 #include <asm/system.h>
 #include <asm/regs.h>
 #include <asm/apic.h>
@@ -441,9 +440,6 @@ static int cf_check core2_vpmu_alloc_resource(struct vcpu *v)
     struct xen_pmu_intel_ctxt *core2_vpmu_cxt = NULL;
     uint64_t *p = NULL;
 
-    if ( !acquire_pmu_ownership(PMU_OWNER_HVM) )
-        return 0;
-
     if ( is_vmx_vcpu(v) )
     {
         if ( vmx_add_host_load_msr(v, MSR_CORE_PERF_GLOBAL_CTRL, 0) )
@@ -487,7 +483,6 @@ static int cf_check core2_vpmu_alloc_resource(struct vcpu *v)
     return 1;
 
 out_err:
-    release_pmu_ownership(PMU_OWNER_HVM);
 
     xfree(core2_vpmu_cxt);
     xfree(p);
@@ -814,7 +809,6 @@ static void cf_check core2_vpmu_destroy(struct vcpu *v)
     vpmu->priv_context = NULL;
     if ( is_vmx_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v);
-    release_pmu_ownership(PMU_OWNER_HVM);
     vpmu_clear(vpmu);
 }
 
diff --git a/xen/arch/x86/hvm/svm/entry.S b/xen/arch/x86/hvm/svm/entry.S
index 610c64bf4c..af8db23b03 100644
--- a/xen/arch/x86/hvm/svm/entry.S
+++ b/xen/arch/x86/hvm/svm/entry.S
@@ -155,7 +155,6 @@ __UNLIKELY_END(nsvm_hap)
          * to safely resolve any Spectre-v1 concerns in the above logic.
          */
         stgi
-LABEL(svm_stgi_label, 0)
         call svm_vmexit_handler
         jmp  .Lsvm_do_resume
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 1208999454..da113f488b 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -36,7 +36,6 @@
 #include <asm/paging.h>
 #include <asm/processor.h>
 #include <asm/x86_emulate.h>
-#include <asm/xenoprof.h>
 
 #include <public/sched.h>
 
@@ -1152,7 +1151,6 @@ static int cf_check svm_vcpu_initialise(struct vcpu *v)
 static void cf_check svm_vcpu_destroy(struct vcpu *v)
 {
     svm_destroy_vmcb(v);
-    passive_domain_destroy(v);
 }
 
 /*
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 05b59cb8e4..f4beac192d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -48,7 +48,6 @@
 #include <asm/spec_ctrl.h>
 #include <asm/stubs.h>
 #include <asm/x86_emulate.h>
-#include <asm/xenoprof.h>
 
 #include <public/arch-x86/cpuid.h>
 #include <public/hvm/ioreq.h>
@@ -692,7 +691,6 @@ static void cf_check vmx_vcpu_destroy(struct vcpu *v)
      */
     vmx_vcpu_disable_pml(v);
     vmx_destroy_vmcs(v);
-    passive_domain_destroy(v);
 }
 
 /*
@@ -3560,9 +3558,6 @@ static int cf_check vmx_msr_read_intercept(
         break;
 
     default:
-        if ( passive_domain_do_rdmsr(msr, msr_content) )
-            goto done;
-
         if ( vmx_read_guest_msr(curr, msr, msr_content) == 0 )
             break;
 
@@ -3582,7 +3577,6 @@ static int cf_check vmx_msr_read_intercept(
         goto gp_fault;
     }
 
-done:
     HVM_DBG_LOG(DBG_LEVEL_MSR, "returns: ecx=%#x, msr_value=%#"PRIx64,
                 msr, *msr_content);
     return X86EMUL_OKAY;
@@ -3875,9 +3869,6 @@ static int cf_check vmx_msr_write_intercept(
         break;
 
     default:
-        if ( passive_domain_do_wrmsr(msr, msr_content) )
-            return X86EMUL_OKAY;
-
         if ( vmx_write_guest_msr(v, msr, msr_content) == 0 ||
              is_last_branch_msr(msr) )
             break;
diff --git a/xen/arch/x86/include/asm/vpmu.h b/xen/arch/x86/include/asm/vpmu.h
index dae9b43dac..d4504201fe 100644
--- a/xen/arch/x86/include/asm/vpmu.h
+++ b/xen/arch/x86/include/asm/vpmu.h
@@ -65,7 +65,7 @@ struct vpmu_struct {
 #define VPMU_RUNNING                        0x0008
 #define VPMU_CONTEXT_SAVE                   0x0010  /* Force context save */
 #define VPMU_FROZEN                         0x0020  /* Stop counters while VCPU is not running */
-#define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x0040
+/* 0x0040 available */
 /* PV(H) guests: VPMU registers are accessed by guest from shared page */
 #define VPMU_CACHED                         0x0080
 #define VPMU_AVAILABLE                      0x0100
diff --git a/xen/arch/x86/include/asm/xenoprof.h b/xen/arch/x86/include/asm/xenoprof.h
deleted file mode 100644
index dc6f822d32..0000000000
--- a/xen/arch/x86/include/asm/xenoprof.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/******************************************************************************
- * asm-x86/xenoprof.h
- * xenoprof x86 arch specific header file
- *
- * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- */
-
-#ifndef __ASM_X86_XENOPROF_H__
-#define __ASM_X86_XENOPROF_H__
-
-struct vcpu;
-
-#ifdef CONFIG_XENOPROF
-
-#include <public/xen.h>
-
-int nmi_reserve_counters(void);
-int nmi_setup_events(void);
-int nmi_enable_virq(void);
-int nmi_start(void);
-void nmi_stop(void);
-void nmi_disable_virq(void);
-void nmi_release_counters(void);
-
-int xenoprof_arch_init(int *num_events, char *cpu_type);
-#define xenoprof_arch_reserve_counters()        nmi_reserve_counters()
-#define xenoprof_arch_setup_events()            nmi_setup_events()
-#define xenoprof_arch_enable_virq()             nmi_enable_virq()
-#define xenoprof_arch_start()                   nmi_start()
-#define xenoprof_arch_stop()                    nmi_stop()
-#define xenoprof_arch_disable_virq()            nmi_disable_virq()
-#define xenoprof_arch_release_counters()        nmi_release_counters()
-
-int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg);
-
-struct cpu_user_regs;
-
-/* AMD IBS support */
-void ibs_init(void);
-extern u32 ibs_caps;
-
-int xenoprofile_get_mode(struct vcpu *, const struct cpu_user_regs *);
-
-static inline int xenoprof_backtrace_supported(void)
-{
-    return 1;
-}
-
-void xenoprof_backtrace(struct vcpu *, const struct cpu_user_regs *,
-                        unsigned long depth, int mode);
-
-int passive_domain_do_rdmsr(unsigned int msr, uint64_t *msr_content);
-int passive_domain_do_wrmsr(unsigned int msr, uint64_t msr_content);
-void passive_domain_destroy(struct vcpu *v);
-
-bool nmi_oprofile_send_virq(void);
-
-#else
-
-static inline int passive_domain_do_rdmsr(unsigned int msr,
-                                          uint64_t *msr_content)
-{
-    return 0;
-}
-
-static inline int passive_domain_do_wrmsr(unsigned int msr,
-                                          uint64_t msr_content)
-{
-    return 0;
-}
-
-static inline void passive_domain_destroy(struct vcpu *v) {}
-
-static inline bool nmi_oprofile_send_virq(void)
-{
-    return false;
-}
-
-#endif /* CONFIG_XENOPROF */
-
-#endif /* __ASM_X86_XENOPROF_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/x86/oprofile/Makefile b/xen/arch/x86/oprofile/Makefile
deleted file mode 100644
index 956e3d1b5d..0000000000
--- a/xen/arch/x86/oprofile/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-obj-y += xenoprof.o
-obj-y += nmi_int.o
-obj-y += op_model_p4.o
-obj-y += op_model_ppro.o
-obj-y += op_model_athlon.o
-obj-y += backtrace.o
diff --git a/xen/arch/x86/oprofile/backtrace.c b/xen/arch/x86/oprofile/backtrace.c
deleted file mode 100644
index 61de18c8d5..0000000000
--- a/xen/arch/x86/oprofile/backtrace.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * @file backtrace.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- * @author David Smith
- * Modified for Xen by Amitabha Roy
- *
- */
-
-#include <xen/types.h>
-#include <asm/page.h>
-#include <xen/xenoprof.h>
-#include <xen/guest_access.h>
-
-struct __packed frame_head {
-    struct frame_head * ebp;
-    unsigned long ret;
-};
-typedef struct frame_head frame_head_t;
-
-struct __packed frame_head_32bit {
-    uint32_t ebp;
-    uint32_t ret;
-};
-typedef struct frame_head_32bit frame_head32_t;
-
-static struct frame_head *
-dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
-                          int mode)
-{
-    if (!xenoprof_add_trace(vcpu, head->ret, mode))
-        return 0;
-    
-    /* frame pointers should strictly progress back up the stack
-     * (towards higher addresses) */
-    if (head >= head->ebp)
-        return NULL;
-    
-    return head->ebp;
-}
-
-static inline int is_32bit_vcpu(struct vcpu *vcpu)
-{
-    if (is_hvm_vcpu(vcpu))
-        return !hvm_long_mode_active(vcpu);
-    else
-        return is_pv_32bit_vcpu(vcpu);
-}
-
-static struct frame_head *
-dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,
-                     int mode)
-{
-    /* Also check accessibility of one struct frame_head beyond. */
-    frame_head_t bufhead[2];
-
-    if ( is_32bit_vcpu(vcpu) )
-    {
-        frame_head32_t bufhead32[2];
-
-        if ( raw_copy_from_guest(bufhead32, head, sizeof(bufhead32)) )
-            return 0;
-        bufhead[0].ebp = (struct frame_head *)(unsigned long)bufhead32[0].ebp;
-        bufhead[0].ret = bufhead32[0].ret;
-    }
-    else if ( raw_copy_from_guest(bufhead, head, sizeof(bufhead)) )
-        return 0;
-    
-    if ( !xenoprof_add_trace(vcpu, bufhead[0].ret, mode) )
-        return 0;
-    
-    /* frame pointers should strictly progress back up the stack
-     * (towards higher addresses) */
-    if ( head >= bufhead[0].ebp )
-        return NULL;
-    
-    return bufhead[0].ebp;
-}
-
-/*
- * |             | /\ Higher addresses
- * |             |
- * --------------- stack base (address of current_thread_info)
- * | thread info |
- * .             .
- * |    stack    |
- * --------------- saved regs->ebp value if valid (frame_head address)
- * .             .
- * --------------- saved regs->rsp value if x86_64
- * |             |
- * --------------- struct pt_regs * stored on stack if 32-bit
- * |             |
- * .             .
- * |             |
- * --------------- %esp
- * |             |
- * |             | \/ Lower addresses
- *
- * Thus, regs (or regs->rsp for x86_64) <-> stack base restricts the
- * valid(ish) ebp values. Note: (1) for x86_64, NMI and several other
- * exceptions use special stacks, maintained by the interrupt stack table
- * (IST). These stacks are set up in trap_init() in
- * arch/x86_64/kernel/traps.c. Thus, for x86_64, regs now does not point
- * to the kernel stack; instead, it points to some location on the NMI
- * stack. On the other hand, regs->rsp is the stack pointer saved when the
- * NMI occurred. (2) For 32-bit, regs->esp is not valid because the
- * processor does not save %esp on the kernel stack when interrupts occur
- * in the kernel mode.
- */
-#if defined(CONFIG_FRAME_POINTER)
-static int valid_hypervisor_stack(const struct frame_head *head,
-				  const struct cpu_user_regs *regs)
-{
-    unsigned long headaddr = (unsigned long)head;
-    unsigned long stack = (unsigned long)regs->rsp;
-    unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
-
-    return headaddr > stack && headaddr < stack_base;
-}
-#else
-/* without fp, it's just junk */
-static int valid_hypervisor_stack(const struct frame_head *head,
-				  const struct cpu_user_regs *regs)
-{
-    return 0;
-}
-#endif
-
-void xenoprof_backtrace(struct vcpu *vcpu, const struct cpu_user_regs *regs,
-			unsigned long depth, int mode)
-{
-    const struct frame_head *head = (void *)regs->rbp;
-
-    if (mode > 1) {
-        while (depth-- && valid_hypervisor_stack(head, regs))
-            head = dump_hypervisor_backtrace(vcpu, head, mode);
-        return;
-    }
-
-    while (depth-- && head)
-        head = dump_guest_backtrace(vcpu, head, mode);
-}
diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
deleted file mode 100644
index 1d6454cf39..0000000000
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ /dev/null
@@ -1,485 +0,0 @@
-/**
- * @file nmi_int.c
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon <levon@movementarian.org>
- *
- * Modified for Xen: by Aravind Menon & Jose Renato Santos
- *   These modifications are:
- *   Copyright (C) 2005 Hewlett-Packard Co.
- */
-
-#include <xen/event.h>
-#include <xen/types.h>
-#include <xen/errno.h>
-#include <xen/init.h>
-#include <xen/param.h>
-#include <xen/string.h>
-#include <xen/delay.h>
-#include <xen/xenoprof.h>
-#include <xen/xvmalloc.h>
-
-#include <public/xenoprof.h>
-
-#include <asm/msr.h>
-#include <asm/apic.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-#include <asm/nmi.h>
-
-#include "op_counter.h"
-#include "op_x86_model.h"
-
-struct op_counter_config counter_config[OP_MAX_COUNTER];
-struct op_ibs_config ibs_config;
-
-struct op_x86_model_spec const *__read_mostly model;
-static struct op_msrs cpu_msrs[NR_CPUS];
-static unsigned long saved_lvtpc[NR_CPUS];
-
-static const char *cpu_type;
-
-static DEFINE_PER_CPU(struct vcpu *, nmi_cont_vcpu);
-
-static int passive_domain_msr_op_checks(unsigned int msr, int *typep, int *indexp)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(current);
-	if ( model == NULL )
-		return 0;
-	if ( model->is_arch_pmu_msr == NULL )
-		return 0;
-	if ( !model->is_arch_pmu_msr(msr, typep, indexp) )
-		return 0;
-
-	if ( !vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-		if ( ! model->allocated_msr(current) )
-			return 0;
-	return 1;
-}
-
-int passive_domain_do_rdmsr(unsigned int msr, uint64_t *msr_content)
-{
-	int type, index;
-
-	if ( !passive_domain_msr_op_checks(msr, &type, &index))
-		return 0;
-
-	model->load_msr(current, type, index, msr_content);
-	return 1;
-}
-
-int passive_domain_do_wrmsr(unsigned int msr, uint64_t msr_content)
-{
-	int type, index;
-
-	if ( !passive_domain_msr_op_checks(msr, &type, &index))
-		return 0;
-
-	model->save_msr(current, type, index, msr_content);
-	return 1;
-}
-
-void passive_domain_destroy(struct vcpu *v)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(v);
-	if ( vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-		model->free_msr(v);
-}
-
-bool nmi_oprofile_send_virq(void)
-{
-	struct vcpu *v = xchg(&this_cpu(nmi_cont_vcpu), NULL);
-
-	if (v)
-		send_guest_vcpu_virq(v, VIRQ_XENOPROF);
-
-	return v;
-}
-
-static int cf_check nmi_callback(const struct cpu_user_regs *regs, int cpu)
-{
-	int xen_mode, ovf;
-
-	ovf = model->check_ctrs(cpu, &cpu_msrs[cpu], regs);
-	xen_mode = ring_0(regs);
-	if (ovf && is_active(current->domain) && !xen_mode &&
-	    !this_cpu(nmi_cont_vcpu)) {
-		this_cpu(nmi_cont_vcpu) = current;
-		trigger_nmi_continuation();
-	}
-
-	if ( ovf == 2 )
-		current->arch.nmi_pending = true;
-	return 1;
-}
-
-
-static void nmi_cpu_save_registers(struct op_msrs *msrs)
-{
-	unsigned int const nr_ctrs = model->num_counters;
-	unsigned int const nr_ctrls = model->num_controls;
-	struct op_msr *counters = msrs->counters;
-	struct op_msr *controls = msrs->controls;
-	unsigned int i;
-
-	for (i = 0; i < nr_ctrs; ++i) {
-		rdmsrl(counters[i].addr, counters[i].value);
-	}
-
-	for (i = 0; i < nr_ctrls; ++i) {
-		rdmsrl(controls[i].addr, controls[i].value);
-	}
-}
-
-
-static void cf_check nmi_save_registers(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs * msrs = &cpu_msrs[cpu];
-	model->fill_in_addresses(msrs);
-	nmi_cpu_save_registers(msrs);
-}
-
-
-static void free_msrs(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < nr_cpu_ids; ++i) {
-		XVFREE(cpu_msrs[i].counters);
-		XVFREE(cpu_msrs[i].controls);
-	}
-}
-
-
-static int allocate_msrs(void)
-{
-	unsigned int i;
-	int success = 1;
-
-	for_each_online_cpu (i) {
-		cpu_msrs[i].counters = xvmalloc_array(struct op_msr,
-						      model->num_counters);
-		if (!cpu_msrs[i].counters) {
-			success = 0;
-			break;
-		}
-		cpu_msrs[i].controls = xvmalloc_array(struct op_msr,
-						      model->num_controls);
-		if (!cpu_msrs[i].controls) {
-			success = 0;
-			break;
-		}
-	}
-
-	if (!success)
-		free_msrs();
-
-	return success;
-}
-
-
-static void cf_check nmi_cpu_setup(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs * msrs = &cpu_msrs[cpu];
-	model->setup_ctrs(msrs);
-}
-
-
-int nmi_setup_events(void)
-{
-	on_each_cpu(nmi_cpu_setup, NULL, 1);
-	return 0;
-}
-
-int nmi_reserve_counters(void)
-{
-	if (!allocate_msrs())
-		return -ENOMEM;
-
-	/*
-	 * We need to be careful to install our NMI handler
-	 * without actually triggering any NMIs as this will
-	 * break the core code horrifically.
-	 */
-	if (reserve_lapic_nmi() < 0) {
-		free_msrs();
-		return -EBUSY;
-	}
-	/* We need to serialize save and setup for HT because the subset
-	 * of msrs are distinct for save and setup operations
-	 */
-	on_each_cpu(nmi_save_registers, NULL, 1);
-	return 0;
-}
-
-int nmi_enable_virq(void)
-{
-	set_nmi_callback(nmi_callback);
-	return 0;
-}
-
-
-void nmi_disable_virq(void)
-{
-	unset_nmi_callback();
-}
-
-
-static void nmi_restore_registers(struct op_msrs * msrs)
-{
-	unsigned int const nr_ctrs = model->num_counters;
-	unsigned int const nr_ctrls = model->num_controls;
-	struct op_msr * counters = msrs->counters;
-	struct op_msr * controls = msrs->controls;
-	unsigned int i;
-
-	for (i = 0; i < nr_ctrls; ++i) {
-		wrmsrl(controls[i].addr, controls[i].value);
-	}
-
-	for (i = 0; i < nr_ctrs; ++i) {
-		wrmsrl(counters[i].addr, counters[i].value);
-	}
-}
-
-
-static void cf_check nmi_cpu_shutdown(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs * msrs = &cpu_msrs[cpu];
-	nmi_restore_registers(msrs);
-}
-
-
-void nmi_release_counters(void)
-{
-	on_each_cpu(nmi_cpu_shutdown, NULL, 1);
-	release_lapic_nmi();
-	free_msrs();
-}
-
-
-static void cf_check nmi_cpu_start(void *dummy)
-{
-	int cpu = smp_processor_id();
-	struct op_msrs const * msrs = &cpu_msrs[cpu];
-	saved_lvtpc[cpu] = apic_read(APIC_LVTPC);
-	apic_write(APIC_LVTPC, APIC_DM_NMI);
-	model->start(msrs);
-}
-
-
-int nmi_start(void)
-{
-	on_each_cpu(nmi_cpu_start, NULL, 1);
-	return 0;
-}
-
-
-static void cf_check nmi_cpu_stop(void *dummy)
-{
-	unsigned int v;
-	int cpu = smp_processor_id();
-	struct op_msrs const * msrs = &cpu_msrs[cpu];
-	model->stop(msrs);
-
-	/* restoring APIC_LVTPC can trigger an apic error because the delivery
-	 * mode and vector nr combination can be illegal. That's by design: on
-	 * power on apic lvt contain a zero vector nr which are legal only for
-	 * NMI delivery mode. So inhibit apic err before restoring lvtpc
-	 */
-	if ( (apic_read(APIC_LVTPC) & APIC_DM_MASK) != APIC_DM_NMI
-	     || (apic_read(APIC_LVTPC) & APIC_LVT_MASKED) )
-	{
-		printk("nmi_stop: APIC not good %ul\n", apic_read(APIC_LVTPC));
-		mdelay(5000);
-	}
-	v = apic_read(APIC_LVTERR);
-	apic_write(APIC_LVTERR, v | APIC_LVT_MASKED);
-	apic_write(APIC_LVTPC, saved_lvtpc[cpu]);
-	apic_write(APIC_LVTERR, v);
-}
-
-
-void nmi_stop(void)
-{
-	on_each_cpu(nmi_cpu_stop, NULL, 1);
-}
-
-
-static int __init p4_init(const char **cpu_type)
-{
-	unsigned int cpu_model = current_cpu_data.x86_model;
-
-	if ((cpu_model > 6) || (cpu_model == 5)) {
-		printk("xenoprof: Initialization failed. "
-		       "Intel processor model %u for pentium 4 family is not "
-		       "supported\n", cpu_model);
-		return 0;
-	}
-
-	switch (current_cpu_data.x86_num_siblings) {
-		case 1:
-			*cpu_type = "i386/p4";
-			model = &op_p4_spec;
-			return 1;
-
-		case 2:
-			*cpu_type = "i386/p4-ht";
-			model = &op_p4_ht2_spec;
-			return 1;
-	}
-
-	printk("Xenoprof ERROR: P4 HyperThreading detected with > 2 threads\n");
-
-	return 0;
-}
-
-
-static int force_arch_perfmon;
-
-static int __init cf_check force_cpu_type(const char *str)
-{
-	if (!strcmp(str, "arch_perfmon")) {
-		force_arch_perfmon = 1;
-		printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
-	}
-	else
-		return -EINVAL;
-
-	return 0;
-}
-custom_param("cpu_type", force_cpu_type);
-
-static int __init ppro_init(const char **cpu_type)
-{
-	if (force_arch_perfmon && cpu_has_arch_perfmon)
-		return 0;
-
-	switch (current_cpu_data.x86_model) {
-	case 14:
-		*cpu_type = "i386/core";
-		break;
-	case 15:
-		*cpu_type = "i386/core_2";
-		ppro_has_global_ctrl = 1;
-		break;
-	default:
-		/* Unknown */
-		return 0;
-	}
-
-	model = &op_ppro_spec;
-	return 1;
-}
-
-static int __init arch_perfmon_init(const char **cpu_type)
-{
-	if (!cpu_has_arch_perfmon)
-		return 0;
-	*cpu_type = "i386/arch_perfmon";
-	model = &op_arch_perfmon_spec;
-	arch_perfmon_setup_counters();
-	ppro_has_global_ctrl = 1;
-	return 1;
-}
-
-static int __init cf_check nmi_init(void)
-{
-	unsigned int vendor = current_cpu_data.x86_vendor;
-	unsigned int family = current_cpu_data.x86;
-
-	if (!cpu_has_apic) {
-		printk("xenoprof: Initialization failed. No APIC\n");
-		return -ENODEV;
-	}
-
-	switch (vendor) {
-		case X86_VENDOR_AMD:
-			/* Needs to be at least an Athlon (or hammer in 32bit mode) */
-
-			switch (family) {
-			default:
-				printk("xenoprof: Initialization failed. "
-				       "AMD processor family %u is not "
-				       "supported\n", family);
-				return -ENODEV;
-			case 0xf:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/hammer";
-				break;
-			case 0x10:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family10";
-				ibs_init();
-				break;
-			case 0x11:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family11h";
-				break;
-                        case 0x12:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family12h";
-				break;
-			case 0x14:
-                                model = &op_athlon_spec;
-                                cpu_type = "x86-64/family14h";
-                                break;
-                        case 0x15:
-                                model = &op_amd_fam15h_spec;
-                                cpu_type = "x86-64/family15h";
-                                break;
-			case 0x16:
-				model = &op_athlon_spec;
-				cpu_type = "x86-64/family16h";
-				break;
-			}
-			break;
-
-		case X86_VENDOR_INTEL:
-			switch (family) {
-				/* Pentium IV */
-				case 0xf:
-					p4_init(&cpu_type);
-					break;
-
-				/* A P6-class processor */
-				case 6:
-					ppro_init(&cpu_type);
-					break;
-
-				default:
-				break;
-			}
-			if (!cpu_type && !arch_perfmon_init(&cpu_type)) {
-				printk("xenoprof: Initialization failed. "
-				       "Intel processor family %u model %d is not supported\n",
-				       family, current_cpu_data.x86_model);
-				return -ENODEV;
-			}
-			break;
-
-		default:
-			printk("xenoprof: Initialization failed. "
-			       "Unsupported processor. Unknown vendor %u\n",
-				vendor);
-			return -ENODEV;
-	}
-
-	return 0;
-}
-
-__initcall(nmi_init);
-
-int xenoprof_arch_init(int *num_events, char *_cpu_type)
-{
-	if (cpu_type == NULL)
-		return -ENODEV;
-	*num_events = model->num_counters;
-	strlcpy(_cpu_type, cpu_type, XENOPROF_CPU_TYPE_SIZE);
-	return 0;
-}
diff --git a/xen/arch/x86/oprofile/op_counter.h b/xen/arch/x86/oprofile/op_counter.h
deleted file mode 100644
index b515ac9ebc..0000000000
--- a/xen/arch/x86/oprofile/op_counter.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * @file op_counter.h
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- */
- 
-#ifndef OP_COUNTER_H
-#define OP_COUNTER_H
- 
-#define OP_MAX_COUNTER 8
- 
-/* Per-perfctr configuration as set via
- * oprofilefs.
- */
-struct op_counter_config {
-        unsigned long count;
-        unsigned long enabled;
-        unsigned long event;
-        unsigned long kernel;
-        unsigned long user;
-        unsigned long unit_mask;
-};
-
-extern struct op_counter_config counter_config[];
-
-/* AMD IBS configuration */
-struct op_ibs_config {
-    unsigned long op_enabled;
-    unsigned long fetch_enabled;
-    unsigned long max_cnt_fetch;
-    unsigned long max_cnt_op;
-    unsigned long rand_en;
-    unsigned long dispatched_ops;
-};
-
-extern struct op_ibs_config ibs_config;
-
-#endif /* OP_COUNTER_H */
diff --git a/xen/arch/x86/oprofile/op_model_athlon.c b/xen/arch/x86/oprofile/op_model_athlon.c
deleted file mode 100644
index 4c016624a6..0000000000
--- a/xen/arch/x86/oprofile/op_model_athlon.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/**
- * @file op_model_athlon.h
- * athlon / K7 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- * @author Philippe Elie
- * @author Graydon Hoare
- */
-
-#include <xen/sched.h>
-#include <xen/types.h>
-#include <asm/msr.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/processor.h>
-#include <xen/xenoprof.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-#include <xen/pci_regs.h>
-#include <xen/pci_ids.h>
-
-#include "op_x86_model.h"
-#include "op_counter.h"
-
-#define K7_NUM_COUNTERS 4
-#define K7_NUM_CONTROLS 4
-
-#define FAM15H_NUM_COUNTERS 6
-#define FAM15H_NUM_CONTROLS 6
-
-#define MAX_COUNTERS FAM15H_NUM_COUNTERS
-
-#define CTR_READ(msr_content,msrs,c) do {rdmsrl(msrs->counters[(c)].addr, (msr_content));} while (0)
-#define CTR_WRITE(l,msrs,c) wrmsr(msrs->counters[(c)].addr, -(l))
-#define CTR_OVERFLOWED(n) (!((n) & (1ULL<<31)))
-
-#define CTRL_READ(msr_content,msrs,c) do {rdmsrl(msrs->controls[(c)].addr, (msr_content));} while (0)
-#define CTRL_WRITE(msr_content,msrs,c) do {wrmsrl(msrs->controls[(c)].addr, (msr_content));} while (0)
-#define CTRL_SET_ACTIVE(n) (n |= (1ULL<<22))
-#define CTRL_SET_INACTIVE(n) (n &= ~(1ULL<<22))
-#define CTRL_CLEAR(val) (val &= (1ULL<<21))
-#define CTRL_SET_ENABLE(val) (val |= 1ULL<<20)
-#define CTRL_SET_USR(val,u) (val |= ((u & 1) << 16))
-#define CTRL_SET_KERN(val,k) (val |= ((k & 1) << 17))
-#define CTRL_SET_UM(val, m) (val |= ((m & 0xff) << 8))
-#define CTRL_SET_EVENT(val, e) (val |= (((e >> 8) & 0xf) | (e & 0xff)))
-#define CTRL_SET_HOST_ONLY(val, h) (val |= ((h & 0x1ULL) << 41))
-#define CTRL_SET_GUEST_ONLY(val, h) (val |= ((h & 0x1ULL) << 40))
-
-static unsigned long reset_value[MAX_COUNTERS];
-
-extern char svm_stgi_label[];
-
-u32 ibs_caps = 0;
-static u64 ibs_op_ctl;
-
-/* IBS cpuid feature detection */
-#define IBS_CPUID_FEATURES              0x8000001b
-
-/* IBS MSRs */
-#define MSR_AMD64_IBSFETCHCTL           0xc0011030
-#define MSR_AMD64_IBSFETCHLINAD         0xc0011031
-#define MSR_AMD64_IBSFETCHPHYSAD        0xc0011032
-#define MSR_AMD64_IBSOPCTL              0xc0011033
-#define MSR_AMD64_IBSOPRIP              0xc0011034
-#define MSR_AMD64_IBSOPDATA             0xc0011035
-#define MSR_AMD64_IBSOPDATA2            0xc0011036
-#define MSR_AMD64_IBSOPDATA3            0xc0011037
-#define MSR_AMD64_IBSDCLINAD            0xc0011038
-#define MSR_AMD64_IBSDCPHYSAD           0xc0011039
-#define MSR_AMD64_IBSCTL                0xc001103a
-
-/*
- * Same bit mask as for IBS cpuid feature flags (Fn8000_001B_EAX), but
- * bit 0 is used to indicate the existence of IBS.
- */
-#define IBS_CAPS_AVAIL                  (1LL<<0)
-#define IBS_CAPS_RDWROPCNT              (1LL<<3)
-#define IBS_CAPS_OPCNT                  (1LL<<4)
-
-/* IBS randomization macros */
-#define IBS_RANDOM_BITS                 12
-#define IBS_RANDOM_MASK                 ((1ULL << IBS_RANDOM_BITS) - 1)
-#define IBS_RANDOM_MAXCNT_OFFSET        (1ULL << (IBS_RANDOM_BITS - 5))
-
-/* IbsFetchCtl bits/masks */
-#define IBS_FETCH_RAND_EN               (1ULL<<57)
-#define IBS_FETCH_VAL                   (1ULL<<49)
-#define IBS_FETCH_ENABLE                (1ULL<<48)
-#define IBS_FETCH_CNT                   0xFFFF0000ULL
-#define IBS_FETCH_MAX_CNT               0x0000FFFFULL
-
-/* IbsOpCtl bits */
-#define IBS_OP_CNT_CTL                  (1ULL<<19)
-#define IBS_OP_VAL                      (1ULL<<18)
-#define IBS_OP_ENABLE                   (1ULL<<17)
-#define IBS_OP_MAX_CNT                  0x0000FFFFULL
-
-/* IBS sample identifier */
-#define IBS_FETCH_CODE                  13
-#define IBS_OP_CODE                     14
-
-#define clamp(val, min, max) ({			\
-	typeof(val) __val = (val);		\
-	typeof(min) __min = (min);		\
-	typeof(max) __max = (max);		\
-	(void) (&__val == &__min);		\
-	(void) (&__val == &__max);		\
-	__val = __val < __min ? __min: __val;	\
-	__val > __max ? __max: __val; })
-
-/*
- * 16-bit Linear Feedback Shift Register (LFSR)
- */
-static unsigned int lfsr_random(void)
-{
-    static unsigned int lfsr_value = 0xF00D;
-    unsigned int bit;
-
-    /* Compute next bit to shift in */
-    bit = ((lfsr_value >> 0) ^
-           (lfsr_value >> 2) ^
-           (lfsr_value >> 3) ^
-           (lfsr_value >> 5)) & 0x0001;
-
-    /* Advance to next register value */
-    lfsr_value = (lfsr_value >> 1) | (bit << 15);
-
-    return lfsr_value;
-}
-
-/*
- * IBS software randomization
- *
- * The IBS periodic op counter is randomized in software. The lower 12
- * bits of the 20 bit counter are randomized. IbsOpCurCnt is
- * initialized with a 12 bit random value.
- */
-static inline u64 op_amd_randomize_ibs_op(u64 val)
-{
-    unsigned int random = lfsr_random();
-
-    if (!(ibs_caps & IBS_CAPS_RDWROPCNT))
-        /*
-         * Work around if the hw can not write to IbsOpCurCnt
-         *
-         * Randomize the lower 8 bits of the 16 bit
-         * IbsOpMaxCnt [15:0] value in the range of -128 to
-         * +127 by adding/subtracting an offset to the
-         * maximum count (IbsOpMaxCnt).
-         *
-         * To avoid over or underflows and protect upper bits
-         * starting at bit 16, the initial value for
-         * IbsOpMaxCnt must fit in the range from 0x0081 to
-         * 0xff80.
-         */
-        val += (int8_t)(random >> 4);
-    else
-        val |= (u64)(random & IBS_RANDOM_MASK) << 32;
-
-    return val;
-}
-
-static void cf_check athlon_fill_in_addresses(struct op_msrs * const msrs)
-{
-	msrs->counters[0].addr = MSR_K7_PERFCTR0;
-	msrs->counters[1].addr = MSR_K7_PERFCTR1;
-	msrs->counters[2].addr = MSR_K7_PERFCTR2;
-	msrs->counters[3].addr = MSR_K7_PERFCTR3;
-
-	msrs->controls[0].addr = MSR_K7_EVNTSEL0;
-	msrs->controls[1].addr = MSR_K7_EVNTSEL1;
-	msrs->controls[2].addr = MSR_K7_EVNTSEL2;
-	msrs->controls[3].addr = MSR_K7_EVNTSEL3;
-}
-
-static void cf_check fam15h_fill_in_addresses(struct op_msrs * const msrs)
-{
-	msrs->counters[0].addr = MSR_AMD_FAM15H_PERFCTR0;
-	msrs->counters[1].addr = MSR_AMD_FAM15H_PERFCTR1;
-	msrs->counters[2].addr = MSR_AMD_FAM15H_PERFCTR2;
-	msrs->counters[3].addr = MSR_AMD_FAM15H_PERFCTR3;
-	msrs->counters[4].addr = MSR_AMD_FAM15H_PERFCTR4;
-	msrs->counters[5].addr = MSR_AMD_FAM15H_PERFCTR5;
-
-	msrs->controls[0].addr = MSR_AMD_FAM15H_EVNTSEL0;
-	msrs->controls[1].addr = MSR_AMD_FAM15H_EVNTSEL1;
-	msrs->controls[2].addr = MSR_AMD_FAM15H_EVNTSEL2;
-	msrs->controls[3].addr = MSR_AMD_FAM15H_EVNTSEL3;
-	msrs->controls[4].addr = MSR_AMD_FAM15H_EVNTSEL4;
-	msrs->controls[5].addr = MSR_AMD_FAM15H_EVNTSEL5;
-}
-
-static void cf_check athlon_setup_ctrs(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-	unsigned int const nr_ctrs = model->num_counters;
-	unsigned int const nr_ctrls = model->num_controls;
- 
-	/* clear all counters */
-	for (i = 0 ; i < nr_ctrls; ++i) {
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_CLEAR(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-	
-	/* avoid a false detection of ctr overflows in NMI handler */
-	for (i = 0; i < nr_ctrs; ++i) {
-		CTR_WRITE(1, msrs, i);
-	}
-
-	/* enable active counters */
-	for (i = 0; i < nr_ctrs; ++i) {
-		if (counter_config[i].enabled) {
-			reset_value[i] = counter_config[i].count;
-
-			CTR_WRITE(counter_config[i].count, msrs, i);
-
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_CLEAR(msr_content);
-			CTRL_SET_ENABLE(msr_content);
-			CTRL_SET_USR(msr_content, counter_config[i].user);
-			CTRL_SET_KERN(msr_content, counter_config[i].kernel);
-			CTRL_SET_UM(msr_content, counter_config[i].unit_mask);
-			CTRL_SET_EVENT(msr_content, counter_config[i].event);
-			CTRL_SET_HOST_ONLY(msr_content, 0);
-			CTRL_SET_GUEST_ONLY(msr_content, 0);
-			CTRL_WRITE(msr_content, msrs, i);
-		} else {
-			reset_value[i] = 0;
-		}
-	}
-}
-
-static inline void
-ibs_log_event(u64 data, struct cpu_user_regs const * const regs, int mode)
-{
-	struct vcpu *v = current;
-	u32 temp = 0;
-
-	temp = data & 0xFFFFFFFF;
-	xenoprof_log_event(v, regs, temp, mode, 0);
-	
-	temp = (data >> 32) & 0xFFFFFFFF;
-	xenoprof_log_event(v, regs, temp, mode, 0);
-	
-}
-
-static inline int handle_ibs(int mode, struct cpu_user_regs const * const regs)
-{
-	u64 val, ctl;
-	struct vcpu *v = current;
-
-	if (!ibs_caps)
-		return 1;
-
-	if (ibs_config.fetch_enabled) {
-		rdmsrl(MSR_AMD64_IBSFETCHCTL, ctl);
-		if (ctl & IBS_FETCH_VAL) {
-			rdmsrl(MSR_AMD64_IBSFETCHLINAD, val);
-			xenoprof_log_event(v, regs, IBS_FETCH_CODE, mode, 0);
-			xenoprof_log_event(v, regs, val, mode, 0);
-
-			ibs_log_event(val, regs, mode);
-			ibs_log_event(ctl, regs, mode);
-
-			rdmsrl(MSR_AMD64_IBSFETCHPHYSAD, val);
-			ibs_log_event(val, regs, mode);
-		
-			/* reenable the IRQ */
-			ctl &= ~(IBS_FETCH_VAL | IBS_FETCH_CNT);
-			ctl |= IBS_FETCH_ENABLE;
-			wrmsrl(MSR_AMD64_IBSFETCHCTL, ctl);
-		}
-	}
-
-	if (ibs_config.op_enabled) {
-		rdmsrl(MSR_AMD64_IBSOPCTL, ctl);
-		if (ctl & IBS_OP_VAL) {
-
-			rdmsrl(MSR_AMD64_IBSOPRIP, val);
-			xenoprof_log_event(v, regs, IBS_OP_CODE, mode, 0);
-			xenoprof_log_event(v, regs, val, mode, 0);
-			
-			ibs_log_event(val, regs, mode);
-
-			rdmsrl(MSR_AMD64_IBSOPDATA, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSOPDATA2, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSOPDATA3, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSDCLINAD, val);
-			ibs_log_event(val, regs, mode);
-			rdmsrl(MSR_AMD64_IBSDCPHYSAD, val);
-			ibs_log_event(val, regs, mode);
-
-			/* reenable the IRQ */
-			ctl = op_amd_randomize_ibs_op(ibs_op_ctl);
-			wrmsrl(MSR_AMD64_IBSOPCTL, ctl);
-		}
-	}
-
-    return 1;
-}
-
-static int cf_check athlon_check_ctrs(
-	unsigned int const cpu, struct op_msrs const * const msrs,
-	struct cpu_user_regs const * const regs)
-
-{
-	uint64_t msr_content;
-	int i;
-	unsigned long eip = regs->rip;
-	int mode = 0;
-	struct vcpu *v = current;
-	unsigned int const nr_ctrs = model->num_counters;
-
-#ifdef CONFIG_AMD_SVM
-	struct cpu_user_regs *guest_regs = guest_cpu_user_regs();
-
-	if (!guest_mode(regs) &&
-	    (eip == (unsigned long)svm_stgi_label)) {
-		/* SVM guest was running when NMI occurred */
-		ASSERT(is_hvm_vcpu(v));
-		eip = guest_regs->rip;
-		mode = xenoprofile_get_mode(v, guest_regs);
-	} else
-#endif
-		mode = xenoprofile_get_mode(v, regs);
-
-	for (i = 0 ; i < nr_ctrs; ++i) {
-		CTR_READ(msr_content, msrs, i);
-		if (CTR_OVERFLOWED(msr_content)) {
-			xenoprof_log_event(current, regs, eip, mode, i);
-			CTR_WRITE(reset_value[i], msrs, i);
-		}
-	}
-
-	/* See op_model_ppro.c */
-	return handle_ibs(mode, regs);
-}
-
-static inline void start_ibs(void)
-{
-	u64 val = 0;
-
-	if (!ibs_caps)
-		return;
-
-	if (ibs_config.fetch_enabled) {
-		val = (ibs_config.max_cnt_fetch >> 4) & IBS_FETCH_MAX_CNT;
-		val |= ibs_config.rand_en ? IBS_FETCH_RAND_EN : 0;
-		val |= IBS_FETCH_ENABLE;
-		wrmsrl(MSR_AMD64_IBSFETCHCTL, val);
-	}
-
-	if (ibs_config.op_enabled) {
-		ibs_op_ctl = ibs_config.max_cnt_op >> 4;
-		if (!(ibs_caps & IBS_CAPS_RDWROPCNT)) {
-			/*
-			 * IbsOpCurCnt not supported.  See
-			 * op_amd_randomize_ibs_op() for details.
-			 */
-			ibs_op_ctl = clamp((unsigned long long)ibs_op_ctl, 
-							0x0081ULL, 0xFF80ULL);
-		} else {
-			/*
-			 * The start value is randomized with a
-			 * positive offset, we need to compensate it
-			 * with the half of the randomized range. Also
-			 * avoid underflows.
-			 */
-		ibs_op_ctl = min(ibs_op_ctl + IBS_RANDOM_MAXCNT_OFFSET,
-					IBS_OP_MAX_CNT);
-		}
-		if (ibs_caps & IBS_CAPS_OPCNT && ibs_config.dispatched_ops)
-			ibs_op_ctl |= IBS_OP_CNT_CTL;
-		ibs_op_ctl |= IBS_OP_ENABLE;
-		val = op_amd_randomize_ibs_op(ibs_op_ctl);
-		wrmsrl(MSR_AMD64_IBSOPCTL, val);
-	}
-}
- 
-static void cf_check athlon_start(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-	unsigned int const nr_ctrs = model->num_counters;
-	for (i = 0 ; i < nr_ctrs ; ++i) {
-		if (reset_value[i]) {
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_SET_ACTIVE(msr_content);
-			CTRL_WRITE(msr_content, msrs, i);
-		}
-	}
-	start_ibs();
-}
-
-static void stop_ibs(void)
-{
-	if (!ibs_caps)
-		return;
-
-	if (ibs_config.fetch_enabled)
-		/* clear max count and enable */
-		wrmsrl(MSR_AMD64_IBSFETCHCTL, 0);
-
-	if (ibs_config.op_enabled)
-		/* clear max count and enable */
-		wrmsrl(MSR_AMD64_IBSOPCTL, 0);
-}
-
-static void cf_check athlon_stop(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-	unsigned int const nr_ctrs = model->num_counters;
-
-	/* Subtle: stop on all counters to avoid race with
-	 * setting our pm callback */
-	for (i = 0 ; i < nr_ctrs ; ++i) {
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_SET_INACTIVE(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-
-	stop_ibs();
-}
-
-#define IBSCTL_LVTOFFSETVAL             (1 << 8)
-#define APIC_EILVT_MSG_NMI              0x4
-#define APIC_EILVT_LVTOFF_IBS           1
-#define APIC_EILVTn(n)                  (0x500 + 0x10 * n)
-static inline void __init cf_check init_ibs_nmi_per_cpu(void *arg)
-{
-	unsigned long reg;
-
-	reg = (APIC_EILVT_LVTOFF_IBS << 4) + APIC_EILVTn(0);
-	apic_write(reg, APIC_EILVT_MSG_NMI << 8);
-}
-
-#define PCI_DEVICE_ID_AMD_10H_NB_MISC   0x1203
-#define IBSCTL                          0x1cc
-static int __init init_ibs_nmi(void)
-{
-	int bus, dev, func;
-	u32 id, value;
-	u16 vendor_id, dev_id;
-	int nodes;
-
-	/* per CPU setup */
-	on_each_cpu(init_ibs_nmi_per_cpu, NULL, 1);
-
-	nodes = 0;
-	for (bus = 0; bus < 256; bus++) {
-		for (dev = 0; dev < 32; dev++) {
-			for (func = 0; func < 8; func++) {
-				id = pci_conf_read32(PCI_SBDF(0, bus, dev, func),
-						     PCI_VENDOR_ID);
-
-				vendor_id = id & 0xffff;
-				dev_id = (id >> 16) & 0xffff;
-
-				if ((vendor_id == PCI_VENDOR_ID_AMD) &&
-					(dev_id == PCI_DEVICE_ID_AMD_10H_NB_MISC)) {
-
-					pci_conf_write32(
-						PCI_SBDF(0, bus, dev, func),
-						IBSCTL,
-						IBSCTL_LVTOFFSETVAL | APIC_EILVT_LVTOFF_IBS);
-
-					value = pci_conf_read32(PCI_SBDF(0, bus, dev, func),
-								IBSCTL);
-
-					if (value != (IBSCTL_LVTOFFSETVAL |
-						APIC_EILVT_LVTOFF_IBS)) {
-						printk("Xenoprofile: Failed to setup IBS LVT offset, "
-							"IBSCTL = %#x\n", value);
-						return 1;
-					}
-					nodes++;
-				}
-			}
-		}
-	}
-
-	if (!nodes) {
-		printk("Xenoprofile: No CPU node configured for IBS\n");
-		return 1;
-	}
-
-	return 0;
-}
-
-static void __init get_ibs_caps(void)
-{
-	if (!boot_cpu_has(X86_FEATURE_IBS))
-		return;
-
-    /* check IBS cpuid feature flags */
-	if (current_cpu_data.extended_cpuid_level >= IBS_CPUID_FEATURES)
-		ibs_caps = cpuid_eax(IBS_CPUID_FEATURES);
-	if (!(ibs_caps & IBS_CAPS_AVAIL))
-		/* cpuid flags not valid */
-		ibs_caps = 0;
-}
-
-void __init ibs_init(void)
-{
-	get_ibs_caps();
-
-	if ( !ibs_caps )
-		return;
-
-	if (init_ibs_nmi()) {
-		ibs_caps = 0;
-		return;
-	}
-
-	printk("Xenoprofile: AMD IBS detected (%#x)\n",
-		(unsigned)ibs_caps);
-}
-
-struct op_x86_model_spec const op_athlon_spec = {
-	.num_counters = K7_NUM_COUNTERS,
-	.num_controls = K7_NUM_CONTROLS,
-	.fill_in_addresses = &athlon_fill_in_addresses,
-	.setup_ctrs = &athlon_setup_ctrs,
-	.check_ctrs = &athlon_check_ctrs,
-	.start = &athlon_start,
-	.stop = &athlon_stop
-};
-
-struct op_x86_model_spec const op_amd_fam15h_spec = {
-	.num_counters = FAM15H_NUM_COUNTERS,
-	.num_controls = FAM15H_NUM_CONTROLS,
-	.fill_in_addresses = &fam15h_fill_in_addresses,
-	.setup_ctrs = &athlon_setup_ctrs,
-	.check_ctrs = &athlon_check_ctrs,
-	.start = &athlon_start,
-	.stop = &athlon_stop
-};
diff --git a/xen/arch/x86/oprofile/op_model_p4.c b/xen/arch/x86/oprofile/op_model_p4.c
deleted file mode 100644
index d047258644..0000000000
--- a/xen/arch/x86/oprofile/op_model_p4.c
+++ /dev/null
@@ -1,721 +0,0 @@
-/**
- * @file op_model_p4.c
- * P4 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author Graydon Hoare
- */
-
-#include <xen/types.h>
-#include <asm/msr.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/processor.h>
-#include <xen/xenoprof.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-
-#include "op_x86_model.h"
-#include "op_counter.h"
-
-#define NUM_EVENTS 39
-
-#define NUM_COUNTERS_NON_HT 8
-#define NUM_ESCRS_NON_HT 45
-#define NUM_CCCRS_NON_HT 18
-#define NUM_CONTROLS_NON_HT (NUM_ESCRS_NON_HT + NUM_CCCRS_NON_HT)
-
-#define NUM_COUNTERS_HT2 4
-#define NUM_ESCRS_HT2 23
-#define NUM_CCCRS_HT2 9
-#define NUM_CONTROLS_HT2 (NUM_ESCRS_HT2 + NUM_CCCRS_HT2)
-
-static unsigned int num_counters = NUM_COUNTERS_NON_HT;
-
-
-/* this has to be checked dynamically since the
-   hyper-threadedness of a chip is discovered at
-   kernel boot-time. */
-static inline void setup_num_counters(void)
-{
-	if (boot_cpu_data.x86_num_siblings == 2) 	/* XXX */
-		num_counters = NUM_COUNTERS_HT2;
-}
-
-static int inline addr_increment(void)
-{
-	return boot_cpu_data.x86_num_siblings == 2 ? 2 : 1;
-}
-
-
-/* tables to simulate simplified hardware view of p4 registers */
-struct p4_counter_binding {
-	int virt_counter;
-	int counter_address;
-	int cccr_address;
-};
-
-struct p4_event_binding {
-	int escr_select;  /* value to put in CCCR */
-	int event_select; /* value to put in ESCR */
-	struct {
-		int virt_counter; /* for this counter... */
-		int escr_address; /* use this ESCR       */
-	} bindings[2];
-};
-
-/* nb: these CTR_* defines are a duplicate of defines in
-   event/i386.p4*events. */
-
-
-#define CTR_BPU_0      (1 << 0)
-#define CTR_MS_0       (1 << 1)
-#define CTR_FLAME_0    (1 << 2)
-#define CTR_IQ_4       (1 << 3)
-#define CTR_BPU_2      (1 << 4)
-#define CTR_MS_2       (1 << 5)
-#define CTR_FLAME_2    (1 << 6)
-#define CTR_IQ_5       (1 << 7)
-
-static struct p4_counter_binding p4_counters [NUM_COUNTERS_NON_HT] = {
-	{ CTR_BPU_0,   MSR_P4_BPU_PERFCTR0,   MSR_P4_BPU_CCCR0 },
-	{ CTR_MS_0,    MSR_P4_MS_PERFCTR0,    MSR_P4_MS_CCCR0 },
-	{ CTR_FLAME_0, MSR_P4_FLAME_PERFCTR0, MSR_P4_FLAME_CCCR0 },
-	{ CTR_IQ_4,    MSR_P4_IQ_PERFCTR4,    MSR_P4_IQ_CCCR4 },
-	{ CTR_BPU_2,   MSR_P4_BPU_PERFCTR2,   MSR_P4_BPU_CCCR2 },
-	{ CTR_MS_2,    MSR_P4_MS_PERFCTR2,    MSR_P4_MS_CCCR2 },
-	{ CTR_FLAME_2, MSR_P4_FLAME_PERFCTR2, MSR_P4_FLAME_CCCR2 },
-	{ CTR_IQ_5,    MSR_P4_IQ_PERFCTR5,    MSR_P4_IQ_CCCR5 }
-};
-
-#define NUM_UNUSED_CCCRS	NUM_CCCRS_NON_HT - NUM_COUNTERS_NON_HT
-
-/* All cccr we don't use. */
-static int p4_unused_cccr[NUM_UNUSED_CCCRS] = {
-	MSR_P4_BPU_CCCR1,	MSR_P4_BPU_CCCR3,
-	MSR_P4_MS_CCCR1,	MSR_P4_MS_CCCR3,
-	MSR_P4_FLAME_CCCR1,	MSR_P4_FLAME_CCCR3,
-	MSR_P4_IQ_CCCR0,	MSR_P4_IQ_CCCR1,
-	MSR_P4_IQ_CCCR2,	MSR_P4_IQ_CCCR3
-};
-
-/* p4 event codes in libop/op_event.h are indices into this table. */
-
-static const struct p4_event_binding p4_events[NUM_EVENTS] = {
-	
-	{ /* BRANCH_RETIRED */
-		0x05, 0x06, 
-		{ {CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  {CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-	
-	{ /* MISPRED_BRANCH_RETIRED */
-		0x04, 0x03, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR0},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
-	},
-	
-	{ /* TC_DELIVER_MODE */
-		0x01, 0x01,
-		{ { CTR_MS_0, MSR_P4_TC_ESCR0},  
-		  { CTR_MS_2, MSR_P4_TC_ESCR1} }
-	},
-	
-	{ /* BPU_FETCH_REQUEST */
-		0x00, 0x03, 
-		{ { CTR_BPU_0, MSR_P4_BPU_ESCR0},
-		  { CTR_BPU_2, MSR_P4_BPU_ESCR1} }
-	},
-
-	{ /* ITLB_REFERENCE */
-		0x03, 0x18,
-		{ { CTR_BPU_0, MSR_P4_ITLB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_ITLB_ESCR1} }
-	},
-
-	{ /* MEMORY_CANCEL */
-		0x05, 0x02,
-		{ { CTR_FLAME_0, MSR_P4_DAC_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_DAC_ESCR1} }
-	},
-
-	{ /* MEMORY_COMPLETE */
-		0x02, 0x08,
-		{ { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
-	},
-
-	{ /* LOAD_PORT_REPLAY */
-		0x02, 0x04, 
-		{ { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
-	},
-
-	{ /* STORE_PORT_REPLAY */
-		0x02, 0x05,
-		{ { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
-	},
-
-	{ /* MOB_LOAD_REPLAY */
-		0x02, 0x03,
-		{ { CTR_BPU_0, MSR_P4_MOB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_MOB_ESCR1} }
-	},
-
-	{ /* PAGE_WALK_TYPE */
-		0x04, 0x01,
-		{ { CTR_BPU_0, MSR_P4_PMH_ESCR0},
-		  { CTR_BPU_2, MSR_P4_PMH_ESCR1} }
-	},
-
-	{ /* BSQ_CACHE_REFERENCE */
-		0x07, 0x0c, 
-		{ { CTR_BPU_0, MSR_P4_BSU_ESCR0},
-		  { CTR_BPU_2, MSR_P4_BSU_ESCR1} }
-	},
-
-	{ /* IOQ_ALLOCATION */
-		0x06, 0x03, 
-		{ { CTR_BPU_0, MSR_P4_FSB_ESCR0},
-		  { 0, 0 } }
-	},
-
-	{ /* IOQ_ACTIVE_ENTRIES */
-		0x06, 0x1a, 
-		{ { CTR_BPU_2, MSR_P4_FSB_ESCR1},
-		  { 0, 0 } }
-	},
-
-	{ /* FSB_DATA_ACTIVITY */
-		0x06, 0x17, 
-		{ { CTR_BPU_0, MSR_P4_FSB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_FSB_ESCR1} }
-	},
-
-	{ /* BSQ_ALLOCATION */
-		0x07, 0x05, 
-		{ { CTR_BPU_0, MSR_P4_BSU_ESCR0},
-		  { 0, 0 } }
-	},
-
-	{ /* BSQ_ACTIVE_ENTRIES */
-		0x07, 0x06,
-		{ { CTR_BPU_2, MSR_P4_BSU_ESCR1 /* guess */},  
-		  { 0, 0 } }
-	},
-
-	{ /* X87_ASSIST */
-		0x05, 0x03, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* SSE_INPUT_ASSIST */
-		0x01, 0x34,
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* PACKED_SP_UOP */
-		0x01, 0x08, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* PACKED_DP_UOP */
-		0x01, 0x0c, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* SCALAR_SP_UOP */
-		0x01, 0x0a, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* SCALAR_DP_UOP */
-		0x01, 0x0e,
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* 64BIT_MMX_UOP */
-		0x01, 0x02, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* 128BIT_MMX_UOP */
-		0x01, 0x1a, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-
-	{ /* X87_FP_UOP */
-		0x01, 0x04, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* X87_SIMD_MOVES_UOP */
-		0x01, 0x2e, 
-		{ { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
-		  { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
-	},
-  
-	{ /* MACHINE_CLEAR */
-		0x05, 0x02, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* GLOBAL_POWER_EVENTS */
-		0x06, 0x13 /* older manual says 0x05, newer 0x13 */,
-		{ { CTR_BPU_0, MSR_P4_FSB_ESCR0},
-		  { CTR_BPU_2, MSR_P4_FSB_ESCR1} }
-	},
-  
-	{ /* TC_MS_XFER */
-		0x00, 0x05, 
-		{ { CTR_MS_0, MSR_P4_MS_ESCR0},
-		  { CTR_MS_2, MSR_P4_MS_ESCR1} }
-	},
-
-	{ /* UOP_QUEUE_WRITES */
-		0x00, 0x09,
-		{ { CTR_MS_0, MSR_P4_MS_ESCR0},
-		  { CTR_MS_2, MSR_P4_MS_ESCR1} }
-	},
-
-	{ /* FRONT_END_EVENT */
-		0x05, 0x08,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* EXECUTION_EVENT */
-		0x05, 0x0c,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* REPLAY_EVENT */
-		0x05, 0x09,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR2},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
-	},
-
-	{ /* INSTR_RETIRED */
-		0x04, 0x02, 
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR0},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
-	},
-
-	{ /* UOPS_RETIRED */
-		0x04, 0x01,
-		{ { CTR_IQ_4, MSR_P4_CRU_ESCR0},
-		  { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
-	},
-
-	{ /* UOP_TYPE */    
-		0x02, 0x02, 
-		{ { CTR_IQ_4, MSR_P4_RAT_ESCR0},
-		  { CTR_IQ_5, MSR_P4_RAT_ESCR1} }
-	},
-
-	{ /* RETIRED_MISPRED_BRANCH_TYPE */
-		0x02, 0x05, 
-		{ { CTR_MS_0, MSR_P4_TBPU_ESCR0},
-		  { CTR_MS_2, MSR_P4_TBPU_ESCR1} }
-	},
-
-	{ /* RETIRED_BRANCH_TYPE */
-		0x02, 0x04,
-		{ { CTR_MS_0, MSR_P4_TBPU_ESCR0},
-		  { CTR_MS_2, MSR_P4_TBPU_ESCR1} }
-	}
-};
-
-
-#define MISC_PMC_ENABLED_P(x) ((x) & 1ULL << 7)
-
-#define ESCR_RESERVED_BITS 0x80000003ULL
-#define ESCR_CLEAR(escr) ((escr) &= ESCR_RESERVED_BITS)
-#define ESCR_SET_USR_0(escr, usr) ((escr) |= (((usr) & 1ULL) << 2))
-#define ESCR_SET_OS_0(escr, os) ((escr) |= (((os) & 1ULL) << 3))
-#define ESCR_SET_USR_1(escr, usr) ((escr) |= (((usr) & 1ULL)))
-#define ESCR_SET_OS_1(escr, os) ((escr) |= (((os) & 1ULL) << 1))
-#define ESCR_SET_EVENT_SELECT(escr, sel) ((escr) |= (((sel) & 0x3fULL) << 25))
-#define ESCR_SET_EVENT_MASK(escr, mask) ((escr) |= (((mask) & 0xffffULL) << 9))
-#define ESCR_READ(escr,ev,i) do {rdmsrl(ev->bindings[(i)].escr_address, (escr));} while (0)
-#define ESCR_WRITE(escr,ev,i) do {wrmsrl(ev->bindings[(i)].escr_address, (escr));} while (0)
-
-#define CCCR_RESERVED_BITS 0x38030FFFULL
-#define CCCR_CLEAR(cccr) ((cccr) &= CCCR_RESERVED_BITS)
-#define CCCR_SET_REQUIRED_BITS(cccr) ((cccr) |= 0x00030000ULL)
-#define CCCR_SET_ESCR_SELECT(cccr, sel) ((cccr) |= (((sel) & 0x07ULL) << 13))
-#define CCCR_SET_PMI_OVF_0(cccr) ((cccr) |= (1ULL<<26))
-#define CCCR_SET_PMI_OVF_1(cccr) ((cccr) |= (1ULL<<27))
-#define CCCR_SET_ENABLE(cccr) ((cccr) |= (1ULL<<12))
-#define CCCR_SET_DISABLE(cccr) ((cccr) &= ~(1ULL<<12))
-#define CCCR_READ(msr_content, i) do {rdmsrl(p4_counters[(i)].cccr_address, (msr_content));} while (0)
-#define CCCR_WRITE(msr_content, i) do {wrmsrl(p4_counters[(i)].cccr_address, (msr_content));} while (0)
-#define CCCR_OVF_P(cccr) ((cccr) & (1ULL<<31))
-#define CCCR_CLEAR_OVF(cccr) ((cccr) &= (~(1ULL<<31)))
-
-#define CTR_READ(msr_content,i) do {rdmsrl(p4_counters[(i)].counter_address, (msr_content));} while (0)
-#define CTR_WRITE(msr_content,i) do {wrmsrl(p4_counters[(i)].counter_address, -(msr_content));} while (0)
-#define CTR_OVERFLOW_P(ctr) (!((ctr) & 0x80000000ULL))
-
-
-/* this assigns a "stagger" to the current CPU, which is used throughout
-   the code in this module as an extra array offset, to select the "even"
-   or "odd" part of all the divided resources. */
-static unsigned int get_stagger(void)
-{
-	int cpu = smp_processor_id();
-	return (cpu != cpumask_first(per_cpu(cpu_sibling_mask, cpu)));
-}
-
-
-/* finally, mediate access to a real hardware counter
-   by passing a "virtual" counter numer to this macro,
-   along with your stagger setting. */
-#define VIRT_CTR(stagger, i) ((i) + ((num_counters) * (stagger)))
-
-static unsigned long reset_value[NUM_COUNTERS_NON_HT];
-
-
-static void cf_check p4_fill_in_addresses(struct op_msrs * const msrs)
-{
-	unsigned int i;
-	unsigned int addr, stag;
-
-	setup_num_counters();
-	stag = get_stagger();
-
-	/* the counter registers we pay attention to */
-	for (i = 0; i < num_counters; ++i) {
-		msrs->counters[i].addr = 
-			p4_counters[VIRT_CTR(stag, i)].counter_address;
-	}
-
-	/* FIXME: bad feeling, we don't save the 10 counters we don't use. */
-
-	/* 18 CCCR registers */
-	for (i = 0, addr = MSR_P4_BPU_CCCR0 + stag;
-	     addr <= MSR_P4_IQ_CCCR5; ++i, addr += addr_increment()) {
-		msrs->controls[i].addr = addr;
-	}
-	
-	/* 43 ESCR registers in three or four discontiguous group */
-	for (addr = MSR_P4_BSU_ESCR0 + stag;
-	     addr < MSR_P4_IQ_ESCR0; ++i, addr += addr_increment()) {
-		msrs->controls[i].addr = addr;
-	}
-
-	/* no IQ_ESCR0/1 on some models, we save a seconde time BSU_ESCR0/1
-	 * to avoid special case in nmi_{save|restore}_registers() */
-	if (boot_cpu_data.x86_model >= 0x3) {
-		for (addr = MSR_P4_BSU_ESCR0 + stag;
-		     addr <= MSR_P4_BSU_ESCR1; ++i, addr += addr_increment()) {
-			msrs->controls[i].addr = addr;
-		}
-	} else {
-		for (addr = MSR_P4_IQ_ESCR0 + stag;
-		     addr <= MSR_P4_IQ_ESCR1; ++i, addr += addr_increment()) {
-			msrs->controls[i].addr = addr;
-		}
-	}
-
-	for (addr = MSR_P4_RAT_ESCR0 + stag;
-	     addr <= MSR_P4_SSU_ESCR0; ++i, addr += addr_increment()) {
-		msrs->controls[i].addr = addr;
-	}
-	
-	for (addr = MSR_P4_MS_ESCR0 + stag;
-	     addr <= MSR_P4_TC_ESCR1; ++i, addr += addr_increment()) { 
-		msrs->controls[i].addr = addr;
-	}
-	
-	for (addr = MSR_P4_IX_ESCR0 + stag;
-	     addr <= MSR_P4_CRU_ESCR3; ++i, addr += addr_increment()) { 
-		msrs->controls[i].addr = addr;
-	}
-
-	/* there are 2 remaining non-contiguously located ESCRs */
-
-	if (num_counters == NUM_COUNTERS_NON_HT) {		
-		/* standard non-HT CPUs handle both remaining ESCRs*/
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR5;
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR4;
-
-	} else if (stag == 0) {
-		/* HT CPUs give the first remainder to the even thread, as
-		   the 32nd control register */
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR4;
-
-	} else {
-		/* and two copies of the second to the odd thread,
-		   for the 22st and 23nd control registers */
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR5;
-		msrs->controls[i++].addr = MSR_P4_CRU_ESCR5;
-	}
-}
-
-
-static void pmc_setup_one_p4_counter(unsigned int ctr)
-{
-	int i;
-	int const maxbind = 2;
-	uint64_t cccr = 0;
-	uint64_t escr = 0;
-	unsigned int counter_bit;
-	const struct p4_event_binding *ev = NULL;
-	unsigned int stag;
-
-	stag = get_stagger();
-	
-	/* convert from counter *number* to counter *bit* */
-	counter_bit = 1 << VIRT_CTR(stag, ctr);
-	
-	/* find our event binding structure. */
-	if (counter_config[ctr].event <= 0 || counter_config[ctr].event > NUM_EVENTS) {
-		printk(KERN_ERR "oprofile: P4 event code %#lx out of range\n",
-		       counter_config[ctr].event);
-		return;
-	}
-	
-	ev = &(p4_events[counter_config[ctr].event - 1]);
-	
-	for (i = 0; i < maxbind; i++) {
-		if (ev->bindings[i].virt_counter & counter_bit) {
-
-			/* modify ESCR */
-			ESCR_READ(escr, ev, i);
-			ESCR_CLEAR(escr);
-			if (stag == 0) {
-				ESCR_SET_USR_0(escr, counter_config[ctr].user);
-				ESCR_SET_OS_0(escr, counter_config[ctr].kernel);
-			} else {
-				ESCR_SET_USR_1(escr, counter_config[ctr].user);
-				ESCR_SET_OS_1(escr, counter_config[ctr].kernel);
-			}
-			ESCR_SET_EVENT_SELECT(escr, ev->event_select);
-			ESCR_SET_EVENT_MASK(escr, counter_config[ctr].unit_mask);			
-			ESCR_WRITE(escr, ev, i);
-		       
-			/* modify CCCR */
-			CCCR_READ(cccr, VIRT_CTR(stag, ctr));
-			CCCR_CLEAR(cccr);
-			CCCR_SET_REQUIRED_BITS(cccr);
-			CCCR_SET_ESCR_SELECT(cccr, ev->escr_select);
-			if (stag == 0) {
-				CCCR_SET_PMI_OVF_0(cccr);
-			} else {
-				CCCR_SET_PMI_OVF_1(cccr);
-			}
-			CCCR_WRITE(cccr, VIRT_CTR(stag, ctr));
-			return;
-		}
-	}
-
-	printk(KERN_ERR 
-	       "oprofile: P4 event code %#lx no binding, stag %d ctr %d\n",
-	       counter_config[ctr].event, stag, ctr);
-}
-
-
-static void cf_check p4_setup_ctrs(struct op_msrs const * const msrs)
-{
-	unsigned int i;
-	uint64_t msr_content;
-	unsigned int addr;
-	unsigned int stag;
-
-	stag = get_stagger();
-
-	rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
-	if (! MISC_PMC_ENABLED_P(msr_content)) {
-		printk(KERN_ERR "oprofile: P4 PMC not available\n");
-		return;
-	}
-
-	/* clear the cccrs we will use */
-	for (i = 0 ; i < num_counters ; i++) {
-		rdmsrl(p4_counters[VIRT_CTR(stag, i)].cccr_address, msr_content);
-		CCCR_CLEAR(msr_content);
-		CCCR_SET_REQUIRED_BITS(msr_content);
-		wrmsrl(p4_counters[VIRT_CTR(stag, i)].cccr_address, msr_content);
-	}
-
-	/* clear cccrs outside our concern */
-	for (i = stag ; i < NUM_UNUSED_CCCRS ; i += addr_increment()) {
-		rdmsrl(p4_unused_cccr[i], msr_content);
-		CCCR_CLEAR(msr_content);
-		CCCR_SET_REQUIRED_BITS(msr_content);
-		wrmsrl(p4_unused_cccr[i], msr_content);
-	}
-
-	/* clear all escrs (including those outside our concern) */
-	for (addr = MSR_P4_BSU_ESCR0 + stag;
-	     addr <  MSR_P4_IQ_ESCR0; addr += addr_increment()) {
-		wrmsrl(addr, 0x0ULL);
-	}
-
-	/* On older models clear also MSR_P4_IQ_ESCR0/1 */
-	if (boot_cpu_data.x86_model < 0x3) {
-		wrmsrl(MSR_P4_IQ_ESCR0, 0x0ULL);
-		wrmsrl(MSR_P4_IQ_ESCR1, 0x0ULL);
-	}
-
-	for (addr = MSR_P4_RAT_ESCR0 + stag;
-	     addr <= MSR_P4_SSU_ESCR0; ++i, addr += addr_increment()) {
-		wrmsrl(addr, 0x0ULL);
-	}
-	
-	for (addr = MSR_P4_MS_ESCR0 + stag;
-	     addr <= MSR_P4_TC_ESCR1; addr += addr_increment()){ 
-		wrmsrl(addr, 0x0ULL);
-	}
-	
-	for (addr = MSR_P4_IX_ESCR0 + stag;
-	     addr <= MSR_P4_CRU_ESCR3; addr += addr_increment()){ 
-		wrmsrl(addr, 0x0ULL);
-	}
-
-	if (num_counters == NUM_COUNTERS_NON_HT) {		
-		wrmsrl(MSR_P4_CRU_ESCR4, 0x0ULL);
-		wrmsrl(MSR_P4_CRU_ESCR5, 0x0ULL);
-	} else if (stag == 0) {
-		wrmsrl(MSR_P4_CRU_ESCR4, 0x0ULL);
-	} else {
-		wrmsrl(MSR_P4_CRU_ESCR5, 0x0ULL);
-	}		
-	
-	/* setup all counters */
-	for (i = 0 ; i < num_counters ; ++i) {
-		if (counter_config[i].enabled) {
-			reset_value[i] = counter_config[i].count;
-			pmc_setup_one_p4_counter(i);
-			CTR_WRITE(counter_config[i].count, VIRT_CTR(stag, i));
-		} else {
-			reset_value[i] = 0;
-		}
-	}
-}
-
-static int cf_check p4_check_ctrs(
-	unsigned int const cpu, struct op_msrs const * const msrs,
-	struct cpu_user_regs const * const regs)
-{
-	unsigned long ctr, stag, real;
-	uint64_t msr_content;
-	int i;
-	int ovf = 0;
-	unsigned long eip = regs->rip;
-	int mode = xenoprofile_get_mode(current, regs);
-
-	stag = get_stagger();
-
-	for (i = 0; i < num_counters; ++i) {
-		
-		if (!reset_value[i]) 
-			continue;
-
-		/* 
-		 * there is some eccentricity in the hardware which
-		 * requires that we perform 2 extra corrections:
-		 *
-		 * - check both the CCCR:OVF flag for overflow and the
-		 *   counter high bit for un-flagged overflows.
-		 *
-		 * - write the counter back twice to ensure it gets
-		 *   updated properly.
-		 * 
-		 * the former seems to be related to extra NMIs happening
-		 * during the current NMI; the latter is reported as errata
-		 * N15 in intel doc 249199-029, pentium 4 specification
-		 * update, though their suggested work-around does not
-		 * appear to solve the problem.
-		 */
-		
-		real = VIRT_CTR(stag, i);
-
-		CCCR_READ(msr_content, real);
- 		CTR_READ(ctr, real);
-		if (CCCR_OVF_P(msr_content) || CTR_OVERFLOW_P(ctr)) {
-			xenoprof_log_event(current, regs, eip, mode, i);
-			CTR_WRITE(reset_value[i], real);
-			CCCR_CLEAR_OVF(msr_content);
-			CCCR_WRITE(msr_content, real);
- 			CTR_WRITE(reset_value[i], real);
-			ovf = 1;
-		}
-	}
-
-	/* P4 quirk: you have to re-unmask the apic vector */
-	apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
-
-	return ovf;
-}
-
-
-static void cf_check p4_start(struct op_msrs const * const msrs)
-{
-	unsigned int stag;
-	uint64_t msr_content;
-	int i;
-
-	stag = get_stagger();
-
-	for (i = 0; i < num_counters; ++i) {
-		if (!reset_value[i])
-			continue;
-		CCCR_READ(msr_content, VIRT_CTR(stag, i));
-		CCCR_SET_ENABLE(msr_content);
-		CCCR_WRITE(msr_content, VIRT_CTR(stag, i));
-	}
-}
-
-
-static void cf_check p4_stop(struct op_msrs const * const msrs)
-{
-	unsigned int stag;
-	uint64_t msr_content;
-	int i;
-
-	stag = get_stagger();
-
-	for (i = 0; i < num_counters; ++i) {
-		CCCR_READ(msr_content, VIRT_CTR(stag, i));
-		CCCR_SET_DISABLE(msr_content);
-		CCCR_WRITE(msr_content, VIRT_CTR(stag, i));
-	}
-}
-
-
-struct op_x86_model_spec const op_p4_ht2_spec = {
-	.num_counters = NUM_COUNTERS_HT2,
-	.num_controls = NUM_CONTROLS_HT2,
-	.fill_in_addresses = &p4_fill_in_addresses,
-	.setup_ctrs = &p4_setup_ctrs,
-	.check_ctrs = &p4_check_ctrs,
-	.start = &p4_start,
-	.stop = &p4_stop
-};
-
-
-struct op_x86_model_spec const op_p4_spec = {
-	.num_counters = NUM_COUNTERS_NON_HT,
-	.num_controls = NUM_CONTROLS_NON_HT,
-	.fill_in_addresses = &p4_fill_in_addresses,
-	.setup_ctrs = &p4_setup_ctrs,
-	.check_ctrs = &p4_check_ctrs,
-	.start = &p4_start,
-	.stop = &p4_stop
-};
diff --git a/xen/arch/x86/oprofile/op_model_ppro.c b/xen/arch/x86/oprofile/op_model_ppro.c
deleted file mode 100644
index 4bbb4502c7..0000000000
--- a/xen/arch/x86/oprofile/op_model_ppro.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/**
- * @file op_model_ppro.h
- * pentium pro / P6 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author John Levon
- * @author Philippe Elie
- * @author Graydon Hoare
- */
-
-#include <xen/sched.h>
-#include <xen/types.h>
-#include <xen/xenoprof.h>
-#include <xen/xvmalloc.h>
-
-#include <asm/msr.h>
-#include <asm/io.h>
-#include <asm/apic.h>
-#include <asm/processor.h>
-#include <asm/regs.h>
-#include <asm/current.h>
-#include <asm/vpmu.h>
-
-#include "op_x86_model.h"
-#include "op_counter.h"
-
-struct arch_msr_pair {
-    u64 counter;
-    u64 control;
-};
-
-/*
- * Intel "Architectural Performance Monitoring" CPUID
- * detection/enumeration details:
- */
-union cpuid10_eax {
-	struct {
-		unsigned int version_id:8;
-		unsigned int num_counters:8;
-		unsigned int bit_width:8;
-		unsigned int mask_length:8;
-	} split;
-	unsigned int full;
-};
-
-static int num_counters = 2;
-static int counter_width = 32;
-
-#define CTR_OVERFLOWED(n) (!((n) & (1ULL<<(counter_width-1))))
-
-#define CTRL_READ(msr_content,msrs,c) do {rdmsrl((msrs->controls[(c)].addr), (msr_content));} while (0)
-#define CTRL_WRITE(msr_content,msrs,c) do {wrmsrl((msrs->controls[(c)].addr), (msr_content));} while (0)
-#define CTRL_SET_ACTIVE(n) (n |= (1ULL<<22))
-#define CTRL_SET_INACTIVE(n) (n &= ~(1ULL<<22))
-#define CTRL_CLEAR(x) (x &= (1ULL<<21))
-#define CTRL_SET_ENABLE(val) (val |= 1ULL<<20)
-#define CTRL_SET_USR(val,u) (val |= ((u & 1ULL) << 16))
-#define CTRL_SET_KERN(val,k) (val |= ((k & 1ULL) << 17))
-#define CTRL_SET_UM(val, m) (val |= (m << 8))
-#define CTRL_SET_EVENT(val, e) (val |= e)
-#define IS_ACTIVE(val) (val & (1ULL << 22) )
-#define IS_ENABLE(val) (val & (1ULL << 20) )
-static unsigned long reset_value[OP_MAX_COUNTER];
-int ppro_has_global_ctrl = 0;
-
-static void cf_check ppro_fill_in_addresses(struct op_msrs * const msrs)
-{
-	int i;
-
-	for (i = 0; i < num_counters; i++)
-		msrs->counters[i].addr = MSR_P6_PERFCTR(i);
-	for (i = 0; i < num_counters; i++)
-		msrs->controls[i].addr = MSR_P6_EVNTSEL(i);
-}
-
-
-static void cf_check ppro_setup_ctrs(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-
-	if (cpu_has_arch_perfmon) {
-		union cpuid10_eax eax;
-		eax.full = cpuid_eax(0xa);
-
-		/*
-		 * For Core2 (family 6, model 15), don't reset the
-		 * counter width:
-		 */
-		if (!(eax.split.version_id == 0 &&
-			current_cpu_data.x86 == 6 &&
-				current_cpu_data.x86_model == 15)) {
-
-			if (counter_width < eax.split.bit_width)
-				counter_width = eax.split.bit_width;
-		}
-	}
-
-	/* clear all counters */
-	for (i = 0 ; i < num_counters; ++i) {
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_CLEAR(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-
-	/* avoid a false detection of ctr overflows in NMI handler */
-	for (i = 0; i < num_counters; ++i)
-		wrmsrl(msrs->counters[i].addr, ~0x0ULL);
-
-	/* enable active counters */
-	for (i = 0; i < num_counters; ++i) {
-		if (counter_config[i].enabled) {
-			reset_value[i] = counter_config[i].count;
-
-			wrmsrl(msrs->counters[i].addr, -reset_value[i]);
-
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_CLEAR(msr_content);
-			CTRL_SET_ENABLE(msr_content);
-			CTRL_SET_USR(msr_content, counter_config[i].user);
-			CTRL_SET_KERN(msr_content, counter_config[i].kernel);
-			CTRL_SET_UM(msr_content, counter_config[i].unit_mask);
-			CTRL_SET_EVENT(msr_content, counter_config[i].event);
-			CTRL_WRITE(msr_content, msrs, i);
-		} else {
-			reset_value[i] = 0;
-		}
-	}
-}
-
-static int cf_check ppro_check_ctrs(
-	unsigned int const cpu, struct op_msrs const * const msrs,
-	struct cpu_user_regs const * const regs)
-{
-	u64 val;
-	int i;
-	int ovf = 0;
-	unsigned long eip = regs->rip;
-	int mode = xenoprofile_get_mode(current, regs);
-	struct arch_msr_pair *msrs_content = vcpu_vpmu(current)->context;
-
-	for (i = 0 ; i < num_counters; ++i) {
-		if (!reset_value[i])
-			continue;
-		rdmsrl(msrs->counters[i].addr, val);
-		if (CTR_OVERFLOWED(val)) {
-			xenoprof_log_event(current, regs, eip, mode, i);
-			wrmsrl(msrs->counters[i].addr, -reset_value[i]);
-			if ( is_passive(current->domain) && (mode != 2) &&
-				vpmu_is_set(vcpu_vpmu(current),
-                                            VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-			{
-				if ( IS_ACTIVE(msrs_content[i].control) )
-				{
-					msrs_content[i].counter = val;
-					if ( IS_ENABLE(msrs_content[i].control) )
-						ovf = 2;
-				}
-			}
-			if ( !ovf )
-				ovf = 1;
-		}
-	}
-
-	/* Only P6 based Pentium M need to re-unmask the apic vector but it
-	 * doesn't hurt other P6 variant */
-	apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
-
-	return ovf;
-}
-
-
-static void cf_check ppro_start(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-
-	for (i = 0; i < num_counters; ++i) {
-		if (reset_value[i]) {
-			CTRL_READ(msr_content, msrs, i);
-			CTRL_SET_ACTIVE(msr_content);
-			CTRL_WRITE(msr_content, msrs, i);
-		}
-	}
-    /* Global Control MSR is enabled by default when system power on.
-     * However, this may not hold true when xenoprof starts to run.
-     */
-    if ( ppro_has_global_ctrl )
-        wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, (1ULL<<num_counters) - 1);
-}
-
-
-static void cf_check ppro_stop(struct op_msrs const * const msrs)
-{
-	uint64_t msr_content;
-	int i;
-
-	for (i = 0; i < num_counters; ++i) {
-		if (!reset_value[i])
-			continue;
-		CTRL_READ(msr_content, msrs, i);
-		CTRL_SET_INACTIVE(msr_content);
-		CTRL_WRITE(msr_content, msrs, i);
-	}
-    if ( ppro_has_global_ctrl )
-        wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0x0ULL);
-}
-
-static int cf_check ppro_is_arch_pmu_msr(u64 msr_index, int *type, int *index)
-{
-	if ( (msr_index >= MSR_IA32_PERFCTR0) &&
-            (msr_index < (MSR_IA32_PERFCTR0 + num_counters)) )
-	{
-		*type = MSR_TYPE_ARCH_COUNTER;
-		*index = msr_index - MSR_IA32_PERFCTR0;
-		return 1;
-        }
-        if ( (msr_index >= MSR_P6_EVNTSEL(0)) &&
-            (msr_index < (MSR_P6_EVNTSEL(num_counters))) )
-        {
-		*type = MSR_TYPE_ARCH_CTRL;
-		*index = msr_index - MSR_P6_EVNTSEL(0);
-		return 1;
-        }
-
-        return 0;
-}
-
-static int cf_check ppro_allocate_msr(struct vcpu *v)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(v);
-	struct arch_msr_pair *msr_content;
-
-	msr_content = xvzalloc_array(struct arch_msr_pair, num_counters);
-	if ( !msr_content )
-		goto out;
-	vpmu->context = (void *)msr_content;
-	vpmu_clear(vpmu);
-	vpmu_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED);
-	return 1;
-out:
-	printk(XENLOG_G_WARNING "Insufficient memory for oprofile,"
-	       " oprofile is unavailable on dom%d vcpu%d\n",
-	       v->vcpu_id, v->domain->domain_id);
-	return 0;
-}
-
-static void cf_check ppro_free_msr(struct vcpu *v)
-{
-	struct vpmu_struct *vpmu = vcpu_vpmu(v);
-
-	if ( !vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
-		return;
-	XVFREE(vpmu->context);
-	vpmu_reset(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED);
-}
-
-static void cf_check ppro_load_msr(
-	struct vcpu *v, int type, int index, u64 *msr_content)
-{
-	struct arch_msr_pair *msrs = vcpu_vpmu(v)->context;
-	switch ( type )
-	{
-	case MSR_TYPE_ARCH_COUNTER:
-		*msr_content = msrs[index].counter;
-		break;
-	case MSR_TYPE_ARCH_CTRL:
-		*msr_content = msrs[index].control;
-		break;
-	}
-}
-
-static void cf_check ppro_save_msr(
-	struct vcpu *v, int type, int index, u64 msr_content)
-{
-	struct arch_msr_pair *msrs = vcpu_vpmu(v)->context;
-
-	switch ( type )
-	{
-	case MSR_TYPE_ARCH_COUNTER:
-		msrs[index].counter = msr_content;
-		break;
-	case MSR_TYPE_ARCH_CTRL:
-		msrs[index].control = msr_content;
-		break;
-	}
-}
-
-/*
- * Architectural performance monitoring.
- *
- * Newer Intel CPUs (Core1+) have support for architectural
- * events described in CPUID 0xA. See the IA32 SDM Vol3b.18 for details.
- * The advantage of this is that it can be done without knowing about
- * the specific CPU.
- */
-void arch_perfmon_setup_counters(void)
-{
-	union cpuid10_eax eax;
-
-	eax.full = cpuid_eax(0xa);
-
-	/* Workaround for BIOS bugs in 6/15. Taken from perfmon2 */
-	if (eax.split.version_id == 0 && current_cpu_data.x86 == 6 &&
-	    current_cpu_data.x86_model == 15) {
-		eax.split.version_id = 2;
-		eax.split.num_counters = 2;
-		eax.split.bit_width = 40;
-	}
-
-	num_counters = min_t(u8, eax.split.num_counters, OP_MAX_COUNTER);
-
-	op_arch_perfmon_spec.num_counters = num_counters;
-	op_arch_perfmon_spec.num_controls = num_counters;
-	op_ppro_spec.num_counters = num_counters;
-	op_ppro_spec.num_controls = num_counters;
-}
-
-struct op_x86_model_spec __read_mostly op_ppro_spec = {
-	.num_counters = 2,
-	.num_controls = 2,
-	.fill_in_addresses = &ppro_fill_in_addresses,
-	.setup_ctrs = &ppro_setup_ctrs,
-	.check_ctrs = &ppro_check_ctrs,
-	.start = &ppro_start,
-	.stop = &ppro_stop,
-	.is_arch_pmu_msr = &ppro_is_arch_pmu_msr,
-	.allocated_msr = &ppro_allocate_msr,
-	.free_msr = &ppro_free_msr,
-	.load_msr = &ppro_load_msr,
-	.save_msr = &ppro_save_msr
-};
-
-struct op_x86_model_spec __read_mostly op_arch_perfmon_spec = {
-	/* num_counters/num_controls filled in at runtime */
-	.fill_in_addresses = &ppro_fill_in_addresses,
-	.setup_ctrs = &ppro_setup_ctrs,
-	.check_ctrs = &ppro_check_ctrs,
-	.start = &ppro_start,
-	.stop = &ppro_stop,
-	.is_arch_pmu_msr = &ppro_is_arch_pmu_msr,
-	.allocated_msr = &ppro_allocate_msr,
-	.free_msr = &ppro_free_msr,
-	.load_msr = &ppro_load_msr,
-	.save_msr = &ppro_save_msr
-};
diff --git a/xen/arch/x86/oprofile/op_x86_model.h b/xen/arch/x86/oprofile/op_x86_model.h
deleted file mode 100644
index 35bc3c1e22..0000000000
--- a/xen/arch/x86/oprofile/op_x86_model.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @file op_x86_model.h
- * interface to x86 model-specific MSR operations
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author Graydon Hoare
- */
-
-#ifndef OP_X86_MODEL_H
-#define OP_X86_MODEL_H
-
-struct op_msr {
-	unsigned long addr;
-	uint64_t value;
-};
-
-struct op_msrs {
-	struct op_msr * counters;
-	struct op_msr * controls;
-};
-
-struct pt_regs;
-
-/* The model vtable abstracts the differences between
- * various x86 CPU model's perfctr support.
- */
-struct op_x86_model_spec {
-	unsigned int num_counters;
-	unsigned int num_controls;
-	void (*fill_in_addresses)(struct op_msrs * const msrs);
-	void (*setup_ctrs)(struct op_msrs const * const msrs);
-	int (*check_ctrs)(unsigned int const cpu, 
-			  struct op_msrs const * const msrs,
-			  struct cpu_user_regs const * const regs);
-	void (*start)(struct op_msrs const * const msrs);
-	void (*stop)(struct op_msrs const * const msrs);
-	int (*is_arch_pmu_msr)(u64 msr_index, int *type, int *index);
-	int (*allocated_msr)(struct vcpu *v);
-	void (*free_msr)(struct vcpu *v);
-	void (*load_msr)(struct vcpu * const v, int type, int index, u64 *msr_content);
-        void (*save_msr)(struct vcpu * const v, int type, int index, u64 msr_content);
-};
-
-extern struct op_x86_model_spec op_ppro_spec;
-extern struct op_x86_model_spec op_arch_perfmon_spec;
-extern struct op_x86_model_spec const op_p4_spec;
-extern struct op_x86_model_spec const op_p4_ht2_spec;
-extern struct op_x86_model_spec const op_athlon_spec;
-extern struct op_x86_model_spec const op_amd_fam15h_spec;
-
-void arch_perfmon_setup_counters(void);
-
-extern int ppro_has_global_ctrl;
-extern struct op_x86_model_spec const *model;
-
-#endif /* OP_X86_MODEL_H */
diff --git a/xen/arch/x86/oprofile/xenoprof.c b/xen/arch/x86/oprofile/xenoprof.c
deleted file mode 100644
index 7f2525bfb4..0000000000
--- a/xen/arch/x86/oprofile/xenoprof.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2005 Hewlett-Packard Co.
- * written by Aravind Menon & Jose Renato Santos
- *            (email: xenoprof@groups.hp.com)
- *
- * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- * x86 specific part
- */
-
-#include <xen/guest_access.h>
-#include <xen/sched.h>
-#include <xen/xenoprof.h>
-#include <public/xenoprof.h>
-
-#include "op_counter.h"
-
-int xenoprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
-{
-    struct xenoprof_counter counter;
-
-    if ( copy_from_guest(&counter, arg, 1) )
-        return -EFAULT;
-
-    if ( counter.ind >= OP_MAX_COUNTER )
-        return -E2BIG;
-
-    counter_config[counter.ind].count     = counter.count;
-    counter_config[counter.ind].enabled   = counter.enabled;
-    counter_config[counter.ind].event     = counter.event;
-    counter_config[counter.ind].kernel    = counter.kernel;
-    counter_config[counter.ind].user      = counter.user;
-    counter_config[counter.ind].unit_mask = counter.unit_mask;
-
-    return 0;
-}
-
-int xenoprof_arch_ibs_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
-{
-    struct xenoprof_ibs_counter ibs_counter;
-
-    if ( copy_from_guest(&ibs_counter, arg, 1) )
-        return -EFAULT;
-
-    ibs_config.op_enabled = ibs_counter.op_enabled;
-    ibs_config.fetch_enabled = ibs_counter.fetch_enabled;
-    ibs_config.max_cnt_fetch = ibs_counter.max_cnt_fetch;
-    ibs_config.max_cnt_op = ibs_counter.max_cnt_op;
-    ibs_config.rand_en = ibs_counter.rand_en;
-    ibs_config.dispatched_ops = ibs_counter.dispatched_ops;
-
-    return 0;
-}
-
-#ifdef CONFIG_COMPAT
-#include <compat/xenoprof.h>
-
-int compat_oprof_arch_counter(XEN_GUEST_HANDLE_PARAM(void) arg)
-{
-    struct compat_oprof_counter counter;
-
-    if ( copy_from_guest(&counter, arg, 1) )
-        return -EFAULT;
-
-    if ( counter.ind >= OP_MAX_COUNTER )
-        return -E2BIG;
-
-    counter_config[counter.ind].count     = counter.count;
-    counter_config[counter.ind].enabled   = counter.enabled;
-    counter_config[counter.ind].event     = counter.event;
-    counter_config[counter.ind].kernel    = counter.kernel;
-    counter_config[counter.ind].user      = counter.user;
-    counter_config[counter.ind].unit_mask = counter.unit_mask;
-
-    return 0;
-}
-#endif
-
-int xenoprofile_get_mode(struct vcpu *curr, const struct cpu_user_regs *regs)
-{
-    if ( !guest_mode(regs) )
-        return 2;
-
-    if ( !is_hvm_vcpu(curr) )
-        return guest_kernel_mode(curr, regs);
-
-    switch ( hvm_guest_x86_mode(curr) )
-    {
-    case X86_MODE_REAL:
-        return 1;
-    case X86_MODE_VM86:
-        return 0;
-    default: /* 16BIT | 32BIT | 64BIT */
-        return hvm_get_cpl(curr) != 3;
-    }
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6ba7ae5202..f621b99a5f 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -50,7 +50,6 @@
 #include <asm/system.h>
 #include <asm/traps.h>
 #include <asm/uaccess.h>
-#include <asm/xenoprof.h>
 
 /*
  * opt_nmi: one of 'ignore', 'dom0', or 'fatal'.
@@ -1943,9 +1942,6 @@ bool nmi_check_continuation(void)
     if ( pci_serr_nmicont() )
         ret = true;
 
-    if ( nmi_oprofile_send_virq() )
-        ret = true;
-
     return ret;
 }
 
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 401d5046f6..38320b248a 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -374,17 +374,6 @@ config EFI_SET_VIRTUAL_ADDRESS_MAP
 
       If unsure, say N.
 
-config XENOPROF
-	bool "Xen Oprofile Support" if EXPERT
-	depends on X86
-	help
-	  Xen OProfile (Xenoprof) is a system-wide profiler for Xen virtual
-	  machine environments, capable of profiling the Xen virtual machine
-	  monitor, multiple Linux guest operating systems, and applications
-	  running on them.
-
-	  If unsure, say Y.
-
 config XSM
 	bool "Xen Security Modules support"
 	default ARM
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 8486c0b510..92c97d641e 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -63,7 +63,6 @@ obj-$(CONFIG_HAS_VMAP) += vmap.o
 obj-y += vsprintf.o
 obj-y += wait.o
 obj-bin-y += warning.init.o
-obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
 
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 unzstd earlycpio,$(n).init.o)
diff --git a/xen/common/compat/xenoprof.c b/xen/common/compat/xenoprof.c
deleted file mode 100644
index 8fbd86c24c..0000000000
--- a/xen/common/compat/xenoprof.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * compat/xenoprof.c
- */
-
-#include <compat/xenoprof.h>
-
-#define COMPAT
-#define ret_t int
-
-#define do_xenoprof_op compat_xenoprof_op
-
-#define xen_oprof_init xenoprof_init
-CHECK_oprof_init;
-#undef xen_oprof_init
-


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 22:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 22:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199235.1515832 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veL2U-0006Fu-VS; Fri, 09 Jan 2026 22:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199235.1515832; Fri, 09 Jan 2026 22:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veL2U-0006Fn-T1; Fri, 09 Jan 2026 22:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1199235;
 Fri, 09 Jan 2026 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 1veL2U-0006Fh-AO
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 22: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 1veL2T-00GkyL-39
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 22:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veL2U-00GAOp-0Y
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 22: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=ZQyHSCDhjr9+dZrgtlcLnTrovSHoUkulXerxgVB2x8s=; b=Y5PT+Hd+YM8nc53tbbZqLA84ts
	FkbqjkthA8A+CxsHLEIL0hb7KQyW44Ah6/E2ldF6b98tq2KuPncAKyz/+VPa6KG7aytTrRMMMP76I
	QMD614r2n9FgFnu7i9LFQBSeWoSsP7GnwCr42ouVX+n/NeoQq43fHTHmPYxh7XE37UtU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Use auto keyword as per C23
Message-Id: <E1veL2U-00GAOp-0Y@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 22:33:02 +0000

commit 6238c97ea430706cb4a959b1474ad40a57ed1033
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 5 12:55:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 20:20:57 2026 +0000

    xen: Use auto keyword as per C23
    
    In macros it is common to declare local variables using typeof(param) in order
    to ensure that side effects are only evaluated once.  A consequence of this is
    double textural expansion of the parameter, which can get out of hand very
    quickly with nested macros.
    
    In C23, the auto keyword has been repurposed to perform type inference.
    
    A GCC extension, __auto_type, is now available in the new toolchain baseline
    and avoids the double textural expansion.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 CODING_STYLE                                    |  5 +++++
 automation/eclair_analysis/ECLAIR/toolchain.ecl | 11 +++++++++--
 docs/misra/C-language-toolchain.rst             |  2 ++
 docs/misra/deviations.rst                       |  5 +++++
 xen/include/xen/compiler.h                      | 14 ++++++++++++++
 xen/include/xen/macros.h                        | 14 +++++++-------
 6 files changed, 42 insertions(+), 9 deletions(-)

diff --git a/CODING_STYLE b/CODING_STYLE
index 7bf3848444..aae5a47ac2 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -129,6 +129,11 @@ Fixed width types should only be used when a fixed width quantity is
 meant (which for example may be a value read from or to be written to a
 register).
 
+Macros which otherwise would use "typeof(arg) newarg =" to avoid double
+evaluation of side effects should use "auto newarg =" per it's C23 behaviour,
+to also avoid double textural expansion.  The use of "auto" outside of macros
+is discouraged.
+
 Especially with pointer types, whenever the pointed to object is not
 (supposed to be) modified, qualify the pointed to type with "const".
 
diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
index da00c2198a..153e96f2b2 100644
--- a/automation/eclair_analysis/ECLAIR/toolchain.ecl
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -15,6 +15,7 @@
     __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_MANUAL".
     asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
     __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
+    __auto_type: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
     __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_MANUAL".
     __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functions Provided by GCC\" of "GCC_MANUAL".
     __builtin_va_arg: non-documented GCC extension.
@@ -26,6 +27,7 @@
 -name_selector+={alignof, "^(__alignof__|__alignof)$"}
 -name_selector+={asm, "^(__asm__|asm)$"}
 -name_selector+={attribute, "^__attribute__$"}
+-name_selector+={auto_type, "^__auto_type$"}
 -name_selector+={builtin_offsetof, "^__builtin_offsetof$"}
 -name_selector+={builtin_types_p, "^__builtin_types_compatible_p$"}
 -name_selector+={builtin_va_arg, "^__builtin_va_arg$"}
@@ -39,6 +41,7 @@
 "alignof||
 asm||
 attribute||
+auto_type||
 builtin_offsetof||
 builtin_types_p||
 builtin_va_arg||
@@ -114,6 +117,7 @@ volatile"
 -doc_end
 
 -doc_begin="
+    ext_auto_type: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
     ext_c_missing_varargs_arg: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
     ext_enum_value_not_int: non-documented GCC extension.
     ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
@@ -126,6 +130,7 @@ volatile"
     ext_return_has_void_expr: see the documentation for -Wreturn-type in Section \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
     ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL".
 "
+-name_selector+={ext_auto_type, "^ext_auto_type$"}
 -name_selector+={ext_c_missing_varargs_arg, "^ext_c_missing_varargs_arg$"}
 -name_selector+={ext_enum_value_not_int, "^ext_enum_value_not_int$"}
 -name_selector+={ext_flexible_array_in_array, "^ext_flexible_array_in_array$"}
@@ -139,7 +144,8 @@ volatile"
 -name_selector+={ext_sizeof_alignof_void_type, "^ext_sizeof_alignof_void_type$"}
 
 -config=STD.diag,behavior+={c99,GCC_ARM64,
-"ext_c_missing_varargs_arg||
+"ext_auto_type||
+ext_c_missing_varargs_arg||
 ext_forward_ref_enum_def||
 ext_gnu_array_range||
 ext_gnu_statement_expr_macro||
@@ -149,7 +155,8 @@ ext_return_has_void_expr||
 ext_sizeof_alignof_void_type"
 }
 -config=STD.diag,behavior+={c99,GCC_X86_64,
-"ext_c_missing_varargs_arg||
+"ext_auto_type||
+ext_c_missing_varargs_arg||
 ext_enum_value_not_int||
 ext_flexible_array_in_array||
 ext_flexible_array_in_struct||
diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 5d418e262a..982c5c6676 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -94,6 +94,8 @@ The table columns are as follows:
           see Sections "6.48 Alternate Keywords" and "6.44 Determining the Alignment of Functions, Types or Variables" of GCC_MANUAL.
        __attribute__:
           see Section "6.39 Attribute Syntax" of GCC_MANUAL.
+       __auto_type:
+          see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
        __builtin_types_compatible_p:
           see Section "6.59 Other Built-in Functions Provided by GCC" of GCC_MANUAL.
        __builtin_va_arg:
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 17c21537f2..b048309596 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -599,6 +599,11 @@ Deviations related to MISRA C:2012 Rules:
      - The override of the keyword \"inline\" in xen/compiler.h is present so
        that section contents checks pass when the compiler chooses not to
        inline a particular function.
+
+       Xen does not use the \"auto\" keyword as a storage qualifier.  The
+       override of the keyword \"auto\" in xen/compiler.h is to give it it's
+       C23 behaviour of type inference.
+
      - Comment-based deviation.
 
    * - R20.7
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 88bf26bc51..38ef5d82ad 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -64,6 +64,20 @@
 # define asm_inline asm
 #endif
 
+/*
+ * In C23, the auto keyword has been repurposed to perform type inference.
+ *
+ * This behaviour is available via the __auto_type extension in supported
+ * toolchains.
+ *
+ * https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Auto-Type.html
+ * https://clang.llvm.org/docs/LanguageExtensions.html#auto-type
+ */
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
+/* SAF-3-safe MISRA C Rule 20.4: Giving the keyword it's C23 meaning. */
+#define auto __auto_type
+#endif
+
 /*
  * Add the pseudo keyword 'fallthrough' so case statement blocks
  * must end with any of these keywords:
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 6e8ac8b452..714a644f4e 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -63,18 +63,18 @@
 /* Hide a value from the optimiser. */
 #define HIDE(x)                                 \
     ({                                          \
-        typeof(x) _x = (x);                     \
+        auto _x = (x);                          \
         asm volatile ( "" : "+r" (_x) );        \
         _x;                                     \
     })
 
 #define ABS(x) ({                              \
-    typeof(x) x_ = (x);                        \
+    auto x_ = (x);                             \
     (x_ < 0) ? -x_ : x_;                       \
 })
 
 #define SWAP(a, b) \
-   do { typeof(a) t_ = (a); (a) = (b); (b) = t_; } while ( 0 )
+   do { auto t_ = (a); (a) = (b); (b) = t_; } while ( 0 )
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
 
@@ -104,15 +104,15 @@
  */
 #define min(x, y)                               \
     ({                                          \
-        const typeof(x) _x = (x);               \
-        const typeof(y) _y = (y);               \
+        const auto _x = (x);                    \
+        const auto _y = (y);                    \
         (void)(&_x == &_y); /* typecheck */     \
         _x < _y ? _x : _y;                      \
     })
 #define max(x, y)                               \
     ({                                          \
-        const typeof(x) _x = (x);               \
-        const typeof(y) _y = (y);               \
+        const auto _x = (x);                    \
+        const auto _y = (y);                    \
         (void)(&_x == &_y); /* typecheck */     \
         _x > _y ? _x : _y;                      \
     })
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 09 23:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Jan 2026 23:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1199273.1515857 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1veM9D-0006h4-7x; Fri, 09 Jan 2026 23:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1199273.1515857; Fri, 09 Jan 2026 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 1veM9D-0006gx-56; Fri, 09 Jan 2026 23:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1199273;
 Fri, 09 Jan 2026 23: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 1veM9C-0006gr-3i
 for xen-changelog@lists.xenproject.org; Fri, 09 Jan 2026 23: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 1veM9B-00GmCK-2Q
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 23:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1veM9B-00GFQl-3D
 for xen-changelog@lists.xenproject.org;
 Fri, 09 Jan 2026 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=k64j5uwDyV5jOncba7J0zgKxBqtYDEWXWuHkoOZgK2o=; b=mQ26ks4JpEpdX/IFd3pUzgbUxw
	5cghgYLDMpuZOkh7UWbukIz3+aZ8+qZxta58Ywmci8GKBsWa8wXfTqvRlAJ+ROXwHsiSBmPl3vQPY
	75dHvcM08NVKbspm2B1mVW/a0qLuoumguMlVcCB0/QCPX5I12RMsmRELSQVIRzVuzR4U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Use auto keyword as per C23
Message-Id: <E1veM9B-00GFQl-3D@xenbits.xenproject.org>
Date: Fri, 09 Jan 2026 23:44:01 +0000

commit 6238c97ea430706cb4a959b1474ad40a57ed1033
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 5 12:55:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jan 9 20:20:57 2026 +0000

    xen: Use auto keyword as per C23
    
    In macros it is common to declare local variables using typeof(param) in order
    to ensure that side effects are only evaluated once.  A consequence of this is
    double textural expansion of the parameter, which can get out of hand very
    quickly with nested macros.
    
    In C23, the auto keyword has been repurposed to perform type inference.
    
    A GCC extension, __auto_type, is now available in the new toolchain baseline
    and avoids the double textural expansion.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 CODING_STYLE                                    |  5 +++++
 automation/eclair_analysis/ECLAIR/toolchain.ecl | 11 +++++++++--
 docs/misra/C-language-toolchain.rst             |  2 ++
 docs/misra/deviations.rst                       |  5 +++++
 xen/include/xen/compiler.h                      | 14 ++++++++++++++
 xen/include/xen/macros.h                        | 14 +++++++-------
 6 files changed, 42 insertions(+), 9 deletions(-)

diff --git a/CODING_STYLE b/CODING_STYLE
index 7bf3848444..aae5a47ac2 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -129,6 +129,11 @@ Fixed width types should only be used when a fixed width quantity is
 meant (which for example may be a value read from or to be written to a
 register).
 
+Macros which otherwise would use "typeof(arg) newarg =" to avoid double
+evaluation of side effects should use "auto newarg =" per it's C23 behaviour,
+to also avoid double textural expansion.  The use of "auto" outside of macros
+is discouraged.
+
 Especially with pointer types, whenever the pointed to object is not
 (supposed to be) modified, qualify the pointed to type with "const".
 
diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
index da00c2198a..153e96f2b2 100644
--- a/automation/eclair_analysis/ECLAIR/toolchain.ecl
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -15,6 +15,7 @@
     __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_MANUAL".
     asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
     __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
+    __auto_type: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
     __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_MANUAL".
     __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functions Provided by GCC\" of "GCC_MANUAL".
     __builtin_va_arg: non-documented GCC extension.
@@ -26,6 +27,7 @@
 -name_selector+={alignof, "^(__alignof__|__alignof)$"}
 -name_selector+={asm, "^(__asm__|asm)$"}
 -name_selector+={attribute, "^__attribute__$"}
+-name_selector+={auto_type, "^__auto_type$"}
 -name_selector+={builtin_offsetof, "^__builtin_offsetof$"}
 -name_selector+={builtin_types_p, "^__builtin_types_compatible_p$"}
 -name_selector+={builtin_va_arg, "^__builtin_va_arg$"}
@@ -39,6 +41,7 @@
 "alignof||
 asm||
 attribute||
+auto_type||
 builtin_offsetof||
 builtin_types_p||
 builtin_va_arg||
@@ -114,6 +117,7 @@ volatile"
 -doc_end
 
 -doc_begin="
+    ext_auto_type: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
     ext_c_missing_varargs_arg: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
     ext_enum_value_not_int: non-documented GCC extension.
     ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
@@ -126,6 +130,7 @@ volatile"
     ext_return_has_void_expr: see the documentation for -Wreturn-type in Section \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
     ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL".
 "
+-name_selector+={ext_auto_type, "^ext_auto_type$"}
 -name_selector+={ext_c_missing_varargs_arg, "^ext_c_missing_varargs_arg$"}
 -name_selector+={ext_enum_value_not_int, "^ext_enum_value_not_int$"}
 -name_selector+={ext_flexible_array_in_array, "^ext_flexible_array_in_array$"}
@@ -139,7 +144,8 @@ volatile"
 -name_selector+={ext_sizeof_alignof_void_type, "^ext_sizeof_alignof_void_type$"}
 
 -config=STD.diag,behavior+={c99,GCC_ARM64,
-"ext_c_missing_varargs_arg||
+"ext_auto_type||
+ext_c_missing_varargs_arg||
 ext_forward_ref_enum_def||
 ext_gnu_array_range||
 ext_gnu_statement_expr_macro||
@@ -149,7 +155,8 @@ ext_return_has_void_expr||
 ext_sizeof_alignof_void_type"
 }
 -config=STD.diag,behavior+={c99,GCC_X86_64,
-"ext_c_missing_varargs_arg||
+"ext_auto_type||
+ext_c_missing_varargs_arg||
 ext_enum_value_not_int||
 ext_flexible_array_in_array||
 ext_flexible_array_in_struct||
diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 5d418e262a..982c5c6676 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -94,6 +94,8 @@ The table columns are as follows:
           see Sections "6.48 Alternate Keywords" and "6.44 Determining the Alignment of Functions, Types or Variables" of GCC_MANUAL.
        __attribute__:
           see Section "6.39 Attribute Syntax" of GCC_MANUAL.
+       __auto_type:
+          see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
        __builtin_types_compatible_p:
           see Section "6.59 Other Built-in Functions Provided by GCC" of GCC_MANUAL.
        __builtin_va_arg:
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 17c21537f2..b048309596 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -599,6 +599,11 @@ Deviations related to MISRA C:2012 Rules:
      - The override of the keyword \"inline\" in xen/compiler.h is present so
        that section contents checks pass when the compiler chooses not to
        inline a particular function.
+
+       Xen does not use the \"auto\" keyword as a storage qualifier.  The
+       override of the keyword \"auto\" in xen/compiler.h is to give it it's
+       C23 behaviour of type inference.
+
      - Comment-based deviation.
 
    * - R20.7
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 88bf26bc51..38ef5d82ad 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -64,6 +64,20 @@
 # define asm_inline asm
 #endif
 
+/*
+ * In C23, the auto keyword has been repurposed to perform type inference.
+ *
+ * This behaviour is available via the __auto_type extension in supported
+ * toolchains.
+ *
+ * https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Auto-Type.html
+ * https://clang.llvm.org/docs/LanguageExtensions.html#auto-type
+ */
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
+/* SAF-3-safe MISRA C Rule 20.4: Giving the keyword it's C23 meaning. */
+#define auto __auto_type
+#endif
+
 /*
  * Add the pseudo keyword 'fallthrough' so case statement blocks
  * must end with any of these keywords:
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 6e8ac8b452..714a644f4e 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -63,18 +63,18 @@
 /* Hide a value from the optimiser. */
 #define HIDE(x)                                 \
     ({                                          \
-        typeof(x) _x = (x);                     \
+        auto _x = (x);                          \
         asm volatile ( "" : "+r" (_x) );        \
         _x;                                     \
     })
 
 #define ABS(x) ({                              \
-    typeof(x) x_ = (x);                        \
+    auto x_ = (x);                             \
     (x_ < 0) ? -x_ : x_;                       \
 })
 
 #define SWAP(a, b) \
-   do { typeof(a) t_ = (a); (a) = (b); (b) = t_; } while ( 0 )
+   do { auto t_ = (a); (a) = (b); (b) = t_; } while ( 0 )
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
 
@@ -104,15 +104,15 @@
  */
 #define min(x, y)                               \
     ({                                          \
-        const typeof(x) _x = (x);               \
-        const typeof(y) _y = (y);               \
+        const auto _x = (x);                    \
+        const auto _y = (y);                    \
         (void)(&_x == &_y); /* typecheck */     \
         _x < _y ? _x : _y;                      \
     })
 #define max(x, y)                               \
     ({                                          \
-        const typeof(x) _x = (x);               \
-        const typeof(y) _y = (y);               \
+        const auto _x = (x);                    \
+        const auto _y = (y);                    \
         (void)(&_x == &_y); /* typecheck */     \
         _x > _y ? _x : _y;                      \
     })
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 13:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 13:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200250.1516232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI2Z-0001Hx-8m; Mon, 12 Jan 2026 13:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200250.1516232; Mon, 12 Jan 2026 13:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI2Z-0001Ho-5o; Mon, 12 Jan 2026 13:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1200250;
 Mon, 12 Jan 2026 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 1vfI2Y-0001Hi-6P
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfI2Y-0004xt-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 13:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfI2Y-000EnR-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=rABG5d+VGVIv+fg5Ipca2FCzvf1wHD2VVcHqACVqaj4=; b=LllFtb//nBpda6GQZHrKinSqrN
	cb4xyZFUpkM4SBJQac9OAjIwr9mUq6B8/3Bvs7BQNXBA5MwKS3Fg1zsYiEPIUG59XR5UtKw4U+XQd
	nwhGQeO9nm4rpY0kevdtzaYmh+foLPAgM6FJewbgsJXXuDE28jRLojSAnHeLma3DCZjY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xenpm: Don't build outside of x86
Message-Id: <E1vfI2Y-000EnR-0E@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 13:33:02 +0000

commit 684897241447de6df28e6b59961418ae4cf05e32
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Mon Jan 12 13:04:08 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:04:08 2026 +0100

    xenpm: Don't build outside of x86
    
    xenpm doesn't provide any interesting usable features outside of x86,
    skip building it if we are not x86.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 CHANGELOG.md        | 3 +++
 tools/misc/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1663f6878e..7de34f64d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
 
+ - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
+   anything useful outside of x86.
+
 ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
 
 ### Changed
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index c26e544e83..6ee783f43e 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -29,7 +29,7 @@ INSTALL_SBIN                   += xencov
 INSTALL_SBIN                   += xenhypfs
 INSTALL_SBIN                   += xenlockprof
 INSTALL_SBIN                   += xenperf
-INSTALL_SBIN                   += xenpm
+INSTALL_SBIN-$(CONFIG_X86)     += xenpm
 INSTALL_SBIN                   += xenwatchdogd
 INSTALL_SBIN                   += xen-access
 INSTALL_SBIN                   += xen-livepatch
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 13:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 13:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200251.1516235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI2j-0001Jc-AH; Mon, 12 Jan 2026 13:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200251.1516235; Mon, 12 Jan 2026 13:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI2j-0001JU-7B; Mon, 12 Jan 2026 13:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1200251;
 Mon, 12 Jan 2026 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 1vfI2i-0001JI-7l
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfI2i-0004xz-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 13:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfI2i-000EoD-0Z
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=tR2tBXPS30IE7xsR8WVdLI2KxUBt2GBNd6yTVtJmyC8=; b=kArHOU1UxCcKYgdMXUOd4IopQr
	EKG/UcFaoon+8WI79KntYvxuAnRBEOq9cFqA6CKVw8AgYGNW2XN04Cm95uHV1lN8I3WlbBjTb2/cJ
	w9KyoYbM65G36weBpC1cSrA/1tGFpsYFhMvXb+dsWLNNaYDEKBlC2NGVz80ob+BTC0oE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add support of page lookup by GFN
Message-Id: <E1vfI2i-000EoD-0Z@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 13:33:12 +0000

commit 27fe81330553ac5edab4ca8ab5435cb0a36e5b1f
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Jan 12 13:06:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:06:14 2026 +0100

    xen/riscv: add support of page lookup by GFN
    
    Introduce helper functions for safely querying the P2M (physical-to-machine)
    mapping:
     - add p2m_read_lock(), p2m_read_unlock(), and p2m_is_locked() for managing
       P2M lock state.
     - Implement p2m_get_entry() to retrieve mapping details for a given GFN,
       including MFN, page order, and validity.
     - Introduce p2m_get_page_from_gfn() to convert a GFN into a page_info
       pointer, acquiring a reference to the page if valid.
     - Introduce get_page().
    
    Implementations are based on Arm's functions with some minor modifications:
    - p2m_get_entry():
      - Reverse traversal of page tables, as RISC-V uses the opposite level
        numbering compared to Arm.
      - Removed the return of p2m_access_t from p2m_get_entry() since
        mem_access_settings is not introduced for RISC-V.
      - Updated BUILD_BUG_ON() to check using the level 0 mask, which corresponds
        to Arm's THIRD_MASK.
      - Replaced open-coded bit shifts with the BIT() macro.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/p2m.h |  21 +++++
 xen/arch/riscv/mm.c              |  13 +++
 xen/arch/riscv/p2m.c             | 185 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 219 insertions(+)

diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index b48693a2b4..f63b5dec99 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -41,6 +41,9 @@
 
 #define P2M_GFN_LEVEL_SHIFT(lvl) (P2M_LEVEL_ORDER(lvl) + PAGE_SHIFT)
 
+#define P2M_LEVEL_MASK(p2m, lvl) \
+    (P2M_TABLE_OFFSET(p2m, lvl) << P2M_GFN_LEVEL_SHIFT(lvl))
+
 #define paddr_bits PADDR_BITS
 
 /* Get host p2m table */
@@ -234,6 +237,24 @@ static inline bool p2m_is_write_locked(struct p2m_domain *p2m)
 
 unsigned long construct_hgatp(const struct p2m_domain *p2m, uint16_t vmid);
 
+static inline void p2m_read_lock(struct p2m_domain *p2m)
+{
+    read_lock(&p2m->lock);
+}
+
+static inline void p2m_read_unlock(struct p2m_domain *p2m)
+{
+    read_unlock(&p2m->lock);
+}
+
+static inline bool p2m_is_locked(const struct p2m_domain *p2m)
+{
+    return rw_is_locked(&p2m->lock);
+}
+
+struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
+                                        p2m_type_t *t);
+
 #endif /* ASM__RISCV__P2M_H */
 
 /*
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index e25f995b72..e9ce182d06 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -673,3 +673,16 @@ struct domain *page_get_owner_and_reference(struct page_info *page)
 
     return owner;
 }
+
+bool get_page(struct page_info *page, const struct domain *domain)
+{
+    const struct domain *owner = page_get_owner_and_reference(page);
+
+    if ( likely(owner == domain) )
+        return true;
+
+    if ( owner != NULL )
+        put_page(page);
+
+    return false;
+}
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 8d572f838f..c6de785e4c 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1057,3 +1057,188 @@ int map_regions_p2mt(struct domain *d,
 
     return rc;
 }
+
+/*
+ * p2m_get_entry() should always return the correct order value, even if an
+ * entry is not present (i.e. the GFN is outside the range):
+ *   [p2m->lowest_mapped_gfn, p2m->max_mapped_gfn]    (1)
+ *
+ * This ensures that callers of p2m_get_entry() can determine what range of
+ * address space would be altered by a corresponding p2m_set_entry().
+ * Also, it would help to avoid costly page walks for GFNs outside range (1).
+ *
+ * Therefore, this function returns true for GFNs outside range (1), and in
+ * that case the corresponding level is returned via the level_out argument.
+ * Otherwise, it returns false and p2m_get_entry() performs a page walk to
+ * find the proper entry.
+ */
+static bool check_outside_boundary(const struct p2m_domain *p2m, gfn_t gfn,
+                                   gfn_t boundary, bool is_lower,
+                                   unsigned int *level_out)
+{
+    unsigned int level = P2M_MAX_ROOT_LEVEL + 1;
+    bool ret = false;
+
+    ASSERT(p2m);
+
+    if ( is_lower ? gfn_x(gfn) < gfn_x(boundary)
+                  : gfn_x(gfn) > gfn_x(boundary) )
+    {
+        for ( level = P2M_ROOT_LEVEL(p2m) ; level; level-- )
+        {
+            unsigned long mask = BIT(P2M_GFN_LEVEL_SHIFT(level), UL) - 1;
+
+            if ( is_lower ? (gfn_x(gfn) | mask) < gfn_x(boundary)
+                          : (gfn_x(gfn) & ~mask) > gfn_x(boundary) )
+                break;
+        }
+
+        ret = true;
+    }
+
+    if ( level_out )
+        *level_out = level;
+
+    return ret;
+}
+
+/*
+ * Get the details of a given gfn.
+ *
+ * If the entry is present, the associated MFN, the p2m type of the mapping,
+ * and the page order of the mapping in the page table (i.e., it could be a
+ * superpage) will be returned.
+ *
+ * If the entry is not present, INVALID_MFN will be returned, page_order will
+ * be set according to the order of the invalid range, and the type will be
+ * p2m_invalid.
+ */
+static mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
+                           p2m_type_t *t,
+                           unsigned int *page_order)
+{
+    unsigned int level = P2M_ROOT_LEVEL(p2m);
+    unsigned int gfn_limit_bits =
+        P2M_LEVEL_ORDER(level + 1) + P2M_ROOT_EXTRA_BITS(p2m, level);
+    pte_t entry, *table;
+    int rc;
+    mfn_t mfn = INVALID_MFN;
+
+    P2M_BUILD_LEVEL_OFFSETS(p2m, offsets, gfn_to_gaddr(gfn));
+
+    ASSERT(p2m_is_locked(p2m));
+
+    *t = p2m_invalid;
+
+    if ( gfn_x(gfn) > (BIT(gfn_limit_bits, UL) - 1) )
+    {
+        if ( page_order )
+            *page_order = gfn_limit_bits;
+
+        return mfn;
+    }
+
+    if ( check_outside_boundary(p2m, gfn, p2m->lowest_mapped_gfn, true,
+                                &level) )
+        goto out;
+
+    if ( check_outside_boundary(p2m, gfn, p2m->max_mapped_gfn, false, &level) )
+        goto out;
+
+    table = p2m_get_root_pointer(p2m, gfn);
+
+    /*
+     * The table should always be non-NULL because the gfn is below
+     * p2m->max_mapped_gfn and the root table pages are always present.
+     */
+    if ( !table )
+    {
+        ASSERT_UNREACHABLE();
+        goto out;
+    }
+
+    for ( level = P2M_ROOT_LEVEL(p2m); level; level-- )
+    {
+        rc = p2m_next_level(p2m, false, level, &table, offsets[level]);
+        if ( rc == P2M_TABLE_MAP_NONE )
+            goto out_unmap;
+
+        if ( rc != P2M_TABLE_NORMAL )
+            break;
+    }
+
+    entry = table[offsets[level]];
+
+    if ( pte_is_valid(entry) )
+    {
+        *t = p2m_get_type(entry);
+
+        mfn = pte_get_mfn(entry);
+
+        ASSERT(!(mfn_x(mfn) & (BIT(P2M_LEVEL_ORDER(level), UL) - 1)));
+
+        /*
+         * The entry may point to a superpage. Find the MFN associated
+         * to the GFN.
+         */
+        mfn = mfn_add(mfn,
+                      gfn_x(gfn) & (BIT(P2M_LEVEL_ORDER(level), UL) - 1));
+    }
+
+ out_unmap:
+    unmap_domain_page(table);
+
+ out:
+    if ( page_order )
+        *page_order = P2M_LEVEL_ORDER(level);
+
+    return mfn;
+}
+
+struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
+                                        p2m_type_t *t)
+{
+    struct page_info *page;
+    p2m_type_t p2mt;
+    mfn_t mfn;
+
+    p2m_read_lock(p2m);
+    mfn = p2m_get_entry(p2m, gfn, &p2mt, NULL);
+
+    if ( t )
+        *t = p2mt;
+
+    if ( !mfn_valid(mfn) )
+    {
+        p2m_read_unlock(p2m);
+        return NULL;
+    }
+
+    page = mfn_to_page(mfn);
+
+    /*
+     * get_page won't work on foreign mapping because the page doesn't
+     * belong to the current domain.
+     */
+    if ( unlikely(p2m_is_foreign(p2mt)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        p2m_read_unlock(p2m);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != p2m->domain) )
+                return page;
+
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+
+        return NULL;
+    }
+
+    p2m_read_unlock(p2m);
+
+    return get_page(page, p2m->domain) ? page : NULL;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 13:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 13:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200252.1516239 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI2u-0001MO-BT; Mon, 12 Jan 2026 13:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200252.1516239; Mon, 12 Jan 2026 13: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 1vfI2u-0001ME-8b; Mon, 12 Jan 2026 13:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1200252;
 Mon, 12 Jan 2026 13:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vfI2s-0001Lo-AQ
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfI2s-0004yL-22
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfI2s-000Eoz-0r
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=XCz5QYCzmiR9rnocMBqUZq1ITgtAsj/hnFf5XKwqpEk=; b=oxAbs1AuxY/hX4bvc/+U92ZQfc
	wdxAAZBhRjNGxpTzPvr33XaOnVVweXuytzrQQwxFLqtxzbROlGfEL2Tkf2nk5/0b10jOQZUj0zbEQ
	pVvj7Je3ACeSSwxwwfUwfB2MqhKvVJX/ihnxmyvuANJ9pDMpQ07gnZDEX3zB54obPvR4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: introduce metadata table to store P2M type
Message-Id: <E1vfI2s-000Eoz-0r@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 13:33:22 +0000

commit df31e3163d6e7a1b8b3287187b43f06458df0ada
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Jan 12 13:06:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:06:49 2026 +0100

    xen/riscv: introduce metadata table to store P2M type
    
    RISC-V's PTE has only two available bits that can be used to store the P2M
    type. This is insufficient to represent all the current RISC-V P2M types.
    Therefore, some P2M types must be stored outside the PTE bits.
    
    To address this, a metadata table is introduced to store P2M types that
    cannot fit in the PTE itself. Not all P2M types are stored in the
    metadata table—only those that require it.
    
    The metadata table is linked to the intermediate page table via the
    `struct page_info`'s v.md.metadata field of the corresponding intermediate
    page.
    Such pages are allocated with MEMF_no_owner, which allows us to use
    the v field for the purpose of storing the metadata table.
    
    To simplify the allocation and linking of intermediate and metadata page
    tables, `p2m_{alloc,free}_table()` functions are implemented.
    
    These changes impact `p2m_split_superpage()`, since when a superpage is
    split, it is necessary to update the metadata table of the new
    intermediate page table — if the entry being split has its P2M type set
    to `p2m_ext_storage` in its `P2M_TYPES` bits. In addition to updating
    the metadata of the new intermediate page table, the corresponding entry
    in the metadata for the original superpage is invalidated.
    
    Also, update p2m_{get,set}_type to work with P2M types which don't fit
    into PTE bits.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/mm.h |   9 ++
 xen/arch/riscv/p2m.c            | 234 ++++++++++++++++++++++++++++++++++------
 2 files changed, 213 insertions(+), 30 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 1a99e1cf0a..48162f5d65 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -149,6 +149,15 @@ struct page_info
             /* Order-size of the free chunk this page is the head of. */
             unsigned int order;
         } free;
+
+        /* Page is used as an intermediate P2M page table */
+        struct {
+            /*
+             * Pointer to a page which store metadata for an intermediate page
+             * table.
+             */
+            struct page_info *pg;
+        } md;
     } v;
 
     union {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index c6de785e4c..c40ea483a7 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -26,6 +26,25 @@
  */
 #define P2M_MAX_SUPPORTED_LEVEL_MAPPING _AC(2, U)
 
+struct md_t {
+    /*
+     * Describes a type stored outside PTE bits.
+     * Look at the comment above definition of enum p2m_type_t.
+     */
+    p2m_type_t type : 4;
+};
+
+/*
+ * P2M PTE context is used only when a PTE's P2M type is p2m_ext_storage.
+ * In this case, the P2M type is stored separately in the metadata page.
+ */
+struct p2m_pte_ctx {
+    struct p2m_domain *p2m;
+    struct page_info *pt_page;   /* Page table page containing the PTE. */
+    unsigned int index;          /* Index of the PTE within that page. */
+    unsigned int level;          /* Paging level at which the PTE resides. */
+};
+
 static struct gstage_mode_desc __ro_after_init max_gstage_mode = {
     .mode = HGATP_MODE_OFF,
     .paging_levels = 0,
@@ -37,6 +56,10 @@ unsigned char get_max_supported_mode(void)
     return max_gstage_mode.mode;
 }
 
+/*
+ * If anything is changed here, it may also require updates to
+ * p2m_{get,set}_type().
+ */
 static inline unsigned int calc_offset(const struct p2m_domain *p2m,
                                        const unsigned int lvl,
                                        const paddr_t gpa)
@@ -79,6 +102,9 @@ static inline unsigned int calc_offset(const struct p2m_domain *p2m,
  * The caller is responsible for unmapping the page after use.
  *
  * Returns NULL if the calculated offset into the root table is invalid.
+ *
+ * If anything is changed here, it may also require updates to
+ * p2m_{get,set}_type().
  */
 static pte_t *p2m_get_root_pointer(struct p2m_domain *p2m, gfn_t gfn)
 {
@@ -370,24 +396,94 @@ static struct page_info *p2m_alloc_page(struct p2m_domain *p2m)
     return pg;
 }
 
-static int p2m_set_type(pte_t *pte, p2m_type_t t)
+/*
+ * `pte` – PTE entry for which the type `t` will be stored.
+ *
+ * If `t` >= p2m_first_external, a valid `ctx` must be provided.
+ */
+static void p2m_set_type(pte_t *pte, p2m_type_t t,
+                         const struct p2m_pte_ctx *ctx)
 {
-    int rc = 0;
+    struct page_info **md_pg;
+    struct md_t *metadata = NULL;
 
-    if ( t > p2m_first_external )
-        panic("unimplemeted\n");
-    else
-        pte->pte |= MASK_INSR(t, P2M_TYPE_PTE_BITS_MASK);
+    /*
+     * It is sufficient to compare ctx->index with PAGETABLE_ENTRIES because,
+     * even for the p2m root page table (which is a 16 KB page allocated as
+     * four 4 KB pages), calc_offset() guarantees that the page-table index
+     * will always fall within the range [0, 511].
+     */
+    ASSERT(ctx && ctx->index < PAGETABLE_ENTRIES && ctx->p2m);
 
-    return rc;
+    /*
+     * At the moment, p2m_get_root_pointer() returns one of four possible p2m
+     * root pages, so there is no need to search for the correct ->pt_page
+     * here.
+     * Non-root page tables are 4 KB pages, so simply using ->pt_page is
+     * sufficient.
+     */
+    md_pg = &ctx->pt_page->v.md.pg;
+
+    if ( !*md_pg && (t >= p2m_first_external) )
+    {
+        /*
+         * Since p2m_alloc_page() initializes an allocated page with
+         * zeros, p2m_invalid is expected to have the value 0 as well.
+         */
+        BUILD_BUG_ON(p2m_invalid);
+
+        *md_pg = p2m_alloc_page(ctx->p2m);
+        if ( !*md_pg )
+        {
+            printk("%pd: can't allocate metadata page\n",
+                    ctx->p2m->domain);
+            domain_crash(ctx->p2m->domain);
+
+            return;
+        }
+    }
+
+    if ( *md_pg )
+        metadata = __map_domain_page(*md_pg);
+
+    if ( t >= p2m_first_external )
+    {
+        metadata[ctx->index].type = t;
+
+        t = p2m_ext_storage;
+    }
+    else if ( metadata )
+        metadata[ctx->index].type = p2m_invalid;
+
+    pte->pte |= MASK_INSR(t, P2M_TYPE_PTE_BITS_MASK);
+
+    unmap_domain_page(metadata);
 }
 
-static p2m_type_t p2m_get_type(const pte_t pte)
+/*
+ * `pte` -> PTE entry that stores the PTE's type.
+ *
+ * If the PTE's type is `p2m_ext_storage`, `ctx` should be provided;
+ * otherwise it could be NULL.
+ */
+static p2m_type_t p2m_get_type(const pte_t pte, const struct p2m_pte_ctx *ctx)
 {
     p2m_type_t type = MASK_EXTR(pte.pte, P2M_TYPE_PTE_BITS_MASK);
 
     if ( type == p2m_ext_storage )
-        panic("unimplemented\n");
+    {
+        const struct md_t *md = __map_domain_page(ctx->pt_page->v.md.pg);
+
+        type = md[ctx->index].type;
+
+        /*
+         * Since p2m_set_type() guarantees that the type will be greater than
+         * p2m_first_external, just check that we received a valid type here.
+         */
+        ASSERT(type > p2m_first_external);
+
+        unmap_domain_page(md);
+    }
 
     return type;
 }
@@ -477,7 +573,14 @@ static void p2m_set_permission(pte_t *e, p2m_type_t t)
     }
 }
 
-static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t, bool is_table)
+/*
+ * If p2m_pte_from_mfn() is called with ctx = NULL,
+ * it means the function is working with a page table for which the `t`
+ * should not be applicable. Otherwise, the function is handling a leaf PTE
+ * for which `t` is applicable.
+ */
+static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t,
+                              struct p2m_pte_ctx *ctx)
 {
     pte_t e = (pte_t) { PTE_VALID };
 
@@ -485,7 +588,7 @@ static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t, bool is_table)
 
     ASSERT(!(mfn_to_maddr(mfn) & ~PADDR_MASK) || mfn_eq(mfn, INVALID_MFN));
 
-    if ( !is_table )
+    if ( ctx )
     {
         switch ( t )
         {
@@ -498,7 +601,7 @@ static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t, bool is_table)
         }
 
         p2m_set_permission(&e, t);
-        p2m_set_type(&e, t);
+        p2m_set_type(&e, t, ctx);
     }
     else
         /*
@@ -518,7 +621,22 @@ static pte_t page_to_p2m_table(const struct page_info *page)
      * set to true and p2m_type_t shouldn't be applied for PTEs which
      * describe an intermediate table.
      */
-    return p2m_pte_from_mfn(page_to_mfn(page), p2m_invalid, true);
+    return p2m_pte_from_mfn(page_to_mfn(page), p2m_invalid, NULL);
+}
+
+static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
+
+/*
+ * Free page table's page and metadata page linked to page table's page.
+ */
+static void p2m_free_table(struct p2m_domain *p2m, struct page_info *tbl_pg)
+{
+    if ( tbl_pg->v.md.pg )
+    {
+        p2m_free_page(p2m, tbl_pg->v.md.pg);
+        tbl_pg->v.md.pg = NULL;
+    }
+    p2m_free_page(p2m, tbl_pg);
 }
 
 /* Allocate a new page table page and hook it in via the given entry. */
@@ -679,12 +797,14 @@ static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg)
 
 /* Free pte sub-tree behind an entry */
 static void p2m_free_subtree(struct p2m_domain *p2m,
-                             pte_t entry, unsigned int level)
+                             pte_t entry,
+                             const struct p2m_pte_ctx *ctx)
 {
     unsigned int i;
     pte_t *table;
     mfn_t mfn;
     struct page_info *pg;
+    unsigned int level = ctx->level;
 
     /*
      * Check if the level is valid: only 4K - 2M - 1G mappings are supported.
@@ -700,7 +820,7 @@ static void p2m_free_subtree(struct p2m_domain *p2m,
 
     if ( pte_is_mapping(entry) )
     {
-        p2m_type_t p2mt = p2m_get_type(entry);
+        p2m_type_t p2mt = p2m_get_type(entry, ctx);
 
 #ifdef CONFIG_IOREQ_SERVER
         /*
@@ -719,10 +839,22 @@ static void p2m_free_subtree(struct p2m_domain *p2m,
         return;
     }
 
-    table = map_domain_page(pte_get_mfn(entry));
+    mfn = pte_get_mfn(entry);
+    ASSERT(mfn_valid(mfn));
+    table = map_domain_page(mfn);
+    pg = mfn_to_page(mfn);
 
     for ( i = 0; i < P2M_PAGETABLE_ENTRIES(p2m, level); i++ )
-        p2m_free_subtree(p2m, table[i], level - 1);
+    {
+        struct p2m_pte_ctx tmp_ctx = {
+            .pt_page = pg,
+            .index = i,
+            .level = level - 1,
+            .p2m = p2m,
+        };
+
+        p2m_free_subtree(p2m, table[i], &tmp_ctx);
+    }
 
     unmap_domain_page(table);
 
@@ -734,17 +866,13 @@ static void p2m_free_subtree(struct p2m_domain *p2m,
      */
     p2m_tlb_flush_sync(p2m);
 
-    mfn = pte_get_mfn(entry);
-    ASSERT(mfn_valid(mfn));
-
-    pg = mfn_to_page(mfn);
-
-    p2m_free_page(p2m, pg);
+    p2m_free_table(p2m, pg);
 }
 
 static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
                                 unsigned int level, unsigned int target,
-                                const unsigned int *offsets)
+                                const unsigned int *offsets,
+                                struct page_info *tbl_pg)
 {
     struct page_info *page;
     unsigned long i;
@@ -756,6 +884,14 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
     unsigned int next_level = level - 1;
     unsigned int level_order = P2M_LEVEL_ORDER(next_level);
 
+    struct p2m_pte_ctx p2m_pte_ctx = {
+        .p2m = p2m,
+        .level = level,
+    };
+
+    /* Init with p2m_invalid just to make compiler happy. */
+    p2m_type_t old_type = p2m_invalid;
+
     /*
      * This should only be called with target != level and the entry is
      * a superpage.
@@ -777,6 +913,17 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
 
     table = __map_domain_page(page);
 
+    if ( MASK_EXTR(entry->pte, P2M_TYPE_PTE_BITS_MASK) == p2m_ext_storage )
+    {
+        p2m_pte_ctx.pt_page = tbl_pg;
+        p2m_pte_ctx.index = offsets[level];
+
+        old_type = p2m_get_type(*entry, &p2m_pte_ctx);
+    }
+
+    p2m_pte_ctx.pt_page = page;
+    p2m_pte_ctx.level = next_level;
+
     for ( i = 0; i < P2M_PAGETABLE_ENTRIES(p2m, next_level); i++ )
     {
         pte_t *new_entry = table + i;
@@ -788,6 +935,13 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
         pte = *entry;
         pte_set_mfn(&pte, mfn_add(mfn, i << level_order));
 
+        if ( MASK_EXTR(pte.pte, P2M_TYPE_PTE_BITS_MASK) == p2m_ext_storage )
+        {
+            p2m_pte_ctx.index = i;
+
+            p2m_set_type(&pte, old_type, &p2m_pte_ctx);
+        }
+
         write_pte(new_entry, pte);
     }
 
@@ -799,7 +953,7 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
      */
     if ( next_level != target )
         rv = p2m_split_superpage(p2m, table + offsets[next_level],
-                                 next_level, target, offsets);
+                                 next_level, target, offsets, page);
 
     if ( p2m->clean_dcache )
         clean_dcache_va_range(table, PAGE_SIZE);
@@ -840,6 +994,9 @@ static int p2m_set_entry(struct p2m_domain *p2m,
      * are still allowed.
      */
     bool removing_mapping = mfn_eq(mfn, INVALID_MFN);
+    struct p2m_pte_ctx tmp_ctx = {
+        .p2m = p2m,
+    };
     P2M_BUILD_LEVEL_OFFSETS(p2m, offsets, gfn_to_gaddr(gfn));
 
     ASSERT(p2m_is_write_locked(p2m));
@@ -890,13 +1047,19 @@ static int p2m_set_entry(struct p2m_domain *p2m,
     {
         /* We need to split the original page. */
         pte_t split_pte = *entry;
+        struct page_info *tbl_pg = mfn_to_page(domain_page_map_to_mfn(table));
 
         ASSERT(pte_is_superpage(*entry, level));
 
-        if ( !p2m_split_superpage(p2m, &split_pte, level, target, offsets) )
+        if ( !p2m_split_superpage(p2m, &split_pte, level, target, offsets,
+                                  tbl_pg) )
         {
+            tmp_ctx.pt_page = tbl_pg;
+            tmp_ctx.index = offsets[level];
+            tmp_ctx.level = level;
+
             /* Free the allocated sub-tree */
-            p2m_free_subtree(p2m, split_pte, level);
+            p2m_free_subtree(p2m, split_pte, &tmp_ctx);
 
             rc = -ENOMEM;
             goto out;
@@ -922,6 +1085,10 @@ static int p2m_set_entry(struct p2m_domain *p2m,
         entry = table + offsets[level];
     }
 
+    tmp_ctx.pt_page = mfn_to_page(domain_page_map_to_mfn(table));
+    tmp_ctx.index = offsets[level];
+    tmp_ctx.level = level;
+
     /*
      * We should always be there with the correct level because all the
      * intermediate tables have been installed if necessary.
@@ -934,7 +1101,7 @@ static int p2m_set_entry(struct p2m_domain *p2m,
         p2m_clean_pte(entry, p2m->clean_dcache);
     else
     {
-        pte_t pte = p2m_pte_from_mfn(mfn, t, false);
+        pte_t pte = p2m_pte_from_mfn(mfn, t, &tmp_ctx);
 
         p2m_write_pte(entry, pte, p2m->clean_dcache);
 
@@ -970,7 +1137,7 @@ static int p2m_set_entry(struct p2m_domain *p2m,
     if ( pte_is_valid(orig_pte) &&
          (!pte_is_valid(*entry) ||
           !mfn_eq(pte_get_mfn(*entry), pte_get_mfn(orig_pte))) )
-        p2m_free_subtree(p2m, orig_pte, level);
+        p2m_free_subtree(p2m, orig_pte, &tmp_ctx);
 
  out:
     unmap_domain_page(table);
@@ -1171,7 +1338,14 @@ static mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
 
     if ( pte_is_valid(entry) )
     {
-        *t = p2m_get_type(entry);
+        struct p2m_pte_ctx p2m_pte_ctx = {
+            .pt_page = mfn_to_page(domain_page_map_to_mfn(table)),
+            .index = offsets[level],
+            .level = level,
+            .p2m = p2m,
+        };
+
+        *t = p2m_get_type(entry, &p2m_pte_ctx);
 
         mfn = pte_get_mfn(entry);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 13:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 13:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200253.1516245 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI34-0001Oy-Fj; Mon, 12 Jan 2026 13:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200253.1516245; Mon, 12 Jan 2026 13:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI34-0001Oo-CR; Mon, 12 Jan 2026 13:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1200253;
 Mon, 12 Jan 2026 13:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vfI32-0001Og-F7
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 13:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfI32-0004yR-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfI32-000EqI-17
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=gWQjVXOBFFdDFxC3SlllxiqmffCqP3mVGYdyXDvzZqs=; b=v1rFdGbpIHr3fe2O/WWzfi1tLh
	KHEwhs0tyAiEhbGe5xl6PKzhHSr8h5FHvqtiyKRuQjJjUgz9FfY9BtSuDDc+WerJKf3ly0cvgCyMu
	dP+UMmMoHB6r/dNBB2YeygDxxA64f7JJMm7i7MiXz5KuqY9+r1yw8upH0Do55XcrQJj0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: update p2m_set_entry() to free unused metadata pages
Message-Id: <E1vfI32-000EqI-17@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 13:33:32 +0000

commit 10551774459e4fd30780dca435a41073c49667b8
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Jan 12 13:07:06 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:07:06 2026 +0100

    xen/riscv: update p2m_set_entry() to free unused metadata pages
    
    Introduce tracking of metadata page entries usage and if all of them are
    p2m_invalid then free them.
    
    Intermediate P2M page tables are allocated with MEMF_no_owner, so we are free
    to repurpose struct page_info fields for them. Since page_info.u.* is not
    used for such pages, introduce a used_entries counter in struct page_info
    to track how many metadata entries are in use for a given intermediate P2M
    page table.
    
    The counter is updated in p2m_set_type() when metadata entries transition
    between p2m_invalid and a valid external type. When the last metadata entry
    is cleared (used_entries == 0), the associated metadata page is freed and
    returned to the P2M pool.
    
    Refactor metadata page freeing into a new helper, p2m_free_metadata_page(),
    as the same logic is needed both when tearing down a P2M table and when
    all metadata entries become p2m_invalid in p2m_set_type(). As part of this
    refactoring, move the declaration of p2m_free_page() earlier to satisfy the
    new helper.
    
    Additionally, implement page_set_tlbflush_timestamp() for RISC-V instead of
    BUGing, as it is invoked when returning memory to the domheap.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/flushtlb.h |  2 +-
 xen/arch/riscv/include/asm/mm.h       | 12 ++++++++++++
 xen/arch/riscv/p2m.c                  | 32 +++++++++++++++++++++++++-------
 3 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index ab32311568..4f64f97570 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -38,7 +38,7 @@ static inline void tlbflush_filter(cpumask_t *mask, uint32_t page_timestamp) {}
 
 static inline void page_set_tlbflush_timestamp(struct page_info *page)
 {
-    BUG_ON("unimplemented");
+    page->tlbflush_timestamp = tlbflush_current_time();
 }
 
 static inline void arch_flush_tlb_mask(const cpumask_t *mask)
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 48162f5d65..a005d0247a 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -113,6 +113,18 @@ struct page_info
             unsigned long type_info;
         } inuse;
 
+        /* Page is used as an intermediate P2M page table: count_info == 0 */
+        struct {
+            /*
+            * Tracks the number of used entries in the metadata page table.
+            *
+            * If used_entries == 0, then `page_info.v.md.pg` can be freed and
+            * returned to the P2M pool.
+            */
+            unsigned long used_entries;
+        } md;
+
+
         /* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
         union {
             struct {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index c40ea483a7..0abeb374c1 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -51,6 +51,18 @@ static struct gstage_mode_desc __ro_after_init max_gstage_mode = {
     .name = "Bare",
 };
 
+static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
+
+static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
+                                          struct page_info **md_pg)
+{
+    if ( *md_pg )
+    {
+        p2m_free_page(p2m, *md_pg);
+        *md_pg = NULL;
+    }
+}
+
 unsigned char get_max_supported_mode(void)
 {
     return max_gstage_mode.mode;
@@ -448,16 +460,27 @@ static void p2m_set_type(pte_t *pte, p2m_type_t t,
 
     if ( t >= p2m_first_external )
     {
+        if ( metadata[ctx->index].type == p2m_invalid )
+            ctx->pt_page->u.md.used_entries++;
+
         metadata[ctx->index].type = t;
 
         t = p2m_ext_storage;
     }
     else if ( metadata )
+    {
+        if ( metadata[ctx->index].type != p2m_invalid )
+            ctx->pt_page->u.md.used_entries--;
+
         metadata[ctx->index].type = p2m_invalid;
+    }
 
     pte->pte |= MASK_INSR(t, P2M_TYPE_PTE_BITS_MASK);
 
     unmap_domain_page(metadata);
+
+    if ( *md_pg && !ctx->pt_page->u.md.used_entries )
+        p2m_free_metadata_page(ctx->p2m, md_pg);
 }
 
 /*
@@ -624,18 +647,13 @@ static pte_t page_to_p2m_table(const struct page_info *page)
     return p2m_pte_from_mfn(page_to_mfn(page), p2m_invalid, NULL);
 }
 
-static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
-
 /*
  * Free page table's page and metadata page linked to page table's page.
  */
 static void p2m_free_table(struct p2m_domain *p2m, struct page_info *tbl_pg)
 {
-    if ( tbl_pg->v.md.pg )
-    {
-        p2m_free_page(p2m, tbl_pg->v.md.pg);
-        tbl_pg->v.md.pg = NULL;
-    }
+    p2m_free_metadata_page(p2m, &tbl_pg->v.md.pg);
+
     p2m_free_page(p2m, tbl_pg);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 13:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 13:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200254.1516247 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfI3E-0001RB-GR; Mon, 12 Jan 2026 13:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200254.1516247; Mon, 12 Jan 2026 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 1vfI3E-0001R3-Dl; Mon, 12 Jan 2026 13:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1200254;
 Mon, 12 Jan 2026 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 1vfI3C-0001Qr-G7
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfI3C-0004yV-2b
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfI3C-000Er6-1Q
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=5vZugJ5yRrLMsPzf/w96Uy+MP01ntgO6093EqsQSONo=; b=bu8onZYQOfqL4p8w7Nd5JGhMen
	khgF67GTFa9ZJND9AWEjsUECUvhHN4Npr0felV/1C+KCjn+8zo4FYlQXHH+rSfkZOUysCHTi2u/Gj
	4e4FT+gZ3MbneZH5hO8rX2vJU5va/KgJcyi/W3Hzsm1HO4Kl56s3ijQ03JGUZJbv/arQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: fix incorrect return value for has_if_pschange_mc
Message-Id: <E1vfI3C-000Er6-1Q@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 13:33:42 +0000

commit a2a34d76643e49ccc949296c9a45888034e50b55
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Mon Jan 12 13:07:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:07:36 2026 +0100

    x86: fix incorrect return value for has_if_pschange_mc
    
    The Atom block used to fall through into the Phi block to get to it's
    return false, and this was accidentally dropped with the Phi removal.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f4beac192d..b1c37268da 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3115,6 +3115,7 @@ static bool __init has_if_pschange_mc(void)
     case 0x75: /* Lightning Mountain */
     case 0x7a: /* Gemini Lake */
     case 0x86: /* Jacobsville */
+        return false;
 
     default:
         printk("Unrecognised CPU model %#x - assuming vulnerable to IF_PSCHANGE_MC\n",
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 14:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 14:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200399.1516333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9I-0005XB-2O; Mon, 12 Jan 2026 14:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200399.1516333; Mon, 12 Jan 2026 14:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9H-0005Wi-VU; Mon, 12 Jan 2026 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1200399;
 Mon, 12 Jan 2026 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 1vfJ9G-0005W6-CX
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfJ9G-0006He-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfJ9G-000Iwy-0w
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 14:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AvWnHyI0+CQI40lonJB1a+UZ6iBG3w0pnvxwpS1VSS8=; b=tG1MPqGuyGdMzqGr9wcc9v6IfF
	H1SHz6Gi7TLjxs3KVKyRMRDd+lJZGSS2d2Zw71EZsOqm7j7m53Zjrz6lvQSIQ/Br2cv5kvV3Q7cBZ
	DdRR1vmnAKECoYAylEqTNalbkIq4TPh7rCHQ5+B/0SsUa8Igc/TXPzTNaFt4QMMJIP/o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xenpm: Don't build outside of x86
Message-Id: <E1vfJ9G-000Iwy-0w@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 14:44:02 +0000

commit 684897241447de6df28e6b59961418ae4cf05e32
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Mon Jan 12 13:04:08 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:04:08 2026 +0100

    xenpm: Don't build outside of x86
    
    xenpm doesn't provide any interesting usable features outside of x86,
    skip building it if we are not x86.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 CHANGELOG.md        | 3 +++
 tools/misc/Makefile | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1663f6878e..7de34f64d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
 
+ - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
+   anything useful outside of x86.
+
 ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
 
 ### Changed
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index c26e544e83..6ee783f43e 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -29,7 +29,7 @@ INSTALL_SBIN                   += xencov
 INSTALL_SBIN                   += xenhypfs
 INSTALL_SBIN                   += xenlockprof
 INSTALL_SBIN                   += xenperf
-INSTALL_SBIN                   += xenpm
+INSTALL_SBIN-$(CONFIG_X86)     += xenpm
 INSTALL_SBIN                   += xenwatchdogd
 INSTALL_SBIN                   += xen-access
 INSTALL_SBIN                   += xen-livepatch
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 14:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 14:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200405.1516338 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9S-0005hK-4J; Mon, 12 Jan 2026 14:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200405.1516338; Mon, 12 Jan 2026 14:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9S-0005hB-0g; Mon, 12 Jan 2026 14:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1200405;
 Mon, 12 Jan 2026 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 1vfJ9Q-0005fG-Fb
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfJ9Q-0006Hi-2Y
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfJ9Q-000IyJ-1J
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=9PzGdOFJoBWw1xQaoyph1FYoEUfL2EEveyhhOD6xTOY=; b=YfWSXNICc6X/zyW5J5PaUyN/tQ
	ngmubm3Bgy3vM9YtGusScNXFRxTHSedhVE8LG6MhnMeLDD6yQ/pfWXApXZlUitTrVSxLycYyGStg6
	4raf7b0BnAqSMmtrYKZMa7Gytn6X+REtpKArh3/nLcZJw7ASFEP2kFg6nH+aL+HlOMP0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add support of page lookup by GFN
Message-Id: <E1vfJ9Q-000IyJ-1J@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 14:44:12 +0000

commit 27fe81330553ac5edab4ca8ab5435cb0a36e5b1f
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Jan 12 13:06:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:06:14 2026 +0100

    xen/riscv: add support of page lookup by GFN
    
    Introduce helper functions for safely querying the P2M (physical-to-machine)
    mapping:
     - add p2m_read_lock(), p2m_read_unlock(), and p2m_is_locked() for managing
       P2M lock state.
     - Implement p2m_get_entry() to retrieve mapping details for a given GFN,
       including MFN, page order, and validity.
     - Introduce p2m_get_page_from_gfn() to convert a GFN into a page_info
       pointer, acquiring a reference to the page if valid.
     - Introduce get_page().
    
    Implementations are based on Arm's functions with some minor modifications:
    - p2m_get_entry():
      - Reverse traversal of page tables, as RISC-V uses the opposite level
        numbering compared to Arm.
      - Removed the return of p2m_access_t from p2m_get_entry() since
        mem_access_settings is not introduced for RISC-V.
      - Updated BUILD_BUG_ON() to check using the level 0 mask, which corresponds
        to Arm's THIRD_MASK.
      - Replaced open-coded bit shifts with the BIT() macro.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/p2m.h |  21 +++++
 xen/arch/riscv/mm.c              |  13 +++
 xen/arch/riscv/p2m.c             | 185 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 219 insertions(+)

diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index b48693a2b4..f63b5dec99 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -41,6 +41,9 @@
 
 #define P2M_GFN_LEVEL_SHIFT(lvl) (P2M_LEVEL_ORDER(lvl) + PAGE_SHIFT)
 
+#define P2M_LEVEL_MASK(p2m, lvl) \
+    (P2M_TABLE_OFFSET(p2m, lvl) << P2M_GFN_LEVEL_SHIFT(lvl))
+
 #define paddr_bits PADDR_BITS
 
 /* Get host p2m table */
@@ -234,6 +237,24 @@ static inline bool p2m_is_write_locked(struct p2m_domain *p2m)
 
 unsigned long construct_hgatp(const struct p2m_domain *p2m, uint16_t vmid);
 
+static inline void p2m_read_lock(struct p2m_domain *p2m)
+{
+    read_lock(&p2m->lock);
+}
+
+static inline void p2m_read_unlock(struct p2m_domain *p2m)
+{
+    read_unlock(&p2m->lock);
+}
+
+static inline bool p2m_is_locked(const struct p2m_domain *p2m)
+{
+    return rw_is_locked(&p2m->lock);
+}
+
+struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
+                                        p2m_type_t *t);
+
 #endif /* ASM__RISCV__P2M_H */
 
 /*
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index e25f995b72..e9ce182d06 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -673,3 +673,16 @@ struct domain *page_get_owner_and_reference(struct page_info *page)
 
     return owner;
 }
+
+bool get_page(struct page_info *page, const struct domain *domain)
+{
+    const struct domain *owner = page_get_owner_and_reference(page);
+
+    if ( likely(owner == domain) )
+        return true;
+
+    if ( owner != NULL )
+        put_page(page);
+
+    return false;
+}
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 8d572f838f..c6de785e4c 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1057,3 +1057,188 @@ int map_regions_p2mt(struct domain *d,
 
     return rc;
 }
+
+/*
+ * p2m_get_entry() should always return the correct order value, even if an
+ * entry is not present (i.e. the GFN is outside the range):
+ *   [p2m->lowest_mapped_gfn, p2m->max_mapped_gfn]    (1)
+ *
+ * This ensures that callers of p2m_get_entry() can determine what range of
+ * address space would be altered by a corresponding p2m_set_entry().
+ * Also, it would help to avoid costly page walks for GFNs outside range (1).
+ *
+ * Therefore, this function returns true for GFNs outside range (1), and in
+ * that case the corresponding level is returned via the level_out argument.
+ * Otherwise, it returns false and p2m_get_entry() performs a page walk to
+ * find the proper entry.
+ */
+static bool check_outside_boundary(const struct p2m_domain *p2m, gfn_t gfn,
+                                   gfn_t boundary, bool is_lower,
+                                   unsigned int *level_out)
+{
+    unsigned int level = P2M_MAX_ROOT_LEVEL + 1;
+    bool ret = false;
+
+    ASSERT(p2m);
+
+    if ( is_lower ? gfn_x(gfn) < gfn_x(boundary)
+                  : gfn_x(gfn) > gfn_x(boundary) )
+    {
+        for ( level = P2M_ROOT_LEVEL(p2m) ; level; level-- )
+        {
+            unsigned long mask = BIT(P2M_GFN_LEVEL_SHIFT(level), UL) - 1;
+
+            if ( is_lower ? (gfn_x(gfn) | mask) < gfn_x(boundary)
+                          : (gfn_x(gfn) & ~mask) > gfn_x(boundary) )
+                break;
+        }
+
+        ret = true;
+    }
+
+    if ( level_out )
+        *level_out = level;
+
+    return ret;
+}
+
+/*
+ * Get the details of a given gfn.
+ *
+ * If the entry is present, the associated MFN, the p2m type of the mapping,
+ * and the page order of the mapping in the page table (i.e., it could be a
+ * superpage) will be returned.
+ *
+ * If the entry is not present, INVALID_MFN will be returned, page_order will
+ * be set according to the order of the invalid range, and the type will be
+ * p2m_invalid.
+ */
+static mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
+                           p2m_type_t *t,
+                           unsigned int *page_order)
+{
+    unsigned int level = P2M_ROOT_LEVEL(p2m);
+    unsigned int gfn_limit_bits =
+        P2M_LEVEL_ORDER(level + 1) + P2M_ROOT_EXTRA_BITS(p2m, level);
+    pte_t entry, *table;
+    int rc;
+    mfn_t mfn = INVALID_MFN;
+
+    P2M_BUILD_LEVEL_OFFSETS(p2m, offsets, gfn_to_gaddr(gfn));
+
+    ASSERT(p2m_is_locked(p2m));
+
+    *t = p2m_invalid;
+
+    if ( gfn_x(gfn) > (BIT(gfn_limit_bits, UL) - 1) )
+    {
+        if ( page_order )
+            *page_order = gfn_limit_bits;
+
+        return mfn;
+    }
+
+    if ( check_outside_boundary(p2m, gfn, p2m->lowest_mapped_gfn, true,
+                                &level) )
+        goto out;
+
+    if ( check_outside_boundary(p2m, gfn, p2m->max_mapped_gfn, false, &level) )
+        goto out;
+
+    table = p2m_get_root_pointer(p2m, gfn);
+
+    /*
+     * The table should always be non-NULL because the gfn is below
+     * p2m->max_mapped_gfn and the root table pages are always present.
+     */
+    if ( !table )
+    {
+        ASSERT_UNREACHABLE();
+        goto out;
+    }
+
+    for ( level = P2M_ROOT_LEVEL(p2m); level; level-- )
+    {
+        rc = p2m_next_level(p2m, false, level, &table, offsets[level]);
+        if ( rc == P2M_TABLE_MAP_NONE )
+            goto out_unmap;
+
+        if ( rc != P2M_TABLE_NORMAL )
+            break;
+    }
+
+    entry = table[offsets[level]];
+
+    if ( pte_is_valid(entry) )
+    {
+        *t = p2m_get_type(entry);
+
+        mfn = pte_get_mfn(entry);
+
+        ASSERT(!(mfn_x(mfn) & (BIT(P2M_LEVEL_ORDER(level), UL) - 1)));
+
+        /*
+         * The entry may point to a superpage. Find the MFN associated
+         * to the GFN.
+         */
+        mfn = mfn_add(mfn,
+                      gfn_x(gfn) & (BIT(P2M_LEVEL_ORDER(level), UL) - 1));
+    }
+
+ out_unmap:
+    unmap_domain_page(table);
+
+ out:
+    if ( page_order )
+        *page_order = P2M_LEVEL_ORDER(level);
+
+    return mfn;
+}
+
+struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
+                                        p2m_type_t *t)
+{
+    struct page_info *page;
+    p2m_type_t p2mt;
+    mfn_t mfn;
+
+    p2m_read_lock(p2m);
+    mfn = p2m_get_entry(p2m, gfn, &p2mt, NULL);
+
+    if ( t )
+        *t = p2mt;
+
+    if ( !mfn_valid(mfn) )
+    {
+        p2m_read_unlock(p2m);
+        return NULL;
+    }
+
+    page = mfn_to_page(mfn);
+
+    /*
+     * get_page won't work on foreign mapping because the page doesn't
+     * belong to the current domain.
+     */
+    if ( unlikely(p2m_is_foreign(p2mt)) )
+    {
+        const struct domain *fdom = page_get_owner_and_reference(page);
+
+        p2m_read_unlock(p2m);
+
+        if ( fdom )
+        {
+            if ( likely(fdom != p2m->domain) )
+                return page;
+
+            ASSERT_UNREACHABLE();
+            put_page(page);
+        }
+
+        return NULL;
+    }
+
+    p2m_read_unlock(p2m);
+
+    return get_page(page, p2m->domain) ? page : NULL;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 14:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 14:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200408.1516340 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9c-0005nt-5J; Mon, 12 Jan 2026 14:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200408.1516340; Mon, 12 Jan 2026 14:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9c-0005nl-27; Mon, 12 Jan 2026 14:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1200408;
 Mon, 12 Jan 2026 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 1vfJ9a-0005nA-Iq
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfJ9a-0006I7-2s
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfJ9a-000J0C-1d
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=CyNyRmGk79W3qRGhyv7tDz8VdMFWuA18FpvSsgakfqQ=; b=mYmdpHTAUkQyUtFrphRXymr0Jg
	wQsbfdl/hT+7Fv5XMOwbDTG2+YYsWNUFCrFVw4OIpQh27zk3jvXFZ1gUsunB/f/cXVSYUyvhcPGBS
	ub2DRY8NBsFQ+HQejleZDsobPZSkOZAqpnxqCPnTrAUAIyBBboRaH4F3oWkntJdDnZM0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: introduce metadata table to store P2M type
Message-Id: <E1vfJ9a-000J0C-1d@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 14:44:22 +0000

commit df31e3163d6e7a1b8b3287187b43f06458df0ada
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Jan 12 13:06:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:06:49 2026 +0100

    xen/riscv: introduce metadata table to store P2M type
    
    RISC-V's PTE has only two available bits that can be used to store the P2M
    type. This is insufficient to represent all the current RISC-V P2M types.
    Therefore, some P2M types must be stored outside the PTE bits.
    
    To address this, a metadata table is introduced to store P2M types that
    cannot fit in the PTE itself. Not all P2M types are stored in the
    metadata table—only those that require it.
    
    The metadata table is linked to the intermediate page table via the
    `struct page_info`'s v.md.metadata field of the corresponding intermediate
    page.
    Such pages are allocated with MEMF_no_owner, which allows us to use
    the v field for the purpose of storing the metadata table.
    
    To simplify the allocation and linking of intermediate and metadata page
    tables, `p2m_{alloc,free}_table()` functions are implemented.
    
    These changes impact `p2m_split_superpage()`, since when a superpage is
    split, it is necessary to update the metadata table of the new
    intermediate page table — if the entry being split has its P2M type set
    to `p2m_ext_storage` in its `P2M_TYPES` bits. In addition to updating
    the metadata of the new intermediate page table, the corresponding entry
    in the metadata for the original superpage is invalidated.
    
    Also, update p2m_{get,set}_type to work with P2M types which don't fit
    into PTE bits.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/mm.h |   9 ++
 xen/arch/riscv/p2m.c            | 234 ++++++++++++++++++++++++++++++++++------
 2 files changed, 213 insertions(+), 30 deletions(-)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 1a99e1cf0a..48162f5d65 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -149,6 +149,15 @@ struct page_info
             /* Order-size of the free chunk this page is the head of. */
             unsigned int order;
         } free;
+
+        /* Page is used as an intermediate P2M page table */
+        struct {
+            /*
+             * Pointer to a page which store metadata for an intermediate page
+             * table.
+             */
+            struct page_info *pg;
+        } md;
     } v;
 
     union {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index c6de785e4c..c40ea483a7 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -26,6 +26,25 @@
  */
 #define P2M_MAX_SUPPORTED_LEVEL_MAPPING _AC(2, U)
 
+struct md_t {
+    /*
+     * Describes a type stored outside PTE bits.
+     * Look at the comment above definition of enum p2m_type_t.
+     */
+    p2m_type_t type : 4;
+};
+
+/*
+ * P2M PTE context is used only when a PTE's P2M type is p2m_ext_storage.
+ * In this case, the P2M type is stored separately in the metadata page.
+ */
+struct p2m_pte_ctx {
+    struct p2m_domain *p2m;
+    struct page_info *pt_page;   /* Page table page containing the PTE. */
+    unsigned int index;          /* Index of the PTE within that page. */
+    unsigned int level;          /* Paging level at which the PTE resides. */
+};
+
 static struct gstage_mode_desc __ro_after_init max_gstage_mode = {
     .mode = HGATP_MODE_OFF,
     .paging_levels = 0,
@@ -37,6 +56,10 @@ unsigned char get_max_supported_mode(void)
     return max_gstage_mode.mode;
 }
 
+/*
+ * If anything is changed here, it may also require updates to
+ * p2m_{get,set}_type().
+ */
 static inline unsigned int calc_offset(const struct p2m_domain *p2m,
                                        const unsigned int lvl,
                                        const paddr_t gpa)
@@ -79,6 +102,9 @@ static inline unsigned int calc_offset(const struct p2m_domain *p2m,
  * The caller is responsible for unmapping the page after use.
  *
  * Returns NULL if the calculated offset into the root table is invalid.
+ *
+ * If anything is changed here, it may also require updates to
+ * p2m_{get,set}_type().
  */
 static pte_t *p2m_get_root_pointer(struct p2m_domain *p2m, gfn_t gfn)
 {
@@ -370,24 +396,94 @@ static struct page_info *p2m_alloc_page(struct p2m_domain *p2m)
     return pg;
 }
 
-static int p2m_set_type(pte_t *pte, p2m_type_t t)
+/*
+ * `pte` – PTE entry for which the type `t` will be stored.
+ *
+ * If `t` >= p2m_first_external, a valid `ctx` must be provided.
+ */
+static void p2m_set_type(pte_t *pte, p2m_type_t t,
+                         const struct p2m_pte_ctx *ctx)
 {
-    int rc = 0;
+    struct page_info **md_pg;
+    struct md_t *metadata = NULL;
 
-    if ( t > p2m_first_external )
-        panic("unimplemeted\n");
-    else
-        pte->pte |= MASK_INSR(t, P2M_TYPE_PTE_BITS_MASK);
+    /*
+     * It is sufficient to compare ctx->index with PAGETABLE_ENTRIES because,
+     * even for the p2m root page table (which is a 16 KB page allocated as
+     * four 4 KB pages), calc_offset() guarantees that the page-table index
+     * will always fall within the range [0, 511].
+     */
+    ASSERT(ctx && ctx->index < PAGETABLE_ENTRIES && ctx->p2m);
 
-    return rc;
+    /*
+     * At the moment, p2m_get_root_pointer() returns one of four possible p2m
+     * root pages, so there is no need to search for the correct ->pt_page
+     * here.
+     * Non-root page tables are 4 KB pages, so simply using ->pt_page is
+     * sufficient.
+     */
+    md_pg = &ctx->pt_page->v.md.pg;
+
+    if ( !*md_pg && (t >= p2m_first_external) )
+    {
+        /*
+         * Since p2m_alloc_page() initializes an allocated page with
+         * zeros, p2m_invalid is expected to have the value 0 as well.
+         */
+        BUILD_BUG_ON(p2m_invalid);
+
+        *md_pg = p2m_alloc_page(ctx->p2m);
+        if ( !*md_pg )
+        {
+            printk("%pd: can't allocate metadata page\n",
+                    ctx->p2m->domain);
+            domain_crash(ctx->p2m->domain);
+
+            return;
+        }
+    }
+
+    if ( *md_pg )
+        metadata = __map_domain_page(*md_pg);
+
+    if ( t >= p2m_first_external )
+    {
+        metadata[ctx->index].type = t;
+
+        t = p2m_ext_storage;
+    }
+    else if ( metadata )
+        metadata[ctx->index].type = p2m_invalid;
+
+    pte->pte |= MASK_INSR(t, P2M_TYPE_PTE_BITS_MASK);
+
+    unmap_domain_page(metadata);
 }
 
-static p2m_type_t p2m_get_type(const pte_t pte)
+/*
+ * `pte` -> PTE entry that stores the PTE's type.
+ *
+ * If the PTE's type is `p2m_ext_storage`, `ctx` should be provided;
+ * otherwise it could be NULL.
+ */
+static p2m_type_t p2m_get_type(const pte_t pte, const struct p2m_pte_ctx *ctx)
 {
     p2m_type_t type = MASK_EXTR(pte.pte, P2M_TYPE_PTE_BITS_MASK);
 
     if ( type == p2m_ext_storage )
-        panic("unimplemented\n");
+    {
+        const struct md_t *md = __map_domain_page(ctx->pt_page->v.md.pg);
+
+        type = md[ctx->index].type;
+
+        /*
+         * Since p2m_set_type() guarantees that the type will be greater than
+         * p2m_first_external, just check that we received a valid type here.
+         */
+        ASSERT(type > p2m_first_external);
+
+        unmap_domain_page(md);
+    }
 
     return type;
 }
@@ -477,7 +573,14 @@ static void p2m_set_permission(pte_t *e, p2m_type_t t)
     }
 }
 
-static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t, bool is_table)
+/*
+ * If p2m_pte_from_mfn() is called with ctx = NULL,
+ * it means the function is working with a page table for which the `t`
+ * should not be applicable. Otherwise, the function is handling a leaf PTE
+ * for which `t` is applicable.
+ */
+static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t,
+                              struct p2m_pte_ctx *ctx)
 {
     pte_t e = (pte_t) { PTE_VALID };
 
@@ -485,7 +588,7 @@ static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t, bool is_table)
 
     ASSERT(!(mfn_to_maddr(mfn) & ~PADDR_MASK) || mfn_eq(mfn, INVALID_MFN));
 
-    if ( !is_table )
+    if ( ctx )
     {
         switch ( t )
         {
@@ -498,7 +601,7 @@ static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t, bool is_table)
         }
 
         p2m_set_permission(&e, t);
-        p2m_set_type(&e, t);
+        p2m_set_type(&e, t, ctx);
     }
     else
         /*
@@ -518,7 +621,22 @@ static pte_t page_to_p2m_table(const struct page_info *page)
      * set to true and p2m_type_t shouldn't be applied for PTEs which
      * describe an intermediate table.
      */
-    return p2m_pte_from_mfn(page_to_mfn(page), p2m_invalid, true);
+    return p2m_pte_from_mfn(page_to_mfn(page), p2m_invalid, NULL);
+}
+
+static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
+
+/*
+ * Free page table's page and metadata page linked to page table's page.
+ */
+static void p2m_free_table(struct p2m_domain *p2m, struct page_info *tbl_pg)
+{
+    if ( tbl_pg->v.md.pg )
+    {
+        p2m_free_page(p2m, tbl_pg->v.md.pg);
+        tbl_pg->v.md.pg = NULL;
+    }
+    p2m_free_page(p2m, tbl_pg);
 }
 
 /* Allocate a new page table page and hook it in via the given entry. */
@@ -679,12 +797,14 @@ static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg)
 
 /* Free pte sub-tree behind an entry */
 static void p2m_free_subtree(struct p2m_domain *p2m,
-                             pte_t entry, unsigned int level)
+                             pte_t entry,
+                             const struct p2m_pte_ctx *ctx)
 {
     unsigned int i;
     pte_t *table;
     mfn_t mfn;
     struct page_info *pg;
+    unsigned int level = ctx->level;
 
     /*
      * Check if the level is valid: only 4K - 2M - 1G mappings are supported.
@@ -700,7 +820,7 @@ static void p2m_free_subtree(struct p2m_domain *p2m,
 
     if ( pte_is_mapping(entry) )
     {
-        p2m_type_t p2mt = p2m_get_type(entry);
+        p2m_type_t p2mt = p2m_get_type(entry, ctx);
 
 #ifdef CONFIG_IOREQ_SERVER
         /*
@@ -719,10 +839,22 @@ static void p2m_free_subtree(struct p2m_domain *p2m,
         return;
     }
 
-    table = map_domain_page(pte_get_mfn(entry));
+    mfn = pte_get_mfn(entry);
+    ASSERT(mfn_valid(mfn));
+    table = map_domain_page(mfn);
+    pg = mfn_to_page(mfn);
 
     for ( i = 0; i < P2M_PAGETABLE_ENTRIES(p2m, level); i++ )
-        p2m_free_subtree(p2m, table[i], level - 1);
+    {
+        struct p2m_pte_ctx tmp_ctx = {
+            .pt_page = pg,
+            .index = i,
+            .level = level - 1,
+            .p2m = p2m,
+        };
+
+        p2m_free_subtree(p2m, table[i], &tmp_ctx);
+    }
 
     unmap_domain_page(table);
 
@@ -734,17 +866,13 @@ static void p2m_free_subtree(struct p2m_domain *p2m,
      */
     p2m_tlb_flush_sync(p2m);
 
-    mfn = pte_get_mfn(entry);
-    ASSERT(mfn_valid(mfn));
-
-    pg = mfn_to_page(mfn);
-
-    p2m_free_page(p2m, pg);
+    p2m_free_table(p2m, pg);
 }
 
 static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
                                 unsigned int level, unsigned int target,
-                                const unsigned int *offsets)
+                                const unsigned int *offsets,
+                                struct page_info *tbl_pg)
 {
     struct page_info *page;
     unsigned long i;
@@ -756,6 +884,14 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
     unsigned int next_level = level - 1;
     unsigned int level_order = P2M_LEVEL_ORDER(next_level);
 
+    struct p2m_pte_ctx p2m_pte_ctx = {
+        .p2m = p2m,
+        .level = level,
+    };
+
+    /* Init with p2m_invalid just to make compiler happy. */
+    p2m_type_t old_type = p2m_invalid;
+
     /*
      * This should only be called with target != level and the entry is
      * a superpage.
@@ -777,6 +913,17 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
 
     table = __map_domain_page(page);
 
+    if ( MASK_EXTR(entry->pte, P2M_TYPE_PTE_BITS_MASK) == p2m_ext_storage )
+    {
+        p2m_pte_ctx.pt_page = tbl_pg;
+        p2m_pte_ctx.index = offsets[level];
+
+        old_type = p2m_get_type(*entry, &p2m_pte_ctx);
+    }
+
+    p2m_pte_ctx.pt_page = page;
+    p2m_pte_ctx.level = next_level;
+
     for ( i = 0; i < P2M_PAGETABLE_ENTRIES(p2m, next_level); i++ )
     {
         pte_t *new_entry = table + i;
@@ -788,6 +935,13 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
         pte = *entry;
         pte_set_mfn(&pte, mfn_add(mfn, i << level_order));
 
+        if ( MASK_EXTR(pte.pte, P2M_TYPE_PTE_BITS_MASK) == p2m_ext_storage )
+        {
+            p2m_pte_ctx.index = i;
+
+            p2m_set_type(&pte, old_type, &p2m_pte_ctx);
+        }
+
         write_pte(new_entry, pte);
     }
 
@@ -799,7 +953,7 @@ static bool p2m_split_superpage(struct p2m_domain *p2m, pte_t *entry,
      */
     if ( next_level != target )
         rv = p2m_split_superpage(p2m, table + offsets[next_level],
-                                 next_level, target, offsets);
+                                 next_level, target, offsets, page);
 
     if ( p2m->clean_dcache )
         clean_dcache_va_range(table, PAGE_SIZE);
@@ -840,6 +994,9 @@ static int p2m_set_entry(struct p2m_domain *p2m,
      * are still allowed.
      */
     bool removing_mapping = mfn_eq(mfn, INVALID_MFN);
+    struct p2m_pte_ctx tmp_ctx = {
+        .p2m = p2m,
+    };
     P2M_BUILD_LEVEL_OFFSETS(p2m, offsets, gfn_to_gaddr(gfn));
 
     ASSERT(p2m_is_write_locked(p2m));
@@ -890,13 +1047,19 @@ static int p2m_set_entry(struct p2m_domain *p2m,
     {
         /* We need to split the original page. */
         pte_t split_pte = *entry;
+        struct page_info *tbl_pg = mfn_to_page(domain_page_map_to_mfn(table));
 
         ASSERT(pte_is_superpage(*entry, level));
 
-        if ( !p2m_split_superpage(p2m, &split_pte, level, target, offsets) )
+        if ( !p2m_split_superpage(p2m, &split_pte, level, target, offsets,
+                                  tbl_pg) )
         {
+            tmp_ctx.pt_page = tbl_pg;
+            tmp_ctx.index = offsets[level];
+            tmp_ctx.level = level;
+
             /* Free the allocated sub-tree */
-            p2m_free_subtree(p2m, split_pte, level);
+            p2m_free_subtree(p2m, split_pte, &tmp_ctx);
 
             rc = -ENOMEM;
             goto out;
@@ -922,6 +1085,10 @@ static int p2m_set_entry(struct p2m_domain *p2m,
         entry = table + offsets[level];
     }
 
+    tmp_ctx.pt_page = mfn_to_page(domain_page_map_to_mfn(table));
+    tmp_ctx.index = offsets[level];
+    tmp_ctx.level = level;
+
     /*
      * We should always be there with the correct level because all the
      * intermediate tables have been installed if necessary.
@@ -934,7 +1101,7 @@ static int p2m_set_entry(struct p2m_domain *p2m,
         p2m_clean_pte(entry, p2m->clean_dcache);
     else
     {
-        pte_t pte = p2m_pte_from_mfn(mfn, t, false);
+        pte_t pte = p2m_pte_from_mfn(mfn, t, &tmp_ctx);
 
         p2m_write_pte(entry, pte, p2m->clean_dcache);
 
@@ -970,7 +1137,7 @@ static int p2m_set_entry(struct p2m_domain *p2m,
     if ( pte_is_valid(orig_pte) &&
          (!pte_is_valid(*entry) ||
           !mfn_eq(pte_get_mfn(*entry), pte_get_mfn(orig_pte))) )
-        p2m_free_subtree(p2m, orig_pte, level);
+        p2m_free_subtree(p2m, orig_pte, &tmp_ctx);
 
  out:
     unmap_domain_page(table);
@@ -1171,7 +1338,14 @@ static mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
 
     if ( pte_is_valid(entry) )
     {
-        *t = p2m_get_type(entry);
+        struct p2m_pte_ctx p2m_pte_ctx = {
+            .pt_page = mfn_to_page(domain_page_map_to_mfn(table)),
+            .index = offsets[level],
+            .level = level,
+            .p2m = p2m,
+        };
+
+        *t = p2m_get_type(entry, &p2m_pte_ctx);
 
         mfn = pte_get_mfn(entry);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 14:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 14:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200411.1516347 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9m-0005tV-8b; Mon, 12 Jan 2026 14:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200411.1516347; Mon, 12 Jan 2026 14:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9m-0005tM-5F; Mon, 12 Jan 2026 14:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1200411;
 Mon, 12 Jan 2026 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 1vfJ9k-0005sw-Ll
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 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 1vfJ9k-0006ID-3A
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfJ9k-000J1y-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 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=2MzZt2obnTKck2lgegdETaixABwF0jSW7zkXF1zamX0=; b=6ai78nTJmZbdNXNF3zmStaylpv
	fxJGO7A+PC86HMcOQ6G5pYkh1JXdceFaJ8+oHeyRv5/OpOIPvSWahfqHXYwdcARahKTolPKJ//znb
	neYI3TOQIsUG2W3PdTJh1LMREJyVqUnyBjGTy9ZZVlXdvt2dgu4eUu1BYv0KUd6rvx0Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: update p2m_set_entry() to free unused metadata pages
Message-Id: <E1vfJ9k-000J1y-1y@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 14:44:32 +0000

commit 10551774459e4fd30780dca435a41073c49667b8
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Jan 12 13:07:06 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:07:06 2026 +0100

    xen/riscv: update p2m_set_entry() to free unused metadata pages
    
    Introduce tracking of metadata page entries usage and if all of them are
    p2m_invalid then free them.
    
    Intermediate P2M page tables are allocated with MEMF_no_owner, so we are free
    to repurpose struct page_info fields for them. Since page_info.u.* is not
    used for such pages, introduce a used_entries counter in struct page_info
    to track how many metadata entries are in use for a given intermediate P2M
    page table.
    
    The counter is updated in p2m_set_type() when metadata entries transition
    between p2m_invalid and a valid external type. When the last metadata entry
    is cleared (used_entries == 0), the associated metadata page is freed and
    returned to the P2M pool.
    
    Refactor metadata page freeing into a new helper, p2m_free_metadata_page(),
    as the same logic is needed both when tearing down a P2M table and when
    all metadata entries become p2m_invalid in p2m_set_type(). As part of this
    refactoring, move the declaration of p2m_free_page() earlier to satisfy the
    new helper.
    
    Additionally, implement page_set_tlbflush_timestamp() for RISC-V instead of
    BUGing, as it is invoked when returning memory to the domheap.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/flushtlb.h |  2 +-
 xen/arch/riscv/include/asm/mm.h       | 12 ++++++++++++
 xen/arch/riscv/p2m.c                  | 32 +++++++++++++++++++++++++-------
 3 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index ab32311568..4f64f97570 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -38,7 +38,7 @@ static inline void tlbflush_filter(cpumask_t *mask, uint32_t page_timestamp) {}
 
 static inline void page_set_tlbflush_timestamp(struct page_info *page)
 {
-    BUG_ON("unimplemented");
+    page->tlbflush_timestamp = tlbflush_current_time();
 }
 
 static inline void arch_flush_tlb_mask(const cpumask_t *mask)
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 48162f5d65..a005d0247a 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -113,6 +113,18 @@ struct page_info
             unsigned long type_info;
         } inuse;
 
+        /* Page is used as an intermediate P2M page table: count_info == 0 */
+        struct {
+            /*
+            * Tracks the number of used entries in the metadata page table.
+            *
+            * If used_entries == 0, then `page_info.v.md.pg` can be freed and
+            * returned to the P2M pool.
+            */
+            unsigned long used_entries;
+        } md;
+
+
         /* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
         union {
             struct {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index c40ea483a7..0abeb374c1 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -51,6 +51,18 @@ static struct gstage_mode_desc __ro_after_init max_gstage_mode = {
     .name = "Bare",
 };
 
+static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
+
+static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
+                                          struct page_info **md_pg)
+{
+    if ( *md_pg )
+    {
+        p2m_free_page(p2m, *md_pg);
+        *md_pg = NULL;
+    }
+}
+
 unsigned char get_max_supported_mode(void)
 {
     return max_gstage_mode.mode;
@@ -448,16 +460,27 @@ static void p2m_set_type(pte_t *pte, p2m_type_t t,
 
     if ( t >= p2m_first_external )
     {
+        if ( metadata[ctx->index].type == p2m_invalid )
+            ctx->pt_page->u.md.used_entries++;
+
         metadata[ctx->index].type = t;
 
         t = p2m_ext_storage;
     }
     else if ( metadata )
+    {
+        if ( metadata[ctx->index].type != p2m_invalid )
+            ctx->pt_page->u.md.used_entries--;
+
         metadata[ctx->index].type = p2m_invalid;
+    }
 
     pte->pte |= MASK_INSR(t, P2M_TYPE_PTE_BITS_MASK);
 
     unmap_domain_page(metadata);
+
+    if ( *md_pg && !ctx->pt_page->u.md.used_entries )
+        p2m_free_metadata_page(ctx->p2m, md_pg);
 }
 
 /*
@@ -624,18 +647,13 @@ static pte_t page_to_p2m_table(const struct page_info *page)
     return p2m_pte_from_mfn(page_to_mfn(page), p2m_invalid, NULL);
 }
 
-static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
-
 /*
  * Free page table's page and metadata page linked to page table's page.
  */
 static void p2m_free_table(struct p2m_domain *p2m, struct page_info *tbl_pg)
 {
-    if ( tbl_pg->v.md.pg )
-    {
-        p2m_free_page(p2m, tbl_pg->v.md.pg);
-        tbl_pg->v.md.pg = NULL;
-    }
+    p2m_free_metadata_page(p2m, &tbl_pg->v.md.pg);
+
     p2m_free_page(p2m, tbl_pg);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 12 14:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Jan 2026 14:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1200412.1516348 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9w-0005x0-9K; Mon, 12 Jan 2026 14:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1200412.1516348; Mon, 12 Jan 2026 14:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfJ9w-0005ws-6e; Mon, 12 Jan 2026 14:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1200412;
 Mon, 12 Jan 2026 14: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 1vfJ9u-0005wa-Oq
 for xen-changelog@lists.xenproject.org; Mon, 12 Jan 2026 14: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 1vfJ9v-0006IU-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 14:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfJ9u-000J2Y-2G
 for xen-changelog@lists.xenproject.org;
 Mon, 12 Jan 2026 14: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=VhSY2UuK7OjVMyAn2JFHS24pcTL1oeTaMPE38CSviBE=; b=z+kn1ZXcvKTXDQ8k6S5B7Y13cm
	vJgYk1oPgEvMje7LNY42DYP4jAt3u3hV+pdP2g7T5qmSClwC9SPC3Tyn8KqDOIKMsh8iDE0zety9H
	vSSNiNc1xSKKOJR8DAfhFCdLCEPlrgaP/Nhm+PuSdFKiWe6wIc+gbNog7E+x/qPgP8qI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: fix incorrect return value for has_if_pschange_mc
Message-Id: <E1vfJ9u-000J2Y-2G@xenbits.xenproject.org>
Date: Mon, 12 Jan 2026 14:44:42 +0000

commit a2a34d76643e49ccc949296c9a45888034e50b55
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Mon Jan 12 13:07:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 12 13:07:36 2026 +0100

    x86: fix incorrect return value for has_if_pschange_mc
    
    The Atom block used to fall through into the Phi block to get to it's
    return false, and this was accidentally dropped with the Phi removal.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f4beac192d..b1c37268da 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3115,6 +3115,7 @@ static bool __init has_if_pschange_mc(void)
     case 0x75: /* Lightning Mountain */
     case 0x7a: /* Gemini Lake */
     case 0x86: /* Jacobsville */
+        return false;
 
     default:
         printk("Unrecognised CPU model %#x - assuming vulnerable to IF_PSCHANGE_MC\n",
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 12:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 12:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201695.1517264 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfdvK-0004sj-9Y; Tue, 13 Jan 2026 12:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201695.1517264; Tue, 13 Jan 2026 12: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 1vfdvK-0004sb-6q; Tue, 13 Jan 2026 12:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1201695;
 Tue, 13 Jan 2026 12: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 1vfdvJ-0004sV-OH
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 12: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 1vfdvK-001e4M-04
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfdvJ-001bok-20
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12: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=ie3jEXleNpa7Zea8a5NYShCMUEQfExZB/SmiXwm+Dyo=; b=XPqAYMB/yMunbthw1wtG7VjQEt
	NlUzfcrbuvP8q3nxrPWOpV06hTMn1KJCH/aaNMFlwmsTMbZjLaMy5XsOvLSTna4HPJkcHM0mSHvrX
	PxkVEmPLwMjkQZ731Qeh9qgv6jplBLxyUcB6ut4RDlxfNDa9qeJWXvSPggmYLDoO8/SU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI: pass pdev to pci_ats_{device,enabled}()
Message-Id: <E1vfdvJ-001bok-20@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 12:55:01 +0000

commit 6ada70ef0f124bd7d10590bb44f8092bac63c859
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 12:33:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:33:53 2026 +0100

    PCI: pass pdev to pci_ats_{device,enabled}()
    
    This not only brings both in sync with {en,dis}able_ats_device() but also
    prepares for doing the same to pci_find_{,next_}ext_capability().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/drivers/passthrough/amd/iommu_cmd.c     |  2 +-
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  8 +++-----
 xen/drivers/passthrough/ats.h               | 12 +++++-------
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_cmd.c b/xen/drivers/passthrough/amd/iommu_cmd.c
index 6b80c57f44..665e882a2d 100644
--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -285,7 +285,7 @@ void amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,
     if ( !ats_enabled )
         return;
 
-    if ( !pci_ats_enabled(pdev->seg, pdev->bus, pdev->devfn) )
+    if ( !pci_ats_enabled(pdev) )
         return;
 
     iommu = find_iommu_for_device(pdev->sbdf);
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 3a14770855..5d4e8edbe8 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -121,7 +121,7 @@ static bool use_ats(
 {
     return !ivrs_dev->block_ats &&
            iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) &&
-           pci_ats_device(iommu->sbdf.seg, pdev->bus, pdev->devfn);
+           pci_ats_device(pdev);
 }
 
 static int __must_check amd_iommu_setup_domain_device(
@@ -274,8 +274,7 @@ static int __must_check amd_iommu_setup_domain_device(
 
     ASSERT(pcidevs_locked());
 
-    if ( use_ats(pdev, iommu, ivrs_dev) &&
-         !pci_ats_enabled(iommu->sbdf.seg, bus, pdev->devfn) )
+    if ( use_ats(pdev, iommu, ivrs_dev) && !pci_ats_enabled(pdev) )
     {
         if ( devfn == pdev->devfn )
             enable_ats_device(pdev, &iommu->ats_devices);
@@ -418,8 +417,7 @@ static void amd_iommu_disable_domain_device(const struct domain *domain,
 
     ASSERT(pcidevs_locked());
 
-    if ( pci_ats_device(iommu->sbdf.seg, bus, pdev->devfn) &&
-         pci_ats_enabled(iommu->sbdf.seg, bus, pdev->devfn) )
+    if ( pci_ats_device(pdev) && pci_ats_enabled(pdev) )
         disable_ats_device(pdev);
 
     BUG_ON ( iommu->dev_table.buffer == NULL );
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index 68b1c600eb..2da255dabe 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -27,27 +27,25 @@ extern bool ats_enabled;
 int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list);
 void disable_ats_device(struct pci_dev *pdev);
 
-static inline int pci_ats_enabled(int seg, int bus, int devfn)
+static inline int pci_ats_enabled(const struct pci_dev *pdev)
 {
     u32 value;
     int pos;
 
-    pos = pci_find_ext_capability(PCI_SBDF(seg, bus, devfn),
-                                  PCI_EXT_CAP_ID_ATS);
+    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
     BUG_ON(!pos);
 
-    value = pci_conf_read16(PCI_SBDF(seg, bus, devfn), pos + ATS_REG_CTL);
+    value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CTL);
 
     return value & ATS_ENABLE;
 }
 
-static inline int pci_ats_device(int seg, int bus, int devfn)
+static inline int pci_ats_device(const struct pci_dev *pdev)
 {
     if ( !ats_enabled )
         return 0;
 
-    return pci_find_ext_capability(PCI_SBDF(seg, bus, devfn),
-                                   PCI_EXT_CAP_ID_ATS);
+    return pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
 }
 
 #endif /* DRIVERS__PASSTHROUGH__ATS_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 12:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 12:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201696.1517268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfdvU-0004uU-An; Tue, 13 Jan 2026 12:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201696.1517268; Tue, 13 Jan 2026 12: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 1vfdvU-0004uM-8C; Tue, 13 Jan 2026 12:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1201696;
 Tue, 13 Jan 2026 12: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 1vfdvT-0004uE-Qe
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 12: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 1vfdvU-001e6W-0Q
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfdvT-001bph-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12: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=zABXzm9IA5+sgXTMztLAmtndFWCt2JIuYBjYdEekTqU=; b=bwfGRmQMgFv6WFBY0DssPtVw5v
	yFp1zdH7uwNXCyMhDSJmE7a5WBxs1aAch9sLvYdfXKNo0M7gOfv8Pzr/XxLHj0AtqtoEskhBjTYRU
	F/xgGduEFVbrTxwtT3xnOW5S+ZxXEXXH502ReBuxrYMW9apT+egZS7tFdiR+AIU4jr6Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MSI: pass pdev to read_pci_mem_bar()
Message-Id: <E1vfdvT-001bph-2S@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 12:55:11 +0000

commit 65d592f497362ae76db0cdc15380577ab153ac49
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 12:34:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:34:33 2026 +0100

    x86/MSI: pass pdev to read_pci_mem_bar()
    
    This not only reduces the number of parameters and local variables, but
    also prepares for doing the same to pci_find_{,next_}ext_capability().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/msi.c | 57 ++++++++++++++++++------------------------------------
 1 file changed, 19 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 5389bc0867..c1667c197c 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -662,11 +662,11 @@ static int msi_capability_init(struct pci_dev *dev,
     return 0;
 }
 
-static uint64_t read_pci_mem_bar(pci_sbdf_t sbdf, uint8_t bir, int vf,
-                                 const struct pf_info *pf_info)
+static uint64_t read_pci_mem_bar(const struct pci_dev *pdev, uint8_t bir,
+                                 int vf)
 {
-    uint16_t seg = sbdf.seg;
-    uint8_t bus = sbdf.bus, slot = sbdf.dev, func = sbdf.fn;
+    uint16_t seg = pdev->sbdf.seg;
+    uint8_t bus = pdev->sbdf.bus, slot = pdev->sbdf.dev, func = pdev->sbdf.fn;
     u8 limit;
     u32 addr, base = PCI_BASE_ADDRESS_0;
     u64 disp = 0;
@@ -676,20 +676,18 @@ static uint64_t read_pci_mem_bar(pci_sbdf_t sbdf, uint8_t bir, int vf,
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
-        ASSERT(pf_info);
-
-        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
-        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
-        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
-        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
-        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
+        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
+        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
+        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
+        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
+        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
 
         if ( !pos ||
              !(ctrl & PCI_SRIOV_CTRL_VFE) ||
              !(ctrl & PCI_SRIOV_CTRL_MSE) ||
              !num_vf || !offset || (num_vf > 1 && !stride) ||
              bir >= PCI_SRIOV_NUM_BARS ||
-             !pf_info->vf_rlen[bir] )
+             !pdev->physfn.vf_rlen[bir] )
             return 0;
         base = pos + PCI_SRIOV_BAR;
         vf -= PCI_BDF(bus, slot, func) + offset;
@@ -703,8 +701,8 @@ static uint64_t read_pci_mem_bar(pci_sbdf_t sbdf, uint8_t bir, int vf,
         }
         if ( vf >= num_vf )
             return 0;
-        BUILD_BUG_ON(ARRAY_SIZE(pf_info->vf_rlen) != PCI_SRIOV_NUM_BARS);
-        disp = vf * pf_info->vf_rlen[bir];
+        BUILD_BUG_ON(ARRAY_SIZE(pdev->physfn.vf_rlen) != PCI_SRIOV_NUM_BARS);
+        disp = vf * pdev->physfn.vf_rlen[bir];
         limit = PCI_SRIOV_NUM_BARS;
     }
     else switch ( pci_conf_read8(PCI_SBDF(seg, bus, slot, func),
@@ -759,10 +757,6 @@ static int msix_capability_init(struct pci_dev *dev,
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u16 seg = dev->seg;
-    u8 bus = dev->bus;
-    u8 slot = PCI_SLOT(dev->devfn);
-    u8 func = PCI_FUNC(dev->devfn);
     bool maskall = msix->host_maskall, zap_on_error = false;
     unsigned int pos = dev->msix_pos;
 
@@ -809,32 +803,20 @@ static int msix_capability_init(struct pci_dev *dev,
           (is_hardware_domain(current->domain) &&
            (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
-        int vf;
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK;
+        int vf = -1;
+        const struct pci_dev *pf_dev = dev;
         paddr_t pba_paddr;
         unsigned int pba_offset;
-        const struct pf_info *pf_info;
 
-        if ( !dev->info.is_virtfn )
-        {
-            pbus = bus;
-            pslot = slot;
-            pfunc = func;
-            vf = -1;
-            pf_info = NULL;
-        }
-        else
+        if ( dev->info.is_virtfn )
         {
-            pbus = dev->info.physfn.bus;
-            pslot = PCI_SLOT(dev->info.physfn.devfn);
-            pfunc = PCI_FUNC(dev->info.physfn.devfn);
             vf = dev->sbdf.bdf;
             ASSERT(dev->pf_pdev);
-            pf_info = &dev->pf_pdev->physfn;
+            pf_dev = dev->pf_pdev;
         }
 
-        table_paddr = read_pci_mem_bar(PCI_SBDF(seg, pbus, pslot, pfunc), bir,
-                                       vf, pf_info);
+        table_paddr = read_pci_mem_bar(pf_dev, bir, vf);
         WARN_ON(msi && msi->table_base != table_paddr);
         if ( !table_paddr )
         {
@@ -857,8 +839,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
         pba_offset = pci_conf_read32(dev->sbdf, msix_pba_offset_reg(pos));
         bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
-        pba_paddr = read_pci_mem_bar(PCI_SBDF(seg, pbus, pslot, pfunc), bir, vf,
-                                     pf_info);
+        pba_paddr = read_pci_mem_bar(pf_dev, bir, vf);
         WARN_ON(!pba_paddr);
         pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 12:55:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 12:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201697.1517272 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfdve-0004wp-CL; Tue, 13 Jan 2026 12:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201697.1517272; Tue, 13 Jan 2026 12: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 1vfdve-0004wh-9a; Tue, 13 Jan 2026 12:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1201697;
 Tue, 13 Jan 2026 12: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 1vfdvd-0004wZ-U4
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 12: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 1vfdve-001e6a-0k
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfdvd-001bqt-2m
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12: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=Mm+Au7NSo/oBgyZ9nMm05UwHzw0E2LQt0WCGjNi3X5E=; b=i5v0EKWGvZSQuehKtylPOhH7H7
	XeDvo3bKkJ9m2mOX4bKIBFW2ncSaTdLOK2TW+0nHCiOmMhiLd8Udvgrr9CmLUVEdsbPJeCQQFZcBO
	gOndBZVvheO4eqfJHSncTkx6sOCMTwbMegP0KNTfFm6HnWgKOg0PwCsZj0UB9gtaQVkc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI: pass pdev to pci_find_{,next_}ext_capability()
Message-Id: <E1vfdvd-001bqt-2m@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 12:55:21 +0000

commit c1f0c432627473e1f3e6a3fd54449b199a819cc0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 12:41:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:41:36 2026 +0100

    PCI: pass pdev to pci_find_{,next_}ext_capability()
    
    This is in preparation of using attributes recorded for devices.
    Additionally locating (extended) capabilities of non-devices (e.g. phantom
    functions) makes no sense.
    
    While there also eliminate open-coding of PCI_CFG_SPACE_SIZE in adjacent
    code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/msi.c                   |  2 +-
 xen/drivers/passthrough/ats.c        |  2 +-
 xen/drivers/passthrough/ats.h        |  4 ++--
 xen/drivers/passthrough/pci.c        |  5 ++---
 xen/drivers/passthrough/vtd/iommu.c  |  2 +-
 xen/drivers/passthrough/vtd/quirks.c |  6 +++---
 xen/drivers/pci/pci.c                | 16 +++++++++-------
 xen/drivers/vpci/rebar.c             |  2 +-
 xen/drivers/vpci/vpci.c              |  6 +++---
 xen/include/xen/pci.h                |  6 ++++--
 10 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index c1667c197c..57ad5002c5 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -676,7 +676,7 @@ static uint64_t read_pci_mem_bar(const struct pci_dev *pdev, uint8_t bir,
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
-        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
+        pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
         ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
         num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
         offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
diff --git a/xen/drivers/passthrough/ats.c b/xen/drivers/passthrough/ats.c
index c20bfc8ee7..cb8268adea 100644
--- a/xen/drivers/passthrough/ats.c
+++ b/xen/drivers/passthrough/ats.c
@@ -24,7 +24,7 @@ boolean_param("ats", ats_enabled);
 int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
 {
     uint16_t value;
-    unsigned int pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    unsigned int pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
 
     BUG_ON(!pos);
 
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index 2da255dabe..279936dcf0 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -32,7 +32,7 @@ static inline int pci_ats_enabled(const struct pci_dev *pdev)
     u32 value;
     int pos;
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
     BUG_ON(!pos);
 
     value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CTL);
@@ -45,7 +45,7 @@ static inline int pci_ats_device(const struct pci_dev *pdev)
     if ( !ats_enabled )
         return 0;
 
-    return pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    return pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
 }
 
 #endif /* DRIVERS__PASSTHROUGH__ATS_H */
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 52c22fa50c..e42fee009c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -581,7 +581,7 @@ static void pci_enable_acs(struct pci_dev *pdev)
     if ( !is_iommu_enabled(pdev->domain) )
         return;
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ACS);
+    pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ACS);
     if (!pos)
         return;
 
@@ -722,8 +722,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
 
     if ( !pdev->info.is_virtfn && !pdev->physfn.vf_rlen[0] )
     {
-        unsigned int pos = pci_find_ext_capability(pdev->sbdf,
-                                                   PCI_EXT_CAP_ID_SRIOV);
+        unsigned int pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
         uint16_t ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
 
         if ( !pos )
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e7049456bf..3d6f787b3c 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1477,7 +1477,7 @@ static int ats_device(const struct pci_dev *pdev,
          !acpi_find_matched_atsr_unit(pdev) )
         return 0;
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
     if ( pos )
         drhd->iommu->flush_dev_iotlb = true;
 
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 0a10a46d90..796b164115 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -531,10 +531,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     /* Sandybridge-EP (Romley) */
     case 0x3c00: /* host bridge */
     case 0x3c01 ... 0x3c0b: /* root ports */
-        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ERR);
+        pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR);
         if ( !pos )
         {
-            pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_VNDR);
+            pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_VNDR);
             while ( pos )
             {
                 val = pci_conf_read32(pdev->sbdf, pos + PCI_VNDR_HEADER);
@@ -543,7 +543,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                     pos += PCI_VNDR_HEADER;
                     break;
                 }
-                pos = pci_find_next_ext_capability(pdev->sbdf, pos,
+                pos = pci_find_next_ext_capability(pdev, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
             ff = 0;
diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index e1ddde90eb..572cb9b21c 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -89,9 +89,10 @@ unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
  * within the device's PCI configuration space or 0 if the device does
  * not support it.
  */
-unsigned int pci_find_ext_capability(pci_sbdf_t sbdf, unsigned int cap)
+unsigned int pci_find_ext_capability(const struct pci_dev *pdev,
+                                     unsigned int cap)
 {
-    return pci_find_next_ext_capability(sbdf, 0, cap);
+    return pci_find_next_ext_capability(pdev, 0, cap);
 }
 
 /**
@@ -104,14 +105,15 @@ unsigned int pci_find_ext_capability(pci_sbdf_t sbdf, unsigned int cap)
  * within the device's PCI configuration space or 0 if the device does
  * not support it.
  */
-unsigned int pci_find_next_ext_capability(pci_sbdf_t sbdf, unsigned int start,
+unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
+                                          unsigned int start,
                                           unsigned int cap)
 {
     u32 header;
     int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
-    unsigned int pos = max(start, 0x100U);
+    unsigned int pos = max(start, PCI_CFG_SPACE_SIZE + 0U);
 
-    header = pci_conf_read32(sbdf, pos);
+    header = pci_conf_read32(pdev->sbdf, pos);
 
     /*
      * If we have no capabilities, this is indicated by cap ID,
@@ -125,9 +127,9 @@ unsigned int pci_find_next_ext_capability(pci_sbdf_t sbdf, unsigned int start,
         if ( PCI_EXT_CAP_ID(header) == cap && pos != start )
             return pos;
         pos = PCI_EXT_CAP_NEXT(header);
-        if ( pos < 0x100 )
+        if ( pos < PCI_CFG_SPACE_SIZE )
             break;
-        header = pci_conf_read32(sbdf, pos);
+        header = pci_conf_read32(pdev->sbdf, pos);
     }
     return 0;
 }
diff --git a/xen/drivers/vpci/rebar.c b/xen/drivers/vpci/rebar.c
index 3c18792d9b..63510c337a 100644
--- a/xen/drivers/vpci/rebar.c
+++ b/xen/drivers/vpci/rebar.c
@@ -53,7 +53,7 @@ static int cf_check init_rebar(struct pci_dev *pdev)
 {
     uint32_t ctrl;
     unsigned int nbars;
-    unsigned int rebar_offset = pci_find_ext_capability(pdev->sbdf,
+    unsigned int rebar_offset = pci_find_ext_capability(pdev,
                                                         PCI_EXT_CAP_ID_REBAR);
 
     if ( !rebar_offset )
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index c824bf8a8a..d76b81e04b 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -196,7 +196,7 @@ static struct vpci_register *vpci_get_previous_ext_cap_register(
 static int vpci_ext_capability_hide(
     const struct pci_dev *pdev, unsigned int cap)
 {
-    const unsigned int offset = pci_find_ext_capability(pdev->sbdf, cap);
+    const unsigned int offset = pci_find_ext_capability(pdev, cap);
     struct vpci_register *r, *prev_r;
     struct vpci *vpci = pdev->vpci;
     uint32_t header, pre_header;
@@ -264,7 +264,7 @@ static int vpci_init_capabilities(struct pci_dev *pdev)
         if ( !is_ext )
             pos = pci_find_cap_offset(pdev->sbdf, cap);
         else if ( is_hardware_domain(pdev->domain) )
-            pos = pci_find_ext_capability(pdev->sbdf, cap);
+            pos = pci_find_ext_capability(pdev, cap);
 
         if ( !pos )
             continue;
@@ -333,7 +333,7 @@ void vpci_deassign_device(struct pci_dev *pdev)
         if ( !capability->is_ext )
             pos = pci_find_cap_offset(pdev->sbdf, cap);
         else if ( is_hardware_domain(pdev->domain) )
-            pos = pci_find_ext_capability(pdev->sbdf, cap);
+            pos = pci_find_ext_capability(pdev, cap);
         if ( pos )
         {
             int rc = capability->cleanup(pdev, false);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 130c2a8c1a..d0521c5085 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -260,8 +260,10 @@ unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
                                    unsigned int *ttl);
 unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
                                unsigned int cap);
-unsigned int pci_find_ext_capability(pci_sbdf_t sbdf, unsigned int cap);
-unsigned int pci_find_next_ext_capability(pci_sbdf_t sbdf, unsigned int start,
+unsigned int pci_find_ext_capability(const struct pci_dev *pdev,
+                                     unsigned int cap);
+unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
+                                          unsigned int start,
                                           unsigned int cap);
 const char *parse_pci(const char *s, unsigned int *seg_p, unsigned int *bus_p,
                       unsigned int *dev_p, unsigned int *func_p);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 12:55:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 12:55:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201698.1517275 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfdvo-0004yx-Dl; Tue, 13 Jan 2026 12:55:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201698.1517275; Tue, 13 Jan 2026 12: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 1vfdvo-0004yp-BD; Tue, 13 Jan 2026 12:55:32 +0000
Received: by outflank-mailman (input) for mailman id 1201698;
 Tue, 13 Jan 2026 12:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vfdvo-0004yj-0o
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 12:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfdvo-001e6j-14
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12:55:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfdvn-001bsL-34
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12: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=awOpvVqKn/aNrM40fDAj2lP68cu/nVlw+Jzb6ADEFmo=; b=kJcNmRKpp4tQRXHsLf+AJ3Iynp
	lB7mIGWoaBWQ0GEAoWHTN2AqZNFLAsnqMbDqpMpn23AUpsKbZZss+O3bM027sZZAgFDB2Ibk+QWWb
	dcLFaki7XVVTSXwRUBsmmEYTdbHJTafPrKKbOzVg3iHwOBzxOOVvWiruM8qQkp/B05lQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/altp2m: altp2m_get_effective_entry() should honor ap2m->default_access
Message-Id: <E1vfdvn-001bsL-34@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 12:55:31 +0000

commit 38a5bfc7f278470309d2424b83873ebf71d4a9aa
Author:     Petr Beneš <w1benny@gmail.com>
AuthorDate: Tue Jan 13 12:42:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:42:04 2026 +0100

    x86/altp2m: altp2m_get_effective_entry() should honor ap2m->default_access
    
    Commit 7e5b662 fixed p2m_altp2m_get_or_propagate() to use the altp2m's
    default_access when propagating entries from the host p2m. However, the same
    fix was not applied to altp2m_get_effective_entry(), which has the same issue.
    
    When altp2m_get_effective_entry() prepopulates a superpage from the host
    p2m, it incorrectly uses the host p2m's access permissions instead of
    the altp2m's default_access. This causes problems when the superpage is
    later split (e.g., when setting mem_access on a specific 4K page): all
    512 entries inherit the host p2m's access rights instead of the altp2m's
    default_access.
    
    This issue became apparent after commit 50baf2d, which causes the host p2m
    to use superpages more frequently. Before that commit, the host p2m
    typically had 4K entries after VM restore, so the prepopulate branch was
    rarely taken.
    
    Symptoms include memory-access events firing for unexpected pages when
    using VMI tools with altp2m, particularly after VM resume.
    The issue can be worked around by booting with "hap_1gb=0 hap_2mb=0".
    
    Amends: 7e5b662b289a ("x86/altp2m: p2m_altp2m_get_or_propagate() should honor ap2m->default_access")
    Signed-off-by: Petr Beneš <w1benny@gmail.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/altp2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
index 0261360aae..0bc9b9ad2f 100644
--- a/xen/arch/x86/mm/altp2m.c
+++ b/xen/arch/x86/mm/altp2m.c
@@ -194,6 +194,9 @@ int altp2m_get_effective_entry(struct p2m_domain *ap2m, gfn_t gfn, mfn_t *mfn,
             gfn_t gfn_aligned = _gfn(gfn_x(gfn) & mask);
             mfn_t mfn_aligned = _mfn(mfn_x(*mfn) & mask);
 
+            /* Override the altp2m entry with its default access. */
+            *a = ap2m->default_access;
+
             rc = ap2m->set_entry(ap2m, gfn_aligned, mfn_aligned, page_order, *t, *a, 1);
             if ( rc )
                 return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 12:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 12:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201699.1517280 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfdvz-00051n-GZ; Tue, 13 Jan 2026 12:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201699.1517280; Tue, 13 Jan 2026 12:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfdvz-00051f-E3; Tue, 13 Jan 2026 12:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1201699;
 Tue, 13 Jan 2026 12:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vfdvy-00051X-3r
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 12:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfdvy-001e75-1N
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfdvy-001btB-09
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 12:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=agXbxYz882tGJBus+h3WZkUXCO3uJAMtvhLz+jFGi0s=; b=yAGq/BWiRD+YjjE9rPhWt16B9T
	VjibnahBwK2RtK0AkBi9HAKHK2LbQTOknBYDFXSCy7aZxFl04kSizMMYP+O79tL46EiMMhsJbSEVw
	N51egA2ku7Ta2nDx6Sg9spL09AlUZA2S4hsG/Tbg8ggenrof/KHXZM9Vrx7LP8f/tyrA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Fix typo s/mitigiated/mitigated/
Message-Id: <E1vfdvy-001btB-09@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 12:55:42 +0000

commit 6d1180b1499145fcb8f3099c1ab4b7305aba2ed4
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 13 12:42:24 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:42:24 2026 +0100

    x86/ucode: Fix typo s/mitigiated/mitigated/
    
    Not a functional change.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 2760ace921..71b041c84b 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -101,7 +101,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
-static bool __ro_after_init entrysign_mitigiated_in_firmware;
+static bool __ro_after_init entrysign_mitigated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -127,7 +127,7 @@ static bool check_digest(const struct container_microcode *mc)
      * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         entrysign_mitigiated_in_firmware || !opt_digest_check )
+         entrysign_mitigated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -676,7 +676,7 @@ void __init amd_check_entrysign(void)
      */
     if ( (uint8_t)curr_rev >= fixed_rev )
     {
-        entrysign_mitigiated_in_firmware = true;
+        entrysign_mitigated_in_firmware = true;
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 13:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 13:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201729.1517306 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vferP-0004WN-Vj; Tue, 13 Jan 2026 13:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201729.1517306; Tue, 13 Jan 2026 13: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 1vferP-0004WH-T6; Tue, 13 Jan 2026 13:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1201729;
 Tue, 13 Jan 2026 13:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vferO-0004UK-BU
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 13:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vferO-001f5p-1w
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vferO-001fln-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pdXjoOce6TPhxVlB/1+ac26v7GUIkhWVHqb3urx1D3M=; b=qwsy4GkShR8cpMIrDKdgQ+KxEH
	fjx7dHIhDuKw9GcwFClF5ts3W1uqJcwcDumbfKx1wV5ZVhBDvgC4ybejwLmWbIdy4yY/uQcsOc8SO
	qYJllH6J/TiBFi4DOoVCfg7pDeOQvdheWRZKPi+1HTIbL2Eb94rerlotBevuvJFni5JE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI: pass pdev to pci_ats_{device,enabled}()
Message-Id: <E1vferO-001fln-0j@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 13:55:02 +0000

commit 6ada70ef0f124bd7d10590bb44f8092bac63c859
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 12:33:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:33:53 2026 +0100

    PCI: pass pdev to pci_ats_{device,enabled}()
    
    This not only brings both in sync with {en,dis}able_ats_device() but also
    prepares for doing the same to pci_find_{,next_}ext_capability().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/drivers/passthrough/amd/iommu_cmd.c     |  2 +-
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  8 +++-----
 xen/drivers/passthrough/ats.h               | 12 +++++-------
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_cmd.c b/xen/drivers/passthrough/amd/iommu_cmd.c
index 6b80c57f44..665e882a2d 100644
--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -285,7 +285,7 @@ void amd_iommu_flush_iotlb(u8 devfn, const struct pci_dev *pdev,
     if ( !ats_enabled )
         return;
 
-    if ( !pci_ats_enabled(pdev->seg, pdev->bus, pdev->devfn) )
+    if ( !pci_ats_enabled(pdev) )
         return;
 
     iommu = find_iommu_for_device(pdev->sbdf);
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 3a14770855..5d4e8edbe8 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -121,7 +121,7 @@ static bool use_ats(
 {
     return !ivrs_dev->block_ats &&
            iommu_has_cap(iommu, PCI_CAP_IOTLB_SHIFT) &&
-           pci_ats_device(iommu->sbdf.seg, pdev->bus, pdev->devfn);
+           pci_ats_device(pdev);
 }
 
 static int __must_check amd_iommu_setup_domain_device(
@@ -274,8 +274,7 @@ static int __must_check amd_iommu_setup_domain_device(
 
     ASSERT(pcidevs_locked());
 
-    if ( use_ats(pdev, iommu, ivrs_dev) &&
-         !pci_ats_enabled(iommu->sbdf.seg, bus, pdev->devfn) )
+    if ( use_ats(pdev, iommu, ivrs_dev) && !pci_ats_enabled(pdev) )
     {
         if ( devfn == pdev->devfn )
             enable_ats_device(pdev, &iommu->ats_devices);
@@ -418,8 +417,7 @@ static void amd_iommu_disable_domain_device(const struct domain *domain,
 
     ASSERT(pcidevs_locked());
 
-    if ( pci_ats_device(iommu->sbdf.seg, bus, pdev->devfn) &&
-         pci_ats_enabled(iommu->sbdf.seg, bus, pdev->devfn) )
+    if ( pci_ats_device(pdev) && pci_ats_enabled(pdev) )
         disable_ats_device(pdev);
 
     BUG_ON ( iommu->dev_table.buffer == NULL );
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index 68b1c600eb..2da255dabe 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -27,27 +27,25 @@ extern bool ats_enabled;
 int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list);
 void disable_ats_device(struct pci_dev *pdev);
 
-static inline int pci_ats_enabled(int seg, int bus, int devfn)
+static inline int pci_ats_enabled(const struct pci_dev *pdev)
 {
     u32 value;
     int pos;
 
-    pos = pci_find_ext_capability(PCI_SBDF(seg, bus, devfn),
-                                  PCI_EXT_CAP_ID_ATS);
+    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
     BUG_ON(!pos);
 
-    value = pci_conf_read16(PCI_SBDF(seg, bus, devfn), pos + ATS_REG_CTL);
+    value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CTL);
 
     return value & ATS_ENABLE;
 }
 
-static inline int pci_ats_device(int seg, int bus, int devfn)
+static inline int pci_ats_device(const struct pci_dev *pdev)
 {
     if ( !ats_enabled )
         return 0;
 
-    return pci_find_ext_capability(PCI_SBDF(seg, bus, devfn),
-                                   PCI_EXT_CAP_ID_ATS);
+    return pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
 }
 
 #endif /* DRIVERS__PASSTHROUGH__ATS_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 13:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 13:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201732.1517311 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfera-0004cl-18; Tue, 13 Jan 2026 13:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201732.1517311; Tue, 13 Jan 2026 13: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 1vferZ-0004cd-UU; Tue, 13 Jan 2026 13:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1201732;
 Tue, 13 Jan 2026 13: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 1vferY-0004bC-Cr
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 13: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 1vferY-001f7s-2E
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vferY-001fm9-12
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13: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=JohRNzqfkABpm8Udd3MRLN7JTxZ0e4ywlBVBcIFT7gM=; b=1B7+5U/TUeAi1YB3SiCA/aJT4g
	k+yYFM8x6hBub+HhgFDYabbppU/3vozP7PAGaxINbsqIs0IYZjqe1DjHCYEbRj6f0tqST1GBtLRkb
	z0lhPk62HtvJvkczfXlx+HIRP3nIJtcVwr5np4pmId7IywpdOfPDR2DDon1nEx6CCnqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MSI: pass pdev to read_pci_mem_bar()
Message-Id: <E1vferY-001fm9-12@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 13:55:12 +0000

commit 65d592f497362ae76db0cdc15380577ab153ac49
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 12:34:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:34:33 2026 +0100

    x86/MSI: pass pdev to read_pci_mem_bar()
    
    This not only reduces the number of parameters and local variables, but
    also prepares for doing the same to pci_find_{,next_}ext_capability().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/msi.c | 57 ++++++++++++++++++------------------------------------
 1 file changed, 19 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 5389bc0867..c1667c197c 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -662,11 +662,11 @@ static int msi_capability_init(struct pci_dev *dev,
     return 0;
 }
 
-static uint64_t read_pci_mem_bar(pci_sbdf_t sbdf, uint8_t bir, int vf,
-                                 const struct pf_info *pf_info)
+static uint64_t read_pci_mem_bar(const struct pci_dev *pdev, uint8_t bir,
+                                 int vf)
 {
-    uint16_t seg = sbdf.seg;
-    uint8_t bus = sbdf.bus, slot = sbdf.dev, func = sbdf.fn;
+    uint16_t seg = pdev->sbdf.seg;
+    uint8_t bus = pdev->sbdf.bus, slot = pdev->sbdf.dev, func = pdev->sbdf.fn;
     u8 limit;
     u32 addr, base = PCI_BASE_ADDRESS_0;
     u64 disp = 0;
@@ -676,20 +676,18 @@ static uint64_t read_pci_mem_bar(pci_sbdf_t sbdf, uint8_t bir, int vf,
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
-        ASSERT(pf_info);
-
-        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
-        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
-        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
-        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
-        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
+        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
+        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
+        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
+        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
+        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
 
         if ( !pos ||
              !(ctrl & PCI_SRIOV_CTRL_VFE) ||
              !(ctrl & PCI_SRIOV_CTRL_MSE) ||
              !num_vf || !offset || (num_vf > 1 && !stride) ||
              bir >= PCI_SRIOV_NUM_BARS ||
-             !pf_info->vf_rlen[bir] )
+             !pdev->physfn.vf_rlen[bir] )
             return 0;
         base = pos + PCI_SRIOV_BAR;
         vf -= PCI_BDF(bus, slot, func) + offset;
@@ -703,8 +701,8 @@ static uint64_t read_pci_mem_bar(pci_sbdf_t sbdf, uint8_t bir, int vf,
         }
         if ( vf >= num_vf )
             return 0;
-        BUILD_BUG_ON(ARRAY_SIZE(pf_info->vf_rlen) != PCI_SRIOV_NUM_BARS);
-        disp = vf * pf_info->vf_rlen[bir];
+        BUILD_BUG_ON(ARRAY_SIZE(pdev->physfn.vf_rlen) != PCI_SRIOV_NUM_BARS);
+        disp = vf * pdev->physfn.vf_rlen[bir];
         limit = PCI_SRIOV_NUM_BARS;
     }
     else switch ( pci_conf_read8(PCI_SBDF(seg, bus, slot, func),
@@ -759,10 +757,6 @@ static int msix_capability_init(struct pci_dev *dev,
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u16 seg = dev->seg;
-    u8 bus = dev->bus;
-    u8 slot = PCI_SLOT(dev->devfn);
-    u8 func = PCI_FUNC(dev->devfn);
     bool maskall = msix->host_maskall, zap_on_error = false;
     unsigned int pos = dev->msix_pos;
 
@@ -809,32 +803,20 @@ static int msix_capability_init(struct pci_dev *dev,
           (is_hardware_domain(current->domain) &&
            (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
-        int vf;
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK;
+        int vf = -1;
+        const struct pci_dev *pf_dev = dev;
         paddr_t pba_paddr;
         unsigned int pba_offset;
-        const struct pf_info *pf_info;
 
-        if ( !dev->info.is_virtfn )
-        {
-            pbus = bus;
-            pslot = slot;
-            pfunc = func;
-            vf = -1;
-            pf_info = NULL;
-        }
-        else
+        if ( dev->info.is_virtfn )
         {
-            pbus = dev->info.physfn.bus;
-            pslot = PCI_SLOT(dev->info.physfn.devfn);
-            pfunc = PCI_FUNC(dev->info.physfn.devfn);
             vf = dev->sbdf.bdf;
             ASSERT(dev->pf_pdev);
-            pf_info = &dev->pf_pdev->physfn;
+            pf_dev = dev->pf_pdev;
         }
 
-        table_paddr = read_pci_mem_bar(PCI_SBDF(seg, pbus, pslot, pfunc), bir,
-                                       vf, pf_info);
+        table_paddr = read_pci_mem_bar(pf_dev, bir, vf);
         WARN_ON(msi && msi->table_base != table_paddr);
         if ( !table_paddr )
         {
@@ -857,8 +839,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
         pba_offset = pci_conf_read32(dev->sbdf, msix_pba_offset_reg(pos));
         bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
-        pba_paddr = read_pci_mem_bar(PCI_SBDF(seg, pbus, pslot, pfunc), bir, vf,
-                                     pf_info);
+        pba_paddr = read_pci_mem_bar(pf_dev, bir, vf);
         WARN_ON(!pba_paddr);
         pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 13:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 13:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201734.1517315 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vferk-0004gS-2M; Tue, 13 Jan 2026 13:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201734.1517315; Tue, 13 Jan 2026 13:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vferj-0004gK-Vv; Tue, 13 Jan 2026 13:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1201734;
 Tue, 13 Jan 2026 13: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 1vferi-0004g7-HN
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 13: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 1vferi-001f7w-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vferi-001fmW-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13: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=A4Iy1q1Zh8GxLpTYicVP9NZKTirXFn+Ln+E3ScIk71w=; b=g3Zr13YYy4ZhGe0O/uWbRyyaTT
	kwPJof1ZOPwGJLrIRFlEj8yGeQ92G4/hXpDkIdFh+eV4NR4UdJgH1T7oW06dosLt7X9Sjr+1iG9cx
	MUTvn2Xkjd81FE24WlxEUpZvWNP6efNntovNDQVsunmAyZ10nqc1ppQWGNTqLz2fKEGU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI: pass pdev to pci_find_{,next_}ext_capability()
Message-Id: <E1vferi-001fmW-1M@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 13:55:22 +0000

commit c1f0c432627473e1f3e6a3fd54449b199a819cc0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 12:41:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:41:36 2026 +0100

    PCI: pass pdev to pci_find_{,next_}ext_capability()
    
    This is in preparation of using attributes recorded for devices.
    Additionally locating (extended) capabilities of non-devices (e.g. phantom
    functions) makes no sense.
    
    While there also eliminate open-coding of PCI_CFG_SPACE_SIZE in adjacent
    code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/msi.c                   |  2 +-
 xen/drivers/passthrough/ats.c        |  2 +-
 xen/drivers/passthrough/ats.h        |  4 ++--
 xen/drivers/passthrough/pci.c        |  5 ++---
 xen/drivers/passthrough/vtd/iommu.c  |  2 +-
 xen/drivers/passthrough/vtd/quirks.c |  6 +++---
 xen/drivers/pci/pci.c                | 16 +++++++++-------
 xen/drivers/vpci/rebar.c             |  2 +-
 xen/drivers/vpci/vpci.c              |  6 +++---
 xen/include/xen/pci.h                |  6 ++++--
 10 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index c1667c197c..57ad5002c5 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -676,7 +676,7 @@ static uint64_t read_pci_mem_bar(const struct pci_dev *pdev, uint8_t bir,
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
-        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
+        pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
         ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
         num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
         offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
diff --git a/xen/drivers/passthrough/ats.c b/xen/drivers/passthrough/ats.c
index c20bfc8ee7..cb8268adea 100644
--- a/xen/drivers/passthrough/ats.c
+++ b/xen/drivers/passthrough/ats.c
@@ -24,7 +24,7 @@ boolean_param("ats", ats_enabled);
 int enable_ats_device(struct pci_dev *pdev, struct list_head *ats_list)
 {
     uint16_t value;
-    unsigned int pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    unsigned int pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
 
     BUG_ON(!pos);
 
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index 2da255dabe..279936dcf0 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -32,7 +32,7 @@ static inline int pci_ats_enabled(const struct pci_dev *pdev)
     u32 value;
     int pos;
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
     BUG_ON(!pos);
 
     value = pci_conf_read16(pdev->sbdf, pos + ATS_REG_CTL);
@@ -45,7 +45,7 @@ static inline int pci_ats_device(const struct pci_dev *pdev)
     if ( !ats_enabled )
         return 0;
 
-    return pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    return pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
 }
 
 #endif /* DRIVERS__PASSTHROUGH__ATS_H */
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 52c22fa50c..e42fee009c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -581,7 +581,7 @@ static void pci_enable_acs(struct pci_dev *pdev)
     if ( !is_iommu_enabled(pdev->domain) )
         return;
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ACS);
+    pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ACS);
     if (!pos)
         return;
 
@@ -722,8 +722,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
 
     if ( !pdev->info.is_virtfn && !pdev->physfn.vf_rlen[0] )
     {
-        unsigned int pos = pci_find_ext_capability(pdev->sbdf,
-                                                   PCI_EXT_CAP_ID_SRIOV);
+        unsigned int pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
         uint16_t ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
 
         if ( !pos )
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e7049456bf..3d6f787b3c 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1477,7 +1477,7 @@ static int ats_device(const struct pci_dev *pdev,
          !acpi_find_matched_atsr_unit(pdev) )
         return 0;
 
-    pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ATS);
+    pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS);
     if ( pos )
         drhd->iommu->flush_dev_iotlb = true;
 
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 0a10a46d90..796b164115 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -531,10 +531,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     /* Sandybridge-EP (Romley) */
     case 0x3c00: /* host bridge */
     case 0x3c01 ... 0x3c0b: /* root ports */
-        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_ERR);
+        pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR);
         if ( !pos )
         {
-            pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_VNDR);
+            pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_VNDR);
             while ( pos )
             {
                 val = pci_conf_read32(pdev->sbdf, pos + PCI_VNDR_HEADER);
@@ -543,7 +543,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                     pos += PCI_VNDR_HEADER;
                     break;
                 }
-                pos = pci_find_next_ext_capability(pdev->sbdf, pos,
+                pos = pci_find_next_ext_capability(pdev, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
             ff = 0;
diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index e1ddde90eb..572cb9b21c 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -89,9 +89,10 @@ unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
  * within the device's PCI configuration space or 0 if the device does
  * not support it.
  */
-unsigned int pci_find_ext_capability(pci_sbdf_t sbdf, unsigned int cap)
+unsigned int pci_find_ext_capability(const struct pci_dev *pdev,
+                                     unsigned int cap)
 {
-    return pci_find_next_ext_capability(sbdf, 0, cap);
+    return pci_find_next_ext_capability(pdev, 0, cap);
 }
 
 /**
@@ -104,14 +105,15 @@ unsigned int pci_find_ext_capability(pci_sbdf_t sbdf, unsigned int cap)
  * within the device's PCI configuration space or 0 if the device does
  * not support it.
  */
-unsigned int pci_find_next_ext_capability(pci_sbdf_t sbdf, unsigned int start,
+unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
+                                          unsigned int start,
                                           unsigned int cap)
 {
     u32 header;
     int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
-    unsigned int pos = max(start, 0x100U);
+    unsigned int pos = max(start, PCI_CFG_SPACE_SIZE + 0U);
 
-    header = pci_conf_read32(sbdf, pos);
+    header = pci_conf_read32(pdev->sbdf, pos);
 
     /*
      * If we have no capabilities, this is indicated by cap ID,
@@ -125,9 +127,9 @@ unsigned int pci_find_next_ext_capability(pci_sbdf_t sbdf, unsigned int start,
         if ( PCI_EXT_CAP_ID(header) == cap && pos != start )
             return pos;
         pos = PCI_EXT_CAP_NEXT(header);
-        if ( pos < 0x100 )
+        if ( pos < PCI_CFG_SPACE_SIZE )
             break;
-        header = pci_conf_read32(sbdf, pos);
+        header = pci_conf_read32(pdev->sbdf, pos);
     }
     return 0;
 }
diff --git a/xen/drivers/vpci/rebar.c b/xen/drivers/vpci/rebar.c
index 3c18792d9b..63510c337a 100644
--- a/xen/drivers/vpci/rebar.c
+++ b/xen/drivers/vpci/rebar.c
@@ -53,7 +53,7 @@ static int cf_check init_rebar(struct pci_dev *pdev)
 {
     uint32_t ctrl;
     unsigned int nbars;
-    unsigned int rebar_offset = pci_find_ext_capability(pdev->sbdf,
+    unsigned int rebar_offset = pci_find_ext_capability(pdev,
                                                         PCI_EXT_CAP_ID_REBAR);
 
     if ( !rebar_offset )
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index c824bf8a8a..d76b81e04b 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -196,7 +196,7 @@ static struct vpci_register *vpci_get_previous_ext_cap_register(
 static int vpci_ext_capability_hide(
     const struct pci_dev *pdev, unsigned int cap)
 {
-    const unsigned int offset = pci_find_ext_capability(pdev->sbdf, cap);
+    const unsigned int offset = pci_find_ext_capability(pdev, cap);
     struct vpci_register *r, *prev_r;
     struct vpci *vpci = pdev->vpci;
     uint32_t header, pre_header;
@@ -264,7 +264,7 @@ static int vpci_init_capabilities(struct pci_dev *pdev)
         if ( !is_ext )
             pos = pci_find_cap_offset(pdev->sbdf, cap);
         else if ( is_hardware_domain(pdev->domain) )
-            pos = pci_find_ext_capability(pdev->sbdf, cap);
+            pos = pci_find_ext_capability(pdev, cap);
 
         if ( !pos )
             continue;
@@ -333,7 +333,7 @@ void vpci_deassign_device(struct pci_dev *pdev)
         if ( !capability->is_ext )
             pos = pci_find_cap_offset(pdev->sbdf, cap);
         else if ( is_hardware_domain(pdev->domain) )
-            pos = pci_find_ext_capability(pdev->sbdf, cap);
+            pos = pci_find_ext_capability(pdev, cap);
         if ( pos )
         {
             int rc = capability->cleanup(pdev, false);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 130c2a8c1a..d0521c5085 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -260,8 +260,10 @@ unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
                                    unsigned int *ttl);
 unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
                                unsigned int cap);
-unsigned int pci_find_ext_capability(pci_sbdf_t sbdf, unsigned int cap);
-unsigned int pci_find_next_ext_capability(pci_sbdf_t sbdf, unsigned int start,
+unsigned int pci_find_ext_capability(const struct pci_dev *pdev,
+                                     unsigned int cap);
+unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
+                                          unsigned int start,
                                           unsigned int cap);
 const char *parse_pci(const char *s, unsigned int *seg_p, unsigned int *bus_p,
                       unsigned int *dev_p, unsigned int *func_p);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 13:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 13:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201735.1517318 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vferu-0004jI-3g; Tue, 13 Jan 2026 13:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201735.1517318; Tue, 13 Jan 2026 13:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vferu-0004jA-12; Tue, 13 Jan 2026 13:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1201735;
 Tue, 13 Jan 2026 13: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 1vfers-0004iw-Ki
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 13: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 1vfers-001f80-31
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfers-001fn0-1o
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13: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=4IwdnDFmNNGAhKe7r4l4F499GPNshQ3Yz5ATR3QfbYk=; b=ki2P9+ZH0KVHHELSbG+3plrsF8
	Y26dHfZslTtVOKhGsDkExViktnVWoLbfdiuu8bfeMWenez62/GZFd1rbeuFYoypKBbtHJ6ZUpTMG7
	mKY/zqElbEm6DaUIeA5U3kAP3M/3WdANcHbZ1g2zLP5XExBNpD53ePsc/zwpjgzZphz8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/altp2m: altp2m_get_effective_entry() should honor ap2m->default_access
Message-Id: <E1vfers-001fn0-1o@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 13:55:32 +0000

commit 38a5bfc7f278470309d2424b83873ebf71d4a9aa
Author:     Petr Beneš <w1benny@gmail.com>
AuthorDate: Tue Jan 13 12:42:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:42:04 2026 +0100

    x86/altp2m: altp2m_get_effective_entry() should honor ap2m->default_access
    
    Commit 7e5b662 fixed p2m_altp2m_get_or_propagate() to use the altp2m's
    default_access when propagating entries from the host p2m. However, the same
    fix was not applied to altp2m_get_effective_entry(), which has the same issue.
    
    When altp2m_get_effective_entry() prepopulates a superpage from the host
    p2m, it incorrectly uses the host p2m's access permissions instead of
    the altp2m's default_access. This causes problems when the superpage is
    later split (e.g., when setting mem_access on a specific 4K page): all
    512 entries inherit the host p2m's access rights instead of the altp2m's
    default_access.
    
    This issue became apparent after commit 50baf2d, which causes the host p2m
    to use superpages more frequently. Before that commit, the host p2m
    typically had 4K entries after VM restore, so the prepopulate branch was
    rarely taken.
    
    Symptoms include memory-access events firing for unexpected pages when
    using VMI tools with altp2m, particularly after VM resume.
    The issue can be worked around by booting with "hap_1gb=0 hap_2mb=0".
    
    Amends: 7e5b662b289a ("x86/altp2m: p2m_altp2m_get_or_propagate() should honor ap2m->default_access")
    Signed-off-by: Petr Beneš <w1benny@gmail.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/altp2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
index 0261360aae..0bc9b9ad2f 100644
--- a/xen/arch/x86/mm/altp2m.c
+++ b/xen/arch/x86/mm/altp2m.c
@@ -194,6 +194,9 @@ int altp2m_get_effective_entry(struct p2m_domain *ap2m, gfn_t gfn, mfn_t *mfn,
             gfn_t gfn_aligned = _gfn(gfn_x(gfn) & mask);
             mfn_t mfn_aligned = _mfn(mfn_x(*mfn) & mask);
 
+            /* Override the altp2m entry with its default access. */
+            *a = ap2m->default_access;
+
             rc = ap2m->set_entry(ap2m, gfn_aligned, mfn_aligned, page_order, *t, *a, 1);
             if ( rc )
                 return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 13:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 13:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201736.1517323 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfes4-0004mm-6V; Tue, 13 Jan 2026 13:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201736.1517323; Tue, 13 Jan 2026 13:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfes4-0004mc-3l; Tue, 13 Jan 2026 13:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1201736;
 Tue, 13 Jan 2026 13: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 1vfes2-0004mU-Mu
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 13: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 1vfes3-001f8W-03
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfes2-001fno-26
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 13:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=plFzQnT7aVV96FDPV5SrekRC5pPXUmaX8lWhplRVAN4=; b=r3sPclN9/BXbjydgIyy/11kiDh
	PWtBNC+SuWqGDwljTdW3lq25uEta8Meo373LLLcVnPUcQ2P4V6HgS/gd8ri+dPQEyrL72VBNKy/ge
	T34/KEXmkh2nJ0Sq74U1vtuUEP94d9aud9PZJjwKWszdeKCxifmPzGNvXiTS9NXVL5GA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Fix typo s/mitigiated/mitigated/
Message-Id: <E1vfes2-001fno-26@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 13:55:42 +0000

commit 6d1180b1499145fcb8f3099c1ab4b7305aba2ed4
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 13 12:42:24 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 12:42:24 2026 +0100

    x86/ucode: Fix typo s/mitigiated/mitigated/
    
    Not a functional change.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 2760ace921..71b041c84b 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -101,7 +101,7 @@ static const struct patch_digest {
 } patch_digests[] = {
 #include "amd-patch-digests.c"
 };
-static bool __ro_after_init entrysign_mitigiated_in_firmware;
+static bool __ro_after_init entrysign_mitigated_in_firmware;
 
 static int cf_check cmp_patch_id(const void *key, const void *elem)
 {
@@ -127,7 +127,7 @@ static bool check_digest(const struct container_microcode *mc)
      * the digest of the patch against a list of known provenance.
      */
     if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ||
-         entrysign_mitigiated_in_firmware || !opt_digest_check )
+         entrysign_mitigated_in_firmware || !opt_digest_check )
         return true;
 
     pd = bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_digests),
@@ -676,7 +676,7 @@ void __init amd_check_entrysign(void)
      */
     if ( (uint8_t)curr_rev >= fixed_rev )
     {
-        entrysign_mitigiated_in_firmware = true;
+        entrysign_mitigated_in_firmware = true;
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:55:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201857.1517417 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffnT-0000OB-F4; Tue, 13 Jan 2026 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201857.1517417; Tue, 13 Jan 2026 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 1vffnT-0000O3-CN; Tue, 13 Jan 2026 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1201857;
 Tue, 13 Jan 2026 14: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 1vffnR-0000Nx-Nt
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vffnS-001gCq-08
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffnR-001jhO-2A
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 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=F5nB8zVEHBJ6iMpJn+Qk9J1l26NP/fwsExM5Qqq+99Y=; b=h+AMNwXOpWJw6Xz9/uGhfF+vg/
	eNZ2SwwNahZCDYT1jmwKtJdeQX7CPEWvS0luZVv35lbe+i1P28wEWgNprkka/MpurMuCbZ9Yvylah
	CF8+F5ReGTG6POdG7r+V8ZrEUH19EipMnwUeZBZ509MueW+gnhpXUdr0s33CDy3Pyk4c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/pod: fix decrease_reservation() clearing of M2P entries
Message-Id: <E1vffnR-001jhO-2A@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:55:01 +0000

commit 79903304784c1a1ee17c16c8371c0852d6d5a655
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:39:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:39:31 2026 +0100

    x86/pod: fix decrease_reservation() clearing of M2P entries
    
    Add the missing index increase in the M2P clearing loop, otherwise the loop
    keeps pointlessly setting the same MFN entry repeatedly.  This seems to be
    an oversight from the change that introduced support to process high order
    pages in one go.
    
    Fixes: 3c352011c0d3 ("x86/PoD: shorten certain operations on higher order ranges")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d495cb8f70280482edae12b48f422b5715099
    master date: 2025-12-11 09:50:10 +0100
---
 xen/arch/x86/mm/p2m-pod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 05633fe2ac..22dde913cc 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -655,7 +655,7 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
             }
             p2m_tlb_flush_sync(p2m);
             for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+                set_gpfn_from_mfn(mfn_x(mfn) + j, INVALID_M2P_ENTRY);
             p2m_pod_cache_add(p2m, page, cur_order);
 
             ioreq_request_mapcache_invalidate(d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201858.1517421 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffnd-0000Pq-GS; Tue, 13 Jan 2026 14:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201858.1517421; Tue, 13 Jan 2026 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 1vffnd-0000Pj-Dk; Tue, 13 Jan 2026 14:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1201858;
 Tue, 13 Jan 2026 14: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 1vffnb-0000PV-Rb
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14: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 1vffnc-001gEt-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffnb-001ji7-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14: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=i6WW2Rh0DTmjjuSUwkXG7oxyJYeVmnRndHVcVhPlcmw=; b=rRaA+kqClzP++vH7rCA5WRt8K8
	+9Qt/i/2olCv20qYkI+GzXAMdCanUYYCM5LF1kxhCdugkp24tuXk0/w8sUgkf9dl2Nb16JlCskKjI
	RwCHSizBI2U6I9pfc1pNzrlQlXEFs2uy+GvHS+7oxJlfGlnXaGt52/skdMfUvLV3txvY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/mm: update log-dirty bitmap when manipulating P2M
Message-Id: <E1vffnb-001ji7-2S@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:55:11 +0000

commit 1cacccbace841bf85fbbef871dfe5be648abf232
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:39:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:39:54 2026 +0100

    x86/mm: update log-dirty bitmap when manipulating P2M
    
    Just like for PV guests MMU_MACHPHYS_UPDATE implies marking of the
    respective page as dirty, additions to a HVM guest's P2M should do so.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    [jb: backport limited to the new paging_mark_pfn_dirty() use]
    master commit: 98fccdf0ac7c1a909b54dd5beeba54a0a23f756c
    master date: 2025-12-11 09:50:30 +0100
---
 xen/arch/x86/mm/p2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index e2a00a0efd..ef35cd564b 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -753,8 +753,11 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
         if ( !p2m_is_grant(t) )
         {
             for ( i = 0; i < (1UL << page_order); i++ )
+            {
                 set_gpfn_from_mfn(mfn_x(mfn_add(mfn, i)),
                                   gfn_x(gfn_add(gfn, i)));
+                paging_mark_pfn_dirty(d, _pfn(gfn_x(gfn) + i));
+            }
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201859.1517425 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffnn-0000S5-Ho; Tue, 13 Jan 2026 14:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201859.1517425; Tue, 13 Jan 2026 14:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffnn-0000Rx-FC; Tue, 13 Jan 2026 14:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1201859;
 Tue, 13 Jan 2026 14: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 1vffnl-0000Rl-Vh
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14: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 1vffnm-001gEx-0l
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffnl-001jiT-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14: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=0xaezgRs4uvGUW6YI6Qg1pLY1pEkifrWLtYups4U7Pk=; b=KPeshkkTH3i5ZncBqvfWWYCsig
	Zl6kjIcVGkcmRFBqk+m8SKaTuHOO2T07ufjRuPLva2cJ+5kpuVzEA6tBs5Wn/+fFSX7+EXieWShfh
	cKLHihHc45T4/QffcfzS0lBMiLxmfskqJn8DWCVOzyZofF0L0TBd2OHI+4NbKaJcB2yU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/x86: Pass TPM ACPI table to PVH dom0
Message-Id: <E1vffnl-001jiT-2o@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:55:21 +0000

commit 7ab1f4939aa0dbbf7f4222dad1b354b01790d9d3
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Jan 13 15:40:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:40:14 2026 +0100

    xen/x86: Pass TPM ACPI table to PVH dom0
    
    Pass the TPM2 ACPI table so that the device can be found by a PVH dom0.
    
    Otherwise dom0 shows:
    tpm_tis MSFT0101:00: [Firmware Bug]: failed to get TPM2 ACPI table
    tpm_tis MSFT0101:00: probe with driver tpm_tis failed with error -22
    
    TCPA is "Trusted Computing Platform Alliance table", but it is really
    the table for a TPM 1.2.  Pass that as well.
    
    While doing this, move ACPI_SIG_WPBT to alpabetize the entries.
    
    This exposes TPM event log tables on PVH dom0, bring it in line with a
    PV dom0.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 46f3ed0d53db6daf38c230dff0d2910bcb61fbe2
    master date: 2025-12-16 09:40:18 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 xen/include/acpi/actbl3.h     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 5551f90448..2635b2b95f 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1013,7 +1013,7 @@ static bool __init pvh_acpi_table_allowed(const char *sig,
         ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_FACS, ACPI_SIG_PSDT,
         ACPI_SIG_SSDT, ACPI_SIG_SBST, ACPI_SIG_MCFG, ACPI_SIG_SLIC,
         ACPI_SIG_MSDM, ACPI_SIG_WDAT, ACPI_SIG_FPDT, ACPI_SIG_S3PT,
-        ACPI_SIG_VFCT,
+        ACPI_SIG_TCPA, ACPI_SIG_TPM2, ACPI_SIG_VFCT,
     };
     unsigned int i;
 
diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 6858d3e60f..636d3f5f5b 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -78,8 +78,10 @@
 #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
 #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
 #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
-#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
+#define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"	/* Trusted Platform Module 2.0 H/W interface table */
 #define ACPI_SIG_VFCT           "VFCT"	/* AMD Video BIOS */
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201860.1517429 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffnx-0000US-JL; Tue, 13 Jan 2026 14:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201860.1517429; Tue, 13 Jan 2026 14:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffnx-0000UK-GU; Tue, 13 Jan 2026 14:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1201860;
 Tue, 13 Jan 2026 14: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 1vffnw-0000UB-4q
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14: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 1vffnw-001gF1-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffnv-001jj4-34
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14: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=me1ZLaSjMtyEBqY56SuaNWiW2zMemVFlLjdDbtgBh0c=; b=JObM1XWho+KwVL9WAEBdrzHBFA
	A9FfL9uqdol6K8SroYSbNHd4UGWy5YOUWdkRo9PAGcVx9aMkqWF3PnhS9z36cZE7iSc6kxQioD58Z
	sEQodVbzEH6rwfs7CmPKRxnH6/g8L8GuyAceSpHEm4cXgapMvFpqlfV/MPIO6T8zoKVc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] vPCI: avoid bogus "overlap in extended cap list" warnings
Message-Id: <E1vffnv-001jj4-34@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:55:31 +0000

commit 11f94271000cc1d92741184e0a38e5f2750e0dfc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:40:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:40:44 2026 +0100

    vPCI: avoid bogus "overlap in extended cap list" warnings
    
    Legacy PCI devices don't have any extended config space. Reading any part
    thereof may very well return all ones. That then necessarily means we
    would think we found a "loop", when there simply is nothing.
    
    Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: ed4e690ae11a60792f722729abb9ec68e64ffea3
    master date: 2025-12-29 09:34:41 +0100
---
 xen/drivers/vpci/header.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 469f497744..aae663bbf5 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -839,6 +839,15 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
         uint32_t header = pci_conf_read32(pdev->sbdf, pos);
         int rc;
 
+        if ( header == 0xffffffffU )
+        {
+            if ( pos != PCI_CFG_SPACE_SIZE )
+                printk(XENLOG_WARNING
+                       "%pd %pp: broken extended cap list, offset %#x\n",
+                       pdev->domain, &pdev->sbdf, pos);
+            return 0;
+        }
+
         rc = vpci_add_register(pdev->vpci, vpci_read_val, NULL,
                                pos, 4, (void *)(uintptr_t)header);
         if ( rc == -EEXIST )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201862.1517433 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffo7-0000Wv-KY; Tue, 13 Jan 2026 14:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201862.1517433; Tue, 13 Jan 2026 14: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 1vffo7-0000Wl-Hp; Tue, 13 Jan 2026 14:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1201862;
 Tue, 13 Jan 2026 14: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 1vffo6-0000Wd-7j
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14: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 1vffo6-001gFL-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffo6-001jjS-0P
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DwIs37qTKkCi1mUXsLDuulrIzq27AQpZAa/pZ3x08IE=; b=OptVyBOMJBzwM2Lx4lEOOWAtao
	FMmTprYgMyJlECI7BgyYybYzX3DC4Po7ixR3UGWD/dIILA8kIcdIIzmXPXwYYZfF1hI6r2hFbgNK+
	IOhqCZ46oh9Z7BxRDpD+eE5Aqc0R3TMsB/zR+E9iAWronjcHdoKq7uOyWWXKxAe7bn4A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/AMD: avoid REP MOVSB for Zen3/4
Message-Id: <E1vffo6-001jjS-0P@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:55:42 +0000

commit f805b61268311017902aff6e956c12c32b099d3e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:41:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:41:10 2026 +0100

    x86/AMD: avoid REP MOVSB for Zen3/4
    
    Zen2 (which doesn't expose ERMS) through Zen4 have sub-optimal aliasing
    detection for REP MOVS, and fall back to a unit-at-a-time loop when the
    two pointers have differing bottom 5 bits.  While both forms are
    affected, this makes REP MOVSB 8 times slower than REP MOVSQ.
    
    memcpy() has a high likelihood of encountering this slowpath, so avoid
    using REP MOVSB.  This undoes the ERMS optimisation added in commit
    d6397bd0e11c which turns out to be an anti-optimisation on these
    microarchitectures.
    
    However, retain the use of ERMS-based REP MOVSB in other cases such as
    copy_page_hot() where there parameter alignment is known to avoid the
    slowpath.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cb3ae9445ab07261188f1d4a54ca5741bc962cf2
    master date: 2026-01-07 14:45:27 +0100
---
 xen/arch/x86/cpu/amd.c                 | 4 ++++
 xen/arch/x86/cpu/intel.c               | 3 +++
 xen/arch/x86/include/asm/cpufeatures.h | 3 ++-
 xen/arch/x86/memcpy.S                  | 2 +-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 35b9dbf149..fb5c6acded 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1378,6 +1378,10 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	check_syscfg_dram_mod_en();
 
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS)
+	    && c->family != 0x19 /* Zen3/4 */)
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
+
 	amd_log_freq(c);
 }
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index ecca11f04d..b5b0b31eb9 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -684,6 +684,9 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	 */
 	if (c == &boot_cpu_data && c->vfm == INTEL_SKYLAKE_X)
 		setup_clear_cpu_cap(X86_FEATURE_CLWB);
+
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS))
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
 }
 
 const struct cpu_dev __initconst_cf_clobber intel_cpu_dev = {
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 0a98676c16..65534863c7 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -7,7 +7,7 @@
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
 /* Synthetic words follow the featureset words. */
-#define X86_NR_SYNTH 1
+#define X86_NR_SYNTH 2
 #define X86_SYNTH(x) (FSCAPINTS * 32 + (x))
 
 /* Synthetic features */
@@ -43,6 +43,7 @@ XEN_CPUFEATURE(IBPB_ENTRY_PV,     X86_SYNTH(28)) /* MSR_PRED_CMD used by Xen for
 XEN_CPUFEATURE(IBPB_ENTRY_HVM,    X86_SYNTH(29)) /* MSR_PRED_CMD used by Xen for HVM */
 XEN_CPUFEATURE(USE_VMCALL,        X86_SYNTH(30)) /* Use VMCALL instead of VMMCALL */
 XEN_CPUFEATURE(PDX_COMPRESSION,   X86_SYNTH(31)) /* PDX compression */
+XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy() */
 
 /* Bug words follow the synthetic words. */
 #define X86_NR_BUG 1
diff --git a/xen/arch/x86/memcpy.S b/xen/arch/x86/memcpy.S
index aaee012126..eefbb8c9ee 100644
--- a/xen/arch/x86/memcpy.S
+++ b/xen/arch/x86/memcpy.S
@@ -10,7 +10,7 @@ FUNC(memcpy)
          * precautions were taken).
          */
         ALTERNATIVE "and $7, %edx; shr $3, %rcx", \
-                    STR(rep movsb; RET), X86_FEATURE_ERMS
+                    STR(rep movsb; RET), X86_FEATURE_XEN_REP_MOVSB
         rep movsq
         or      %edx, %ecx
         jz      1f
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:55:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201863.1517437 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffoH-0000Yy-Lt; Tue, 13 Jan 2026 14:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201863.1517437; Tue, 13 Jan 2026 14:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffoH-0000Yq-JF; Tue, 13 Jan 2026 14:55:53 +0000
Received: by outflank-mailman (input) for mailman id 1201863;
 Tue, 13 Jan 2026 14:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vffoG-0000Yi-At
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffoG-001gFQ-22
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffoG-001jkN-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O/HUl/YNvLUgTREeQ4lo8xJ1f8n6BOxCHHB5n/KvX6A=; b=Ap1p1NAnTMZEPF0gO4xaVLbbia
	iTNw7vS1Nh3MlMciTFwL6tUHjAVUyYSVTgc0K8ad+IcQQit5QAGekKnmly7C5Zo5ewTiX4pVpV3QJ
	z6k9X7IwNVuqKuLwfybQ6N4S2jWTIOTtHe5NMh7GEhshVYQSdAfRqhl0e6ZgkFV4cd7k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/mm: reject XENMEM_claim_pages when using LLC coloring
Message-Id: <E1vffoG-001jkN-0r@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:55:52 +0000

commit e39831f5906f5e5536eea7d7ffb8d167dfb7e959
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:41:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:41:33 2026 +0100

    xen/mm: reject XENMEM_claim_pages when using LLC coloring
    
    The coloring allocator ignores claims; reject the usage of the hypercall if
    LLC coloring is enabled.  Note that the usage of alloc_color_heap_page() is
    selected at boot time, and it's a system wide decision.  Once enabled all
    domains will use alloc_color_heap_page() for allocations, which ignores any
    outstanding claims.
    
    The hypercall can be enabled if/when LLC coloring is adjusted to support
    claims.
    
    Fixes: 95debe51a936 ("xen: add cache coloring allocator for domains")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b068cafc737d51c76b40d3f9f821017bfa15814c
    master date: 2026-01-07 15:54:33 +0100
---
 xen/common/memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 3688e6dd50..3cb6fa9495 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -16,6 +16,7 @@
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
+#include <xen/llc-coloring.h>
 #include <xen/mem_access.h>
 #include <xen/mm.h>
 #include <xen/numa.h>
@@ -1660,6 +1661,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case XENMEM_claim_pages:
+        if ( llc_coloring_enabled )
+            return -EOPNOTSUPP;
+
         if ( unlikely(start_extent) )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:56:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201864.1517441 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffoR-0000bB-Nx; Tue, 13 Jan 2026 14:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201864.1517441; Tue, 13 Jan 2026 14:56:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffoR-0000b3-Kj; Tue, 13 Jan 2026 14:56:03 +0000
Received: by outflank-mailman (input) for mailman id 1201864;
 Tue, 13 Jan 2026 14:56:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vffoQ-0000av-DH
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:56:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffoQ-001gFk-2J
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffoQ-001jlU-17
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f2le/GgZ1VTvezzcRr+ic1FSQHEQkCNcdOPci/KLZGE=; b=MtbJDS+LAWHV5H+hOA10bhRFUb
	UdQ5JEM5v4ZXURXpizk6uPv5fRjnyzohroX7azqIfrS1s9eISF8NYo10+0w8/mJzMTb4ojzUt9MYe
	1LpexTqWWxzjPrVF1/t/YGAHAqyhbMEVCtH71sDKvjroqAJT9DXmGEhI5Na6PVtE3+dg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vffoQ-001jlU-17@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:56:02 +0000

commit b579e832dea70a977d1020396215cb36d1bc1c06
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:41:57 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:41:57 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c9491ea21a433168ef69639183a01848877cea14
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index ef35cd564b..86d8221b84 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2010,11 +2010,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:56:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201865.1517445 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffob-0000dg-Q4; Tue, 13 Jan 2026 14:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201865.1517445; Tue, 13 Jan 2026 14:56:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffob-0000dY-NM; Tue, 13 Jan 2026 14:56:13 +0000
Received: by outflank-mailman (input) for mailman id 1201865;
 Tue, 13 Jan 2026 14:56:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vffoa-0000dQ-GS
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:56:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffoa-001gFt-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffoa-001jmr-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j5gC5DaWXXpduVaAridcOX+b+QQCzFL0Z21sBSz3khc=; b=kmCKMrgt9eb9JvP0tN/WvjvX0v
	I3x0uNyG/xVojmcF0+m1WZ48q3LCOOaIg5tsa9MKjNU2/DsoPUt6tw3mGH6htp3syXeRQTMHjwRF9
	dh8a0aHF7Jh00yNjr3bk0mRG2cmEqJ8gIWVqVFvRLfvKdNVUL33a8kg9tKwFaduYclvw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vffoa-001jmr-1R@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:56:12 +0000

commit 82fe260552c460143a6bc4dd0d36bf8ed9d37de6
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:42:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:42:13 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 75d29d9b5e226bafa0fbf9fba25623229660b81e
    master date: 2026-01-08 11:05:30 +0100
---
 xen/common/page_alloc.c | 55 +++++++++++++++++++++++++------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1f67b88a89..2efc11ce09 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -515,30 +515,6 @@ unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->outstanding_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages || pages <= 0 )
-        goto out;
-
-    spin_lock(&heap_lock);
-    BUG_ON(outstanding_claims < d->outstanding_pages);
-    if ( d->outstanding_pages < pages )
-    {
-        /* `pages` exceeds the domain's outstanding count. Zero it out. */
-        outstanding_claims -= d->outstanding_pages;
-        d->outstanding_pages = 0;
-    }
-    else
-    {
-        outstanding_claims -= pages;
-        d->outstanding_pages -= pages;
-    }
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -548,9 +524,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1071,6 +1048,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 02bdc256ce..610f3d4c0d 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -402,7 +402,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:56:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:56:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201867.1517449 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffol-0000g2-RH; Tue, 13 Jan 2026 14:56:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201867.1517449; Tue, 13 Jan 2026 14:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffol-0000fu-Oj; Tue, 13 Jan 2026 14:56:23 +0000
Received: by outflank-mailman (input) for mailman id 1201867;
 Tue, 13 Jan 2026 14:56: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 1vffok-0000fm-JE
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:56: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 1vffok-001gFx-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffok-001joe-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=94Raj2fq9zQ+ft2esJHr46eTEsCo5K20fmtfjlfOnco=; b=SAlTitld7prdHz3FHcnHMakmiP
	Cybxz9u+63rnzJAJwchmSp6sIhqJM9nQpssGusVr+4XexAJkz9NPsNsQEOfHa/yeZI80yJP/q/2kE
	QUnBhg1HPinuaOb1hCf7GDiGqPlKFgPVYcp0W0m67a5QYOh+mg6+HwDFl65RwFH/e6f4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vffok-001joe-1j@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:56:22 +0000

commit fe0d8969022c52aca1a4f5a8f758701f01d1c9c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:42:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:42:35 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: bdd5f35cf20c7397a7f74fb80446c136688e3145
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 2635b2b95f..6849e8c010 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1310,7 +1310,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:56:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201868.1517452 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffow-0000iA-SZ; Tue, 13 Jan 2026 14:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201868.1517452; Tue, 13 Jan 2026 14:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffow-0000i2-Q4; Tue, 13 Jan 2026 14:56:34 +0000
Received: by outflank-mailman (input) for mailman id 1201868;
 Tue, 13 Jan 2026 14:56: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 1vffou-0000hs-M4
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:56: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 1vffou-001gG2-3B
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffou-001jp6-21
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q0PmEQIDz9RiP82Y5q6P2mXlib+CtBGTSzf6Y8ZzPgs=; b=56HT+0hdim+DlAm780ilxT5M6K
	QFB8JAxdQg6gLqni5qVOAby8Gk+J5Tro7lNEdblo5kbAnlje8kdr9qcqp97Ke//nkm71iUv5V5+At
	fPM5Y3XquEDydgFCmqvW30urIbqbVeLsq3v95xmZ/lehKHNWGdbOLnYyh5zL7d4MtKfQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86: fix incorrect return value for has_if_pschange_mc
Message-Id: <E1vffou-001jp6-21@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:56:32 +0000

commit c692a6786b1c40b3b481856f40fc8a2fad6a0333
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Tue Jan 13 15:42:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:42:55 2026 +0100

    x86: fix incorrect return value for has_if_pschange_mc
    
    The Atom block used to fall through into the Phi block to get to it's
    return false, and this was accidentally dropped with the Phi removal.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a2a34d76643e49ccc949296c9a45888034e50b55
    master date: 2026-01-12 13:07:36 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e2b5077654..a4f606720f 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3054,6 +3054,7 @@ static bool __init has_if_pschange_mc(void)
     case 0x75: /* Lightning Mountain */
     case 0x7a: /* Gemini Lake */
     case 0x86: /* Jacobsville */
+        return false;
 
     default:
         printk("Unrecognised CPU model %#x - assuming vulnerable to IF_PSCHANGE_MC\n",
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:56:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201869.1517457 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffp6-0000ka-Tt; Tue, 13 Jan 2026 14:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201869.1517457; Tue, 13 Jan 2026 14:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffp6-0000kS-RN; Tue, 13 Jan 2026 14:56:44 +0000
Received: by outflank-mailman (input) for mailman id 1201869;
 Tue, 13 Jan 2026 14:56: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 1vffp5-0000kK-4L
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:56: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 1vffp5-001gGS-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffp5-001jqc-0F
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TaHe08JT1YbQJYzstczbHffJtsbl6fLS7BGHpH3vsnw=; b=OtDfFT/0Hoi5/UY2OJsfwXuEpC
	H6wbdw3PRzm5LFKkUJ3cMPJIG30HaRjVBrUUDX08EgtOXAgTUh0N2FRVvCZU4C40P+yFk6+BPk5xk
	AzlbkSm+BGaiJpB6P17MUwCqZq+ddV39rHd3MmAIPir/hbd2VxLNc9XLbG5bIRey+8R0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/pod: fix decrease_reservation() clearing of M2P entries
Message-Id: <E1vffp5-001jqc-0F@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:56:43 +0000

commit a13ce6cee8eadb5620d2d2ffa620e95bb0dddcff
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:44:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:44:43 2026 +0100

    x86/pod: fix decrease_reservation() clearing of M2P entries
    
    Add the missing index increase in the M2P clearing loop, otherwise the loop
    keeps pointlessly setting the same MFN entry repeatedly.  This seems to be
    an oversight from the change that introduced support to process high order
    pages in one go.
    
    Fixes: 3c352011c0d3 ("x86/PoD: shorten certain operations on higher order ranges")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d495cb8f70280482edae12b48f422b5715099
    master date: 2025-12-11 09:50:10 +0100
---
 xen/arch/x86/mm/p2m-pod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index df2a1cc074..fa2b9a2728 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -655,7 +655,7 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
             }
             p2m_tlb_flush_sync(p2m);
             for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+                set_gpfn_from_mfn(mfn_x(mfn) + j, INVALID_M2P_ENTRY);
             p2m_pod_cache_add(p2m, page, cur_order);
 
             ioreq_request_mapcache_invalidate(d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:56:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201870.1517461 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffpF-0000me-VW; Tue, 13 Jan 2026 14:56:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201870.1517461; Tue, 13 Jan 2026 14:56: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 1vffpF-0000mW-Sf; Tue, 13 Jan 2026 14:56:53 +0000
Received: by outflank-mailman (input) for mailman id 1201870;
 Tue, 13 Jan 2026 14:56: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 1vffpF-0000mP-90
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:56: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 1vffpF-001gGW-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffpF-001jrt-0X
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:56:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RKBTByPZRapXqc4vnl3/4FTGOickzDQraOQEb2mE2Ik=; b=hqnxKT3X+ORweEAQ56MsIhR6Rf
	v0yFP/WiIbI1PKinNRYaX7FnY/U78biKdKl8DD/lqLnQkgsJKr2oUIvbgvzoB74aQlf7ER8oj+zfl
	hFp5Obb71P2R8mUOuDHoBS7WidvuQ65+g7BkgD2+3krVzQPh0A5M6CT4NCiyiYsCggYU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/mm: update log-dirty bitmap when manipulating P2M
Message-Id: <E1vffpF-001jrt-0X@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:56:53 +0000

commit c31086c50b9d6a1219be429b8e903c5893b36c25
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:45:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:45:05 2026 +0100

    x86/mm: update log-dirty bitmap when manipulating P2M
    
    Just like for PV guests MMU_MACHPHYS_UPDATE implies marking of the
    respective page as dirty, additions to a HVM guest's P2M should do so.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    [jb: backport limited to the new paging_mark_pfn_dirty() use]
    master commit: 98fccdf0ac7c1a909b54dd5beeba54a0a23f756c
    master date: 2025-12-11 09:50:30 +0100
---
 xen/arch/x86/mm/p2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 41fc108bba..8c31bf808d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -738,8 +738,11 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
         if ( !p2m_is_grant(t) )
         {
             for ( i = 0; i < (1UL << page_order); i++ )
+            {
                 set_gpfn_from_mfn(mfn_x(mfn_add(mfn, i)),
                                   gfn_x(gfn_add(gfn, i)));
+                paging_mark_pfn_dirty(d, _pfn(gfn_x(gfn) + i));
+            }
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:57:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:57:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201871.1517465 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffpQ-0000oo-0m; Tue, 13 Jan 2026 14:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201871.1517465; Tue, 13 Jan 2026 14:57: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 1vffpP-0000og-UP; Tue, 13 Jan 2026 14:57:03 +0000
Received: by outflank-mailman (input) for mailman id 1201871;
 Tue, 13 Jan 2026 14:57: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 1vffpP-0000oa-Ba
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:57: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 1vffpP-001gGo-29
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffpP-001jt1-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X70XaqLHHSgVfnSL2swY36Tfw9CwqeqjPvw8D8lOmYA=; b=DzIebMEtD9lu1W0N7m3TYaPsmW
	8/UptwPU4xC2aqvs5UFegii71hzxTmoY5XEykHn9IbqHaAwKGT9gWdAEH/8Qx23usm4qdQbo1D508
	l6j3UhEgOS5fh37o9goQ5qf+xaYHDwXjPt9YdpPZE0h+gmOzEARuAZ71srbbFgt4lAa8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/x86: Pass TPM ACPI table to PVH dom0
Message-Id: <E1vffpP-001jt1-0y@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:57:03 +0000

commit 23989412fb7671f99434c5996c3f6d7d80bb7008
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Jan 13 15:45:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:45:31 2026 +0100

    xen/x86: Pass TPM ACPI table to PVH dom0
    
    Pass the TPM2 ACPI table so that the device can be found by a PVH dom0.
    
    Otherwise dom0 shows:
    tpm_tis MSFT0101:00: [Firmware Bug]: failed to get TPM2 ACPI table
    tpm_tis MSFT0101:00: probe with driver tpm_tis failed with error -22
    
    TCPA is "Trusted Computing Platform Alliance table", but it is really
    the table for a TPM 1.2.  Pass that as well.
    
    While doing this, move ACPI_SIG_WPBT to alpabetize the entries.
    
    This exposes TPM event log tables on PVH dom0, bring it in line with a
    PV dom0.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 46f3ed0d53db6daf38c230dff0d2910bcb61fbe2
    master date: 2025-12-16 09:40:18 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 xen/include/acpi/actbl3.h     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 7551cbe167..b85b887dc8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1014,7 +1014,7 @@ static bool __init pvh_acpi_table_allowed(const char *sig,
         ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_FACS, ACPI_SIG_PSDT,
         ACPI_SIG_SSDT, ACPI_SIG_SBST, ACPI_SIG_MCFG, ACPI_SIG_SLIC,
         ACPI_SIG_MSDM, ACPI_SIG_WDAT, ACPI_SIG_FPDT, ACPI_SIG_S3PT,
-        ACPI_SIG_VFCT,
+        ACPI_SIG_TCPA, ACPI_SIG_TPM2, ACPI_SIG_VFCT,
     };
     unsigned int i;
 
diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 6858d3e60f..636d3f5f5b 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -78,8 +78,10 @@
 #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
 #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
 #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
-#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
+#define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"	/* Trusted Platform Module 2.0 H/W interface table */
 #define ACPI_SIG_VFCT           "VFCT"	/* AMD Video BIOS */
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:57:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:57:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201872.1517469 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffpa-0000qr-2H; Tue, 13 Jan 2026 14:57:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201872.1517469; Tue, 13 Jan 2026 14:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffpZ-0000qj-Vm; Tue, 13 Jan 2026 14:57:13 +0000
Received: by outflank-mailman (input) for mailman id 1201872;
 Tue, 13 Jan 2026 14:57: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 1vffpZ-0000qd-EH
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:57: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 1vffpZ-001gGs-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffpZ-001jtp-1F
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RO/tBkMuNIguGkrEdRPeRRDE68gl8OcgPkC3tDb3nRU=; b=csjRDBPo/wmVb26I8AGcpRoCQe
	8jvqthEeIHR3j6dbh2jic+1/IDJKKRJiqI9jd9/FOiclaqn8L9a4PkEFglrWTlsGNsVLThNVYvkuu
	4zAXv67B3nanNDnOQamR3WQAajLOht/uFfkKB/gZZUA5Fakp7J9Mgp5li7IbKHuY4Fgg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/mm: reject XENMEM_claim_pages when using LLC coloring
Message-Id: <E1vffpZ-001jtp-1F@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:57:13 +0000

commit 84436dea9f15a7d245e30e14ffc698da0b12704b
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:46:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:07 2026 +0100

    xen/mm: reject XENMEM_claim_pages when using LLC coloring
    
    The coloring allocator ignores claims; reject the usage of the hypercall if
    LLC coloring is enabled.  Note that the usage of alloc_color_heap_page() is
    selected at boot time, and it's a system wide decision.  Once enabled all
    domains will use alloc_color_heap_page() for allocations, which ignores any
    outstanding claims.
    
    The hypercall can be enabled if/when LLC coloring is adjusted to support
    claims.
    
    Fixes: 95debe51a936 ("xen: add cache coloring allocator for domains")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b068cafc737d51c76b40d3f9f821017bfa15814c
    master date: 2026-01-07 15:54:33 +0100
---
 xen/common/memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 8ca4e1a842..1165ef200f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -16,6 +16,7 @@
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
+#include <xen/llc-coloring.h>
 #include <xen/mem_access.h>
 #include <xen/mm.h>
 #include <xen/numa.h>
@@ -1658,6 +1659,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case XENMEM_claim_pages:
+        if ( llc_coloring_enabled )
+            return -EOPNOTSUPP;
+
         if ( unlikely(start_extent) )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:57:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201873.1517473 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffpk-0000wK-59; Tue, 13 Jan 2026 14:57:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201873.1517473; Tue, 13 Jan 2026 14:57: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 1vffpk-0000wC-2J; Tue, 13 Jan 2026 14:57:24 +0000
Received: by outflank-mailman (input) for mailman id 1201873;
 Tue, 13 Jan 2026 14:57: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 1vffpj-0000w6-Gm
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:57: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 1vffpj-001gGw-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffpj-001juY-1W
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57: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=6zis0jGVRBENNZgbQIJBwdmhDBif4pU1Zn5boTPHUT8=; b=nvTyZDsV0xHihseJ8ZhA1VZulA
	d3U2zUwoIXG7ow+BxsXXYvkpkeJOeogoGiuaOxfhB9cKCehKZyl60cKicyYEJ4mW18czntOHIBJ1A
	CwHOuoOSd0BteuyCjMaCqDag5hA9k2ssNIJLW8+6NSVrfGCasjNzRNvUbqs3EAbdZJQ8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vffpj-001juY-1W@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:57:23 +0000

commit 219510a9d6ae6d0c2e05b7d0e89da5b9e0c647c8
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:46:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:23 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c9491ea21a433168ef69639183a01848877cea14
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8c31bf808d..8d225d2d6c 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1990,11 +1990,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:57:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:57:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201874.1517476 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffpu-00013v-6P; Tue, 13 Jan 2026 14:57:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201874.1517476; Tue, 13 Jan 2026 14:57: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 1vffpu-00013n-3h; Tue, 13 Jan 2026 14:57:34 +0000
Received: by outflank-mailman (input) for mailman id 1201874;
 Tue, 13 Jan 2026 14:57: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 1vffpt-00013h-Je
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:57: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 1vffpt-001gH6-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffpt-001jxQ-1m
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57: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=dbn8bkWlrgBMGQFZLu1RqpJhePtc/5SkQUJjz6w+D5s=; b=uua78+zerUohQFiB7GYCAsfcbW
	WYouTJN6hZiFz6jmlIBHcuFJJOMaqJJnYEsjNG6c78kTd4ROr7mCYMiTKzegjzqeaD71uRH3FyAwJ
	aM09XoU5epMbkE004mi6diTPaNIGTqTXmcjjfAdBA7xPkU3nD4z7A7M82BzXOE+k4mrY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vffpt-001jxQ-1m@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:57:33 +0000

commit 39748952e917e57d4def03f2bd993c11313a8a47
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:46:37 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:37 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 75d29d9b5e226bafa0fbf9fba25623229660b81e
    master date: 2026-01-08 11:05:30 +0100
---
 xen/common/page_alloc.c | 56 ++++++++++++++++++++++++-------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1bf070c8c5..6919722e9a 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -490,34 +490,9 @@ static long outstanding_claims; /* total outstanding claims by all domains */
 
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
 {
-    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
-
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->claimed_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages )
-        goto out;
-
-    spin_lock(&heap_lock);
-    /* adjust domain outstanding pages; may not go negative */
-    dom_before = d->outstanding_pages;
-    dom_after = dom_before - pages;
-    BUG_ON(dom_before < 0);
-    dom_claimed = dom_after < 0 ? 0 : dom_after;
-    d->outstanding_pages = dom_claimed;
-    /* flag accounting bug if system outstanding_claims would go negative */
-    sys_before = outstanding_claims;
-    sys_after = sys_before - (dom_before - dom_claimed);
-    BUG_ON(sys_after < 0);
-    outstanding_claims = sys_after;
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -527,9 +502,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1044,6 +1020,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 037c83fda2..de621eb123 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -396,7 +396,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:57:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:57:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201875.1517481 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffq4-0001DD-7m; Tue, 13 Jan 2026 14:57:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201875.1517481; Tue, 13 Jan 2026 14:57: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 1vffq4-0001D5-56; Tue, 13 Jan 2026 14:57:44 +0000
Received: by outflank-mailman (input) for mailman id 1201875;
 Tue, 13 Jan 2026 14:57: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 1vffq3-0001Cj-MM
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:57: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 1vffq4-001gHR-00
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffq3-001jyF-22
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57: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=GRJ0FXDh05ANlliVJG1Vei6Ki3dpSj37+/G00pNdGpA=; b=0k7FhOjS9Q0IC3AG7Y/bRDeza8
	Ijb/0h6CI7+9n8MK8SZtgMDkf26rIFnpxUzyGP7N5NreZ3b0M1XTJBtl+IbdBJexIfQ/Fl7vkaHFl
	ZQvH3Fttq20Jyz1rCXQAO4A0u7hYqkloaFPiFN17/52xAGxRawrmr0flLu9Jec4NoAZo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vffq3-001jyF-22@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:57:43 +0000

commit f54c59f2ca6c26c383e9d05cea63187a850abd4b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:46:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:58 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: bdd5f35cf20c7397a7f74fb80446c136688e3145
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index b85b887dc8..c6f8af9a96 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1311,7 +1311,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:57:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:57:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201876.1517485 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffqE-0001FN-9A; Tue, 13 Jan 2026 14:57:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201876.1517485; Tue, 13 Jan 2026 14:57: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 1vffqE-0001FF-6R; Tue, 13 Jan 2026 14:57:54 +0000
Received: by outflank-mailman (input) for mailman id 1201876;
 Tue, 13 Jan 2026 14:57: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 1vffqD-0001F9-Ox
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:57: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 1vffqE-001gHX-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffqD-001jyb-2K
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:57: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=h2bBppyEwrT9cDbfpf7IjpZWL2jxvcrOp6x2CPnjLiU=; b=P1vSxB9opZlrGftDvo739+Uwnh
	7ZPSTJyER88ksIfKfj+JQ7hhhMHJKWYFjmZx9j4xa4PxhTB/p+m5oTa4oCSIUl/l8i/9dClDvm5o2
	3IZ9HQc3xoUiiibF1Chhsh3Vw68M9BVfb5Cpi9xf4bX8J9ygVLKkj41wgFrrDMg+w1Qk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86: fix incorrect return value for has_if_pschange_mc
Message-Id: <E1vffqD-001jyb-2K@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:57:53 +0000

commit 0cb467d86df393fc2c577fd707a951c5dfa5fdc8
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Tue Jan 13 15:47:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:47:17 2026 +0100

    x86: fix incorrect return value for has_if_pschange_mc
    
    The Atom block used to fall through into the Phi block to get to it's
    return false, and this was accidentally dropped with the Phi removal.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a2a34d76643e49ccc949296c9a45888034e50b55
    master date: 2026-01-12 13:07:36 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 962b7f543c..338dd79422 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2979,6 +2979,7 @@ static bool __init has_if_pschange_mc(void)
     case 0x75: /* Lightning Mountain */
     case 0x7a: /* Gemini Lake */
     case 0x86: /* Jacobsville */
+        return false;
 
     default:
         printk("Unrecognised CPU model %#x - assuming vulnerable to IF_PSCHANGE_MC\n",
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:58:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:58:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201877.1517489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffqP-0001HY-AW; Tue, 13 Jan 2026 14:58:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201877.1517489; Tue, 13 Jan 2026 14:58: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 1vffqP-0001HO-7s; Tue, 13 Jan 2026 14:58:05 +0000
Received: by outflank-mailman (input) for mailman id 1201877;
 Tue, 13 Jan 2026 14:58: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 1vffqO-0001HH-7B
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:58: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 1vffqO-001gHo-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffqO-001k1O-0Y
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N95HmISP6S9y5LdGD+ThJn5ii5yqX4zTgnxyoHJNQkU=; b=Z45QsksESji/DdrCH40/L+uInZ
	fGbAzJ7O6eKyoYeVyenauuRmKE0xnriqUbB7NlZzSy8NH8UcBUI3UTvgoW7fG6P+jNInJnZVTbF7e
	7sK7VovpooGj0hcVSYPB5t5guKUE2Tq2G1+NlaCC14a834e+LPoKcsJgdSxxuaayZViw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] update Xen version to 4.19.5-pre
Message-Id: <E1vffqO-001k1O-0Y@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:58:04 +0000

commit 331ffed3cf3bf77fdca95692cb2e9a7318ccba33
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:48:11 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:48:11 2026 +0100

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

diff --git a/xen/Makefile b/xen/Makefile
index 1a484cd6e6..61a7dced35 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    = 19
-export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:58:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:58:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201878.1517492 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffqZ-0001Je-Bj; Tue, 13 Jan 2026 14:58:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201878.1517492; Tue, 13 Jan 2026 14:58: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 1vffqZ-0001JW-9G; Tue, 13 Jan 2026 14:58:15 +0000
Received: by outflank-mailman (input) for mailman id 1201878;
 Tue, 13 Jan 2026 14:58: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 1vffqY-0001JQ-9s
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:58: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 1vffqY-001gHx-1y
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffqY-001k27-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DMzafe1pJcNeZTHrIKAYvrIfucb7dsIGoxqYS3NP21U=; b=DxTAxqYPZ3eZJknPpqTN90NUo7
	kwaOsk1PS15kxh6DePpl+OuD0iNVW0d2ppVa22TpPgM3vItp8lr+X9blocFK+N1LuV3e3tXjJI8Id
	JAIDWzMmOLCvLzfdRUlaD2DEeGHeY+c/NfhBZbYGe/YooRd+51sNbAw/7w2GVE4dEK9w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/pod: fix decrease_reservation() clearing of M2P entries
Message-Id: <E1vffqY-001k27-0o@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:58:14 +0000

commit 40c5e35d0ff749d330b42810482be6300616288a
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:49:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:49:10 2026 +0100

    x86/pod: fix decrease_reservation() clearing of M2P entries
    
    Add the missing index increase in the M2P clearing loop, otherwise the loop
    keeps pointlessly setting the same MFN entry repeatedly.  This seems to be
    an oversight from the change that introduced support to process high order
    pages in one go.
    
    Fixes: 3c352011c0d3 ("x86/PoD: shorten certain operations on higher order ranges")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d495cb8f70280482edae12b48f422b5715099
    master date: 2025-12-11 09:50:10 +0100
---
 xen/arch/x86/mm/p2m-pod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index bd84fe9e27..8b2641dbbd 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -655,7 +655,7 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
             }
             p2m_tlb_flush_sync(p2m);
             for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+                set_gpfn_from_mfn(mfn_x(mfn) + j, INVALID_M2P_ENTRY);
             p2m_pod_cache_add(p2m, page, cur_order);
 
             ioreq_request_mapcache_invalidate(d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:58:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:58:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201879.1517497 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffqj-0001Ls-DO; Tue, 13 Jan 2026 14:58:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201879.1517497; Tue, 13 Jan 2026 14:58: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 1vffqj-0001Lk-Ae; Tue, 13 Jan 2026 14:58:25 +0000
Received: by outflank-mailman (input) for mailman id 1201879;
 Tue, 13 Jan 2026 14:58: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 1vffqi-0001Lc-CS
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:58: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 1vffqi-001gI1-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffqi-001k30-13
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58: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=gT/mH3jZz2MUx0Ktxn0PBMy5ZtdJ3WWjegFClJvib38=; b=1ZvM9xEiLFNZds/j6EfJ6CXuNK
	8n0kEvZYG/dHCguIvRyjZUZo7Z7OLJuVX9IOc9M5sdLUQYUWLZz7xbYCRLTFgE/vNZELGxj3ezUdR
	2R1YdfVoRZWFFFNeLvh9XWS9+CoDkvrUsUPDeqpP5bHcUlMF8g9GgDjr95CECRSc+FZo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/mm: update log-dirty bitmap when manipulating P2M
Message-Id: <E1vffqi-001k30-13@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:58:24 +0000

commit c2affd2788324c46a256826e171ef9105a9e37be
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:49:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:49:30 2026 +0100

    x86/mm: update log-dirty bitmap when manipulating P2M
    
    Just like for PV guests MMU_MACHPHYS_UPDATE implies marking of the
    respective page as dirty, additions to a HVM guest's P2M should do so.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    [jb: backport limited to the new paging_mark_pfn_dirty() use]
    master commit: 98fccdf0ac7c1a909b54dd5beeba54a0a23f756c
    master date: 2025-12-11 09:50:30 +0100
---
 xen/arch/x86/mm/p2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 41fc108bba..8c31bf808d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -738,8 +738,11 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
         if ( !p2m_is_grant(t) )
         {
             for ( i = 0; i < (1UL << page_order); i++ )
+            {
                 set_gpfn_from_mfn(mfn_x(mfn_add(mfn, i)),
                                   gfn_x(gfn_add(gfn, i)));
+                paging_mark_pfn_dirty(d, _pfn(gfn_x(gfn) + i));
+            }
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:58:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:58:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201880.1517501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffqt-0001Nw-EZ; Tue, 13 Jan 2026 14:58:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201880.1517501; Tue, 13 Jan 2026 14:58: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 1vffqt-0001No-C0; Tue, 13 Jan 2026 14:58:35 +0000
Received: by outflank-mailman (input) for mailman id 1201880;
 Tue, 13 Jan 2026 14:58: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 1vffqs-0001Ng-Ey
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:58: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 1vffqs-001gI5-2U
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffqs-001k3y-1K
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58: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=ASHfJeEihsWoz4uS1QNUJv9QBPygIKJfY5RzQvdic90=; b=EIlM+TnOUnJCqdOjOxjLj37c38
	sja1WzhiHIcYod1HNxrSjjDKflPxVM9sg5qRZyK804wp94H1HEiMgoh1elPdDVH66U8m5HbqndfPP
	M4ettpN8oxYcsqeii4U+U+JLw4L/uIxA5rAG/gl3dIbLG8ymfsuEy1Dj0lMUGLe7TddM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/x86: Pass TPM ACPI table to PVH dom0
Message-Id: <E1vffqs-001k3y-1K@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:58:34 +0000

commit 9135f73d99ad27c37d33829a030337d3f8dbeeab
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Jan 13 15:49:46 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:49:46 2026 +0100

    xen/x86: Pass TPM ACPI table to PVH dom0
    
    Pass the TPM2 ACPI table so that the device can be found by a PVH dom0.
    
    Otherwise dom0 shows:
    tpm_tis MSFT0101:00: [Firmware Bug]: failed to get TPM2 ACPI table
    tpm_tis MSFT0101:00: probe with driver tpm_tis failed with error -22
    
    TCPA is "Trusted Computing Platform Alliance table", but it is really
    the table for a TPM 1.2.  Pass that as well.
    
    While doing this, move ACPI_SIG_WPBT to alpabetize the entries.
    
    This exposes TPM event log tables on PVH dom0, bring it in line with a
    PV dom0.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 46f3ed0d53db6daf38c230dff0d2910bcb61fbe2
    master date: 2025-12-16 09:40:18 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 xen/include/acpi/actbl3.h     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 2b4505ebbf..a965cff45f 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1013,7 +1013,7 @@ static bool __init pvh_acpi_table_allowed(const char *sig,
         ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_FACS, ACPI_SIG_PSDT,
         ACPI_SIG_SSDT, ACPI_SIG_SBST, ACPI_SIG_MCFG, ACPI_SIG_SLIC,
         ACPI_SIG_MSDM, ACPI_SIG_WDAT, ACPI_SIG_FPDT, ACPI_SIG_S3PT,
-        ACPI_SIG_VFCT,
+        ACPI_SIG_TCPA, ACPI_SIG_TPM2, ACPI_SIG_VFCT,
     };
     unsigned int i;
 
diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 6858d3e60f..636d3f5f5b 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -78,8 +78,10 @@
 #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
 #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
 #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
-#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
+#define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"	/* Trusted Platform Module 2.0 H/W interface table */
 #define ACPI_SIG_VFCT           "VFCT"	/* AMD Video BIOS */
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:58:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:58:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201881.1517505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffr3-0001Qu-HE; Tue, 13 Jan 2026 14:58:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201881.1517505; Tue, 13 Jan 2026 14:58: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 1vffr3-0001Qm-Eh; Tue, 13 Jan 2026 14:58:45 +0000
Received: by outflank-mailman (input) for mailman id 1201881;
 Tue, 13 Jan 2026 14:58: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 1vffr2-0001Qe-HJ
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:58: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 1vffr2-001gIS-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffr2-001k4l-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58: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=G8yR5j0nlIjFe9GbH+qoWC6a3RRyRqR9hRwIKtXngBk=; b=5oOMLE4I3WLWJ2VX5VOBndVSwq
	yTKZY7c+Lmpn7vpm96CdDMQr/t3x+rDILOjy5lhF+gdtM0p4F9F3+exjeTsXDPkxk+OO4EDi1J/AZ
	r618XvZe3Jv+UyViZ9AZgJgFaRtXphahiv2jvqgoVxRf8wkKhcmq+CZSkgxJaDyitx/Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vffr2-001k4l-1a@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:58:44 +0000

commit 072dbe798363098ea83c8128d6677e331231d135
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:50:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:50:23 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c9491ea21a433168ef69639183a01848877cea14
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8c31bf808d..8d225d2d6c 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1990,11 +1990,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:58:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:58:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201882.1517509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffrD-0001UW-Ip; Tue, 13 Jan 2026 14:58:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201882.1517509; Tue, 13 Jan 2026 14:58: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 1vffrD-0001UN-G5; Tue, 13 Jan 2026 14:58:55 +0000
Received: by outflank-mailman (input) for mailman id 1201882;
 Tue, 13 Jan 2026 14:58: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 1vffrC-0001UF-Jm
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:58: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 1vffrC-001gIW-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffrC-001k5k-1p
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:58: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=PAb8jyViwdTGjgYJcLy1tKZn3xI6gLAmrXZpZ8QhMUc=; b=lb9Ra9icNIiJXyFayIhEceOOVI
	Cl2kaQGZy5CIR7szPGF+c8MA6f3xRY/d4Pb0ZhNfgz0pB9Pl7cCnfT2gZ6z8ktQuMeWsgepr2BMDq
	8vGNDPi3RcL7NclZ6xmBakmFPjx6ehk6kcf4Xa7DTo8P7cjx0dBg4IkA6rM0HGY7IB1U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vffrC-001k5k-1p@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:58:54 +0000

commit 999fdfb104cfbdfb5e4c495e6d065e63c1a51c6d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:50:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:50:36 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 75d29d9b5e226bafa0fbf9fba25623229660b81e
    master date: 2026-01-08 11:05:30 +0100
---
 xen/common/page_alloc.c | 56 ++++++++++++++++++++++++-------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 054b7edb39..bbb8578459 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -475,34 +475,9 @@ static long outstanding_claims; /* total outstanding claims by all domains */
 
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
 {
-    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
-
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->claimed_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages )
-        goto out;
-
-    spin_lock(&heap_lock);
-    /* adjust domain outstanding pages; may not go negative */
-    dom_before = d->outstanding_pages;
-    dom_after = dom_before - pages;
-    BUG_ON(dom_before < 0);
-    dom_claimed = dom_after < 0 ? 0 : dom_after;
-    d->outstanding_pages = dom_claimed;
-    /* flag accounting bug if system outstanding_claims would go negative */
-    sys_before = outstanding_claims;
-    sys_after = sys_before - (dom_before - dom_claimed);
-    BUG_ON(sys_after < 0);
-    outstanding_claims = sys_after;
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -512,9 +487,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1014,6 +990,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2dcd1d1a4f..2a83b9dacf 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -393,7 +393,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 14:59:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 14:59:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1201883.1517512 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vffrN-0001X3-K6; Tue, 13 Jan 2026 14:59:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1201883.1517512; Tue, 13 Jan 2026 14:59: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 1vffrN-0001Wu-HS; Tue, 13 Jan 2026 14:59:05 +0000
Received: by outflank-mailman (input) for mailman id 1201883;
 Tue, 13 Jan 2026 14:59: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 1vffrM-0001Wm-Mk
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 14:59: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 1vffrM-001gIm-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:59:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vffrM-001k6j-23
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 14:59: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=Ql5aPD6+3/XGuDS6yv+QwI9AKxOdrjtZXDglU90H0oY=; b=mMt3XJFhk01SzgK59G2/mSjIIF
	oHgfro0znH0BTAb1FZmld3ww+OQTCr5uCKUtcPH6L4IRPd1noM2VO0KSdGQt2JKhmef553MOFdRG8
	FFIU1drklTP5AexEuM6C2PF9Y9jZS5ShTM9cmlNf7x1+6h5OXTzhtvhgxN28vqj0pdUY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vffrM-001k6j-23@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 14:59:04 +0000

commit bc8363a41a8992b4eade2d059b74acaa1887fadc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:50:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:50:54 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: bdd5f35cf20c7397a7f74fb80446c136688e3145
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index a965cff45f..82cda30343 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1310,7 +1310,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202056.1517647 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfh9f-0002wO-Cj; Tue, 13 Jan 2026 16:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202056.1517647; Tue, 13 Jan 2026 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 1vfh9f-0002wG-A0; Tue, 13 Jan 2026 16:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1202056;
 Tue, 13 Jan 2026 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 1vfh9e-0002wA-2l
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vfh9e-001iHE-12
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfh9d-001pSE-31
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 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=VrylwO0K9rq3bySjJ957XGmvKlFIicDRMvFr/emoaqg=; b=Zyg4LJUKilAq7dwrrN2Ntl+gqX
	S/U2ROYJXwVlshCZ2LTdVDOxrBz4/xCf8KAsHHMMGaZxdX6axZSD3rUKEOf9N6z1sHEuIbbtpkG5V
	cE/KCorEFXzTBHNNeTcUQJzckSOxeUKV4Sawl70b+L80QLCABRkvXZn0pw3cRngpbDzE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/pod: fix decrease_reservation() clearing of M2P entries
Message-Id: <E1vfh9d-001pSE-31@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:22:01 +0000

commit 79903304784c1a1ee17c16c8371c0852d6d5a655
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:39:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:39:31 2026 +0100

    x86/pod: fix decrease_reservation() clearing of M2P entries
    
    Add the missing index increase in the M2P clearing loop, otherwise the loop
    keeps pointlessly setting the same MFN entry repeatedly.  This seems to be
    an oversight from the change that introduced support to process high order
    pages in one go.
    
    Fixes: 3c352011c0d3 ("x86/PoD: shorten certain operations on higher order ranges")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d495cb8f70280482edae12b48f422b5715099
    master date: 2025-12-11 09:50:10 +0100
---
 xen/arch/x86/mm/p2m-pod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 05633fe2ac..22dde913cc 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -655,7 +655,7 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
             }
             p2m_tlb_flush_sync(p2m);
             for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+                set_gpfn_from_mfn(mfn_x(mfn) + j, INVALID_M2P_ENTRY);
             p2m_pod_cache_add(p2m, page, cur_order);
 
             ioreq_request_mapcache_invalidate(d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202057.1517651 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfh9p-0002y6-Du; Tue, 13 Jan 2026 16:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202057.1517651; Tue, 13 Jan 2026 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 1vfh9p-0002xy-BK; Tue, 13 Jan 2026 16:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1202057;
 Tue, 13 Jan 2026 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 1vfh9o-0002xq-3t
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vfh9o-001iHI-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfh9o-001pTT-07
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 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=sOeHNTbhbpjqif/cM9FAErOXUNzxmysbRcxwjYJieCw=; b=CSch6KGxceYNm81b5OnU2zfrSC
	jYpWf8DA0bpQzgaKY/x74aXEbZN00eAgZd5NrhWM0BlAK6j3YpAqBbFYzwMsNDbL0y3DayxkByfgK
	LxLc5CyYuDghxbsvg3PeoInzToTKU4U7O4Ig4fkEXCIJh6/35V7k7W0KhLzxFPTO1dQY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/mm: update log-dirty bitmap when manipulating P2M
Message-Id: <E1vfh9o-001pTT-07@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:22:12 +0000

commit 1cacccbace841bf85fbbef871dfe5be648abf232
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:39:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:39:54 2026 +0100

    x86/mm: update log-dirty bitmap when manipulating P2M
    
    Just like for PV guests MMU_MACHPHYS_UPDATE implies marking of the
    respective page as dirty, additions to a HVM guest's P2M should do so.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    [jb: backport limited to the new paging_mark_pfn_dirty() use]
    master commit: 98fccdf0ac7c1a909b54dd5beeba54a0a23f756c
    master date: 2025-12-11 09:50:30 +0100
---
 xen/arch/x86/mm/p2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index e2a00a0efd..ef35cd564b 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -753,8 +753,11 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
         if ( !p2m_is_grant(t) )
         {
             for ( i = 0; i < (1UL << page_order); i++ )
+            {
                 set_gpfn_from_mfn(mfn_x(mfn_add(mfn, i)),
                                   gfn_x(gfn_add(gfn, i)));
+                paging_mark_pfn_dirty(d, _pfn(gfn_x(gfn) + i));
+            }
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202058.1517654 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfh9z-00030E-FB; Tue, 13 Jan 2026 16:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202058.1517654; Tue, 13 Jan 2026 16:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfh9z-000307-Cf; Tue, 13 Jan 2026 16:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1202058;
 Tue, 13 Jan 2026 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 1vfh9y-000301-6t
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vfh9y-001iHM-1d
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfh9y-001pTx-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 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=EenoxDw1eFQ7HkWGVUcRkXt+3clD5tqiRfCnbOxcvSs=; b=qezlki9t44yu45bGJB1ERhOoEV
	luQuovuWMeA6TyxiIdoHIqVZSTmiJItgmb3RXu3mSv1IrB7xD9V2fF2LQfMBibIMIcAnSAkECfbbN
	ePolcDCwWwjwKNdgZk2G9w1hG0+TGTSSOdccuSMMZQkiOdCJ3niLEKXT6t23041nrfnA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/x86: Pass TPM ACPI table to PVH dom0
Message-Id: <E1vfh9y-001pTx-0S@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:22:22 +0000

commit 7ab1f4939aa0dbbf7f4222dad1b354b01790d9d3
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Jan 13 15:40:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:40:14 2026 +0100

    xen/x86: Pass TPM ACPI table to PVH dom0
    
    Pass the TPM2 ACPI table so that the device can be found by a PVH dom0.
    
    Otherwise dom0 shows:
    tpm_tis MSFT0101:00: [Firmware Bug]: failed to get TPM2 ACPI table
    tpm_tis MSFT0101:00: probe with driver tpm_tis failed with error -22
    
    TCPA is "Trusted Computing Platform Alliance table", but it is really
    the table for a TPM 1.2.  Pass that as well.
    
    While doing this, move ACPI_SIG_WPBT to alpabetize the entries.
    
    This exposes TPM event log tables on PVH dom0, bring it in line with a
    PV dom0.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 46f3ed0d53db6daf38c230dff0d2910bcb61fbe2
    master date: 2025-12-16 09:40:18 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 xen/include/acpi/actbl3.h     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 5551f90448..2635b2b95f 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1013,7 +1013,7 @@ static bool __init pvh_acpi_table_allowed(const char *sig,
         ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_FACS, ACPI_SIG_PSDT,
         ACPI_SIG_SSDT, ACPI_SIG_SBST, ACPI_SIG_MCFG, ACPI_SIG_SLIC,
         ACPI_SIG_MSDM, ACPI_SIG_WDAT, ACPI_SIG_FPDT, ACPI_SIG_S3PT,
-        ACPI_SIG_VFCT,
+        ACPI_SIG_TCPA, ACPI_SIG_TPM2, ACPI_SIG_VFCT,
     };
     unsigned int i;
 
diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 6858d3e60f..636d3f5f5b 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -78,8 +78,10 @@
 #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
 #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
 #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
-#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
+#define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"	/* Trusted Platform Module 2.0 H/W interface table */
 #define ACPI_SIG_VFCT           "VFCT"	/* AMD Video BIOS */
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202059.1517659 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhA9-00032W-Gr; Tue, 13 Jan 2026 16:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202059.1517659; Tue, 13 Jan 2026 16:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhA9-00032O-E4; Tue, 13 Jan 2026 16:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1202059;
 Tue, 13 Jan 2026 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 1vfhA8-00032F-9p
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vfhA8-001iHQ-1w
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhA8-001pWR-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 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=rzO/J+M9Dw5voBFxreHgJaZsDWtZq4L2zqOyYKne5OE=; b=sf18duhwfk84QDXdFm60bk8Nka
	R91zNw/hnRKAy1rF22e9YzfcTl9AhSP0FCdtPR08jebxpdmiBfkf6sDd8IDdjxB3Lr6HCfI5NE6Tw
	oWMrP4dw7uEhXkVhEl6XTwlM/UnG3WQqlsKOOrTHLqtNC4rMxc7Y9qp1kA5PKH+NmVgk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] vPCI: avoid bogus "overlap in extended cap list" warnings
Message-Id: <E1vfhA8-001pWR-0j@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:22:32 +0000

commit 11f94271000cc1d92741184e0a38e5f2750e0dfc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:40:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:40:44 2026 +0100

    vPCI: avoid bogus "overlap in extended cap list" warnings
    
    Legacy PCI devices don't have any extended config space. Reading any part
    thereof may very well return all ones. That then necessarily means we
    would think we found a "loop", when there simply is nothing.
    
    Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: ed4e690ae11a60792f722729abb9ec68e64ffea3
    master date: 2025-12-29 09:34:41 +0100
---
 xen/drivers/vpci/header.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 469f497744..aae663bbf5 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -839,6 +839,15 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
         uint32_t header = pci_conf_read32(pdev->sbdf, pos);
         int rc;
 
+        if ( header == 0xffffffffU )
+        {
+            if ( pos != PCI_CFG_SPACE_SIZE )
+                printk(XENLOG_WARNING
+                       "%pd %pp: broken extended cap list, offset %#x\n",
+                       pdev->domain, &pdev->sbdf, pos);
+            return 0;
+        }
+
         rc = vpci_add_register(pdev->vpci, vpci_read_val, NULL,
                                pos, 4, (void *)(uintptr_t)header);
         if ( rc == -EEXIST )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202060.1517663 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhAJ-00035a-Ja; Tue, 13 Jan 2026 16:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202060.1517663; Tue, 13 Jan 2026 16: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 1vfhAJ-00035S-Gg; Tue, 13 Jan 2026 16:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1202060;
 Tue, 13 Jan 2026 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 1vfhAI-000358-CO
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vfhAI-001iHu-2E
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhAI-001pX1-12
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 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=3f9yeW3F+mmGKAUQ/KMY4Durdj8gNTNItQW7IoNSF+I=; b=jUZHw3syJkL2hBHxkD6/DhruRp
	0AVbOlDW+i1rx9fTlQj6Noraxc8/eXazckEjGvyel/k0T1vTKxRdkDmT3x/v9G8TqZ4di07hBQxTd
	lRF4Siq+2ihtOMQhucb1ev/dkDSsNgs/kwS07lYW4tl2sPneINl7NgEmbrLWXSmIO5vc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/AMD: avoid REP MOVSB for Zen3/4
Message-Id: <E1vfhAI-001pX1-12@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:22:42 +0000

commit f805b61268311017902aff6e956c12c32b099d3e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:41:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:41:10 2026 +0100

    x86/AMD: avoid REP MOVSB for Zen3/4
    
    Zen2 (which doesn't expose ERMS) through Zen4 have sub-optimal aliasing
    detection for REP MOVS, and fall back to a unit-at-a-time loop when the
    two pointers have differing bottom 5 bits.  While both forms are
    affected, this makes REP MOVSB 8 times slower than REP MOVSQ.
    
    memcpy() has a high likelihood of encountering this slowpath, so avoid
    using REP MOVSB.  This undoes the ERMS optimisation added in commit
    d6397bd0e11c which turns out to be an anti-optimisation on these
    microarchitectures.
    
    However, retain the use of ERMS-based REP MOVSB in other cases such as
    copy_page_hot() where there parameter alignment is known to avoid the
    slowpath.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cb3ae9445ab07261188f1d4a54ca5741bc962cf2
    master date: 2026-01-07 14:45:27 +0100
---
 xen/arch/x86/cpu/amd.c                 | 4 ++++
 xen/arch/x86/cpu/intel.c               | 3 +++
 xen/arch/x86/include/asm/cpufeatures.h | 3 ++-
 xen/arch/x86/memcpy.S                  | 2 +-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 35b9dbf149..fb5c6acded 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1378,6 +1378,10 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	check_syscfg_dram_mod_en();
 
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS)
+	    && c->family != 0x19 /* Zen3/4 */)
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
+
 	amd_log_freq(c);
 }
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index ecca11f04d..b5b0b31eb9 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -684,6 +684,9 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	 */
 	if (c == &boot_cpu_data && c->vfm == INTEL_SKYLAKE_X)
 		setup_clear_cpu_cap(X86_FEATURE_CLWB);
+
+	if (c == &boot_cpu_data && cpu_has(c, X86_FEATURE_ERMS))
+		setup_force_cpu_cap(X86_FEATURE_XEN_REP_MOVSB);
 }
 
 const struct cpu_dev __initconst_cf_clobber intel_cpu_dev = {
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 0a98676c16..65534863c7 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -7,7 +7,7 @@
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
 /* Synthetic words follow the featureset words. */
-#define X86_NR_SYNTH 1
+#define X86_NR_SYNTH 2
 #define X86_SYNTH(x) (FSCAPINTS * 32 + (x))
 
 /* Synthetic features */
@@ -43,6 +43,7 @@ XEN_CPUFEATURE(IBPB_ENTRY_PV,     X86_SYNTH(28)) /* MSR_PRED_CMD used by Xen for
 XEN_CPUFEATURE(IBPB_ENTRY_HVM,    X86_SYNTH(29)) /* MSR_PRED_CMD used by Xen for HVM */
 XEN_CPUFEATURE(USE_VMCALL,        X86_SYNTH(30)) /* Use VMCALL instead of VMMCALL */
 XEN_CPUFEATURE(PDX_COMPRESSION,   X86_SYNTH(31)) /* PDX compression */
+XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy() */
 
 /* Bug words follow the synthetic words. */
 #define X86_NR_BUG 1
diff --git a/xen/arch/x86/memcpy.S b/xen/arch/x86/memcpy.S
index aaee012126..eefbb8c9ee 100644
--- a/xen/arch/x86/memcpy.S
+++ b/xen/arch/x86/memcpy.S
@@ -10,7 +10,7 @@ FUNC(memcpy)
          * precautions were taken).
          */
         ALTERNATIVE "and $7, %edx; shr $3, %rcx", \
-                    STR(rep movsb; RET), X86_FEATURE_ERMS
+                    STR(rep movsb; RET), X86_FEATURE_XEN_REP_MOVSB
         rep movsq
         or      %edx, %ecx
         jz      1f
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:22:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202061.1517667 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhAT-00037q-Kr; Tue, 13 Jan 2026 16:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202061.1517667; Tue, 13 Jan 2026 16: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 1vfhAT-00037h-I5; Tue, 13 Jan 2026 16:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1202061;
 Tue, 13 Jan 2026 16: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 1vfhAS-00037Q-Gk
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16: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 1vfhAS-001iHy-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhAS-001pXd-1K
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16: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=4tgUrfg5JSpQ9ohab2gnJYqLbE6+9KDOTjpSgcP62pQ=; b=VeiFdAKE0YJdvfvxx4NPQT30ez
	CtEdrcAzLf9xwJOR8pNBVxsaN2WhdljQNWJyKjCJNd8wZ/lPdPDgXGlUkAU52r7zgyAY/EIbnj7N2
	ppChz3D3QMZ/C39dgTJdU5iiC00lf+k4QooWGPb5UMPGUQyEUzZhoRaG8iPnqBeMARBY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/mm: reject XENMEM_claim_pages when using LLC coloring
Message-Id: <E1vfhAS-001pXd-1K@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:22:52 +0000

commit e39831f5906f5e5536eea7d7ffb8d167dfb7e959
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:41:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:41:33 2026 +0100

    xen/mm: reject XENMEM_claim_pages when using LLC coloring
    
    The coloring allocator ignores claims; reject the usage of the hypercall if
    LLC coloring is enabled.  Note that the usage of alloc_color_heap_page() is
    selected at boot time, and it's a system wide decision.  Once enabled all
    domains will use alloc_color_heap_page() for allocations, which ignores any
    outstanding claims.
    
    The hypercall can be enabled if/when LLC coloring is adjusted to support
    claims.
    
    Fixes: 95debe51a936 ("xen: add cache coloring allocator for domains")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b068cafc737d51c76b40d3f9f821017bfa15814c
    master date: 2026-01-07 15:54:33 +0100
---
 xen/common/memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 3688e6dd50..3cb6fa9495 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -16,6 +16,7 @@
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
+#include <xen/llc-coloring.h>
 #include <xen/mem_access.h>
 #include <xen/mm.h>
 #include <xen/numa.h>
@@ -1660,6 +1661,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case XENMEM_claim_pages:
+        if ( llc_coloring_enabled )
+            return -EOPNOTSUPP;
+
         if ( unlikely(start_extent) )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:23:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202063.1517671 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhAd-00039t-M3; Tue, 13 Jan 2026 16:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202063.1517671; Tue, 13 Jan 2026 16: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 1vfhAd-00039l-JR; Tue, 13 Jan 2026 16:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1202063;
 Tue, 13 Jan 2026 16: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 1vfhAc-00039f-Kp
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16: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 1vfhAc-001iIO-34
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhAc-001pYP-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16: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=1Bwhzpo8/PzwG8fX09VXKwtPehDOnsb6YBX9Ljvu9i4=; b=e268H1opQYPSBcYBeAGY8MVyKQ
	X7Fm/FkdtsRz9C4gOAAs9XYK/d9cBJNXm/3SxNOLOXniEBqGoWHEfN+lulIjnm/RH9N9qFpimwqA/
	ZAMtCgSYq9v22PsRLUgz/Eh+FOsh8X++CmZ8cvxga71qpslvztxwZQENBp+dzIgd93Lo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vfhAc-001pYP-1l@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:23:02 +0000

commit b579e832dea70a977d1020396215cb36d1bc1c06
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:41:57 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:41:57 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c9491ea21a433168ef69639183a01848877cea14
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index ef35cd564b..86d8221b84 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2010,11 +2010,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:23:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:23:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202064.1517675 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhAn-0003CC-Nm; Tue, 13 Jan 2026 16:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202064.1517675; Tue, 13 Jan 2026 16: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 1vfhAn-0003C4-Kq; Tue, 13 Jan 2026 16:23:13 +0000
Received: by outflank-mailman (input) for mailman id 1202064;
 Tue, 13 Jan 2026 16: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 1vfhAm-0003Bw-Nt
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16: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 1vfhAn-001iIY-09
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhAm-001pZ5-2A
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16: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=4H5+LCD19VKdtMpkcPjGRVKyeQXM+EC/m2HMQ/1T3zU=; b=15KGcZofAe0atEhpiI0FRH5tFk
	tZt0cKZDVWkz1P12d2ie4dVU0REzvVtpIanMIT/ujkwFHEainG14TQIMye4Q5Lxt57uUqDJnVvaIk
	CuP15HWe6oFUqjfWSEuYOUPR+O/NTmmNWbElsnaKtnnm+G+U186+hNXRz8Q3/Vvpxn3Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vfhAm-001pZ5-2A@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:23:12 +0000

commit 82fe260552c460143a6bc4dd0d36bf8ed9d37de6
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:42:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:42:13 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 75d29d9b5e226bafa0fbf9fba25623229660b81e
    master date: 2026-01-08 11:05:30 +0100
---
 xen/common/page_alloc.c | 55 +++++++++++++++++++++++++------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1f67b88a89..2efc11ce09 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -515,30 +515,6 @@ unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->outstanding_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages || pages <= 0 )
-        goto out;
-
-    spin_lock(&heap_lock);
-    BUG_ON(outstanding_claims < d->outstanding_pages);
-    if ( d->outstanding_pages < pages )
-    {
-        /* `pages` exceeds the domain's outstanding count. Zero it out. */
-        outstanding_claims -= d->outstanding_pages;
-        d->outstanding_pages = 0;
-    }
-    else
-    {
-        outstanding_claims -= pages;
-        d->outstanding_pages -= pages;
-    }
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -548,9 +524,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1071,6 +1048,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 02bdc256ce..610f3d4c0d 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -402,7 +402,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:23:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202065.1517679 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhAx-0003EH-Oo; Tue, 13 Jan 2026 16:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202065.1517679; Tue, 13 Jan 2026 16:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhAx-0003E9-MF; Tue, 13 Jan 2026 16:23:23 +0000
Received: by outflank-mailman (input) for mailman id 1202065;
 Tue, 13 Jan 2026 16:23:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vfhAw-0003E1-QO
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:23:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhAx-001iIe-0P
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhAw-001pZd-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3KUZHvpsU9sCgMeea8Hqle0CsYxk76L3uSIaOrTGHUA=; b=IijZ6fZvFK4wzazi5/h200khgi
	jbxnbOtA6c8aqwcVAFDkX/v2AcESRIy98kDXhrHrxeAMwCoXYEeBP3+wPE+Sj2G/fSFjb8zUcGsKw
	pt+MPYA2lSy0iz6u2TSi2UXgaFclQCVUTLI+bZyn6ytrE15ViQLf1yIBH1yg17QxDoaE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vfhAw-001pZd-2S@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:23:22 +0000

commit fe0d8969022c52aca1a4f5a8f758701f01d1c9c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:42:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:42:35 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: bdd5f35cf20c7397a7f74fb80446c136688e3145
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 2635b2b95f..6849e8c010 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1310,7 +1310,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:23:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:23:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202073.1517752 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhB8-0004zu-LZ; Tue, 13 Jan 2026 16:23:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202073.1517752; Tue, 13 Jan 2026 16:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhB8-0004zl-H1; Tue, 13 Jan 2026 16:23:34 +0000
Received: by outflank-mailman (input) for mailman id 1202073;
 Tue, 13 Jan 2026 16:23:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vfhB6-0004fN-T2
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:23:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhB7-001iIw-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhB6-001paM-2k
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oKfCxnvxxiS9BZW9Q4ZTNzqepp2DJXF8RUnsT2ttKoo=; b=otFAhDAABEuQZib4EWZxGY9l0+
	E3pnAGxFAx2Nn3ax6BRI81Ku0tthYfpTMUwC0A+fqL/ygvlFTml7DDSQhRk+9HAVWHtu2CwJEfqzo
	BPV/t4MXv0z03ftTMPwe4aZqylmTp2kKe8YNkVFXncdp8aSH0kcUhcafkFJeLAdHoPgQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86: fix incorrect return value for has_if_pschange_mc
Message-Id: <E1vfhB6-001paM-2k@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:23:32 +0000

commit c692a6786b1c40b3b481856f40fc8a2fad6a0333
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Tue Jan 13 15:42:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:42:55 2026 +0100

    x86: fix incorrect return value for has_if_pschange_mc
    
    The Atom block used to fall through into the Phi block to get to it's
    return false, and this was accidentally dropped with the Phi removal.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a2a34d76643e49ccc949296c9a45888034e50b55
    master date: 2026-01-12 13:07:36 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e2b5077654..a4f606720f 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3054,6 +3054,7 @@ static bool __init has_if_pschange_mc(void)
     case 0x75: /* Lightning Mountain */
     case 0x7a: /* Gemini Lake */
     case 0x86: /* Jacobsville */
+        return false;
 
     default:
         printk("Unrecognised CPU model %#x - assuming vulnerable to IF_PSCHANGE_MC\n",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:23:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202094.1517758 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhBI-0005nk-MW; Tue, 13 Jan 2026 16:23:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202094.1517758; Tue, 13 Jan 2026 16:23: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 1vfhBI-0005ml-J7; Tue, 13 Jan 2026 16:23:44 +0000
Received: by outflank-mailman (input) for mailman id 1202094;
 Tue, 13 Jan 2026 16:23: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 1vfhBH-0005hU-Au
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:23: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 1vfhBH-001iJS-25
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhBH-001pbj-0u
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23: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=/hy8GzGgra2hInL/xka/CRkokl31ic++ietNBB9RTpQ=; b=Bc2sIAAGNx/ZyKJgPckaHgDwne
	wmSROsQDSmaTLUy0GE5Ow/B9c1mrJO7Y1LMwoYt9Ncpri1IbDySn77FP1I9sT0XfwH/4BVQgvy3wv
	DKP/auJjRPBeVHa5vQ2tM9yBdjopEyTQiyI9BiaVxvXiTZSuezvaIN/Z8y/YunMfrMvM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/pod: fix decrease_reservation() clearing of M2P entries
Message-Id: <E1vfhBH-001pbj-0u@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:23:43 +0000

commit a13ce6cee8eadb5620d2d2ffa620e95bb0dddcff
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:44:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:44:43 2026 +0100

    x86/pod: fix decrease_reservation() clearing of M2P entries
    
    Add the missing index increase in the M2P clearing loop, otherwise the loop
    keeps pointlessly setting the same MFN entry repeatedly.  This seems to be
    an oversight from the change that introduced support to process high order
    pages in one go.
    
    Fixes: 3c352011c0d3 ("x86/PoD: shorten certain operations on higher order ranges")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d495cb8f70280482edae12b48f422b5715099
    master date: 2025-12-11 09:50:10 +0100
---
 xen/arch/x86/mm/p2m-pod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index df2a1cc074..fa2b9a2728 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -655,7 +655,7 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
             }
             p2m_tlb_flush_sync(p2m);
             for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+                set_gpfn_from_mfn(mfn_x(mfn) + j, INVALID_M2P_ENTRY);
             p2m_pod_cache_add(p2m, page, cur_order);
 
             ioreq_request_mapcache_invalidate(d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:23:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:23:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202109.1517761 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhBS-0006Qo-P5; Tue, 13 Jan 2026 16:23:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202109.1517761; Tue, 13 Jan 2026 16:23: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 1vfhBS-0006QH-ME; Tue, 13 Jan 2026 16:23:54 +0000
Received: by outflank-mailman (input) for mailman id 1202109;
 Tue, 13 Jan 2026 16:23: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 1vfhBR-0006NX-EG
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:23: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 1vfhBR-001iJc-2N
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhBR-001pcP-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:23: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=MpKGV/dA24VITZt6YUNbpWh0z2n2dP43K6NVOn7CAqs=; b=jbyWAwjwZKWSU4bj6PT72BWa/t
	w1MS8KFpc0r0Ej0d1U84OwJKccHu5oy0CV3C7RUkgia71Mi8Tbwosul3MzXoQx1eH3/uahUvacieD
	Dy8L+X1c2atfG3CW82sZ1QtjhxhQha4pGXffxOrR4ijLQfqwt2ZJu0VAQYBA1a8hGPXg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/mm: update log-dirty bitmap when manipulating P2M
Message-Id: <E1vfhBR-001pcP-1A@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:23:53 +0000

commit c31086c50b9d6a1219be429b8e903c5893b36c25
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:45:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:45:05 2026 +0100

    x86/mm: update log-dirty bitmap when manipulating P2M
    
    Just like for PV guests MMU_MACHPHYS_UPDATE implies marking of the
    respective page as dirty, additions to a HVM guest's P2M should do so.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    [jb: backport limited to the new paging_mark_pfn_dirty() use]
    master commit: 98fccdf0ac7c1a909b54dd5beeba54a0a23f756c
    master date: 2025-12-11 09:50:30 +0100
---
 xen/arch/x86/mm/p2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 41fc108bba..8c31bf808d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -738,8 +738,11 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
         if ( !p2m_is_grant(t) )
         {
             for ( i = 0; i < (1UL << page_order); i++ )
+            {
                 set_gpfn_from_mfn(mfn_x(mfn_add(mfn, i)),
                                   gfn_x(gfn_add(gfn, i)));
+                paging_mark_pfn_dirty(d, _pfn(gfn_x(gfn) + i));
+            }
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:24:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:24:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202115.1517765 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhBc-0006bD-QN; Tue, 13 Jan 2026 16:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202115.1517765; Tue, 13 Jan 2026 16:24: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 1vfhBc-0006b3-Nd; Tue, 13 Jan 2026 16:24:04 +0000
Received: by outflank-mailman (input) for mailman id 1202115;
 Tue, 13 Jan 2026 16:24: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 1vfhBb-0006aT-GR
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:24: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 1vfhBb-001iJs-2d
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhBb-001peE-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24: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=qPxJQn8fZ6kJfDOqTJUO2wt44BcOshi4IGglh5cctjM=; b=najA+K0zI6vgzIRXd230sp6HFc
	B9o2vFUCQWHOrLTT2MjvS10Hn9tnZxjMoL1t3swf8cZJ9kCI3FzFoMBEERv/S1K8UHMz8R0di7kc0
	43hJBy4bzkSY/BwspT/X3gOHVYoRyhyniO/0Pouw+Qk4RHf0/LMl4PgmvNCjR55A1FKk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/x86: Pass TPM ACPI table to PVH dom0
Message-Id: <E1vfhBb-001peE-1S@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:24:03 +0000

commit 23989412fb7671f99434c5996c3f6d7d80bb7008
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Jan 13 15:45:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:45:31 2026 +0100

    xen/x86: Pass TPM ACPI table to PVH dom0
    
    Pass the TPM2 ACPI table so that the device can be found by a PVH dom0.
    
    Otherwise dom0 shows:
    tpm_tis MSFT0101:00: [Firmware Bug]: failed to get TPM2 ACPI table
    tpm_tis MSFT0101:00: probe with driver tpm_tis failed with error -22
    
    TCPA is "Trusted Computing Platform Alliance table", but it is really
    the table for a TPM 1.2.  Pass that as well.
    
    While doing this, move ACPI_SIG_WPBT to alpabetize the entries.
    
    This exposes TPM event log tables on PVH dom0, bring it in line with a
    PV dom0.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 46f3ed0d53db6daf38c230dff0d2910bcb61fbe2
    master date: 2025-12-16 09:40:18 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 xen/include/acpi/actbl3.h     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 7551cbe167..b85b887dc8 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1014,7 +1014,7 @@ static bool __init pvh_acpi_table_allowed(const char *sig,
         ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_FACS, ACPI_SIG_PSDT,
         ACPI_SIG_SSDT, ACPI_SIG_SBST, ACPI_SIG_MCFG, ACPI_SIG_SLIC,
         ACPI_SIG_MSDM, ACPI_SIG_WDAT, ACPI_SIG_FPDT, ACPI_SIG_S3PT,
-        ACPI_SIG_VFCT,
+        ACPI_SIG_TCPA, ACPI_SIG_TPM2, ACPI_SIG_VFCT,
     };
     unsigned int i;
 
diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 6858d3e60f..636d3f5f5b 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -78,8 +78,10 @@
 #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
 #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
 #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
-#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
+#define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"	/* Trusted Platform Module 2.0 H/W interface table */
 #define ACPI_SIG_VFCT           "VFCT"	/* AMD Video BIOS */
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:24:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:24:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202116.1517769 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhBm-0006jk-Rr; Tue, 13 Jan 2026 16:24:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202116.1517769; Tue, 13 Jan 2026 16:24: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 1vfhBm-0006jc-P8; Tue, 13 Jan 2026 16:24:14 +0000
Received: by outflank-mailman (input) for mailman id 1202116;
 Tue, 13 Jan 2026 16:24: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 1vfhBl-0006ir-Jg
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:24: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 1vfhBl-001iJw-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhBl-001pf6-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24: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=G1+QOkR0yu6SRWjP5l50bC9U4svyPAJr9mmBfP/2Igk=; b=x9bJ6CmMqN0D7OMkyFY0MVkCk+
	6eUs5TOJqk9b+hlJVy5DtThwoH81qmHjXBb/6KAn2RDtNyaInYV7dMfFrV5gMmmJcX/Gy/OJH9yrg
	HVd+GO/UwRgnfJt6DGZa4UvfUSj6MH+9gFGFAIEh/6tNvtkc2L1JY6ro9rHBMMHFhTNA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/mm: reject XENMEM_claim_pages when using LLC coloring
Message-Id: <E1vfhBl-001pf6-1i@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:24:13 +0000

commit 84436dea9f15a7d245e30e14ffc698da0b12704b
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:46:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:07 2026 +0100

    xen/mm: reject XENMEM_claim_pages when using LLC coloring
    
    The coloring allocator ignores claims; reject the usage of the hypercall if
    LLC coloring is enabled.  Note that the usage of alloc_color_heap_page() is
    selected at boot time, and it's a system wide decision.  Once enabled all
    domains will use alloc_color_heap_page() for allocations, which ignores any
    outstanding claims.
    
    The hypercall can be enabled if/when LLC coloring is adjusted to support
    claims.
    
    Fixes: 95debe51a936 ("xen: add cache coloring allocator for domains")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b068cafc737d51c76b40d3f9f821017bfa15814c
    master date: 2026-01-07 15:54:33 +0100
---
 xen/common/memory.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 8ca4e1a842..1165ef200f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -16,6 +16,7 @@
 #include <xen/iocap.h>
 #include <xen/ioreq.h>
 #include <xen/lib.h>
+#include <xen/llc-coloring.h>
 #include <xen/mem_access.h>
 #include <xen/mm.h>
 #include <xen/numa.h>
@@ -1658,6 +1659,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
 
     case XENMEM_claim_pages:
+        if ( llc_coloring_enabled )
+            return -EOPNOTSUPP;
+
         if ( unlikely(start_extent) )
             return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:24:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:24:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202117.1517772 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhBw-0006r9-T9; Tue, 13 Jan 2026 16:24:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202117.1517772; Tue, 13 Jan 2026 16:24: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 1vfhBw-0006r0-Qj; Tue, 13 Jan 2026 16:24:24 +0000
Received: by outflank-mailman (input) for mailman id 1202117;
 Tue, 13 Jan 2026 16:24: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 1vfhBv-0006qY-MI
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:24: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 1vfhBv-001iKF-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhBv-001pfn-23
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24: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=eNENqu6Pk2hxBaTw8lJuTDucTIOUqaOkYO/GMTfCMN8=; b=FTOWeVO2e5cA/ISPquE1tHNMgr
	0AiOjVuzAJrDHrmPF0UqtiGhVNzvKqwrUNIqtPDnR8vLu4rdmSLA9j9QDZ7cwfN4zdceaV7lotlXi
	yTf9xd1E2j6lfz57LJVaSqirN4ob3uzUhtwA2LQj4LDmcDURPW/hAh5yJjS9hyEMmTKw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vfhBv-001pfn-23@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:24:23 +0000

commit 219510a9d6ae6d0c2e05b7d0e89da5b9e0c647c8
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:46:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:23 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c9491ea21a433168ef69639183a01848877cea14
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8c31bf808d..8d225d2d6c 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1990,11 +1990,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:24:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:24:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202118.1517778 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhC6-0006v1-Vc; Tue, 13 Jan 2026 16:24:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202118.1517778; Tue, 13 Jan 2026 16:24: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 1vfhC6-0006ut-S8; Tue, 13 Jan 2026 16:24:34 +0000
Received: by outflank-mailman (input) for mailman id 1202118;
 Tue, 13 Jan 2026 16:24: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 1vfhC5-0006ud-Oq
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:24: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 1vfhC6-001iKz-0F
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhC5-001ph2-2J
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24: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=/EXHPxjb9YATOE0YJcuaiSVseC7eBoK3LHHtoe/TSWk=; b=yIKTl08yG4Vu2FI/Yy/bV421sr
	jyweKsdgi+nGJ+ij4/5jkJhmeYlSDYNINTj8p7vvJkfhAnX/a55RT2WOZ33OAWV5/p8BfvLrIBaOe
	EPONRhKD2qzyhxCVFks++lSTtcF+qEyAVQ7JE3C9ulBtOXZtQrX0iZp4J026wa2iMdZ4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vfhC5-001ph2-2J@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:24:33 +0000

commit 39748952e917e57d4def03f2bd993c11313a8a47
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:46:37 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:37 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 75d29d9b5e226bafa0fbf9fba25623229660b81e
    master date: 2026-01-08 11:05:30 +0100
---
 xen/common/page_alloc.c | 56 ++++++++++++++++++++++++-------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1bf070c8c5..6919722e9a 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -490,34 +490,9 @@ static long outstanding_claims; /* total outstanding claims by all domains */
 
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
 {
-    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
-
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->claimed_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages )
-        goto out;
-
-    spin_lock(&heap_lock);
-    /* adjust domain outstanding pages; may not go negative */
-    dom_before = d->outstanding_pages;
-    dom_after = dom_before - pages;
-    BUG_ON(dom_before < 0);
-    dom_claimed = dom_after < 0 ? 0 : dom_after;
-    d->outstanding_pages = dom_claimed;
-    /* flag accounting bug if system outstanding_claims would go negative */
-    sys_before = outstanding_claims;
-    sys_after = sys_before - (dom_before - dom_claimed);
-    BUG_ON(sys_after < 0);
-    outstanding_claims = sys_after;
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -527,9 +502,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1044,6 +1020,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 037c83fda2..de621eb123 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -396,7 +396,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:24:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:24:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202119.1517781 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhCH-0006ym-0D; Tue, 13 Jan 2026 16:24:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202119.1517781; Tue, 13 Jan 2026 16:24: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 1vfhCG-0006yc-Tn; Tue, 13 Jan 2026 16:24:44 +0000
Received: by outflank-mailman (input) for mailman id 1202119;
 Tue, 13 Jan 2026 16:24: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 1vfhCF-0006yP-RS
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:24: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 1vfhCG-001iLV-0V
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhCF-001piG-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24: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=bUvvnR7DEdW4Pm+HUj2s60Oe3GlfdtkXGs+S5+C8GkQ=; b=ddwQFuTAeM3MAOoFO5BT8H5d8q
	OubnDViuAsAz6cHLQMCEiOPeuCQkJLqCO1yeNEi/hk0/GbEy9u935HyYhRl0nNcQO9AuuC9vmTmxR
	WkM5qSHhQ14bvifrn5q0SFbE6q4tE8FAg9MoeqDouNY3JRBCErobMh5egM9VuHCqtRGQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vfhCF-001piG-2Z@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:24:43 +0000

commit f54c59f2ca6c26c383e9d05cea63187a850abd4b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:46:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:46:58 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: bdd5f35cf20c7397a7f74fb80446c136688e3145
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index b85b887dc8..c6f8af9a96 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1311,7 +1311,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 16:24:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 16:24:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202120.1517785 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhCR-00072W-1V; Tue, 13 Jan 2026 16:24:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202120.1517785; Tue, 13 Jan 2026 16:24: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 1vfhCQ-00072O-VB; Tue, 13 Jan 2026 16:24:54 +0000
Received: by outflank-mailman (input) for mailman id 1202120;
 Tue, 13 Jan 2026 16:24: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 1vfhCP-000728-UI
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 16:24: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 1vfhCQ-001iLc-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhCP-001pii-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 16:24: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=apx1to1gYROh8H6B3wiM4QQijnDZXjzsHiv757PURLE=; b=C7DnyngmfJBdUB2MuX8zNk+7qe
	JzUlQ7eK0/FJvIcZ9RKSCQSdJTUg4z4S4Ifog6L5ekiL6oxWc/tVC1lL0teuzCJPWY4kGVDG5Dr7H
	ZqahbBglKs/iTvT7OVcdmxuZ0cCP+PIxm/MD9giZh+i20ExlAzYmGogMJzVfvPFvHzjQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86: fix incorrect return value for has_if_pschange_mc
Message-Id: <E1vfhCP-001pii-2q@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 16:24:53 +0000

commit 0cb467d86df393fc2c577fd707a951c5dfa5fdc8
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Tue Jan 13 15:47:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:47:17 2026 +0100

    x86: fix incorrect return value for has_if_pschange_mc
    
    The Atom block used to fall through into the Phi block to get to it's
    return false, and this was accidentally dropped with the Phi removal.
    
    Fixes: 85191cf32180 ("x86: drop Xeon Phi support")
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a2a34d76643e49ccc949296c9a45888034e50b55
    master date: 2026-01-12 13:07:36 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 962b7f543c..338dd79422 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2979,6 +2979,7 @@ static bool __init has_if_pschange_mc(void)
     case 0x75: /* Lightning Mountain */
     case 0x7a: /* Gemini Lake */
     case 0x86: /* Jacobsville */
+        return false;
 
     default:
         printk("Unrecognised CPU model %#x - assuming vulnerable to IF_PSCHANGE_MC\n",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202249.1517860 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhv5-0000Ij-S5; Tue, 13 Jan 2026 17:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202249.1517860; Tue, 13 Jan 2026 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 1vfhv5-0000Ib-Oz; Tue, 13 Jan 2026 17:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1202249;
 Tue, 13 Jan 2026 17: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 1vfhv4-0000IV-Jr
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhv4-001jC1-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhv4-001zhc-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ONV2oY1bOXYrY0dTXsDFwoaljjvgph+r22R8ngzxqeQ=; b=dncXOgEpM22dK43AHT0elUi7El
	Ov90uYuPKeqBQZMNjIWBOZT6lM8QypSt1+sQ2pEOQo+jrnczUK1qWErmN7NUfpvHZEYYv9EUkZnck
	sUnAjfv+htOUwhwrWmIKD5Ocv8+iDpP3lPCdWdWz8ltGHhOKBEcUxAnJhg56+OX7dVlk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] update Xen version to 4.19.5-pre
Message-Id: <E1vfhv4-001zhc-1I@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:11:02 +0000

commit 331ffed3cf3bf77fdca95692cb2e9a7318ccba33
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:48:11 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:48:11 2026 +0100

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

diff --git a/xen/Makefile b/xen/Makefile
index 1a484cd6e6..61a7dced35 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    = 19
-export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202250.1517862 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhvF-0000KH-Sp; Tue, 13 Jan 2026 17:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202250.1517862; Tue, 13 Jan 2026 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 1vfhvF-0000KA-QO; Tue, 13 Jan 2026 17:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1202250;
 Tue, 13 Jan 2026 17: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 1vfhvE-0000Jx-J1
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhvE-001jC9-2s
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhvE-001ziA-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bIIYfFC9+Qoc+qq0uRz5wT+WnVM/SsQC5d7jW6oOa/E=; b=2LRDYi4M7lEhO5Aie1TAq6lPG1
	hNcwLZUcwXgfN43V+KkP++zztN3UXEx04wqgjkjHPcwqcXQvL07ewQ7RyGVtAhWsbG5qlfAkVpRpE
	or1m5lLgcVHRia1/ARkO2aIhb7HJWqdr4VYvLG39o4WR5ddI2201MuGQdxHdy4kIzQ44=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/pod: fix decrease_reservation() clearing of M2P entries
Message-Id: <E1vfhvE-001ziA-1g@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:11:12 +0000

commit 40c5e35d0ff749d330b42810482be6300616288a
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:49:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:49:10 2026 +0100

    x86/pod: fix decrease_reservation() clearing of M2P entries
    
    Add the missing index increase in the M2P clearing loop, otherwise the loop
    keeps pointlessly setting the same MFN entry repeatedly.  This seems to be
    an oversight from the change that introduced support to process high order
    pages in one go.
    
    Fixes: 3c352011c0d3 ("x86/PoD: shorten certain operations on higher order ranges")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d495cb8f70280482edae12b48f422b5715099
    master date: 2025-12-11 09:50:10 +0100
---
 xen/arch/x86/mm/p2m-pod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index bd84fe9e27..8b2641dbbd 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -655,7 +655,7 @@ decrease_reservation(struct domain *d, gfn_t gfn, unsigned int order)
             }
             p2m_tlb_flush_sync(p2m);
             for ( j = 0; j < n; ++j )
-                set_gpfn_from_mfn(mfn_x(mfn), INVALID_M2P_ENTRY);
+                set_gpfn_from_mfn(mfn_x(mfn) + j, INVALID_M2P_ENTRY);
             p2m_pod_cache_add(p2m, page, cur_order);
 
             ioreq_request_mapcache_invalidate(d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202251.1517867 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhvP-0000Md-Ua; Tue, 13 Jan 2026 17:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202251.1517867; Tue, 13 Jan 2026 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 1vfhvP-0000MV-Rr; Tue, 13 Jan 2026 17:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1202251;
 Tue, 13 Jan 2026 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 1vfhvO-0000MI-Lp
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vfhvO-001jCD-3A
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhvO-001zjJ-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wz0vAw9U1fMP/+bLwl+Itaf9aajR4tQIwDTJ+VRutNE=; b=VqVAj4g+8xKQ7PlRoYh49pdMuv
	dopyeMP8YXPYs3qxVXlMcyC2uZ8L0WxlFL/uNXwUlZkMKf8XrC53MmAyyDwjStbfYMrasK5fcbfbh
	2XapLj1CiVLP4O+eV9Kx/vzJP1szhWiPD61fLJuv8RIn7ci9ARefxcYLXEjqME5PoiNM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/mm: update log-dirty bitmap when manipulating P2M
Message-Id: <E1vfhvO-001zjJ-1z@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:11:22 +0000

commit c2affd2788324c46a256826e171ef9105a9e37be
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:49:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:49:30 2026 +0100

    x86/mm: update log-dirty bitmap when manipulating P2M
    
    Just like for PV guests MMU_MACHPHYS_UPDATE implies marking of the
    respective page as dirty, additions to a HVM guest's P2M should do so.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    [jb: backport limited to the new paging_mark_pfn_dirty() use]
    master commit: 98fccdf0ac7c1a909b54dd5beeba54a0a23f756c
    master date: 2025-12-11 09:50:30 +0100
---
 xen/arch/x86/mm/p2m.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 41fc108bba..8c31bf808d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -738,8 +738,11 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
         if ( !p2m_is_grant(t) )
         {
             for ( i = 0; i < (1UL << page_order); i++ )
+            {
                 set_gpfn_from_mfn(mfn_x(mfn_add(mfn, i)),
                                   gfn_x(gfn_add(gfn, i)));
+                paging_mark_pfn_dirty(d, _pfn(gfn_x(gfn) + i));
+            }
         }
     }
     else
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202252.1517871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhvZ-0000PJ-W5; Tue, 13 Jan 2026 17:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202252.1517871; Tue, 13 Jan 2026 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 1vfhvZ-0000PA-TE; Tue, 13 Jan 2026 17:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1202252;
 Tue, 13 Jan 2026 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 1vfhvY-0000P4-OW
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 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 1vfhvZ-001jCI-0D
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhvY-001zju-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 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=hebBBJVpJiQtwTBHLoXvK3BuYxxcRVzrYjbI/f1swsE=; b=M4iQYRyjyFduBD9BVDSSG7mFV9
	s8h4HapImpVOMERo5QWdS4GxxiGQ2NFYiN8Krfh2O6Z3K5jZgtxASu5WMn+9ShmE8wzNmhF/KYwQO
	UsWImyX480bOAAb7ClVjTADt7bNU17FZme+6/ApJtgAxdDsG75/UqHADq/Rh0U4svlgI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/x86: Pass TPM ACPI table to PVH dom0
Message-Id: <E1vfhvY-001zju-2F@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:11:32 +0000

commit 9135f73d99ad27c37d33829a030337d3f8dbeeab
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Tue Jan 13 15:49:46 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:49:46 2026 +0100

    xen/x86: Pass TPM ACPI table to PVH dom0
    
    Pass the TPM2 ACPI table so that the device can be found by a PVH dom0.
    
    Otherwise dom0 shows:
    tpm_tis MSFT0101:00: [Firmware Bug]: failed to get TPM2 ACPI table
    tpm_tis MSFT0101:00: probe with driver tpm_tis failed with error -22
    
    TCPA is "Trusted Computing Platform Alliance table", but it is really
    the table for a TPM 1.2.  Pass that as well.
    
    While doing this, move ACPI_SIG_WPBT to alpabetize the entries.
    
    This exposes TPM event log tables on PVH dom0, bring it in line with a
    PV dom0.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 46f3ed0d53db6daf38c230dff0d2910bcb61fbe2
    master date: 2025-12-16 09:40:18 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 xen/include/acpi/actbl3.h     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 2b4505ebbf..a965cff45f 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1013,7 +1013,7 @@ static bool __init pvh_acpi_table_allowed(const char *sig,
         ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_FACS, ACPI_SIG_PSDT,
         ACPI_SIG_SSDT, ACPI_SIG_SBST, ACPI_SIG_MCFG, ACPI_SIG_SLIC,
         ACPI_SIG_MSDM, ACPI_SIG_WDAT, ACPI_SIG_FPDT, ACPI_SIG_S3PT,
-        ACPI_SIG_VFCT,
+        ACPI_SIG_TCPA, ACPI_SIG_TPM2, ACPI_SIG_VFCT,
     };
     unsigned int i;
 
diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 6858d3e60f..636d3f5f5b 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -78,8 +78,10 @@
 #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resources Table */
 #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
 #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
-#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
+#define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"	/* Trusted Platform Module 2.0 H/W interface table */
 #define ACPI_SIG_VFCT           "VFCT"	/* AMD Video BIOS */
+#define ACPI_SIG_WPBT           "WPBT"	/* Windows Platform Binary Table */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202253.1517875 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhvk-0000S2-14; Tue, 13 Jan 2026 17:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202253.1517875; Tue, 13 Jan 2026 17: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 1vfhvj-0000Ru-Ue; Tue, 13 Jan 2026 17:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1202253;
 Tue, 13 Jan 2026 17: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 1vfhvi-0000Rj-Sp
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhvj-001jCP-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhvi-001zkx-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Wjw1RqR0+uC5nyJ8pTN6ttxHXDbr6nlz8Y+F4kMLlhw=; b=QUT9IkuGc+eormAlJq9k1YG35P
	rkcon4Hu4/lwPpyIBWDWjlu5F0JoNWbsrdUR6Fp4cda+gSkby05niVfA0BRqmWb3xIWMtmXJsqIIn
	hUv4OknUxhmJj9PgouHNAxiw+RCUUi4AmVfgit1WG/KAIIecMyvyGEVQPAfOho8NqyUY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/hvm: be more strict with XENMAPSPACE_gmfn source types
Message-Id: <E1vfhvi-001zkx-2X@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:11:42 +0000

commit 072dbe798363098ea83c8128d6677e331231d135
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:50:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:50:23 2026 +0100

    x86/hvm: be more strict with XENMAPSPACE_gmfn source types
    
    XENMAPSPACE_gmfn{_range} allows moving gfn around the guest p2m: the mfn
    behind the source gfn is zapped from the origin and mapped at the
    requested destination gfn.  The destination p2m entries are always created
    with type p2m_ram_rw.
    
    With the current checking done in xenmem_add_to_physmap_one() it's possible
    to use XENMAPSPACE_gmfn{_range} to change the type of a p2m entry.  The
    source gfn is only checked to be not shared, and that the underlying page
    is owned by the domain.
    
    Make the source checks more strict, by checking that the source gfn is of
    type read/write RAM or logdirty.  That prevents the operation from
    inadvertently changing the type as part of the move.
    
    Fixes: 3e50af3d8776 ("New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c9491ea21a433168ef69639183a01848877cea14
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/mm/p2m.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8c31bf808d..8d225d2d6c 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1990,11 +1990,17 @@ int xenmem_add_to_physmap_one(
     {
         gmfn = idx;
         mfn = get_gfn_unshare(d, gmfn, &p2mt);
-        /* If the page is still shared, exit early */
-        if ( p2m_is_shared(p2mt) )
+        /*
+         * The entry at the destination gfn will be created as type p2m_ram_rw.
+         * Only allow moving source gfns with read/write or logdirty RAM types
+         * to avoid unexpected p2m type changes as a result of the operation.
+         * Note that for logdirty source type we rely on p2m_add_page() marking
+         * the destination gfn as dirty.
+         */
+        if ( p2mt != p2m_ram_rw && p2mt != p2m_ram_logdirty )
         {
             put_gfn(d, gmfn);
-            return -ENOMEM;
+            return p2m_is_shared(p2mt) ? -ENOMEM : -EACCES;
         }
         page = get_page_from_mfn(mfn, d);
         if ( unlikely(!page) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202254.1517879 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhvu-0000UG-2a; Tue, 13 Jan 2026 17:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202254.1517879; Tue, 13 Jan 2026 17:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhvt-0000U7-W0; Tue, 13 Jan 2026 17:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1202254;
 Tue, 13 Jan 2026 17: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 1vfhvs-0000Tu-Vw
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhvt-001jCj-0m
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhvs-001zm9-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:11:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4J3C/Wt/B93LaLlGZ4D6D1nzTn7pgkPcT4mH+Zx4fp0=; b=ejaRiNZE9p8GWPz3Mk1r8sBPnI
	Ct2NP+jCz31x4FjVFOHyrkpOO3/CbHYyCNUOCWkruCUbnvu13UvBqpjT+hdKrlPqTJ7tQeIDfeUU5
	ka/LWFerfETGUI0RwlWw0t1+CieI+LAWiKYXVJPQnWOHqoUm8ZHo3sBJdnxL0hPJCmG4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/mm: move adjustment of claimed pages counters on allocation
Message-Id: <E1vfhvs-001zm9-2n@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:11:52 +0000

commit 999fdfb104cfbdfb5e4c495e6d065e63c1a51c6d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 13 15:50:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:50:36 2026 +0100

    xen/mm: move adjustment of claimed pages counters on allocation
    
    The current logic splits the update of the amount of available memory in
    the system (total_avail_pages) and pending claims into two separately
    locked regions.  This leads to a window between counters adjustments where
    the result of total_avail_pages - outstanding_claims doesn't reflect the
    real amount of free memory available, and can return a negative value due
    to total_avail_pages having been updated ahead of outstanding_claims.
    
    Fix by adjusting outstanding_claims and d->outstanding_pages in the same
    place where total_avail_pages is updated.  Note that accesses to
    d->outstanding_pages is protected by the global heap_lock, just like
    total_avail_pages or outstanding_claims.  Add a comment to the field
    declaration, and also adjust the comment at the top of
    domain_set_outstanding_pages() to be clearer in that regard.
    
    Note that failures in assign_pages() causes the claimed amount that has
    been allocated to be lost, as the amount is not added back to the domain
    quota once pages are freed.  Given the intended usage of claims is limited
    to initial physmap populate, and the current failure paths in
    assign_pages() would lead to the domain being destroyed anyway, don't
    add extra logic to recover the claimed amount on failure - it's just adding
    complexity for no real benefit.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 75d29d9b5e226bafa0fbf9fba25623229660b81e
    master date: 2026-01-08 11:05:30 +0100
---
 xen/common/page_alloc.c | 56 ++++++++++++++++++++++++-------------------------
 xen/include/xen/sched.h |  3 ++-
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 054b7edb39..bbb8578459 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -475,34 +475,9 @@ static long outstanding_claims; /* total outstanding claims by all domains */
 
 unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
 {
-    long dom_before, dom_after, dom_claimed, sys_before, sys_after;
-
     ASSERT(rspin_is_locked(&d->page_alloc_lock));
     d->tot_pages += pages;
 
-    /*
-     * can test d->claimed_pages race-free because it can only change
-     * if d->page_alloc_lock and heap_lock are both held, see also
-     * domain_set_outstanding_pages below
-     */
-    if ( !d->outstanding_pages )
-        goto out;
-
-    spin_lock(&heap_lock);
-    /* adjust domain outstanding pages; may not go negative */
-    dom_before = d->outstanding_pages;
-    dom_after = dom_before - pages;
-    BUG_ON(dom_before < 0);
-    dom_claimed = dom_after < 0 ? 0 : dom_after;
-    d->outstanding_pages = dom_claimed;
-    /* flag accounting bug if system outstanding_claims would go negative */
-    sys_before = outstanding_claims;
-    sys_after = sys_before - (dom_before - dom_claimed);
-    BUG_ON(sys_after < 0);
-    outstanding_claims = sys_after;
-    spin_unlock(&heap_lock);
-
-out:
     return d->tot_pages;
 }
 
@@ -512,9 +487,10 @@ int domain_set_outstanding_pages(struct domain *d, unsigned long pages)
     unsigned long claim, avail_pages;
 
     /*
-     * take the domain's page_alloc_lock, else all d->tot_page adjustments
-     * must always take the global heap_lock rather than only in the much
-     * rarer case that d->outstanding_pages is non-zero
+     * Two locks are needed here:
+     *  - d->page_alloc_lock: protects accesses to d->{tot,max,extra}_pages.
+     *  - heap_lock: protects accesses to d->outstanding_pages, total_avail_pages
+     *    and outstanding_claims.
      */
     nrspin_lock(&d->page_alloc_lock);
     spin_lock(&heap_lock);
@@ -1014,6 +990,30 @@ static struct page_info *alloc_heap_pages(
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
+    {
+        /*
+         * Adjust claims in the same locked region where total_avail_pages is
+         * adjusted, not doing so would lead to a window where the amount of
+         * free memory (avail - claimed) would be incorrect.
+         *
+         * Note that by adjusting the claimed amount here it's possible for
+         * pages to fail to be assigned to the claiming domain while already
+         * having been subtracted from d->outstanding_pages.  Such claimed
+         * amount is then lost, as the pages that fail to be assigned to the
+         * domain are freed without replenishing the claim.  This is fine given
+         * claims are only to be used during physmap population as part of
+         * domain build, and any failure in assign_pages() there will result in
+         * the domain being destroyed before creation is finished.  Losing part
+         * of the claim makes no difference.
+         */
+        unsigned long outstanding = min(d->outstanding_pages + 0UL, request);
+
+        BUG_ON(outstanding > outstanding_claims);
+        outstanding_claims -= outstanding;
+        d->outstanding_pages -= outstanding;
+    }
+
     check_low_mem_virq();
 
     if ( d != NULL )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2dcd1d1a4f..2a83b9dacf 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -393,7 +393,8 @@ struct domain
     unsigned int     tot_pages;
 
     unsigned int     xenheap_pages;     /* pages allocated from Xen heap */
-    unsigned int     outstanding_pages; /* pages claimed but not possessed */
+    /* Pages claimed but not possessed, protected by global heap_lock. */
+    unsigned int     outstanding_pages;
     unsigned int     max_pages;         /* maximum value for domain_tot_pages() */
     unsigned int     extra_pages;       /* pages not included in domain_tot_pages() */
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:12:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202256.1517882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhw4-0000WN-3h; Tue, 13 Jan 2026 17:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202256.1517882; Tue, 13 Jan 2026 17: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 1vfhw4-0000WG-17; Tue, 13 Jan 2026 17:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1202256;
 Tue, 13 Jan 2026 17: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 1vfhw3-0000WA-2I
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhw3-001jD1-1E
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhw2-001zn9-35
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:12:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HUN4sUGyLIxdsL9FhH9XyZkMPBaIQr+mWIjxpd4zFB4=; b=14S6m6tx3wdjNthwg5CUwd5Rtj
	xOqPc0BKX0FDtJ3M8eZlY+Nh80Ih8Q9cfkrURuATN32kMXI2SEGNFuIR0teV+K8o9+v6kv13T9hLH
	s56wUVtUXdLhoQV/kLu7OpYvIL4prdVCzYh4HkakxPva0Bo3lhkKweIGRaz0jEaIgh8I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/PVH: mark pvh_setup_mmcfg() __init
Message-Id: <E1vfhw2-001zn9-35@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:12:02 +0000

commit bc8363a41a8992b4eade2d059b74acaa1887fadc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 13 15:50:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 13 15:50:54 2026 +0100

    x86/PVH: mark pvh_setup_mmcfg() __init
    
    Its sole caller is, and the wrong annotation would cause a build failure
    (non-empty .text) if the compiler chose to not inline the function when at
    the same time LATE_HWDOM=y.
    
    Fixes: be52cb139f57a ("x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: bdd5f35cf20c7397a7f74fb80446c136688e3145
    master date: 2026-01-08 11:05:30 +0100
---
 xen/arch/x86/hvm/dom0_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index a965cff45f..82cda30343 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1310,7 +1310,7 @@ static int __init pvh_setup_acpi(struct domain *d, paddr_t start_info)
     return 0;
 }
 
-static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
+static void __init pvh_setup_mmcfg(struct domain *d)
 {
     unsigned int i;
     int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:12:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:12:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202257.1517887 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhwF-0000Z0-6v; Tue, 13 Jan 2026 17:12:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202257.1517887; Tue, 13 Jan 2026 17:12:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhwF-0000Ys-4O; Tue, 13 Jan 2026 17:12:15 +0000
Received: by outflank-mailman (input) for mailman id 1202257;
 Tue, 13 Jan 2026 17: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 1vfhwD-0000Yh-Hn
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhwD-001jD8-2m
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhwD-001zpB-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17: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=zCSi+IZq7POwyt06HyNciMTj45JuCmMEm9paL49RpZw=; b=AzgeXydYh+dz9xlXeoTvWLY3dh
	moES1fEyRlaXBw1BGyeOXX9L8JJ+9lcr9SMqqqzzZENbRA3U84qa/58cvVQVjusef8iwrYDo6a+7r
	P2Rev9NFJ/aQ+Xvtw8NMNP6LFW4Bw5GxHvCEKjFUa0WpNUuEVDsh8blbwWb0ZZwr9riw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI/randconfig: Disable CONFIG_CONDITION_COVERAGE
Message-Id: <E1vfhwD-001zpB-1b@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:12:13 +0000

commit d2a91a129468b1f0ed585c98a2a0f22271256242
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 12 16:35:39 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    CI/randconfig: Disable CONFIG_CONDITION_COVERAGE
    
    In addition to GCC not liking x86_emulate(), it turns out that Clang is still
    rather more a work in progress than a usable feature, causing failures in the
    FreeBSD builds:
    
      https://cirrus-ci.com/task/5934059060199424
    
    Exclude CONFIG_CONDITION_COVERAGE from Ranconfig until it gets a bit more
    stable.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/tools/kconfig/allrandom.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/tools/kconfig/allrandom.config b/xen/tools/kconfig/allrandom.config
index f04b589a80..8127ebb570 100644
--- a/xen/tools/kconfig/allrandom.config
+++ b/xen/tools/kconfig/allrandom.config
@@ -1,2 +1,2 @@
 # Explicit option choices not subject to regular RANDCONFIG
-
+CONFIG_CONDITION_COVERAGE=n
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:12:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:12:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202258.1517891 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhwP-0000b8-8V; Tue, 13 Jan 2026 17:12:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202258.1517891; Tue, 13 Jan 2026 17:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhwP-0000az-5k; Tue, 13 Jan 2026 17:12:25 +0000
Received: by outflank-mailman (input) for mailman id 1202258;
 Tue, 13 Jan 2026 17: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 1vfhwN-0000al-L4
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhwN-001jDC-35
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhwN-001zq9-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17: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=gFngReIQOzuLINea9OODkvyAQyQEU2/mroaVNHWT83E=; b=maYpZ6JqI+Jats7t6OIAB0tYmW
	alKSrQ/y+y6YXffstnAT7Et619NG02QcLPMjLafskXqcy3Hn6CrcVCD9RqTCjEN9R3JPPoX4w8fPU
	v55d9H6jH4l63JBxC6WOXa4vktGNe4eJK/FOgPS9hm8ts26Fu0QXTNm8L3zjTpgrrJOY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/nodemask: Remove _unused_nodemask_arg_
Message-Id: <E1vfhwN-001zq9-1r@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:12:23 +0000

commit 66228b6e4067bd09b3820e3220f589315962ecf3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 12 10:32:24 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    xen/nodemask: Remove _unused_nodemask_arg_
    
    This only exists to have it's type taken, despite there being a perfectly good
    concrete type to use.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/nodemask.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index 1dd6c7458e..c9b18c47aa 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -67,8 +67,6 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
 
 #define nodemask_bits(src) ((src)->bits)
 
-extern nodemask_t _unused_nodemask_arg_;
-
 #define node_set(node, dst) __node_set((node), &(dst))
 static inline void __node_set(int node, volatile nodemask_t *dstp)
 {
@@ -215,7 +213,7 @@ static inline int __last_node(const nodemask_t *srcp, int nbits)
 
 #define nodemask_of_node(node)						\
 ({									\
-	typeof(_unused_nodemask_arg_) m;				\
+	nodemask_t m;							\
 	if (sizeof(m) == sizeof(unsigned long)) {			\
 		m.bits[0] = 1UL<<(node);				\
 	} else {							\
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:12:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202259.1517896 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhwZ-0000dG-B5; Tue, 13 Jan 2026 17:12:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202259.1517896; Tue, 13 Jan 2026 17: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 1vfhwZ-0000d8-76; Tue, 13 Jan 2026 17:12:35 +0000
Received: by outflank-mailman (input) for mailman id 1202259;
 Tue, 13 Jan 2026 17: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 1vfhwX-0000cv-Ni
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhwY-001jDM-08
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhwX-001zsc-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17: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=5ELSf802qHPMgqrW3HYGipQ+kMugdsOJreuwFH+ecgY=; b=Sx7NYBkloiOd9bhL4l3pmRlwT/
	muR1JHo3xWerrKF4kOjP70HZuxfGFxUaYMH3LFSz5kvmaIN+mS/wPFVsGNnujwkOsW35Bvksewe8+
	WPqk+AweFDLqNxgH4mGQjZOSsn5HqgrwbNF/kpmwwMIjl4A+tv8T1b2bnqAonuXhFLkA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu-policy: Filter out OS{XSAVE,PKE} in calculate_raw_cpu_policy()
Message-Id: <E1vfhwX-001zsc-2B@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:12:33 +0000

commit 3e47cfe9ee1a7b0b196cee303a6ce939473689c7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 13 13:13:43 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    x86/cpu-policy: Filter out OS{XSAVE,PKE} in calculate_raw_cpu_policy()
    
    They're dynamic too, and don't have named fields because no (other) logic in
    Xen ought to operate on them.  In particular, OSPKE being visible depending on
    whether we're in HVM or PV vCPU context when scanning.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu-policy.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index 372d11f2ff..5273fe0ae4 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -345,9 +345,13 @@ void calculate_raw_cpu_policy(void)
     ASSERT(p->x86_vendor == boot_cpu_data.vendor);
 
     /*
-     * Clear the truly dynamic fields.  These vary with the in-context XCR0
-     * and MSR_XSS, and aren't interesting fields in the raw policy.
+     * Clear the truly dynamic fields.
+     *
+     * - The OS* bits are forwards from CR4.
+     * - The xstate fields are calculated from XCR0 and MSR_XSS.
      */
+    p->basic.raw[1].c &= ~cpufeat_mask(X86_FEATURE_OSXSAVE);
+    p->feat.raw[0].c  &= ~cpufeat_mask(X86_FEATURE_OSPKE);
     p->xstate.raw[0].b = 0;
     p->xstate.raw[1].b = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:12:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:12:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202260.1517899 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhwj-0000fk-Av; Tue, 13 Jan 2026 17:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202260.1517899; Tue, 13 Jan 2026 17: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 1vfhwj-0000fc-8T; Tue, 13 Jan 2026 17:12:45 +0000
Received: by outflank-mailman (input) for mailman id 1202260;
 Tue, 13 Jan 2026 17: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 1vfhwh-0000fT-QW
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhwi-001jDk-0Q
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhwh-001ztW-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17: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=5LtR5ONHU+kMDcAGOuCb4UkuqeFRg+eKFiHFy7PmZtQ=; b=DzZChCQtkFwA339r7nvLYoe5zm
	LYAcdrGYmux1kI9o+zVazKYGbizGaKClJhqbL+ZbCjOrnYecPSqzQD/E8Z4AZnDlsnS5M2WbheHZ0
	3pAacdWVxD3v9MJiprga4CqB+2pgZEkZdx1xlPPs1rKQ/9YBCiT6CuKrau1Dzi3ozIi4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Use 32-bit counter for TLB clock on debug builds
Message-Id: <E1vfhwh-001ztW-2R@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:12:43 +0000

commit c42bb919d5aa58dc28df66f792f5a6b319b0ad03
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 13 13:09:58 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    x86: Use 32-bit counter for TLB clock on debug builds
    
    Debug builds traditionally ship with a 10-bit counter for the TLB
    clock. This forces global TLB shootdowns with high frequency, making
    debug builds unsuitable for any form of real time testing.
    
    Remove this quirk, unifying release and debug under a wide counter.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/flushtlb.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 09e676c151..23721bb52c 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -19,13 +19,6 @@
 #include <asm/pv/domain.h>
 #include <asm/spec_ctrl.h>
 
-/* Debug builds: Wrap frequently to stress-test the wrap logic. */
-#ifdef NDEBUG
-#define WRAP_MASK (0xFFFFFFFFU)
-#else
-#define WRAP_MASK (0x000003FFU)
-#endif
-
 #ifndef CONFIG_PV
 # undef X86_CR4_PCIDE
 # define X86_CR4_PCIDE 0
@@ -55,7 +48,7 @@ static u32 pre_flush(void)
         /* Clock wrapped: someone else is leading a global TLB shootdown. */
         if ( unlikely(t1 == 0) )
             goto skip_clocktick;
-        t2 = (t + 1) & WRAP_MASK;
+        t2 = t + 1;
     }
     while ( unlikely((t = cmpxchg(&tlbflush_clock, t1, t2)) != t1) );
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 17:12:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 17:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202261.1517902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfhwt-0000hw-CM; Tue, 13 Jan 2026 17:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202261.1517902; Tue, 13 Jan 2026 17: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 1vfhwt-0000ho-9p; Tue, 13 Jan 2026 17:12:55 +0000
Received: by outflank-mailman (input) for mailman id 1202261;
 Tue, 13 Jan 2026 17: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 1vfhwr-0000hY-TQ
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 17: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 1vfhws-001jDq-0h
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfhwr-001ztw-2l
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 17: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=O339CwR86IawllflGGqatcbCY3s1VSJrENk6GhQoK+I=; b=dJSUlFy3fqtqjEBOMx3Su764Yh
	SJJEZjT2irKwnMGv4vYIEmxzVOk4pin5GUBh6TMEgiiAmQhAfIpkG4Tz9GJLsv0pO1Fo/qCS4cBd3
	T9sSXhDPB5Dy6qfSgqN6tlfTHxb6MDEZF4s5j9phPLhHtqaUTn4p/1Qw430B5rjQYSKc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Rename UCODE_SCAN_DEFAULT to MICROCODE_SCAN_DEFAULT
Message-Id: <E1vfhwr-001ztw-2l@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 17:12:53 +0000

commit f4f68ddc603905e80b065ea9d0480e4c23674155
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 13 13:21:02 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    x86/ucode: Rename UCODE_SCAN_DEFAULT to MICROCODE_SCAN_DEFAULT
    
    We'd rather have the full spelling in Kconfig. Adjusts every other
    reference to the name too.
    
    Not a functional change.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/build.yaml   | 2 +-
 docs/misc/xen-command-line.pandoc | 2 +-
 xen/arch/x86/Kconfig              | 2 +-
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index a6fc55c2d5..b69bad9202 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -310,7 +310,7 @@ alpine-3.18-gcc-debug:
       CONFIG_ARGO=y
       CONFIG_UBSAN=y
       CONFIG_UBSAN_FATAL=y
-      CONFIG_UCODE_SCAN_DEFAULT=y
+      CONFIG_MICROCODE_SCAN_DEFAULT=y
       CONFIG_XHCI=y
 
 debian-13-x86_64-gcc-debug:
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 50d7edb248..15f7a315a4 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2773,7 +2773,7 @@ microcode in the cpio name space must be:
   - on AMD  : kernel/x86/microcode/AuthenticAMD.bin
 When using xen.efi, the `ucode=<filename>` config file setting takes
 precedence over `scan`. The default value for `scan` is set with
-`CONFIG_UCODE_SCAN_DEFAULT`.
+`CONFIG_MICROCODE_SCAN_DEFAULT`.
 
 'nmi' determines late loading is performed in NMI handler or just in
 stop_machine context. In NMI handler, even NMIs are blocked, which is
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index c808c989fc..d5705e4bff 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -331,7 +331,7 @@ config REQUIRE_NX
 	  was unavailable. However, if enabled, Xen will no longer boot on
 	  any CPU which is lacking NX support.
 
-config UCODE_SCAN_DEFAULT
+config MICROCODE_SCAN_DEFAULT
 	bool "Scan for microcode by default"
 	help
 	  During boot, Xen can scan the multiboot images for a CPIO archive
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index fe47c3a6c1..dabdb95b4c 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -101,7 +101,7 @@ static struct microcode_patch *microcode_cache;
  * location we require that they are not both active together.
  */
 static int __initdata opt_mod_idx;
-static bool __initdata opt_scan = IS_ENABLED(CONFIG_UCODE_SCAN_DEFAULT);
+static bool __initdata opt_scan = IS_ENABLED(CONFIG_MICROCODE_SCAN_DEFAULT);
 bool __ro_after_init opt_digest_check = true;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 18:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 18:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202308.1517916 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfjXj-0004dY-Db; Tue, 13 Jan 2026 18:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202308.1517916; Tue, 13 Jan 2026 18:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfjXj-0004dQ-B2; Tue, 13 Jan 2026 18:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1202308;
 Tue, 13 Jan 2026 18: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 1vfjXi-0004dK-Br
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 18: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 1vfjXi-001l1o-21
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfjXi-0025zV-0d
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TN0YEAVEj5iTD3IAqr+Ur+JJ2MkyYY+eAD71ZSYan3A=; b=oOSD3tCdtRhmP/VVtZoP8EhLXd
	8qGcExUfgMwh5iaDY8nMPChUz73KPVfLP+BC9xmLPEmpuZ1W1/tTvVL67O3TLmoej+gw5wuoarxTU
	jJibHjT+VMu1w0isfnDQq5CItCxp+IAZdjsOLS2h69WN4jM1RHooZaOzAN3xWXfiGOL0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI/randconfig: Disable CONFIG_CONDITION_COVERAGE
Message-Id: <E1vfjXi-0025zV-0d@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 18:55:02 +0000

commit d2a91a129468b1f0ed585c98a2a0f22271256242
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 12 16:35:39 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    CI/randconfig: Disable CONFIG_CONDITION_COVERAGE
    
    In addition to GCC not liking x86_emulate(), it turns out that Clang is still
    rather more a work in progress than a usable feature, causing failures in the
    FreeBSD builds:
    
      https://cirrus-ci.com/task/5934059060199424
    
    Exclude CONFIG_CONDITION_COVERAGE from Ranconfig until it gets a bit more
    stable.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/tools/kconfig/allrandom.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/tools/kconfig/allrandom.config b/xen/tools/kconfig/allrandom.config
index f04b589a80..8127ebb570 100644
--- a/xen/tools/kconfig/allrandom.config
+++ b/xen/tools/kconfig/allrandom.config
@@ -1,2 +1,2 @@
 # Explicit option choices not subject to regular RANDCONFIG
-
+CONFIG_CONDITION_COVERAGE=n
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 18:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 18:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202309.1517921 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfjXt-0004fC-FD; Tue, 13 Jan 2026 18:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202309.1517921; Tue, 13 Jan 2026 18: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 1vfjXt-0004f4-CQ; Tue, 13 Jan 2026 18:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1202309;
 Tue, 13 Jan 2026 18: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 1vfjXs-0004ev-DA
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 18: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 1vfjXs-001l3t-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfjXs-0025zy-16
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18: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=+LxmgrHXZpIVP1s1s5SR54TjUuaPIdiiyn2zWD+QIy8=; b=P/UCTwg9h5xeTOkVRJMXuLf1Zp
	19GzI1e1T05SP4xU6FwdeJzyn2APeMCLHHdFtc9gUlxAnMSRauAFp3Wd9CR5KwFRQ/+7OtAEixJsV
	h17KhSIlg7MGJa6ZYuNF+HdMUELQBi4MiOqmXs7N2aIosu0bH7DrNDTQyBlsFYL4apEA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/nodemask: Remove _unused_nodemask_arg_
Message-Id: <E1vfjXs-0025zy-16@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 18:55:12 +0000

commit 66228b6e4067bd09b3820e3220f589315962ecf3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 12 10:32:24 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    xen/nodemask: Remove _unused_nodemask_arg_
    
    This only exists to have it's type taken, despite there being a perfectly good
    concrete type to use.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/nodemask.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index 1dd6c7458e..c9b18c47aa 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -67,8 +67,6 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
 
 #define nodemask_bits(src) ((src)->bits)
 
-extern nodemask_t _unused_nodemask_arg_;
-
 #define node_set(node, dst) __node_set((node), &(dst))
 static inline void __node_set(int node, volatile nodemask_t *dstp)
 {
@@ -215,7 +213,7 @@ static inline int __last_node(const nodemask_t *srcp, int nbits)
 
 #define nodemask_of_node(node)						\
 ({									\
-	typeof(_unused_nodemask_arg_) m;				\
+	nodemask_t m;							\
 	if (sizeof(m) == sizeof(unsigned long)) {			\
 		m.bits[0] = 1UL<<(node);				\
 	} else {							\
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 18:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 18:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202310.1517925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfjY3-0004hf-GJ; Tue, 13 Jan 2026 18:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202310.1517925; Tue, 13 Jan 2026 18: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 1vfjY3-0004hX-Dm; Tue, 13 Jan 2026 18:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1202310;
 Tue, 13 Jan 2026 18: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 1vfjY2-0004hM-Hr
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 18: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 1vfjY2-001l3z-2m
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfjY2-00260i-1O
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18: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=DTXTcxmbJJ7uTzRUFWzETc0OJJAq1HPbVKb8fzGFGE4=; b=Opa2SK6BkPcFG4GZjIB2OQV4IB
	3YDpiVDZ3/ryzvBZS5DAFZJcNd7YYvVZfOiVAPa+egp3rqPVADcK3FZLK4iMm9ICoagISTyyOA11I
	c/NJgPZcW/Vkpdcxbmz3WE0R4N/ll+6D/6iW2OyodNc+FZayGq+DgdteQpEC6tNKhh0M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu-policy: Filter out OS{XSAVE,PKE} in calculate_raw_cpu_policy()
Message-Id: <E1vfjY2-00260i-1O@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 18:55:22 +0000

commit 3e47cfe9ee1a7b0b196cee303a6ce939473689c7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 13 13:13:43 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    x86/cpu-policy: Filter out OS{XSAVE,PKE} in calculate_raw_cpu_policy()
    
    They're dynamic too, and don't have named fields because no (other) logic in
    Xen ought to operate on them.  In particular, OSPKE being visible depending on
    whether we're in HVM or PV vCPU context when scanning.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu-policy.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index 372d11f2ff..5273fe0ae4 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -345,9 +345,13 @@ void calculate_raw_cpu_policy(void)
     ASSERT(p->x86_vendor == boot_cpu_data.vendor);
 
     /*
-     * Clear the truly dynamic fields.  These vary with the in-context XCR0
-     * and MSR_XSS, and aren't interesting fields in the raw policy.
+     * Clear the truly dynamic fields.
+     *
+     * - The OS* bits are forwards from CR4.
+     * - The xstate fields are calculated from XCR0 and MSR_XSS.
      */
+    p->basic.raw[1].c &= ~cpufeat_mask(X86_FEATURE_OSXSAVE);
+    p->feat.raw[0].c  &= ~cpufeat_mask(X86_FEATURE_OSPKE);
     p->xstate.raw[0].b = 0;
     p->xstate.raw[1].b = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 18:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 18:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202311.1517929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfjYD-0004jp-Hj; Tue, 13 Jan 2026 18:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202311.1517929; Tue, 13 Jan 2026 18: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 1vfjYD-0004jg-F7; Tue, 13 Jan 2026 18:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1202311;
 Tue, 13 Jan 2026 18: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 1vfjYC-0004jU-Kb
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 18: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 1vfjYC-001l45-33
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfjYC-00261D-1r
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18: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=UP9TrbgSQ7gL/rPTmJqQU58m2un3jwUv/9BeVd/7kDo=; b=S0q8eJa1cvBNbe3Q/4vTlhL631
	Vdc2kGauPiyXK82h81sn3QXSLq2GicAGDyXsxywV5MNX4jVyLWTNa2U+G5R5wb2PPhxOtNvdCXIb3
	j9hKVk7C7NL4JlgctU5Fi383mp78BZ3jwddi+JirpZh/LwKQQni5d1e6AWuVLml48VAM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Use 32-bit counter for TLB clock on debug builds
Message-Id: <E1vfjYC-00261D-1r@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 18:55:32 +0000

commit c42bb919d5aa58dc28df66f792f5a6b319b0ad03
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 13 13:09:58 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    x86: Use 32-bit counter for TLB clock on debug builds
    
    Debug builds traditionally ship with a 10-bit counter for the TLB
    clock. This forces global TLB shootdowns with high frequency, making
    debug builds unsuitable for any form of real time testing.
    
    Remove this quirk, unifying release and debug under a wide counter.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/flushtlb.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 09e676c151..23721bb52c 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -19,13 +19,6 @@
 #include <asm/pv/domain.h>
 #include <asm/spec_ctrl.h>
 
-/* Debug builds: Wrap frequently to stress-test the wrap logic. */
-#ifdef NDEBUG
-#define WRAP_MASK (0xFFFFFFFFU)
-#else
-#define WRAP_MASK (0x000003FFU)
-#endif
-
 #ifndef CONFIG_PV
 # undef X86_CR4_PCIDE
 # define X86_CR4_PCIDE 0
@@ -55,7 +48,7 @@ static u32 pre_flush(void)
         /* Clock wrapped: someone else is leading a global TLB shootdown. */
         if ( unlikely(t1 == 0) )
             goto skip_clocktick;
-        t2 = (t + 1) & WRAP_MASK;
+        t2 = t + 1;
     }
     while ( unlikely((t = cmpxchg(&tlbflush_clock, t1, t2)) != t1) );
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 13 18:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Jan 2026 18:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1202312.1517933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vfjYN-0004mf-KW; Tue, 13 Jan 2026 18:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1202312.1517933; Tue, 13 Jan 2026 18: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 1vfjYN-0004mX-Hp; Tue, 13 Jan 2026 18:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1202312;
 Tue, 13 Jan 2026 18: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 1vfjYM-0004mR-NZ
 for xen-changelog@lists.xenproject.org; Tue, 13 Jan 2026 18: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 1vfjYN-001l4B-07
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vfjYM-00261b-29
 for xen-changelog@lists.xenproject.org;
 Tue, 13 Jan 2026 18:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uCE+KDQJPXvgdGSw+p/NtZelOYZaJ1khwt22lEk5WHU=; b=6OkUcCzo0m1OQL8vnZpreKCpez
	PLXG5iVxseatD7r0QaR5ljUGiTUxmFcX41mWpjRqoTxeHWQJTmvBi3BfLQK4P8e2x/9Jahb3wQAzt
	fm6Ml/QKAFeAt9jTIuAiMQaiUKMNW0bqAQ4toZ8GS19vgrYKQuD7QVb3sdvb7UjtKGZ8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Rename UCODE_SCAN_DEFAULT to MICROCODE_SCAN_DEFAULT
Message-Id: <E1vfjYM-00261b-29@xenbits.xenproject.org>
Date: Tue, 13 Jan 2026 18:55:42 +0000

commit f4f68ddc603905e80b065ea9d0480e4c23674155
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 13 13:21:02 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 13 15:47:02 2026 +0000

    x86/ucode: Rename UCODE_SCAN_DEFAULT to MICROCODE_SCAN_DEFAULT
    
    We'd rather have the full spelling in Kconfig. Adjusts every other
    reference to the name too.
    
    Not a functional change.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/build.yaml   | 2 +-
 docs/misc/xen-command-line.pandoc | 2 +-
 xen/arch/x86/Kconfig              | 2 +-
 xen/arch/x86/cpu/microcode/core.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index a6fc55c2d5..b69bad9202 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -310,7 +310,7 @@ alpine-3.18-gcc-debug:
       CONFIG_ARGO=y
       CONFIG_UBSAN=y
       CONFIG_UBSAN_FATAL=y
-      CONFIG_UCODE_SCAN_DEFAULT=y
+      CONFIG_MICROCODE_SCAN_DEFAULT=y
       CONFIG_XHCI=y
 
 debian-13-x86_64-gcc-debug:
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 50d7edb248..15f7a315a4 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2773,7 +2773,7 @@ microcode in the cpio name space must be:
   - on AMD  : kernel/x86/microcode/AuthenticAMD.bin
 When using xen.efi, the `ucode=<filename>` config file setting takes
 precedence over `scan`. The default value for `scan` is set with
-`CONFIG_UCODE_SCAN_DEFAULT`.
+`CONFIG_MICROCODE_SCAN_DEFAULT`.
 
 'nmi' determines late loading is performed in NMI handler or just in
 stop_machine context. In NMI handler, even NMIs are blocked, which is
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index c808c989fc..d5705e4bff 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -331,7 +331,7 @@ config REQUIRE_NX
 	  was unavailable. However, if enabled, Xen will no longer boot on
 	  any CPU which is lacking NX support.
 
-config UCODE_SCAN_DEFAULT
+config MICROCODE_SCAN_DEFAULT
 	bool "Scan for microcode by default"
 	help
 	  During boot, Xen can scan the multiboot images for a CPIO archive
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index fe47c3a6c1..dabdb95b4c 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -101,7 +101,7 @@ static struct microcode_patch *microcode_cache;
  * location we require that they are not both active together.
  */
 static int __initdata opt_mod_idx;
-static bool __initdata opt_scan = IS_ENABLED(CONFIG_UCODE_SCAN_DEFAULT);
+static bool __initdata opt_scan = IS_ENABLED(CONFIG_MICROCODE_SCAN_DEFAULT);
 bool __ro_after_init opt_digest_check = true;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 15:11:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 15:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203341.1518560 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg2WV-0005Hx-Mu; Wed, 14 Jan 2026 15:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203341.1518560; Wed, 14 Jan 2026 15:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg2WV-0005Hp-KE; Wed, 14 Jan 2026 15:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1203341;
 Wed, 14 Jan 2026 15:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vg2WU-0005Hj-AC
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 15:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg2WU-003G8G-1q
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 15:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg2WU-003D7O-0a
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 15:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0e0U9io/mJLbTvAseAO0d1YPe/HRGXL5c5/vqDNmwHs=; b=SBaiML9XoIY1SA+ET0LMC3LxHO
	WXwA3U/058RPAJFPHnX7Q+B7bn2Wmg0yMPChR30BYR3zkJChhr9fgnV7vZGe1RvSATTEdSAqcInN4
	48AsgadO6Iu9K2Tap1RoHj4aNuxiZsLPG2CZI5xqFjX5Nc6hWzEY+sZqIVHtU44TKZZo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: scale_delta() can be static
Message-Id: <E1vg2WU-003D7O-0a@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 15:11:02 +0000

commit 5ecc04d9e02b66e93f63f5ef6494890218b23611
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:47:09 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:47:09 2026 +0100

    x86/time: scale_delta() can be static
    
    It's used in time.c alone. Modernize types while there.
    
    Amends: 5a82d598d2d ("viridian: unify time sources")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/time.h | 1 -
 xen/arch/x86/time.c             | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index c35d25abd6..e45b9ebbfc 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -56,7 +56,6 @@ u64 stime2tsc(s_time_t stime);
 
 struct time_scale;
 void set_time_scale(struct time_scale *ts, u64 ticks_per_sec);
-u64 scale_delta(u64 delta, const struct time_scale *scale);
 
 /* Programmable Interval Timer (8254) */
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 36d990f7f4..0664ffb806 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -133,9 +133,9 @@ static inline u32 mul_frac(u32 multiplicand, u32 multiplier)
  * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
  * yielding a 64-bit result.
  */
-u64 scale_delta(u64 delta, const struct time_scale *scale)
+static uint64_t scale_delta(uint64_t delta, const struct time_scale *scale)
 {
-    u64 product;
+    uint64_t product;
 
     if ( scale->shift < 0 )
         delta >>= -scale->shift;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 15:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 15:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203342.1518564 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg2Wf-0005Jj-OH; Wed, 14 Jan 2026 15:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203342.1518564; Wed, 14 Jan 2026 15:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg2Wf-0005Jb-Lj; Wed, 14 Jan 2026 15:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1203342;
 Wed, 14 Jan 2026 15:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vg2We-0005JS-Cf
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 15:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg2We-003G8R-2F
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 15:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg2We-003D8U-10
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 15:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CoD1S6GM2RYhWqT01xnu5ochP6GEp1UXZxTK/lXhXXo=; b=lBzM5dCt3qDE+uQxOyt9uB7y8/
	c3gWUf23LU153yhQKF053ZxkavLIekmkP9dGgDuQyBInuMmFPkUYr9kGENGUf74lTHNvG8cFrdaQi
	KbQ3FRJxX1Uw8KTzoBxoGL0D/liYooUExIuMBcEcJ+97U8FlqvODRmCd/EIlvXGtF+Kw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HVM: drop at_tsc parameter from ->set_tsc_offset() hook
Message-Id: <E1vg2We-003D8U-10@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 15:11:12 +0000

commit b70825ee3a8a5b2c8f5c74da614e8d13905f80cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:48:21 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:48:21 2026 +0100

    x86/HVM: drop at_tsc parameter from ->set_tsc_offset() hook
    
    While the VMX hook never used the parameter, the SVM one lost its sole use
    some time ago (while the original use of the parameter had gone away even
    earlier).
    
    Again modernize types while there.
    
    Amends: 0cd50753eb40 ("nestedsvm: Disable TscRateMSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/domain.c          | 3 +--
 xen/arch/x86/hvm/hvm.c             | 7 +++----
 xen/arch/x86/hvm/svm/svm.c         | 2 +-
 xen/arch/x86/hvm/vmx/vmx.c         | 2 +-
 xen/arch/x86/hvm/vmx/vvmx.c        | 4 ++--
 xen/arch/x86/include/asm/hvm/hvm.h | 9 ++++-----
 xen/arch/x86/time.c                | 3 +--
 7 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 37092f31f3..155d61db13 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -312,8 +312,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
         d->vcpu[0]->arch.hvm.cache_tsc_offset;
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset,
-                       d->arch.hvm.sync_tsc);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     paging_update_paging_modes(v);
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4084b610fa..0eafa515bb 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -412,7 +412,7 @@ static void hvm_set_guest_tsc_fixed(struct vcpu *v, u64 guest_tsc, u64 at_tsc)
     delta_tsc = guest_tsc - tsc;
     v->arch.hvm.cache_tsc_offset = delta_tsc;
 
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, at_tsc);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 }
 
 #define hvm_set_guest_tsc(v, t) hvm_set_guest_tsc_fixed(v, t, 0)
@@ -430,7 +430,7 @@ static void hvm_set_guest_tsc_msr(struct vcpu *v, u64 guest_tsc)
 static void hvm_set_guest_tsc_adjust(struct vcpu *v, u64 tsc_adjust)
 {
     v->arch.hvm.cache_tsc_offset += tsc_adjust - v->arch.hvm.msr_tsc_adjust;
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, 0);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
     v->arch.hvm.msr_tsc_adjust = tsc_adjust;
     if ( v == current )
         update_vcpu_system_time(v);
@@ -4023,8 +4023,7 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
         v->domain->vcpu[0]->arch.hvm.cache_tsc_offset;
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset,
-                       d->arch.hvm.sync_tsc);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     v->arch.hvm.msr_tsc_adjust = 0;
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index da113f488b..564337bb4e 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -778,7 +778,7 @@ static int cf_check svm_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
-static void cf_check svm_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
+static void cf_check svm_set_tsc_offset(struct vcpu *v, uint64_t offset)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
     struct vmcb_struct *n1vmcb, *n2vmcb;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index b1c37268da..524bce8307 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1556,7 +1556,7 @@ static void cf_check vmx_handle_cd(struct vcpu *v, unsigned long value)
     }
 }
 
-static void cf_check vmx_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
+static void cf_check vmx_set_tsc_offset(struct vcpu *v, uint64_t offset)
 {
     vmx_vmcs_enter(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e4f3a5fe4c..38952f0696 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1114,7 +1114,7 @@ static void load_shadow_guest_state(struct vcpu *v)
             hvm_inject_hw_exception(X86_EXC_GP, 0);
     }
 
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, 0);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     vvmcs_to_shadow_bulk(v, ARRAY_SIZE(vmentry_fields), vmentry_fields);
 
@@ -1330,7 +1330,7 @@ static void load_vvmcs_host_state(struct vcpu *v)
             hvm_inject_hw_exception(X86_EXC_GP, 0);
     }
 
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, 0);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     set_vvmcs(v, VM_ENTRY_INTR_INFO, 0);
 
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 7412256a2d..666fa402a8 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -165,7 +165,7 @@ struct hvm_function_table {
     int  (*get_guest_pat)(struct vcpu *v, uint64_t *gpat);
     int  (*set_guest_pat)(struct vcpu *v, uint64_t gpat);
 
-    void (*set_tsc_offset)(struct vcpu *v, u64 offset, u64 at_tsc);
+    void (*set_tsc_offset)(struct vcpu *v, uint64_t offset);
 
     void (*inject_event)(const struct x86_event *event);
 
@@ -482,10 +482,9 @@ static inline void hvm_cpuid_policy_changed(struct vcpu *v)
     alternative_vcall(hvm_funcs.cpuid_policy_changed, v);
 }
 
-static inline void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset,
-                                      uint64_t at_tsc)
+static inline void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset)
 {
-    alternative_vcall(hvm_funcs.set_tsc_offset, v, offset, at_tsc);
+    alternative_vcall(hvm_funcs.set_tsc_offset, v, offset);
 }
 
 /*
@@ -847,7 +846,7 @@ static inline void hvm_sync_pir_to_irr(struct vcpu *v)
  */
 int hvm_guest_x86_mode(struct vcpu *v);
 void hvm_cpuid_policy_changed(struct vcpu *v);
-void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset, uint64_t at_tsc);
+void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset);
 
 /* End of prototype list */
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0664ffb806..0bfad0f634 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2982,8 +2982,7 @@ int tsc_set_info(struct domain *d,
              */
             d->arch.hvm.sync_tsc = rdtsc();
             hvm_set_tsc_offset(d->vcpu[0],
-                               d->vcpu[0]->arch.hvm.cache_tsc_offset,
-                               d->arch.hvm.sync_tsc);
+                               d->vcpu[0]->arch.hvm.cache_tsc_offset);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 15:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 15:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203343.1518568 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg2Wp-0005M5-Pb; Wed, 14 Jan 2026 15:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203343.1518568; Wed, 14 Jan 2026 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 1vg2Wp-0005Lx-N5; Wed, 14 Jan 2026 15:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1203343;
 Wed, 14 Jan 2026 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 1vg2Wo-0005Ln-Ia
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 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 1vg2Wo-003G8V-2q
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 15:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg2Wo-003D9u-1K
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 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=d0sIgPND/n/HakdSubI2ZCDts14mduJb20/bUjwpKmM=; b=um5inJnMu8UDLy7JmariXpF0/s
	f5axe6gO4hvCui/NiM03oFbbaWFTefCGeWCDwYFmy2Dl8WlPC74m9bKjvh/K3jGtLsiMU916ugt+t
	L8mZMLnDezou+6rvVE6WUj01mDwPJCjC+wcttq8aV3tSdN9phw195EFfcCJVcFQgB1KA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: gtsc_to_gtime() is HVM-only
Message-Id: <E1vg2Wo-003D9u-1K@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 15:11:22 +0000

commit 91c5bbbb912931e0a1d694d358a86a85d653535b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:48:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:48:47 2026 +0100

    x86/time: gtsc_to_gtime() is HVM-only
    
    Omit the function when HVM=n. With that the !HVM logic can also go away;
    leave an assertion.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0bfad0f634..c5005a0360 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2837,14 +2837,13 @@ uint64_t gtime_to_gtsc(const struct domain *d, uint64_t time)
     return scale_delta(time, &d->arch.ns_to_vtsc);
 }
 
+#ifdef CONFIG_HVM
 uint64_t gtsc_to_gtime(const struct domain *d, uint64_t tsc)
 {
-    u64 time = scale_delta(tsc, &d->arch.vtsc_to_ns);
-
-    if ( !is_hvm_domain(d) )
-        time += d->arch.vtsc_offset;
-    return time;
+    ASSERT(is_hvm_domain(d));
+    return scale_delta(tsc, &d->arch.vtsc_to_ns);
 }
+#endif /* CONFIG_HVM */
 
 uint64_t pv_soft_rdtsc(const struct vcpu *v, const struct cpu_user_regs *regs)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 15:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 15:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203344.1518572 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg2Wz-0005OG-R6; Wed, 14 Jan 2026 15:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203344.1518572; Wed, 14 Jan 2026 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 1vg2Wz-0005O7-OR; Wed, 14 Jan 2026 15:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1203344;
 Wed, 14 Jan 2026 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 1vg2Wy-0005Nz-MT
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 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 1vg2Wy-003G8c-3D
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 15:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg2Wy-003DAd-1w
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 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=P2e2ZRw/BadJBL3eNxNxzWjchecX4nKnlmPk2mzCAOc=; b=TtYyVB/n93edY7W10ZexIcczKp
	IOVxGPqaAD674ZHy1EqDV9EJba66yvb08q6m2RI+TLnn26cE52PonPzTLNq5rBRpG3LUvrQnBeEK4
	SIhyzBRQwOq6gIb0Xn12aA8+C1Y2BGTvbUbJkM6ICWdrzvpys/fXHbww3mud3xZV+22A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: pv_soft_rdtsc() is PV-only
Message-Id: <E1vg2Wy-003DAd-1w@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 15:11:32 +0000

commit a6ed4543222a309a4c3ecaced0e85d8e4502c93f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:49:16 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:49:16 2026 +0100

    x86/time: pv_soft_rdtsc() is PV-only
    
    Omit the function when PV=n, by moving it to the sole file using it, thus
    allowing it to become static as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/time.h |  2 --
 xen/arch/x86/pv/emul-priv-op.c  | 16 +++++++++++++++-
 xen/arch/x86/time.c             | 13 -------------
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index e45b9ebbfc..c5e826456d 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -37,8 +37,6 @@ uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
 uint64_t tsc_ticks2ns(uint64_t ticks);
 
-struct cpu_user_regs;
-uint64_t pv_soft_rdtsc(const struct vcpu *v, const struct cpu_user_regs *regs);
 uint64_t gtime_to_gtsc(const struct domain *d, uint64_t time);
 uint64_t gtsc_to_gtime(const struct domain *d, uint64_t tsc);
 
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index e6d370cd81..c970e16152 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -874,6 +874,20 @@ static uint64_t guest_efer(const struct domain *d)
     return val;
 }
 
+static uint64_t soft_rdtsc(
+    const struct vcpu *v, const struct cpu_user_regs *regs)
+{
+    s_time_t old, new, now = get_s_time();
+    struct domain *d = v->domain;
+
+    do {
+        old = d->arch.vtsc_last;
+        new = now > d->arch.vtsc_last ? now : old + 1;
+    } while ( cmpxchg(&d->arch.vtsc_last, old, new) != old );
+
+    return gtime_to_gtsc(d, new);
+}
+
 static int cf_check read_msr(
     unsigned int reg, uint64_t *val, struct x86_emulate_ctxt *ctxt)
 {
@@ -920,7 +934,7 @@ static int cf_check read_msr(
         return X86EMUL_OKAY;
 
     case MSR_IA32_TSC:
-        *val = currd->arch.vtsc ? pv_soft_rdtsc(curr, ctxt->regs) : rdtsc();
+        *val = currd->arch.vtsc ? soft_rdtsc(curr, ctxt->regs) : rdtsc();
         return X86EMUL_OKAY;
 
     case MSR_EFER:
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index c5005a0360..03a383a9a5 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2845,19 +2845,6 @@ uint64_t gtsc_to_gtime(const struct domain *d, uint64_t tsc)
 }
 #endif /* CONFIG_HVM */
 
-uint64_t pv_soft_rdtsc(const struct vcpu *v, const struct cpu_user_regs *regs)
-{
-    s_time_t old, new, now = get_s_time();
-    struct domain *d = v->domain;
-
-    do {
-        old = d->arch.vtsc_last;
-        new = now > d->arch.vtsc_last ? now : old + 1;
-    } while ( cmpxchg(&d->arch.vtsc_last, old, new) != old );
-
-    return gtime_to_gtsc(d, new);
-}
-
 bool clocksource_is_tsc(void)
 {
     return plt_src.read_counter == READ_TSC_POISON;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 15:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 15:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203345.1518576 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg2X9-0005QK-SY; Wed, 14 Jan 2026 15:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203345.1518576; Wed, 14 Jan 2026 15: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 1vg2X9-0005QC-Pq; Wed, 14 Jan 2026 15:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1203345;
 Wed, 14 Jan 2026 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 1vg2X8-0005Q4-PE
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 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 1vg2X9-003G8l-0H
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 15:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg2X8-003DBl-2J
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 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=oXdRVlZ9HwiwcQetP0OuAyd7QhnDl8pc1qY5zhqc/Wg=; b=Aujf5iOIqs2nIOO3/Q/1FtrRi1
	QfwhCDNNCiB1d1ve2LIMIwBYS+pikkeEeLo4DFb4r8Y9uPvs6pGq/4NngwMWNPuTrEoheoOWuWLnf
	ztl8SlRyxfQdY7OZMCbj9tr3BsrRetb6GB1VJLz1NdYM1hENeGnuBh2xyJnKDe/ZuSBs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/platform: adjust CONFIG_VIDEO usage
Message-Id: <E1vg2X8-003DBl-2J@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 15:11:42 +0000

commit 322c4e8fa27edca0d0e7131a1c0620259346e116
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:49:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:49:39 2026 +0100

    x86/platform: adjust CONFIG_VIDEO usage
    
    Switch to using IS_ENABLED() in both places, thus in particular making
    sure XENPF_get_dom0_console handling doesn't take the "default" path: The
    behavior better wouldn't differ between VIDEO=y and there not being VGA vs
    VIDEO=n. For this to work, fill_console_start_info() needs to be
    unconditionally declared; extend that to vga_console_info as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/platform_hypercall.c | 21 +++++++++------------
 xen/include/xen/vga.h             |  3 ++-
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 79bb99e0b6..214b130ea8 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -415,10 +415,9 @@ ret_t do_platform_op(
         }
         case XEN_FW_VBEDDC_INFO:
             ret = -ESRCH;
-#ifdef CONFIG_VIDEO
-            if ( op->u.firmware_info.index != 0 )
-                break;
-            if ( *(u32 *)bootsym(boot_edid_info) == 0x13131313 )
+            if ( !IS_ENABLED(CONFIG_VIDEO) ||
+                 op->u.firmware_info.index != 0 ||
+                 *(uint32_t *)bootsym(boot_edid_info) == 0x13131313 )
                 break;
 
             op->u.firmware_info.u.vbeddc_info.capabilities =
@@ -434,7 +433,6 @@ ret_t do_platform_op(
                  copy_to_compat(op->u.firmware_info.u.vbeddc_info.edid,
                                 bootsym(boot_edid_info), 128) )
                 ret = -EFAULT;
-#endif
             break;
         case XEN_FW_EFI_INFO:
             ret = efi_get_info(op->u.firmware_info.index,
@@ -905,20 +903,19 @@ ret_t do_platform_op(
         break;
     }
 
-#ifdef CONFIG_VIDEO
     case XENPF_get_dom0_console:
         BUILD_BUG_ON(sizeof(op->u.dom0_console) > sizeof(op->u.pad));
-        ret = sizeof(op->u.dom0_console);
-        if ( !fill_console_start_info(&op->u.dom0_console) )
-        {
-            ret = -ENODEV;
+
+        ret = -ENODEV;
+        if ( !IS_ENABLED(CONFIG_VIDEO) ||
+             !fill_console_start_info(&op->u.dom0_console) )
             break;
-        }
+
+        ret = sizeof(op->u.dom0_console);
 
         if ( copy_field_to_guest(u_xenpf_op, op, u.dom0_console) )
             ret = -EFAULT;
         break;
-#endif
 
     default:
         ret = -ENOSYS;
diff --git a/xen/include/xen/vga.h b/xen/include/xen/vga.h
index ceb8a527ed..43e6961b81 100644
--- a/xen/include/xen/vga.h
+++ b/xen/include/xen/vga.h
@@ -11,9 +11,10 @@
 
 #include <xen/video.h>
 
-#ifdef CONFIG_VGA
 extern struct xen_vga_console_info vga_console_info;
 int fill_console_start_info(struct dom0_vga_console_info *ci);
+
+#ifdef CONFIG_VGA
 void vesa_init(void);
 void vesa_early_init(void);
 void vesa_endboot(bool keep);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 16:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 16:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203446.1518640 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg3SZ-00084q-Ey; Wed, 14 Jan 2026 16:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203446.1518640; Wed, 14 Jan 2026 16:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg3SZ-00084j-C4; Wed, 14 Jan 2026 16:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1203446;
 Wed, 14 Jan 2026 16:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vg3SY-00084d-2I
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 16:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg3SY-003HhK-14
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg3SX-003GMb-35
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7RvxP1TJUvVBmD/VzgYsaEAdZktfJ3soHKqT4y30XMw=; b=nz6ps4giSmaavwKGux4jIiWh3f
	WtgW6uECWPTuRbt85QM4RK+gebg7v8PbmWju3Dj4uUV42e6gXvAXvQrI7TJXI2IYCbuV8W0MgC9e4
	grAar9NaFroQqvHgLClduSg7Mqx+tNvbQq2eWz/Bfstkk361frYoOU8h+cdbqcQ3hgfA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: scale_delta() can be static
Message-Id: <E1vg3SX-003GMb-35@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 16:11:01 +0000

commit 5ecc04d9e02b66e93f63f5ef6494890218b23611
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:47:09 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:47:09 2026 +0100

    x86/time: scale_delta() can be static
    
    It's used in time.c alone. Modernize types while there.
    
    Amends: 5a82d598d2d ("viridian: unify time sources")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/time.h | 1 -
 xen/arch/x86/time.c             | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index c35d25abd6..e45b9ebbfc 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -56,7 +56,6 @@ u64 stime2tsc(s_time_t stime);
 
 struct time_scale;
 void set_time_scale(struct time_scale *ts, u64 ticks_per_sec);
-u64 scale_delta(u64 delta, const struct time_scale *scale);
 
 /* Programmable Interval Timer (8254) */
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 36d990f7f4..0664ffb806 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -133,9 +133,9 @@ static inline u32 mul_frac(u32 multiplicand, u32 multiplier)
  * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
  * yielding a 64-bit result.
  */
-u64 scale_delta(u64 delta, const struct time_scale *scale)
+static uint64_t scale_delta(uint64_t delta, const struct time_scale *scale)
 {
-    u64 product;
+    uint64_t product;
 
     if ( scale->shift < 0 )
         delta >>= -scale->shift;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 16:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 16:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203447.1518645 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg3Sj-00086Y-Gq; Wed, 14 Jan 2026 16:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203447.1518645; Wed, 14 Jan 2026 16:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg3Sj-00086Q-Df; Wed, 14 Jan 2026 16:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1203447;
 Wed, 14 Jan 2026 16:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vg3Si-00086I-7B
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 16:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg3Si-003Hhm-1b
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg3Si-003GN0-0E
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16: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=Inmf7QS/hv5S++rNuvPbgUGIMzru3Xr/ArciT1kJvls=; b=ER0Z4jKAYNHzD/6RxiVtgx6OP1
	zbKCcP3UvLP/LQrZhGK73M13OGC7vL+jlAQ9Zc+/kBCNeDAhLTl1izt/uh+JUN4wZQ0MVfXvnBaCk
	bnqI8OaUN6z9YdgJZ6cxrE9noavWPwE8hQJsjZ+FwALH+Pg3t0QMUsCodPS10sPVCze0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HVM: drop at_tsc parameter from ->set_tsc_offset() hook
Message-Id: <E1vg3Si-003GN0-0E@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 16:11:12 +0000

commit b70825ee3a8a5b2c8f5c74da614e8d13905f80cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:48:21 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:48:21 2026 +0100

    x86/HVM: drop at_tsc parameter from ->set_tsc_offset() hook
    
    While the VMX hook never used the parameter, the SVM one lost its sole use
    some time ago (while the original use of the parameter had gone away even
    earlier).
    
    Again modernize types while there.
    
    Amends: 0cd50753eb40 ("nestedsvm: Disable TscRateMSR")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/domain.c          | 3 +--
 xen/arch/x86/hvm/hvm.c             | 7 +++----
 xen/arch/x86/hvm/svm/svm.c         | 2 +-
 xen/arch/x86/hvm/vmx/vmx.c         | 2 +-
 xen/arch/x86/hvm/vmx/vvmx.c        | 4 ++--
 xen/arch/x86/include/asm/hvm/hvm.h | 9 ++++-----
 xen/arch/x86/time.c                | 3 +--
 7 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 37092f31f3..155d61db13 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -312,8 +312,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
         d->vcpu[0]->arch.hvm.cache_tsc_offset;
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset,
-                       d->arch.hvm.sync_tsc);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     paging_update_paging_modes(v);
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4084b610fa..0eafa515bb 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -412,7 +412,7 @@ static void hvm_set_guest_tsc_fixed(struct vcpu *v, u64 guest_tsc, u64 at_tsc)
     delta_tsc = guest_tsc - tsc;
     v->arch.hvm.cache_tsc_offset = delta_tsc;
 
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, at_tsc);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 }
 
 #define hvm_set_guest_tsc(v, t) hvm_set_guest_tsc_fixed(v, t, 0)
@@ -430,7 +430,7 @@ static void hvm_set_guest_tsc_msr(struct vcpu *v, u64 guest_tsc)
 static void hvm_set_guest_tsc_adjust(struct vcpu *v, u64 tsc_adjust)
 {
     v->arch.hvm.cache_tsc_offset += tsc_adjust - v->arch.hvm.msr_tsc_adjust;
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, 0);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
     v->arch.hvm.msr_tsc_adjust = tsc_adjust;
     if ( v == current )
         update_vcpu_system_time(v);
@@ -4023,8 +4023,7 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
         v->domain->vcpu[0]->arch.hvm.cache_tsc_offset;
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset,
-                       d->arch.hvm.sync_tsc);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     v->arch.hvm.msr_tsc_adjust = 0;
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index da113f488b..564337bb4e 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -778,7 +778,7 @@ static int cf_check svm_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
-static void cf_check svm_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
+static void cf_check svm_set_tsc_offset(struct vcpu *v, uint64_t offset)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
     struct vmcb_struct *n1vmcb, *n2vmcb;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index b1c37268da..524bce8307 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1556,7 +1556,7 @@ static void cf_check vmx_handle_cd(struct vcpu *v, unsigned long value)
     }
 }
 
-static void cf_check vmx_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
+static void cf_check vmx_set_tsc_offset(struct vcpu *v, uint64_t offset)
 {
     vmx_vmcs_enter(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e4f3a5fe4c..38952f0696 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1114,7 +1114,7 @@ static void load_shadow_guest_state(struct vcpu *v)
             hvm_inject_hw_exception(X86_EXC_GP, 0);
     }
 
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, 0);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     vvmcs_to_shadow_bulk(v, ARRAY_SIZE(vmentry_fields), vmentry_fields);
 
@@ -1330,7 +1330,7 @@ static void load_vvmcs_host_state(struct vcpu *v)
             hvm_inject_hw_exception(X86_EXC_GP, 0);
     }
 
-    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, 0);
+    hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset);
 
     set_vvmcs(v, VM_ENTRY_INTR_INFO, 0);
 
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 7412256a2d..666fa402a8 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -165,7 +165,7 @@ struct hvm_function_table {
     int  (*get_guest_pat)(struct vcpu *v, uint64_t *gpat);
     int  (*set_guest_pat)(struct vcpu *v, uint64_t gpat);
 
-    void (*set_tsc_offset)(struct vcpu *v, u64 offset, u64 at_tsc);
+    void (*set_tsc_offset)(struct vcpu *v, uint64_t offset);
 
     void (*inject_event)(const struct x86_event *event);
 
@@ -482,10 +482,9 @@ static inline void hvm_cpuid_policy_changed(struct vcpu *v)
     alternative_vcall(hvm_funcs.cpuid_policy_changed, v);
 }
 
-static inline void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset,
-                                      uint64_t at_tsc)
+static inline void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset)
 {
-    alternative_vcall(hvm_funcs.set_tsc_offset, v, offset, at_tsc);
+    alternative_vcall(hvm_funcs.set_tsc_offset, v, offset);
 }
 
 /*
@@ -847,7 +846,7 @@ static inline void hvm_sync_pir_to_irr(struct vcpu *v)
  */
 int hvm_guest_x86_mode(struct vcpu *v);
 void hvm_cpuid_policy_changed(struct vcpu *v);
-void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset, uint64_t at_tsc);
+void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset);
 
 /* End of prototype list */
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0664ffb806..0bfad0f634 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2982,8 +2982,7 @@ int tsc_set_info(struct domain *d,
              */
             d->arch.hvm.sync_tsc = rdtsc();
             hvm_set_tsc_offset(d->vcpu[0],
-                               d->vcpu[0]->arch.hvm.cache_tsc_offset,
-                               d->arch.hvm.sync_tsc);
+                               d->vcpu[0]->arch.hvm.cache_tsc_offset);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 16:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 16:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203448.1518648 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg3St-000892-Jk; Wed, 14 Jan 2026 16:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203448.1518648; Wed, 14 Jan 2026 16: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 1vg3St-00088s-Gp; Wed, 14 Jan 2026 16:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1203448;
 Wed, 14 Jan 2026 16: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 1vg3Ss-00088l-Ax
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 16: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 1vg3Ss-003Hhs-24
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg3Ss-003GOL-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16: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=eacUHLix7WcQLjx2h8JyXBHFsmzNn6mkAztCrKjz0PU=; b=A6nSKmRFh6GTjxi2xmiAci3S53
	uCtRhb8S+jwlNp79AaWVleg5uj8AanxXzmk1rSAqg0yKEloWjMQ6ImVFehgKxnu+PKYrWC1LJF/Jt
	Ke7IFjFd6RkS7TypW9QE+tGOgvUX8GLzz4abbnWI0rXMW98KPWK7qN0JrM11VvnSZBT4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: gtsc_to_gtime() is HVM-only
Message-Id: <E1vg3Ss-003GOL-0i@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 16:11:22 +0000

commit 91c5bbbb912931e0a1d694d358a86a85d653535b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:48:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:48:47 2026 +0100

    x86/time: gtsc_to_gtime() is HVM-only
    
    Omit the function when HVM=n. With that the !HVM logic can also go away;
    leave an assertion.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0bfad0f634..c5005a0360 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2837,14 +2837,13 @@ uint64_t gtime_to_gtsc(const struct domain *d, uint64_t time)
     return scale_delta(time, &d->arch.ns_to_vtsc);
 }
 
+#ifdef CONFIG_HVM
 uint64_t gtsc_to_gtime(const struct domain *d, uint64_t tsc)
 {
-    u64 time = scale_delta(tsc, &d->arch.vtsc_to_ns);
-
-    if ( !is_hvm_domain(d) )
-        time += d->arch.vtsc_offset;
-    return time;
+    ASSERT(is_hvm_domain(d));
+    return scale_delta(tsc, &d->arch.vtsc_to_ns);
 }
+#endif /* CONFIG_HVM */
 
 uint64_t pv_soft_rdtsc(const struct vcpu *v, const struct cpu_user_regs *regs)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 16:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 16:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203450.1518651 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg3T4-0008Ba-Ki; Wed, 14 Jan 2026 16:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203450.1518651; Wed, 14 Jan 2026 16: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 1vg3T4-0008BS-IA; Wed, 14 Jan 2026 16:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1203450;
 Wed, 14 Jan 2026 16: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 1vg3T2-0008B9-Ef
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 16: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 1vg3T2-003Hhx-2Q
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg3T2-003GOl-1B
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16: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=5sA/nYOSlK12GhtHMt0bq6aFVCrL07A/GClKy4ENNzI=; b=rA7gAqLevpndEDq6w7fgvsCZbc
	M1DIpKulk5wrCO1jwYdmEL2z6bVw0HxZDNAEAmxiHX6pFGpc7+jg7WaYdTcUCdIgMVaW3mB8mBsPR
	PU5gs2gzL3nYOs+zqqAL1GWLSsB00yaczInZlMhLIycRo+8dful5eJukwDJBJljJh8mA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: pv_soft_rdtsc() is PV-only
Message-Id: <E1vg3T2-003GOl-1B@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 16:11:32 +0000

commit a6ed4543222a309a4c3ecaced0e85d8e4502c93f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:49:16 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:49:16 2026 +0100

    x86/time: pv_soft_rdtsc() is PV-only
    
    Omit the function when PV=n, by moving it to the sole file using it, thus
    allowing it to become static as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/time.h |  2 --
 xen/arch/x86/pv/emul-priv-op.c  | 16 +++++++++++++++-
 xen/arch/x86/time.c             | 13 -------------
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index e45b9ebbfc..c5e826456d 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -37,8 +37,6 @@ uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
 uint64_t tsc_ticks2ns(uint64_t ticks);
 
-struct cpu_user_regs;
-uint64_t pv_soft_rdtsc(const struct vcpu *v, const struct cpu_user_regs *regs);
 uint64_t gtime_to_gtsc(const struct domain *d, uint64_t time);
 uint64_t gtsc_to_gtime(const struct domain *d, uint64_t tsc);
 
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index e6d370cd81..c970e16152 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -874,6 +874,20 @@ static uint64_t guest_efer(const struct domain *d)
     return val;
 }
 
+static uint64_t soft_rdtsc(
+    const struct vcpu *v, const struct cpu_user_regs *regs)
+{
+    s_time_t old, new, now = get_s_time();
+    struct domain *d = v->domain;
+
+    do {
+        old = d->arch.vtsc_last;
+        new = now > d->arch.vtsc_last ? now : old + 1;
+    } while ( cmpxchg(&d->arch.vtsc_last, old, new) != old );
+
+    return gtime_to_gtsc(d, new);
+}
+
 static int cf_check read_msr(
     unsigned int reg, uint64_t *val, struct x86_emulate_ctxt *ctxt)
 {
@@ -920,7 +934,7 @@ static int cf_check read_msr(
         return X86EMUL_OKAY;
 
     case MSR_IA32_TSC:
-        *val = currd->arch.vtsc ? pv_soft_rdtsc(curr, ctxt->regs) : rdtsc();
+        *val = currd->arch.vtsc ? soft_rdtsc(curr, ctxt->regs) : rdtsc();
         return X86EMUL_OKAY;
 
     case MSR_EFER:
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index c5005a0360..03a383a9a5 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2845,19 +2845,6 @@ uint64_t gtsc_to_gtime(const struct domain *d, uint64_t tsc)
 }
 #endif /* CONFIG_HVM */
 
-uint64_t pv_soft_rdtsc(const struct vcpu *v, const struct cpu_user_regs *regs)
-{
-    s_time_t old, new, now = get_s_time();
-    struct domain *d = v->domain;
-
-    do {
-        old = d->arch.vtsc_last;
-        new = now > d->arch.vtsc_last ? now : old + 1;
-    } while ( cmpxchg(&d->arch.vtsc_last, old, new) != old );
-
-    return gtime_to_gtsc(d, new);
-}
-
 bool clocksource_is_tsc(void)
 {
     return plt_src.read_counter == READ_TSC_POISON;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 14 16:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Jan 2026 16:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1203451.1518657 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vg3TD-0008Di-MQ; Wed, 14 Jan 2026 16:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1203451.1518657; Wed, 14 Jan 2026 16: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 1vg3TD-0008DZ-JR; Wed, 14 Jan 2026 16:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1203451;
 Wed, 14 Jan 2026 16: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 1vg3TC-0008DR-He
 for xen-changelog@lists.xenproject.org; Wed, 14 Jan 2026 16: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 1vg3TC-003Hi4-2f
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vg3TC-003GP7-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 14 Jan 2026 16: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=eq/lRvjTScV9vtzjRrh9YfV1aRlLMb/XkSY0pofYIZk=; b=dNgtFp+DBhUyVJC1mrjlH2stP/
	2UJ7fSQc+21KkeA6acIzbt0AX9LhjzFSbbBuZ9ivg9UNksr0swTg0JkcGF0G3hrUQU/2z3ee9usIu
	gi6OfCjFZ/Ez8jxapCg3gGj9e6al52AKjiSeiZ86aReUIF+BftADV592PyFa1x7QlbGU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/platform: adjust CONFIG_VIDEO usage
Message-Id: <E1vg3TC-003GP7-1V@xenbits.xenproject.org>
Date: Wed, 14 Jan 2026 16:11:42 +0000

commit 322c4e8fa27edca0d0e7131a1c0620259346e116
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 14 14:49:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 14 14:49:39 2026 +0100

    x86/platform: adjust CONFIG_VIDEO usage
    
    Switch to using IS_ENABLED() in both places, thus in particular making
    sure XENPF_get_dom0_console handling doesn't take the "default" path: The
    behavior better wouldn't differ between VIDEO=y and there not being VGA vs
    VIDEO=n. For this to work, fill_console_start_info() needs to be
    unconditionally declared; extend that to vga_console_info as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/platform_hypercall.c | 21 +++++++++------------
 xen/include/xen/vga.h             |  3 ++-
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 79bb99e0b6..214b130ea8 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -415,10 +415,9 @@ ret_t do_platform_op(
         }
         case XEN_FW_VBEDDC_INFO:
             ret = -ESRCH;
-#ifdef CONFIG_VIDEO
-            if ( op->u.firmware_info.index != 0 )
-                break;
-            if ( *(u32 *)bootsym(boot_edid_info) == 0x13131313 )
+            if ( !IS_ENABLED(CONFIG_VIDEO) ||
+                 op->u.firmware_info.index != 0 ||
+                 *(uint32_t *)bootsym(boot_edid_info) == 0x13131313 )
                 break;
 
             op->u.firmware_info.u.vbeddc_info.capabilities =
@@ -434,7 +433,6 @@ ret_t do_platform_op(
                  copy_to_compat(op->u.firmware_info.u.vbeddc_info.edid,
                                 bootsym(boot_edid_info), 128) )
                 ret = -EFAULT;
-#endif
             break;
         case XEN_FW_EFI_INFO:
             ret = efi_get_info(op->u.firmware_info.index,
@@ -905,20 +903,19 @@ ret_t do_platform_op(
         break;
     }
 
-#ifdef CONFIG_VIDEO
     case XENPF_get_dom0_console:
         BUILD_BUG_ON(sizeof(op->u.dom0_console) > sizeof(op->u.pad));
-        ret = sizeof(op->u.dom0_console);
-        if ( !fill_console_start_info(&op->u.dom0_console) )
-        {
-            ret = -ENODEV;
+
+        ret = -ENODEV;
+        if ( !IS_ENABLED(CONFIG_VIDEO) ||
+             !fill_console_start_info(&op->u.dom0_console) )
             break;
-        }
+
+        ret = sizeof(op->u.dom0_console);
 
         if ( copy_field_to_guest(u_xenpf_op, op, u.dom0_console) )
             ret = -EFAULT;
         break;
-#endif
 
     default:
         ret = -ENOSYS;
diff --git a/xen/include/xen/vga.h b/xen/include/xen/vga.h
index ceb8a527ed..43e6961b81 100644
--- a/xen/include/xen/vga.h
+++ b/xen/include/xen/vga.h
@@ -11,9 +11,10 @@
 
 #include <xen/video.h>
 
-#ifdef CONFIG_VGA
 extern struct xen_vga_console_info vga_console_info;
 int fill_console_start_info(struct dom0_vga_console_info *ci);
+
+#ifdef CONFIG_VGA
 void vesa_init(void);
 void vesa_early_init(void);
 void vesa_endboot(bool keep);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 12:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 12:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1204986.1519479 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMBs-0007IB-3e; Thu, 15 Jan 2026 12:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1204986.1519479; Thu, 15 Jan 2026 12:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMBs-0007I3-0a; Thu, 15 Jan 2026 12:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1204986;
 Thu, 15 Jan 2026 12:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vgMBq-0007Hv-Ij
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 12:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMBq-004mrx-2l
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMBq-004V2h-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UjpO7BuT9l4Nc9hFcdE53gnKEiG2EraePFiv8uf53O8=; b=6iXttDZmjwsLXp0gWy2TAUBqyV
	xogcdTtPJJiErOepPizxTqkKo2qyYrMAn/zbcIoVVpkxrcDqtz9pTfpio7CaXyRSEAT85hhJABxcL
	mCeqGTQRKuSZJu3qMgZBjCTjgPDiZO3EJLt9Kdod/1Etr5TfEPc4FJiv9jjH5kwCIBSI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: move OOS functions to their own file
Message-Id: <E1vgMBq-004V2h-1V@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 12:11:02 +0000

commit adcac96dff99cf92a34e0409ad80a1b8c44e816f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 15 11:45:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:48:00 2026 +0100

    x86/shadow: move OOS functions to their own file
    
    The code has been identified as HVM-only, and its main functions are
    pretty well isolated. Move them to their own file. While moving, besides
    making two functions non-static, do a few style adjustments, mainly
    comment formatting, but leave the code otherwise untouched.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/Makefile  |   2 +-
 xen/arch/x86/mm/shadow/common.c  | 570 ------------------------------------
 xen/arch/x86/mm/shadow/oos.c     | 606 +++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/shadow/private.h |   2 +
 4 files changed, 609 insertions(+), 571 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/Makefile b/xen/arch/x86/mm/shadow/Makefile
index b4a1620b69..3012fa127d 100644
--- a/xen/arch/x86/mm/shadow/Makefile
+++ b/xen/arch/x86/mm/shadow/Makefile
@@ -1,6 +1,6 @@
 ifeq ($(CONFIG_SHADOW_PAGING),y)
 obj-y += common.o set.o
-obj-$(CONFIG_HVM) += hvm.o guest_2.o guest_3.o guest_4.o
+obj-$(CONFIG_HVM) += hvm.o guest_2.o guest_3.o guest_4.o oos.o
 obj-$(CONFIG_PV) += pv.o guest_4.o
 else
 obj-y += none.o
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index f9310d008d..d92ca84362 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -143,576 +143,6 @@ static int __init cf_check shadow_audit_key_init(void)
 __initcall(shadow_audit_key_init);
 #endif /* SHADOW_AUDIT */
 
-#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
-/**************************************************************************/
-/* Out-of-sync shadows. */
-
-/* From time to time, we let a shadowed pagetable page go out of sync
- * with its shadow: the guest is allowed to write directly to the page,
- * and those writes are not synchronously reflected in the shadow.
- * This lets us avoid many emulations if the guest is writing a lot to a
- * pagetable, but it relaxes a pretty important invariant in the shadow
- * pagetable design.  Therefore, some rules:
- *
- * 1. Only L1 pagetables may go out of sync: any page that is shadowed
- *    at at higher level must be synchronously updated.  This makes
- *    using linear shadow pagetables much less dangerous.
- *    That means that: (a) unsyncing code needs to check for higher-level
- *    shadows, and (b) promotion code needs to resync.
- *
- * 2. All shadow operations on a guest page require the page to be brought
- *    back into sync before proceeding.  This must be done under the
- *    paging lock so that the page is guaranteed to remain synced until
- *    the operation completes.
- *
- *    Exceptions to this rule: the pagefault and invlpg handlers may
- *    update only one entry on an out-of-sync page without resyncing it.
- *
- * 3. Operations on shadows that do not start from a guest page need to
- *    be aware that they may be handling an out-of-sync shadow.
- *
- * 4. Operations that do not normally take the paging lock (fast-path
- *    #PF handler, INVLPG) must fall back to a locking, syncing version
- *    if they see an out-of-sync table.
- *
- * 5. Operations corresponding to guest TLB flushes (MOV CR3, INVLPG)
- *    must explicitly resync all relevant pages or update their
- *    shadows.
- *
- * Currently out-of-sync pages are listed in a simple open-addressed
- * hash table with a second chance (must resist temptation to radically
- * over-engineer hash tables...)  The virtual address of the access
- * which caused us to unsync the page is also kept in the hash table, as
- * a hint for finding the writable mappings later.
- *
- * We keep a hash per vcpu, because we want as much as possible to do
- * the re-sync on the save vcpu we did the unsync on, so the VA hint
- * will be valid.
- */
-
-static void sh_oos_audit(struct domain *d)
-{
-    unsigned int idx, expected_idx, expected_idx_alt;
-    struct page_info *pg;
-    struct vcpu *v;
-
-    for_each_vcpu(d, v)
-    {
-        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
-        {
-            mfn_t *oos = v->arch.paging.shadow.oos;
-            if ( mfn_eq(oos[idx], INVALID_MFN) )
-                continue;
-
-            expected_idx = mfn_x(oos[idx]) % SHADOW_OOS_PAGES;
-            expected_idx_alt = ((expected_idx + 1) % SHADOW_OOS_PAGES);
-            if ( idx != expected_idx && idx != expected_idx_alt )
-            {
-                printk("%s: idx %x contains gmfn %lx, expected at %x or %x.\n",
-                       __func__, idx, mfn_x(oos[idx]),
-                       expected_idx, expected_idx_alt);
-                BUG();
-            }
-            pg = mfn_to_page(oos[idx]);
-            if ( !(pg->count_info & PGC_shadowed_pt) )
-            {
-                printk("%s: idx %x gmfn %lx not a pt (count %lx)\n",
-                       __func__, idx, mfn_x(oos[idx]), pg->count_info);
-                BUG();
-            }
-            if ( !(pg->shadow_flags & SHF_out_of_sync) )
-            {
-                printk("%s: idx %x gmfn %lx not marked oos (flags %x)\n",
-                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
-                BUG();
-            }
-            if ( (pg->shadow_flags & SHF_page_type_mask & ~SHF_L1_ANY) )
-            {
-                printk("%s: idx %x gmfn %lx shadowed as non-l1 (flags %x)\n",
-                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
-                BUG();
-            }
-        }
-    }
-}
-
-#if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES
-void oos_audit_hash_is_present(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    struct vcpu *v;
-    mfn_t *oos;
-
-    ASSERT(mfn_is_out_of_sync(gmfn));
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-
-        if ( mfn_eq(oos[idx], gmfn) )
-            return;
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" marked OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-#endif
-
-/* Update the shadow, but keep the page out of sync. */
-static inline void _sh_resync_l1(struct vcpu *v, mfn_t gmfn, mfn_t snpmfn)
-{
-    struct page_info *pg = mfn_to_page(gmfn);
-
-    ASSERT(mfn_valid(gmfn));
-    ASSERT(page_is_out_of_sync(pg));
-
-    /* Call out to the appropriate per-mode resyncing function */
-    if ( pg->shadow_flags & SHF_L1_32 )
-        SHADOW_INTERNAL_NAME(sh_resync_l1, 2)(v, gmfn, snpmfn);
-    else if ( pg->shadow_flags & SHF_L1_PAE )
-        SHADOW_INTERNAL_NAME(sh_resync_l1, 3)(v, gmfn, snpmfn);
-    else if ( pg->shadow_flags & SHF_L1_64 )
-        SHADOW_INTERNAL_NAME(sh_resync_l1, 4)(v, gmfn, snpmfn);
-}
-
-static int sh_remove_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
-                                            mfn_t smfn, unsigned long off)
-{
-    ASSERT(mfn_valid(smfn));
-    ASSERT(mfn_valid(gmfn));
-
-    switch ( mfn_to_page(smfn)->u.sh.type )
-    {
-    case SH_type_l1_32_shadow:
-    case SH_type_fl1_32_shadow:
-        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 2)
-            (d, gmfn, smfn, off);
-
-    case SH_type_l1_pae_shadow:
-    case SH_type_fl1_pae_shadow:
-        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 3)
-            (d, gmfn, smfn, off);
-
-    case SH_type_l1_64_shadow:
-    case SH_type_fl1_64_shadow:
-        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 4)
-            (d, gmfn, smfn, off);
-
-    default:
-        return 0;
-    }
-}
-
-/*
- * Fixup arrays: We limit the maximum number of writable mappings to
- * SHADOW_OOS_FIXUPS and store enough information to remove them
- * quickly on resync.
- */
-
-static inline int oos_fixup_flush_gmfn(struct vcpu *v, mfn_t gmfn,
-                                       struct oos_fixup *fixup)
-{
-    struct domain *d = v->domain;
-    int i;
-    for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
-    {
-        if ( !mfn_eq(fixup->smfn[i], INVALID_MFN) )
-        {
-            sh_remove_write_access_from_sl1p(d, gmfn,
-                                             fixup->smfn[i],
-                                             fixup->off[i]);
-            fixup->smfn[i] = INVALID_MFN;
-        }
-    }
-
-    /* Always flush the TLBs. See comment on oos_fixup_add(). */
-    return 1;
-}
-
-void oos_fixup_add(struct domain *d, mfn_t gmfn,
-                   mfn_t smfn,  unsigned long off)
-{
-    int idx, next;
-    mfn_t *oos;
-    struct oos_fixup *oos_fixup;
-    struct vcpu *v;
-
-    perfc_incr(shadow_oos_fixup_add);
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        oos_fixup = v->arch.paging.shadow.oos_fixup;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            int i;
-            for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
-            {
-                if ( mfn_eq(oos_fixup[idx].smfn[i], smfn)
-                     && (oos_fixup[idx].off[i] == off) )
-                    return;
-            }
-
-            next = oos_fixup[idx].next;
-
-            if ( !mfn_eq(oos_fixup[idx].smfn[next], INVALID_MFN) )
-            {
-                TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_EVICT);
-
-                /* Reuse this slot and remove current writable mapping. */
-                sh_remove_write_access_from_sl1p(d, gmfn,
-                                                 oos_fixup[idx].smfn[next],
-                                                 oos_fixup[idx].off[next]);
-                perfc_incr(shadow_oos_fixup_evict);
-                /* We should flush the TLBs now, because we removed a
-                   writable mapping, but since the shadow is already
-                   OOS we have no problem if another vcpu write to
-                   this page table. We just have to be very careful to
-                   *always* flush the tlbs on resync. */
-            }
-
-            oos_fixup[idx].smfn[next] = smfn;
-            oos_fixup[idx].off[next] = off;
-            oos_fixup[idx].next = (next + 1) % SHADOW_OOS_FIXUPS;
-
-            TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_ADD);
-            return;
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-static int oos_remove_write_access(struct vcpu *v, mfn_t gmfn,
-                                   struct oos_fixup *fixup)
-{
-    struct domain *d = v->domain;
-    int ftlb = 0;
-
-    ftlb |= oos_fixup_flush_gmfn(v, gmfn, fixup);
-
-    switch ( sh_remove_write_access(d, gmfn, 0, 0) )
-    {
-    default:
-    case 0:
-        break;
-
-    case 1:
-        ftlb |= 1;
-        break;
-
-    case -1:
-        /* An unfindable writeable typecount has appeared, probably via a
-         * grant table entry: can't shoot the mapping, so try to unshadow
-         * the page.  If that doesn't work either, the guest is granting
-         * his pagetables and must be killed after all.
-         * This will flush the tlb, so we can return with no worries. */
-        shadow_remove_all_shadows(d, gmfn);
-        return 1;
-    }
-
-    if ( ftlb )
-        guest_flush_tlb_mask(d, d->dirty_cpumask);
-
-    return 0;
-}
-
-
-static inline void trace_resync(int event, mfn_t gmfn)
-{
-    if ( tb_init_done )
-    {
-        /* Convert gmfn to gfn */
-        gfn_t gfn = mfn_to_gfn(current->domain, gmfn);
-
-        trace(event, sizeof(gfn), &gfn);
-    }
-}
-
-/* Pull all the entries on an out-of-sync page back into sync. */
-static void _sh_resync(struct vcpu *v, mfn_t gmfn,
-                       struct oos_fixup *fixup, mfn_t snp)
-{
-    struct page_info *pg = mfn_to_page(gmfn);
-
-    ASSERT(paging_locked_by_me(v->domain));
-    ASSERT(mfn_is_out_of_sync(gmfn));
-    /* Guest page must be shadowed *only* as L1 when out of sync. */
-    ASSERT(!(mfn_to_page(gmfn)->shadow_flags & SHF_page_type_mask
-             & ~SHF_L1_ANY));
-    ASSERT(!sh_page_has_multiple_shadows(mfn_to_page(gmfn)));
-
-    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
-
-    /* Need to pull write access so the page *stays* in sync. */
-    if ( oos_remove_write_access(v, gmfn, fixup) )
-    {
-        /* Page has been unshadowed. */
-        return;
-    }
-
-    /* No more writable mappings of this page, please */
-    pg->shadow_flags &= ~SHF_oos_may_write;
-
-    /* Update the shadows with current guest entries. */
-    _sh_resync_l1(v, gmfn, snp);
-
-    /* Now we know all the entries are synced, and will stay that way */
-    pg->shadow_flags &= ~SHF_out_of_sync;
-    perfc_incr(shadow_resync);
-    trace_resync(TRC_SHADOW_RESYNC_FULL, gmfn);
-}
-
-
-/* Add an MFN to the list of out-of-sync guest pagetables */
-static void oos_hash_add(struct vcpu *v, mfn_t gmfn)
-{
-    int i, idx, oidx, swap = 0;
-    mfn_t *oos = v->arch.paging.shadow.oos;
-    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
-    struct oos_fixup fixup = { .next = 0 };
-
-    for (i = 0; i < SHADOW_OOS_FIXUPS; i++ )
-        fixup.smfn[i] = INVALID_MFN;
-
-    idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-    oidx = idx;
-
-    if ( !mfn_eq(oos[idx], INVALID_MFN)
-         && (mfn_x(oos[idx]) % SHADOW_OOS_PAGES) == idx )
-    {
-        /* Punt the current occupant into the next slot */
-        SWAP(oos[idx], gmfn);
-        SWAP(oos_fixup[idx], fixup);
-        swap = 1;
-        idx = (idx + 1) % SHADOW_OOS_PAGES;
-    }
-    if ( !mfn_eq(oos[idx], INVALID_MFN) )
-    {
-        /* Crush the current occupant. */
-        _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
-        perfc_incr(shadow_unsync_evict);
-    }
-    oos[idx] = gmfn;
-    oos_fixup[idx] = fixup;
-
-    if ( swap )
-        SWAP(oos_snapshot[idx], oos_snapshot[oidx]);
-
-    copy_domain_page(oos_snapshot[oidx], oos[oidx]);
-}
-
-/* Remove an MFN from the list of out-of-sync guest pagetables */
-static void oos_hash_remove(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    mfn_t *oos;
-    struct vcpu *v;
-
-    SHADOW_PRINTK("d%d gmfn %lx\n", d->domain_id, mfn_x(gmfn));
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            oos[idx] = INVALID_MFN;
-            return;
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    mfn_t *oos;
-    mfn_t *oos_snapshot;
-    struct vcpu *v;
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            return oos_snapshot[idx];
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-/* Pull a single guest page back into sync */
-void sh_resync(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    mfn_t *oos;
-    mfn_t *oos_snapshot;
-    struct oos_fixup *oos_fixup;
-    struct vcpu *v;
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        oos_fixup = v->arch.paging.shadow.oos_fixup;
-        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            _sh_resync(v, gmfn, &oos_fixup[idx], oos_snapshot[idx]);
-            oos[idx] = INVALID_MFN;
-            return;
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-/* Figure out whether it's definitely safe not to sync this l1 table,
- * by making a call out to the mode in which that shadow was made. */
-static int sh_skip_sync(struct vcpu *v, mfn_t gl1mfn)
-{
-    struct page_info *pg = mfn_to_page(gl1mfn);
-    if ( pg->shadow_flags & SHF_L1_32 )
-        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 2)(v, gl1mfn);
-    else if ( pg->shadow_flags & SHF_L1_PAE )
-        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
-    else if ( pg->shadow_flags & SHF_L1_64 )
-        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not shadowed as an l1\n",
-           mfn_x(gl1mfn));
-    BUG();
-}
-
-
-/* Pull all out-of-sync pages back into sync.  Pages brought out of sync
- * on other vcpus are allowed to remain out of sync, but their contents
- * will be made safe (TLB flush semantics); pages unsynced by this vcpu
- * are brought back into sync and write-protected.  If skip != 0, we try
- * to avoid resyncing at all if we think we can get away with it. */
-void sh_resync_all(struct vcpu *v, int skip, int this, int others)
-{
-    int idx;
-    struct vcpu *other;
-    mfn_t *oos = v->arch.paging.shadow.oos;
-    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
-
-    SHADOW_PRINTK("%pv\n", v);
-
-    ASSERT(paging_locked_by_me(v->domain));
-
-    if ( !this )
-        goto resync_others;
-
-    /* First: resync all of this vcpu's oos pages */
-    for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
-        if ( !mfn_eq(oos[idx], INVALID_MFN) )
-        {
-            /* Write-protect and sync contents */
-            _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
-            oos[idx] = INVALID_MFN;
-        }
-
- resync_others:
-    if ( !others )
-        return;
-
-    /* Second: make all *other* vcpus' oos pages safe. */
-    for_each_vcpu(v->domain, other)
-    {
-        if ( v == other )
-            continue;
-
-        oos = other->arch.paging.shadow.oos;
-        oos_fixup = other->arch.paging.shadow.oos_fixup;
-        oos_snapshot = other->arch.paging.shadow.oos_snapshot;
-
-        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
-        {
-            if ( mfn_eq(oos[idx], INVALID_MFN) )
-                continue;
-
-            if ( skip )
-            {
-                /* Update the shadows and leave the page OOS. */
-                if ( sh_skip_sync(v, oos[idx]) )
-                    continue;
-                trace_resync(TRC_SHADOW_RESYNC_ONLY, oos[idx]);
-                _sh_resync_l1(other, oos[idx], oos_snapshot[idx]);
-            }
-            else
-            {
-                /* Write-protect and sync contents */
-                _sh_resync(other, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
-                oos[idx] = INVALID_MFN;
-            }
-        }
-    }
-}
-
-/* Allow a shadowed page to go out of sync. Unsyncs are traced in
- * multi.c:sh_page_fault() */
-int sh_unsync(struct vcpu *v, mfn_t gmfn)
-{
-    struct page_info *pg;
-
-    ASSERT(paging_locked_by_me(v->domain));
-
-    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
-
-    pg = mfn_to_page(gmfn);
-
-    /* Guest page must be shadowed *only* as L1 and *only* once when out
-     * of sync.  Also, get out now if it's already out of sync.
-     * Also, can't safely unsync if some vcpus have paging disabled.*/
-    if ( pg->shadow_flags &
-         ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)
-         || sh_page_has_multiple_shadows(pg)
-         || !is_hvm_vcpu(v)
-         || !v->domain->arch.paging.shadow.oos_active )
-        return 0;
-
-    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_out_of_sync);
-    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_oos_may_write);
-
-    pg->shadow_flags |= SHF_out_of_sync|SHF_oos_may_write;
-    oos_hash_add(v, gmfn);
-    perfc_incr(shadow_unsync);
-    TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_UNSYNC);
-    return 1;
-}
-
-#endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */
-
-
 /**************************************************************************/
 /* Code for "promoting" a guest page to the point where the shadow code is
  * willing to let it be treated as a guest page table.  This generally
diff --git a/xen/arch/x86/mm/shadow/oos.c b/xen/arch/x86/mm/shadow/oos.c
new file mode 100644
index 0000000000..d4f167f73f
--- /dev/null
+++ b/xen/arch/x86/mm/shadow/oos.c
@@ -0,0 +1,606 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/******************************************************************************
+ * arch/x86/mm/shadow/oos.c
+ *
+ * Shadow code dealing with out-of-sync shadows.
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ */
+
+#include <asm/shadow.h>
+
+#include "private.h"
+
+#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
+
+#include <xen/trace.h>
+
+/*
+ * From time to time, we let a shadowed pagetable page go out of sync
+ * with its shadow: the guest is allowed to write directly to the page,
+ * and those writes are not synchronously reflected in the shadow.
+ * This lets us avoid many emulations if the guest is writing a lot to a
+ * pagetable, but it relaxes a pretty important invariant in the shadow
+ * pagetable design.  Therefore, some rules:
+ *
+ * 1. Only L1 pagetables may go out of sync: any page that is shadowed
+ *    at at higher level must be synchronously updated.  This makes
+ *    using linear shadow pagetables much less dangerous.
+ *    That means that: (a) unsyncing code needs to check for higher-level
+ *    shadows, and (b) promotion code needs to resync.
+ *
+ * 2. All shadow operations on a guest page require the page to be brought
+ *    back into sync before proceeding.  This must be done under the
+ *    paging lock so that the page is guaranteed to remain synced until
+ *    the operation completes.
+ *
+ *    Exceptions to this rule: the pagefault and invlpg handlers may
+ *    update only one entry on an out-of-sync page without resyncing it.
+ *
+ * 3. Operations on shadows that do not start from a guest page need to
+ *    be aware that they may be handling an out-of-sync shadow.
+ *
+ * 4. Operations that do not normally take the paging lock (fast-path
+ *    #PF handler, INVLPG) must fall back to a locking, syncing version
+ *    if they see an out-of-sync table.
+ *
+ * 5. Operations corresponding to guest TLB flushes (MOV CR3, INVLPG)
+ *    must explicitly resync all relevant pages or update their
+ *    shadows.
+ *
+ * Currently out-of-sync pages are listed in a simple open-addressed
+ * hash table with a second chance (must resist temptation to radically
+ * over-engineer hash tables...)  The virtual address of the access
+ * which caused us to unsync the page is also kept in the hash table, as
+ * a hint for finding the writable mappings later.
+ *
+ * We keep a hash per vcpu, because we want as much as possible to do
+ * the re-sync on the save vcpu we did the unsync on, so the VA hint
+ * will be valid.
+ */
+
+#if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL
+void sh_oos_audit(struct domain *d)
+{
+    unsigned int idx, expected_idx, expected_idx_alt;
+    struct page_info *pg;
+    struct vcpu *v;
+
+    for_each_vcpu(d, v)
+    {
+        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
+        {
+            mfn_t *oos = v->arch.paging.shadow.oos;
+
+            if ( mfn_eq(oos[idx], INVALID_MFN) )
+                continue;
+
+            expected_idx = mfn_x(oos[idx]) % SHADOW_OOS_PAGES;
+            expected_idx_alt = ((expected_idx + 1) % SHADOW_OOS_PAGES);
+            if ( idx != expected_idx && idx != expected_idx_alt )
+            {
+                printk("%s: idx %x contains gmfn %lx, expected at %x or %x.\n",
+                       __func__, idx, mfn_x(oos[idx]),
+                       expected_idx, expected_idx_alt);
+                BUG();
+            }
+            pg = mfn_to_page(oos[idx]);
+            if ( !(pg->count_info & PGC_shadowed_pt) )
+            {
+                printk("%s: idx %x gmfn %lx not a pt (count %lx)\n",
+                       __func__, idx, mfn_x(oos[idx]), pg->count_info);
+                BUG();
+            }
+            if ( !(pg->shadow_flags & SHF_out_of_sync) )
+            {
+                printk("%s: idx %x gmfn %lx not marked oos (flags %x)\n",
+                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
+                BUG();
+            }
+            if ( (pg->shadow_flags & SHF_page_type_mask & ~SHF_L1_ANY) )
+            {
+                printk("%s: idx %x gmfn %lx shadowed as non-l1 (flags %x)\n",
+                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
+                BUG();
+            }
+        }
+    }
+}
+#endif
+
+#if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES
+void oos_audit_hash_is_present(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    struct vcpu *v;
+    mfn_t *oos;
+
+    ASSERT(mfn_is_out_of_sync(gmfn));
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+
+        if ( mfn_eq(oos[idx], gmfn) )
+            return;
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" marked OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+#endif
+
+/* Update the shadow, but keep the page out of sync. */
+static inline void _sh_resync_l1(struct vcpu *v, mfn_t gmfn, mfn_t snpmfn)
+{
+    struct page_info *pg = mfn_to_page(gmfn);
+
+    ASSERT(mfn_valid(gmfn));
+    ASSERT(page_is_out_of_sync(pg));
+
+    /* Call out to the appropriate per-mode resyncing function */
+    if ( pg->shadow_flags & SHF_L1_32 )
+        SHADOW_INTERNAL_NAME(sh_resync_l1, 2)(v, gmfn, snpmfn);
+    else if ( pg->shadow_flags & SHF_L1_PAE )
+        SHADOW_INTERNAL_NAME(sh_resync_l1, 3)(v, gmfn, snpmfn);
+    else if ( pg->shadow_flags & SHF_L1_64 )
+        SHADOW_INTERNAL_NAME(sh_resync_l1, 4)(v, gmfn, snpmfn);
+}
+
+static int sh_remove_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
+                                            mfn_t smfn, unsigned long off)
+{
+    ASSERT(mfn_valid(smfn));
+    ASSERT(mfn_valid(gmfn));
+
+    switch ( mfn_to_page(smfn)->u.sh.type )
+    {
+    case SH_type_l1_32_shadow:
+    case SH_type_fl1_32_shadow:
+        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 2)
+            (d, gmfn, smfn, off);
+
+    case SH_type_l1_pae_shadow:
+    case SH_type_fl1_pae_shadow:
+        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 3)
+            (d, gmfn, smfn, off);
+
+    case SH_type_l1_64_shadow:
+    case SH_type_fl1_64_shadow:
+        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 4)
+            (d, gmfn, smfn, off);
+
+    default:
+        return 0;
+    }
+}
+
+/*
+ * Fixup arrays: We limit the maximum number of writable mappings to
+ * SHADOW_OOS_FIXUPS and store enough information to remove them
+ * quickly on resync.
+ */
+
+static inline int oos_fixup_flush_gmfn(struct vcpu *v, mfn_t gmfn,
+                                       struct oos_fixup *fixup)
+{
+    struct domain *d = v->domain;
+    int i;
+    for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
+    {
+        if ( !mfn_eq(fixup->smfn[i], INVALID_MFN) )
+        {
+            sh_remove_write_access_from_sl1p(d, gmfn,
+                                             fixup->smfn[i],
+                                             fixup->off[i]);
+            fixup->smfn[i] = INVALID_MFN;
+        }
+    }
+
+    /* Always flush the TLBs. See comment on oos_fixup_add(). */
+    return 1;
+}
+
+void oos_fixup_add(struct domain *d, mfn_t gmfn,
+                   mfn_t smfn,  unsigned long off)
+{
+    int idx, next;
+    mfn_t *oos;
+    struct oos_fixup *oos_fixup;
+    struct vcpu *v;
+
+    perfc_incr(shadow_oos_fixup_add);
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        oos_fixup = v->arch.paging.shadow.oos_fixup;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            int i;
+            for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
+            {
+                if ( mfn_eq(oos_fixup[idx].smfn[i], smfn) &&
+                     (oos_fixup[idx].off[i] == off) )
+                    return;
+            }
+
+            next = oos_fixup[idx].next;
+
+            if ( !mfn_eq(oos_fixup[idx].smfn[next], INVALID_MFN) )
+            {
+                TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_EVICT);
+
+                /* Reuse this slot and remove current writable mapping. */
+                sh_remove_write_access_from_sl1p(d, gmfn,
+                                                 oos_fixup[idx].smfn[next],
+                                                 oos_fixup[idx].off[next]);
+                perfc_incr(shadow_oos_fixup_evict);
+                /*
+                 * We should flush the TLBs now, because we removed a
+                 * writable mapping, but since the shadow is already
+                 * OOS we have no problem if another vcpu write to
+                 * this page table. We just have to be very careful to
+                 * *always* flush the tlbs on resync.
+                 */
+            }
+
+            oos_fixup[idx].smfn[next] = smfn;
+            oos_fixup[idx].off[next] = off;
+            oos_fixup[idx].next = (next + 1) % SHADOW_OOS_FIXUPS;
+
+            TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_ADD);
+            return;
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+static int oos_remove_write_access(struct vcpu *v, mfn_t gmfn,
+                                   struct oos_fixup *fixup)
+{
+    struct domain *d = v->domain;
+    int ftlb = 0;
+
+    ftlb |= oos_fixup_flush_gmfn(v, gmfn, fixup);
+
+    switch ( sh_remove_write_access(d, gmfn, 0, 0) )
+    {
+    default:
+    case 0:
+        break;
+
+    case 1:
+        ftlb |= 1;
+        break;
+
+    case -1:
+        /*
+         * An unfindable writeable typecount has appeared, probably via a
+         * grant table entry: can't shoot the mapping, so try to unshadow
+         * the page.  If that doesn't work either, the guest is granting
+         * his pagetables and must be killed after all.
+         * This will flush the tlb, so we can return with no worries.
+         */
+        shadow_remove_all_shadows(d, gmfn);
+        return 1;
+    }
+
+    if ( ftlb )
+        guest_flush_tlb_mask(d, d->dirty_cpumask);
+
+    return 0;
+}
+
+static inline void trace_resync(int event, mfn_t gmfn)
+{
+    if ( tb_init_done )
+    {
+        /* Convert gmfn to gfn */
+        gfn_t gfn = mfn_to_gfn(current->domain, gmfn);
+
+        trace(event, sizeof(gfn), &gfn);
+    }
+}
+
+/* Pull all the entries on an out-of-sync page back into sync. */
+static void _sh_resync(struct vcpu *v, mfn_t gmfn,
+                       struct oos_fixup *fixup, mfn_t snp)
+{
+    struct page_info *pg = mfn_to_page(gmfn);
+
+    ASSERT(paging_locked_by_me(v->domain));
+    ASSERT(mfn_is_out_of_sync(gmfn));
+    /* Guest page must be shadowed *only* as L1 when out of sync. */
+    ASSERT(!(mfn_to_page(gmfn)->shadow_flags & SHF_page_type_mask
+             & ~SHF_L1_ANY));
+    ASSERT(!sh_page_has_multiple_shadows(mfn_to_page(gmfn)));
+
+    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
+
+    /* Need to pull write access so the page *stays* in sync. */
+    if ( oos_remove_write_access(v, gmfn, fixup) )
+    {
+        /* Page has been unshadowed. */
+        return;
+    }
+
+    /* No more writable mappings of this page, please */
+    pg->shadow_flags &= ~SHF_oos_may_write;
+
+    /* Update the shadows with current guest entries. */
+    _sh_resync_l1(v, gmfn, snp);
+
+    /* Now we know all the entries are synced, and will stay that way */
+    pg->shadow_flags &= ~SHF_out_of_sync;
+    perfc_incr(shadow_resync);
+    trace_resync(TRC_SHADOW_RESYNC_FULL, gmfn);
+}
+
+/* Add an MFN to the list of out-of-sync guest pagetables */
+static void oos_hash_add(struct vcpu *v, mfn_t gmfn)
+{
+    int i, idx, oidx, swap = 0;
+    mfn_t *oos = v->arch.paging.shadow.oos;
+    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
+    struct oos_fixup fixup = { .next = 0 };
+
+    for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
+        fixup.smfn[i] = INVALID_MFN;
+
+    idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+    oidx = idx;
+
+    if ( !mfn_eq(oos[idx], INVALID_MFN) &&
+         (mfn_x(oos[idx]) % SHADOW_OOS_PAGES) == idx )
+    {
+        /* Punt the current occupant into the next slot */
+        SWAP(oos[idx], gmfn);
+        SWAP(oos_fixup[idx], fixup);
+        swap = 1;
+        idx = (idx + 1) % SHADOW_OOS_PAGES;
+    }
+    if ( !mfn_eq(oos[idx], INVALID_MFN) )
+    {
+        /* Crush the current occupant. */
+        _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
+        perfc_incr(shadow_unsync_evict);
+    }
+    oos[idx] = gmfn;
+    oos_fixup[idx] = fixup;
+
+    if ( swap )
+        SWAP(oos_snapshot[idx], oos_snapshot[oidx]);
+
+    copy_domain_page(oos_snapshot[oidx], oos[oidx]);
+}
+
+/* Remove an MFN from the list of out-of-sync guest pagetables */
+void oos_hash_remove(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    mfn_t *oos;
+    struct vcpu *v;
+
+    SHADOW_PRINTK("d%d gmfn %lx\n", d->domain_id, mfn_x(gmfn));
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            oos[idx] = INVALID_MFN;
+            return;
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    mfn_t *oos;
+    mfn_t *oos_snapshot;
+    struct vcpu *v;
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            return oos_snapshot[idx];
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+/* Pull a single guest page back into sync */
+void sh_resync(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    mfn_t *oos;
+    mfn_t *oos_snapshot;
+    struct oos_fixup *oos_fixup;
+    struct vcpu *v;
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        oos_fixup = v->arch.paging.shadow.oos_fixup;
+        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            _sh_resync(v, gmfn, &oos_fixup[idx], oos_snapshot[idx]);
+            oos[idx] = INVALID_MFN;
+            return;
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+/*
+ * Figure out whether it's definitely safe not to sync this l1 table,
+ * by making a call out to the mode in which that shadow was made.
+ */
+static int sh_skip_sync(struct vcpu *v, mfn_t gl1mfn)
+{
+    struct page_info *pg = mfn_to_page(gl1mfn);
+
+    if ( pg->shadow_flags & SHF_L1_32 )
+        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 2)(v, gl1mfn);
+    else if ( pg->shadow_flags & SHF_L1_PAE )
+        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
+    else if ( pg->shadow_flags & SHF_L1_64 )
+        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not shadowed as an l1\n",
+           mfn_x(gl1mfn));
+    BUG();
+}
+
+/*
+ * Pull all out-of-sync pages back into sync.  Pages brought out of sync
+ * on other vcpus are allowed to remain out of sync, but their contents
+ * will be made safe (TLB flush semantics); pages unsynced by this vcpu
+ * are brought back into sync and write-protected.  If skip != 0, we try
+ * to avoid resyncing at all if we think we can get away with it.
+ */
+void sh_resync_all(struct vcpu *v, int skip, int this, int others)
+{
+    int idx;
+    struct vcpu *other;
+    mfn_t *oos = v->arch.paging.shadow.oos;
+    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
+
+    SHADOW_PRINTK("%pv\n", v);
+
+    ASSERT(paging_locked_by_me(v->domain));
+
+    if ( !this )
+        goto resync_others;
+
+    /* First: resync all of this vcpu's oos pages */
+    for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
+        if ( !mfn_eq(oos[idx], INVALID_MFN) )
+        {
+            /* Write-protect and sync contents */
+            _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
+            oos[idx] = INVALID_MFN;
+        }
+
+ resync_others:
+    if ( !others )
+        return;
+
+    /* Second: make all *other* vcpus' oos pages safe. */
+    for_each_vcpu(v->domain, other)
+    {
+        if ( v == other )
+            continue;
+
+        oos = other->arch.paging.shadow.oos;
+        oos_fixup = other->arch.paging.shadow.oos_fixup;
+        oos_snapshot = other->arch.paging.shadow.oos_snapshot;
+
+        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
+        {
+            if ( mfn_eq(oos[idx], INVALID_MFN) )
+                continue;
+
+            if ( skip )
+            {
+                /* Update the shadows and leave the page OOS. */
+                if ( sh_skip_sync(v, oos[idx]) )
+                    continue;
+                trace_resync(TRC_SHADOW_RESYNC_ONLY, oos[idx]);
+                _sh_resync_l1(other, oos[idx], oos_snapshot[idx]);
+            }
+            else
+            {
+                /* Write-protect and sync contents */
+                _sh_resync(other, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
+                oos[idx] = INVALID_MFN;
+            }
+        }
+    }
+}
+
+/*
+ * Allow a shadowed page to go out of sync. Unsyncs are traced in
+ * multi.c:sh_page_fault()
+ */
+int sh_unsync(struct vcpu *v, mfn_t gmfn)
+{
+    struct page_info *pg;
+
+    ASSERT(paging_locked_by_me(v->domain));
+
+    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
+
+    pg = mfn_to_page(gmfn);
+
+    /*
+     * Guest page must be shadowed *only* as L1 and *only* once when out
+     * of sync.  Also, get out now if it's already out of sync.
+     * Also, can't safely unsync if some vcpus have paging disabled.
+     */
+    if ( (pg->shadow_flags &
+          ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)) ||
+         sh_page_has_multiple_shadows(pg) ||
+         !is_hvm_vcpu(v) ||
+         !v->domain->arch.paging.shadow.oos_active )
+        return 0;
+
+    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_out_of_sync);
+    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_oos_may_write);
+
+    pg->shadow_flags |= SHF_out_of_sync|SHF_oos_may_write;
+    oos_hash_add(v, gmfn);
+    perfc_incr(shadow_unsync);
+    TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_UNSYNC);
+    return 1;
+}
+
+#endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index e4eca60eb3..4e955ef35b 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -439,6 +439,7 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn);
 /* Pull an out-of-sync page back into sync. */
 void sh_resync(struct domain *d, mfn_t gmfn);
 
+void oos_hash_remove(struct domain *d, mfn_t gmfn);
 void oos_fixup_add(struct domain *d, mfn_t gmfn, mfn_t smfn, unsigned long off);
 
 /* Pull all out-of-sync shadows back into sync.  If skip != 0, we try
@@ -464,6 +465,7 @@ shadow_sync_other_vcpus(struct vcpu *v)
     sh_resync_all(v, 1 /* skip */, 0 /* this */, 1 /* others */);
 }
 
+void sh_oos_audit(struct domain *d);
 void oos_audit_hash_is_present(struct domain *d, mfn_t gmfn);
 mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 12:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1204987.1519483 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMC1-0007Kt-6b; Thu, 15 Jan 2026 12:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1204987.1519483; Thu, 15 Jan 2026 12:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMC1-0007Kl-41; Thu, 15 Jan 2026 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1204987;
 Thu, 15 Jan 2026 12:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vgMC0-0007Kc-LL
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 12:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMC0-004ms7-34
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMC0-004V3P-1q
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SQSmg2z9VW4i19e5ZgTARPdyOa5nq6U1UVJT+MpsnhI=; b=lmBBy9MHIxC2uGlTd6pycAH7p9
	kt3dpo/b2gwLmpC51+DuJXoso19MhU6E1KrKQMilA6MowALL2LUq6gUEKLS8I0dTOrCWI7YzahLzg
	44sq8XDagp+ZmyYFulkcM7MdT3aNpXVvxm6TlAkCoFoqLiAf0kk37cLCzzwlhR8nIFvQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: OOS doesn't track VAs anymore
Message-Id: <E1vgMC0-004V3P-1q@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 12:11:12 +0000

commit c5e70ef3094865bbfcb4699b4ac449bf73b75a53
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 15 11:48:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:48:28 2026 +0100

    x86/shadow: OOS doesn't track VAs anymore
    
    The tracking lasted only for about two weeks, but the related comment
    parts were never purged.
    
    Amends: 50b74f55e0c0 ("OOS cleanup: Fixup arrays instead of fixup tables")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/oos.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/oos.c b/xen/arch/x86/mm/shadow/oos.c
index d4f167f73f..89e8a3b722 100644
--- a/xen/arch/x86/mm/shadow/oos.c
+++ b/xen/arch/x86/mm/shadow/oos.c
@@ -51,13 +51,10 @@
  *
  * Currently out-of-sync pages are listed in a simple open-addressed
  * hash table with a second chance (must resist temptation to radically
- * over-engineer hash tables...)  The virtual address of the access
- * which caused us to unsync the page is also kept in the hash table, as
- * a hint for finding the writable mappings later.
+ * over-engineer hash tables...).
  *
  * We keep a hash per vcpu, because we want as much as possible to do
- * the re-sync on the save vcpu we did the unsync on, so the VA hint
- * will be valid.
+ * the re-sync on the same vcpu we did the unsync on.
  */
 
 #if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 12:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1204989.1519487 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMCB-0007NU-7y; Thu, 15 Jan 2026 12:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1204989.1519487; Thu, 15 Jan 2026 12:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMCB-0007NL-5K; Thu, 15 Jan 2026 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1204989;
 Thu, 15 Jan 2026 12:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vgMCA-0007NE-Nv
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 12:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMCB-004msU-0A
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMCA-004V4q-2C
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cUv5JFeE8jssosAVhasC8wVIz256j5buwPkcXoqMiL4=; b=dHCEp04HDFQM0LwX5rnnbFFw1s
	wvEu9dR3bMFbU5+rcdkACN76rcJ1HDj2hC9NxbTc/wGRRh9Jhm/DhehR6cefiBcnXItZWk63my6SW
	hMmT1ciuNKvSMVBEIgybX6kkcH1L+vvbfSQk0+SGHDdjD4RGutYxs8+giEEgRKdKm53g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: rename ARAT feature flag
Message-Id: <E1vgMCA-004V4q-2C@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 12:11:22 +0000

commit 4422643e3b6469ccf16a080a0f93b509945b0243
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 15 11:49:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:49:28 2026 +0100

    x86: rename ARAT feature flag
    
    Add a XEN infix, to properly distinguish it from the CPUID feature flag
    (leaf 6 EAX bit 2).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpu_idle.c           | 4 ++--
 xen/arch/x86/cpu/amd.c                 | 2 +-
 xen/arch/x86/cpu/hygon.c               | 2 +-
 xen/arch/x86/cpu/intel.c               | 2 +-
 xen/arch/x86/cpu/mwait-idle.c          | 4 ++--
 xen/arch/x86/include/asm/cpufeatures.h | 2 +-
 xen/arch/x86/time.c                    | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index d60a07bfd5..7a87625077 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -109,7 +109,7 @@ void (*__read_mostly lapic_timer_on)(void);
 
 bool lapic_timer_init(void)
 {
-    if ( boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( boot_cpu_has(X86_FEATURE_XEN_ARAT) )
     {
         lapic_timer_off = lapic_timer_nop;
         lapic_timer_on = lapic_timer_nop;
@@ -1463,7 +1463,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
         if ( !vendor_override )
         {
-            if ( !boot_cpu_has(X86_FEATURE_ARAT) )
+            if ( !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
                 hpet_broadcast_init();
 
             if ( !lapic_timer_init() )
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 928d6bd168..8c5bdf0bd5 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1239,7 +1239,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * running in deep C states.
 	 */
 	if ( opt_arat && c->x86 > 0x11 )
-		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	/*
 	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
diff --git a/xen/arch/x86/cpu/hygon.c b/xen/arch/x86/cpu/hygon.c
index cab915a2fc..b99d83ed4d 100644
--- a/xen/arch/x86/cpu/hygon.c
+++ b/xen/arch/x86/cpu/hygon.c
@@ -81,7 +81,7 @@ static void cf_check init_hygon(struct cpuinfo_x86 *c)
 
 	/* Hygon processors have APIC timer running in deep C states. */
 	if (opt_arat)
-		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	if (cpu_has(c, X86_FEATURE_EFRO)) {
 		rdmsrl(MSR_K8_HWCR, value);
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 863edac4cd..b76797cb9a 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -668,7 +668,7 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	if ( opt_arat &&
 	     ( c->cpuid_level >= 0x00000006 ) &&
 	     ( cpuid_eax(0x00000006) & (1u<<2) ) )
-		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	if ((opt_cpu_info && !(c->apicid & (c->x86_num_siblings - 1))) ||
 	    c == &boot_cpu_data )
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index f47fdfb569..5962ec1db9 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1633,7 +1633,7 @@ static int __init mwait_idle_probe(void)
 	icpu = id->driver_data;
 	cpuidle_state_table = icpu->state_table;
 
-	if (boot_cpu_has(X86_FEATURE_ARAT))
+	if (boot_cpu_has(X86_FEATURE_XEN_ARAT))
 		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
 
 	pr_debug(PREFIX "v" MWAIT_IDLE_VERSION " model %#x\n",
@@ -1792,7 +1792,7 @@ int __init mwait_idle_init(struct notifier_block *nfb)
 		return -ENODEV;
 
 	err = mwait_idle_probe();
-	if (!err && !boot_cpu_has(X86_FEATURE_ARAT)) {
+	if (!err && !boot_cpu_has(X86_FEATURE_XEN_ARAT)) {
 		hpet_broadcast_init();
 		if (xen_cpuidle < 0 && !hpet_broadcast_is_available())
 			err = -ENODEV;
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 65534863c7..bd53ba7976 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -13,7 +13,7 @@
 /* Synthetic features */
 XEN_CPUFEATURE(CONSTANT_TSC,      X86_SYNTH( 0)) /* TSC ticks at a constant rate */
 XEN_CPUFEATURE(NONSTOP_TSC,       X86_SYNTH( 1)) /* TSC does not stop in C states */
-XEN_CPUFEATURE(ARAT,              X86_SYNTH( 2)) /* Always running APIC timer */
+XEN_CPUFEATURE(XEN_ARAT,          X86_SYNTH( 2)) /* Xen may utilize always running APIC timer */
 XEN_CPUFEATURE(ARCH_PERFMON,      X86_SYNTH( 3)) /* Intel Architectural PerfMon */
 XEN_CPUFEATURE(TSC_RELIABLE,      X86_SYNTH( 4)) /* TSC is known to be reliable */
 XEN_CPUFEATURE(XTOPOLOGY,         X86_SYNTH( 5)) /* cpu topology enum extensions */
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 03a383a9a5..362c76df0b 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2644,7 +2644,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 12:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 12:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1204990.1519492 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMCL-0007Pj-9m; Thu, 15 Jan 2026 12:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1204990.1519492; Thu, 15 Jan 2026 12:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgMCL-0007Pb-6i; Thu, 15 Jan 2026 12:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1204990;
 Thu, 15 Jan 2026 12:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vgMCK-0007PV-Qj
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 12:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMCL-004msZ-0Q
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgMCK-004V5P-2T
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 12:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LUB0lhUQYzycW7wPoAwWckSyUK+Bri67pUtk34UyLvY=; b=cykvcTa+HcokwD2dfos8uo+1G3
	qpWgZhJBpKoN8KD3C+0yE4b36jwLYQREVDYlWrwduUC+HII37Qt70rF7JksF4Xd6s3YnUjghPKTox
	tOpFo1Wm2Vp3VHhE+E4/HzMdD1YrMwUWb+8pXcAi3f9sLoVaydK7hsZMh2PCK0JckObk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mce: use offsetof() to determine section offset
Message-Id: <E1vgMCK-004V5P-2T@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 12:11:32 +0000

commit f4df6d35112c009514db55c3e5e5725b4e7b730c
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Jan 15 11:49:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:49:55 2026 +0100

    x86/mce: use offsetof() to determine section offset
    
    There is no reason to use pointer difference.
    A violation of MISRA C Rule 18.2 ("Subtraction between pointers
    shall only be applied to pointers that address elements of the
    same array") is also resolved because the object to the subtraction
    is applied is not an array.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/mce-apei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce-apei.c b/xen/arch/x86/cpu/mcheck/mce-apei.c
index b895020882..0b1c9902c0 100644
--- a/xen/arch/x86/cpu/mcheck/mce-apei.c
+++ b/xen/arch/x86/cpu/mcheck/mce-apei.c
@@ -74,7 +74,7 @@ int apei_write_mce(struct mce *m)
 	rcd.hdr.record_id = cper_next_record_id();
 	rcd.hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR;
 
-	rcd.sec_hdr.section_offset = (void *)&rcd.mce - (void *)&rcd;
+	rcd.sec_hdr.section_offset = offsetof(struct cper_mce_record, mce);
 	rcd.sec_hdr.section_length = sizeof(rcd.mce);
 	rcd.sec_hdr.revision = CPER_SEC_REV;
 	/* fru_id and fru_text is invalid */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 13:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1205096.1519535 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN7w-0000Ua-7F; Thu, 15 Jan 2026 13:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1205096.1519535; Thu, 15 Jan 2026 13:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN7w-0000US-4E; Thu, 15 Jan 2026 13:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1205096;
 Thu, 15 Jan 2026 13:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vgN7u-0000UM-8L
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 13:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgN7u-004nw0-1e
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgN7u-004XzF-0R
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 13:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2nBv9oNFlHbjixvh+h1mnunWq7VgHL84QAfnli/0zbk=; b=vyJt05alrvdWG3pHyUDnvLZFE1
	0qaG1V+1ycgMjhllJh/oYPYiS3zPTrp/0SIlmVT1TZ0+kgMB/1mvJMP3vLTU6o1AEkfFd5uXXB+G1
	9LCh3cdb7IXz5uGWZpZWTNuLCJUA8rxyC9Zgj7cujZAyBJDp5uIzRpUxjsWl4VhNWyJg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: move OOS functions to their own file
Message-Id: <E1vgN7u-004XzF-0R@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 13:11:02 +0000

commit adcac96dff99cf92a34e0409ad80a1b8c44e816f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 15 11:45:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:48:00 2026 +0100

    x86/shadow: move OOS functions to their own file
    
    The code has been identified as HVM-only, and its main functions are
    pretty well isolated. Move them to their own file. While moving, besides
    making two functions non-static, do a few style adjustments, mainly
    comment formatting, but leave the code otherwise untouched.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/Makefile  |   2 +-
 xen/arch/x86/mm/shadow/common.c  | 570 ------------------------------------
 xen/arch/x86/mm/shadow/oos.c     | 606 +++++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/shadow/private.h |   2 +
 4 files changed, 609 insertions(+), 571 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/Makefile b/xen/arch/x86/mm/shadow/Makefile
index b4a1620b69..3012fa127d 100644
--- a/xen/arch/x86/mm/shadow/Makefile
+++ b/xen/arch/x86/mm/shadow/Makefile
@@ -1,6 +1,6 @@
 ifeq ($(CONFIG_SHADOW_PAGING),y)
 obj-y += common.o set.o
-obj-$(CONFIG_HVM) += hvm.o guest_2.o guest_3.o guest_4.o
+obj-$(CONFIG_HVM) += hvm.o guest_2.o guest_3.o guest_4.o oos.o
 obj-$(CONFIG_PV) += pv.o guest_4.o
 else
 obj-y += none.o
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index f9310d008d..d92ca84362 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -143,576 +143,6 @@ static int __init cf_check shadow_audit_key_init(void)
 __initcall(shadow_audit_key_init);
 #endif /* SHADOW_AUDIT */
 
-#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
-/**************************************************************************/
-/* Out-of-sync shadows. */
-
-/* From time to time, we let a shadowed pagetable page go out of sync
- * with its shadow: the guest is allowed to write directly to the page,
- * and those writes are not synchronously reflected in the shadow.
- * This lets us avoid many emulations if the guest is writing a lot to a
- * pagetable, but it relaxes a pretty important invariant in the shadow
- * pagetable design.  Therefore, some rules:
- *
- * 1. Only L1 pagetables may go out of sync: any page that is shadowed
- *    at at higher level must be synchronously updated.  This makes
- *    using linear shadow pagetables much less dangerous.
- *    That means that: (a) unsyncing code needs to check for higher-level
- *    shadows, and (b) promotion code needs to resync.
- *
- * 2. All shadow operations on a guest page require the page to be brought
- *    back into sync before proceeding.  This must be done under the
- *    paging lock so that the page is guaranteed to remain synced until
- *    the operation completes.
- *
- *    Exceptions to this rule: the pagefault and invlpg handlers may
- *    update only one entry on an out-of-sync page without resyncing it.
- *
- * 3. Operations on shadows that do not start from a guest page need to
- *    be aware that they may be handling an out-of-sync shadow.
- *
- * 4. Operations that do not normally take the paging lock (fast-path
- *    #PF handler, INVLPG) must fall back to a locking, syncing version
- *    if they see an out-of-sync table.
- *
- * 5. Operations corresponding to guest TLB flushes (MOV CR3, INVLPG)
- *    must explicitly resync all relevant pages or update their
- *    shadows.
- *
- * Currently out-of-sync pages are listed in a simple open-addressed
- * hash table with a second chance (must resist temptation to radically
- * over-engineer hash tables...)  The virtual address of the access
- * which caused us to unsync the page is also kept in the hash table, as
- * a hint for finding the writable mappings later.
- *
- * We keep a hash per vcpu, because we want as much as possible to do
- * the re-sync on the save vcpu we did the unsync on, so the VA hint
- * will be valid.
- */
-
-static void sh_oos_audit(struct domain *d)
-{
-    unsigned int idx, expected_idx, expected_idx_alt;
-    struct page_info *pg;
-    struct vcpu *v;
-
-    for_each_vcpu(d, v)
-    {
-        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
-        {
-            mfn_t *oos = v->arch.paging.shadow.oos;
-            if ( mfn_eq(oos[idx], INVALID_MFN) )
-                continue;
-
-            expected_idx = mfn_x(oos[idx]) % SHADOW_OOS_PAGES;
-            expected_idx_alt = ((expected_idx + 1) % SHADOW_OOS_PAGES);
-            if ( idx != expected_idx && idx != expected_idx_alt )
-            {
-                printk("%s: idx %x contains gmfn %lx, expected at %x or %x.\n",
-                       __func__, idx, mfn_x(oos[idx]),
-                       expected_idx, expected_idx_alt);
-                BUG();
-            }
-            pg = mfn_to_page(oos[idx]);
-            if ( !(pg->count_info & PGC_shadowed_pt) )
-            {
-                printk("%s: idx %x gmfn %lx not a pt (count %lx)\n",
-                       __func__, idx, mfn_x(oos[idx]), pg->count_info);
-                BUG();
-            }
-            if ( !(pg->shadow_flags & SHF_out_of_sync) )
-            {
-                printk("%s: idx %x gmfn %lx not marked oos (flags %x)\n",
-                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
-                BUG();
-            }
-            if ( (pg->shadow_flags & SHF_page_type_mask & ~SHF_L1_ANY) )
-            {
-                printk("%s: idx %x gmfn %lx shadowed as non-l1 (flags %x)\n",
-                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
-                BUG();
-            }
-        }
-    }
-}
-
-#if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES
-void oos_audit_hash_is_present(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    struct vcpu *v;
-    mfn_t *oos;
-
-    ASSERT(mfn_is_out_of_sync(gmfn));
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-
-        if ( mfn_eq(oos[idx], gmfn) )
-            return;
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" marked OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-#endif
-
-/* Update the shadow, but keep the page out of sync. */
-static inline void _sh_resync_l1(struct vcpu *v, mfn_t gmfn, mfn_t snpmfn)
-{
-    struct page_info *pg = mfn_to_page(gmfn);
-
-    ASSERT(mfn_valid(gmfn));
-    ASSERT(page_is_out_of_sync(pg));
-
-    /* Call out to the appropriate per-mode resyncing function */
-    if ( pg->shadow_flags & SHF_L1_32 )
-        SHADOW_INTERNAL_NAME(sh_resync_l1, 2)(v, gmfn, snpmfn);
-    else if ( pg->shadow_flags & SHF_L1_PAE )
-        SHADOW_INTERNAL_NAME(sh_resync_l1, 3)(v, gmfn, snpmfn);
-    else if ( pg->shadow_flags & SHF_L1_64 )
-        SHADOW_INTERNAL_NAME(sh_resync_l1, 4)(v, gmfn, snpmfn);
-}
-
-static int sh_remove_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
-                                            mfn_t smfn, unsigned long off)
-{
-    ASSERT(mfn_valid(smfn));
-    ASSERT(mfn_valid(gmfn));
-
-    switch ( mfn_to_page(smfn)->u.sh.type )
-    {
-    case SH_type_l1_32_shadow:
-    case SH_type_fl1_32_shadow:
-        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 2)
-            (d, gmfn, smfn, off);
-
-    case SH_type_l1_pae_shadow:
-    case SH_type_fl1_pae_shadow:
-        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 3)
-            (d, gmfn, smfn, off);
-
-    case SH_type_l1_64_shadow:
-    case SH_type_fl1_64_shadow:
-        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 4)
-            (d, gmfn, smfn, off);
-
-    default:
-        return 0;
-    }
-}
-
-/*
- * Fixup arrays: We limit the maximum number of writable mappings to
- * SHADOW_OOS_FIXUPS and store enough information to remove them
- * quickly on resync.
- */
-
-static inline int oos_fixup_flush_gmfn(struct vcpu *v, mfn_t gmfn,
-                                       struct oos_fixup *fixup)
-{
-    struct domain *d = v->domain;
-    int i;
-    for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
-    {
-        if ( !mfn_eq(fixup->smfn[i], INVALID_MFN) )
-        {
-            sh_remove_write_access_from_sl1p(d, gmfn,
-                                             fixup->smfn[i],
-                                             fixup->off[i]);
-            fixup->smfn[i] = INVALID_MFN;
-        }
-    }
-
-    /* Always flush the TLBs. See comment on oos_fixup_add(). */
-    return 1;
-}
-
-void oos_fixup_add(struct domain *d, mfn_t gmfn,
-                   mfn_t smfn,  unsigned long off)
-{
-    int idx, next;
-    mfn_t *oos;
-    struct oos_fixup *oos_fixup;
-    struct vcpu *v;
-
-    perfc_incr(shadow_oos_fixup_add);
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        oos_fixup = v->arch.paging.shadow.oos_fixup;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            int i;
-            for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
-            {
-                if ( mfn_eq(oos_fixup[idx].smfn[i], smfn)
-                     && (oos_fixup[idx].off[i] == off) )
-                    return;
-            }
-
-            next = oos_fixup[idx].next;
-
-            if ( !mfn_eq(oos_fixup[idx].smfn[next], INVALID_MFN) )
-            {
-                TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_EVICT);
-
-                /* Reuse this slot and remove current writable mapping. */
-                sh_remove_write_access_from_sl1p(d, gmfn,
-                                                 oos_fixup[idx].smfn[next],
-                                                 oos_fixup[idx].off[next]);
-                perfc_incr(shadow_oos_fixup_evict);
-                /* We should flush the TLBs now, because we removed a
-                   writable mapping, but since the shadow is already
-                   OOS we have no problem if another vcpu write to
-                   this page table. We just have to be very careful to
-                   *always* flush the tlbs on resync. */
-            }
-
-            oos_fixup[idx].smfn[next] = smfn;
-            oos_fixup[idx].off[next] = off;
-            oos_fixup[idx].next = (next + 1) % SHADOW_OOS_FIXUPS;
-
-            TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_ADD);
-            return;
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-static int oos_remove_write_access(struct vcpu *v, mfn_t gmfn,
-                                   struct oos_fixup *fixup)
-{
-    struct domain *d = v->domain;
-    int ftlb = 0;
-
-    ftlb |= oos_fixup_flush_gmfn(v, gmfn, fixup);
-
-    switch ( sh_remove_write_access(d, gmfn, 0, 0) )
-    {
-    default:
-    case 0:
-        break;
-
-    case 1:
-        ftlb |= 1;
-        break;
-
-    case -1:
-        /* An unfindable writeable typecount has appeared, probably via a
-         * grant table entry: can't shoot the mapping, so try to unshadow
-         * the page.  If that doesn't work either, the guest is granting
-         * his pagetables and must be killed after all.
-         * This will flush the tlb, so we can return with no worries. */
-        shadow_remove_all_shadows(d, gmfn);
-        return 1;
-    }
-
-    if ( ftlb )
-        guest_flush_tlb_mask(d, d->dirty_cpumask);
-
-    return 0;
-}
-
-
-static inline void trace_resync(int event, mfn_t gmfn)
-{
-    if ( tb_init_done )
-    {
-        /* Convert gmfn to gfn */
-        gfn_t gfn = mfn_to_gfn(current->domain, gmfn);
-
-        trace(event, sizeof(gfn), &gfn);
-    }
-}
-
-/* Pull all the entries on an out-of-sync page back into sync. */
-static void _sh_resync(struct vcpu *v, mfn_t gmfn,
-                       struct oos_fixup *fixup, mfn_t snp)
-{
-    struct page_info *pg = mfn_to_page(gmfn);
-
-    ASSERT(paging_locked_by_me(v->domain));
-    ASSERT(mfn_is_out_of_sync(gmfn));
-    /* Guest page must be shadowed *only* as L1 when out of sync. */
-    ASSERT(!(mfn_to_page(gmfn)->shadow_flags & SHF_page_type_mask
-             & ~SHF_L1_ANY));
-    ASSERT(!sh_page_has_multiple_shadows(mfn_to_page(gmfn)));
-
-    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
-
-    /* Need to pull write access so the page *stays* in sync. */
-    if ( oos_remove_write_access(v, gmfn, fixup) )
-    {
-        /* Page has been unshadowed. */
-        return;
-    }
-
-    /* No more writable mappings of this page, please */
-    pg->shadow_flags &= ~SHF_oos_may_write;
-
-    /* Update the shadows with current guest entries. */
-    _sh_resync_l1(v, gmfn, snp);
-
-    /* Now we know all the entries are synced, and will stay that way */
-    pg->shadow_flags &= ~SHF_out_of_sync;
-    perfc_incr(shadow_resync);
-    trace_resync(TRC_SHADOW_RESYNC_FULL, gmfn);
-}
-
-
-/* Add an MFN to the list of out-of-sync guest pagetables */
-static void oos_hash_add(struct vcpu *v, mfn_t gmfn)
-{
-    int i, idx, oidx, swap = 0;
-    mfn_t *oos = v->arch.paging.shadow.oos;
-    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
-    struct oos_fixup fixup = { .next = 0 };
-
-    for (i = 0; i < SHADOW_OOS_FIXUPS; i++ )
-        fixup.smfn[i] = INVALID_MFN;
-
-    idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-    oidx = idx;
-
-    if ( !mfn_eq(oos[idx], INVALID_MFN)
-         && (mfn_x(oos[idx]) % SHADOW_OOS_PAGES) == idx )
-    {
-        /* Punt the current occupant into the next slot */
-        SWAP(oos[idx], gmfn);
-        SWAP(oos_fixup[idx], fixup);
-        swap = 1;
-        idx = (idx + 1) % SHADOW_OOS_PAGES;
-    }
-    if ( !mfn_eq(oos[idx], INVALID_MFN) )
-    {
-        /* Crush the current occupant. */
-        _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
-        perfc_incr(shadow_unsync_evict);
-    }
-    oos[idx] = gmfn;
-    oos_fixup[idx] = fixup;
-
-    if ( swap )
-        SWAP(oos_snapshot[idx], oos_snapshot[oidx]);
-
-    copy_domain_page(oos_snapshot[oidx], oos[oidx]);
-}
-
-/* Remove an MFN from the list of out-of-sync guest pagetables */
-static void oos_hash_remove(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    mfn_t *oos;
-    struct vcpu *v;
-
-    SHADOW_PRINTK("d%d gmfn %lx\n", d->domain_id, mfn_x(gmfn));
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            oos[idx] = INVALID_MFN;
-            return;
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    mfn_t *oos;
-    mfn_t *oos_snapshot;
-    struct vcpu *v;
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            return oos_snapshot[idx];
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-/* Pull a single guest page back into sync */
-void sh_resync(struct domain *d, mfn_t gmfn)
-{
-    int idx;
-    mfn_t *oos;
-    mfn_t *oos_snapshot;
-    struct oos_fixup *oos_fixup;
-    struct vcpu *v;
-
-    for_each_vcpu(d, v)
-    {
-        oos = v->arch.paging.shadow.oos;
-        oos_fixup = v->arch.paging.shadow.oos_fixup;
-        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
-        if ( !mfn_eq(oos[idx], gmfn) )
-            idx = (idx + 1) % SHADOW_OOS_PAGES;
-
-        if ( mfn_eq(oos[idx], gmfn) )
-        {
-            _sh_resync(v, gmfn, &oos_fixup[idx], oos_snapshot[idx]);
-            oos[idx] = INVALID_MFN;
-            return;
-        }
-    }
-
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
-           mfn_x(gmfn));
-    BUG();
-}
-
-/* Figure out whether it's definitely safe not to sync this l1 table,
- * by making a call out to the mode in which that shadow was made. */
-static int sh_skip_sync(struct vcpu *v, mfn_t gl1mfn)
-{
-    struct page_info *pg = mfn_to_page(gl1mfn);
-    if ( pg->shadow_flags & SHF_L1_32 )
-        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 2)(v, gl1mfn);
-    else if ( pg->shadow_flags & SHF_L1_PAE )
-        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
-    else if ( pg->shadow_flags & SHF_L1_64 )
-        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
-    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not shadowed as an l1\n",
-           mfn_x(gl1mfn));
-    BUG();
-}
-
-
-/* Pull all out-of-sync pages back into sync.  Pages brought out of sync
- * on other vcpus are allowed to remain out of sync, but their contents
- * will be made safe (TLB flush semantics); pages unsynced by this vcpu
- * are brought back into sync and write-protected.  If skip != 0, we try
- * to avoid resyncing at all if we think we can get away with it. */
-void sh_resync_all(struct vcpu *v, int skip, int this, int others)
-{
-    int idx;
-    struct vcpu *other;
-    mfn_t *oos = v->arch.paging.shadow.oos;
-    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
-    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
-
-    SHADOW_PRINTK("%pv\n", v);
-
-    ASSERT(paging_locked_by_me(v->domain));
-
-    if ( !this )
-        goto resync_others;
-
-    /* First: resync all of this vcpu's oos pages */
-    for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
-        if ( !mfn_eq(oos[idx], INVALID_MFN) )
-        {
-            /* Write-protect and sync contents */
-            _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
-            oos[idx] = INVALID_MFN;
-        }
-
- resync_others:
-    if ( !others )
-        return;
-
-    /* Second: make all *other* vcpus' oos pages safe. */
-    for_each_vcpu(v->domain, other)
-    {
-        if ( v == other )
-            continue;
-
-        oos = other->arch.paging.shadow.oos;
-        oos_fixup = other->arch.paging.shadow.oos_fixup;
-        oos_snapshot = other->arch.paging.shadow.oos_snapshot;
-
-        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
-        {
-            if ( mfn_eq(oos[idx], INVALID_MFN) )
-                continue;
-
-            if ( skip )
-            {
-                /* Update the shadows and leave the page OOS. */
-                if ( sh_skip_sync(v, oos[idx]) )
-                    continue;
-                trace_resync(TRC_SHADOW_RESYNC_ONLY, oos[idx]);
-                _sh_resync_l1(other, oos[idx], oos_snapshot[idx]);
-            }
-            else
-            {
-                /* Write-protect and sync contents */
-                _sh_resync(other, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
-                oos[idx] = INVALID_MFN;
-            }
-        }
-    }
-}
-
-/* Allow a shadowed page to go out of sync. Unsyncs are traced in
- * multi.c:sh_page_fault() */
-int sh_unsync(struct vcpu *v, mfn_t gmfn)
-{
-    struct page_info *pg;
-
-    ASSERT(paging_locked_by_me(v->domain));
-
-    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
-
-    pg = mfn_to_page(gmfn);
-
-    /* Guest page must be shadowed *only* as L1 and *only* once when out
-     * of sync.  Also, get out now if it's already out of sync.
-     * Also, can't safely unsync if some vcpus have paging disabled.*/
-    if ( pg->shadow_flags &
-         ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)
-         || sh_page_has_multiple_shadows(pg)
-         || !is_hvm_vcpu(v)
-         || !v->domain->arch.paging.shadow.oos_active )
-        return 0;
-
-    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_out_of_sync);
-    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_oos_may_write);
-
-    pg->shadow_flags |= SHF_out_of_sync|SHF_oos_may_write;
-    oos_hash_add(v, gmfn);
-    perfc_incr(shadow_unsync);
-    TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_UNSYNC);
-    return 1;
-}
-
-#endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */
-
-
 /**************************************************************************/
 /* Code for "promoting" a guest page to the point where the shadow code is
  * willing to let it be treated as a guest page table.  This generally
diff --git a/xen/arch/x86/mm/shadow/oos.c b/xen/arch/x86/mm/shadow/oos.c
new file mode 100644
index 0000000000..d4f167f73f
--- /dev/null
+++ b/xen/arch/x86/mm/shadow/oos.c
@@ -0,0 +1,606 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/******************************************************************************
+ * arch/x86/mm/shadow/oos.c
+ *
+ * Shadow code dealing with out-of-sync shadows.
+ * Parts of this code are Copyright (c) 2006 by XenSource Inc.
+ * Parts of this code are Copyright (c) 2006 by Michael A Fetterman
+ * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al.
+ */
+
+#include <asm/shadow.h>
+
+#include "private.h"
+
+#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
+
+#include <xen/trace.h>
+
+/*
+ * From time to time, we let a shadowed pagetable page go out of sync
+ * with its shadow: the guest is allowed to write directly to the page,
+ * and those writes are not synchronously reflected in the shadow.
+ * This lets us avoid many emulations if the guest is writing a lot to a
+ * pagetable, but it relaxes a pretty important invariant in the shadow
+ * pagetable design.  Therefore, some rules:
+ *
+ * 1. Only L1 pagetables may go out of sync: any page that is shadowed
+ *    at at higher level must be synchronously updated.  This makes
+ *    using linear shadow pagetables much less dangerous.
+ *    That means that: (a) unsyncing code needs to check for higher-level
+ *    shadows, and (b) promotion code needs to resync.
+ *
+ * 2. All shadow operations on a guest page require the page to be brought
+ *    back into sync before proceeding.  This must be done under the
+ *    paging lock so that the page is guaranteed to remain synced until
+ *    the operation completes.
+ *
+ *    Exceptions to this rule: the pagefault and invlpg handlers may
+ *    update only one entry on an out-of-sync page without resyncing it.
+ *
+ * 3. Operations on shadows that do not start from a guest page need to
+ *    be aware that they may be handling an out-of-sync shadow.
+ *
+ * 4. Operations that do not normally take the paging lock (fast-path
+ *    #PF handler, INVLPG) must fall back to a locking, syncing version
+ *    if they see an out-of-sync table.
+ *
+ * 5. Operations corresponding to guest TLB flushes (MOV CR3, INVLPG)
+ *    must explicitly resync all relevant pages or update their
+ *    shadows.
+ *
+ * Currently out-of-sync pages are listed in a simple open-addressed
+ * hash table with a second chance (must resist temptation to radically
+ * over-engineer hash tables...)  The virtual address of the access
+ * which caused us to unsync the page is also kept in the hash table, as
+ * a hint for finding the writable mappings later.
+ *
+ * We keep a hash per vcpu, because we want as much as possible to do
+ * the re-sync on the save vcpu we did the unsync on, so the VA hint
+ * will be valid.
+ */
+
+#if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL
+void sh_oos_audit(struct domain *d)
+{
+    unsigned int idx, expected_idx, expected_idx_alt;
+    struct page_info *pg;
+    struct vcpu *v;
+
+    for_each_vcpu(d, v)
+    {
+        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
+        {
+            mfn_t *oos = v->arch.paging.shadow.oos;
+
+            if ( mfn_eq(oos[idx], INVALID_MFN) )
+                continue;
+
+            expected_idx = mfn_x(oos[idx]) % SHADOW_OOS_PAGES;
+            expected_idx_alt = ((expected_idx + 1) % SHADOW_OOS_PAGES);
+            if ( idx != expected_idx && idx != expected_idx_alt )
+            {
+                printk("%s: idx %x contains gmfn %lx, expected at %x or %x.\n",
+                       __func__, idx, mfn_x(oos[idx]),
+                       expected_idx, expected_idx_alt);
+                BUG();
+            }
+            pg = mfn_to_page(oos[idx]);
+            if ( !(pg->count_info & PGC_shadowed_pt) )
+            {
+                printk("%s: idx %x gmfn %lx not a pt (count %lx)\n",
+                       __func__, idx, mfn_x(oos[idx]), pg->count_info);
+                BUG();
+            }
+            if ( !(pg->shadow_flags & SHF_out_of_sync) )
+            {
+                printk("%s: idx %x gmfn %lx not marked oos (flags %x)\n",
+                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
+                BUG();
+            }
+            if ( (pg->shadow_flags & SHF_page_type_mask & ~SHF_L1_ANY) )
+            {
+                printk("%s: idx %x gmfn %lx shadowed as non-l1 (flags %x)\n",
+                       __func__, idx, mfn_x(oos[idx]), pg->shadow_flags);
+                BUG();
+            }
+        }
+    }
+}
+#endif
+
+#if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES
+void oos_audit_hash_is_present(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    struct vcpu *v;
+    mfn_t *oos;
+
+    ASSERT(mfn_is_out_of_sync(gmfn));
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+
+        if ( mfn_eq(oos[idx], gmfn) )
+            return;
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" marked OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+#endif
+
+/* Update the shadow, but keep the page out of sync. */
+static inline void _sh_resync_l1(struct vcpu *v, mfn_t gmfn, mfn_t snpmfn)
+{
+    struct page_info *pg = mfn_to_page(gmfn);
+
+    ASSERT(mfn_valid(gmfn));
+    ASSERT(page_is_out_of_sync(pg));
+
+    /* Call out to the appropriate per-mode resyncing function */
+    if ( pg->shadow_flags & SHF_L1_32 )
+        SHADOW_INTERNAL_NAME(sh_resync_l1, 2)(v, gmfn, snpmfn);
+    else if ( pg->shadow_flags & SHF_L1_PAE )
+        SHADOW_INTERNAL_NAME(sh_resync_l1, 3)(v, gmfn, snpmfn);
+    else if ( pg->shadow_flags & SHF_L1_64 )
+        SHADOW_INTERNAL_NAME(sh_resync_l1, 4)(v, gmfn, snpmfn);
+}
+
+static int sh_remove_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
+                                            mfn_t smfn, unsigned long off)
+{
+    ASSERT(mfn_valid(smfn));
+    ASSERT(mfn_valid(gmfn));
+
+    switch ( mfn_to_page(smfn)->u.sh.type )
+    {
+    case SH_type_l1_32_shadow:
+    case SH_type_fl1_32_shadow:
+        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 2)
+            (d, gmfn, smfn, off);
+
+    case SH_type_l1_pae_shadow:
+    case SH_type_fl1_pae_shadow:
+        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 3)
+            (d, gmfn, smfn, off);
+
+    case SH_type_l1_64_shadow:
+    case SH_type_fl1_64_shadow:
+        return SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, 4)
+            (d, gmfn, smfn, off);
+
+    default:
+        return 0;
+    }
+}
+
+/*
+ * Fixup arrays: We limit the maximum number of writable mappings to
+ * SHADOW_OOS_FIXUPS and store enough information to remove them
+ * quickly on resync.
+ */
+
+static inline int oos_fixup_flush_gmfn(struct vcpu *v, mfn_t gmfn,
+                                       struct oos_fixup *fixup)
+{
+    struct domain *d = v->domain;
+    int i;
+    for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
+    {
+        if ( !mfn_eq(fixup->smfn[i], INVALID_MFN) )
+        {
+            sh_remove_write_access_from_sl1p(d, gmfn,
+                                             fixup->smfn[i],
+                                             fixup->off[i]);
+            fixup->smfn[i] = INVALID_MFN;
+        }
+    }
+
+    /* Always flush the TLBs. See comment on oos_fixup_add(). */
+    return 1;
+}
+
+void oos_fixup_add(struct domain *d, mfn_t gmfn,
+                   mfn_t smfn,  unsigned long off)
+{
+    int idx, next;
+    mfn_t *oos;
+    struct oos_fixup *oos_fixup;
+    struct vcpu *v;
+
+    perfc_incr(shadow_oos_fixup_add);
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        oos_fixup = v->arch.paging.shadow.oos_fixup;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            int i;
+            for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
+            {
+                if ( mfn_eq(oos_fixup[idx].smfn[i], smfn) &&
+                     (oos_fixup[idx].off[i] == off) )
+                    return;
+            }
+
+            next = oos_fixup[idx].next;
+
+            if ( !mfn_eq(oos_fixup[idx].smfn[next], INVALID_MFN) )
+            {
+                TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_EVICT);
+
+                /* Reuse this slot and remove current writable mapping. */
+                sh_remove_write_access_from_sl1p(d, gmfn,
+                                                 oos_fixup[idx].smfn[next],
+                                                 oos_fixup[idx].off[next]);
+                perfc_incr(shadow_oos_fixup_evict);
+                /*
+                 * We should flush the TLBs now, because we removed a
+                 * writable mapping, but since the shadow is already
+                 * OOS we have no problem if another vcpu write to
+                 * this page table. We just have to be very careful to
+                 * *always* flush the tlbs on resync.
+                 */
+            }
+
+            oos_fixup[idx].smfn[next] = smfn;
+            oos_fixup[idx].off[next] = off;
+            oos_fixup[idx].next = (next + 1) % SHADOW_OOS_FIXUPS;
+
+            TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_OOS_FIXUP_ADD);
+            return;
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+static int oos_remove_write_access(struct vcpu *v, mfn_t gmfn,
+                                   struct oos_fixup *fixup)
+{
+    struct domain *d = v->domain;
+    int ftlb = 0;
+
+    ftlb |= oos_fixup_flush_gmfn(v, gmfn, fixup);
+
+    switch ( sh_remove_write_access(d, gmfn, 0, 0) )
+    {
+    default:
+    case 0:
+        break;
+
+    case 1:
+        ftlb |= 1;
+        break;
+
+    case -1:
+        /*
+         * An unfindable writeable typecount has appeared, probably via a
+         * grant table entry: can't shoot the mapping, so try to unshadow
+         * the page.  If that doesn't work either, the guest is granting
+         * his pagetables and must be killed after all.
+         * This will flush the tlb, so we can return with no worries.
+         */
+        shadow_remove_all_shadows(d, gmfn);
+        return 1;
+    }
+
+    if ( ftlb )
+        guest_flush_tlb_mask(d, d->dirty_cpumask);
+
+    return 0;
+}
+
+static inline void trace_resync(int event, mfn_t gmfn)
+{
+    if ( tb_init_done )
+    {
+        /* Convert gmfn to gfn */
+        gfn_t gfn = mfn_to_gfn(current->domain, gmfn);
+
+        trace(event, sizeof(gfn), &gfn);
+    }
+}
+
+/* Pull all the entries on an out-of-sync page back into sync. */
+static void _sh_resync(struct vcpu *v, mfn_t gmfn,
+                       struct oos_fixup *fixup, mfn_t snp)
+{
+    struct page_info *pg = mfn_to_page(gmfn);
+
+    ASSERT(paging_locked_by_me(v->domain));
+    ASSERT(mfn_is_out_of_sync(gmfn));
+    /* Guest page must be shadowed *only* as L1 when out of sync. */
+    ASSERT(!(mfn_to_page(gmfn)->shadow_flags & SHF_page_type_mask
+             & ~SHF_L1_ANY));
+    ASSERT(!sh_page_has_multiple_shadows(mfn_to_page(gmfn)));
+
+    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
+
+    /* Need to pull write access so the page *stays* in sync. */
+    if ( oos_remove_write_access(v, gmfn, fixup) )
+    {
+        /* Page has been unshadowed. */
+        return;
+    }
+
+    /* No more writable mappings of this page, please */
+    pg->shadow_flags &= ~SHF_oos_may_write;
+
+    /* Update the shadows with current guest entries. */
+    _sh_resync_l1(v, gmfn, snp);
+
+    /* Now we know all the entries are synced, and will stay that way */
+    pg->shadow_flags &= ~SHF_out_of_sync;
+    perfc_incr(shadow_resync);
+    trace_resync(TRC_SHADOW_RESYNC_FULL, gmfn);
+}
+
+/* Add an MFN to the list of out-of-sync guest pagetables */
+static void oos_hash_add(struct vcpu *v, mfn_t gmfn)
+{
+    int i, idx, oidx, swap = 0;
+    mfn_t *oos = v->arch.paging.shadow.oos;
+    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
+    struct oos_fixup fixup = { .next = 0 };
+
+    for ( i = 0; i < SHADOW_OOS_FIXUPS; i++ )
+        fixup.smfn[i] = INVALID_MFN;
+
+    idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+    oidx = idx;
+
+    if ( !mfn_eq(oos[idx], INVALID_MFN) &&
+         (mfn_x(oos[idx]) % SHADOW_OOS_PAGES) == idx )
+    {
+        /* Punt the current occupant into the next slot */
+        SWAP(oos[idx], gmfn);
+        SWAP(oos_fixup[idx], fixup);
+        swap = 1;
+        idx = (idx + 1) % SHADOW_OOS_PAGES;
+    }
+    if ( !mfn_eq(oos[idx], INVALID_MFN) )
+    {
+        /* Crush the current occupant. */
+        _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
+        perfc_incr(shadow_unsync_evict);
+    }
+    oos[idx] = gmfn;
+    oos_fixup[idx] = fixup;
+
+    if ( swap )
+        SWAP(oos_snapshot[idx], oos_snapshot[oidx]);
+
+    copy_domain_page(oos_snapshot[oidx], oos[oidx]);
+}
+
+/* Remove an MFN from the list of out-of-sync guest pagetables */
+void oos_hash_remove(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    mfn_t *oos;
+    struct vcpu *v;
+
+    SHADOW_PRINTK("d%d gmfn %lx\n", d->domain_id, mfn_x(gmfn));
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            oos[idx] = INVALID_MFN;
+            return;
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    mfn_t *oos;
+    mfn_t *oos_snapshot;
+    struct vcpu *v;
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            return oos_snapshot[idx];
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+/* Pull a single guest page back into sync */
+void sh_resync(struct domain *d, mfn_t gmfn)
+{
+    int idx;
+    mfn_t *oos;
+    mfn_t *oos_snapshot;
+    struct oos_fixup *oos_fixup;
+    struct vcpu *v;
+
+    for_each_vcpu(d, v)
+    {
+        oos = v->arch.paging.shadow.oos;
+        oos_fixup = v->arch.paging.shadow.oos_fixup;
+        oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+        idx = mfn_x(gmfn) % SHADOW_OOS_PAGES;
+        if ( !mfn_eq(oos[idx], gmfn) )
+            idx = (idx + 1) % SHADOW_OOS_PAGES;
+
+        if ( mfn_eq(oos[idx], gmfn) )
+        {
+            _sh_resync(v, gmfn, &oos_fixup[idx], oos_snapshot[idx]);
+            oos[idx] = INVALID_MFN;
+            return;
+        }
+    }
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not in hash table\n",
+           mfn_x(gmfn));
+    BUG();
+}
+
+/*
+ * Figure out whether it's definitely safe not to sync this l1 table,
+ * by making a call out to the mode in which that shadow was made.
+ */
+static int sh_skip_sync(struct vcpu *v, mfn_t gl1mfn)
+{
+    struct page_info *pg = mfn_to_page(gl1mfn);
+
+    if ( pg->shadow_flags & SHF_L1_32 )
+        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 2)(v, gl1mfn);
+    else if ( pg->shadow_flags & SHF_L1_PAE )
+        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 3)(v, gl1mfn);
+    else if ( pg->shadow_flags & SHF_L1_64 )
+        return SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, 4)(v, gl1mfn);
+
+    printk(XENLOG_ERR "gmfn %"PRI_mfn" was OOS but not shadowed as an l1\n",
+           mfn_x(gl1mfn));
+    BUG();
+}
+
+/*
+ * Pull all out-of-sync pages back into sync.  Pages brought out of sync
+ * on other vcpus are allowed to remain out of sync, but their contents
+ * will be made safe (TLB flush semantics); pages unsynced by this vcpu
+ * are brought back into sync and write-protected.  If skip != 0, we try
+ * to avoid resyncing at all if we think we can get away with it.
+ */
+void sh_resync_all(struct vcpu *v, int skip, int this, int others)
+{
+    int idx;
+    struct vcpu *other;
+    mfn_t *oos = v->arch.paging.shadow.oos;
+    mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot;
+    struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup;
+
+    SHADOW_PRINTK("%pv\n", v);
+
+    ASSERT(paging_locked_by_me(v->domain));
+
+    if ( !this )
+        goto resync_others;
+
+    /* First: resync all of this vcpu's oos pages */
+    for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
+        if ( !mfn_eq(oos[idx], INVALID_MFN) )
+        {
+            /* Write-protect and sync contents */
+            _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
+            oos[idx] = INVALID_MFN;
+        }
+
+ resync_others:
+    if ( !others )
+        return;
+
+    /* Second: make all *other* vcpus' oos pages safe. */
+    for_each_vcpu(v->domain, other)
+    {
+        if ( v == other )
+            continue;
+
+        oos = other->arch.paging.shadow.oos;
+        oos_fixup = other->arch.paging.shadow.oos_fixup;
+        oos_snapshot = other->arch.paging.shadow.oos_snapshot;
+
+        for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ )
+        {
+            if ( mfn_eq(oos[idx], INVALID_MFN) )
+                continue;
+
+            if ( skip )
+            {
+                /* Update the shadows and leave the page OOS. */
+                if ( sh_skip_sync(v, oos[idx]) )
+                    continue;
+                trace_resync(TRC_SHADOW_RESYNC_ONLY, oos[idx]);
+                _sh_resync_l1(other, oos[idx], oos_snapshot[idx]);
+            }
+            else
+            {
+                /* Write-protect and sync contents */
+                _sh_resync(other, oos[idx], &oos_fixup[idx], oos_snapshot[idx]);
+                oos[idx] = INVALID_MFN;
+            }
+        }
+    }
+}
+
+/*
+ * Allow a shadowed page to go out of sync. Unsyncs are traced in
+ * multi.c:sh_page_fault()
+ */
+int sh_unsync(struct vcpu *v, mfn_t gmfn)
+{
+    struct page_info *pg;
+
+    ASSERT(paging_locked_by_me(v->domain));
+
+    SHADOW_PRINTK("%pv gmfn=%"PRI_mfn"\n", v, mfn_x(gmfn));
+
+    pg = mfn_to_page(gmfn);
+
+    /*
+     * Guest page must be shadowed *only* as L1 and *only* once when out
+     * of sync.  Also, get out now if it's already out of sync.
+     * Also, can't safely unsync if some vcpus have paging disabled.
+     */
+    if ( (pg->shadow_flags &
+          ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)) ||
+         sh_page_has_multiple_shadows(pg) ||
+         !is_hvm_vcpu(v) ||
+         !v->domain->arch.paging.shadow.oos_active )
+        return 0;
+
+    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_out_of_sync);
+    BUILD_BUG_ON(!(typeof(pg->shadow_flags))SHF_oos_may_write);
+
+    pg->shadow_flags |= SHF_out_of_sync|SHF_oos_may_write;
+    oos_hash_add(v, gmfn);
+    perfc_incr(shadow_unsync);
+    TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_UNSYNC);
+    return 1;
+}
+
+#endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index e4eca60eb3..4e955ef35b 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -439,6 +439,7 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn);
 /* Pull an out-of-sync page back into sync. */
 void sh_resync(struct domain *d, mfn_t gmfn);
 
+void oos_hash_remove(struct domain *d, mfn_t gmfn);
 void oos_fixup_add(struct domain *d, mfn_t gmfn, mfn_t smfn, unsigned long off);
 
 /* Pull all out-of-sync shadows back into sync.  If skip != 0, we try
@@ -464,6 +465,7 @@ shadow_sync_other_vcpus(struct vcpu *v)
     sh_resync_all(v, 1 /* skip */, 0 /* this */, 1 /* others */);
 }
 
+void sh_oos_audit(struct domain *d);
 void oos_audit_hash_is_present(struct domain *d, mfn_t gmfn);
 mfn_t oos_snapshot_lookup(struct domain *d, mfn_t gmfn);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 13:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 13:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1205097.1519540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN86-0000XI-Be; Thu, 15 Jan 2026 13:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1205097.1519540; Thu, 15 Jan 2026 13:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN86-0000X8-8W; Thu, 15 Jan 2026 13:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1205097;
 Thu, 15 Jan 2026 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 1vgN84-0000Wt-9p
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 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 1vgN84-004nw8-1v
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgN84-004Xzt-0k
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 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=Lx1Fbd9rPNL5KzUfNr6WJu2P23XJzWvw8ThorCcLiDA=; b=zXb2PpJ/eGtWejIpCChWTZlxoA
	YNWE3OQ5hQ8Nw0Zck+GnDc34OL40mNzWvB3tHTE+YyVmQ+Ji7YCRZKhZjHDus3dnQ1ddDOZhZ3sYV
	nNBZ1JdCfHPEfLFAR+gBE7CJIWiKCuuHnW9NaYFLVJ+u8ttrlJqn3D4rXxmbsh1OfoAA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: OOS doesn't track VAs anymore
Message-Id: <E1vgN84-004Xzt-0k@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 13:11:12 +0000

commit c5e70ef3094865bbfcb4699b4ac449bf73b75a53
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 15 11:48:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:48:28 2026 +0100

    x86/shadow: OOS doesn't track VAs anymore
    
    The tracking lasted only for about two weeks, but the related comment
    parts were never purged.
    
    Amends: 50b74f55e0c0 ("OOS cleanup: Fixup arrays instead of fixup tables")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/oos.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/oos.c b/xen/arch/x86/mm/shadow/oos.c
index d4f167f73f..89e8a3b722 100644
--- a/xen/arch/x86/mm/shadow/oos.c
+++ b/xen/arch/x86/mm/shadow/oos.c
@@ -51,13 +51,10 @@
  *
  * Currently out-of-sync pages are listed in a simple open-addressed
  * hash table with a second chance (must resist temptation to radically
- * over-engineer hash tables...)  The virtual address of the access
- * which caused us to unsync the page is also kept in the hash table, as
- * a hint for finding the writable mappings later.
+ * over-engineer hash tables...).
  *
  * We keep a hash per vcpu, because we want as much as possible to do
- * the re-sync on the save vcpu we did the unsync on, so the VA hint
- * will be valid.
+ * the re-sync on the same vcpu we did the unsync on.
  */
 
 #if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 13:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 13:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1205098.1519543 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN8G-0000ZZ-Cb; Thu, 15 Jan 2026 13:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1205098.1519543; Thu, 15 Jan 2026 13:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN8G-0000ZR-9r; Thu, 15 Jan 2026 13:11:24 +0000
Received: by outflank-mailman (input) for mailman id 1205098;
 Thu, 15 Jan 2026 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 1vgN8E-0000ZH-Cg
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 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 1vgN8E-004nwW-2F
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgN8E-004Y17-13
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 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=kH5Tq0TUS7tMaeE7Du8pHkLYXZPjr62XHLy7Jpm1ohM=; b=YOBuMiRze8MA93wuRBZXKDeBEl
	Os0P7Qc3ZgvggTcyNuL3ipbbV4rmjzrI/GFeWqlDozfiNWI8+7lbRRNbAJUyzULwxJSWXPO2HRkqE
	D11tUGnYlO7sFNOtWpSKSL1CpBjgx3f3Pdieqv4M2p8Bcu2ebzgwl+b9zOw2TgYiKA1g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: rename ARAT feature flag
Message-Id: <E1vgN8E-004Y17-13@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 13:11:22 +0000

commit 4422643e3b6469ccf16a080a0f93b509945b0243
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 15 11:49:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:49:28 2026 +0100

    x86: rename ARAT feature flag
    
    Add a XEN infix, to properly distinguish it from the CPUID feature flag
    (leaf 6 EAX bit 2).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpu_idle.c           | 4 ++--
 xen/arch/x86/cpu/amd.c                 | 2 +-
 xen/arch/x86/cpu/hygon.c               | 2 +-
 xen/arch/x86/cpu/intel.c               | 2 +-
 xen/arch/x86/cpu/mwait-idle.c          | 4 ++--
 xen/arch/x86/include/asm/cpufeatures.h | 2 +-
 xen/arch/x86/time.c                    | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index d60a07bfd5..7a87625077 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -109,7 +109,7 @@ void (*__read_mostly lapic_timer_on)(void);
 
 bool lapic_timer_init(void)
 {
-    if ( boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( boot_cpu_has(X86_FEATURE_XEN_ARAT) )
     {
         lapic_timer_off = lapic_timer_nop;
         lapic_timer_on = lapic_timer_nop;
@@ -1463,7 +1463,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
         if ( !vendor_override )
         {
-            if ( !boot_cpu_has(X86_FEATURE_ARAT) )
+            if ( !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
                 hpet_broadcast_init();
 
             if ( !lapic_timer_init() )
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 928d6bd168..8c5bdf0bd5 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1239,7 +1239,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * running in deep C states.
 	 */
 	if ( opt_arat && c->x86 > 0x11 )
-		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	/*
 	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
diff --git a/xen/arch/x86/cpu/hygon.c b/xen/arch/x86/cpu/hygon.c
index cab915a2fc..b99d83ed4d 100644
--- a/xen/arch/x86/cpu/hygon.c
+++ b/xen/arch/x86/cpu/hygon.c
@@ -81,7 +81,7 @@ static void cf_check init_hygon(struct cpuinfo_x86 *c)
 
 	/* Hygon processors have APIC timer running in deep C states. */
 	if (opt_arat)
-		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	if (cpu_has(c, X86_FEATURE_EFRO)) {
 		rdmsrl(MSR_K8_HWCR, value);
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 863edac4cd..b76797cb9a 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -668,7 +668,7 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	if ( opt_arat &&
 	     ( c->cpuid_level >= 0x00000006 ) &&
 	     ( cpuid_eax(0x00000006) & (1u<<2) ) )
-		__set_bit(X86_FEATURE_ARAT, c->x86_capability);
+		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	if ((opt_cpu_info && !(c->apicid & (c->x86_num_siblings - 1))) ||
 	    c == &boot_cpu_data )
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index f47fdfb569..5962ec1db9 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1633,7 +1633,7 @@ static int __init mwait_idle_probe(void)
 	icpu = id->driver_data;
 	cpuidle_state_table = icpu->state_table;
 
-	if (boot_cpu_has(X86_FEATURE_ARAT))
+	if (boot_cpu_has(X86_FEATURE_XEN_ARAT))
 		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
 
 	pr_debug(PREFIX "v" MWAIT_IDLE_VERSION " model %#x\n",
@@ -1792,7 +1792,7 @@ int __init mwait_idle_init(struct notifier_block *nfb)
 		return -ENODEV;
 
 	err = mwait_idle_probe();
-	if (!err && !boot_cpu_has(X86_FEATURE_ARAT)) {
+	if (!err && !boot_cpu_has(X86_FEATURE_XEN_ARAT)) {
 		hpet_broadcast_init();
 		if (xen_cpuidle < 0 && !hpet_broadcast_is_available())
 			err = -ENODEV;
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 65534863c7..bd53ba7976 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -13,7 +13,7 @@
 /* Synthetic features */
 XEN_CPUFEATURE(CONSTANT_TSC,      X86_SYNTH( 0)) /* TSC ticks at a constant rate */
 XEN_CPUFEATURE(NONSTOP_TSC,       X86_SYNTH( 1)) /* TSC does not stop in C states */
-XEN_CPUFEATURE(ARAT,              X86_SYNTH( 2)) /* Always running APIC timer */
+XEN_CPUFEATURE(XEN_ARAT,          X86_SYNTH( 2)) /* Xen may utilize always running APIC timer */
 XEN_CPUFEATURE(ARCH_PERFMON,      X86_SYNTH( 3)) /* Intel Architectural PerfMon */
 XEN_CPUFEATURE(TSC_RELIABLE,      X86_SYNTH( 4)) /* TSC is known to be reliable */
 XEN_CPUFEATURE(XTOPOLOGY,         X86_SYNTH( 5)) /* cpu topology enum extensions */
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 03a383a9a5..362c76df0b 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2644,7 +2644,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 15 13:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Jan 2026 13:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1205099.1519546 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN8Q-0000bh-Dy; Thu, 15 Jan 2026 13:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1205099.1519546; Thu, 15 Jan 2026 13:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgN8Q-0000bZ-BH; Thu, 15 Jan 2026 13:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1205099;
 Thu, 15 Jan 2026 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 1vgN8O-0000bO-Ho
 for xen-changelog@lists.xenproject.org; Thu, 15 Jan 2026 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 1vgN8O-004nwb-2i
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgN8O-004Y1T-1K
 for xen-changelog@lists.xenproject.org;
 Thu, 15 Jan 2026 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=jpPHePtCNZqXWmAO9blLLQ4lFrERO0f/ehUrUhkuYqQ=; b=fNa2faCWNLA4qHVpiF+fNTNNaq
	+pF/mBxjavs8kFVoSgZb627+DfQznoVM47W5Rukkk1b3vciI3BjnVC35poa/WSgw3lMHjRsfkI5Us
	EtYUQUGGPRPNiMkCPPdGruEL2JpXTl3CbvAT7HPpe82X6AtbtZwaRtrw8fOOpRMSjNAg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mce: use offsetof() to determine section offset
Message-Id: <E1vgN8O-004Y1T-1K@xenbits.xenproject.org>
Date: Thu, 15 Jan 2026 13:11:32 +0000

commit f4df6d35112c009514db55c3e5e5725b4e7b730c
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu Jan 15 11:49:55 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 15 11:49:55 2026 +0100

    x86/mce: use offsetof() to determine section offset
    
    There is no reason to use pointer difference.
    A violation of MISRA C Rule 18.2 ("Subtraction between pointers
    shall only be applied to pointers that address elements of the
    same array") is also resolved because the object to the subtraction
    is applied is not an array.
    
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/mce-apei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce-apei.c b/xen/arch/x86/cpu/mcheck/mce-apei.c
index b895020882..0b1c9902c0 100644
--- a/xen/arch/x86/cpu/mcheck/mce-apei.c
+++ b/xen/arch/x86/cpu/mcheck/mce-apei.c
@@ -74,7 +74,7 @@ int apei_write_mce(struct mce *m)
 	rcd.hdr.record_id = cper_next_record_id();
 	rcd.hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR;
 
-	rcd.sec_hdr.section_offset = (void *)&rcd.mce - (void *)&rcd;
+	rcd.sec_hdr.section_offset = offsetof(struct cper_mce_record, mce);
 	rcd.sec_hdr.section_length = sizeof(rcd.mce);
 	rcd.sec_hdr.revision = CPER_SEC_REV;
 	/* fru_id and fru_text is invalid */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 08:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 08:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206300.1519937 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfR5-0006gR-A5; Fri, 16 Jan 2026 08:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206300.1519937; Fri, 16 Jan 2026 08:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfR5-0006gI-7R; Fri, 16 Jan 2026 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1206300;
 Fri, 16 Jan 2026 08: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 1vgfR4-0006gC-2O
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 08: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 1vgfR4-006ISj-0m
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgfR3-005g9V-2d
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08: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=3PhLwggK7/n3WqxdJmektfRKd//Ljq5JTI9hLcX8bHA=; b=5YgSiqW7DDIqGbYiczuBAT/pVZ
	E3zg0eZId/a9LREih96frO46FhDhZpfuJXJuWO5M6W9f9M2e96xhfavS3FPLwianYE+bllaSTheeu
	fjUaUi2CeYDb8tagwZAGca81TrKFQt5ddBaC1SWE0Ees6WucSTAZiTFndz2btgxOuemY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Implement copy_from_paddr for MPU systems
Message-Id: <E1vgfR3-005g9V-2d@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 08:44:01 +0000

commit 38bd76197ce655adb590478fc576a1674c3f19fe
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Wed Jan 14 14:27:29 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Implement copy_from_paddr for MPU systems
    
    Implement the function copy_from_paddr variant for MPU systems, using
    the map_pages_to_xen/destroy_xen_mappings to temporarily map the memory
    range to be copied.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/mpu/setup.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
index 163573b932..ec264f54f2 100644
--- a/xen/arch/arm/mpu/setup.c
+++ b/xen/arch/arm/mpu/setup.c
@@ -91,7 +91,19 @@ void * __init early_fdt_map(paddr_t fdt_paddr)
  */
 void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
 {
-    BUG_ON("unimplemented");
+    paddr_t start_pg = round_pgdown(paddr);
+    paddr_t end_pg   = round_pgup(paddr + len);
+    unsigned long nr_mfns = (end_pg - start_pg) >> PAGE_SHIFT;
+    mfn_t mfn = maddr_to_mfn(start_pg);
+
+    if ( map_pages_to_xen(start_pg, mfn, nr_mfns, PAGE_HYPERVISOR_WC) )
+        panic("Unable to map range for copy_from_paddr\n");
+
+    memcpy(dst, maddr_to_virt(paddr), len);
+    clean_dcache_va_range(dst, len);
+
+    if ( destroy_xen_mappings(start_pg, end_pg) )
+        panic("Unable to unmap range for copy_from_paddr\n");
 }
 
 void __init remove_early_mappings(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 08:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 08:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206301.1519941 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfRF-0006hc-BZ; Fri, 16 Jan 2026 08:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206301.1519941; Fri, 16 Jan 2026 08:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfRF-0006hU-8l; Fri, 16 Jan 2026 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1206301;
 Fri, 16 Jan 2026 08: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 1vgfRE-0006hM-2B
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 08: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 1vgfRE-006ISp-1C
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgfRD-005gB9-36
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08: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=ZhOwAPecvf4B/2rLPaZdTqorfmELAA68XVe3DGVMN+4=; b=3vHsP7xNHRq0j8Riz6TNR19JxC
	mumLGrbHCs8kl1WMP2fCbpLZqMFNTNCY5xb7zMh1J2o0aDMxbjXJgx2Xefb2CDiSnzhUyhZnD3aUg
	gvN3AWJcQ4Sg5lRPKQeCeAxX+ZnMoQ6NMKDKB0XN3ri5gf/z1gY3dEsHcdLFrw9AaFxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Implement vmap functions for MPU
Message-Id: <E1vgfRD-005gB9-36@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 08:44:11 +0000

commit da0c03b66c67f00f74d35b10f0ab9df1b0f7410a
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Wed Jan 14 14:27:30 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Implement vmap functions for MPU
    
    HAS_VMAP is not enabled on MPU systems, but the vmap functions are used
    in places across common code. In order to keep the existing code and
    maintain correct functionality, implement the `vmap_contig` and `vunmap`
    functions for MPU systems.
    
    Introduce a helper function `destroy_xen_mapping_containing` to aid with
    unmapping an entire region when only the start address is known.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mpu/mm.h | 10 +++++
 xen/arch/arm/mpu/mm.c             | 83 +++++++++++++++++++++++++++++++++------
 xen/arch/arm/mpu/vmap.c           | 14 +++++--
 3 files changed, 92 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
index e1ded6521d..1b5ffa5b64 100644
--- a/xen/arch/arm/include/asm/mpu/mm.h
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -111,6 +111,16 @@ pr_t pr_of_addr(paddr_t base, paddr_t limit, unsigned int flags);
 int mpumap_contains_region(pr_t *table, uint8_t nr_regions, paddr_t base,
                            paddr_t limit, uint8_t *index);
 
+
+/*
+ * Destroys and frees (if reference count is 0) an entire xen mapping on MPU
+ * systems where only the start address is known.
+ *
+ * @param s     Start address of memory region to be destroyed.
+ * @return:     0 on success, negative on error.
+ */
+int destroy_xen_mapping_containing(paddr_t s);
+
 #endif /* __ARM_MPU_MM_H__ */
 
 /*
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 687dec3bc6..5e19ffde4c 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -290,6 +290,43 @@ static void disable_mpu_region_from_index(uint8_t index)
         write_protection_region(&xen_mpumap[index], index);
 }
 
+/*
+ * Free a xen_mpumap entry given the index. A mpu region is actually disabled
+ * when the refcount is 0 and the region type is MPUMAP_REGION_FOUND.
+ *
+ * @param idx                   Index of the mpumap entry.
+ * @param region_found_type     MPUMAP_REGION_* value.
+ * @return                      0 on success, otherwise negative on error.
+ */
+static int xen_mpumap_free_entry(uint8_t idx, int region_found_type)
+{
+    ASSERT(spin_is_locked(&xen_mpumap_lock));
+    ASSERT(idx != INVALID_REGION_IDX);
+    ASSERT(MPUMAP_REGION_OVERLAP != region_found_type);
+
+    if ( MPUMAP_REGION_NOTFOUND == region_found_type )
+    {
+        printk(XENLOG_ERR "Cannot remove entry that does not exist\n");
+        return -EINVAL;
+    }
+
+    if ( xen_mpumap[idx].refcount )
+    {
+        xen_mpumap[idx].refcount -= 1;
+        return 0;
+    }
+
+    if ( MPUMAP_REGION_FOUND != region_found_type )
+    {
+        printk(XENLOG_ERR "Cannot remove a partial region\n");
+        return -EINVAL;
+    }
+
+    disable_mpu_region_from_index(idx);
+
+    return 0;
+}
+
 /*
  * Update the entry in the MPU memory region mapping table (xen_mpumap) for the
  * given memory range and flags, creating one if none exists.
@@ -357,18 +394,7 @@ static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
             return -EINVAL;
         }
 
-        if ( xen_mpumap[idx].refcount == 0 )
-        {
-            if ( MPUMAP_REGION_FOUND == rc )
-                disable_mpu_region_from_index(idx);
-            else
-            {
-                printk("Cannot remove a partial region\n");
-                return -EINVAL;
-            }
-        }
-        else
-            xen_mpumap[idx].refcount -= 1;
+        return xen_mpumap_free_entry(idx, rc);
     }
 
     return 0;
@@ -418,6 +444,39 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
     return xen_mpumap_update(s, e, 0);
 }
 
+int destroy_xen_mapping_containing(paddr_t s)
+{
+    int rc;
+    uint8_t idx;
+
+    ASSERT(IS_ALIGNED(s, PAGE_SIZE));
+
+    spin_lock(&xen_mpumap_lock);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions, s, s + PAGE_SIZE,
+                                &idx);
+
+    /*
+     * Since only entire regions can be freed using `xen_mpumap_free_entry` we
+     * must first check the region exists.
+     */
+    if ( MPUMAP_REGION_NOTFOUND == rc )
+    {
+        printk(XENLOG_ERR "Cannot remove entry that does not exist");
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* As we are unmapping entire region use MPUMAP_REGION_FOUND instead */
+    rc = xen_mpumap_free_entry(idx, MPUMAP_REGION_FOUND);
+    if ( !rc )
+        context_sync_mpu();
+ out:
+    spin_unlock(&xen_mpumap_lock);
+
+    return rc;
+}
+
 int map_pages_to_xen(unsigned long virt, mfn_t mfn, unsigned long nr_mfns,
                      unsigned int flags)
 {
diff --git a/xen/arch/arm/mpu/vmap.c b/xen/arch/arm/mpu/vmap.c
index f977b79cd4..54d949e7ce 100644
--- a/xen/arch/arm/mpu/vmap.c
+++ b/xen/arch/arm/mpu/vmap.c
@@ -1,19 +1,27 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
 #include <xen/bug.h>
+#include <xen/mm.h>
 #include <xen/mm-frame.h>
 #include <xen/types.h>
 #include <xen/vmap.h>
 
 void *vmap_contig(mfn_t mfn, unsigned int nr)
 {
-    BUG_ON("unimplemented");
-    return NULL;
+    paddr_t base = mfn_to_maddr(mfn);
+
+    if ( map_pages_to_xen(base, mfn, nr, PAGE_HYPERVISOR ) )
+        return NULL;
+
+    return maddr_to_virt(base);
 }
 
 void vunmap(const void *va)
 {
-    BUG_ON("unimplemented");
+    paddr_t base = virt_to_maddr(va);
+
+    if ( destroy_xen_mapping_containing(base) )
+        panic("Failed to vunmap region\n");
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 08:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206302.1519944 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfRP-0006kW-Ce; Fri, 16 Jan 2026 08:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206302.1519944; Fri, 16 Jan 2026 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfRP-0006kO-A6; Fri, 16 Jan 2026 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1206302;
 Fri, 16 Jan 2026 08: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 1vgfRO-0006jt-5S
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 08: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 1vgfRO-006ISt-1X
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgfRO-005gCk-0I
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oHoe5DtgHbQVYFE5bAukzkH4tKIHOjeKstlkQkAi3XE=; b=IGvnR9KG3o3CTLExUTYX+xfO5/
	jSIjygYDmy14sgMpqyS57xqU62Ov7ndj9dtreQ30tbXWMkPfBCjWG9IFnKowjPTqIHGxauxMiFOCu
	5i6bjt9G0YHBbrdJrxMgOW/GMkQ8Xybxj76DL+FPkjb4w++MlJ+2FN7UhraMkHsCpeVk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Implement free_init_memory for MPU systems
Message-Id: <E1vgfRO-005gCk-0I@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 08:44:22 +0000

commit 342ac31d1f287e5de1ebc276a23ae53e97a0b0ea
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed Jan 14 14:27:31 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Implement free_init_memory for MPU systems
    
    Implement the function `free_init_memory` for MPU systems. In order to
    support this, the function `modify_xen_mappings` is implemented.
    
    On MPU systems, we map the init text and init data sections using
    separate MPU memory regions. Therefore these are removed separately in
    `free_init_memory`.
    
    Additionally remove warning messages from `is_mm_attr_match` as some
    attributes can now be updated by `xen_mpumap_update_entry`.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/setup.h |   2 +
 xen/arch/arm/mpu/mm.c            | 119 ++++++++++++++++++++++++++++++---------
 2 files changed, 93 insertions(+), 28 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 1eaf13bd66..005cf7be59 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -65,6 +65,8 @@ int map_irq_to_domain(struct domain *d, unsigned int irq,
 int map_range_to_domain(const struct dt_device_node *dev,
                         uint64_t addr, uint64_t len, void *data);
 
+extern const char __init_data_begin[], __bss_start[], __bss_end[];
+
 struct init_info
 {
     /* Pointer to the stack, used by head.S when entering in C */
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 5e19ffde4c..cfd75abdb0 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -15,6 +15,9 @@
 #include <asm/setup.h>
 #include <asm/sysregs.h>
 
+#define MPU_ATTR_XN_RO_MISMATCH     -1
+#define MPU_ATTR_AI_MISMATCH        -2
+
 struct page_info *frame_table;
 
 /* Maximum number of supported MPU memory regions by the EL2 MPU. */
@@ -171,33 +174,16 @@ int mpumap_contains_region(pr_t *table, uint8_t nr_regions, paddr_t base,
     return MPUMAP_REGION_NOTFOUND;
 }
 
-static bool is_mm_attr_match(pr_t *region, unsigned int attributes)
+static int is_mm_attr_match(pr_t *region, unsigned int attributes)
 {
-    if ( region->prbar.reg.ro != PAGE_RO_MASK(attributes) )
-    {
-        printk(XENLOG_WARNING
-               "Mismatched Access Permission attributes (%#x instead of %#x)\n",
-               region->prbar.reg.ro, PAGE_RO_MASK(attributes));
-        return false;
-    }
-
-    if ( region->prbar.reg.xn != PAGE_XN_MASK(attributes) )
-    {
-        printk(XENLOG_WARNING
-               "Mismatched Execute Never attributes (%#x instead of %#x)\n",
-               region->prbar.reg.xn, PAGE_XN_MASK(attributes));
-        return false;
-    }
+    if ( (region->prbar.reg.xn != PAGE_XN_MASK(attributes)) ||
+         (region->prbar.reg.ro != PAGE_RO_MASK(attributes)) )
+        return MPU_ATTR_XN_RO_MISMATCH;
 
     if ( region->prlar.reg.ai != PAGE_AI_MASK(attributes) )
-    {
-        printk(XENLOG_WARNING
-               "Mismatched Memory Attribute Index (%#x instead of %#x)\n",
-               region->prlar.reg.ai, PAGE_AI_MASK(attributes));
-        return false;
-    }
+        return MPU_ATTR_AI_MISMATCH;
 
-    return true;
+    return 0;
 }
 
 /* Map a frame table to cover physical addresses ps through pe */
@@ -358,12 +344,44 @@ static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
     */
     if ( flags_has_page_present && (rc >= MPUMAP_REGION_FOUND) )
     {
-        if ( !is_mm_attr_match(&xen_mpumap[idx], flags) )
+        int attr_match = is_mm_attr_match(&xen_mpumap[idx], flags);
+
+        /* We do not support modifying AI attribute. */
+        if ( MPU_ATTR_AI_MISMATCH == attr_match )
         {
-            printk("Modifying an existing entry is not supported\n");
+            printk(XENLOG_ERR
+                   "Modifying AI attribute is not supported\n");
             return -EINVAL;
         }
 
+        /*
+         * Attributes RO and XN can be changed only by the full region.
+         * Attributes that match can continue and just increment refcount.
+         */
+        if ( MPU_ATTR_XN_RO_MISMATCH == attr_match )
+        {
+            if ( rc == MPUMAP_REGION_INCLUSIVE )
+            {
+                printk(XENLOG_ERR
+                       "Cannot modify partial region attributes\n");
+                return -EINVAL;
+            }
+
+            if ( xen_mpumap[idx].refcount != 0 )
+            {
+                printk(XENLOG_ERR
+                       "Cannot modify RO,XN attributes for a region mapped multiple times\n");
+                return -EINVAL;
+            }
+
+            /* Set new attributes */
+            xen_mpumap[idx].prbar.reg.ro = PAGE_RO_MASK(flags);
+            xen_mpumap[idx].prbar.reg.xn = PAGE_XN_MASK(flags);
+
+            write_protection_region(&xen_mpumap[idx], idx);
+            return 0;
+        }
+
         /* Check for overflow of refcount before incrementing.  */
         if ( xen_mpumap[idx].refcount == 0xFF )
         {
@@ -515,8 +533,7 @@ void __init setup_mm_helper(void)
 
 int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
 {
-    BUG_ON("unimplemented");
-    return -EINVAL;
+    return xen_mpumap_update(s, e, nf);
 }
 
 void dump_hyp_walk(vaddr_t addr)
@@ -527,7 +544,53 @@ void dump_hyp_walk(vaddr_t addr)
 /* Release all __init and __initdata ranges to be reused */
 void free_init_memory(void)
 {
-    BUG_ON("unimplemented");
+    unsigned long inittext_end = (unsigned long)__init_data_begin;
+    unsigned long len = __init_end - __init_begin;
+    uint8_t idx;
+    int rc;
+
+    /* Modify inittext region to be read/write instead of read/execute. */
+    rc = modify_xen_mappings((unsigned long)__init_begin, inittext_end,
+                             PAGE_HYPERVISOR_RW);
+    if ( rc )
+        panic("Unable to map RW the init text section (rc = %d)\n", rc);
+
+    /*
+     * From now on, init will not be used for execution anymore,
+     * so nuke the instruction cache to remove entries related to init.
+     */
+    invalidate_icache_local();
+
+    /*
+     * The initdata region already has read/write permissions so it can just be
+     * zeroed out.
+     */
+    memset(__init_begin, 0, len);
+
+    rc = destroy_xen_mappings((unsigned long)__init_begin, inittext_end);
+    if ( rc )
+        panic("Unable to remove init text section (rc = %d)\n", rc);
+
+    /*
+     * The initdata and bss sections are mapped using a single MPU region, so
+     * modify the start of this region to remove the initdata section.
+     */
+    spin_lock(&xen_mpumap_lock);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions,
+                                (unsigned long)__init_data_begin,
+                                (unsigned long)__bss_end,
+                                &idx);
+    if ( rc < MPUMAP_REGION_FOUND )
+        panic("Unable to find bss data section (rc = %d)\n", rc);
+
+    /* bss data section is shrunk and now starts from __bss_start */
+    pr_set_base(&xen_mpumap[idx], (unsigned long)__bss_start);
+
+    write_protection_region(&xen_mpumap[idx], idx);
+    context_sync_mpu();
+
+    spin_unlock(&xen_mpumap_lock);
 }
 
 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 08:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 08:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206303.1519949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfRZ-0006nH-Fk; Fri, 16 Jan 2026 08:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206303.1519949; Fri, 16 Jan 2026 08: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 1vgfRZ-0006n9-D7; Fri, 16 Jan 2026 08:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1206303;
 Fri, 16 Jan 2026 08: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 1vgfRY-0006n1-8g
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 08: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 1vgfRY-006ISx-1o
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgfRY-005gEa-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cMOmoo9uVARVfTVvL+4sFZiMRwONy7yo7Bhd4b5u3F4=; b=AmclyF4w/dRU3UUfN6x00GHNzB
	FQGBtqTpt5mnSRA1ZUI+mxXV61ilbuChQMVe9yNkNe9PMeXbbRUh0xzWbwIGjWhNOfq0vQxz0X7EC
	lvZfvjsPbMoU6kQTST7SmplpaEUXgZuCcXxI1U8kDcE7XR+vGRKjv8sLn7RVqtQfkKi0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Introduce modify_after_init_mappings
Message-Id: <E1vgfRY-005gEa-0c@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 08:44:32 +0000

commit 2dbdf8607c94b54f51670bf5a89d1dd0f0dbf5c1
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Wed Jan 14 14:27:32 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Introduce modify_after_init_mappings
    
    During `init_done`, Xen sets the permissions of all symbols marked with
    __ro_after_init to be read-only. This does not work on MPU systems at
    present because part-region modification is not supported.
    
    Therefore introduce the function `modify_after_init_mappings` for MMU
    and MPU, to handle the divergent approaches to setting permissions of
    __ro_after_init symbols.
    
    For MPU systems `modify_xen_mappings` will shrink the RW mapping on one
    side and extend the RO mapping on the other. This approach prevents
    wasting an additional region between RW and RO mappings.
    
    As the new function is marked with __init, it needs to be called before
    `free_init_memory`.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/setup.h |  3 +++
 xen/arch/arm/mmu/setup.c         | 15 +++++++++++++++
 xen/arch/arm/mpu/mm.c            |  2 +-
 xen/arch/arm/mpu/setup.c         | 40 ++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/setup.c             | 15 ++-------------
 5 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 005cf7be59..899e33925c 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -78,6 +78,9 @@ struct init_info
 paddr_t consider_modules(paddr_t s, paddr_t e, uint32_t size, paddr_t align,
                          int first_mod);
 
+/* Modify some mappings after the init is done */
+void modify_after_init_mappings(void);
+
 #endif
 /*
  * Local variables:
diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
index 9b874f8ab2..d042f73597 100644
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -213,6 +213,21 @@ void __init remove_early_mappings(void)
     BUG_ON(rc);
 }
 
+void __init modify_after_init_mappings(void)
+{
+    /*
+     * We have finished booting. Mark the section .data.ro_after_init
+     * read-only.
+     */
+    int rc = modify_xen_mappings((unsigned long)&__ro_after_init_start,
+                                 (unsigned long)&__ro_after_init_end,
+                                 PAGE_HYPERVISOR_RO);
+
+    if ( rc )
+        panic("Unable to mark the .data.ro_after_init section read-only (rc = %d)\n",
+              rc);
+}
+
 /*
  * After boot, Xen page-tables should not contain mapping that are both
  * Writable and eXecutables.
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index cfd75abdb0..6b3b0b06e9 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -35,7 +35,7 @@ DECLARE_BITMAP(xen_mpumap_mask, MAX_MPU_REGION_NR) \
 /* EL2 Xen MPU memory region mapping table. */
 pr_t __cacheline_aligned __section(".data") xen_mpumap[MAX_MPU_REGION_NR];
 
-static DEFINE_SPINLOCK(xen_mpumap_lock);
+DEFINE_SPINLOCK(xen_mpumap_lock);
 
 static void __init __maybe_unused build_assertions(void)
 {
diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
index ec264f54f2..55317ee318 100644
--- a/xen/arch/arm/mpu/setup.c
+++ b/xen/arch/arm/mpu/setup.c
@@ -8,11 +8,14 @@
 #include <xen/pfn.h>
 #include <xen/types.h>
 #include <xen/sizes.h>
+#include <xen/spinlock.h>
 #include <asm/setup.h>
 
 static paddr_t __initdata mapped_fdt_base = INVALID_PADDR;
 static paddr_t __initdata mapped_fdt_limit = INVALID_PADDR;
 
+extern spinlock_t xen_mpumap_lock;
+
 void __init setup_pagetables(void) {}
 
 void * __init early_fdt_map(paddr_t fdt_paddr)
@@ -106,6 +109,43 @@ void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
         panic("Unable to unmap range for copy_from_paddr\n");
 }
 
+void __init modify_after_init_mappings(void)
+{
+    int rc;
+    uint8_t idx_rodata;
+    uint8_t idx_rwdata;
+
+    spin_lock(&xen_mpumap_lock);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions,
+                                (unsigned long)_srodata,
+                                (unsigned long)_erodata,
+                                &idx_rodata);
+
+    if ( rc < MPUMAP_REGION_FOUND )
+        panic("Unable to find rodata section (rc = %d)\n", rc);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions,
+                                (unsigned long)__ro_after_init_start,
+                                (unsigned long)__init_begin,
+                                &idx_rwdata);
+
+    if ( rc < MPUMAP_REGION_FOUND )
+        panic("Unable to find rwdata section (rc = %d)\n", rc);
+
+    /* Shrink rwdata section to begin at __ro_after_init_end */
+    pr_set_base(&xen_mpumap[idx_rwdata], (unsigned long)__ro_after_init_end);
+
+    /* Extend rodata section to end at __ro_after_init_end */
+    pr_set_limit(&xen_mpumap[idx_rodata], (unsigned long)__ro_after_init_end);
+
+    write_protection_region(&xen_mpumap[idx_rwdata], idx_rwdata);
+    write_protection_region(&xen_mpumap[idx_rodata], idx_rodata);
+    context_sync_mpu();
+
+    spin_unlock(&xen_mpumap_lock);
+}
+
 void __init remove_early_mappings(void)
 {
     int rc = destroy_xen_mappings(round_pgdown(mapped_fdt_base),
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7ad870e382..6310a47d68 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -66,23 +66,12 @@ domid_t __read_mostly max_init_domid;
 
 static __used void noreturn init_done(void)
 {
-    int rc;
-
     /* Must be done past setting system_state. */
     unregister_init_virtual_region();
 
-    free_init_memory();
+    modify_after_init_mappings();
 
-    /*
-     * We have finished booting. Mark the section .data.ro_after_init
-     * read-only.
-     */
-    rc = modify_xen_mappings((unsigned long)&__ro_after_init_start,
-                             (unsigned long)&__ro_after_init_end,
-                             PAGE_HYPERVISOR_RO);
-    if ( rc )
-        panic("Unable to mark the .data.ro_after_init section read-only (rc = %d)\n",
-              rc);
+    free_init_memory();
 
     startup_cpu_idle_loop();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 08:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 08:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206304.1519953 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfRj-0006qP-H9; Fri, 16 Jan 2026 08:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206304.1519953; Fri, 16 Jan 2026 08: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 1vgfRj-0006qH-EX; Fri, 16 Jan 2026 08:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1206304;
 Fri, 16 Jan 2026 08: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 1vgfRi-0006qB-Ao
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 08: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 1vgfRi-006ITH-24
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgfRi-005gGc-0u
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08: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=TpviIdKbtHyI7RybcliCJqQVqjKB3mR5Fa6ohczrFDM=; b=R6MoJDkgD/z460Om3BfLfOXsHw
	xczdl4ZRzNusFmdiLVNvxrte6zwYf6l+TlrF+NBIOO+zGcrKdWo+MsQc7e21nFpfOvq1igXgUFzuX
	abKVGCpsM/7FefMniGUBawy5em8kw4xw3e4LSbfTByT9VjB2X3gB7A3Y8M0BEbBRV1bI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm: Use secure hypervisor timer in MPU system
Message-Id: <E1vgfRi-005gGc-0u@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 08:44:42 +0000

commit e232aa054ce197a6d9cc54796d09ba42a9b377ed
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed Jan 14 14:27:33 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm: Use secure hypervisor timer in MPU system
    
    As MPU systems only have one secure state, we have to use secure EL2
    hypervisor timer for Xen in secure EL2.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/arm64/sysregs.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index 7dfd20414d..19d409d3eb 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -462,6 +462,17 @@
 #define ZCR_ELx_LEN_SIZE             9
 #define ZCR_ELx_LEN_MASK             0x1ff
 
+#ifdef CONFIG_MPU
+/*
+ * The Armv8-R AArch64 architecture always executes code in Secure
+ * state with EL2 as the highest exception level.
+ *
+ * Hypervisor timer registers for Secure EL2.
+ */
+#define CNTHP_CTL_EL2   CNTHPS_CTL_EL2
+#define CNTHP_CVAL_EL2  CNTHPS_CVAL_EL2
+#endif
+
 #define REGION_TEXT_PRBAR       0x38    /* SH=11 AP=10 XN=00 */
 #define REGION_RO_PRBAR         0x3A    /* SH=11 AP=10 XN=10 */
 #define REGION_DATA_PRBAR       0x32    /* SH=11 AP=00 XN=10 */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 08:44:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 08:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206305.1519957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfRt-0006sU-IV; Fri, 16 Jan 2026 08:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206305.1519957; Fri, 16 Jan 2026 08: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 1vgfRt-0006sM-Fr; Fri, 16 Jan 2026 08:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1206305;
 Fri, 16 Jan 2026 08: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 1vgfRs-0006sE-E3
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 08: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 1vgfRs-006ITN-2N
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgfRs-005gIl-19
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08: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=JHSz8sItJ7k98cnGRYAEcXheUutXbt3bNLLZmgnhEyg=; b=XELQruFrQ+N/8odWXYHD5p5goT
	9A8mc4DDUxezQQf9VPrf+rzLnVkWGygHqPc0MeEoZTUs2k35jtCWqKSZSwxaIyiCHNHlRm+zDhquD
	eu19IG2eHfbeao35aZpv/5l/mjNj1+/FBOCqHUZsPLoJ56WgsvPVlVjVk2EWryN6gA7I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Map domain page in MPU systems
Message-Id: <E1vgfRs-005gIl-19@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 08:44:52 +0000

commit 4b3cad91a13a03f4c2e03e9147a42949df33ee57
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed Jan 14 14:27:34 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Map domain page in MPU systems
    
    In MPU systems, we implement map_domain_page()/unmap_domain_page()
    through mapping the domain page with a MPU region on demand.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig           |  1 +
 xen/arch/arm/mpu/Makefile      |  1 +
 xen/arch/arm/mpu/domain-page.c | 46 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index cf6af68299..0d81a4d8b4 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -91,6 +91,7 @@ config MMU
 
 config MPU
 	bool "MPU" if UNSUPPORTED
+	select ARCH_MAP_DOMAIN_PAGE
 	select STATIC_MEMORY
 	help
 	  Memory Protection Unit (MPU). Select if you plan to run Xen on ARMv8-R
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index 4963c8b550..3327fadd5d 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_ARM_32) += arm32/
 obj-$(CONFIG_ARM_64) += arm64/
+obj-y += domain-page.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += setup.init.o
diff --git a/xen/arch/arm/mpu/domain-page.c b/xen/arch/arm/mpu/domain-page.c
new file mode 100644
index 0000000000..b79afc493b
--- /dev/null
+++ b/xen/arch/arm/mpu/domain-page.c
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/domain_page.h>
+#include <xen/mm.h>
+#include <xen/mm-frame.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+
+void *map_domain_page_global(mfn_t mfn)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/* Map a page of domheap memory */
+void *map_domain_page(mfn_t mfn)
+{
+    return vmap_contig(mfn, 1);
+}
+
+/* Release a mapping taken with map_domain_page() */
+void unmap_domain_page(const void *ptr)
+{
+    vunmap(ptr);
+}
+
+mfn_t domain_page_map_to_mfn(const void *ptr)
+{
+    BUG_ON("unimplemented");
+    return INVALID_MFN;
+}
+
+void unmap_domain_page_global(const void *va)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 08:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 08:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206306.1519961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vgfS4-0006uf-Jt; Fri, 16 Jan 2026 08:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206306.1519961; Fri, 16 Jan 2026 08: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 1vgfS4-0006uX-HH; Fri, 16 Jan 2026 08:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1206306;
 Fri, 16 Jan 2026 08: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 1vgfS2-0006uO-HL
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 08: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 1vgfS2-006ITn-2i
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vgfS2-005gKX-1S
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 08: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=moqSK6yxoYEdEqRu5IJO0r9LPJoQ4pKGLQA26pFPV1I=; b=nLnYJMmEpnSKMpYZpZ0nBLO92R
	kZZ+HudqF3WYVspF6mJtVOlm0Y7QMuHAQ+6gj+fWn/35g/UKELMEA7i1sEK35/tdGG9JsnfEsl+Zx
	ZlPz1+XzYK3c/GUXAExvfuOGT7hSaS4TtA0DDl7feVW/SekN8XBrIiFSyNkkvG0wsBL0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Print correct domid in allocate_memory_11
Message-Id: <E1vgfS2-005gKX-1S@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 08:45:02 +0000

commit 7c02572c37eaafbb64bb498d6b4499db7365c7b4
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Mon Jan 12 11:42:32 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    xen/arm: Print correct domid in allocate_memory_11
    
    allocate_memory_11() can be called for dom0 and direct-mapped hwdom
    domU. In the latter scenario, a log message would still mention dom0
    instead of the correct domid.
    
    Fixes: 52cb53f1816a ("xen/arm: dom0less hwdom construction")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/domain_build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 986a456f17..e8795745dd 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -296,9 +296,9 @@ static void __init allocate_memory_11(struct domain *d,
      */
     BUG_ON(!is_domain_direct_mapped(d));
 
-    printk("Allocating 1:1 mappings totalling %ldMB for dom0:\n",
+    printk("Allocating 1:1 mappings totalling %ldMB for %pd:\n",
            /* Don't want format this as PRIpaddr (16 digit hex) */
-           (unsigned long)(kinfo->unassigned_mem >> 20));
+           (unsigned long)(kinfo->unassigned_mem >> 20), d);
 
     mem->nr_banks = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 10:00:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 10:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206354.1519969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggcn-0007Rp-Iq; Fri, 16 Jan 2026 10:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206354.1519969; Fri, 16 Jan 2026 10:00:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggcn-0007Rf-G2; Fri, 16 Jan 2026 10:00:13 +0000
Received: by outflank-mailman (input) for mailman id 1206354;
 Fri, 16 Jan 2026 10:00: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 1vggcl-0007RX-LS
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 10:00: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 1vggcl-006Jym-38
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggcl-005kz0-1v
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KipP8dk9I9taX6+ASCvQPO5nKbilIFjbHrIxhRWN2/0=; b=w7doJf9Sqrz8pkjx4pjTLbKm0S
	2I1WjHUXBuseRKSKh/kavRovAm4FTih7QBlYLb5qKCIc4TW8MR2Y+xvPZhPYbwdWAEetKH82cqJWR
	LHibBAaLCzVdihbCX+qEGAZMQaoTJcA02tZqBOAWze9ygXtIcVJ7KOKdrDWhNR2iMTiQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Implement vmap functions for MPU
Message-Id: <E1vggcl-005kz0-1v@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 10:00:11 +0000

commit da0c03b66c67f00f74d35b10f0ab9df1b0f7410a
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Wed Jan 14 14:27:30 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Implement vmap functions for MPU
    
    HAS_VMAP is not enabled on MPU systems, but the vmap functions are used
    in places across common code. In order to keep the existing code and
    maintain correct functionality, implement the `vmap_contig` and `vunmap`
    functions for MPU systems.
    
    Introduce a helper function `destroy_xen_mapping_containing` to aid with
    unmapping an entire region when only the start address is known.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/mpu/mm.h | 10 +++++
 xen/arch/arm/mpu/mm.c             | 83 +++++++++++++++++++++++++++++++++------
 xen/arch/arm/mpu/vmap.c           | 14 +++++--
 3 files changed, 92 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
index e1ded6521d..1b5ffa5b64 100644
--- a/xen/arch/arm/include/asm/mpu/mm.h
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -111,6 +111,16 @@ pr_t pr_of_addr(paddr_t base, paddr_t limit, unsigned int flags);
 int mpumap_contains_region(pr_t *table, uint8_t nr_regions, paddr_t base,
                            paddr_t limit, uint8_t *index);
 
+
+/*
+ * Destroys and frees (if reference count is 0) an entire xen mapping on MPU
+ * systems where only the start address is known.
+ *
+ * @param s     Start address of memory region to be destroyed.
+ * @return:     0 on success, negative on error.
+ */
+int destroy_xen_mapping_containing(paddr_t s);
+
 #endif /* __ARM_MPU_MM_H__ */
 
 /*
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 687dec3bc6..5e19ffde4c 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -290,6 +290,43 @@ static void disable_mpu_region_from_index(uint8_t index)
         write_protection_region(&xen_mpumap[index], index);
 }
 
+/*
+ * Free a xen_mpumap entry given the index. A mpu region is actually disabled
+ * when the refcount is 0 and the region type is MPUMAP_REGION_FOUND.
+ *
+ * @param idx                   Index of the mpumap entry.
+ * @param region_found_type     MPUMAP_REGION_* value.
+ * @return                      0 on success, otherwise negative on error.
+ */
+static int xen_mpumap_free_entry(uint8_t idx, int region_found_type)
+{
+    ASSERT(spin_is_locked(&xen_mpumap_lock));
+    ASSERT(idx != INVALID_REGION_IDX);
+    ASSERT(MPUMAP_REGION_OVERLAP != region_found_type);
+
+    if ( MPUMAP_REGION_NOTFOUND == region_found_type )
+    {
+        printk(XENLOG_ERR "Cannot remove entry that does not exist\n");
+        return -EINVAL;
+    }
+
+    if ( xen_mpumap[idx].refcount )
+    {
+        xen_mpumap[idx].refcount -= 1;
+        return 0;
+    }
+
+    if ( MPUMAP_REGION_FOUND != region_found_type )
+    {
+        printk(XENLOG_ERR "Cannot remove a partial region\n");
+        return -EINVAL;
+    }
+
+    disable_mpu_region_from_index(idx);
+
+    return 0;
+}
+
 /*
  * Update the entry in the MPU memory region mapping table (xen_mpumap) for the
  * given memory range and flags, creating one if none exists.
@@ -357,18 +394,7 @@ static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
             return -EINVAL;
         }
 
-        if ( xen_mpumap[idx].refcount == 0 )
-        {
-            if ( MPUMAP_REGION_FOUND == rc )
-                disable_mpu_region_from_index(idx);
-            else
-            {
-                printk("Cannot remove a partial region\n");
-                return -EINVAL;
-            }
-        }
-        else
-            xen_mpumap[idx].refcount -= 1;
+        return xen_mpumap_free_entry(idx, rc);
     }
 
     return 0;
@@ -418,6 +444,39 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
     return xen_mpumap_update(s, e, 0);
 }
 
+int destroy_xen_mapping_containing(paddr_t s)
+{
+    int rc;
+    uint8_t idx;
+
+    ASSERT(IS_ALIGNED(s, PAGE_SIZE));
+
+    spin_lock(&xen_mpumap_lock);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions, s, s + PAGE_SIZE,
+                                &idx);
+
+    /*
+     * Since only entire regions can be freed using `xen_mpumap_free_entry` we
+     * must first check the region exists.
+     */
+    if ( MPUMAP_REGION_NOTFOUND == rc )
+    {
+        printk(XENLOG_ERR "Cannot remove entry that does not exist");
+        rc = -EINVAL;
+        goto out;
+    }
+
+    /* As we are unmapping entire region use MPUMAP_REGION_FOUND instead */
+    rc = xen_mpumap_free_entry(idx, MPUMAP_REGION_FOUND);
+    if ( !rc )
+        context_sync_mpu();
+ out:
+    spin_unlock(&xen_mpumap_lock);
+
+    return rc;
+}
+
 int map_pages_to_xen(unsigned long virt, mfn_t mfn, unsigned long nr_mfns,
                      unsigned int flags)
 {
diff --git a/xen/arch/arm/mpu/vmap.c b/xen/arch/arm/mpu/vmap.c
index f977b79cd4..54d949e7ce 100644
--- a/xen/arch/arm/mpu/vmap.c
+++ b/xen/arch/arm/mpu/vmap.c
@@ -1,19 +1,27 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
 #include <xen/bug.h>
+#include <xen/mm.h>
 #include <xen/mm-frame.h>
 #include <xen/types.h>
 #include <xen/vmap.h>
 
 void *vmap_contig(mfn_t mfn, unsigned int nr)
 {
-    BUG_ON("unimplemented");
-    return NULL;
+    paddr_t base = mfn_to_maddr(mfn);
+
+    if ( map_pages_to_xen(base, mfn, nr, PAGE_HYPERVISOR ) )
+        return NULL;
+
+    return maddr_to_virt(base);
 }
 
 void vunmap(const void *va)
 {
-    BUG_ON("unimplemented");
+    paddr_t base = virt_to_maddr(va);
+
+    if ( destroy_xen_mapping_containing(base) )
+        panic("Failed to vunmap region\n");
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 10:00:16 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 10:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206353.1519965 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggcd-0006oQ-HR; Fri, 16 Jan 2026 10:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206353.1519965; Fri, 16 Jan 2026 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 1vggcd-0006nM-Ej; Fri, 16 Jan 2026 10:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1206353;
 Fri, 16 Jan 2026 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 1vggcb-0006Nr-Ju
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 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 1vggcb-006Jwe-2q
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggcb-005kxb-1Z
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 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=+hG/y9f3vFsevNTuxNk/6jGWYAKce7pKl3JxqAJ6aXE=; b=BfvGnroV2ZoP7VEfeuSkCQ2HTI
	nH9vMKBFKXOO8NAvWC9jM5OGU0UpOZCrhgnhWorEbBzwSa349G+4lQJjTw+L2oME87MgLNDkBZxni
	fyNlW5mjPXTa7gDDOZuNNF+hya+OyvFG8uBk/dK7AwWSuqF5Opy1Hwgp7AGYHA9Op3qI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Implement copy_from_paddr for MPU systems
Message-Id: <E1vggcb-005kxb-1Z@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 10:00:01 +0000

commit 38bd76197ce655adb590478fc576a1674c3f19fe
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Wed Jan 14 14:27:29 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Implement copy_from_paddr for MPU systems
    
    Implement the function copy_from_paddr variant for MPU systems, using
    the map_pages_to_xen/destroy_xen_mappings to temporarily map the memory
    range to be copied.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/mpu/setup.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
index 163573b932..ec264f54f2 100644
--- a/xen/arch/arm/mpu/setup.c
+++ b/xen/arch/arm/mpu/setup.c
@@ -91,7 +91,19 @@ void * __init early_fdt_map(paddr_t fdt_paddr)
  */
 void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
 {
-    BUG_ON("unimplemented");
+    paddr_t start_pg = round_pgdown(paddr);
+    paddr_t end_pg   = round_pgup(paddr + len);
+    unsigned long nr_mfns = (end_pg - start_pg) >> PAGE_SHIFT;
+    mfn_t mfn = maddr_to_mfn(start_pg);
+
+    if ( map_pages_to_xen(start_pg, mfn, nr_mfns, PAGE_HYPERVISOR_WC) )
+        panic("Unable to map range for copy_from_paddr\n");
+
+    memcpy(dst, maddr_to_virt(paddr), len);
+    clean_dcache_va_range(dst, len);
+
+    if ( destroy_xen_mappings(start_pg, end_pg) )
+        panic("Unable to unmap range for copy_from_paddr\n");
 }
 
 void __init remove_early_mappings(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 10:00:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 10:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206355.1519973 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggcx-0007V3-LM; Fri, 16 Jan 2026 10:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206355.1519973; Fri, 16 Jan 2026 10:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggcx-0007Uu-IY; Fri, 16 Jan 2026 10:00:23 +0000
Received: by outflank-mailman (input) for mailman id 1206355;
 Fri, 16 Jan 2026 10:00: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 1vggcv-0007UU-OF
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 10:00: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 1vggcw-006Jys-0B
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggcv-005kzq-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oZptd0YXikO72uqpyrWrBaPIse2rURt4O1rs1afJCgA=; b=pFOQISEmJloG0BSanILJwohX9h
	t0a7GDPH6mJc4jB+lCh1YzahXUTgP3TexwlHGS8UHUtA04lbnyYG7F9Z9DJO9PohHjfb3Spd5KbG6
	fJ0EKFGdRfuTTcMqlIwojhtXvW8ef+jUtbKTlgHyiJ9g/SVy3xamlFWq4pWi/wMnea84=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Implement free_init_memory for MPU systems
Message-Id: <E1vggcv-005kzq-2D@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 10:00:21 +0000

commit 342ac31d1f287e5de1ebc276a23ae53e97a0b0ea
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed Jan 14 14:27:31 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Implement free_init_memory for MPU systems
    
    Implement the function `free_init_memory` for MPU systems. In order to
    support this, the function `modify_xen_mappings` is implemented.
    
    On MPU systems, we map the init text and init data sections using
    separate MPU memory regions. Therefore these are removed separately in
    `free_init_memory`.
    
    Additionally remove warning messages from `is_mm_attr_match` as some
    attributes can now be updated by `xen_mpumap_update_entry`.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/setup.h |   2 +
 xen/arch/arm/mpu/mm.c            | 119 ++++++++++++++++++++++++++++++---------
 2 files changed, 93 insertions(+), 28 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 1eaf13bd66..005cf7be59 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -65,6 +65,8 @@ int map_irq_to_domain(struct domain *d, unsigned int irq,
 int map_range_to_domain(const struct dt_device_node *dev,
                         uint64_t addr, uint64_t len, void *data);
 
+extern const char __init_data_begin[], __bss_start[], __bss_end[];
+
 struct init_info
 {
     /* Pointer to the stack, used by head.S when entering in C */
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index 5e19ffde4c..cfd75abdb0 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -15,6 +15,9 @@
 #include <asm/setup.h>
 #include <asm/sysregs.h>
 
+#define MPU_ATTR_XN_RO_MISMATCH     -1
+#define MPU_ATTR_AI_MISMATCH        -2
+
 struct page_info *frame_table;
 
 /* Maximum number of supported MPU memory regions by the EL2 MPU. */
@@ -171,33 +174,16 @@ int mpumap_contains_region(pr_t *table, uint8_t nr_regions, paddr_t base,
     return MPUMAP_REGION_NOTFOUND;
 }
 
-static bool is_mm_attr_match(pr_t *region, unsigned int attributes)
+static int is_mm_attr_match(pr_t *region, unsigned int attributes)
 {
-    if ( region->prbar.reg.ro != PAGE_RO_MASK(attributes) )
-    {
-        printk(XENLOG_WARNING
-               "Mismatched Access Permission attributes (%#x instead of %#x)\n",
-               region->prbar.reg.ro, PAGE_RO_MASK(attributes));
-        return false;
-    }
-
-    if ( region->prbar.reg.xn != PAGE_XN_MASK(attributes) )
-    {
-        printk(XENLOG_WARNING
-               "Mismatched Execute Never attributes (%#x instead of %#x)\n",
-               region->prbar.reg.xn, PAGE_XN_MASK(attributes));
-        return false;
-    }
+    if ( (region->prbar.reg.xn != PAGE_XN_MASK(attributes)) ||
+         (region->prbar.reg.ro != PAGE_RO_MASK(attributes)) )
+        return MPU_ATTR_XN_RO_MISMATCH;
 
     if ( region->prlar.reg.ai != PAGE_AI_MASK(attributes) )
-    {
-        printk(XENLOG_WARNING
-               "Mismatched Memory Attribute Index (%#x instead of %#x)\n",
-               region->prlar.reg.ai, PAGE_AI_MASK(attributes));
-        return false;
-    }
+        return MPU_ATTR_AI_MISMATCH;
 
-    return true;
+    return 0;
 }
 
 /* Map a frame table to cover physical addresses ps through pe */
@@ -358,12 +344,44 @@ static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
     */
     if ( flags_has_page_present && (rc >= MPUMAP_REGION_FOUND) )
     {
-        if ( !is_mm_attr_match(&xen_mpumap[idx], flags) )
+        int attr_match = is_mm_attr_match(&xen_mpumap[idx], flags);
+
+        /* We do not support modifying AI attribute. */
+        if ( MPU_ATTR_AI_MISMATCH == attr_match )
         {
-            printk("Modifying an existing entry is not supported\n");
+            printk(XENLOG_ERR
+                   "Modifying AI attribute is not supported\n");
             return -EINVAL;
         }
 
+        /*
+         * Attributes RO and XN can be changed only by the full region.
+         * Attributes that match can continue and just increment refcount.
+         */
+        if ( MPU_ATTR_XN_RO_MISMATCH == attr_match )
+        {
+            if ( rc == MPUMAP_REGION_INCLUSIVE )
+            {
+                printk(XENLOG_ERR
+                       "Cannot modify partial region attributes\n");
+                return -EINVAL;
+            }
+
+            if ( xen_mpumap[idx].refcount != 0 )
+            {
+                printk(XENLOG_ERR
+                       "Cannot modify RO,XN attributes for a region mapped multiple times\n");
+                return -EINVAL;
+            }
+
+            /* Set new attributes */
+            xen_mpumap[idx].prbar.reg.ro = PAGE_RO_MASK(flags);
+            xen_mpumap[idx].prbar.reg.xn = PAGE_XN_MASK(flags);
+
+            write_protection_region(&xen_mpumap[idx], idx);
+            return 0;
+        }
+
         /* Check for overflow of refcount before incrementing.  */
         if ( xen_mpumap[idx].refcount == 0xFF )
         {
@@ -515,8 +533,7 @@ void __init setup_mm_helper(void)
 
 int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
 {
-    BUG_ON("unimplemented");
-    return -EINVAL;
+    return xen_mpumap_update(s, e, nf);
 }
 
 void dump_hyp_walk(vaddr_t addr)
@@ -527,7 +544,53 @@ void dump_hyp_walk(vaddr_t addr)
 /* Release all __init and __initdata ranges to be reused */
 void free_init_memory(void)
 {
-    BUG_ON("unimplemented");
+    unsigned long inittext_end = (unsigned long)__init_data_begin;
+    unsigned long len = __init_end - __init_begin;
+    uint8_t idx;
+    int rc;
+
+    /* Modify inittext region to be read/write instead of read/execute. */
+    rc = modify_xen_mappings((unsigned long)__init_begin, inittext_end,
+                             PAGE_HYPERVISOR_RW);
+    if ( rc )
+        panic("Unable to map RW the init text section (rc = %d)\n", rc);
+
+    /*
+     * From now on, init will not be used for execution anymore,
+     * so nuke the instruction cache to remove entries related to init.
+     */
+    invalidate_icache_local();
+
+    /*
+     * The initdata region already has read/write permissions so it can just be
+     * zeroed out.
+     */
+    memset(__init_begin, 0, len);
+
+    rc = destroy_xen_mappings((unsigned long)__init_begin, inittext_end);
+    if ( rc )
+        panic("Unable to remove init text section (rc = %d)\n", rc);
+
+    /*
+     * The initdata and bss sections are mapped using a single MPU region, so
+     * modify the start of this region to remove the initdata section.
+     */
+    spin_lock(&xen_mpumap_lock);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions,
+                                (unsigned long)__init_data_begin,
+                                (unsigned long)__bss_end,
+                                &idx);
+    if ( rc < MPUMAP_REGION_FOUND )
+        panic("Unable to find bss data section (rc = %d)\n", rc);
+
+    /* bss data section is shrunk and now starts from __bss_start */
+    pr_set_base(&xen_mpumap[idx], (unsigned long)__bss_start);
+
+    write_protection_region(&xen_mpumap[idx], idx);
+    context_sync_mpu();
+
+    spin_unlock(&xen_mpumap_lock);
 }
 
 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 10:00:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 10:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206356.1519976 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggd7-0007X1-Mr; Fri, 16 Jan 2026 10:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206356.1519976; Fri, 16 Jan 2026 10:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggd7-0007Wt-Jw; Fri, 16 Jan 2026 10:00:33 +0000
Received: by outflank-mailman (input) for mailman id 1206356;
 Fri, 16 Jan 2026 10:00: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 1vggd5-0007Wh-SG
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 10:00: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 1vggd6-006Jyw-0W
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggd5-005l0M-2V
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vLOAcacORmlF1tm/okcwXS/L8V/UJK/6nMV6Y78IRYc=; b=fx/lY0k4Uh0QlcZGu6WxcwnSeN
	ZAh5s0ENQFeSMhS0WobjwhIvjdbihxqunDptzgWpnOGiukpr5qIdqFvXBSv/h/Tj9YCBfk2SydLk2
	TNxL6n4JQD95eutRErEF73E8SYajI3DsZFhVAkb7ffDxgg8FXaoZfjDiOghhGEyihj+Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Introduce modify_after_init_mappings
Message-Id: <E1vggd5-005l0M-2V@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 10:00:31 +0000

commit 2dbdf8607c94b54f51670bf5a89d1dd0f0dbf5c1
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Wed Jan 14 14:27:32 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Introduce modify_after_init_mappings
    
    During `init_done`, Xen sets the permissions of all symbols marked with
    __ro_after_init to be read-only. This does not work on MPU systems at
    present because part-region modification is not supported.
    
    Therefore introduce the function `modify_after_init_mappings` for MMU
    and MPU, to handle the divergent approaches to setting permissions of
    __ro_after_init symbols.
    
    For MPU systems `modify_xen_mappings` will shrink the RW mapping on one
    side and extend the RO mapping on the other. This approach prevents
    wasting an additional region between RW and RO mappings.
    
    As the new function is marked with __init, it needs to be called before
    `free_init_memory`.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/setup.h |  3 +++
 xen/arch/arm/mmu/setup.c         | 15 +++++++++++++++
 xen/arch/arm/mpu/mm.c            |  2 +-
 xen/arch/arm/mpu/setup.c         | 40 ++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/setup.c             | 15 ++-------------
 5 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 005cf7be59..899e33925c 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -78,6 +78,9 @@ struct init_info
 paddr_t consider_modules(paddr_t s, paddr_t e, uint32_t size, paddr_t align,
                          int first_mod);
 
+/* Modify some mappings after the init is done */
+void modify_after_init_mappings(void);
+
 #endif
 /*
  * Local variables:
diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
index 9b874f8ab2..d042f73597 100644
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -213,6 +213,21 @@ void __init remove_early_mappings(void)
     BUG_ON(rc);
 }
 
+void __init modify_after_init_mappings(void)
+{
+    /*
+     * We have finished booting. Mark the section .data.ro_after_init
+     * read-only.
+     */
+    int rc = modify_xen_mappings((unsigned long)&__ro_after_init_start,
+                                 (unsigned long)&__ro_after_init_end,
+                                 PAGE_HYPERVISOR_RO);
+
+    if ( rc )
+        panic("Unable to mark the .data.ro_after_init section read-only (rc = %d)\n",
+              rc);
+}
+
 /*
  * After boot, Xen page-tables should not contain mapping that are both
  * Writable and eXecutables.
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index cfd75abdb0..6b3b0b06e9 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -35,7 +35,7 @@ DECLARE_BITMAP(xen_mpumap_mask, MAX_MPU_REGION_NR) \
 /* EL2 Xen MPU memory region mapping table. */
 pr_t __cacheline_aligned __section(".data") xen_mpumap[MAX_MPU_REGION_NR];
 
-static DEFINE_SPINLOCK(xen_mpumap_lock);
+DEFINE_SPINLOCK(xen_mpumap_lock);
 
 static void __init __maybe_unused build_assertions(void)
 {
diff --git a/xen/arch/arm/mpu/setup.c b/xen/arch/arm/mpu/setup.c
index ec264f54f2..55317ee318 100644
--- a/xen/arch/arm/mpu/setup.c
+++ b/xen/arch/arm/mpu/setup.c
@@ -8,11 +8,14 @@
 #include <xen/pfn.h>
 #include <xen/types.h>
 #include <xen/sizes.h>
+#include <xen/spinlock.h>
 #include <asm/setup.h>
 
 static paddr_t __initdata mapped_fdt_base = INVALID_PADDR;
 static paddr_t __initdata mapped_fdt_limit = INVALID_PADDR;
 
+extern spinlock_t xen_mpumap_lock;
+
 void __init setup_pagetables(void) {}
 
 void * __init early_fdt_map(paddr_t fdt_paddr)
@@ -106,6 +109,43 @@ void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
         panic("Unable to unmap range for copy_from_paddr\n");
 }
 
+void __init modify_after_init_mappings(void)
+{
+    int rc;
+    uint8_t idx_rodata;
+    uint8_t idx_rwdata;
+
+    spin_lock(&xen_mpumap_lock);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions,
+                                (unsigned long)_srodata,
+                                (unsigned long)_erodata,
+                                &idx_rodata);
+
+    if ( rc < MPUMAP_REGION_FOUND )
+        panic("Unable to find rodata section (rc = %d)\n", rc);
+
+    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions,
+                                (unsigned long)__ro_after_init_start,
+                                (unsigned long)__init_begin,
+                                &idx_rwdata);
+
+    if ( rc < MPUMAP_REGION_FOUND )
+        panic("Unable to find rwdata section (rc = %d)\n", rc);
+
+    /* Shrink rwdata section to begin at __ro_after_init_end */
+    pr_set_base(&xen_mpumap[idx_rwdata], (unsigned long)__ro_after_init_end);
+
+    /* Extend rodata section to end at __ro_after_init_end */
+    pr_set_limit(&xen_mpumap[idx_rodata], (unsigned long)__ro_after_init_end);
+
+    write_protection_region(&xen_mpumap[idx_rwdata], idx_rwdata);
+    write_protection_region(&xen_mpumap[idx_rodata], idx_rodata);
+    context_sync_mpu();
+
+    spin_unlock(&xen_mpumap_lock);
+}
+
 void __init remove_early_mappings(void)
 {
     int rc = destroy_xen_mappings(round_pgdown(mapped_fdt_base),
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7ad870e382..6310a47d68 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -66,23 +66,12 @@ domid_t __read_mostly max_init_domid;
 
 static __used void noreturn init_done(void)
 {
-    int rc;
-
     /* Must be done past setting system_state. */
     unregister_init_virtual_region();
 
-    free_init_memory();
+    modify_after_init_mappings();
 
-    /*
-     * We have finished booting. Mark the section .data.ro_after_init
-     * read-only.
-     */
-    rc = modify_xen_mappings((unsigned long)&__ro_after_init_start,
-                             (unsigned long)&__ro_after_init_end,
-                             PAGE_HYPERVISOR_RO);
-    if ( rc )
-        panic("Unable to mark the .data.ro_after_init section read-only (rc = %d)\n",
-              rc);
+    free_init_memory();
 
     startup_cpu_idle_loop();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 10:00:42 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 10:00:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206357.1519982 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggdG-0007ZR-P7; Fri, 16 Jan 2026 10:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206357.1519982; Fri, 16 Jan 2026 10:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggdG-0007ZJ-LT; Fri, 16 Jan 2026 10:00:42 +0000
Received: by outflank-mailman (input) for mailman id 1206357;
 Fri, 16 Jan 2026 10:00: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 1vggdF-0007Z9-W2
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 10:00:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggdG-006JzG-0x
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggdF-005l0q-2p
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zWB+VGuDigifq1q1h2W6tcxtntOBgh5nefdeYaCwLeE=; b=1Bp49FmOqhYGbmz1qM5LrJFJid
	EVUk+ae2YDF9asrloo0TonIs7pR5g6zACbzNCMsz8tPvWDkF+mRtn8iUSW4lxVbDXHn8W62pdWFxv
	B14A/8Riv0EAU/yrVtScp2P9deLXJQgBN6hPlo+Q2oWRQREl/GD9ASUXy5EdtJt7/dU8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm: Use secure hypervisor timer in MPU system
Message-Id: <E1vggdF-005l0q-2p@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 10:00:41 +0000

commit e232aa054ce197a6d9cc54796d09ba42a9b377ed
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed Jan 14 14:27:33 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm: Use secure hypervisor timer in MPU system
    
    As MPU systems only have one secure state, we have to use secure EL2
    hypervisor timer for Xen in secure EL2.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/arm64/sysregs.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index 7dfd20414d..19d409d3eb 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -462,6 +462,17 @@
 #define ZCR_ELx_LEN_SIZE             9
 #define ZCR_ELx_LEN_MASK             0x1ff
 
+#ifdef CONFIG_MPU
+/*
+ * The Armv8-R AArch64 architecture always executes code in Secure
+ * state with EL2 as the highest exception level.
+ *
+ * Hypervisor timer registers for Secure EL2.
+ */
+#define CNTHP_CTL_EL2   CNTHPS_CTL_EL2
+#define CNTHP_CVAL_EL2  CNTHPS_CVAL_EL2
+#endif
+
 #define REGION_TEXT_PRBAR       0x38    /* SH=11 AP=10 XN=00 */
 #define REGION_RO_PRBAR         0x3A    /* SH=11 AP=10 XN=10 */
 #define REGION_DATA_PRBAR       0x32    /* SH=11 AP=00 XN=10 */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 10:00:52 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 10:00:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206358.1519985 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggdQ-0007bj-PS; Fri, 16 Jan 2026 10:00:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206358.1519985; Fri, 16 Jan 2026 10:00:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggdQ-0007bb-Ms; Fri, 16 Jan 2026 10:00:52 +0000
Received: by outflank-mailman (input) for mailman id 1206358;
 Fri, 16 Jan 2026 10:00: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 1vggdQ-0007bV-4B
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 10:00: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 1vggdQ-006JzM-1Q
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggdQ-005l1H-02
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:00:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PkR9+p9YTFZH+1QKcedMFaQaZSP9giifTFrUECGeBaE=; b=TJfpojliwznSWrrywKkbF2krnn
	5uOftHGXmLwySTjzi89jkCsgQGxQPmbeoaNYjBPTUqhX9Hhnhfby+HqN+u9/teXjFFtxltgr/E3jr
	10b+UDYrjTg2ssiHUoDoi3v3U8UN6yzCAromEP+CCcUeXtzETsTjB8Ubp0+w/pQ3+1mc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Map domain page in MPU systems
Message-Id: <E1vggdQ-005l1H-02@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 10:00:52 +0000

commit 4b3cad91a13a03f4c2e03e9147a42949df33ee57
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed Jan 14 14:27:34 2026 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    arm/mpu: Map domain page in MPU systems
    
    In MPU systems, we implement map_domain_page()/unmap_domain_page()
    through mapping the domain page with a MPU region on demand.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig           |  1 +
 xen/arch/arm/mpu/Makefile      |  1 +
 xen/arch/arm/mpu/domain-page.c | 46 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index cf6af68299..0d81a4d8b4 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -91,6 +91,7 @@ config MMU
 
 config MPU
 	bool "MPU" if UNSUPPORTED
+	select ARCH_MAP_DOMAIN_PAGE
 	select STATIC_MEMORY
 	help
 	  Memory Protection Unit (MPU). Select if you plan to run Xen on ARMv8-R
diff --git a/xen/arch/arm/mpu/Makefile b/xen/arch/arm/mpu/Makefile
index 4963c8b550..3327fadd5d 100644
--- a/xen/arch/arm/mpu/Makefile
+++ b/xen/arch/arm/mpu/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_ARM_32) += arm32/
 obj-$(CONFIG_ARM_64) += arm64/
+obj-y += domain-page.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += setup.init.o
diff --git a/xen/arch/arm/mpu/domain-page.c b/xen/arch/arm/mpu/domain-page.c
new file mode 100644
index 0000000000..b79afc493b
--- /dev/null
+++ b/xen/arch/arm/mpu/domain-page.c
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/domain_page.h>
+#include <xen/mm.h>
+#include <xen/mm-frame.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+
+void *map_domain_page_global(mfn_t mfn)
+{
+    BUG_ON("unimplemented");
+    return NULL;
+}
+
+/* Map a page of domheap memory */
+void *map_domain_page(mfn_t mfn)
+{
+    return vmap_contig(mfn, 1);
+}
+
+/* Release a mapping taken with map_domain_page() */
+void unmap_domain_page(const void *ptr)
+{
+    vunmap(ptr);
+}
+
+mfn_t domain_page_map_to_mfn(const void *ptr)
+{
+    BUG_ON("unimplemented");
+    return INVALID_MFN;
+}
+
+void unmap_domain_page_global(const void *va)
+{
+    BUG_ON("unimplemented");
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Jan 16 10:01:02 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Jan 2026 10:01:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1206359.1519988 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vggda-0007dy-Qk; Fri, 16 Jan 2026 10:01:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1206359.1519988; Fri, 16 Jan 2026 10:01: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 1vggda-0007dq-OD; Fri, 16 Jan 2026 10:01:02 +0000
Received: by outflank-mailman (input) for mailman id 1206359;
 Fri, 16 Jan 2026 10:01: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 1vggda-0007dk-8g
 for xen-changelog@lists.xenproject.org; Fri, 16 Jan 2026 10:01: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 1vggda-006Jzd-1f
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:01:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vggda-005l2H-0V
 for xen-changelog@lists.xenproject.org;
 Fri, 16 Jan 2026 10:01:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B6DxZIgo7bdAiK/UqjZCx4EEUGoZUIeN9AO56wat3LU=; b=Uo++jInccFX9Y+hA+u5+yL4ZYh
	R3IMuP0vaYYMg4+BqNE0Fjr3GMSLsWGUquctHiGVG+DdOhRQhejiER0/PtVB50dMOnCYK+aYOpspP
	grByF0peDiJuMk2/ghHOKg7qsrikTC9wXj3zHnwrw2HBLWsVZAi8hWaW3Kuj8a7eBP4w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Print correct domid in allocate_memory_11
Message-Id: <E1vggda-005l2H-0V@xenbits.xenproject.org>
Date: Fri, 16 Jan 2026 10:01:02 +0000

commit 7c02572c37eaafbb64bb498d6b4499db7365c7b4
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Mon Jan 12 11:42:32 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri Jan 16 09:38:30 2026 +0100

    xen/arm: Print correct domid in allocate_memory_11
    
    allocate_memory_11() can be called for dom0 and direct-mapped hwdom
    domU. In the latter scenario, a log message would still mention dom0
    instead of the correct domid.
    
    Fixes: 52cb53f1816a ("xen/arm: dom0less hwdom construction")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/domain_build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 986a456f17..e8795745dd 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -296,9 +296,9 @@ static void __init allocate_memory_11(struct domain *d,
      */
     BUG_ON(!is_domain_direct_mapped(d));
 
-    printk("Allocating 1:1 mappings totalling %ldMB for dom0:\n",
+    printk("Allocating 1:1 mappings totalling %ldMB for %pd:\n",
            /* Don't want format this as PRIpaddr (16 digit hex) */
-           (unsigned long)(kinfo->unassigned_mem >> 20));
+           (unsigned long)(kinfo->unassigned_mem >> 20), d);
 
     mem->nr_banks = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 10:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 10:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208057.1520273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZD-0002u8-Qn; Mon, 19 Jan 2026 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208057.1520273; Mon, 19 Jan 2026 10:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZD-0002u0-O7; Mon, 19 Jan 2026 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1208057;
 Mon, 19 Jan 2026 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 1vhmZB-0002ts-Ro
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 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 1vhmZC-00B6Q0-0Q
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhmZB-009uWr-2R
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 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=WVj1QQHfa+lUDwwybA5otptRd2VkcPUoIeDHsJBjkzE=; b=Kwn0FPPUzunrr4PQ96r8rBPIUD
	DSyQnfvVeWFux4JHgHhruaWMKRPtOlFPHhuXMFm9JKqCdya6ZOGznGoHuEC89ZCBhYuuSzhrrdJoZ
	ijI+/UypfMICw66UEFQ243WLuUTim1uM8B6RtVaWe9MXNKvbJ4y3hSU5PGUIQvE94xpc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/x86: move declaration from mem_access.h to altp2m.h
Message-Id: <E1vhmZB-009uWr-2R@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 10:33:01 +0000

commit 7304ee88d4b7a84b7d00edd72abe98e0b2130d60
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:36 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 09:14:58 2026 +0100

    xen/x86: move declaration from mem_access.h to altp2m.h
    
    Memory access and ALTP2M are two seperate features, and each could be
    controlled via VM_EVENT or ALTP2M. In order to avoid implicit declaration
    when ALTP2M=y and VM_EVENT=n on compiling hvm.o/altp2m.o, we move declaration
    of the following functions from <asm/mem_access.h> to <asm/altp2m.h>:
    - p2m_set_suppress_ve
    - p2m_set_suppress_ve_multi
    - p2m_get_suppress_ve
    Potential error on altp2m.c also breaks Misra Rule 8.4.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/include/asm/altp2m.h     | 10 ++++++++++
 xen/arch/x86/include/asm/mem_access.h | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/altp2m.h b/xen/arch/x86/include/asm/altp2m.h
index 8ecd74f363..9c1ac3cc26 100644
--- a/xen/arch/x86/include/asm/altp2m.h
+++ b/xen/arch/x86/include/asm/altp2m.h
@@ -46,6 +46,16 @@ void altp2m_vcpu_destroy(struct vcpu *v);
 int altp2m_vcpu_enable_ve(struct vcpu *v, gfn_t gfn);
 void altp2m_vcpu_disable_ve(struct vcpu *v);
 
+int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
+                        unsigned int altp2m_idx);
+
+struct xen_hvm_altp2m_suppress_ve_multi;
+int p2m_set_suppress_ve_multi(struct domain *d,
+                              struct xen_hvm_altp2m_suppress_ve_multi *sve);
+
+int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
+                        unsigned int altp2m_idx);
+
 #else
 
 static inline bool altp2m_is_eptp_valid(const struct domain *d,
diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 1a52a10322..257ed33de1 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -34,16 +34,6 @@ bool p2m_mem_access_emulate_check(struct vcpu *v,
 /* Sanity check for mem_access hardware support */
 bool p2m_mem_access_sanity_check(const struct domain *d);
 
-int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
-                        unsigned int altp2m_idx);
-
-struct xen_hvm_altp2m_suppress_ve_multi;
-int p2m_set_suppress_ve_multi(struct domain *d,
-                              struct xen_hvm_altp2m_suppress_ve_multi *sve);
-
-int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
-                        unsigned int altp2m_idx);
-
 #endif /*__ASM_X86_MEM_ACCESS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 10:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 10:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208058.1520276 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZN-0002vp-SD; Mon, 19 Jan 2026 10:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208058.1520276; Mon, 19 Jan 2026 10:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZN-0002vh-PV; Mon, 19 Jan 2026 10:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1208058;
 Mon, 19 Jan 2026 10:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vhmZM-0002vL-0k
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 10:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhmZM-00B6Q9-11
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhmZL-009uXY-2p
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=k3RXcN64pY7xh0BmX9Yx8ybEhvov4zjrfWU26v0sbtc=; b=s/wV4Up32Znqa6bFersquKQpml
	5j8I+l71I4OgLU99uDHicY3JrOBUBMHclPDKNGpgBOFCFfyjFvD8LnjajAiNodpY+vDw5/FWofmZB
	N4vRUmvRAF8dn52TtostuWEk6EGiXJGWv+MsUZRRl//XzGCxeCPa33N1A4SQMai7xgKA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vm_event: introduce vm_event_is_enabled()
Message-Id: <E1vhmZL-009uXY-2p@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 10:33:11 +0000

commit 0ea539000c1d2fa93318c715e8f24c829f79f055
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:37 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 09:15:35 2026 +0100

    x86/vm_event: introduce vm_event_is_enabled()
    
    Function vm_event_is_enabled() is introduced to check if vm event is enabled,
    and also make the checking conditional upon CONFIG_VM_EVENT, which could help
    DCE a lot unreachable calls/codes, such as hvm_monitor_io(), etc,
    when having VM_EVENT=n.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/emulate.c          |  9 +++---
 xen/arch/x86/hvm/hvm.c              | 23 ++++++++++----
 xen/arch/x86/hvm/svm/intr.c         |  2 +-
 xen/arch/x86/hvm/svm/svm.c          | 46 +++++++++++++++------------
 xen/arch/x86/hvm/vmx/intr.c         |  2 +-
 xen/arch/x86/hvm/vmx/vmx.c          | 63 ++++++++++++++++++++++---------------
 xen/arch/x86/include/asm/vm_event.h |  5 +++
 xen/arch/x86/mm/mem_sharing.c       |  3 ++
 8 files changed, 96 insertions(+), 57 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 2af4f30359..fe75b0516d 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -105,7 +105,7 @@ static int set_context_data(void *buffer, unsigned int size)
 {
     struct vcpu *curr = current;
 
-    if ( curr->arch.vm_event )
+    if ( vm_event_is_enabled(curr) )
     {
         unsigned int safe_size =
             min(size, curr->arch.vm_event->emul.read.size);
@@ -771,7 +771,7 @@ static void *hvmemul_map_linear_addr(
             ASSERT(p2mt == p2m_ram_logdirty || !p2m_is_readonly(p2mt));
         }
 
-        if ( unlikely(curr->arch.vm_event) &&
+        if ( unlikely(vm_event_is_enabled(curr)) &&
              curr->arch.vm_event->send_event &&
              hvm_monitor_check_p2m(addr, gfn, pfec, npfec_kind_with_gla) )
         {
@@ -1863,16 +1863,17 @@ static int hvmemul_rep_outs_set_context(
     unsigned int bytes_per_rep,
     unsigned long *reps)
 {
-    const struct arch_vm_event *ev = current->arch.vm_event;
+    const struct arch_vm_event *ev;
     const uint8_t *ptr;
     unsigned int avail;
     unsigned long done;
     int rc = X86EMUL_OKAY;
 
     ASSERT(bytes_per_rep <= 4);
-    if ( !ev )
+    if ( !vm_event_is_enabled(current) )
         return X86EMUL_UNHANDLEABLE;
 
+    ev = current->arch.vm_event;
     ptr = ev->emul.read.data;
     avail = ev->emul.read.size;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 0eafa515bb..07e54890d9 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -532,7 +532,7 @@ void hvm_do_resume(struct vcpu *v)
     if ( !vcpu_ioreq_handle_completion(v) )
         return;
 
-    if ( unlikely(v->arch.vm_event) )
+    if ( unlikely(vm_event_is_enabled(v)) )
         hvm_vm_event_do_resume(v);
 
     /* Inject pending hw/sw event */
@@ -546,7 +546,8 @@ void hvm_do_resume(struct vcpu *v)
         v->arch.hvm.inject_event.vector = HVM_EVENT_VECTOR_UNSET;
     }
 
-    if ( unlikely(v->arch.vm_event) && v->arch.monitor.next_interrupt_enabled )
+    if ( unlikely(vm_event_is_enabled(v)) &&
+         v->arch.monitor.next_interrupt_enabled )
     {
         struct x86_event info;
 
@@ -2095,7 +2096,7 @@ int hvm_handle_xsetbv(u32 index, u64 new_bv)
 {
     int rc;
 
-    if ( index == 0 )
+    if ( index == 0 && vm_event_is_enabled(current) )
         hvm_monitor_crX(XCR0, new_bv, current->arch.xcr0);
 
     rc = x86emul_write_xcr(index, new_bv, NULL);
@@ -2266,6 +2267,8 @@ int hvm_set_cr0(unsigned long value, bool may_defer)
 
     HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR0 value = %lx", value);
 
+    may_defer &= vm_event_is_enabled(v);
+
     if ( (u32)value != value )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
@@ -2401,6 +2404,8 @@ int hvm_set_cr3(unsigned long value, bool noflush, bool may_defer)
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
 
+    may_defer &= vm_event_is_enabled(curr);
+
     if ( value >> currd->arch.cpuid->extd.maxphysaddr )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
@@ -2456,6 +2461,8 @@ int hvm_set_cr4(unsigned long value, bool may_defer)
     struct vcpu *v = current;
     unsigned long old_cr, valid = hvm_cr4_guest_valid_bits(v->domain);
 
+    may_defer &= vm_event_is_enabled(v);
+
     if ( value & ~valid )
     {
         HVM_DBG_LOG(DBG_LEVEL_1, "Bad CR4 %#lx (valid %#lx, rejected %#lx)",
@@ -3356,7 +3363,7 @@ static enum hvm_translation_result __hvm_copy(
             return HVMTRANS_bad_gfn_to_mfn;
         }
 
-        if ( unlikely(v->arch.vm_event) &&
+        if ( unlikely(vm_event_is_enabled(v)) &&
              (flags & HVMCOPY_linear) &&
              v->arch.vm_event->send_event &&
              hvm_monitor_check_p2m(addr, gfn, pfec, npfec_kind_with_gla) )
@@ -3503,7 +3510,9 @@ int hvm_vmexit_cpuid(struct cpu_user_regs *regs, unsigned int inst_len)
     regs->rcx = res.c;
     regs->rdx = res.d;
 
-    return hvm_monitor_cpuid(inst_len, leaf, subleaf);
+    return vm_event_is_enabled(curr)
+           ? hvm_monitor_cpuid(inst_len, leaf, subleaf)
+           : 0;
 }
 
 void hvm_rdtsc_intercept(struct cpu_user_regs *regs)
@@ -3635,6 +3644,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
 
     TRACE(TRC_HVM_MSR_WRITE, msr, msr_content, msr_content >> 32);
 
+    may_defer &= vm_event_is_enabled(v);
     if ( may_defer && unlikely(monitored_msr(v->domain, msr)) )
     {
         uint64_t msr_old_content;
@@ -3803,7 +3813,8 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
 
-    if ( currd->arch.monitor.descriptor_access_enabled )
+    if ( vm_event_is_enabled(curr) &&
+         currd->arch.monitor.descriptor_access_enabled )
     {
         ASSERT(curr->arch.vm_event);
         hvm_monitor_descriptor_access(exit_info, vmx_exit_qualification,
diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 702c071e89..6453a46b85 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -130,7 +130,7 @@ void asmlinkage svm_intr_assist(void)
     enum hvm_intblk intblk;
 
     /* Block event injection while handling a sync vm_event. */
-    if ( unlikely(v->arch.vm_event) && v->arch.vm_event->sync_event )
+    if ( unlikely(vm_event_is_enabled(v)) && v->arch.vm_event->sync_event )
         return;
 
     /* Crank the handle on interrupt state. */
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 564337bb4e..21f355a657 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -35,6 +35,7 @@
 #include <asm/p2m.h>
 #include <asm/paging.h>
 #include <asm/processor.h>
+#include <asm/vm_event.h>
 #include <asm/x86_emulate.h>
 
 #include <public/sched.h>
@@ -2702,7 +2703,7 @@ void asmlinkage svm_vmexit_handler(void)
         if ( !v->domain->debugger_attached )
         {
             unsigned int trap_type;
-            int rc;
+            int rc = 0;
 
             if ( likely(exit_reason != VMEXIT_ICEBP) )
             {
@@ -2718,11 +2719,14 @@ void asmlinkage svm_vmexit_handler(void)
                     break;
             }
 
-            rc = hvm_monitor_debug(regs->rip,
-                                   HVM_MONITOR_DEBUG_EXCEPTION,
-                                   trap_type, insn_len, 0);
-            if ( rc < 0 )
-                goto unexpected_exit_type;
+            if ( vm_event_is_enabled(v) )
+            {
+                rc = hvm_monitor_debug(regs->rip,
+                                       HVM_MONITOR_DEBUG_EXCEPTION,
+                                       trap_type, insn_len, 0);
+                if ( rc < 0 )
+                    goto unexpected_exit_type;
+            }
             if ( !rc )
                 hvm_inject_exception(X86_EXC_DB,
                                      trap_type, insn_len, X86_EVENT_NO_EC);
@@ -2746,9 +2750,10 @@ void asmlinkage svm_vmexit_handler(void)
         }
         else
         {
-            int rc = hvm_monitor_debug(regs->rip,
-                                       HVM_MONITOR_SOFTWARE_BREAKPOINT,
-                                       X86_ET_SW_EXC, insn_len, 0);
+            int rc = vm_event_is_enabled(v) ?
+                        hvm_monitor_debug(regs->rip,
+                                          HVM_MONITOR_SOFTWARE_BREAKPOINT,
+                                          X86_ET_SW_EXC, insn_len, 0) : 0;
             if ( rc < 0 )
                 goto unexpected_exit_type;
             if ( !rc )
@@ -2899,17 +2904,19 @@ void asmlinkage svm_vmexit_handler(void)
         break;
 
     case VMEXIT_IOIO:
-    {
-        int rc;
+        if ( vm_event_is_enabled(v) )
+        {
+            int rc;
 
-        rc = hvm_monitor_io(vmcb->ei.io.port,
-                            vmcb->ei.io.bytes,
-                            vmcb->ei.io.in,
-                            vmcb->ei.io.str);
-        if ( rc < 0 )
-            goto unexpected_exit_type;
-        if ( rc )
-            break;
+            rc = hvm_monitor_io(vmcb->ei.io.port,
+                                vmcb->ei.io.bytes,
+                                vmcb->ei.io.in,
+                                vmcb->ei.io.str);
+            if ( rc < 0 )
+                goto unexpected_exit_type;
+            if ( rc )
+                break;
+        }
 
         if ( !vmcb->ei.io.str )
         {
@@ -2921,7 +2928,6 @@ void asmlinkage svm_vmexit_handler(void)
         else if ( !hvm_emulate_one_insn(x86_insn_is_portio, "port I/O") )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
         break;
-    }
 
     case VMEXIT_CR0_READ ... VMEXIT_CR15_READ:
     case VMEXIT_CR0_WRITE ... VMEXIT_CR15_WRITE:
diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index b35dc8c586..a8ced95871 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -239,7 +239,7 @@ void asmlinkage vmx_intr_assist(void)
     }
 
     /* Block event injection while handling a sync vm_event. */
-    if ( unlikely(v->arch.vm_event) && v->arch.vm_event->sync_event )
+    if ( unlikely(vm_event_is_enabled(v)) && v->arch.vm_event->sync_event )
         return;
 
 #ifdef CONFIG_MEM_SHARING
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 524bce8307..89f9d9c7f6 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -47,6 +47,7 @@
 #include <asm/shadow.h>
 #include <asm/spec_ctrl.h>
 #include <asm/stubs.h>
+#include <asm/vm_event.h>
 #include <asm/x86_emulate.h>
 
 #include <public/arch-x86/cpuid.h>
@@ -3335,7 +3336,8 @@ static int vmx_cr_access(cr_access_qual_t qual)
          * VM_EVENT_FLAG_DENY-capable application, so the hvm_monitor_crX()
          * return value is ignored for now.
          */
-        hvm_monitor_crX(CR0, value, old);
+        if ( vm_event_is_enabled(curr) )
+            hvm_monitor_crX(CR0, value, old);
         curr->arch.hvm.guest_cr[0] = value;
         vmx_update_guest_cr(curr, 0, 0);
         TRACE(TRC_HVM_CLTS);
@@ -4322,7 +4324,8 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
         p2m_set_altp2m(v, idx);
     }
 
-    if ( unlikely(currd->arch.monitor.vmexit_enabled) )
+    if ( vm_event_is_enabled(v) &&
+         unlikely(currd->arch.monitor.vmexit_enabled) )
     {
         int rc;
 
@@ -4470,19 +4473,21 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
             if ( !v->domain->debugger_attached )
             {
                 unsigned long insn_len = 0;
-                int rc;
+                int rc = 0;
                 unsigned long trap_type = MASK_EXTR(intr_info,
                                                     INTR_INFO_INTR_TYPE_MASK);
 
                 if ( trap_type >= X86_ET_SW_INT )
                     __vmread(VM_EXIT_INSTRUCTION_LEN, &insn_len);
 
-                rc = hvm_monitor_debug(regs->rip,
-                                       HVM_MONITOR_DEBUG_EXCEPTION,
-                                       trap_type, insn_len, 0);
-
-                if ( rc < 0 )
-                    goto exit_and_crash;
+                if ( vm_event_is_enabled(v) )
+                {
+                    rc = hvm_monitor_debug(regs->rip,
+                                           HVM_MONITOR_DEBUG_EXCEPTION,
+                                           trap_type, insn_len, 0);
+                    if ( rc < 0 )
+                        goto exit_and_crash;
+                }
                 if ( !rc )
                     vmx_propagate_intr(intr_info);
             }
@@ -4494,16 +4499,19 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
             if ( !v->domain->debugger_attached )
             {
                 unsigned long insn_len;
-                int rc;
+                int rc = 0;
 
                 __vmread(VM_EXIT_INSTRUCTION_LEN, &insn_len);
-                rc = hvm_monitor_debug(regs->rip,
-                                       HVM_MONITOR_SOFTWARE_BREAKPOINT,
-                                       X86_ET_SW_EXC,
-                                       insn_len, 0);
+                if ( vm_event_is_enabled(v) )
+                {
+                    rc = hvm_monitor_debug(regs->rip,
+                                           HVM_MONITOR_SOFTWARE_BREAKPOINT,
+                                           X86_ET_SW_EXC,
+                                           insn_len, 0);
 
-                if ( rc < 0 )
-                    goto exit_and_crash;
+                    if ( rc < 0 )
+                        goto exit_and_crash;
+                }
                 if ( !rc )
                     vmx_propagate_intr(intr_info);
             }
@@ -4758,16 +4766,20 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
             };
         } io_qual;
         unsigned int bytes;
-        int rc;
 
         __vmread(EXIT_QUALIFICATION, &io_qual.raw);
         bytes = io_qual.size + 1;
 
-        rc = hvm_monitor_io(io_qual.port, bytes, io_qual.in, io_qual.str);
-        if ( rc < 0 )
-            goto exit_and_crash;
-        if ( rc )
-            break;
+        if ( vm_event_is_enabled(v) )
+        {
+            int rc;
+
+            rc = hvm_monitor_io(io_qual.port, bytes, io_qual.in, io_qual.str);
+            if ( rc < 0 )
+                goto exit_and_crash;
+            if ( rc )
+                break;
+        }
 
         if ( io_qual.str )
         {
@@ -4821,9 +4833,10 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
         vmx_update_cpu_exec_control(v);
         if ( v->arch.hvm.single_step )
         {
-            hvm_monitor_debug(regs->rip,
-                              HVM_MONITOR_SINGLESTEP_BREAKPOINT,
-                              0, 0, 0);
+            if ( vm_event_is_enabled(v) )
+                hvm_monitor_debug(regs->rip,
+                                  HVM_MONITOR_SINGLESTEP_BREAKPOINT,
+                                  0, 0, 0);
 
             if ( v->domain->debugger_attached )
                 domain_pause_for_debugger();
diff --git a/xen/arch/x86/include/asm/vm_event.h b/xen/arch/x86/include/asm/vm_event.h
index 46e77ed6d9..0310f30c18 100644
--- a/xen/arch/x86/include/asm/vm_event.h
+++ b/xen/arch/x86/include/asm/vm_event.h
@@ -45,4 +45,9 @@ void vm_event_sync_event(struct vcpu *v, bool value);
 
 void vm_event_reset_vmtrace(struct vcpu *v);
 
+static inline bool vm_event_is_enabled(const struct vcpu *v)
+{
+    return IS_ENABLED(CONFIG_VM_EVENT) && v->arch.vm_event != NULL;
+}
+
 #endif /* __ASM_X86_VM_EVENT_H__ */
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 4787b27964..b5a259af1d 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -648,6 +648,9 @@ int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
         .u.mem_sharing.p2mt = p2m_ram_shared,
     };
 
+    if ( !vm_event_is_enabled(current) )
+        return -EOPNOTSUPP;
+
     if ( (rc = __vm_event_claim_slot(
               d, d->vm_event_share, allow_sleep)) < 0 )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 10:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 10:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208059.1520280 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZX-0002yC-U7; Mon, 19 Jan 2026 10:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208059.1520280; Mon, 19 Jan 2026 10:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZX-0002y4-R7; Mon, 19 Jan 2026 10:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1208059;
 Mon, 19 Jan 2026 10:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vhmZW-0002xn-64
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 10:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhmZW-00B6QF-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhmZW-009uY3-09
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qoUjjKd7Uyzhx9mAWeHLOCZ7v7DIU2wLtfrjEZ2MHOs=; b=X92j851znn6qUpJ9Vo3Vjiey/T
	1f0kzQbsh7n8xBDPE2ufqroLUaEuN4GPZ8u+mZWrcpnxx2k0p/wcbR8Zw5bYEm8cn3PtyWMliXBaa
	K4v6y9vkjY4XKnOGIW10NgHlpEZRT+2bSI7ShY9u2g1MBu2kp99CHTnvRJTZ/qDiWo54=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/monitor: wrap monitor_op under CONFIG_VM_EVENT
Message-Id: <E1vhmZW-009uY3-09@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 10:33:22 +0000

commit 0f45da409846a799d603e72b08f3c25244b7be62
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:38 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 09:15:50 2026 +0100

    x86/monitor: wrap monitor_op under CONFIG_VM_EVENT
    
    Feature monitor_op is based on vm event subsystem, so monitor.o shall be
    wrapped under CONFIG_VM_EVENT.
    The following functions are only invoked by monitor-op, so they all shall be
    wrapped with CONFIG_VM_EVENT (otherwise they will become unreachable and
    violate Misra rule 2.1 when VM_EVENT=n):
    - hvm_enable_msr_interception
      - hvm_function_table.enable_msr_interception
    - hvm_has_set_descriptor_access_existing
      - hvm_function_table.set_descriptor_access_existi
    - arch_monitor_get_capabilities
    Function monitored_msr() still needs a stub to pass compilation when
    VM_EVENT=n.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/Makefile          |  2 +-
 xen/arch/x86/hvm/svm/svm.c         |  8 +++++++-
 xen/arch/x86/hvm/vmx/vmx.c         | 10 ++++++++++
 xen/arch/x86/include/asm/hvm/hvm.h | 18 +++++++++++-------
 xen/arch/x86/include/asm/monitor.h |  9 +++++++++
 5 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index 1b97bdc624..ee4b45a4ee 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -16,7 +16,7 @@ obj-y += io.o
 obj-y += ioreq.o
 obj-y += irq.o
 obj-y += mmio.o
-obj-y += monitor.o
+obj-$(CONFIG_VM_EVENT) += monitor.o
 obj-y += mtrr.o
 obj-y += nestedhvm.o
 obj-y += pmtimer.o
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 21f355a657..5d23603fc1 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -297,6 +297,7 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags)
         __clear_bit(msr * 2 + 1, msr_bit);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check svm_enable_msr_interception(struct domain *d, uint32_t msr)
 {
     struct vcpu *v;
@@ -304,6 +305,7 @@ static void cf_check svm_enable_msr_interception(struct domain *d, uint32_t msr)
     for_each_vcpu ( d, v )
         svm_intercept_msr(v, msr, MSR_INTERCEPT_WRITE);
 }
+#endif /* CONFIG_VM_EVENT */
 
 static void svm_save_dr(struct vcpu *v)
 {
@@ -824,6 +826,7 @@ static void cf_check svm_set_rdtsc_exiting(struct vcpu *v, bool enable)
     vmcb_set_general2_intercepts(vmcb, general2_intercepts);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check svm_set_descriptor_access_exiting(
     struct vcpu *v, bool enable)
 {
@@ -841,6 +844,7 @@ static void cf_check svm_set_descriptor_access_exiting(
 
     vmcb_set_general1_intercepts(vmcb, general1_intercepts);
 }
+#endif /* CONFIG_VM_EVENT */
 
 static unsigned int cf_check svm_get_insn_bytes(struct vcpu *v, uint8_t *buf)
 {
@@ -2454,9 +2458,11 @@ static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
     .fpu_dirty_intercept  = svm_fpu_dirty_intercept,
     .msr_read_intercept   = svm_msr_read_intercept,
     .msr_write_intercept  = svm_msr_write_intercept,
+#ifdef CONFIG_VM_EVENT
     .enable_msr_interception = svm_enable_msr_interception,
-    .set_rdtsc_exiting    = svm_set_rdtsc_exiting,
     .set_descriptor_access_exiting = svm_set_descriptor_access_exiting,
+#endif
+    .set_rdtsc_exiting    = svm_set_rdtsc_exiting,
     .get_insn_bytes       = svm_get_insn_bytes,
 
     .nhvm_vcpu_initialise = nsvm_vcpu_initialise,
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 89f9d9c7f6..40e4c71244 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1581,6 +1581,7 @@ static void cf_check vmx_set_rdtsc_exiting(struct vcpu *v, bool enable)
     vmx_vmcs_exit(v);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check vmx_set_descriptor_access_exiting(
     struct vcpu *v, bool enable)
 {
@@ -1595,6 +1596,7 @@ static void cf_check vmx_set_descriptor_access_exiting(
     vmx_update_secondary_exec_control(v);
     vmx_vmcs_exit(v);
 }
+#endif /* CONFIG_VM_EVENT */
 
 static void cf_check vmx_init_hypercall_page(void *p)
 {
@@ -2474,6 +2476,7 @@ static void cf_check vmx_handle_eoi(uint8_t vector, int isr)
         printk_once(XENLOG_WARNING "EOI for %02x but SVI=%02x\n", vector, old_svi);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check vmx_enable_msr_interception(struct domain *d, uint32_t msr)
 {
     struct vcpu *v;
@@ -2481,6 +2484,7 @@ static void cf_check vmx_enable_msr_interception(struct domain *d, uint32_t msr)
     for_each_vcpu ( d, v )
         vmx_set_msr_intercept(v, msr, VMX_MSR_W);
 }
+#endif /* CONFIG_VM_EVENT */
 
 #ifdef CONFIG_ALTP2M
 
@@ -2932,7 +2936,9 @@ static struct hvm_function_table __initdata_cf_clobber vmx_function_table = {
     .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources,
     .update_vlapic_mode = vmx_vlapic_msr_changed,
     .nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m,
+#ifdef CONFIG_VM_EVENT
     .enable_msr_interception = vmx_enable_msr_interception,
+#endif
 #ifdef CONFIG_ALTP2M
     .altp2m_vcpu_update_p2m = vmx_vcpu_update_eptp,
     .altp2m_vcpu_update_vmfunc_ve = vmx_vcpu_update_vmfunc_ve,
@@ -3141,9 +3147,11 @@ const struct hvm_function_table * __init start_vmx(void)
 
     vmx_function_table.caps.singlestep = cpu_has_monitor_trap_flag;
 
+#ifdef CONFIG_VM_EVENT
     if ( cpu_has_vmx_dt_exiting )
         vmx_function_table.set_descriptor_access_exiting =
             vmx_set_descriptor_access_exiting;
+#endif
 
     /*
      * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
@@ -3214,8 +3222,10 @@ void __init vmx_fill_funcs(void)
     if ( !cpu_has_xen_ibt )
         return;
 
+#ifdef CONFIG_VM_EVENT
     vmx_function_table.set_descriptor_access_exiting =
         vmx_set_descriptor_access_exiting;
+#endif
 
     vmx_function_table.update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap;
     vmx_function_table.process_isr            = vmx_process_isr;
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 666fa402a8..af042ae858 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -192,7 +192,11 @@ struct hvm_function_table {
     void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool enable);
+
+#ifdef CONFIG_VM_EVENT
     void (*set_descriptor_access_exiting)(struct vcpu *v, bool enable);
+    void (*enable_msr_interception)(struct domain *d, uint32_t msr);
+#endif
 
     /* Nested HVM */
     int (*nhvm_vcpu_initialise)(struct vcpu *v);
@@ -224,8 +228,6 @@ struct hvm_function_table {
                                 paddr_t *L1_gpa, unsigned int *page_order,
                                 uint8_t *p2m_acc, struct npfec npfec);
 
-    void (*enable_msr_interception)(struct domain *d, uint32_t msr);
-
 #ifdef CONFIG_ALTP2M
     /* Alternate p2m */
     void (*altp2m_vcpu_update_p2m)(struct vcpu *v);
@@ -435,11 +437,18 @@ static inline bool using_svm(void)
 
 #define hvm_long_mode_active(v) (!!((v)->arch.hvm.guest_efer & EFER_LMA))
 
+#ifdef CONFIG_VM_EVENT
 static inline bool hvm_has_set_descriptor_access_exiting(void)
 {
     return hvm_funcs.set_descriptor_access_exiting;
 }
 
+static inline void hvm_enable_msr_interception(struct domain *d, uint32_t msr)
+{
+    alternative_vcall(hvm_funcs.enable_msr_interception, d, msr);
+}
+#endif /* CONFIG_VM_EVENT */
+
 static inline void hvm_domain_creation_finished(struct domain *d)
 {
     if ( hvm_funcs.domain_creation_finished )
@@ -681,11 +690,6 @@ static inline int nhvm_hap_walk_L1_p2m(
         v, L2_gpa, L1_gpa, page_order, p2m_acc, npfec);
 }
 
-static inline void hvm_enable_msr_interception(struct domain *d, uint32_t msr)
-{
-    alternative_vcall(hvm_funcs.enable_msr_interception, d, msr);
-}
-
 static inline bool hvm_is_singlestep_supported(void)
 {
     return hvm_funcs.caps.singlestep;
diff --git a/xen/arch/x86/include/asm/monitor.h b/xen/arch/x86/include/asm/monitor.h
index 3c64d8258f..9249324fd0 100644
--- a/xen/arch/x86/include/asm/monitor.h
+++ b/xen/arch/x86/include/asm/monitor.h
@@ -71,6 +71,7 @@ int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop)
     return rc;
 }
 
+#ifdef CONFIG_VM_EVENT
 static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
 {
     uint32_t capabilities = 0;
@@ -102,6 +103,7 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
 
     return capabilities;
 }
+#endif /* CONFIG_VM_EVENT */
 
 int arch_monitor_domctl_event(struct domain *d,
                               struct xen_domctl_monitor_op *mop);
@@ -123,7 +125,14 @@ static inline void arch_monitor_cleanup_domain(struct domain *d) {}
 
 #endif
 
+#ifdef CONFIG_VM_EVENT
 bool monitored_msr(const struct domain *d, u32 msr);
+#else
+static inline bool monitored_msr(const struct domain *d, u32 msr)
+{
+    return false;
+}
+#endif
 bool monitored_msr_onchangeonly(const struct domain *d, u32 msr);
 
 #endif /* __ASM_X86_MONITOR_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 10:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 10:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208060.1520285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZi-00030c-12; Mon, 19 Jan 2026 10:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208060.1520285; Mon, 19 Jan 2026 10:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZh-00030U-Ue; Mon, 19 Jan 2026 10:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1208060;
 Mon, 19 Jan 2026 10: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 1vhmZg-00030O-9L
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 10: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 1vhmZg-00B6QL-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhmZg-009uZJ-0h
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T9hlxMuPdLThVxTtz1RCCm3JbK68UwmVVi205ioKFSE=; b=j9yeuYqZKjuwd9YN2/pOGXcuG3
	+7dHNnqmNeIic0VRV4amIOoYz+xZko9kZ1Sbw3KzVH2eHLWZPxIGxL2fYAChGeoMAr1eSaf1YKuSG
	EKqvPZ33DYXXXMG6VK1xZu+cQIpOY1x7stQbABPxrQKgBm4P3+7g7jn5rO7RY1Lrh5HM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/p2m: move xenmem_access_to_p2m_access() to common p2m.c
Message-Id: <E1vhmZg-009uZJ-0h@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 10:33:32 +0000

commit 0288e87afca2b0602e625577d559929339943846
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:39 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 10:06:10 2026 +0100

    xen/p2m: move xenmem_access_to_p2m_access() to common p2m.c
    
    Memory access and ALTP2M are two seperate features, while both depending on
    helper xenmem_access_to_p2m_access(). So it betters lives in common p2m.c,
    other than mem_access.c which will be compiled out when VM_EVENT=n && ALTP2M=y.
    Guard xenmem_access_to_p2m_access() with VM_EVENT || ALTP2M, otherwise it
    will become unreachable when both VM_EVENT=n and ALTP2M=n, and hence
    violating Misra rule 2.1.
    Also move declaration from xen/mem_access.h to x86'es one, requiring to also
    move the inclusion point and condition of asm/mem_access.h there.
    An extra blank line is inserted after each case-block to correct coding
    style at the same time.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/include/asm/mem_access.h |  5 +++++
 xen/arch/x86/mm/mem_access.c          | 36 -------------------------------
 xen/arch/x86/mm/p2m.c                 | 40 +++++++++++++++++++++++++++++++++++
 xen/include/xen/mem_access.h          | 11 +++-------
 4 files changed, 48 insertions(+), 44 deletions(-)

diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 257ed33de1..84af05a8c6 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -34,6 +34,11 @@ bool p2m_mem_access_emulate_check(struct vcpu *v,
 /* Sanity check for mem_access hardware support */
 bool p2m_mem_access_sanity_check(const struct domain *d);
 
+struct p2m_domain;
+bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
+                                 xenmem_access_t xaccess,
+                                 p2m_access_t *paccess);
+
 #endif /*__ASM_X86_MEM_ACCESS_H__ */
 
 /*
diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c
index e6b609064c..e55e53f44c 100644
--- a/xen/arch/x86/mm/mem_access.c
+++ b/xen/arch/x86/mm/mem_access.c
@@ -298,42 +298,6 @@ static int set_mem_access(struct domain *d, struct p2m_domain *p2m,
     return rc;
 }
 
-bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
-                                 xenmem_access_t xaccess,
-                                 p2m_access_t *paccess)
-{
-    static const p2m_access_t memaccess[] = {
-#define ACCESS(ac) [XENMEM_access_##ac] = p2m_access_##ac
-        ACCESS(n),
-        ACCESS(r),
-        ACCESS(w),
-        ACCESS(rw),
-        ACCESS(x),
-        ACCESS(rx),
-        ACCESS(wx),
-        ACCESS(rwx),
-        ACCESS(rx2rw),
-        ACCESS(n2rwx),
-        ACCESS(r_pw),
-#undef ACCESS
-    };
-
-    switch ( xaccess )
-    {
-    case 0 ... ARRAY_SIZE(memaccess) - 1:
-        xaccess = array_index_nospec(xaccess, ARRAY_SIZE(memaccess));
-        *paccess = memaccess[xaccess];
-        break;
-    case XENMEM_access_default:
-        *paccess = p2m->default_access;
-        break;
-    default:
-        return false;
-    }
-
-    return true;
-}
-
 /*
  * Set access type for a region of gfns.
  * If gfn == INVALID_GFN, sets the default access type.
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 759f3273d3..8d34357bcb 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2203,6 +2203,46 @@ void p2m_log_dirty_range(struct domain *d, unsigned long begin_pfn,
     guest_flush_tlb_mask(d, d->dirty_cpumask);
 }
 
+#if defined(CONFIG_VM_EVENT) || defined(CONFIG_ALTP2M)
+bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
+                                 xenmem_access_t xaccess,
+                                 p2m_access_t *paccess)
+{
+    static const p2m_access_t memaccess[] = {
+#define ACCESS(ac) [XENMEM_access_##ac] = p2m_access_##ac
+        ACCESS(n),
+        ACCESS(r),
+        ACCESS(w),
+        ACCESS(rw),
+        ACCESS(x),
+        ACCESS(rx),
+        ACCESS(wx),
+        ACCESS(rwx),
+        ACCESS(rx2rw),
+        ACCESS(n2rwx),
+        ACCESS(r_pw),
+#undef ACCESS
+    };
+
+    switch ( xaccess )
+    {
+    case 0 ... ARRAY_SIZE(memaccess) - 1:
+        xaccess = array_index_nospec(xaccess, ARRAY_SIZE(memaccess));
+        *paccess = memaccess[xaccess];
+        break;
+
+    case XENMEM_access_default:
+        *paccess = p2m->default_access;
+        break;
+
+    default:
+        return false;
+    }
+
+    return true;
+}
+#endif /* VM_EVENT || ALTP2M */
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h
index 4de651038d..998ec680d4 100644
--- a/xen/include/xen/mem_access.h
+++ b/xen/include/xen/mem_access.h
@@ -33,10 +33,6 @@
  */
 struct vm_event_st;
 
-#ifdef CONFIG_VM_EVENT
-#include <asm/mem_access.h>
-#endif
-
 /*
  * Additional access types, which are used to further restrict
  * the permissions given my the p2m_type_t memory type.  Violations
@@ -73,10 +69,9 @@ typedef enum {
     /* NOTE: Assumed to be only 4 bits right now on x86. */
 } p2m_access_t;
 
-struct p2m_domain;
-bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
-                                 xenmem_access_t xaccess,
-                                 p2m_access_t *paccess);
+#if defined(CONFIG_VM_EVENT) || defined(CONFIG_ALTP2M)
+#include <asm/mem_access.h>
+#endif
 
 /*
  * Set access type for a region of gfns.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 10:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 10:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208061.1520289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZs-000336-2O; Mon, 19 Jan 2026 10:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208061.1520289; Mon, 19 Jan 2026 10:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhmZr-00032y-W3; Mon, 19 Jan 2026 10:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1208061;
 Mon, 19 Jan 2026 10: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 1vhmZq-00032p-C9
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 10: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 1vhmZq-00B6Qh-2C
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhmZq-009uZj-10
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6XuOVT7h4L/4fkOzZS3idCOfIVDH6/Nxco6VzWWl31A=; b=6854F6BmuJjPNcmKMdd/o7MpX7
	qxn4ircN12EPCXwnnNUvbR+r76Sf73SwY3WMs+XWQi2ghmm3qDjmN6cnTIdWdcPOdvS8Z1X73ThmT
	Xkfp94h8Y03Ur5ernAtu4sYKIP/Qft44nlQ/hEwigB81+cdNreamNy9KBQpLHJgqVQ4A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mem_access: wrap memory access when VM_EVENT=n
Message-Id: <E1vhmZq-009uZj-10@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 10:33:42 +0000

commit b18e38e42da66ec7eb54a9606cf3a321b01efa0d
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:40 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 10:07:02 2026 +0100

    xen/mem_access: wrap memory access when VM_EVENT=n
    
    Feature memory access is based on vm event subsystem, and it could be disabled
    in the future. So a few switch-blocks in do_altp2m_op() need
    vm_event_is_enabled() condition check to pass compilation when ALTP2M=y and
    VM_EVENT=n(, hence MEM_ACCESS=n), like HVMOP_altp2m_set_mem_access, etc.
    Function p2m_mem_access_check() still needs stub when VM_EVENT=n to
    pass compilation.
    Although local variable "req_ptr" still remains NULL throughout its lifetime,
    with the change of NULL assignment, we will face runtime undefined error only
    when CONFIG_USBAN is on. So we strengthen the condition check via adding
    vm_event_is_enabled() for the special case.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/hvm.c                | 26 +++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mem_access.h | 10 ++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 07e54890d9..b34cd29629 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -52,6 +52,7 @@
 #include <asm/i387.h>
 #include <asm/mc146818rtc.h>
 #include <asm/mce.h>
+#include <asm/mem_access.h>
 #include <asm/monitor.h>
 #include <asm/msr.h>
 #include <asm/mtrr.h>
@@ -2082,7 +2083,12 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
 #endif
     }
 
-    if ( req_ptr )
+    /*
+     * req_ptr being constant NULL when !CONFIG_VM_EVENT, CONFIG_UBSAN=y
+     * builds have been observed to still hit undefined-ness at runtime.
+     * Hence do a seemingly redundant vm_event_is_enabled() check here.
+     */
+    if ( req_ptr && vm_event_is_enabled(curr) )
     {
         if ( monitor_traps(curr, sync, req_ptr) < 0 )
             rc = 0;
@@ -4804,6 +4810,12 @@ static int do_altp2m_op(
         break;
 
     case HVMOP_altp2m_set_mem_access:
+        if ( !vm_event_is_enabled(current) )
+        {
+            rc = -EOPNOTSUPP;
+            break;
+        }
+
         if ( a.u.mem_access.pad )
             rc = -EINVAL;
         else
@@ -4813,6 +4825,12 @@ static int do_altp2m_op(
         break;
 
     case HVMOP_altp2m_set_mem_access_multi:
+        if ( !vm_event_is_enabled(current) )
+        {
+            rc = -EOPNOTSUPP;
+            break;
+        }
+
         if ( a.u.set_mem_access_multi.pad ||
              a.u.set_mem_access_multi.opaque > a.u.set_mem_access_multi.nr )
         {
@@ -4844,6 +4862,12 @@ static int do_altp2m_op(
         break;
 
     case HVMOP_altp2m_get_mem_access:
+        if ( !vm_event_is_enabled(current) )
+        {
+            rc = -EOPNOTSUPP;
+            break;
+        }
+
         if ( a.u.mem_access.pad )
             rc = -EINVAL;
         else
diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 84af05a8c6..e2cb10cd32 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -14,6 +14,7 @@
 #ifndef __ASM_X86_MEM_ACCESS_H__
 #define __ASM_X86_MEM_ACCESS_H__
 
+#ifdef CONFIG_VM_EVENT
 /*
  * Setup vm_event request based on the access (gla is -1ull if not available).
  * Handles the rw2rx conversion. Boolean return value indicates if event type
@@ -25,6 +26,15 @@
 bool p2m_mem_access_check(paddr_t gpa, unsigned long gla,
                           struct npfec npfec,
                           struct vm_event_st **req_ptr);
+#else
+static inline bool p2m_mem_access_check(paddr_t gpa, unsigned long gla,
+                                        struct npfec npfec,
+                                        struct vm_event_st **req_ptr)
+{
+    *req_ptr = NULL;
+    return false;
+}
+#endif /* CONFIG_VM_EVENT */
 
 /* Check for emulation and mark vcpu for skipping one instruction
  * upon rescheduling if required. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 10:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 10:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208062.1520293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhma2-00036v-3t; Mon, 19 Jan 2026 10:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208062.1520293; Mon, 19 Jan 2026 10:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhma2-00036n-1F; Mon, 19 Jan 2026 10:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1208062;
 Mon, 19 Jan 2026 10: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 1vhma0-00036f-G5
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 10: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 1vhma0-00B6Ql-2Z
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhma0-009uaN-1K
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 10:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GteGfjks5pQeHAkFLNwF8bk0j+kFvysohompyMsiI1c=; b=x5hJKicZ4uuWJGPkc7ybZPGl2Q
	SjCozjoDDzWfdVuIbB7UepL6iJGyYEjZf8drGjWvHbkhOT/2+ps2FeCnxvElI9iJ0M/St1GRNbqJ4
	kjHMC8B+/TmXKN3j9tLYq/Sq0xpfFVDbIiKGTBCrjhA6tQDu1fbSa4vADR/6B8alzJqU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/vm_event: consolidate CONFIG_VM_EVENT
Message-Id: <E1vhma0-009uaN-1K@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 10:33:52 +0000

commit e70e76654cc092542cbd506ff3e9653a9ededcdf
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:41 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 10:07:28 2026 +0100

    xen/vm_event: consolidate CONFIG_VM_EVENT
    
    File hvm/vm_event.c and x86/vm_event.c are the extend to vm_event handling
    routines, and its compilation shall be guarded by CONFIG_VM_EVENT too.
    
    Although CONFIG_VM_EVENT is right now forcibly enabled on x86 via
    MEM_ACCESS_ALWAYS_ON, we could disable it through disabling
    CONFIG_MGMT_HYPERCALLS later. So we remove MEM_ACCESS_ALWAYS_ON and
    make VM_EVENT=y on default only on x86 to retain the same.
    
    The following functions are developed on the basis of vm event framework, or
    only invoked by vm_event.c, so they all shall be wrapped with CONFIG_VM_EVENT
    (otherwise they will become unreachable and
    violate Misra rule 2.1 when VM_EVENT=n):
    - hvm_toggle_singlestep
    - hvm_fast_singlestep
    - hvm_emulate_one_vm_event
        - hvmemul_write{,cmpxchg,rep_ins,rep_outs,rep_movs,rep_stos,read_io,write_io}_discard
    And Function vm_event_check_ring() needs stub to pass compilation when
    VM_EVENT=n.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/Makefile      |  2 +-
 xen/arch/x86/hvm/Kconfig   |  1 -
 xen/arch/x86/hvm/Makefile  |  2 +-
 xen/arch/x86/hvm/emulate.c | 58 +++++++++++++++++++++++++---------------------
 xen/arch/x86/hvm/hvm.c     |  2 ++
 xen/common/Kconfig         |  7 ++----
 xen/include/xen/vm_event.h |  7 ++++++
 7 files changed, 44 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d8b41cec16..5bf3578983 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -69,7 +69,7 @@ obj-$(CONFIG_INTEL) += tsx.o
 obj-y += x86_emulate.o
 obj-$(CONFIG_TBOOT) += tboot.o
 obj-y += hpet.o
-obj-y += vm_event.o
+obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-y += xstate.o
 
 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig
index c1a131d185..25eb3e374f 100644
--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -4,7 +4,6 @@ menuconfig HVM
 	default !PV_SHIM
 	select COMPAT
 	select IOREQ_SERVER
-	select MEM_ACCESS_ALWAYS_ON
 	help
 	  Interfaces to support HVM domains.  HVM domains require hardware
 	  virtualisation extensions (e.g. Intel VT-x, AMD SVM), but can boot
diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index ee4b45a4ee..f34fb03934 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -26,7 +26,7 @@ obj-y += save.o
 obj-y += stdvga.o
 obj-y += vioapic.o
 obj-y += vlapic.o
-obj-y += vm_event.o
+obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-y += vmsi.o
 obj-y += vpic.o
 obj-y += vpt.o
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index fe75b0516d..d56ef02baf 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1615,6 +1615,7 @@ static int cf_check hvmemul_blk(
     return rc;
 }
 
+#ifdef CONFIG_VM_EVENT
 static int cf_check hvmemul_write_discard(
     enum x86_segment seg,
     unsigned long offset,
@@ -1717,6 +1718,7 @@ static int cf_check hvmemul_cache_op_discard(
 {
     return X86EMUL_OKAY;
 }
+#endif /* CONFIG_VM_EVENT */
 
 static int cf_check hvmemul_cmpxchg(
     enum x86_segment seg,
@@ -2750,33 +2752,6 @@ static const struct x86_emulate_ops hvm_emulate_ops = {
     .vmfunc        = hvmemul_vmfunc,
 };
 
-static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
-    .read          = hvmemul_read,
-    .insn_fetch    = hvmemul_insn_fetch,
-    .write         = hvmemul_write_discard,
-    .cmpxchg       = hvmemul_cmpxchg_discard,
-    .rep_ins       = hvmemul_rep_ins_discard,
-    .rep_outs      = hvmemul_rep_outs_discard,
-    .rep_movs      = hvmemul_rep_movs_discard,
-    .rep_stos      = hvmemul_rep_stos_discard,
-    .read_segment  = hvmemul_read_segment,
-    .write_segment = hvmemul_write_segment,
-    .read_io       = hvmemul_read_io_discard,
-    .write_io      = hvmemul_write_io_discard,
-    .read_cr       = hvmemul_read_cr,
-    .write_cr      = hvmemul_write_cr,
-    .read_xcr      = hvmemul_read_xcr,
-    .write_xcr     = hvmemul_write_xcr,
-    .read_msr      = hvmemul_read_msr,
-    .write_msr     = hvmemul_write_msr_discard,
-    .cache_op      = hvmemul_cache_op_discard,
-    .tlb_op        = hvmemul_tlb_op,
-    .cpuid         = x86emul_cpuid,
-    .get_fpu       = hvmemul_get_fpu,
-    .put_fpu       = hvmemul_put_fpu,
-    .vmfunc        = hvmemul_vmfunc,
-};
-
 /*
  * Note that passing VIO_no_completion into this function serves as kind
  * of (but not fully) an "auto select completion" indicator.  When there's
@@ -2887,6 +2862,34 @@ int hvm_emulate_one(
     return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops, completion);
 }
 
+#ifdef CONFIG_VM_EVENT
+static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
+    .read          = hvmemul_read,
+    .insn_fetch    = hvmemul_insn_fetch,
+    .write         = hvmemul_write_discard,
+    .cmpxchg       = hvmemul_cmpxchg_discard,
+    .rep_ins       = hvmemul_rep_ins_discard,
+    .rep_outs      = hvmemul_rep_outs_discard,
+    .rep_movs      = hvmemul_rep_movs_discard,
+    .rep_stos      = hvmemul_rep_stos_discard,
+    .read_segment  = hvmemul_read_segment,
+    .write_segment = hvmemul_write_segment,
+    .read_io       = hvmemul_read_io_discard,
+    .write_io      = hvmemul_write_io_discard,
+    .read_cr       = hvmemul_read_cr,
+    .write_cr      = hvmemul_write_cr,
+    .read_xcr      = hvmemul_read_xcr,
+    .write_xcr     = hvmemul_write_xcr,
+    .read_msr      = hvmemul_read_msr,
+    .write_msr     = hvmemul_write_msr_discard,
+    .cache_op      = hvmemul_cache_op_discard,
+    .tlb_op        = hvmemul_tlb_op,
+    .cpuid         = x86emul_cpuid,
+    .get_fpu       = hvmemul_get_fpu,
+    .put_fpu       = hvmemul_put_fpu,
+    .vmfunc        = hvmemul_vmfunc,
+};
+
 void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     unsigned int errcode)
 {
@@ -2949,6 +2952,7 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
 
     hvm_emulate_writeback(&ctx);
 }
+#endif /* CONFIG_VM_EVENT */
 
 void hvm_emulate_init_once(
     struct hvm_emulate_ctxt *hvmemul_ctxt,
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b34cd29629..4d37a93c57 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5250,6 +5250,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op)
     return rc;
 }
 
+#ifdef CONFIG_VM_EVENT
 void hvm_toggle_singlestep(struct vcpu *v)
 {
     ASSERT(atomic_read(&v->pause_count));
@@ -5276,6 +5277,7 @@ void hvm_fast_singlestep(struct vcpu *v, uint16_t p2midx)
     v->arch.hvm.fast_single_step.p2midx = p2midx;
 }
 #endif
+#endif /* CONFIG_VM_EVENT */
 
 /*
  * Segment caches in VMCB/VMCS are inconsistent about which bits are checked,
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 38320b248a..d7e79e752a 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -173,13 +173,10 @@ config HAS_VMAP
 config LIBFDT
 	bool
 
-config MEM_ACCESS_ALWAYS_ON
-	bool
-
 config VM_EVENT
-	def_bool MEM_ACCESS_ALWAYS_ON
-	prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
+	bool "Memory Access and VM events"
 	depends on HVM
+	default X86
 	help
 
 	  Framework to configure memory access types for guests and receive
diff --git a/xen/include/xen/vm_event.h b/xen/include/xen/vm_event.h
index 27d0c74216..1b76ce632e 100644
--- a/xen/include/xen/vm_event.h
+++ b/xen/include/xen/vm_event.h
@@ -51,7 +51,14 @@ struct vm_event_domain
 };
 
 /* Returns whether a ring has been set up */
+#ifdef CONFIG_VM_EVENT
 bool vm_event_check_ring(struct vm_event_domain *ved);
+#else
+static inline bool vm_event_check_ring(struct vm_event_domain *ved)
+{
+    return false;
+}
+#endif /* CONFIG_VM_EVENT */
 
 /* Returns 0 on success, -ENOSYS if there is no ring, -EBUSY if there is no
  * available space and the caller is a foreign domain. If the guest itself
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 11:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 11:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208091.1520317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnVH-0002d2-KW; Mon, 19 Jan 2026 11:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208091.1520317; Mon, 19 Jan 2026 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 1vhnVH-0002cu-Ht; Mon, 19 Jan 2026 11:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1208091;
 Mon, 19 Jan 2026 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 1vhnVF-0002co-TW
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 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 1vhnVG-00B7qO-0Y
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhnVF-009y55-2W
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 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=PbBX4VDLcaN1l4oFf7tKEc2ztOuivfnDIxzfoxSXuzs=; b=SwqLbnb1ZXXvuAjCiLoz+PaJ4K
	4oiEoJ0kpiH+8btXEgA9VQEvufSdWXDvvLJh9gMPz1NdlVWyb0++AJ3qTqxA5LVaVJTvB1of74He7
	s8bFL/Z5DIUHrGo3zWBa8VPIlQlEeWAeQwaW9MliSrV4GzjMcgiePDEohWkLhVJpIOo4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: move declaration from mem_access.h to altp2m.h
Message-Id: <E1vhnVF-009y55-2W@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 11:33:01 +0000

commit 7304ee88d4b7a84b7d00edd72abe98e0b2130d60
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:36 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 09:14:58 2026 +0100

    xen/x86: move declaration from mem_access.h to altp2m.h
    
    Memory access and ALTP2M are two seperate features, and each could be
    controlled via VM_EVENT or ALTP2M. In order to avoid implicit declaration
    when ALTP2M=y and VM_EVENT=n on compiling hvm.o/altp2m.o, we move declaration
    of the following functions from <asm/mem_access.h> to <asm/altp2m.h>:
    - p2m_set_suppress_ve
    - p2m_set_suppress_ve_multi
    - p2m_get_suppress_ve
    Potential error on altp2m.c also breaks Misra Rule 8.4.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/include/asm/altp2m.h     | 10 ++++++++++
 xen/arch/x86/include/asm/mem_access.h | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/altp2m.h b/xen/arch/x86/include/asm/altp2m.h
index 8ecd74f363..9c1ac3cc26 100644
--- a/xen/arch/x86/include/asm/altp2m.h
+++ b/xen/arch/x86/include/asm/altp2m.h
@@ -46,6 +46,16 @@ void altp2m_vcpu_destroy(struct vcpu *v);
 int altp2m_vcpu_enable_ve(struct vcpu *v, gfn_t gfn);
 void altp2m_vcpu_disable_ve(struct vcpu *v);
 
+int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
+                        unsigned int altp2m_idx);
+
+struct xen_hvm_altp2m_suppress_ve_multi;
+int p2m_set_suppress_ve_multi(struct domain *d,
+                              struct xen_hvm_altp2m_suppress_ve_multi *sve);
+
+int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
+                        unsigned int altp2m_idx);
+
 #else
 
 static inline bool altp2m_is_eptp_valid(const struct domain *d,
diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 1a52a10322..257ed33de1 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -34,16 +34,6 @@ bool p2m_mem_access_emulate_check(struct vcpu *v,
 /* Sanity check for mem_access hardware support */
 bool p2m_mem_access_sanity_check(const struct domain *d);
 
-int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
-                        unsigned int altp2m_idx);
-
-struct xen_hvm_altp2m_suppress_ve_multi;
-int p2m_set_suppress_ve_multi(struct domain *d,
-                              struct xen_hvm_altp2m_suppress_ve_multi *sve);
-
-int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
-                        unsigned int altp2m_idx);
-
 #endif /*__ASM_X86_MEM_ACCESS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 11:33:19 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 11:33:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208092.1520321 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnVR-0002f8-M3; Mon, 19 Jan 2026 11:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208092.1520321; Mon, 19 Jan 2026 11: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 1vhnVR-0002f1-JI; Mon, 19 Jan 2026 11:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1208092;
 Mon, 19 Jan 2026 11: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 1vhnVQ-0002et-1Y
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 11: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 1vhnVQ-00B7ql-16
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhnVP-009y5T-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11: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=4lJooB3pFjQW2WZKZmiO6h2ezOKkdg6IIa4nTTjU5Zs=; b=bgUXTj33DEZVPZGiOGVGh8/Mtr
	eZmCLdhjsNmWVQZvtOci21YXD79WchlEHL0hbRd2sfkEvCPMZEF3uFfIDdDd8Q4HA0phYpPAP0F6l
	TKjhpvBzCi+Y215Cepx2nF8mimZDg/KKwDN2hrUrx3NomPedJANKz1oz3picFxm3sDUs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vm_event: introduce vm_event_is_enabled()
Message-Id: <E1vhnVP-009y5T-2x@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 11:33:11 +0000

commit 0ea539000c1d2fa93318c715e8f24c829f79f055
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:37 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 09:15:35 2026 +0100

    x86/vm_event: introduce vm_event_is_enabled()
    
    Function vm_event_is_enabled() is introduced to check if vm event is enabled,
    and also make the checking conditional upon CONFIG_VM_EVENT, which could help
    DCE a lot unreachable calls/codes, such as hvm_monitor_io(), etc,
    when having VM_EVENT=n.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/emulate.c          |  9 +++---
 xen/arch/x86/hvm/hvm.c              | 23 ++++++++++----
 xen/arch/x86/hvm/svm/intr.c         |  2 +-
 xen/arch/x86/hvm/svm/svm.c          | 46 +++++++++++++++------------
 xen/arch/x86/hvm/vmx/intr.c         |  2 +-
 xen/arch/x86/hvm/vmx/vmx.c          | 63 ++++++++++++++++++++++---------------
 xen/arch/x86/include/asm/vm_event.h |  5 +++
 xen/arch/x86/mm/mem_sharing.c       |  3 ++
 8 files changed, 96 insertions(+), 57 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 2af4f30359..fe75b0516d 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -105,7 +105,7 @@ static int set_context_data(void *buffer, unsigned int size)
 {
     struct vcpu *curr = current;
 
-    if ( curr->arch.vm_event )
+    if ( vm_event_is_enabled(curr) )
     {
         unsigned int safe_size =
             min(size, curr->arch.vm_event->emul.read.size);
@@ -771,7 +771,7 @@ static void *hvmemul_map_linear_addr(
             ASSERT(p2mt == p2m_ram_logdirty || !p2m_is_readonly(p2mt));
         }
 
-        if ( unlikely(curr->arch.vm_event) &&
+        if ( unlikely(vm_event_is_enabled(curr)) &&
              curr->arch.vm_event->send_event &&
              hvm_monitor_check_p2m(addr, gfn, pfec, npfec_kind_with_gla) )
         {
@@ -1863,16 +1863,17 @@ static int hvmemul_rep_outs_set_context(
     unsigned int bytes_per_rep,
     unsigned long *reps)
 {
-    const struct arch_vm_event *ev = current->arch.vm_event;
+    const struct arch_vm_event *ev;
     const uint8_t *ptr;
     unsigned int avail;
     unsigned long done;
     int rc = X86EMUL_OKAY;
 
     ASSERT(bytes_per_rep <= 4);
-    if ( !ev )
+    if ( !vm_event_is_enabled(current) )
         return X86EMUL_UNHANDLEABLE;
 
+    ev = current->arch.vm_event;
     ptr = ev->emul.read.data;
     avail = ev->emul.read.size;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 0eafa515bb..07e54890d9 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -532,7 +532,7 @@ void hvm_do_resume(struct vcpu *v)
     if ( !vcpu_ioreq_handle_completion(v) )
         return;
 
-    if ( unlikely(v->arch.vm_event) )
+    if ( unlikely(vm_event_is_enabled(v)) )
         hvm_vm_event_do_resume(v);
 
     /* Inject pending hw/sw event */
@@ -546,7 +546,8 @@ void hvm_do_resume(struct vcpu *v)
         v->arch.hvm.inject_event.vector = HVM_EVENT_VECTOR_UNSET;
     }
 
-    if ( unlikely(v->arch.vm_event) && v->arch.monitor.next_interrupt_enabled )
+    if ( unlikely(vm_event_is_enabled(v)) &&
+         v->arch.monitor.next_interrupt_enabled )
     {
         struct x86_event info;
 
@@ -2095,7 +2096,7 @@ int hvm_handle_xsetbv(u32 index, u64 new_bv)
 {
     int rc;
 
-    if ( index == 0 )
+    if ( index == 0 && vm_event_is_enabled(current) )
         hvm_monitor_crX(XCR0, new_bv, current->arch.xcr0);
 
     rc = x86emul_write_xcr(index, new_bv, NULL);
@@ -2266,6 +2267,8 @@ int hvm_set_cr0(unsigned long value, bool may_defer)
 
     HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR0 value = %lx", value);
 
+    may_defer &= vm_event_is_enabled(v);
+
     if ( (u32)value != value )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
@@ -2401,6 +2404,8 @@ int hvm_set_cr3(unsigned long value, bool noflush, bool may_defer)
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
 
+    may_defer &= vm_event_is_enabled(curr);
+
     if ( value >> currd->arch.cpuid->extd.maxphysaddr )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
@@ -2456,6 +2461,8 @@ int hvm_set_cr4(unsigned long value, bool may_defer)
     struct vcpu *v = current;
     unsigned long old_cr, valid = hvm_cr4_guest_valid_bits(v->domain);
 
+    may_defer &= vm_event_is_enabled(v);
+
     if ( value & ~valid )
     {
         HVM_DBG_LOG(DBG_LEVEL_1, "Bad CR4 %#lx (valid %#lx, rejected %#lx)",
@@ -3356,7 +3363,7 @@ static enum hvm_translation_result __hvm_copy(
             return HVMTRANS_bad_gfn_to_mfn;
         }
 
-        if ( unlikely(v->arch.vm_event) &&
+        if ( unlikely(vm_event_is_enabled(v)) &&
              (flags & HVMCOPY_linear) &&
              v->arch.vm_event->send_event &&
              hvm_monitor_check_p2m(addr, gfn, pfec, npfec_kind_with_gla) )
@@ -3503,7 +3510,9 @@ int hvm_vmexit_cpuid(struct cpu_user_regs *regs, unsigned int inst_len)
     regs->rcx = res.c;
     regs->rdx = res.d;
 
-    return hvm_monitor_cpuid(inst_len, leaf, subleaf);
+    return vm_event_is_enabled(curr)
+           ? hvm_monitor_cpuid(inst_len, leaf, subleaf)
+           : 0;
 }
 
 void hvm_rdtsc_intercept(struct cpu_user_regs *regs)
@@ -3635,6 +3644,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
 
     TRACE(TRC_HVM_MSR_WRITE, msr, msr_content, msr_content >> 32);
 
+    may_defer &= vm_event_is_enabled(v);
     if ( may_defer && unlikely(monitored_msr(v->domain, msr)) )
     {
         uint64_t msr_old_content;
@@ -3803,7 +3813,8 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
 
-    if ( currd->arch.monitor.descriptor_access_enabled )
+    if ( vm_event_is_enabled(curr) &&
+         currd->arch.monitor.descriptor_access_enabled )
     {
         ASSERT(curr->arch.vm_event);
         hvm_monitor_descriptor_access(exit_info, vmx_exit_qualification,
diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 702c071e89..6453a46b85 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -130,7 +130,7 @@ void asmlinkage svm_intr_assist(void)
     enum hvm_intblk intblk;
 
     /* Block event injection while handling a sync vm_event. */
-    if ( unlikely(v->arch.vm_event) && v->arch.vm_event->sync_event )
+    if ( unlikely(vm_event_is_enabled(v)) && v->arch.vm_event->sync_event )
         return;
 
     /* Crank the handle on interrupt state. */
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 564337bb4e..21f355a657 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -35,6 +35,7 @@
 #include <asm/p2m.h>
 #include <asm/paging.h>
 #include <asm/processor.h>
+#include <asm/vm_event.h>
 #include <asm/x86_emulate.h>
 
 #include <public/sched.h>
@@ -2702,7 +2703,7 @@ void asmlinkage svm_vmexit_handler(void)
         if ( !v->domain->debugger_attached )
         {
             unsigned int trap_type;
-            int rc;
+            int rc = 0;
 
             if ( likely(exit_reason != VMEXIT_ICEBP) )
             {
@@ -2718,11 +2719,14 @@ void asmlinkage svm_vmexit_handler(void)
                     break;
             }
 
-            rc = hvm_monitor_debug(regs->rip,
-                                   HVM_MONITOR_DEBUG_EXCEPTION,
-                                   trap_type, insn_len, 0);
-            if ( rc < 0 )
-                goto unexpected_exit_type;
+            if ( vm_event_is_enabled(v) )
+            {
+                rc = hvm_monitor_debug(regs->rip,
+                                       HVM_MONITOR_DEBUG_EXCEPTION,
+                                       trap_type, insn_len, 0);
+                if ( rc < 0 )
+                    goto unexpected_exit_type;
+            }
             if ( !rc )
                 hvm_inject_exception(X86_EXC_DB,
                                      trap_type, insn_len, X86_EVENT_NO_EC);
@@ -2746,9 +2750,10 @@ void asmlinkage svm_vmexit_handler(void)
         }
         else
         {
-            int rc = hvm_monitor_debug(regs->rip,
-                                       HVM_MONITOR_SOFTWARE_BREAKPOINT,
-                                       X86_ET_SW_EXC, insn_len, 0);
+            int rc = vm_event_is_enabled(v) ?
+                        hvm_monitor_debug(regs->rip,
+                                          HVM_MONITOR_SOFTWARE_BREAKPOINT,
+                                          X86_ET_SW_EXC, insn_len, 0) : 0;
             if ( rc < 0 )
                 goto unexpected_exit_type;
             if ( !rc )
@@ -2899,17 +2904,19 @@ void asmlinkage svm_vmexit_handler(void)
         break;
 
     case VMEXIT_IOIO:
-    {
-        int rc;
+        if ( vm_event_is_enabled(v) )
+        {
+            int rc;
 
-        rc = hvm_monitor_io(vmcb->ei.io.port,
-                            vmcb->ei.io.bytes,
-                            vmcb->ei.io.in,
-                            vmcb->ei.io.str);
-        if ( rc < 0 )
-            goto unexpected_exit_type;
-        if ( rc )
-            break;
+            rc = hvm_monitor_io(vmcb->ei.io.port,
+                                vmcb->ei.io.bytes,
+                                vmcb->ei.io.in,
+                                vmcb->ei.io.str);
+            if ( rc < 0 )
+                goto unexpected_exit_type;
+            if ( rc )
+                break;
+        }
 
         if ( !vmcb->ei.io.str )
         {
@@ -2921,7 +2928,6 @@ void asmlinkage svm_vmexit_handler(void)
         else if ( !hvm_emulate_one_insn(x86_insn_is_portio, "port I/O") )
             hvm_inject_hw_exception(X86_EXC_GP, 0);
         break;
-    }
 
     case VMEXIT_CR0_READ ... VMEXIT_CR15_READ:
     case VMEXIT_CR0_WRITE ... VMEXIT_CR15_WRITE:
diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index b35dc8c586..a8ced95871 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -239,7 +239,7 @@ void asmlinkage vmx_intr_assist(void)
     }
 
     /* Block event injection while handling a sync vm_event. */
-    if ( unlikely(v->arch.vm_event) && v->arch.vm_event->sync_event )
+    if ( unlikely(vm_event_is_enabled(v)) && v->arch.vm_event->sync_event )
         return;
 
 #ifdef CONFIG_MEM_SHARING
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 524bce8307..89f9d9c7f6 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -47,6 +47,7 @@
 #include <asm/shadow.h>
 #include <asm/spec_ctrl.h>
 #include <asm/stubs.h>
+#include <asm/vm_event.h>
 #include <asm/x86_emulate.h>
 
 #include <public/arch-x86/cpuid.h>
@@ -3335,7 +3336,8 @@ static int vmx_cr_access(cr_access_qual_t qual)
          * VM_EVENT_FLAG_DENY-capable application, so the hvm_monitor_crX()
          * return value is ignored for now.
          */
-        hvm_monitor_crX(CR0, value, old);
+        if ( vm_event_is_enabled(curr) )
+            hvm_monitor_crX(CR0, value, old);
         curr->arch.hvm.guest_cr[0] = value;
         vmx_update_guest_cr(curr, 0, 0);
         TRACE(TRC_HVM_CLTS);
@@ -4322,7 +4324,8 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
         p2m_set_altp2m(v, idx);
     }
 
-    if ( unlikely(currd->arch.monitor.vmexit_enabled) )
+    if ( vm_event_is_enabled(v) &&
+         unlikely(currd->arch.monitor.vmexit_enabled) )
     {
         int rc;
 
@@ -4470,19 +4473,21 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
             if ( !v->domain->debugger_attached )
             {
                 unsigned long insn_len = 0;
-                int rc;
+                int rc = 0;
                 unsigned long trap_type = MASK_EXTR(intr_info,
                                                     INTR_INFO_INTR_TYPE_MASK);
 
                 if ( trap_type >= X86_ET_SW_INT )
                     __vmread(VM_EXIT_INSTRUCTION_LEN, &insn_len);
 
-                rc = hvm_monitor_debug(regs->rip,
-                                       HVM_MONITOR_DEBUG_EXCEPTION,
-                                       trap_type, insn_len, 0);
-
-                if ( rc < 0 )
-                    goto exit_and_crash;
+                if ( vm_event_is_enabled(v) )
+                {
+                    rc = hvm_monitor_debug(regs->rip,
+                                           HVM_MONITOR_DEBUG_EXCEPTION,
+                                           trap_type, insn_len, 0);
+                    if ( rc < 0 )
+                        goto exit_and_crash;
+                }
                 if ( !rc )
                     vmx_propagate_intr(intr_info);
             }
@@ -4494,16 +4499,19 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
             if ( !v->domain->debugger_attached )
             {
                 unsigned long insn_len;
-                int rc;
+                int rc = 0;
 
                 __vmread(VM_EXIT_INSTRUCTION_LEN, &insn_len);
-                rc = hvm_monitor_debug(regs->rip,
-                                       HVM_MONITOR_SOFTWARE_BREAKPOINT,
-                                       X86_ET_SW_EXC,
-                                       insn_len, 0);
+                if ( vm_event_is_enabled(v) )
+                {
+                    rc = hvm_monitor_debug(regs->rip,
+                                           HVM_MONITOR_SOFTWARE_BREAKPOINT,
+                                           X86_ET_SW_EXC,
+                                           insn_len, 0);
 
-                if ( rc < 0 )
-                    goto exit_and_crash;
+                    if ( rc < 0 )
+                        goto exit_and_crash;
+                }
                 if ( !rc )
                     vmx_propagate_intr(intr_info);
             }
@@ -4758,16 +4766,20 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
             };
         } io_qual;
         unsigned int bytes;
-        int rc;
 
         __vmread(EXIT_QUALIFICATION, &io_qual.raw);
         bytes = io_qual.size + 1;
 
-        rc = hvm_monitor_io(io_qual.port, bytes, io_qual.in, io_qual.str);
-        if ( rc < 0 )
-            goto exit_and_crash;
-        if ( rc )
-            break;
+        if ( vm_event_is_enabled(v) )
+        {
+            int rc;
+
+            rc = hvm_monitor_io(io_qual.port, bytes, io_qual.in, io_qual.str);
+            if ( rc < 0 )
+                goto exit_and_crash;
+            if ( rc )
+                break;
+        }
 
         if ( io_qual.str )
         {
@@ -4821,9 +4833,10 @@ void asmlinkage vmx_vmexit_handler(struct cpu_user_regs *regs)
         vmx_update_cpu_exec_control(v);
         if ( v->arch.hvm.single_step )
         {
-            hvm_monitor_debug(regs->rip,
-                              HVM_MONITOR_SINGLESTEP_BREAKPOINT,
-                              0, 0, 0);
+            if ( vm_event_is_enabled(v) )
+                hvm_monitor_debug(regs->rip,
+                                  HVM_MONITOR_SINGLESTEP_BREAKPOINT,
+                                  0, 0, 0);
 
             if ( v->domain->debugger_attached )
                 domain_pause_for_debugger();
diff --git a/xen/arch/x86/include/asm/vm_event.h b/xen/arch/x86/include/asm/vm_event.h
index 46e77ed6d9..0310f30c18 100644
--- a/xen/arch/x86/include/asm/vm_event.h
+++ b/xen/arch/x86/include/asm/vm_event.h
@@ -45,4 +45,9 @@ void vm_event_sync_event(struct vcpu *v, bool value);
 
 void vm_event_reset_vmtrace(struct vcpu *v);
 
+static inline bool vm_event_is_enabled(const struct vcpu *v)
+{
+    return IS_ENABLED(CONFIG_VM_EVENT) && v->arch.vm_event != NULL;
+}
+
 #endif /* __ASM_X86_VM_EVENT_H__ */
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 4787b27964..b5a259af1d 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -648,6 +648,9 @@ int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
         .u.mem_sharing.p2mt = p2m_ram_shared,
     };
 
+    if ( !vm_event_is_enabled(current) )
+        return -EOPNOTSUPP;
+
     if ( (rc = __vm_event_claim_slot(
               d, d->vm_event_share, allow_sleep)) < 0 )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 11:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 11:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208093.1520325 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnVb-0002iB-Px; Mon, 19 Jan 2026 11:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208093.1520325; Mon, 19 Jan 2026 11: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 1vhnVb-0002i3-Mj; Mon, 19 Jan 2026 11:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1208093;
 Mon, 19 Jan 2026 11: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 1vhnVa-0002hl-55
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 11: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 1vhnVa-00B7r1-1U
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhnVa-009y65-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11: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=JwgVD/FR5hWFv7EBsuoq5nOEa2s84gNK7gNdjcwsvcM=; b=JawTFt3GF1rOZ73m0/PJPP5PSE
	ywgVy6dL2I8fNJsJSkjtIaWglOxWVm+9P7Tn1j76zlKEvRCF5y9vgBCs9eR+EIZvemrpbBWIIe3vX
	3kdEbqq40N9/xxABJYco/uKhsylnd5lZuyLCFTeUTB3/tZa7YMcWlAHosxTgIsi2wmjo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/monitor: wrap monitor_op under CONFIG_VM_EVENT
Message-Id: <E1vhnVa-009y65-0E@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 11:33:22 +0000

commit 0f45da409846a799d603e72b08f3c25244b7be62
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:38 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 09:15:50 2026 +0100

    x86/monitor: wrap monitor_op under CONFIG_VM_EVENT
    
    Feature monitor_op is based on vm event subsystem, so monitor.o shall be
    wrapped under CONFIG_VM_EVENT.
    The following functions are only invoked by monitor-op, so they all shall be
    wrapped with CONFIG_VM_EVENT (otherwise they will become unreachable and
    violate Misra rule 2.1 when VM_EVENT=n):
    - hvm_enable_msr_interception
      - hvm_function_table.enable_msr_interception
    - hvm_has_set_descriptor_access_existing
      - hvm_function_table.set_descriptor_access_existi
    - arch_monitor_get_capabilities
    Function monitored_msr() still needs a stub to pass compilation when
    VM_EVENT=n.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/Makefile          |  2 +-
 xen/arch/x86/hvm/svm/svm.c         |  8 +++++++-
 xen/arch/x86/hvm/vmx/vmx.c         | 10 ++++++++++
 xen/arch/x86/include/asm/hvm/hvm.h | 18 +++++++++++-------
 xen/arch/x86/include/asm/monitor.h |  9 +++++++++
 5 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index 1b97bdc624..ee4b45a4ee 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -16,7 +16,7 @@ obj-y += io.o
 obj-y += ioreq.o
 obj-y += irq.o
 obj-y += mmio.o
-obj-y += monitor.o
+obj-$(CONFIG_VM_EVENT) += monitor.o
 obj-y += mtrr.o
 obj-y += nestedhvm.o
 obj-y += pmtimer.o
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 21f355a657..5d23603fc1 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -297,6 +297,7 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags)
         __clear_bit(msr * 2 + 1, msr_bit);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check svm_enable_msr_interception(struct domain *d, uint32_t msr)
 {
     struct vcpu *v;
@@ -304,6 +305,7 @@ static void cf_check svm_enable_msr_interception(struct domain *d, uint32_t msr)
     for_each_vcpu ( d, v )
         svm_intercept_msr(v, msr, MSR_INTERCEPT_WRITE);
 }
+#endif /* CONFIG_VM_EVENT */
 
 static void svm_save_dr(struct vcpu *v)
 {
@@ -824,6 +826,7 @@ static void cf_check svm_set_rdtsc_exiting(struct vcpu *v, bool enable)
     vmcb_set_general2_intercepts(vmcb, general2_intercepts);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check svm_set_descriptor_access_exiting(
     struct vcpu *v, bool enable)
 {
@@ -841,6 +844,7 @@ static void cf_check svm_set_descriptor_access_exiting(
 
     vmcb_set_general1_intercepts(vmcb, general1_intercepts);
 }
+#endif /* CONFIG_VM_EVENT */
 
 static unsigned int cf_check svm_get_insn_bytes(struct vcpu *v, uint8_t *buf)
 {
@@ -2454,9 +2458,11 @@ static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
     .fpu_dirty_intercept  = svm_fpu_dirty_intercept,
     .msr_read_intercept   = svm_msr_read_intercept,
     .msr_write_intercept  = svm_msr_write_intercept,
+#ifdef CONFIG_VM_EVENT
     .enable_msr_interception = svm_enable_msr_interception,
-    .set_rdtsc_exiting    = svm_set_rdtsc_exiting,
     .set_descriptor_access_exiting = svm_set_descriptor_access_exiting,
+#endif
+    .set_rdtsc_exiting    = svm_set_rdtsc_exiting,
     .get_insn_bytes       = svm_get_insn_bytes,
 
     .nhvm_vcpu_initialise = nsvm_vcpu_initialise,
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 89f9d9c7f6..40e4c71244 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1581,6 +1581,7 @@ static void cf_check vmx_set_rdtsc_exiting(struct vcpu *v, bool enable)
     vmx_vmcs_exit(v);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check vmx_set_descriptor_access_exiting(
     struct vcpu *v, bool enable)
 {
@@ -1595,6 +1596,7 @@ static void cf_check vmx_set_descriptor_access_exiting(
     vmx_update_secondary_exec_control(v);
     vmx_vmcs_exit(v);
 }
+#endif /* CONFIG_VM_EVENT */
 
 static void cf_check vmx_init_hypercall_page(void *p)
 {
@@ -2474,6 +2476,7 @@ static void cf_check vmx_handle_eoi(uint8_t vector, int isr)
         printk_once(XENLOG_WARNING "EOI for %02x but SVI=%02x\n", vector, old_svi);
 }
 
+#ifdef CONFIG_VM_EVENT
 static void cf_check vmx_enable_msr_interception(struct domain *d, uint32_t msr)
 {
     struct vcpu *v;
@@ -2481,6 +2484,7 @@ static void cf_check vmx_enable_msr_interception(struct domain *d, uint32_t msr)
     for_each_vcpu ( d, v )
         vmx_set_msr_intercept(v, msr, VMX_MSR_W);
 }
+#endif /* CONFIG_VM_EVENT */
 
 #ifdef CONFIG_ALTP2M
 
@@ -2932,7 +2936,9 @@ static struct hvm_function_table __initdata_cf_clobber vmx_function_table = {
     .nhvm_domain_relinquish_resources = nvmx_domain_relinquish_resources,
     .update_vlapic_mode = vmx_vlapic_msr_changed,
     .nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m,
+#ifdef CONFIG_VM_EVENT
     .enable_msr_interception = vmx_enable_msr_interception,
+#endif
 #ifdef CONFIG_ALTP2M
     .altp2m_vcpu_update_p2m = vmx_vcpu_update_eptp,
     .altp2m_vcpu_update_vmfunc_ve = vmx_vcpu_update_vmfunc_ve,
@@ -3141,9 +3147,11 @@ const struct hvm_function_table * __init start_vmx(void)
 
     vmx_function_table.caps.singlestep = cpu_has_monitor_trap_flag;
 
+#ifdef CONFIG_VM_EVENT
     if ( cpu_has_vmx_dt_exiting )
         vmx_function_table.set_descriptor_access_exiting =
             vmx_set_descriptor_access_exiting;
+#endif
 
     /*
      * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
@@ -3214,8 +3222,10 @@ void __init vmx_fill_funcs(void)
     if ( !cpu_has_xen_ibt )
         return;
 
+#ifdef CONFIG_VM_EVENT
     vmx_function_table.set_descriptor_access_exiting =
         vmx_set_descriptor_access_exiting;
+#endif
 
     vmx_function_table.update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap;
     vmx_function_table.process_isr            = vmx_process_isr;
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 666fa402a8..af042ae858 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -192,7 +192,11 @@ struct hvm_function_table {
     void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool enable);
+
+#ifdef CONFIG_VM_EVENT
     void (*set_descriptor_access_exiting)(struct vcpu *v, bool enable);
+    void (*enable_msr_interception)(struct domain *d, uint32_t msr);
+#endif
 
     /* Nested HVM */
     int (*nhvm_vcpu_initialise)(struct vcpu *v);
@@ -224,8 +228,6 @@ struct hvm_function_table {
                                 paddr_t *L1_gpa, unsigned int *page_order,
                                 uint8_t *p2m_acc, struct npfec npfec);
 
-    void (*enable_msr_interception)(struct domain *d, uint32_t msr);
-
 #ifdef CONFIG_ALTP2M
     /* Alternate p2m */
     void (*altp2m_vcpu_update_p2m)(struct vcpu *v);
@@ -435,11 +437,18 @@ static inline bool using_svm(void)
 
 #define hvm_long_mode_active(v) (!!((v)->arch.hvm.guest_efer & EFER_LMA))
 
+#ifdef CONFIG_VM_EVENT
 static inline bool hvm_has_set_descriptor_access_exiting(void)
 {
     return hvm_funcs.set_descriptor_access_exiting;
 }
 
+static inline void hvm_enable_msr_interception(struct domain *d, uint32_t msr)
+{
+    alternative_vcall(hvm_funcs.enable_msr_interception, d, msr);
+}
+#endif /* CONFIG_VM_EVENT */
+
 static inline void hvm_domain_creation_finished(struct domain *d)
 {
     if ( hvm_funcs.domain_creation_finished )
@@ -681,11 +690,6 @@ static inline int nhvm_hap_walk_L1_p2m(
         v, L2_gpa, L1_gpa, page_order, p2m_acc, npfec);
 }
 
-static inline void hvm_enable_msr_interception(struct domain *d, uint32_t msr)
-{
-    alternative_vcall(hvm_funcs.enable_msr_interception, d, msr);
-}
-
 static inline bool hvm_is_singlestep_supported(void)
 {
     return hvm_funcs.caps.singlestep;
diff --git a/xen/arch/x86/include/asm/monitor.h b/xen/arch/x86/include/asm/monitor.h
index 3c64d8258f..9249324fd0 100644
--- a/xen/arch/x86/include/asm/monitor.h
+++ b/xen/arch/x86/include/asm/monitor.h
@@ -71,6 +71,7 @@ int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop)
     return rc;
 }
 
+#ifdef CONFIG_VM_EVENT
 static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
 {
     uint32_t capabilities = 0;
@@ -102,6 +103,7 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
 
     return capabilities;
 }
+#endif /* CONFIG_VM_EVENT */
 
 int arch_monitor_domctl_event(struct domain *d,
                               struct xen_domctl_monitor_op *mop);
@@ -123,7 +125,14 @@ static inline void arch_monitor_cleanup_domain(struct domain *d) {}
 
 #endif
 
+#ifdef CONFIG_VM_EVENT
 bool monitored_msr(const struct domain *d, u32 msr);
+#else
+static inline bool monitored_msr(const struct domain *d, u32 msr)
+{
+    return false;
+}
+#endif
 bool monitored_msr_onchangeonly(const struct domain *d, u32 msr);
 
 #endif /* __ASM_X86_MONITOR_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 11:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 11:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208094.1520329 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnVl-0002kX-Qz; Mon, 19 Jan 2026 11:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208094.1520329; Mon, 19 Jan 2026 11: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 1vhnVl-0002kP-OA; Mon, 19 Jan 2026 11:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1208094;
 Mon, 19 Jan 2026 11: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 1vhnVk-0002kG-90
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 11: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 1vhnVk-00B7rJ-1r
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhnVk-009y7W-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11: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=z3L5JFh+cRnxAxvLr9Pynb3FGy56Q857Ky3u3QYHysQ=; b=Uf1DCHac8onzomiACN9yBm0JHG
	nOHJQKmCjI6O0NCla34j0V6KEZQqXSy8enwFvstsI446KV/5diXPev2XecWoGFVbB1wo0fdSC+ReE
	sYpw5lIwQjEhrUmH7d3Ym5kSJ+H2zzypx5ZS74RsCK+XhsDULIacXC4qYpKjj7Dj+H3o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/p2m: move xenmem_access_to_p2m_access() to common p2m.c
Message-Id: <E1vhnVk-009y7W-0c@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 11:33:32 +0000

commit 0288e87afca2b0602e625577d559929339943846
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:39 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 10:06:10 2026 +0100

    xen/p2m: move xenmem_access_to_p2m_access() to common p2m.c
    
    Memory access and ALTP2M are two seperate features, while both depending on
    helper xenmem_access_to_p2m_access(). So it betters lives in common p2m.c,
    other than mem_access.c which will be compiled out when VM_EVENT=n && ALTP2M=y.
    Guard xenmem_access_to_p2m_access() with VM_EVENT || ALTP2M, otherwise it
    will become unreachable when both VM_EVENT=n and ALTP2M=n, and hence
    violating Misra rule 2.1.
    Also move declaration from xen/mem_access.h to x86'es one, requiring to also
    move the inclusion point and condition of asm/mem_access.h there.
    An extra blank line is inserted after each case-block to correct coding
    style at the same time.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/include/asm/mem_access.h |  5 +++++
 xen/arch/x86/mm/mem_access.c          | 36 -------------------------------
 xen/arch/x86/mm/p2m.c                 | 40 +++++++++++++++++++++++++++++++++++
 xen/include/xen/mem_access.h          | 11 +++-------
 4 files changed, 48 insertions(+), 44 deletions(-)

diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 257ed33de1..84af05a8c6 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -34,6 +34,11 @@ bool p2m_mem_access_emulate_check(struct vcpu *v,
 /* Sanity check for mem_access hardware support */
 bool p2m_mem_access_sanity_check(const struct domain *d);
 
+struct p2m_domain;
+bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
+                                 xenmem_access_t xaccess,
+                                 p2m_access_t *paccess);
+
 #endif /*__ASM_X86_MEM_ACCESS_H__ */
 
 /*
diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c
index e6b609064c..e55e53f44c 100644
--- a/xen/arch/x86/mm/mem_access.c
+++ b/xen/arch/x86/mm/mem_access.c
@@ -298,42 +298,6 @@ static int set_mem_access(struct domain *d, struct p2m_domain *p2m,
     return rc;
 }
 
-bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
-                                 xenmem_access_t xaccess,
-                                 p2m_access_t *paccess)
-{
-    static const p2m_access_t memaccess[] = {
-#define ACCESS(ac) [XENMEM_access_##ac] = p2m_access_##ac
-        ACCESS(n),
-        ACCESS(r),
-        ACCESS(w),
-        ACCESS(rw),
-        ACCESS(x),
-        ACCESS(rx),
-        ACCESS(wx),
-        ACCESS(rwx),
-        ACCESS(rx2rw),
-        ACCESS(n2rwx),
-        ACCESS(r_pw),
-#undef ACCESS
-    };
-
-    switch ( xaccess )
-    {
-    case 0 ... ARRAY_SIZE(memaccess) - 1:
-        xaccess = array_index_nospec(xaccess, ARRAY_SIZE(memaccess));
-        *paccess = memaccess[xaccess];
-        break;
-    case XENMEM_access_default:
-        *paccess = p2m->default_access;
-        break;
-    default:
-        return false;
-    }
-
-    return true;
-}
-
 /*
  * Set access type for a region of gfns.
  * If gfn == INVALID_GFN, sets the default access type.
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 759f3273d3..8d34357bcb 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2203,6 +2203,46 @@ void p2m_log_dirty_range(struct domain *d, unsigned long begin_pfn,
     guest_flush_tlb_mask(d, d->dirty_cpumask);
 }
 
+#if defined(CONFIG_VM_EVENT) || defined(CONFIG_ALTP2M)
+bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
+                                 xenmem_access_t xaccess,
+                                 p2m_access_t *paccess)
+{
+    static const p2m_access_t memaccess[] = {
+#define ACCESS(ac) [XENMEM_access_##ac] = p2m_access_##ac
+        ACCESS(n),
+        ACCESS(r),
+        ACCESS(w),
+        ACCESS(rw),
+        ACCESS(x),
+        ACCESS(rx),
+        ACCESS(wx),
+        ACCESS(rwx),
+        ACCESS(rx2rw),
+        ACCESS(n2rwx),
+        ACCESS(r_pw),
+#undef ACCESS
+    };
+
+    switch ( xaccess )
+    {
+    case 0 ... ARRAY_SIZE(memaccess) - 1:
+        xaccess = array_index_nospec(xaccess, ARRAY_SIZE(memaccess));
+        *paccess = memaccess[xaccess];
+        break;
+
+    case XENMEM_access_default:
+        *paccess = p2m->default_access;
+        break;
+
+    default:
+        return false;
+    }
+
+    return true;
+}
+#endif /* VM_EVENT || ALTP2M */
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h
index 4de651038d..998ec680d4 100644
--- a/xen/include/xen/mem_access.h
+++ b/xen/include/xen/mem_access.h
@@ -33,10 +33,6 @@
  */
 struct vm_event_st;
 
-#ifdef CONFIG_VM_EVENT
-#include <asm/mem_access.h>
-#endif
-
 /*
  * Additional access types, which are used to further restrict
  * the permissions given my the p2m_type_t memory type.  Violations
@@ -73,10 +69,9 @@ typedef enum {
     /* NOTE: Assumed to be only 4 bits right now on x86. */
 } p2m_access_t;
 
-struct p2m_domain;
-bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m,
-                                 xenmem_access_t xaccess,
-                                 p2m_access_t *paccess);
+#if defined(CONFIG_VM_EVENT) || defined(CONFIG_ALTP2M)
+#include <asm/mem_access.h>
+#endif
 
 /*
  * Set access type for a region of gfns.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 11:33:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 11:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208095.1520333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnVv-0002mh-SF; Mon, 19 Jan 2026 11:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208095.1520333; Mon, 19 Jan 2026 11: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 1vhnVv-0002mZ-Pf; Mon, 19 Jan 2026 11:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1208095;
 Mon, 19 Jan 2026 11: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 1vhnVu-0002mT-DB
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 11: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 1vhnVu-00B7rr-28
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhnVu-009y8m-0y
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11: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=CUbqOM1d9Ib758PCHY+4WBzbCMrP4Pw+jkTemK+1Mn0=; b=QMnH7RdgYw/3OWXauvhaxIxqyI
	9bmiDug8RFx9T9E5X+DUz4VAQPoxLCnHvCTMZWmTCYaVQbMK0cU0LomJqVsysO8Ebp/vzIo5YBLkW
	E+bUnInABy8Lua7Uww83DCWEMTQdSEAfBkwi5Ydevm/aNv7v0ZwR3zLGhP1eiBna3mzc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mem_access: wrap memory access when VM_EVENT=n
Message-Id: <E1vhnVu-009y8m-0y@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 11:33:42 +0000

commit b18e38e42da66ec7eb54a9606cf3a321b01efa0d
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:40 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 10:07:02 2026 +0100

    xen/mem_access: wrap memory access when VM_EVENT=n
    
    Feature memory access is based on vm event subsystem, and it could be disabled
    in the future. So a few switch-blocks in do_altp2m_op() need
    vm_event_is_enabled() condition check to pass compilation when ALTP2M=y and
    VM_EVENT=n(, hence MEM_ACCESS=n), like HVMOP_altp2m_set_mem_access, etc.
    Function p2m_mem_access_check() still needs stub when VM_EVENT=n to
    pass compilation.
    Although local variable "req_ptr" still remains NULL throughout its lifetime,
    with the change of NULL assignment, we will face runtime undefined error only
    when CONFIG_USBAN is on. So we strengthen the condition check via adding
    vm_event_is_enabled() for the special case.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/hvm.c                | 26 +++++++++++++++++++++++++-
 xen/arch/x86/include/asm/mem_access.h | 10 ++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 07e54890d9..b34cd29629 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -52,6 +52,7 @@
 #include <asm/i387.h>
 #include <asm/mc146818rtc.h>
 #include <asm/mce.h>
+#include <asm/mem_access.h>
 #include <asm/monitor.h>
 #include <asm/msr.h>
 #include <asm/mtrr.h>
@@ -2082,7 +2083,12 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
 #endif
     }
 
-    if ( req_ptr )
+    /*
+     * req_ptr being constant NULL when !CONFIG_VM_EVENT, CONFIG_UBSAN=y
+     * builds have been observed to still hit undefined-ness at runtime.
+     * Hence do a seemingly redundant vm_event_is_enabled() check here.
+     */
+    if ( req_ptr && vm_event_is_enabled(curr) )
     {
         if ( monitor_traps(curr, sync, req_ptr) < 0 )
             rc = 0;
@@ -4804,6 +4810,12 @@ static int do_altp2m_op(
         break;
 
     case HVMOP_altp2m_set_mem_access:
+        if ( !vm_event_is_enabled(current) )
+        {
+            rc = -EOPNOTSUPP;
+            break;
+        }
+
         if ( a.u.mem_access.pad )
             rc = -EINVAL;
         else
@@ -4813,6 +4825,12 @@ static int do_altp2m_op(
         break;
 
     case HVMOP_altp2m_set_mem_access_multi:
+        if ( !vm_event_is_enabled(current) )
+        {
+            rc = -EOPNOTSUPP;
+            break;
+        }
+
         if ( a.u.set_mem_access_multi.pad ||
              a.u.set_mem_access_multi.opaque > a.u.set_mem_access_multi.nr )
         {
@@ -4844,6 +4862,12 @@ static int do_altp2m_op(
         break;
 
     case HVMOP_altp2m_get_mem_access:
+        if ( !vm_event_is_enabled(current) )
+        {
+            rc = -EOPNOTSUPP;
+            break;
+        }
+
         if ( a.u.mem_access.pad )
             rc = -EINVAL;
         else
diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/asm/mem_access.h
index 84af05a8c6..e2cb10cd32 100644
--- a/xen/arch/x86/include/asm/mem_access.h
+++ b/xen/arch/x86/include/asm/mem_access.h
@@ -14,6 +14,7 @@
 #ifndef __ASM_X86_MEM_ACCESS_H__
 #define __ASM_X86_MEM_ACCESS_H__
 
+#ifdef CONFIG_VM_EVENT
 /*
  * Setup vm_event request based on the access (gla is -1ull if not available).
  * Handles the rw2rx conversion. Boolean return value indicates if event type
@@ -25,6 +26,15 @@
 bool p2m_mem_access_check(paddr_t gpa, unsigned long gla,
                           struct npfec npfec,
                           struct vm_event_st **req_ptr);
+#else
+static inline bool p2m_mem_access_check(paddr_t gpa, unsigned long gla,
+                                        struct npfec npfec,
+                                        struct vm_event_st **req_ptr)
+{
+    *req_ptr = NULL;
+    return false;
+}
+#endif /* CONFIG_VM_EVENT */
 
 /* Check for emulation and mark vcpu for skipping one instruction
  * upon rescheduling if required. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 11:33:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 11:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208096.1520338 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnW5-0002qJ-UI; Mon, 19 Jan 2026 11:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208096.1520338; Mon, 19 Jan 2026 11: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 1vhnW5-0002qB-R3; Mon, 19 Jan 2026 11:33:53 +0000
Received: by outflank-mailman (input) for mailman id 1208096;
 Mon, 19 Jan 2026 11: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 1vhnW4-0002q3-Eu
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 11: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 1vhnW4-00B7s7-2T
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhnW4-009y9U-1G
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11: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=BJpDjO3Z8o7va4I/wyie3bJjpfFC/gBZYKjTzANsiqY=; b=kxw2CnOju+GraWj4ayZvBMjydr
	naOeUKk1TdYgWrcyROiO574NcjFdOURftBlSYIxf1sriMRzyMYTBDVPeHZRFRyP+2P7JcxUV0lN7f
	akKxgouFfI3Zg3gUIIWIvEAXpv7f5KjVHiiCGEzVp4VvJI6DnRO3Ob5K359Uw6FF1DTY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vm_event: consolidate CONFIG_VM_EVENT
Message-Id: <E1vhnW4-009y9U-1G@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 11:33:52 +0000

commit e70e76654cc092542cbd506ff3e9653a9ededcdf
Author:     Penny Zheng <Penny.Zheng@amd.com>
AuthorDate: Thu Jan 15 17:28:41 2026 +0800
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 19 10:07:28 2026 +0100

    xen/vm_event: consolidate CONFIG_VM_EVENT
    
    File hvm/vm_event.c and x86/vm_event.c are the extend to vm_event handling
    routines, and its compilation shall be guarded by CONFIG_VM_EVENT too.
    
    Although CONFIG_VM_EVENT is right now forcibly enabled on x86 via
    MEM_ACCESS_ALWAYS_ON, we could disable it through disabling
    CONFIG_MGMT_HYPERCALLS later. So we remove MEM_ACCESS_ALWAYS_ON and
    make VM_EVENT=y on default only on x86 to retain the same.
    
    The following functions are developed on the basis of vm event framework, or
    only invoked by vm_event.c, so they all shall be wrapped with CONFIG_VM_EVENT
    (otherwise they will become unreachable and
    violate Misra rule 2.1 when VM_EVENT=n):
    - hvm_toggle_singlestep
    - hvm_fast_singlestep
    - hvm_emulate_one_vm_event
        - hvmemul_write{,cmpxchg,rep_ins,rep_outs,rep_movs,rep_stos,read_io,write_io}_discard
    And Function vm_event_check_ring() needs stub to pass compilation when
    VM_EVENT=n.
    
    Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/Makefile      |  2 +-
 xen/arch/x86/hvm/Kconfig   |  1 -
 xen/arch/x86/hvm/Makefile  |  2 +-
 xen/arch/x86/hvm/emulate.c | 58 +++++++++++++++++++++++++---------------------
 xen/arch/x86/hvm/hvm.c     |  2 ++
 xen/common/Kconfig         |  7 ++----
 xen/include/xen/vm_event.h |  7 ++++++
 7 files changed, 44 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d8b41cec16..5bf3578983 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -69,7 +69,7 @@ obj-$(CONFIG_INTEL) += tsx.o
 obj-y += x86_emulate.o
 obj-$(CONFIG_TBOOT) += tboot.o
 obj-y += hpet.o
-obj-y += vm_event.o
+obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-y += xstate.o
 
 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig
index c1a131d185..25eb3e374f 100644
--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -4,7 +4,6 @@ menuconfig HVM
 	default !PV_SHIM
 	select COMPAT
 	select IOREQ_SERVER
-	select MEM_ACCESS_ALWAYS_ON
 	help
 	  Interfaces to support HVM domains.  HVM domains require hardware
 	  virtualisation extensions (e.g. Intel VT-x, AMD SVM), but can boot
diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index ee4b45a4ee..f34fb03934 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -26,7 +26,7 @@ obj-y += save.o
 obj-y += stdvga.o
 obj-y += vioapic.o
 obj-y += vlapic.o
-obj-y += vm_event.o
+obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-y += vmsi.o
 obj-y += vpic.o
 obj-y += vpt.o
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index fe75b0516d..d56ef02baf 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1615,6 +1615,7 @@ static int cf_check hvmemul_blk(
     return rc;
 }
 
+#ifdef CONFIG_VM_EVENT
 static int cf_check hvmemul_write_discard(
     enum x86_segment seg,
     unsigned long offset,
@@ -1717,6 +1718,7 @@ static int cf_check hvmemul_cache_op_discard(
 {
     return X86EMUL_OKAY;
 }
+#endif /* CONFIG_VM_EVENT */
 
 static int cf_check hvmemul_cmpxchg(
     enum x86_segment seg,
@@ -2750,33 +2752,6 @@ static const struct x86_emulate_ops hvm_emulate_ops = {
     .vmfunc        = hvmemul_vmfunc,
 };
 
-static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
-    .read          = hvmemul_read,
-    .insn_fetch    = hvmemul_insn_fetch,
-    .write         = hvmemul_write_discard,
-    .cmpxchg       = hvmemul_cmpxchg_discard,
-    .rep_ins       = hvmemul_rep_ins_discard,
-    .rep_outs      = hvmemul_rep_outs_discard,
-    .rep_movs      = hvmemul_rep_movs_discard,
-    .rep_stos      = hvmemul_rep_stos_discard,
-    .read_segment  = hvmemul_read_segment,
-    .write_segment = hvmemul_write_segment,
-    .read_io       = hvmemul_read_io_discard,
-    .write_io      = hvmemul_write_io_discard,
-    .read_cr       = hvmemul_read_cr,
-    .write_cr      = hvmemul_write_cr,
-    .read_xcr      = hvmemul_read_xcr,
-    .write_xcr     = hvmemul_write_xcr,
-    .read_msr      = hvmemul_read_msr,
-    .write_msr     = hvmemul_write_msr_discard,
-    .cache_op      = hvmemul_cache_op_discard,
-    .tlb_op        = hvmemul_tlb_op,
-    .cpuid         = x86emul_cpuid,
-    .get_fpu       = hvmemul_get_fpu,
-    .put_fpu       = hvmemul_put_fpu,
-    .vmfunc        = hvmemul_vmfunc,
-};
-
 /*
  * Note that passing VIO_no_completion into this function serves as kind
  * of (but not fully) an "auto select completion" indicator.  When there's
@@ -2887,6 +2862,34 @@ int hvm_emulate_one(
     return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops, completion);
 }
 
+#ifdef CONFIG_VM_EVENT
+static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
+    .read          = hvmemul_read,
+    .insn_fetch    = hvmemul_insn_fetch,
+    .write         = hvmemul_write_discard,
+    .cmpxchg       = hvmemul_cmpxchg_discard,
+    .rep_ins       = hvmemul_rep_ins_discard,
+    .rep_outs      = hvmemul_rep_outs_discard,
+    .rep_movs      = hvmemul_rep_movs_discard,
+    .rep_stos      = hvmemul_rep_stos_discard,
+    .read_segment  = hvmemul_read_segment,
+    .write_segment = hvmemul_write_segment,
+    .read_io       = hvmemul_read_io_discard,
+    .write_io      = hvmemul_write_io_discard,
+    .read_cr       = hvmemul_read_cr,
+    .write_cr      = hvmemul_write_cr,
+    .read_xcr      = hvmemul_read_xcr,
+    .write_xcr     = hvmemul_write_xcr,
+    .read_msr      = hvmemul_read_msr,
+    .write_msr     = hvmemul_write_msr_discard,
+    .cache_op      = hvmemul_cache_op_discard,
+    .tlb_op        = hvmemul_tlb_op,
+    .cpuid         = x86emul_cpuid,
+    .get_fpu       = hvmemul_get_fpu,
+    .put_fpu       = hvmemul_put_fpu,
+    .vmfunc        = hvmemul_vmfunc,
+};
+
 void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     unsigned int errcode)
 {
@@ -2949,6 +2952,7 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
 
     hvm_emulate_writeback(&ctx);
 }
+#endif /* CONFIG_VM_EVENT */
 
 void hvm_emulate_init_once(
     struct hvm_emulate_ctxt *hvmemul_ctxt,
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b34cd29629..4d37a93c57 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5250,6 +5250,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op)
     return rc;
 }
 
+#ifdef CONFIG_VM_EVENT
 void hvm_toggle_singlestep(struct vcpu *v)
 {
     ASSERT(atomic_read(&v->pause_count));
@@ -5276,6 +5277,7 @@ void hvm_fast_singlestep(struct vcpu *v, uint16_t p2midx)
     v->arch.hvm.fast_single_step.p2midx = p2midx;
 }
 #endif
+#endif /* CONFIG_VM_EVENT */
 
 /*
  * Segment caches in VMCB/VMCS are inconsistent about which bits are checked,
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 38320b248a..d7e79e752a 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -173,13 +173,10 @@ config HAS_VMAP
 config LIBFDT
 	bool
 
-config MEM_ACCESS_ALWAYS_ON
-	bool
-
 config VM_EVENT
-	def_bool MEM_ACCESS_ALWAYS_ON
-	prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
+	bool "Memory Access and VM events"
 	depends on HVM
+	default X86
 	help
 
 	  Framework to configure memory access types for guests and receive
diff --git a/xen/include/xen/vm_event.h b/xen/include/xen/vm_event.h
index 27d0c74216..1b76ce632e 100644
--- a/xen/include/xen/vm_event.h
+++ b/xen/include/xen/vm_event.h
@@ -51,7 +51,14 @@ struct vm_event_domain
 };
 
 /* Returns whether a ring has been set up */
+#ifdef CONFIG_VM_EVENT
 bool vm_event_check_ring(struct vm_event_domain *ved);
+#else
+static inline bool vm_event_check_ring(struct vm_event_domain *ved)
+{
+    return false;
+}
+#endif /* CONFIG_VM_EVENT */
 
 /* Returns 0 on success, -ENOSYS if there is no ring, -EBUSY if there is no
  * available space and the caller is a foreign domain. If the guest itself
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 11:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 11:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208097.1520340 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnfv-0003z6-LY; Mon, 19 Jan 2026 11:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208097.1520340; Mon, 19 Jan 2026 11:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhnfv-0003yy-Iy; Mon, 19 Jan 2026 11:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1208097;
 Mon, 19 Jan 2026 11: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 1vhnft-0003ys-NI
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 11: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 1vhnft-00B84l-3A
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhnft-009zHE-1m
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 11:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4oBimbUw/cLbBQYCFrwE0IJe2patAWkuVfduzqwH5Q0=; b=HBiJsaZxPdbANGX6ICMmMyqw7K
	ckCHjithc5B2LqUHKOOLIXYNRxwlR6IoQho4SbOszM4H6+6gqF8EE9kw55PNrDvODSKQaMRXdslHy
	J4+EkXYYOvUT2Y0iD/Eg/oCv4lQh7LSG8Q0K2q0tLP9DM471Dd50EnkkG2stzKS3t53M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dom0less: Calculate guest DTB size based on MAX_VIRT_CPUS
Message-Id: <E1vhnft-009zHE-1m@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 11:44:01 +0000

commit e80f4da85b29f888c0644749b0a4ab29a9f2f6ca
Author:     Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
AuthorDate: Wed Dec 17 08:12:48 2025 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Jan 19 12:32:15 2026 +0100

    xen/dom0less: Calculate guest DTB size based on MAX_VIRT_CPUS
    
    Creating a dom0less guest with a high vCPU count (e.g., >32) fails
    because the fixed 4KiB device tree buffer (DOMU_DTB_SIZE) overflows
    during creation.
    
    The FDT nodes for each vCPU are the primary consumer of space,
    and the previous fixed-size buffer was insufficient.
    
    This patch replaces the fixed size with a formula that calculates
    the required buffer size based on a fixed baseline plus a scalable
    portion for each potential vCPU up to the MAX_VIRT_CPUS limit.
    
    Please note, the change to DOMU_DTB_SIZE formula would result in
    a smaller buffer size of 3072 bytes compared to the original 4096 bytes
    on Arm32 platforms where MAX_VIRT_CPUS is 8.
    
    ***
    
    The following tests were done to confirm that the proposed formula
    fits:
    
    1. Arm64 testing with varying vCPU counts (MAX_VIRT_CPUS=128),
       final compacted FDT size:
    
       - 1 vCPU: 1586 bytes (with 18432 byte buffer)
       - 2 vCPUs: 1698 bytes
       - 32 vCPUs: 5058 bytes
       - 128 vCPUs: 15810 bytes
    
    2. Arm64 testing with simulated Arm32 conditions (MAX_VIRT_CPUS=8),
       final compacted FDT size:
    
       - 1 vCPU: 1586 bytes (with 3072 byte buffer)
       - 8 vCPUs: 2370 bytes
    
    3. Arm32 testing (MAX_VIRT_CPUS=8),
       final compacted FDT size:
    
       - 8 vCPUs: 1127 bytes (with 3072 byte buffer)
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Grygorii Strashko <grygorii_strashko@epam.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Tested-by: Harry Ramsey <harry.ramsey@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dom0less-build.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 495ef7b16a..840d14419d 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -439,15 +439,25 @@ static int __init domain_handle_dtb_boot_module(struct domain *d,
 
 /*
  * The max size for DT is 2MB. However, the generated DT is small (not including
- * domU passthrough DT nodes whose size we account separately), 4KB are enough
- * for now, but we might have to increase it in the future.
+ * domU passthrough DT nodes whose size we account separately). The size is
+ * calculated from a fixed baseline plus a scalable portion for each potential
+ * vCPU node up to the system limit (MAX_VIRT_CPUS), as the vCPU nodes are
+ * the primary consumer of space.
+ *
+ * The baseline of 2KiB is a safe buffer for all non-vCPU FDT content.
+ * Empirical testing with the maximum number of other device tree nodes shows
+ * a final compacted base size of ~1.5KiB. The 128 bytes per vCPU is derived
+ * from a worst-case analysis of the FDT construction-time size for a single
+ * vCPU node.
  */
-#define DOMU_DTB_SIZE 4096
+#define DOMU_DTB_SIZE (2048 + (MAX_VIRT_CPUS * 128))
 static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
 {
     int addrcells, sizecells;
     int ret, fdt_size = DOMU_DTB_SIZE;
 
+    BUILD_BUG_ON(DOMU_DTB_SIZE > SZ_2M);
+
     kinfo->phandle_intc = GUEST_PHANDLE_GIC;
 
 #ifdef CONFIG_GRANT_TABLE
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 19 12:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Jan 2026 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208105.1520345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vhome-0003VA-Ed; Mon, 19 Jan 2026 12:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208105.1520345; Mon, 19 Jan 2026 12: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 1vhome-0003V2-Bt; Mon, 19 Jan 2026 12:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1208105;
 Mon, 19 Jan 2026 12:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vhomc-0003Uu-FR
 for xen-changelog@lists.xenproject.org; Mon, 19 Jan 2026 12:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhomc-00B9Ny-1g
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vhomc-00A3aU-0Q
 for xen-changelog@lists.xenproject.org;
 Mon, 19 Jan 2026 12:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JiPakQ4FRksmshVtPvCNSopb3rVPLs8v4e1HOmYRTDs=; b=dihfTaAdpto9KazJG+s8BSmD0e
	4ZulXD1NMKW5q0i/D8l+wcrV8jXtn9VGTdpz9YpRS1EeTj0l91+/F49kj4Pp/H7Q23gKgqLQmwRRu
	cSiGszg8baGIY3JFA1nEjH6O9m9nyBNkQgLYVVVxcL5vOJYr50yzQanG8deY4aPhJ9Ug=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dom0less: Calculate guest DTB size based on MAX_VIRT_CPUS
Message-Id: <E1vhomc-00A3aU-0Q@xenbits.xenproject.org>
Date: Mon, 19 Jan 2026 12:55:02 +0000

commit e80f4da85b29f888c0644749b0a4ab29a9f2f6ca
Author:     Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
AuthorDate: Wed Dec 17 08:12:48 2025 +0000
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Jan 19 12:32:15 2026 +0100

    xen/dom0less: Calculate guest DTB size based on MAX_VIRT_CPUS
    
    Creating a dom0less guest with a high vCPU count (e.g., >32) fails
    because the fixed 4KiB device tree buffer (DOMU_DTB_SIZE) overflows
    during creation.
    
    The FDT nodes for each vCPU are the primary consumer of space,
    and the previous fixed-size buffer was insufficient.
    
    This patch replaces the fixed size with a formula that calculates
    the required buffer size based on a fixed baseline plus a scalable
    portion for each potential vCPU up to the MAX_VIRT_CPUS limit.
    
    Please note, the change to DOMU_DTB_SIZE formula would result in
    a smaller buffer size of 3072 bytes compared to the original 4096 bytes
    on Arm32 platforms where MAX_VIRT_CPUS is 8.
    
    ***
    
    The following tests were done to confirm that the proposed formula
    fits:
    
    1. Arm64 testing with varying vCPU counts (MAX_VIRT_CPUS=128),
       final compacted FDT size:
    
       - 1 vCPU: 1586 bytes (with 18432 byte buffer)
       - 2 vCPUs: 1698 bytes
       - 32 vCPUs: 5058 bytes
       - 128 vCPUs: 15810 bytes
    
    2. Arm64 testing with simulated Arm32 conditions (MAX_VIRT_CPUS=8),
       final compacted FDT size:
    
       - 1 vCPU: 1586 bytes (with 3072 byte buffer)
       - 8 vCPUs: 2370 bytes
    
    3. Arm32 testing (MAX_VIRT_CPUS=8),
       final compacted FDT size:
    
       - 8 vCPUs: 1127 bytes (with 3072 byte buffer)
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Reviewed-by: Grygorii Strashko <grygorii_strashko@epam.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Tested-by: Harry Ramsey <harry.ramsey@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/device-tree/dom0less-build.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 495ef7b16a..840d14419d 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -439,15 +439,25 @@ static int __init domain_handle_dtb_boot_module(struct domain *d,
 
 /*
  * The max size for DT is 2MB. However, the generated DT is small (not including
- * domU passthrough DT nodes whose size we account separately), 4KB are enough
- * for now, but we might have to increase it in the future.
+ * domU passthrough DT nodes whose size we account separately). The size is
+ * calculated from a fixed baseline plus a scalable portion for each potential
+ * vCPU node up to the system limit (MAX_VIRT_CPUS), as the vCPU nodes are
+ * the primary consumer of space.
+ *
+ * The baseline of 2KiB is a safe buffer for all non-vCPU FDT content.
+ * Empirical testing with the maximum number of other device tree nodes shows
+ * a final compacted base size of ~1.5KiB. The 128 bytes per vCPU is derived
+ * from a worst-case analysis of the FDT construction-time size for a single
+ * vCPU node.
  */
-#define DOMU_DTB_SIZE 4096
+#define DOMU_DTB_SIZE (2048 + (MAX_VIRT_CPUS * 128))
 static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
 {
     int addrcells, sizecells;
     int ret, fdt_size = DOMU_DTB_SIZE;
 
+    BUILD_BUG_ON(DOMU_DTB_SIZE > SZ_2M);
+
     kinfo->phandle_intc = GUEST_PHANDLE_GIC;
 
 #ifdef CONFIG_GRANT_TABLE
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 09:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 09:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208479.1520619 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7w3-0007TR-Tf; Tue, 20 Jan 2026 09:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208479.1520619; Tue, 20 Jan 2026 09:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7w3-0007TJ-R0; Tue, 20 Jan 2026 09:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1208479;
 Tue, 20 Jan 2026 09:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi7w2-0007TD-CT
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 09:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7w2-00Cg4P-23
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7w2-00BH6q-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ulQ2JsLeoRFMopp2lwIYyAY0QizPfBsjiiESsM+Yj2w=; b=4M8yR22cMC5BnUZMTCqmqLRsmN
	KOpyxgUKp8oITeA1lt+XQNKsikkkviZ5JLvwHHLiZ63Sx9ZqVthhjQGy3p1XB1oSJe3n/4PkdsGKS
	tSHlO3PkJhrgubT7GCOfxiOjaLvz9puz8nVl4L/AKUwdH42XG9vCX8RC2tNtf+/xjP8k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu-policy: define bits of leaf 6
Message-Id: <E1vi7w2-00BH6q-0f@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 09:22:02 +0000

commit 93b6695bbc9df34c8c99edd797473b6cdaf2726a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 08:59:16 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 08:59:16 2026 +0100

    x86/cpu-policy: define bits of leaf 6
    
    ... as far as we presently use them in the codebase.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/include/xen/lib/x86/cpu-policy.h | 37 +++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index f94f23e159..bdda6e52e1 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -121,7 +121,42 @@ struct cpu_policy
             uint64_t :64, :64; /* Leaf 0x3 - PSN. */
             uint64_t :64, :64; /* Leaf 0x4 - Structured Cache. */
             uint64_t :64, :64; /* Leaf 0x5 - MONITOR. */
-            uint64_t :64, :64; /* Leaf 0x6 - Therm/Perf. */
+
+            /* Leaf 0x6 - Therm/Perf. */
+            union {
+                uint32_t _6a;
+                struct {
+                    bool :1,
+                        turbo_boost:1,
+                        arat:1,
+                        :1,
+                        :1,
+                        :1,
+                        :1,
+                        hwp:1,
+                        hwp_interrupt:1,
+                        hwp_activity_window:1,
+                        hwp_epp:1,
+                        hwp_request_pkg:1,
+                        :1,
+                        hdc:1,
+                        :1,
+                        :1,
+                        hwp_peci_override:1,
+                        :1,
+                        :1,
+                        hw_feedback:1;
+                };
+            };
+            uint32_t /* b */:32;
+            union {
+                uint32_t _6c;
+                struct {
+                    bool hw_feedback_cap:1; /* aperf/mperf */
+                };
+            };
+            uint32_t /* d */:32;
+
             uint64_t :64, :64; /* Leaf 0x7 - Structured Features. */
             uint64_t :64, :64; /* Leaf 0x8 - rsvd */
             uint64_t :64, :64; /* Leaf 0x9 - DCA */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 09:22:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 09:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208480.1520623 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7wC-0007VD-Ur; Tue, 20 Jan 2026 09:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208480.1520623; Tue, 20 Jan 2026 09:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7wC-0007Uz-SL; Tue, 20 Jan 2026 09:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1208480;
 Tue, 20 Jan 2026 09:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi7wC-0007Ur-Fd
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 09:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wC-00Cg4V-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wC-00BH7T-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XAfd74qeb8j1GjcFLl4/VAjurHBSqduu+Lj9rrawF6I=; b=xAAbeSxNs7Tvj3CJSqua9HpYpP
	1mAsN+WQ8HKbRrFoqkhwAtCQplD3Og9am0bbCY/0ChuTY5coD7LnqoYh7H0HU0JJerLjaKuoWPtcF
	GQKuLfHEKxjpmPFXKTDD66PAQ2ny+k3NIICfJljvZ0OYMlNLHLth4zFMrQ4TMsyy732E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: replace APERFMPERF synthetic feature bit
Message-Id: <E1vi7wC-00BH7T-1A@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 09:22:12 +0000

commit e09aa8610589924c90e0e657a7fa2f61762ded8f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:00:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:00:01 2026 +0100

    x86: replace APERFMPERF synthetic feature bit
    
    Use the respective host CPU policy bit instead. This has the (tolerable,
    as we generally assume symmetry anyway) effect of using the BSP's
    (unleveled) setting, rather than the result of leveling (as is done by
    identify_cpu() on boot_cpu_data, rendering the variable name somewhat
    misleading).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c    | 2 +-
 xen/arch/x86/cpu/common.c              | 4 ----
 xen/arch/x86/include/asm/cpufeature.h  | 7 +++++--
 xen/arch/x86/include/asm/cpufeatures.h | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 94e8e11c15..7d522f84ac 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -80,7 +80,7 @@ unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
         return 0;
 
     policy = per_cpu(cpufreq_cpu_policy, cpu);
-    if ( !policy || !cpu_has_aperfmperf )
+    if ( !policy || !cpu_has_hw_feedback_cap )
         return 0;
 
     switch (flag)
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 37820a3a08..091c018934 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -523,10 +523,6 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	if ( cpu_has(c, X86_FEATURE_CLFLUSH) )
 		c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
 
-	if ( (c->cpuid_level >= CPUID_PM_LEAF) &&
-	     (cpuid_ecx(CPUID_PM_LEAF) & CPUID6_ECX_APERFMPERF_CAPABILITY) )
-		__set_bit(X86_FEATURE_APERFMPERF, c->x86_capability);
-
 	/* AMD-defined flags: level 0x80000001 */
 	if (c->extended_cpuid_level >= 0x80000001)
 		cpuid(0x80000001, &tmp, &tmp,
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 28c4085cc7..8423f54723 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -11,7 +11,9 @@
 #include <xen/macros.h>
 
 #ifndef __ASSEMBLER__
+#include <asm/cpu-policy.h>
 #include <asm/cpuid.h>
+#include <xen/lib/x86/cpu-policy.h>
 #else
 #include <asm/cpufeatureset.h>
 #endif
@@ -121,7 +123,6 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define CPUID6_EAX_HDC                               BIT(13, U)
 #define CPUID6_EAX_HWP_PECI                          BIT(16, U)
 #define CPUID6_EAX_HW_FEEDBACK                       BIT(19, U)
-#define CPUID6_ECX_APERFMPERF_CAPABILITY             BIT(0, U)
 
 /* CPUID level 0x00000001.edx */
 #define cpu_has_fpu             1
@@ -175,6 +176,9 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_fma4            boot_cpu_has(X86_FEATURE_FMA4)
 #define cpu_has_tbm             boot_cpu_has(X86_FEATURE_TBM)
 
+/* CPUID level 0x00000006.ecx */
+#define cpu_has_hw_feedback_cap host_cpu_policy.basic.hw_feedback_cap
+
 /* CPUID level 0x0000000D:1.eax */
 #define cpu_has_xsaveopt        boot_cpu_has(X86_FEATURE_XSAVEOPT)
 #define cpu_has_xsavec          boot_cpu_has(X86_FEATURE_XSAVEC)
@@ -292,7 +296,6 @@ static inline bool boot_cpu_has(unsigned int feat)
 /* Synthesized. */
 #define cpu_has_arch_perfmon    boot_cpu_has(X86_FEATURE_ARCH_PERFMON)
 #define cpu_has_cpuid_faulting  boot_cpu_has(X86_FEATURE_CPUID_FAULTING)
-#define cpu_has_aperfmperf      boot_cpu_has(X86_FEATURE_APERFMPERF)
 #define cpu_has_xen_lbr         boot_cpu_has(X86_FEATURE_XEN_LBR)
 #define cpu_has_xen_shstk       (IS_ENABLED(CONFIG_XEN_SHSTK) && \
                                  boot_cpu_has(X86_FEATURE_XEN_SHSTK))
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index bd53ba7976..0d90924e3e 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -19,7 +19,7 @@ XEN_CPUFEATURE(TSC_RELIABLE,      X86_SYNTH( 4)) /* TSC is known to be reliable
 XEN_CPUFEATURE(XTOPOLOGY,         X86_SYNTH( 5)) /* cpu topology enum extensions */
 XEN_CPUFEATURE(CPUID_FAULTING,    X86_SYNTH( 6)) /* cpuid faulting */
 XEN_CPUFEATURE(XEN_FRED,          X86_SYNTH( 7)) /* Xen uses FRED */
-XEN_CPUFEATURE(APERFMPERF,        X86_SYNTH( 8)) /* APERFMPERF */
+/* Bit 8 unused */
 XEN_CPUFEATURE(MFENCE_RDTSC,      X86_SYNTH( 9)) /* MFENCE synchronizes RDTSC */
 XEN_CPUFEATURE(XEN_SMEP,          X86_SYNTH(10)) /* SMEP gets used by Xen itself */
 XEN_CPUFEATURE(XEN_SMAP,          X86_SYNTH(11)) /* SMAP gets used by Xen itself */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 09:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 09:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208481.1520626 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7wM-0007XP-WC; Tue, 20 Jan 2026 09:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208481.1520626; Tue, 20 Jan 2026 09: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 1vi7wM-0007XH-Te; Tue, 20 Jan 2026 09:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1208481;
 Tue, 20 Jan 2026 09:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi7wM-0007X9-J3
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 09:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wM-00Cg4b-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wM-00BH8N-1e
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9jEoamAlCryszL1aZ+XvNJ8qJNIekGtxmRb1HcgaUGY=; b=ZPl0r20Qty8yijmhYbfOFWKInY
	+hr4gUFV7RA0lPjTJ+hJz/hW+Im58taCFxCfR+rWzBpi3DA2f8C5d2LorDe4g3JZN43Ar+DUp3IUW
	64Lj2iPBhw9ZEZkJnSsWF59Ypbl69Q+sogPbpPHi2asRS/RXdKysG1PooX154oAfjPBo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/Intel: use host CPU policy for ARAT checking
Message-Id: <E1vi7wM-00BH8N-1e@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 09:22:22 +0000

commit 894bd76179241a854c9d70a45abc3f68f369f525
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:01:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:01:29 2026 +0100

    x86/Intel: use host CPU policy for ARAT checking
    
    There's no need to invoke CPUID yet another time. However, as the host CPU
    policy is set up only shortly after init_intel() ran on the BSP, defer the
    logic to a pre-SMP initcall. This can't be (a new) one in cpu/intel.c
    though, as that's linked after acpi/cpu_idle.c (which is where we already
    need the feature set). Since opt_arat is local to the cpu/ subtree,
    introduce a new Intel-specific helper to hold the code needed.
    
    Further, as we assume symmetry anyway, use setup_force_cpu_cap() and hence
    limit the checking to the boot CPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpu_idle.c          |  3 +++
 xen/arch/x86/cpu/intel.c              | 10 ++++++----
 xen/arch/x86/include/asm/cpufeature.h |  3 +++
 xen/arch/x86/include/asm/processor.h  |  1 +
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 7a87625077..0b3d0631dd 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -1666,6 +1666,9 @@ static int __init cf_check cpuidle_presmp_init(void)
 {
     void *cpu = (void *)(long)smp_processor_id();
 
+    if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
+        intel_init_arat();
+
     if ( !xen_cpuidle )
         return 0;
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index b76797cb9a..7037f1f268 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -665,10 +665,6 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
 		__set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
 	}
-	if ( opt_arat &&
-	     ( c->cpuid_level >= 0x00000006 ) &&
-	     ( cpuid_eax(0x00000006) & (1u<<2) ) )
-		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	if ((opt_cpu_info && !(c->apicid & (c->x86_num_siblings - 1))) ||
 	    c == &boot_cpu_data )
@@ -693,3 +689,9 @@ const struct cpu_dev __initconst_cf_clobber intel_cpu_dev = {
 	.c_early_init	= early_init_intel,
 	.c_init		= init_intel,
 };
+
+void __init intel_init_arat(void)
+{
+    if ( opt_arat && cpu_has_arat )
+        setup_force_cpu_cap(X86_FEATURE_XEN_ARAT);
+}
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 8423f54723..f45295d84e 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -176,6 +176,9 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_fma4            boot_cpu_has(X86_FEATURE_FMA4)
 #define cpu_has_tbm             boot_cpu_has(X86_FEATURE_TBM)
 
+/* CPUID level 0x00000006.eax */
+#define cpu_has_arat            host_cpu_policy.basic.arat
+
 /* CPUID level 0x00000006.ecx */
 #define cpu_has_hw_feedback_cap host_cpu_policy.basic.hw_feedback_cap
 
diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index cf614bd8c6..c37bd7a176 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -102,6 +102,7 @@ extern void setup_force_cpu_cap(unsigned int cap);
 extern bool is_forced_cpu_cap(unsigned int cap);
 extern void print_cpu_info(unsigned int cpu);
 extern void init_intel_cacheinfo(struct cpuinfo_x86 *c);
+extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 09:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 09:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208482.1520631 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7wX-0007aA-1M; Tue, 20 Jan 2026 09:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208482.1520631; Tue, 20 Jan 2026 09: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 1vi7wW-0007a2-V2; Tue, 20 Jan 2026 09:22:32 +0000
Received: by outflank-mailman (input) for mailman id 1208482;
 Tue, 20 Jan 2026 09:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi7wW-0007Zw-LL
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 09:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wW-00Cg4h-37
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wW-00BHAz-1v
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4qCJJ79pFKpDNbIQ1s6aMbYiCPH8dFBCRTmPcwSc22E=; b=JVffoNK7+dVSIyCgmXmaMvlgQY
	9GGD3brV6IBDqcidwzuhmeIFbVTQGg7zsCILmd3EDVvxQGBeqPTY6igjuydqW7eF09s8gil09Lvg3
	LC+mEqTnpat8p+cwKbUbssnnuFdpnD3XGFVFOOHmCkHXdT0UQpvgMazXOBDI0WZpprME=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpufreq: use host CPU policy for Turbo checking
Message-Id: <E1vi7wW-00BHAz-1v@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 09:22:32 +0000

commit dc4d5f1ef6b73db6bb75e31d35223da21c5a52ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:01:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:01:50 2026 +0100

    x86/cpufreq: use host CPU policy for Turbo checking
    
    There's no need to invoke CPUID yet another time - we assume symmetry
    anyway. With symmetry assumed, logging per-CPU also isn't very useful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/acpi.c      | 11 ++++-------
 xen/arch/x86/include/asm/cpufeature.h |  1 +
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/acpi.c b/xen/arch/x86/acpi/cpufreq/acpi.c
index b027459417..2d08c3094f 100644
--- a/xen/arch/x86/acpi/cpufreq/acpi.c
+++ b/xen/arch/x86/acpi/cpufreq/acpi.c
@@ -220,14 +220,11 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
 
 void intel_feature_detect(struct cpufreq_policy *policy)
 {
-    unsigned int eax;
-
-    eax = cpuid_eax(6);
-    if (eax & 0x2) {
+    if ( cpu_has_turbo_boost )
+    {
         policy->turbo = CPUFREQ_TURBO_ENABLED;
-        if (cpufreq_verbose)
-            printk(XENLOG_INFO "CPU%u: Turbo Mode detected and enabled\n",
-                   smp_processor_id());
+        if ( cpufreq_verbose )
+            printk_once(XENLOG_INFO "Turbo Mode detected and enabled\n");
     }
 }
 
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index f45295d84e..a0374c1b20 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -177,6 +177,7 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_tbm             boot_cpu_has(X86_FEATURE_TBM)
 
 /* CPUID level 0x00000006.eax */
+#define cpu_has_turbo_boost     host_cpu_policy.basic.turbo_boost
 #define cpu_has_arat            host_cpu_policy.basic.arat
 
 /* CPUID level 0x00000006.ecx */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 09:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 09:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208483.1520634 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7wi-0007cE-2b; Tue, 20 Jan 2026 09:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208483.1520634; Tue, 20 Jan 2026 09:22:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7wi-0007c6-08; Tue, 20 Jan 2026 09:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1208483;
 Tue, 20 Jan 2026 09:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi7wg-0007by-Oj
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 09:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wh-00Cg4w-0E
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wg-00BHBg-2D
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CKggraWZVFdY1aKic/TtnmcgBxU8iKGnH454aonYXrs=; b=VnWO1uytl4cj3VRYf5Q4MGJO/V
	kTkhCWns3hLme59+oJEbtZQytIAqPXJgEkUPtgMWznx1gKZLA46vOBtpsLrbz8OaDDNDhNFJWH92N
	DQFu8T1BaMJL5Tc8bJUeMATt3I0aAGSpvUcb6BVVyNrqmnDuFRxlYjE96IMkdqdiKD0M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpufreq: use host CPU policy in HWP driver
Message-Id: <E1vi7wg-00BHBg-2D@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 09:22:42 +0000

commit 89c461242d02fcf0f77981e81c008d29670ed564
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:02:11 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:02:11 2026 +0100

    x86/cpufreq: use host CPU policy in HWP driver
    
    There's no need to invoke CPUID yet another time. This way two of the
    static booleans can also go away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/hwp.c       | 38 ++++++++++++-----------------------
 xen/arch/x86/include/asm/cpufeature.h | 16 +++++++--------
 2 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index e801acd7a7..8af02070bf 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -18,9 +18,6 @@
 
 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 __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
@@ -165,8 +162,6 @@ bool hwp_active(void)
 
 static bool __init hwp_available(void)
 {
-    unsigned int eax;
-
     if ( boot_cpu_data.cpuid_level < CPUID_PM_LEAF )
     {
         hwp_verbose("cpuid_level (%#x) lacks HWP support\n",
@@ -183,29 +178,22 @@ static bool __init hwp_available(void)
         return false;
     }
 
-    eax = cpuid_eax(CPUID_PM_LEAF);
-
     hwp_verbose("%d notify: %d act-window: %d energy-perf: %d pkg-level: %d peci: %d\n",
-                !!(eax & CPUID6_EAX_HWP),
-                !!(eax & CPUID6_EAX_HWP_NOTIFICATION),
-                !!(eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW),
-                !!(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE),
-                !!(eax & CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST),
-                !!(eax & CPUID6_EAX_HWP_PECI));
-
-    if ( !(eax & CPUID6_EAX_HWP) )
+                cpu_has_hwp, cpu_has_hwp_interrupt,
+                cpu_has_hwp_activity_window, cpu_has_hwp_epp,
+                cpu_has_hwp_request_pkg, cpu_has_hwp_peci_override);
+
+    if ( !cpu_has_hwp )
         return false;
 
-    if ( !(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE) )
+    if ( !cpu_has_hwp_epp )
     {
         hwp_verbose("disabled: No energy/performance preference available");
 
         return false;
     }
 
-    feature_hwp_notification    = eax & CPUID6_EAX_HWP_NOTIFICATION;
-    feature_hwp_activity_window = eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW;
-    feature_hdc                 = eax & CPUID6_EAX_HDC;
+    feature_hdc = cpu_has_hdc;
 
     hwp_verbose("Hardware Duty Cycling (HDC) %ssupported%s\n",
                 feature_hdc ? "" : "not ",
@@ -213,7 +201,7 @@ static bool __init hwp_available(void)
                             : "");
 
     hwp_verbose("HW_FEEDBACK %ssupported\n",
-                (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
+                cpu_has_hw_feedback ? "" : "not ");
 
     hwp_in_use = true;
 
@@ -226,7 +214,7 @@ static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
 {
     struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
 
-    if ( !feature_hwp_activity_window && data->activity_window )
+    if ( !cpu_has_hwp_activity_window && data->activity_window )
     {
         hwp_verbose("HWP activity window not supported\n");
 
@@ -268,7 +256,7 @@ static int cf_check hwp_cpufreq_target(struct cpufreq_policy *policy,
     hwp_req.max_perf = data->maximum;
     hwp_req.desired = data->desired;
     hwp_req.energy_perf = data->energy_perf;
-    if ( feature_hwp_activity_window )
+    if ( cpu_has_hwp_activity_window )
         hwp_req.activity_window = data->activity_window;
 
     if ( hwp_req.raw == data->curr_req.raw )
@@ -365,7 +353,7 @@ static void cf_check hwp_init_msrs(void *info)
     }
 
     /* Ensure we don't generate interrupts */
-    if ( feature_hwp_notification )
+    if ( cpu_has_hwp_interrupt )
         wrmsr_safe(MSR_HWP_INTERRUPT, 0);
 
     if ( !(val & PM_ENABLE_HWP_ENABLE) )
@@ -537,7 +525,7 @@ int get_hwp_para(unsigned int cpu,
         return -ENODATA;
 
     cppc_para->features         =
-        (feature_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
+        (cpu_has_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
     cppc_para->lowest           = data->hw.lowest;
     cppc_para->lowest_nonlinear = data->hw.most_efficient;
     cppc_para->nominal          = data->hw.guaranteed;
@@ -585,7 +573,7 @@ int set_hwp_para(struct cpufreq_policy *policy,
 
     /* Clear out activity window if lacking HW supported. */
     if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
-         !feature_hwp_activity_window )
+         !cpu_has_hwp_activity_window )
     {
         set_cppc->set_params &= ~XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
         cleared_act_window = true;
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index a0374c1b20..dcd223d84f 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -115,14 +115,6 @@ static inline bool boot_cpu_has(unsigned int feat)
 }
 
 #define CPUID_PM_LEAF                                6
-#define CPUID6_EAX_HWP                               BIT(7, U)
-#define CPUID6_EAX_HWP_NOTIFICATION                  BIT(8, U)
-#define CPUID6_EAX_HWP_ACTIVITY_WINDOW               BIT(9, U)
-#define CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE BIT(10, U)
-#define CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST         BIT(11, U)
-#define CPUID6_EAX_HDC                               BIT(13, U)
-#define CPUID6_EAX_HWP_PECI                          BIT(16, U)
-#define CPUID6_EAX_HW_FEEDBACK                       BIT(19, U)
 
 /* CPUID level 0x00000001.edx */
 #define cpu_has_fpu             1
@@ -179,6 +171,14 @@ static inline bool boot_cpu_has(unsigned int feat)
 /* CPUID level 0x00000006.eax */
 #define cpu_has_turbo_boost     host_cpu_policy.basic.turbo_boost
 #define cpu_has_arat            host_cpu_policy.basic.arat
+#define cpu_has_hwp             host_cpu_policy.basic.hwp
+#define cpu_has_hwp_interrupt   host_cpu_policy.basic.hwp_interrupt
+#define cpu_has_hwp_activity_window host_cpu_policy.basic.hwp_activity_window
+#define cpu_has_hwp_epp         host_cpu_policy.basic.hwp_epp
+#define cpu_has_hwp_request_pkg host_cpu_policy.basic.hwp_request_pkg
+#define cpu_has_hdc             host_cpu_policy.basic.hdc
+#define cpu_has_hwp_peci_override host_cpu_policy.basic.hwp_peci_override
+#define cpu_has_hw_feedback     host_cpu_policy.basic.hw_feedback
 
 /* CPUID level 0x00000006.ecx */
 #define cpu_has_hw_feedback_cap host_cpu_policy.basic.hw_feedback_cap
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 09:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 09:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208484.1520640 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7ws-0007ew-5l; Tue, 20 Jan 2026 09:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208484.1520640; Tue, 20 Jan 2026 09:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7ws-0007eo-2o; Tue, 20 Jan 2026 09:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1208484;
 Tue, 20 Jan 2026 09:22:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi7wq-0007ee-RW
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 09:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wr-00Cg52-0W
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7wq-00BHC2-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:22:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BOUOElGk+UV5nnLqLhXQbigzq30oS4Cp8buenCY1qaA=; b=hHR7l/iA/3e09L23jLmgShcH+9
	dYkoQZPjyubk9gqPe/8d6ecK/5F3ry3NCu2J/+D+4Qs+ro10XPSZ7UgnU+kK8Fcb294Is9crkep3y
	iNSyRp/BPl2uME3HTFnDKY7T++PZhvN1ZqWYRacxWRijrYjaop3XBVo7ijJ0ykTZ3aE8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/platform: Expose DTS sensors MSR
Message-Id: <E1vi7wq-00BHC2-2Z@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 09:22:52 +0000

commit 615c9f3f82006a1365d5a6b4cfb8ebc4714a7b8d
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Jan 20 09:02:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:02:39 2026 +0100

    x86/platform: Expose DTS sensors MSR
    
    Intel provide CPU sensors through "DTS" MSRs. As these MSR are core-specific
    (or package-specific), we can't reliably fetch them from Dom0 directly.
    Expose these MSR (if supported) through XENPF_resource_op so that it is
    accessible through hypercall.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/msr-index.h | 3 +++
 xen/arch/x86/platform_hypercall.c    | 6 ++++++
 xen/include/xen/lib/x86/cpu-policy.h | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index df52587c85..b92a278611 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -115,6 +115,9 @@
 #define  MCU_OPT_CTRL_GDS_MIT_DIS           (_AC(1, ULL) <<  4)
 #define  MCU_OPT_CTRL_GDS_MIT_LOCK          (_AC(1, ULL) <<  5)
 
+#define MSR_TEMPERATURE_TARGET              0x000001a2
+#define MSR_PACKAGE_THERM_STATUS            0x000001b1
+
 #define MSR_FRED_RSP_SL0                    0x000001cc
 #define MSR_FRED_RSP_SL1                    0x000001cd
 #define MSR_FRED_RSP_SL2                    0x000001ce
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 214b130ea8..f8eca48170 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -27,6 +27,7 @@
 #include <asm/current.h>
 #include <public/platform.h>
 #include <acpi/cpufreq/processor_perf.h>
+#include <asm/cpu-policy.h>
 #include <asm/edd.h>
 #include <asm/microcode.h>
 #include <asm/mtrr.h>
@@ -86,6 +87,11 @@ static bool msr_read_allowed(unsigned int msr)
 
     case MSR_MCU_OPT_CTRL:
         return cpu_has_srbds_ctrl;
+
+    case MSR_IA32_THERM_STATUS:
+    case MSR_TEMPERATURE_TARGET:
+    case MSR_PACKAGE_THERM_STATUS:
+        return host_cpu_policy.basic.digital_temp_sensor;
     }
 
     if ( ppin_msr && msr == ppin_msr )
diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index bdda6e52e1..db8d035589 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -126,7 +126,7 @@ struct cpu_policy
             union {
                 uint32_t _6a;
                 struct {
-                    bool :1,
+                    bool digital_temp_sensor:1,
                         turbo_boost:1,
                         arat:1,
                         :1,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 09:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 09:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208485.1520644 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7x2-0007h6-7F; Tue, 20 Jan 2026 09:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208485.1520644; Tue, 20 Jan 2026 09:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi7x2-0007gy-4C; Tue, 20 Jan 2026 09:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1208485;
 Tue, 20 Jan 2026 09:23:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi7x0-0007gq-UI
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 09:23:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7x1-00Cg5k-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi7x0-00BHCh-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 09:23:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2UVdtgwbUMr5oLXIceAC/CdZslKJmggw12eu3Ufe2UE=; b=qKH8lZDUNOBpRHouQfNj5qHc7m
	ck8FVG92Eaw5d1q7u7ABiXTY9cz7yOda3WXo4djEyWE+fZKlSGPo7Qa7pY9vxIRfGrZS069G1Bc2o
	q6vPN/YaMbeOVD3EYVO20CqTsi/IGWzMSM5VzXUNzNJiQyY8ASml1dXzWA7cgFa9VdYk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vi7x0-00BHCh-2q@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 09:23:02 +0000

commit 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:03:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:03:17 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 362c76df0b..87b4e83250 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1651,8 +1651,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 10:55:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 10:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208697.1520828 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9O3-0002jF-Qd; Tue, 20 Jan 2026 10:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208697.1520828; Tue, 20 Jan 2026 10:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9O3-0002j6-Nj; Tue, 20 Jan 2026 10:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1208697;
 Tue, 20 Jan 2026 10:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi9O1-0002iy-UN
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 10:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9O2-00ChqQ-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9O1-00BNFc-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MklIpPNpdxWPeeoqfIW8xPwucWCpbuNYIWpcxAC7Uoc=; b=HTeEF0BgOtmq6/1can27N3OzBn
	WuIEhn8GKE3/26zLlSjMbVI6r0vKKAHRn7lPC8fLMnxXWf3zkL8csxR/SRb7/pvKe5qQYh4ckygxU
	QYsC2/Uai3+OhKyHbonFhTl/oiikbfhNcZJhEUAe3NE0ADXjAnQx8jrJwqOZcNvirfhI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu-policy: define bits of leaf 6
Message-Id: <E1vi9O1-00BNFc-2a@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 10:55:01 +0000

commit 93b6695bbc9df34c8c99edd797473b6cdaf2726a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 08:59:16 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 08:59:16 2026 +0100

    x86/cpu-policy: define bits of leaf 6
    
    ... as far as we presently use them in the codebase.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/include/xen/lib/x86/cpu-policy.h | 37 +++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index f94f23e159..bdda6e52e1 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -121,7 +121,42 @@ struct cpu_policy
             uint64_t :64, :64; /* Leaf 0x3 - PSN. */
             uint64_t :64, :64; /* Leaf 0x4 - Structured Cache. */
             uint64_t :64, :64; /* Leaf 0x5 - MONITOR. */
-            uint64_t :64, :64; /* Leaf 0x6 - Therm/Perf. */
+
+            /* Leaf 0x6 - Therm/Perf. */
+            union {
+                uint32_t _6a;
+                struct {
+                    bool :1,
+                        turbo_boost:1,
+                        arat:1,
+                        :1,
+                        :1,
+                        :1,
+                        :1,
+                        hwp:1,
+                        hwp_interrupt:1,
+                        hwp_activity_window:1,
+                        hwp_epp:1,
+                        hwp_request_pkg:1,
+                        :1,
+                        hdc:1,
+                        :1,
+                        :1,
+                        hwp_peci_override:1,
+                        :1,
+                        :1,
+                        hw_feedback:1;
+                };
+            };
+            uint32_t /* b */:32;
+            union {
+                uint32_t _6c;
+                struct {
+                    bool hw_feedback_cap:1; /* aperf/mperf */
+                };
+            };
+            uint32_t /* d */:32;
+
             uint64_t :64, :64; /* Leaf 0x7 - Structured Features. */
             uint64_t :64, :64; /* Leaf 0x8 - rsvd */
             uint64_t :64, :64; /* Leaf 0x9 - DCA */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 10:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 10:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208698.1520831 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9OD-0002l2-Rw; Tue, 20 Jan 2026 10:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208698.1520831; Tue, 20 Jan 2026 10:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9OD-0002kv-P6; Tue, 20 Jan 2026 10:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1208698;
 Tue, 20 Jan 2026 10: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 1vi9OB-0002kc-V3
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 10:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9OC-00Chse-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9OB-00BNG9-2t
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Nl1PLKEyg7N7aST6lGvkn6ubity9GN4RlW6FuPldjRI=; b=EChOkPvMjyr7lE+NQsZMe8VdSw
	1KzTKaKZ4MQDL3arGDv8m91A93hS5PWuIsEEkl/oG6rvcN167IhmlfpNixFudDU/vLfIM5oH0floU
	eiS62pnmUTmeinOSvc8sdXNh0YRcWtb/Tn/Zy16+P+scLPOvrpry89jWmChoj4KNxWJ8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: replace APERFMPERF synthetic feature bit
Message-Id: <E1vi9OB-00BNG9-2t@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 10:55:11 +0000

commit e09aa8610589924c90e0e657a7fa2f61762ded8f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:00:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:00:01 2026 +0100

    x86: replace APERFMPERF synthetic feature bit
    
    Use the respective host CPU policy bit instead. This has the (tolerable,
    as we generally assume symmetry anyway) effect of using the BSP's
    (unleveled) setting, rather than the result of leveling (as is done by
    identify_cpu() on boot_cpu_data, rendering the variable name somewhat
    misleading).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c    | 2 +-
 xen/arch/x86/cpu/common.c              | 4 ----
 xen/arch/x86/include/asm/cpufeature.h  | 7 +++++--
 xen/arch/x86/include/asm/cpufeatures.h | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 94e8e11c15..7d522f84ac 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -80,7 +80,7 @@ unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
         return 0;
 
     policy = per_cpu(cpufreq_cpu_policy, cpu);
-    if ( !policy || !cpu_has_aperfmperf )
+    if ( !policy || !cpu_has_hw_feedback_cap )
         return 0;
 
     switch (flag)
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 37820a3a08..091c018934 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -523,10 +523,6 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	if ( cpu_has(c, X86_FEATURE_CLFLUSH) )
 		c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
 
-	if ( (c->cpuid_level >= CPUID_PM_LEAF) &&
-	     (cpuid_ecx(CPUID_PM_LEAF) & CPUID6_ECX_APERFMPERF_CAPABILITY) )
-		__set_bit(X86_FEATURE_APERFMPERF, c->x86_capability);
-
 	/* AMD-defined flags: level 0x80000001 */
 	if (c->extended_cpuid_level >= 0x80000001)
 		cpuid(0x80000001, &tmp, &tmp,
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 28c4085cc7..8423f54723 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -11,7 +11,9 @@
 #include <xen/macros.h>
 
 #ifndef __ASSEMBLER__
+#include <asm/cpu-policy.h>
 #include <asm/cpuid.h>
+#include <xen/lib/x86/cpu-policy.h>
 #else
 #include <asm/cpufeatureset.h>
 #endif
@@ -121,7 +123,6 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define CPUID6_EAX_HDC                               BIT(13, U)
 #define CPUID6_EAX_HWP_PECI                          BIT(16, U)
 #define CPUID6_EAX_HW_FEEDBACK                       BIT(19, U)
-#define CPUID6_ECX_APERFMPERF_CAPABILITY             BIT(0, U)
 
 /* CPUID level 0x00000001.edx */
 #define cpu_has_fpu             1
@@ -175,6 +176,9 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_fma4            boot_cpu_has(X86_FEATURE_FMA4)
 #define cpu_has_tbm             boot_cpu_has(X86_FEATURE_TBM)
 
+/* CPUID level 0x00000006.ecx */
+#define cpu_has_hw_feedback_cap host_cpu_policy.basic.hw_feedback_cap
+
 /* CPUID level 0x0000000D:1.eax */
 #define cpu_has_xsaveopt        boot_cpu_has(X86_FEATURE_XSAVEOPT)
 #define cpu_has_xsavec          boot_cpu_has(X86_FEATURE_XSAVEC)
@@ -292,7 +296,6 @@ static inline bool boot_cpu_has(unsigned int feat)
 /* Synthesized. */
 #define cpu_has_arch_perfmon    boot_cpu_has(X86_FEATURE_ARCH_PERFMON)
 #define cpu_has_cpuid_faulting  boot_cpu_has(X86_FEATURE_CPUID_FAULTING)
-#define cpu_has_aperfmperf      boot_cpu_has(X86_FEATURE_APERFMPERF)
 #define cpu_has_xen_lbr         boot_cpu_has(X86_FEATURE_XEN_LBR)
 #define cpu_has_xen_shstk       (IS_ENABLED(CONFIG_XEN_SHSTK) && \
                                  boot_cpu_has(X86_FEATURE_XEN_SHSTK))
diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index bd53ba7976..0d90924e3e 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -19,7 +19,7 @@ XEN_CPUFEATURE(TSC_RELIABLE,      X86_SYNTH( 4)) /* TSC is known to be reliable
 XEN_CPUFEATURE(XTOPOLOGY,         X86_SYNTH( 5)) /* cpu topology enum extensions */
 XEN_CPUFEATURE(CPUID_FAULTING,    X86_SYNTH( 6)) /* cpuid faulting */
 XEN_CPUFEATURE(XEN_FRED,          X86_SYNTH( 7)) /* Xen uses FRED */
-XEN_CPUFEATURE(APERFMPERF,        X86_SYNTH( 8)) /* APERFMPERF */
+/* Bit 8 unused */
 XEN_CPUFEATURE(MFENCE_RDTSC,      X86_SYNTH( 9)) /* MFENCE synchronizes RDTSC */
 XEN_CPUFEATURE(XEN_SMEP,          X86_SYNTH(10)) /* SMEP gets used by Xen itself */
 XEN_CPUFEATURE(XEN_SMAP,          X86_SYNTH(11)) /* SMAP gets used by Xen itself */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 10:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 10:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208699.1520834 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9ON-0002ng-T6; Tue, 20 Jan 2026 10:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208699.1520834; Tue, 20 Jan 2026 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9ON-0002nY-Qd; Tue, 20 Jan 2026 10:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1208699;
 Tue, 20 Jan 2026 10:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi9OM-0002nJ-3b
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 10:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9OM-00Chsi-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9OL-00BNGc-3B
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/8uoY3Oe8CwR/iNKJ7OFP13r/DeJlZ56EoP+PPJ4ft0=; b=KEgDcXRxsUce4JrVpxB+blcSKn
	Rtez6/b4UA4pBwG/7OnlzqwLkXtNEwAAo9OT1/WR4ptLEq5iHGobtqhueeZRiFXK8zhbY1TjZhN3q
	SA//rUFSnKEg+J10+mQDdXnX8J2K9PyEfOlQAGaAlwow3DW73A8P0YHOQbId7FUjBqsg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/Intel: use host CPU policy for ARAT checking
Message-Id: <E1vi9OL-00BNGc-3B@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 10:55:21 +0000

commit 894bd76179241a854c9d70a45abc3f68f369f525
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:01:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:01:29 2026 +0100

    x86/Intel: use host CPU policy for ARAT checking
    
    There's no need to invoke CPUID yet another time. However, as the host CPU
    policy is set up only shortly after init_intel() ran on the BSP, defer the
    logic to a pre-SMP initcall. This can't be (a new) one in cpu/intel.c
    though, as that's linked after acpi/cpu_idle.c (which is where we already
    need the feature set). Since opt_arat is local to the cpu/ subtree,
    introduce a new Intel-specific helper to hold the code needed.
    
    Further, as we assume symmetry anyway, use setup_force_cpu_cap() and hence
    limit the checking to the boot CPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpu_idle.c          |  3 +++
 xen/arch/x86/cpu/intel.c              | 10 ++++++----
 xen/arch/x86/include/asm/cpufeature.h |  3 +++
 xen/arch/x86/include/asm/processor.h  |  1 +
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 7a87625077..0b3d0631dd 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -1666,6 +1666,9 @@ static int __init cf_check cpuidle_presmp_init(void)
 {
     void *cpu = (void *)(long)smp_processor_id();
 
+    if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
+        intel_init_arat();
+
     if ( !xen_cpuidle )
         return 0;
 
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index b76797cb9a..7037f1f268 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -665,10 +665,6 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 		__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
 		__set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
 	}
-	if ( opt_arat &&
-	     ( c->cpuid_level >= 0x00000006 ) &&
-	     ( cpuid_eax(0x00000006) & (1u<<2) ) )
-		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	if ((opt_cpu_info && !(c->apicid & (c->x86_num_siblings - 1))) ||
 	    c == &boot_cpu_data )
@@ -693,3 +689,9 @@ const struct cpu_dev __initconst_cf_clobber intel_cpu_dev = {
 	.c_early_init	= early_init_intel,
 	.c_init		= init_intel,
 };
+
+void __init intel_init_arat(void)
+{
+    if ( opt_arat && cpu_has_arat )
+        setup_force_cpu_cap(X86_FEATURE_XEN_ARAT);
+}
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index 8423f54723..f45295d84e 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -176,6 +176,9 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_fma4            boot_cpu_has(X86_FEATURE_FMA4)
 #define cpu_has_tbm             boot_cpu_has(X86_FEATURE_TBM)
 
+/* CPUID level 0x00000006.eax */
+#define cpu_has_arat            host_cpu_policy.basic.arat
+
 /* CPUID level 0x00000006.ecx */
 #define cpu_has_hw_feedback_cap host_cpu_policy.basic.hw_feedback_cap
 
diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index cf614bd8c6..c37bd7a176 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -102,6 +102,7 @@ extern void setup_force_cpu_cap(unsigned int cap);
 extern bool is_forced_cpu_cap(unsigned int cap);
 extern void print_cpu_info(unsigned int cpu);
 extern void init_intel_cacheinfo(struct cpuinfo_x86 *c);
+extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 10:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 10:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208700.1520839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9OX-0002qF-UZ; Tue, 20 Jan 2026 10:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208700.1520839; Tue, 20 Jan 2026 10:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9OX-0002q7-Rt; Tue, 20 Jan 2026 10:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1208700;
 Tue, 20 Jan 2026 10:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi9OW-0002pz-6e
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 10:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9OW-00Chsm-1e
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9OW-00BNHE-0R
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c1u/b4Zyrmo62pYnSO//buGa75sduIzjWTZ0JV2sBLA=; b=28UBCSVdK9PkPeejcWEfyGR51I
	mDtrekyhvvC4p0jP9jwX1FQ/3c/m7aqUqbBmb8VU1J/F/BrrEw3Bwe4YqoynpJ+s7/tMS6K9c/u8J
	HU+2vqkvYq0uMWVBKO855TTfbFb8FGNy9SyRqXm348ntDTWB9Le0+rflji24D0VWp7xo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpufreq: use host CPU policy for Turbo checking
Message-Id: <E1vi9OW-00BNHE-0R@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 10:55:32 +0000

commit dc4d5f1ef6b73db6bb75e31d35223da21c5a52ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:01:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:01:50 2026 +0100

    x86/cpufreq: use host CPU policy for Turbo checking
    
    There's no need to invoke CPUID yet another time - we assume symmetry
    anyway. With symmetry assumed, logging per-CPU also isn't very useful.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/acpi.c      | 11 ++++-------
 xen/arch/x86/include/asm/cpufeature.h |  1 +
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/acpi.c b/xen/arch/x86/acpi/cpufreq/acpi.c
index b027459417..2d08c3094f 100644
--- a/xen/arch/x86/acpi/cpufreq/acpi.c
+++ b/xen/arch/x86/acpi/cpufreq/acpi.c
@@ -220,14 +220,11 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
 
 void intel_feature_detect(struct cpufreq_policy *policy)
 {
-    unsigned int eax;
-
-    eax = cpuid_eax(6);
-    if (eax & 0x2) {
+    if ( cpu_has_turbo_boost )
+    {
         policy->turbo = CPUFREQ_TURBO_ENABLED;
-        if (cpufreq_verbose)
-            printk(XENLOG_INFO "CPU%u: Turbo Mode detected and enabled\n",
-                   smp_processor_id());
+        if ( cpufreq_verbose )
+            printk_once(XENLOG_INFO "Turbo Mode detected and enabled\n");
     }
 }
 
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index f45295d84e..a0374c1b20 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -177,6 +177,7 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_tbm             boot_cpu_has(X86_FEATURE_TBM)
 
 /* CPUID level 0x00000006.eax */
+#define cpu_has_turbo_boost     host_cpu_policy.basic.turbo_boost
 #define cpu_has_arat            host_cpu_policy.basic.arat
 
 /* CPUID level 0x00000006.ecx */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 10:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 10:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208701.1520843 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9Oh-0002sg-W7; Tue, 20 Jan 2026 10:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208701.1520843; Tue, 20 Jan 2026 10: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 1vi9Oh-0002sY-TE; Tue, 20 Jan 2026 10:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1208701;
 Tue, 20 Jan 2026 10: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 1vi9Og-0002sC-96
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 10: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 1vi9Og-00Chsq-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9Og-00BNHk-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+y/fwWS6aCreigSdIjo8PG3Zl3kQkL8IO1oPf0SK17Q=; b=2pcLM+9oc0P83MAs9Iz39KHcHB
	mO7zR6ke2aTG5L4pFzZHw6t33mxb/JTH4rBixOHVKnSAqbsg5TKBvaZuDAzjNokveOFNX69UcQAhv
	Up4jSQ2/+ZXMSQ5kH5VGWn5XhAkg+giQXhJKjWylGAFH/UDWu4u5Blzu91JgaV5fK7Gc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpufreq: use host CPU policy in HWP driver
Message-Id: <E1vi9Og-00BNHk-0j@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 10:55:42 +0000

commit 89c461242d02fcf0f77981e81c008d29670ed564
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:02:11 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:02:11 2026 +0100

    x86/cpufreq: use host CPU policy in HWP driver
    
    There's no need to invoke CPUID yet another time. This way two of the
    static booleans can also go away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/hwp.c       | 38 ++++++++++++-----------------------
 xen/arch/x86/include/asm/cpufeature.h | 16 +++++++--------
 2 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index e801acd7a7..8af02070bf 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -18,9 +18,6 @@
 
 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 __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
@@ -165,8 +162,6 @@ bool hwp_active(void)
 
 static bool __init hwp_available(void)
 {
-    unsigned int eax;
-
     if ( boot_cpu_data.cpuid_level < CPUID_PM_LEAF )
     {
         hwp_verbose("cpuid_level (%#x) lacks HWP support\n",
@@ -183,29 +178,22 @@ static bool __init hwp_available(void)
         return false;
     }
 
-    eax = cpuid_eax(CPUID_PM_LEAF);
-
     hwp_verbose("%d notify: %d act-window: %d energy-perf: %d pkg-level: %d peci: %d\n",
-                !!(eax & CPUID6_EAX_HWP),
-                !!(eax & CPUID6_EAX_HWP_NOTIFICATION),
-                !!(eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW),
-                !!(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE),
-                !!(eax & CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST),
-                !!(eax & CPUID6_EAX_HWP_PECI));
-
-    if ( !(eax & CPUID6_EAX_HWP) )
+                cpu_has_hwp, cpu_has_hwp_interrupt,
+                cpu_has_hwp_activity_window, cpu_has_hwp_epp,
+                cpu_has_hwp_request_pkg, cpu_has_hwp_peci_override);
+
+    if ( !cpu_has_hwp )
         return false;
 
-    if ( !(eax & CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE) )
+    if ( !cpu_has_hwp_epp )
     {
         hwp_verbose("disabled: No energy/performance preference available");
 
         return false;
     }
 
-    feature_hwp_notification    = eax & CPUID6_EAX_HWP_NOTIFICATION;
-    feature_hwp_activity_window = eax & CPUID6_EAX_HWP_ACTIVITY_WINDOW;
-    feature_hdc                 = eax & CPUID6_EAX_HDC;
+    feature_hdc = cpu_has_hdc;
 
     hwp_verbose("Hardware Duty Cycling (HDC) %ssupported%s\n",
                 feature_hdc ? "" : "not ",
@@ -213,7 +201,7 @@ static bool __init hwp_available(void)
                             : "");
 
     hwp_verbose("HW_FEEDBACK %ssupported\n",
-                (eax & CPUID6_EAX_HW_FEEDBACK) ? "" : "not ");
+                cpu_has_hw_feedback ? "" : "not ");
 
     hwp_in_use = true;
 
@@ -226,7 +214,7 @@ static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
 {
     struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
 
-    if ( !feature_hwp_activity_window && data->activity_window )
+    if ( !cpu_has_hwp_activity_window && data->activity_window )
     {
         hwp_verbose("HWP activity window not supported\n");
 
@@ -268,7 +256,7 @@ static int cf_check hwp_cpufreq_target(struct cpufreq_policy *policy,
     hwp_req.max_perf = data->maximum;
     hwp_req.desired = data->desired;
     hwp_req.energy_perf = data->energy_perf;
-    if ( feature_hwp_activity_window )
+    if ( cpu_has_hwp_activity_window )
         hwp_req.activity_window = data->activity_window;
 
     if ( hwp_req.raw == data->curr_req.raw )
@@ -365,7 +353,7 @@ static void cf_check hwp_init_msrs(void *info)
     }
 
     /* Ensure we don't generate interrupts */
-    if ( feature_hwp_notification )
+    if ( cpu_has_hwp_interrupt )
         wrmsr_safe(MSR_HWP_INTERRUPT, 0);
 
     if ( !(val & PM_ENABLE_HWP_ENABLE) )
@@ -537,7 +525,7 @@ int get_hwp_para(unsigned int cpu,
         return -ENODATA;
 
     cppc_para->features         =
-        (feature_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
+        (cpu_has_hwp_activity_window ? XEN_SYSCTL_CPPC_FEAT_ACT_WINDOW : 0);
     cppc_para->lowest           = data->hw.lowest;
     cppc_para->lowest_nonlinear = data->hw.most_efficient;
     cppc_para->nominal          = data->hw.guaranteed;
@@ -585,7 +573,7 @@ int set_hwp_para(struct cpufreq_policy *policy,
 
     /* Clear out activity window if lacking HW supported. */
     if ( (set_cppc->set_params & XEN_SYSCTL_CPPC_SET_ACT_WINDOW) &&
-         !feature_hwp_activity_window )
+         !cpu_has_hwp_activity_window )
     {
         set_cppc->set_params &= ~XEN_SYSCTL_CPPC_SET_ACT_WINDOW;
         cleared_act_window = true;
diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h
index a0374c1b20..dcd223d84f 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -115,14 +115,6 @@ static inline bool boot_cpu_has(unsigned int feat)
 }
 
 #define CPUID_PM_LEAF                                6
-#define CPUID6_EAX_HWP                               BIT(7, U)
-#define CPUID6_EAX_HWP_NOTIFICATION                  BIT(8, U)
-#define CPUID6_EAX_HWP_ACTIVITY_WINDOW               BIT(9, U)
-#define CPUID6_EAX_HWP_ENERGY_PERFORMANCE_PREFERENCE BIT(10, U)
-#define CPUID6_EAX_HWP_PACKAGE_LEVEL_REQUEST         BIT(11, U)
-#define CPUID6_EAX_HDC                               BIT(13, U)
-#define CPUID6_EAX_HWP_PECI                          BIT(16, U)
-#define CPUID6_EAX_HW_FEEDBACK                       BIT(19, U)
 
 /* CPUID level 0x00000001.edx */
 #define cpu_has_fpu             1
@@ -179,6 +171,14 @@ static inline bool boot_cpu_has(unsigned int feat)
 /* CPUID level 0x00000006.eax */
 #define cpu_has_turbo_boost     host_cpu_policy.basic.turbo_boost
 #define cpu_has_arat            host_cpu_policy.basic.arat
+#define cpu_has_hwp             host_cpu_policy.basic.hwp
+#define cpu_has_hwp_interrupt   host_cpu_policy.basic.hwp_interrupt
+#define cpu_has_hwp_activity_window host_cpu_policy.basic.hwp_activity_window
+#define cpu_has_hwp_epp         host_cpu_policy.basic.hwp_epp
+#define cpu_has_hwp_request_pkg host_cpu_policy.basic.hwp_request_pkg
+#define cpu_has_hdc             host_cpu_policy.basic.hdc
+#define cpu_has_hwp_peci_override host_cpu_policy.basic.hwp_peci_override
+#define cpu_has_hw_feedback     host_cpu_policy.basic.hw_feedback
 
 /* CPUID level 0x00000006.ecx */
 #define cpu_has_hw_feedback_cap host_cpu_policy.basic.hw_feedback_cap
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 10:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 10:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208702.1520848 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9Os-0002vI-3y; Tue, 20 Jan 2026 10:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208702.1520848; Tue, 20 Jan 2026 10:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9Os-0002vA-0z; Tue, 20 Jan 2026 10:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1208702;
 Tue, 20 Jan 2026 10:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi9Oq-0002us-Cc
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 10:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9Oq-00Chsu-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9Oq-00BNIB-11
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MY3QC/Q6fDBZBeMR9c7HVHwvs1dugUtBotyV7BZ3EQQ=; b=C32JGkbYRtEJJp0NSMNKvRNTGE
	qAYZPaYL0xr0o3eCRQHETWeDlUMD92s2OJnjWOZw6WVrg8rl52C+lBBXQ0Y2W53WtQtQomgIsHpzR
	XnrU/+gJsDpqe7fFVeoF/cbHNoIgSu4bzQAcXYqQ1W7Ch3r41Jh71fcPvr+9pfxyl4Gs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/platform: Expose DTS sensors MSR
Message-Id: <E1vi9Oq-00BNIB-11@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 10:55:52 +0000

commit 615c9f3f82006a1365d5a6b4cfb8ebc4714a7b8d
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Jan 20 09:02:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:02:39 2026 +0100

    x86/platform: Expose DTS sensors MSR
    
    Intel provide CPU sensors through "DTS" MSRs. As these MSR are core-specific
    (or package-specific), we can't reliably fetch them from Dom0 directly.
    Expose these MSR (if supported) through XENPF_resource_op so that it is
    accessible through hypercall.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/msr-index.h | 3 +++
 xen/arch/x86/platform_hypercall.c    | 6 ++++++
 xen/include/xen/lib/x86/cpu-policy.h | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index df52587c85..b92a278611 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -115,6 +115,9 @@
 #define  MCU_OPT_CTRL_GDS_MIT_DIS           (_AC(1, ULL) <<  4)
 #define  MCU_OPT_CTRL_GDS_MIT_LOCK          (_AC(1, ULL) <<  5)
 
+#define MSR_TEMPERATURE_TARGET              0x000001a2
+#define MSR_PACKAGE_THERM_STATUS            0x000001b1
+
 #define MSR_FRED_RSP_SL0                    0x000001cc
 #define MSR_FRED_RSP_SL1                    0x000001cd
 #define MSR_FRED_RSP_SL2                    0x000001ce
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 214b130ea8..f8eca48170 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -27,6 +27,7 @@
 #include <asm/current.h>
 #include <public/platform.h>
 #include <acpi/cpufreq/processor_perf.h>
+#include <asm/cpu-policy.h>
 #include <asm/edd.h>
 #include <asm/microcode.h>
 #include <asm/mtrr.h>
@@ -86,6 +87,11 @@ static bool msr_read_allowed(unsigned int msr)
 
     case MSR_MCU_OPT_CTRL:
         return cpu_has_srbds_ctrl;
+
+    case MSR_IA32_THERM_STATUS:
+    case MSR_TEMPERATURE_TARGET:
+    case MSR_PACKAGE_THERM_STATUS:
+        return host_cpu_policy.basic.digital_temp_sensor;
     }
 
     if ( ppin_msr && msr == ppin_msr )
diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index bdda6e52e1..db8d035589 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -126,7 +126,7 @@ struct cpu_policy
             union {
                 uint32_t _6a;
                 struct {
-                    bool :1,
+                    bool digital_temp_sensor:1,
                         turbo_boost:1,
                         arat:1,
                         :1,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 20 10:56:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Jan 2026 10:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1208703.1520850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9P2-0002xR-4t; Tue, 20 Jan 2026 10:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1208703.1520850; Tue, 20 Jan 2026 10:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vi9P2-0002xJ-2J; Tue, 20 Jan 2026 10:56:04 +0000
Received: by outflank-mailman (input) for mailman id 1208703;
 Tue, 20 Jan 2026 10:56:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vi9P0-0002x7-FY
 for xen-changelog@lists.xenproject.org; Tue, 20 Jan 2026 10:56:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9P0-00ChtR-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vi9P0-00BNJA-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 20 Jan 2026 10:56:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SIktxgS+Ik8McMXzp3gngUnuwBKHhT7agaA1soavyLs=; b=CHVmq5A8m2hjyvWuYOvCSPcF6Z
	hKXs2bmSoJGxIJP7vuNOk/VPP6Tlo3uS6wznMFpwv7OiO4ZPGTuHPLbOA89IIhxa6q9mCg1PyLBhl
	RzlFcLYbpCzDRq8ibPgqi4q/6fZkZcUdRr5J6J3E4BV0e77ptso55o72bXrpZ9A+Mbs8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vi9P0-00BNJA-1L@xenbits.xenproject.org>
Date: Tue, 20 Jan 2026 10:56:02 +0000

commit 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 20 09:03:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 20 09:03:17 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 362c76df0b..87b4e83250 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1651,8 +1651,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 21 12:11:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Jan 2026 12:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1209678.1521607 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viX3A-0001w8-8O; Wed, 21 Jan 2026 12:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1209678.1521607; Wed, 21 Jan 2026 12:11:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viX3A-0001w0-5r; Wed, 21 Jan 2026 12:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1209678;
 Wed, 21 Jan 2026 12:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viX38-0001vu-Dt
 for xen-changelog@lists.xenproject.org; Wed, 21 Jan 2026 12:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viX38-00EInM-2E
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 12:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viX38-00D57D-10
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 12:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Es2zHz5CSY1xl+DgSGtUpkLRO7nWDgKRpPKfiYzAa4Y=; b=L7tETb/0bFDpGWBd+jgyL6nA8F
	PNoq2+EjJTjc+lsa4eyCV7EbvOyhHf0/s3ZTY25UL9N6wDywenH42oNoU+CIlFjAAgl484sp9Jdsn
	Y16Fq4CNOMnhDfwpglFGpubRQCGytrBWVsgrm8nxSmOdHYyIsc3VbPgHP929ro5egwmc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/intel: Drop more cpuid_mask_* infrastructure
Message-Id: <E1viX38-00D57D-10@xenbits.xenproject.org>
Date: Wed, 21 Jan 2026 12:11:02 +0000

commit 54deff5e135f10f4b9ba834b918f9ce636ba1ff5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 19 19:30:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 21 10:47:46 2026 +0000

    x86/intel: Drop more cpuid_mask_* infrastructure
    
    Despite removing references from the documentation, the Intel parts of CPUID
    Masking were accidentally left behind and still active.
    
    Intel CPUID Masking is even more niche than AMD masking, as the MSRs only
    exist between Nehalem and SandyBridge, being fully replaced with CPUID
    Faulting from IvyBridge onwards.
    
    Fixes: 317051c2f032 ("x86/amd: Drop the cpuid_mask_* command line options")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 CHANGELOG.md              |  4 ++--
 xen/arch/x86/cpu/common.c | 13 -------------
 xen/arch/x86/cpu/cpu.h    |  3 ---
 xen/arch/x86/cpu/intel.c  | 24 ++----------------------
 4 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7de34f64d1..53d92a2597 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,9 +12,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ### Removed
  - On x86:
-   - The cpuid_mask_* command line options for legacy AMD CPUs.  These were
+   - The cpuid_mask_* command line options for legacy CPUs.  These were
      deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from
-     2011 onwards.
+     2011 onwards, nor work at all with Intel CPUs from 2012.
    - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 091c018934..28aca3417d 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -31,19 +31,6 @@ bool __read_mostly opt_dom0_cpuid_faulting = true;
 bool opt_arat = true;
 boolean_param("arat", opt_arat);
 
-unsigned int opt_cpuid_mask_ecx = ~0u;
-integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx);
-unsigned int opt_cpuid_mask_edx = ~0u;
-integer_param("cpuid_mask_edx", opt_cpuid_mask_edx);
-
-unsigned int opt_cpuid_mask_xsave_eax = ~0u;
-integer_param("cpuid_mask_xsave_eax", opt_cpuid_mask_xsave_eax);
-
-unsigned int opt_cpuid_mask_ext_ecx = ~0u;
-integer_param("cpuid_mask_ext_ecx", opt_cpuid_mask_ext_ecx);
-unsigned int opt_cpuid_mask_ext_edx = ~0u;
-integer_param("cpuid_mask_ext_edx", opt_cpuid_mask_ext_edx);
-
 unsigned int __initdata expected_levelling_cap;
 unsigned int __read_mostly levelling_caps;
 
diff --git a/xen/arch/x86/cpu/cpu.h b/xen/arch/x86/cpu/cpu.h
index 8bed3f5249..bbede57ab0 100644
--- a/xen/arch/x86/cpu/cpu.h
+++ b/xen/arch/x86/cpu/cpu.h
@@ -12,9 +12,6 @@ extern const struct cpu_dev intel_cpu_dev, amd_cpu_dev, centaur_cpu_dev,
     shanghai_cpu_dev, hygon_cpu_dev;
 
 extern bool opt_arat;
-extern unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_edx;
-extern unsigned int opt_cpuid_mask_xsave_eax;
-extern unsigned int opt_cpuid_mask_ext_ecx, opt_cpuid_mask_ext_edx;
 
 extern int get_model_name(struct cpuinfo_x86 *c);
 extern void display_cacheinfo(struct cpuinfo_x86 *c);
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 7037f1f268..584588e406 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -251,14 +251,10 @@ static const typeof(ctxt_switch_masking) __initconst_cf_clobber __used csm =
     intel_ctxt_switch_masking;
 #endif
 
-/*
- * opt_cpuid_mask_ecx/edx: cpuid.1[ecx, edx] feature mask.
- * For example, E8400[Intel Core 2 Duo Processor series] ecx = 0x0008E3FD,
- * edx = 0xBFEBFBFF when executing CPUID.EAX = 1 normally. If you want to
- * 'rev down' to E8400, you can set these values in these Xen boot parameters.
- */
 static void __init noinline intel_init_levelling(void)
 {
+	uint32_t eax, ecx, edx, tmp;
+
 	/*
 	 * Intel Fam0f is old enough that probing for CPUID faulting support
 	 * introduces spurious #GP(0) when the appropriate MSRs are read,
@@ -275,13 +271,8 @@ static void __init noinline intel_init_levelling(void)
 	probe_masking_msrs();
 
 	if (msr_basic) {
-		uint32_t ecx, edx, tmp;
-
 		cpuid(0x00000001, &tmp, &tmp, &ecx, &edx);
 
-		ecx &= opt_cpuid_mask_ecx;
-		edx &= opt_cpuid_mask_edx;
-
 		/* Fast-forward bits - Must be set. */
 		if (ecx & cpufeat_mask(X86_FEATURE_XSAVE))
 			ecx |= cpufeat_mask(X86_FEATURE_OSXSAVE);
@@ -291,23 +282,12 @@ static void __init noinline intel_init_levelling(void)
 	}
 
 	if (msr_ext) {
-		uint32_t ecx, edx, tmp;
-
 		cpuid(0x80000001, &tmp, &tmp, &ecx, &edx);
-
-		ecx &= opt_cpuid_mask_ext_ecx;
-		edx &= opt_cpuid_mask_ext_edx;
-
 		cpuidmask_defaults.e1cd &= ((u64)edx << 32) | ecx;
 	}
 
 	if (msr_xsave) {
-		uint32_t eax, tmp;
-
 		cpuid_count(0x0000000d, 1, &eax, &tmp, &tmp, &tmp);
-
-		eax &= opt_cpuid_mask_xsave_eax;
-
 		cpuidmask_defaults.Da1 &= (~0ULL << 32) | eax;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 21 12:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Jan 2026 12:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1209679.1521612 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viX3K-0001xx-AF; Wed, 21 Jan 2026 12:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1209679.1521612; Wed, 21 Jan 2026 12:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viX3K-0001xp-7I; Wed, 21 Jan 2026 12:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1209679;
 Wed, 21 Jan 2026 12:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viX3I-0001xb-G1
 for xen-changelog@lists.xenproject.org; Wed, 21 Jan 2026 12:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viX3I-00EInU-2a
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viX3I-00D57q-1N
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 12:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n2wawmE6ve+TtNKeK9by9Jx1FUmv1tXJpjOE0m7Eznw=; b=GWqSzH4suwCfxviivtSN4Qkeqx
	E9tSmyV6X2MjOnvzr0VVWc2dBziNbYG/KicR3L0m/mNcJLbRD57bCpEuoeGKXXRhUrbclP/MFfJq/
	D18ieYATlPLPieiQ3ny7t1+Qw817PzL5w2iyxVQ9uz//mvxDIgFmC468FhnAwagBWjFg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Add Kconfig option to remove microcode loading
Message-Id: <E1viX3I-00D57q-1N@xenbits.xenproject.org>
Date: Wed, 21 Jan 2026 12:11:12 +0000

commit c4fecc5267d0e2c755d4e451dbd86c5480dfd078
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 20 10:38:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 21 10:47:46 2026 +0000

    x86/ucode: Add Kconfig option to remove microcode loading
    
    Amend docs to reflect ucode= command/stanza depend on MICROCODE_LOADING
    being set.
    
    The new MICROCODE_OP() is a conditional setter for the microcode_ops
    struct. By using IS_ENABLED() there rather than ifdef we allow DCE to
    remove all statics no longer used when microcode loading is disabled
    without tagging them with __maybe_unused.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/admin-guide/microcode-loading.rst |  2 ++
 docs/misc/efi.pandoc                   |  2 ++
 docs/misc/xen-command-line.pandoc      |  7 ++++---
 xen/arch/x86/Kconfig                   | 14 ++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c       | 16 +++++++++-------
 xen/arch/x86/cpu/microcode/core.c      | 15 ++++++++++++---
 xen/arch/x86/cpu/microcode/intel.c     | 11 +++++++----
 xen/arch/x86/cpu/microcode/private.h   |  3 +++
 xen/arch/x86/efi/efi-boot.h            |  3 ++-
 xen/arch/x86/platform_hypercall.c      |  8 ++++++++
 10 files changed, 63 insertions(+), 18 deletions(-)

diff --git a/docs/admin-guide/microcode-loading.rst b/docs/admin-guide/microcode-loading.rst
index a07e25802f..148bc8559b 100644
--- a/docs/admin-guide/microcode-loading.rst
+++ b/docs/admin-guide/microcode-loading.rst
@@ -23,6 +23,8 @@ TSX errata which necessitated disabling the feature entirely), or the addition
 of brand new features (e.g. the Spectre v2 controls to work around speculative
 execution vulnerabilities).
 
+Microcode loading support in Xen is controlled by the
+``CONFIG_MICROCODE_LOADING`` Kconfig option.
 
 Boot time microcode loading
 ---------------------------
diff --git a/docs/misc/efi.pandoc b/docs/misc/efi.pandoc
index 11c1ac3346..8198a7f063 100644
--- a/docs/misc/efi.pandoc
+++ b/docs/misc/efi.pandoc
@@ -104,6 +104,8 @@ Specifies an XSM module to load.
 
 Specifies a CPU microcode blob to load. (x86 only)
 
+Only available when Xen is compiled with CONFIG_MICROCODE_LOADING enabled.
+
 ###`dtb=<filename>`
 
 Specifies a device tree file to load.  The platform firmware may provide a
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 15f7a315a4..ece4dd4c93 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2751,9 +2751,10 @@ performance.
     Applicability: x86
     Default: `scan` is selectable via Kconfig, `nmi,digest-check`
 
-Controls for CPU microcode loading. For early loading, this parameter can
-specify how and where to find the microcode update blob. For late loading,
-this parameter specifies if the update happens within a NMI handler.
+Controls for CPU microcode loading, available when `CONFIG_MICROCODE_LOADING`
+is enabled. For early loading, this parameter can specify how and where to
+find the microcode update blob. For late loading, this parameter specifies if
+the update happens within a NMI handler.
 
 'integer' specifies the CPU microcode update blob module index. When positive,
 this specifies the n-th module (in the GrUB entry, zero based) to be used
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index d5705e4bff..61f58aa829 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -331,8 +331,22 @@ config REQUIRE_NX
 	  was unavailable. However, if enabled, Xen will no longer boot on
 	  any CPU which is lacking NX support.
 
+config MICROCODE_LOADING
+	bool "Microcode loading"
+	default y
+	help
+	  Microcode updates for CPUs fix errata and provide new functionality for
+	  software to work around bugs, such as the speculative execution
+	  vulnerabilities. It is common for OSes to carry updated microcode as
+	  software tends to get updated more frequently than firmware.
+
+	  For embedded environments where a full firmware/software stack is being
+	  provided, it might not be necessary for Xen to need to load microcode
+	  itself.
+
 config MICROCODE_SCAN_DEFAULT
 	bool "Scan for microcode by default"
+	depends on MICROCODE_LOADING
 	help
 	  During boot, Xen can scan the multiboot images for a CPIO archive
 	  containing CPU microcode to be loaded, which is Linux's mechanism for
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 71b041c84b..c1ab6deb4d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -561,11 +561,11 @@ static const char __initconst amd_cpio_path[] =
     "kernel/x86/microcode/AuthenticAMD.bin";
 
 static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
-    .cpu_request_microcode            = cpu_request_microcode,
     .collect_cpu_info                 = collect_cpu_info,
-    .apply_microcode                  = apply_microcode,
-    .compare                          = amd_compare,
-    .cpio_path                        = amd_cpio_path,
+    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .compare                          = MICROCODE_OP(amd_compare),
+    .cpio_path                        = MICROCODE_OP(amd_cpio_path),
 };
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
@@ -574,7 +574,8 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
      * 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 &&
+    if ( IS_ENABLED(CONFIG_MICROCODE_LOADING) &&
+         boot_cpu_data.family >= 0x17 && boot_cpu_data.family <= 0x1a &&
          !opt_digest_check )
     {
         printk(XENLOG_WARNING
@@ -614,8 +615,9 @@ 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 ||
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING)  ||
+         boot_cpu_data.vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.family < 0x17            ||
          boot_cpu_data.family > 0x1a )
         return;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index dabdb95b4c..efaf808f1a 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -58,7 +58,7 @@
  */
 #define MICROCODE_UPDATE_TIMEOUT_US 1000000
 
-static bool __initdata ucode_mod_forced;
+static bool __initdata __maybe_unused ucode_mod_forced;
 static unsigned int nr_cores;
 
 /*
@@ -104,6 +104,7 @@ static int __initdata opt_mod_idx;
 static bool __initdata opt_scan = IS_ENABLED(CONFIG_MICROCODE_SCAN_DEFAULT);
 bool __ro_after_init opt_digest_check = true;
 
+#ifdef CONFIG_MICROCODE_LOADING
 /*
  * Used by the EFI path only, when xen.cfg identifies an explicit microcode
  * file.  Overrides ucode=<int>|scan on the regular command line.
@@ -162,6 +163,7 @@ static int __init cf_check parse_ucode(const char *s)
     return rc;
 }
 custom_param("ucode", parse_ucode);
+#endif /* CONFIG_MICROCODE_LOADING */
 
 static struct microcode_ops __ro_after_init ucode_ops;
 
@@ -469,7 +471,7 @@ struct ucode_buf {
     char buffer[];
 };
 
-static long cf_check ucode_update_hcall_cont(void *data)
+static long cf_check __maybe_unused ucode_update_hcall_cont(void *data)
 {
     struct microcode_patch *patch = NULL;
     int ret, result;
@@ -613,6 +615,7 @@ static long cf_check ucode_update_hcall_cont(void *data)
     return ret;
 }
 
+#ifdef CONFIG_MICROCODE_LOADING
 int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf,
                        unsigned long len, unsigned int flags)
 {
@@ -645,6 +648,7 @@ int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf,
      */
     return continue_hypercall_on_cpu(0, ucode_update_hcall_cont, buffer);
 }
+#endif /* CONFIG_MICROCODE_LOADING */
 
 /* Load a cached update to current cpu */
 int microcode_update_one(void)
@@ -658,7 +662,7 @@ int microcode_update_one(void)
     if ( ucode_ops.collect_cpu_info )
         alternative_vcall(ucode_ops.collect_cpu_info);
 
-    if ( !ucode_ops.apply_microcode )
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || !ucode_ops.apply_microcode )
         return -EOPNOTSUPP;
 
     spin_lock(&microcode_mutex);
@@ -678,6 +682,7 @@ int microcode_update_one(void)
  */
 static int __initdata early_mod_idx = -1;
 
+#ifdef CONFIG_MICROCODE_LOADING
 static int __init cf_check microcode_init_cache(void)
 {
     struct boot_info *bi = &xen_boot_info;
@@ -734,6 +739,7 @@ static int __init cf_check microcode_init_cache(void)
     return rc;
 }
 presmp_initcall(microcode_init_cache);
+#endif /* CONFIG_MICROCODE_LOADING */
 
 /*
  * There are several tasks:
@@ -898,6 +904,9 @@ int __init early_microcode_init(struct boot_info *bi)
 
     printk(XENLOG_INFO "BSP microcode revision: 0x%08x\n", this_cpu(cpu_sig).rev);
 
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+        return -ENODEV;
+
     /*
      * Some hypervisors deliberately report a microcode revision of -1 to
      * mean that they will not accept microcode updates.
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index 281993e725..dac464961a 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -408,17 +408,20 @@ static const char __initconst intel_cpio_path[] =
     "kernel/x86/microcode/GenuineIntel.bin";
 
 static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
-    .cpu_request_microcode            = cpu_request_microcode,
     .collect_cpu_info                 = collect_cpu_info,
-    .apply_microcode                  = apply_microcode,
-    .compare                          = intel_compare,
-    .cpio_path                        = intel_cpio_path,
+    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .compare                          = MICROCODE_OP(intel_compare),
+    .cpio_path                        = MICROCODE_OP(intel_cpio_path),
 };
 
 void __init ucode_probe_intel(struct microcode_ops *ops)
 {
     *ops = intel_ucode_ops;
 
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+        return;
+
     if ( !can_load_microcode() )
         ops->apply_microcode = NULL;
 }
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index e6c965dc99..77ce816c1a 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -8,6 +8,9 @@
 /* Opaque.  Internals are vendor-specific. */
 struct microcode_patch;
 
+/* Aids dead-code elimination of the static hooks */
+#define MICROCODE_OP(x) (IS_ENABLED(CONFIG_MICROCODE_LOADING) ? (x) : NULL)
+
 struct microcode_ops {
     /*
      * Parse a microcode container.  Format is vendor-specific.
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 0194720003..42a2c46b5e 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -295,7 +295,8 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
 {
     union string name;
 
-    if ( read_section(image, L"ucode", &ucode, NULL) )
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) ||
+         read_section(image, L"ucode", &ucode, NULL) )
         return;
 
     name.s = get_value(&cfg, section, "ucode");
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index f8eca48170..c6c5135806 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -317,6 +317,10 @@ ret_t do_platform_op(
     {
         XEN_GUEST_HANDLE(const_void) data;
 
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+            break;
+
         guest_from_compat_handle(data, op->u.microcode.data);
 
         ret = ucode_update_hcall(data, op->u.microcode.length, 0);
@@ -327,6 +331,10 @@ ret_t do_platform_op(
     {
         XEN_GUEST_HANDLE(const_void) data;
 
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+            break;
+
         guest_from_compat_handle(data, op->u.microcode2.data);
 
         ret = ucode_update_hcall(data, op->u.microcode2.length,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 21 12:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Jan 2026 12:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1209680.1521615 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viX3U-00020G-BD; Wed, 21 Jan 2026 12:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1209680.1521615; Wed, 21 Jan 2026 12:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viX3U-000208-8i; Wed, 21 Jan 2026 12:11:24 +0000
Received: by outflank-mailman (input) for mailman id 1209680;
 Wed, 21 Jan 2026 12:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viX3S-0001zy-JY
 for xen-changelog@lists.xenproject.org; Wed, 21 Jan 2026 12:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viX3S-00EInr-2t
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viX3S-00D59X-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 12:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=awxNPG092o3LU1qvwhBd3ydUybodwWMzWMNOSZKmJ1c=; b=hDLOqJxDhMMCnYkS5PvfomUqqv
	OyGmjiNJSkDh5zWe7cwChnYXqCMdBHqRCBiOAe9bwHnHoz9MRd5iO9YKWUB8+YV5zcxilsaIM0PnN
	Z0wSVT3k2/WdQJVOAtyogSdAoiYT0feR6XCGB2xmlPpkjEW8qCzd2ONUtqAAc+xOtSzY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: Disable ucode loading on AMD's analysis run
Message-Id: <E1viX3S-00D59X-1f@xenbits.xenproject.org>
Date: Wed, 21 Jan 2026 12:11:22 +0000

commit 61204ed24ba4537d6eff56594faa5d23cacb8310
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 20 10:38:50 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 21 10:47:46 2026 +0000

    automation: Disable ucode loading on AMD's analysis run
    
    Explicitly set CONFIG_MICROCODE_LOADING=n
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/analyze.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index a472692fcb..b3395e2da7 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -93,6 +93,7 @@ eclair-x86_64-amd:
       CONFIG_DEBUG_LOCKS=n
       CONFIG_SCRUB_DEBUG=n
       CONFIG_XMEM_POOL_POISON=n
+      CONFIG_MICROCODE_LOADING=n
   rules:
     - if: $ECLAIR_SAFETY
       when: always
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 21 13:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Jan 2026 13:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1209760.1521670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viY9r-0004ao-8E; Wed, 21 Jan 2026 13:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1209760.1521670; Wed, 21 Jan 2026 13: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 1viY9r-0004ag-5S; Wed, 21 Jan 2026 13:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1209760;
 Wed, 21 Jan 2026 13:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viY9q-0004aa-4W
 for xen-changelog@lists.xenproject.org; Wed, 21 Jan 2026 13:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viY9q-00EK3M-15
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 13:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viY9p-00D9e4-2u
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 13: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=2VlYh395ekgGEc6SZA9o9tH1N4zamc1xYZl7/7/8rbs=; b=N6FgSrl17p3Xm10667wFISMsCG
	J8HXNTZU1r1p0tl089WSgC3umL6kMrPYrgS7aFAakauMrVcvMzlJqm5keliF7XOtlXmER5q942a/i
	maqW0WJG6hqdesmwQlLLjE1J4tn7vsv8AFH1gDkQpNybsdzmR3oBvzl8vhpydQWBaQvw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/intel: Drop more cpuid_mask_* infrastructure
Message-Id: <E1viY9p-00D9e4-2u@xenbits.xenproject.org>
Date: Wed, 21 Jan 2026 13:22:01 +0000

commit 54deff5e135f10f4b9ba834b918f9ce636ba1ff5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 19 19:30:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 21 10:47:46 2026 +0000

    x86/intel: Drop more cpuid_mask_* infrastructure
    
    Despite removing references from the documentation, the Intel parts of CPUID
    Masking were accidentally left behind and still active.
    
    Intel CPUID Masking is even more niche than AMD masking, as the MSRs only
    exist between Nehalem and SandyBridge, being fully replaced with CPUID
    Faulting from IvyBridge onwards.
    
    Fixes: 317051c2f032 ("x86/amd: Drop the cpuid_mask_* command line options")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 CHANGELOG.md              |  4 ++--
 xen/arch/x86/cpu/common.c | 13 -------------
 xen/arch/x86/cpu/cpu.h    |  3 ---
 xen/arch/x86/cpu/intel.c  | 24 ++----------------------
 4 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7de34f64d1..53d92a2597 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,9 +12,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
 ### Removed
  - On x86:
-   - The cpuid_mask_* command line options for legacy AMD CPUs.  These were
+   - The cpuid_mask_* command line options for legacy CPUs.  These were
      deprecated in Xen 4.7 and noted not to work correctly with AMD CPUs from
-     2011 onwards.
+     2011 onwards, nor work at all with Intel CPUs from 2012.
    - Xenoprofile support.  Oprofile themselves removed support for Xen in 2014
      prior to the version 1.0 release, and there has been no development since
      before then in Xen.
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 091c018934..28aca3417d 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -31,19 +31,6 @@ bool __read_mostly opt_dom0_cpuid_faulting = true;
 bool opt_arat = true;
 boolean_param("arat", opt_arat);
 
-unsigned int opt_cpuid_mask_ecx = ~0u;
-integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx);
-unsigned int opt_cpuid_mask_edx = ~0u;
-integer_param("cpuid_mask_edx", opt_cpuid_mask_edx);
-
-unsigned int opt_cpuid_mask_xsave_eax = ~0u;
-integer_param("cpuid_mask_xsave_eax", opt_cpuid_mask_xsave_eax);
-
-unsigned int opt_cpuid_mask_ext_ecx = ~0u;
-integer_param("cpuid_mask_ext_ecx", opt_cpuid_mask_ext_ecx);
-unsigned int opt_cpuid_mask_ext_edx = ~0u;
-integer_param("cpuid_mask_ext_edx", opt_cpuid_mask_ext_edx);
-
 unsigned int __initdata expected_levelling_cap;
 unsigned int __read_mostly levelling_caps;
 
diff --git a/xen/arch/x86/cpu/cpu.h b/xen/arch/x86/cpu/cpu.h
index 8bed3f5249..bbede57ab0 100644
--- a/xen/arch/x86/cpu/cpu.h
+++ b/xen/arch/x86/cpu/cpu.h
@@ -12,9 +12,6 @@ extern const struct cpu_dev intel_cpu_dev, amd_cpu_dev, centaur_cpu_dev,
     shanghai_cpu_dev, hygon_cpu_dev;
 
 extern bool opt_arat;
-extern unsigned int opt_cpuid_mask_ecx, opt_cpuid_mask_edx;
-extern unsigned int opt_cpuid_mask_xsave_eax;
-extern unsigned int opt_cpuid_mask_ext_ecx, opt_cpuid_mask_ext_edx;
 
 extern int get_model_name(struct cpuinfo_x86 *c);
 extern void display_cacheinfo(struct cpuinfo_x86 *c);
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 7037f1f268..584588e406 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -251,14 +251,10 @@ static const typeof(ctxt_switch_masking) __initconst_cf_clobber __used csm =
     intel_ctxt_switch_masking;
 #endif
 
-/*
- * opt_cpuid_mask_ecx/edx: cpuid.1[ecx, edx] feature mask.
- * For example, E8400[Intel Core 2 Duo Processor series] ecx = 0x0008E3FD,
- * edx = 0xBFEBFBFF when executing CPUID.EAX = 1 normally. If you want to
- * 'rev down' to E8400, you can set these values in these Xen boot parameters.
- */
 static void __init noinline intel_init_levelling(void)
 {
+	uint32_t eax, ecx, edx, tmp;
+
 	/*
 	 * Intel Fam0f is old enough that probing for CPUID faulting support
 	 * introduces spurious #GP(0) when the appropriate MSRs are read,
@@ -275,13 +271,8 @@ static void __init noinline intel_init_levelling(void)
 	probe_masking_msrs();
 
 	if (msr_basic) {
-		uint32_t ecx, edx, tmp;
-
 		cpuid(0x00000001, &tmp, &tmp, &ecx, &edx);
 
-		ecx &= opt_cpuid_mask_ecx;
-		edx &= opt_cpuid_mask_edx;
-
 		/* Fast-forward bits - Must be set. */
 		if (ecx & cpufeat_mask(X86_FEATURE_XSAVE))
 			ecx |= cpufeat_mask(X86_FEATURE_OSXSAVE);
@@ -291,23 +282,12 @@ static void __init noinline intel_init_levelling(void)
 	}
 
 	if (msr_ext) {
-		uint32_t ecx, edx, tmp;
-
 		cpuid(0x80000001, &tmp, &tmp, &ecx, &edx);
-
-		ecx &= opt_cpuid_mask_ext_ecx;
-		edx &= opt_cpuid_mask_ext_edx;
-
 		cpuidmask_defaults.e1cd &= ((u64)edx << 32) | ecx;
 	}
 
 	if (msr_xsave) {
-		uint32_t eax, tmp;
-
 		cpuid_count(0x0000000d, 1, &eax, &tmp, &tmp, &tmp);
-
-		eax &= opt_cpuid_mask_xsave_eax;
-
 		cpuidmask_defaults.Da1 &= (~0ULL << 32) | eax;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 21 13:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Jan 2026 13:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1209761.1521674 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viYA1-0004d2-BI; Wed, 21 Jan 2026 13:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1209761.1521674; Wed, 21 Jan 2026 13: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 1viYA1-0004cu-8Z; Wed, 21 Jan 2026 13:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1209761;
 Wed, 21 Jan 2026 13:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viYA0-0004cm-5L
 for xen-changelog@lists.xenproject.org; Wed, 21 Jan 2026 13:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viYA0-00EK3Q-1T
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viYA0-00D9h3-0D
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 13:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=04NzFQgmTmYMB1merXHx/+zneLZNere765Bdyt7RDlk=; b=xpuMw6nFD2xbv1MP4MGbsSJlWv
	qvykwBG3gNoMK+MTl3EiXaZeYUw/8WLQRJtkMOIx725sEnA9fvelTEVPT79MHDpW9ScCHMyy/t6Fr
	s3vFiA7BXLvGysZFS8OvUWot4sGNtzeAewY1BxMuK9MHVSKfqF3P6DhKafrlgeb6O93Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Add Kconfig option to remove microcode loading
Message-Id: <E1viYA0-00D9h3-0D@xenbits.xenproject.org>
Date: Wed, 21 Jan 2026 13:22:12 +0000

commit c4fecc5267d0e2c755d4e451dbd86c5480dfd078
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 20 10:38:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 21 10:47:46 2026 +0000

    x86/ucode: Add Kconfig option to remove microcode loading
    
    Amend docs to reflect ucode= command/stanza depend on MICROCODE_LOADING
    being set.
    
    The new MICROCODE_OP() is a conditional setter for the microcode_ops
    struct. By using IS_ENABLED() there rather than ifdef we allow DCE to
    remove all statics no longer used when microcode loading is disabled
    without tagging them with __maybe_unused.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/admin-guide/microcode-loading.rst |  2 ++
 docs/misc/efi.pandoc                   |  2 ++
 docs/misc/xen-command-line.pandoc      |  7 ++++---
 xen/arch/x86/Kconfig                   | 14 ++++++++++++++
 xen/arch/x86/cpu/microcode/amd.c       | 16 +++++++++-------
 xen/arch/x86/cpu/microcode/core.c      | 15 ++++++++++++---
 xen/arch/x86/cpu/microcode/intel.c     | 11 +++++++----
 xen/arch/x86/cpu/microcode/private.h   |  3 +++
 xen/arch/x86/efi/efi-boot.h            |  3 ++-
 xen/arch/x86/platform_hypercall.c      |  8 ++++++++
 10 files changed, 63 insertions(+), 18 deletions(-)

diff --git a/docs/admin-guide/microcode-loading.rst b/docs/admin-guide/microcode-loading.rst
index a07e25802f..148bc8559b 100644
--- a/docs/admin-guide/microcode-loading.rst
+++ b/docs/admin-guide/microcode-loading.rst
@@ -23,6 +23,8 @@ TSX errata which necessitated disabling the feature entirely), or the addition
 of brand new features (e.g. the Spectre v2 controls to work around speculative
 execution vulnerabilities).
 
+Microcode loading support in Xen is controlled by the
+``CONFIG_MICROCODE_LOADING`` Kconfig option.
 
 Boot time microcode loading
 ---------------------------
diff --git a/docs/misc/efi.pandoc b/docs/misc/efi.pandoc
index 11c1ac3346..8198a7f063 100644
--- a/docs/misc/efi.pandoc
+++ b/docs/misc/efi.pandoc
@@ -104,6 +104,8 @@ Specifies an XSM module to load.
 
 Specifies a CPU microcode blob to load. (x86 only)
 
+Only available when Xen is compiled with CONFIG_MICROCODE_LOADING enabled.
+
 ###`dtb=<filename>`
 
 Specifies a device tree file to load.  The platform firmware may provide a
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 15f7a315a4..ece4dd4c93 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2751,9 +2751,10 @@ performance.
     Applicability: x86
     Default: `scan` is selectable via Kconfig, `nmi,digest-check`
 
-Controls for CPU microcode loading. For early loading, this parameter can
-specify how and where to find the microcode update blob. For late loading,
-this parameter specifies if the update happens within a NMI handler.
+Controls for CPU microcode loading, available when `CONFIG_MICROCODE_LOADING`
+is enabled. For early loading, this parameter can specify how and where to
+find the microcode update blob. For late loading, this parameter specifies if
+the update happens within a NMI handler.
 
 'integer' specifies the CPU microcode update blob module index. When positive,
 this specifies the n-th module (in the GrUB entry, zero based) to be used
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index d5705e4bff..61f58aa829 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -331,8 +331,22 @@ config REQUIRE_NX
 	  was unavailable. However, if enabled, Xen will no longer boot on
 	  any CPU which is lacking NX support.
 
+config MICROCODE_LOADING
+	bool "Microcode loading"
+	default y
+	help
+	  Microcode updates for CPUs fix errata and provide new functionality for
+	  software to work around bugs, such as the speculative execution
+	  vulnerabilities. It is common for OSes to carry updated microcode as
+	  software tends to get updated more frequently than firmware.
+
+	  For embedded environments where a full firmware/software stack is being
+	  provided, it might not be necessary for Xen to need to load microcode
+	  itself.
+
 config MICROCODE_SCAN_DEFAULT
 	bool "Scan for microcode by default"
+	depends on MICROCODE_LOADING
 	help
 	  During boot, Xen can scan the multiboot images for a CPIO archive
 	  containing CPU microcode to be loaded, which is Linux's mechanism for
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 71b041c84b..c1ab6deb4d 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -561,11 +561,11 @@ static const char __initconst amd_cpio_path[] =
     "kernel/x86/microcode/AuthenticAMD.bin";
 
 static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
-    .cpu_request_microcode            = cpu_request_microcode,
     .collect_cpu_info                 = collect_cpu_info,
-    .apply_microcode                  = apply_microcode,
-    .compare                          = amd_compare,
-    .cpio_path                        = amd_cpio_path,
+    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .compare                          = MICROCODE_OP(amd_compare),
+    .cpio_path                        = MICROCODE_OP(amd_cpio_path),
 };
 
 void __init ucode_probe_amd(struct microcode_ops *ops)
@@ -574,7 +574,8 @@ void __init ucode_probe_amd(struct microcode_ops *ops)
      * 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 &&
+    if ( IS_ENABLED(CONFIG_MICROCODE_LOADING) &&
+         boot_cpu_data.family >= 0x17 && boot_cpu_data.family <= 0x1a &&
          !opt_digest_check )
     {
         printk(XENLOG_WARNING
@@ -614,8 +615,9 @@ 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 ||
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING)  ||
+         boot_cpu_data.vendor != X86_VENDOR_AMD ||
+         boot_cpu_data.family < 0x17            ||
          boot_cpu_data.family > 0x1a )
         return;
 
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index dabdb95b4c..efaf808f1a 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -58,7 +58,7 @@
  */
 #define MICROCODE_UPDATE_TIMEOUT_US 1000000
 
-static bool __initdata ucode_mod_forced;
+static bool __initdata __maybe_unused ucode_mod_forced;
 static unsigned int nr_cores;
 
 /*
@@ -104,6 +104,7 @@ static int __initdata opt_mod_idx;
 static bool __initdata opt_scan = IS_ENABLED(CONFIG_MICROCODE_SCAN_DEFAULT);
 bool __ro_after_init opt_digest_check = true;
 
+#ifdef CONFIG_MICROCODE_LOADING
 /*
  * Used by the EFI path only, when xen.cfg identifies an explicit microcode
  * file.  Overrides ucode=<int>|scan on the regular command line.
@@ -162,6 +163,7 @@ static int __init cf_check parse_ucode(const char *s)
     return rc;
 }
 custom_param("ucode", parse_ucode);
+#endif /* CONFIG_MICROCODE_LOADING */
 
 static struct microcode_ops __ro_after_init ucode_ops;
 
@@ -469,7 +471,7 @@ struct ucode_buf {
     char buffer[];
 };
 
-static long cf_check ucode_update_hcall_cont(void *data)
+static long cf_check __maybe_unused ucode_update_hcall_cont(void *data)
 {
     struct microcode_patch *patch = NULL;
     int ret, result;
@@ -613,6 +615,7 @@ static long cf_check ucode_update_hcall_cont(void *data)
     return ret;
 }
 
+#ifdef CONFIG_MICROCODE_LOADING
 int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf,
                        unsigned long len, unsigned int flags)
 {
@@ -645,6 +648,7 @@ int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf,
      */
     return continue_hypercall_on_cpu(0, ucode_update_hcall_cont, buffer);
 }
+#endif /* CONFIG_MICROCODE_LOADING */
 
 /* Load a cached update to current cpu */
 int microcode_update_one(void)
@@ -658,7 +662,7 @@ int microcode_update_one(void)
     if ( ucode_ops.collect_cpu_info )
         alternative_vcall(ucode_ops.collect_cpu_info);
 
-    if ( !ucode_ops.apply_microcode )
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || !ucode_ops.apply_microcode )
         return -EOPNOTSUPP;
 
     spin_lock(&microcode_mutex);
@@ -678,6 +682,7 @@ int microcode_update_one(void)
  */
 static int __initdata early_mod_idx = -1;
 
+#ifdef CONFIG_MICROCODE_LOADING
 static int __init cf_check microcode_init_cache(void)
 {
     struct boot_info *bi = &xen_boot_info;
@@ -734,6 +739,7 @@ static int __init cf_check microcode_init_cache(void)
     return rc;
 }
 presmp_initcall(microcode_init_cache);
+#endif /* CONFIG_MICROCODE_LOADING */
 
 /*
  * There are several tasks:
@@ -898,6 +904,9 @@ int __init early_microcode_init(struct boot_info *bi)
 
     printk(XENLOG_INFO "BSP microcode revision: 0x%08x\n", this_cpu(cpu_sig).rev);
 
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+        return -ENODEV;
+
     /*
      * Some hypervisors deliberately report a microcode revision of -1 to
      * mean that they will not accept microcode updates.
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index 281993e725..dac464961a 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -408,17 +408,20 @@ static const char __initconst intel_cpio_path[] =
     "kernel/x86/microcode/GenuineIntel.bin";
 
 static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
-    .cpu_request_microcode            = cpu_request_microcode,
     .collect_cpu_info                 = collect_cpu_info,
-    .apply_microcode                  = apply_microcode,
-    .compare                          = intel_compare,
-    .cpio_path                        = intel_cpio_path,
+    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .compare                          = MICROCODE_OP(intel_compare),
+    .cpio_path                        = MICROCODE_OP(intel_cpio_path),
 };
 
 void __init ucode_probe_intel(struct microcode_ops *ops)
 {
     *ops = intel_ucode_ops;
 
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+        return;
+
     if ( !can_load_microcode() )
         ops->apply_microcode = NULL;
 }
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index e6c965dc99..77ce816c1a 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -8,6 +8,9 @@
 /* Opaque.  Internals are vendor-specific. */
 struct microcode_patch;
 
+/* Aids dead-code elimination of the static hooks */
+#define MICROCODE_OP(x) (IS_ENABLED(CONFIG_MICROCODE_LOADING) ? (x) : NULL)
+
 struct microcode_ops {
     /*
      * Parse a microcode container.  Format is vendor-specific.
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 0194720003..42a2c46b5e 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -295,7 +295,8 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
 {
     union string name;
 
-    if ( read_section(image, L"ucode", &ucode, NULL) )
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) ||
+         read_section(image, L"ucode", &ucode, NULL) )
         return;
 
     name.s = get_value(&cfg, section, "ucode");
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index f8eca48170..c6c5135806 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -317,6 +317,10 @@ ret_t do_platform_op(
     {
         XEN_GUEST_HANDLE(const_void) data;
 
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+            break;
+
         guest_from_compat_handle(data, op->u.microcode.data);
 
         ret = ucode_update_hcall(data, op->u.microcode.length, 0);
@@ -327,6 +331,10 @@ ret_t do_platform_op(
     {
         XEN_GUEST_HANDLE(const_void) data;
 
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) )
+            break;
+
         guest_from_compat_handle(data, op->u.microcode2.data);
 
         ret = ucode_update_hcall(data, op->u.microcode2.length,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 21 13:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Jan 2026 13:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1209762.1521678 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viYAB-0004fO-CW; Wed, 21 Jan 2026 13:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1209762.1521678; Wed, 21 Jan 2026 13:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viYAB-0004fG-9x; Wed, 21 Jan 2026 13:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1209762;
 Wed, 21 Jan 2026 13:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viYAA-0004f6-AG
 for xen-changelog@lists.xenproject.org; Wed, 21 Jan 2026 13:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viYAA-00EK3W-1x
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viYAA-00D9jI-0Y
 for xen-changelog@lists.xenproject.org;
 Wed, 21 Jan 2026 13:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WHIhY0RSUERGnmYtLFR+6Njp2SkyxRbTu7js1iZ5wTw=; b=oOuTcWHKKtqPI3K/nm+o0pSy6N
	DdEquDcKmP//il0E7HqM+caDkCYLmOml3RZZ8m/rmfw7SJBTDhgmK4p2dWnsyuUB8JxYpJHhwIxUo
	Ti6Si5QhmcP/hAPh0MynL3shdFBRmsEYWSQM+DYPir8pjPHMeuiAwHSQkWnCC0wzqkIo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: Disable ucode loading on AMD's analysis run
Message-Id: <E1viYAA-00D9jI-0Y@xenbits.xenproject.org>
Date: Wed, 21 Jan 2026 13:22:22 +0000

commit 61204ed24ba4537d6eff56594faa5d23cacb8310
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Jan 20 10:38:50 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 21 10:47:46 2026 +0000

    automation: Disable ucode loading on AMD's analysis run
    
    Explicitly set CONFIG_MICROCODE_LOADING=n
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/analyze.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index a472692fcb..b3395e2da7 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -93,6 +93,7 @@ eclair-x86_64-amd:
       CONFIG_DEBUG_LOCKS=n
       CONFIG_SCRUB_DEBUG=n
       CONFIG_XMEM_POOL_POISON=n
+      CONFIG_MICROCODE_LOADING=n
   rules:
     - if: $ECLAIR_SAFETY
       when: always
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 10:44:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 10:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210774.1522378 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAW-0007s0-0G; Thu, 22 Jan 2026 10:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210774.1522378; Thu, 22 Jan 2026 10:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAV-0007rs-Ty; Thu, 22 Jan 2026 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1210774;
 Thu, 22 Jan 2026 10:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1visAU-0007rm-7w
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 10:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAU-00FqNw-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAU-00ERlP-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GfW2Z/Qz01mJoxQGnSru7E9ENvZGTm1iCpmopitoytw=; b=bHbT2nDiI9JwpcvvQ+o/LA/eSn
	dHeQjB7z2kWsqvAQjjYV+o59nFVuJRafYaFO0BOUupScs3gUDqQGw5BjD/c5WHbMijCMd+/CwxFtv
	syR0Mznyneka6mCaFipfvEYMEYLBKjO5L7Mqj1QyVzktswRTmI7euvfdep8XajJCb9Vo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1visAU-00ERlP-0F@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 10:44:02 +0000

commit f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:10:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:10:10 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 28aca3417d..ebe2baf8b9 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -96,7 +96,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 10:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210776.1522382 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAf-0007te-1g; Thu, 22 Jan 2026 10:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210776.1522382; Thu, 22 Jan 2026 10:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAe-0007tW-VH; Thu, 22 Jan 2026 10:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1210776;
 Thu, 22 Jan 2026 10:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1visAe-0007tM-86
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 10:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAe-00FqO0-1n
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAe-00ERmp-0a
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xZzpJJlyDG40bGQyHp9sNcNmj9Mo75oIaxX66IXH1h8=; b=6J8wwRuyMgfCbpUAhMUeL856wY
	Os7ZkOojwJEWTI2Tt3vJWWRDG+X049lJm/g1+hqHwcFriNshEZVKOakaowZWzDnuFEfrNrDi397OW
	Y5gkAxPpqzxVNV9ANNPZyM2iE8bwD5sb38ZrXLRLIdIPICU1B3rr/lLT055yfCkVLD30=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: avoid indirect call to event handler
Message-Id: <E1visAe-00ERmp-0a@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 10:44:12 +0000

commit 93c8070e029dee61a83cb7408a155cf3ebe5c50c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:11:25 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:11:25 2026 +0100

    x86/HPET: avoid indirect call to event handler
    
    It's only ever handle_hpet_broadcast() that's used. While we now don't
    enable IRQs right away, still play safe and convert the function pointer
    to a boolean, to make sure no calls occur too early.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index a69abe2650..d94da24f42 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -40,7 +40,7 @@ struct hpet_event_channel
     s_time_t      next_event;
     cpumask_var_t cpumask;
     spinlock_t    lock;
-    void          (*event_handler)(struct hpet_event_channel *ch);
+    bool          event_handler;
 
     unsigned int idx;   /* physical channel idx */
     unsigned int cpu;   /* msi target */
@@ -194,7 +194,7 @@ static void evt_do_broadcast(cpumask_t *mask)
        cpumask_raise_softirq(mask, TIMER_SOFTIRQ);
 }
 
-static void cf_check handle_hpet_broadcast(struct hpet_event_channel *ch)
+static void handle_hpet_broadcast(struct hpet_event_channel *ch)
 {
     cpumask_t *scratch = this_cpu(hpet_scratch_cpumask);
     s_time_t now, next_event;
@@ -250,7 +250,7 @@ static void cf_check hpet_interrupt_handler(int irq, void *data)
         return;
     }
 
-    ch->event_handler(ch);
+    handle_hpet_broadcast(ch);
 }
 
 static void hpet_enable_channel(struct hpet_event_channel *ch)
@@ -657,7 +657,7 @@ void __init hpet_broadcast_init(void)
         hpet_events[i].next_event = STIME_MAX;
         spin_lock_init(&hpet_events[i].lock);
         smp_wmb();
-        hpet_events[i].event_handler = handle_hpet_broadcast;
+        hpet_events[i].event_handler = true;
 
         hpet_events[i].msi.msi_attrib.maskbit = 1;
         hpet_events[i].msi.msi_attrib.pos = MSI_TYPE_HPET;
@@ -814,7 +814,9 @@ int hpet_legacy_irq_tick(void)
          (hpet_events->flags & (HPET_EVT_DISABLE|HPET_EVT_LEGACY)) !=
          HPET_EVT_LEGACY )
         return 0;
-    hpet_events->event_handler(hpet_events);
+
+    handle_hpet_broadcast(hpet_events);
+
     return 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 10:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 10:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210777.1522386 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAp-0007wC-3N; Thu, 22 Jan 2026 10:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210777.1522386; Thu, 22 Jan 2026 10:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAp-0007w3-0M; Thu, 22 Jan 2026 10:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1210777;
 Thu, 22 Jan 2026 10:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1visAo-0007vv-B4
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 10:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAo-00FqO4-25
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAo-00ERoC-0t
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fZdHq4n3E8pJiE14PoBsDEkkKQ+6PLlmZKLBpnBfg1I=; b=U7bg71+vzDDYqW1nlHfMHpyURd
	adKdWMjtlVz7QJ36XWKpHbhhF3szxemU0SoxGCAoB0r2get/EPfDzHReAAhONNq9C5KuUHFHFs6Be
	ll/dypB215YpChQxnbdY/wZVKUVPlMouP8P1hfFlYKaA0LQDh73K0VRTMPjPWIzVyGMg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: make another channel flags update atomic
Message-Id: <E1visAo-00ERoC-0t@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 10:44:22 +0000

commit d4691d3aaa038020815a4962c3247eebd7ff65be
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:11:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:11:43 2026 +0100

    x86/HPET: make another channel flags update atomic
    
    Unlike the setting of HPET_EVT_LEGACY in hpet_broadcast_init(), the
    setting of HPET_EVT_DISABLE in hpet_disable_legacy_broadcast() isn't init-
    only and hence can race other flag manipulation (not all of which occur
    while holding the channel's lock). While possibly any such updates would
    only ever occur when HPET_EVT_LEGACY isn't set in the first place, this
    doesn't look straightforward to prove, so better be on the safe side.
    
    Fixes: d09486dba36a ("cpuidle: Enable hpet broadcast by default")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index d94da24f42..f34863e0df 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -729,7 +729,7 @@ void hpet_disable_legacy_broadcast(void)
 
     spin_lock_irqsave(&hpet_events->lock, flags);
 
-    hpet_events->flags |= HPET_EVT_DISABLE;
+    set_bit(HPET_EVT_DISABLE_BIT, &hpet_events->flags);
 
     /* disable HPET T0 */
     cfg = hpet_read32(HPET_Tn_CFG(0));
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 10:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 10:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210778.1522389 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAz-0007yJ-4F; Thu, 22 Jan 2026 10:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210778.1522389; Thu, 22 Jan 2026 10:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visAz-0007yB-1f; Thu, 22 Jan 2026 10:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1210778;
 Thu, 22 Jan 2026 10:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1visAy-0007y3-Dh
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 10:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAy-00FqOA-2N
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visAy-00ERqc-1A
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O1FYLcQ4qkUWcivGGhHP0SZwYc4LdSj/mwTBeB9AVKY=; b=NJpatP4rCpe+9+rc9/+Gql6PqA
	L+SoW97VtB8IAoOKbbQvP3XcVBGQA5+wcnlhKIiZi3D65SoORXALlww+6Fq7XTUscjkxb5VbjPg2C
	8WCnordpmhfasnDoT7VUF/bznVBRmEyZETy3QpLlFIw/3Dpfp1k4T/vmW0GbrnsB8608=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1visAy-00ERqc-1A@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 10:44:32 +0000

commit cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:13:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:13:14 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.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 e42fee009c..119337af5d 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -351,6 +351,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 10:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 10:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210779.1522394 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visB9-00080y-6u; Thu, 22 Jan 2026 10:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210779.1522394; Thu, 22 Jan 2026 10:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1visB9-00080q-4Q; Thu, 22 Jan 2026 10:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1210779;
 Thu, 22 Jan 2026 10:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1visB8-00080i-H8
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 10:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visB8-00FqOU-2e
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1visB8-00ERrk-1R
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 10:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AtoqXaUMrliW3onVNT8rQ45iH9UPACOpSvnREOS1hhk=; b=hURu0thBPH4RpL1KtBbLveVfNk
	cUu017wznqn+6D5tZMwgpkFK1tQ8LkOlHSCijqxhyhNvvlHW9l/WUak+wE11rTNwWSVNvcmhU35eA
	iy978Rs4YRqxxg+96LpIxf+jLxA5kSlqhqM9SxR71kS9fS6Yh1V9mlnJUXLCAy2/W4XU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] INSTALL: remove unsupported XEN_CONFIG_EXPERT from documentation
Message-Id: <E1visB8-00ERrk-1R@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 10:44:42 +0000

commit 1952fc21568324eccb1899aff4c9a9b19e7760a3
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 22 09:13:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:13:49 2026 +0100

    INSTALL: remove unsupported XEN_CONFIG_EXPERT from documentation
    
    Remove XEN_CONFIG_EXPERT explanation and also correct information in
    the entire "Xen Hypervisor" section.
    
    Link: 37339ba9ef46 ("automation: Remove XEN_CONFIG_EXPERT leftovers")
    Suggested-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 INSTALL | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/INSTALL b/INSTALL
index c2e756bf4b..fb9efe884f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -25,19 +25,12 @@ Xen Hypervisor
 Xen itself is configured via a `kconfig' system borrowed from Linux.
 See https://www.kernel.org/doc/html/v5.4/kbuild/.
 
-Note that unlike with Linux, and contrary to that document, you cannot
-look at Kconfig files, or the default or generated config files etc.,
-to find available configuration options.  This is because it is only
-supported (and security supported) by the Xen Project, to change a
-small subset of the options.  Attempts to change other options will be
-silently overridden.  The only way to find which configuration options
-are available is to run `make menuconfig' or the like.
-
-You can counter-override this behaviour by setting XEN_CONFIG_EXPERT=y
-in your environment.  However, doing this is not supported and the
-resulting configurations do not receive security support.  If you set
-this variable there is nothing stopping you setting dangerously
-experimental combinations of features - not even any warnings.
+Only a subset of options is supported or security-supported by Xen
+Project. You can explore all available options, including unsupported
+ones and those recommended only for expert users, e.g. by using `make
+menuconfig` and enabling `CONFIG_UNSUPPORTED` and/or `CONFIG_EXPERT`.
+However, enabling these options is not supported, and configurations
+resulting from them do not receive security support.
 
 Options recognized by configure
 ===============================
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 11:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 11:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210873.1522459 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vitHD-0002op-FV; Thu, 22 Jan 2026 11:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210873.1522459; Thu, 22 Jan 2026 11:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vitHD-0002oh-CO; Thu, 22 Jan 2026 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1210873;
 Thu, 22 Jan 2026 11: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 1vitHC-0002ob-4z
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 11: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 1vitHC-00Frgl-1J
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vitHC-00EVQa-06
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11: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=YNoZAn5DS/R+liuzb1N6Lnw9S91QUh+mrNty/HPfvdI=; b=WV9sXKzhuW3Qwnexa+2fLS7O3l
	U0OTDJpDgk+UCtf5U76qRjRgJAA26APVFTp3cxI0jKWfIVuYsnfDCVyJfLv/pIJz3BJ88ZreMydeW
	ahemDBHkFKV3PLvUr29hghJE7aR3F1QbQToiK3QJ/Xi9aSwj1CMv7ro6MleHC4i3l3dw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1vitHC-00EVQa-06@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 11:55:02 +0000

commit f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:10:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:10:10 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 28aca3417d..ebe2baf8b9 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -96,7 +96,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 11:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 11:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210874.1522462 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vitHN-0002qa-GS; Thu, 22 Jan 2026 11:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210874.1522462; Thu, 22 Jan 2026 11:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vitHN-0002qS-Dk; Thu, 22 Jan 2026 11:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1210874;
 Thu, 22 Jan 2026 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 1vitHM-0002qM-8Z
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1vitHM-00Frio-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vitHM-00EVR3-0P
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=vKCeEjIi/EnBLs6WNudpBkpRTzRK328A4vZvWyEAYdg=; b=Azjj9tr3IF0AOWrmww3xa+IfmK
	h79/77RWdiMVuecfRL+FhYhd3RUyyBWpIIU1B1lWVRySp5FMbDtx+TL4eCsMM9QNzZVa4KdzRe5TU
	qUbPlJSGLYkFXw1z7Zyp2LsTw1LHyRWU1NOaQ/TEe6LNdNtDvmSAl8dgyKns8LHn7Oeg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: avoid indirect call to event handler
Message-Id: <E1vitHM-00EVR3-0P@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 11:55:12 +0000

commit 93c8070e029dee61a83cb7408a155cf3ebe5c50c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:11:25 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:11:25 2026 +0100

    x86/HPET: avoid indirect call to event handler
    
    It's only ever handle_hpet_broadcast() that's used. While we now don't
    enable IRQs right away, still play safe and convert the function pointer
    to a boolean, to make sure no calls occur too early.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index a69abe2650..d94da24f42 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -40,7 +40,7 @@ struct hpet_event_channel
     s_time_t      next_event;
     cpumask_var_t cpumask;
     spinlock_t    lock;
-    void          (*event_handler)(struct hpet_event_channel *ch);
+    bool          event_handler;
 
     unsigned int idx;   /* physical channel idx */
     unsigned int cpu;   /* msi target */
@@ -194,7 +194,7 @@ static void evt_do_broadcast(cpumask_t *mask)
        cpumask_raise_softirq(mask, TIMER_SOFTIRQ);
 }
 
-static void cf_check handle_hpet_broadcast(struct hpet_event_channel *ch)
+static void handle_hpet_broadcast(struct hpet_event_channel *ch)
 {
     cpumask_t *scratch = this_cpu(hpet_scratch_cpumask);
     s_time_t now, next_event;
@@ -250,7 +250,7 @@ static void cf_check hpet_interrupt_handler(int irq, void *data)
         return;
     }
 
-    ch->event_handler(ch);
+    handle_hpet_broadcast(ch);
 }
 
 static void hpet_enable_channel(struct hpet_event_channel *ch)
@@ -657,7 +657,7 @@ void __init hpet_broadcast_init(void)
         hpet_events[i].next_event = STIME_MAX;
         spin_lock_init(&hpet_events[i].lock);
         smp_wmb();
-        hpet_events[i].event_handler = handle_hpet_broadcast;
+        hpet_events[i].event_handler = true;
 
         hpet_events[i].msi.msi_attrib.maskbit = 1;
         hpet_events[i].msi.msi_attrib.pos = MSI_TYPE_HPET;
@@ -814,7 +814,9 @@ int hpet_legacy_irq_tick(void)
          (hpet_events->flags & (HPET_EVT_DISABLE|HPET_EVT_LEGACY)) !=
          HPET_EVT_LEGACY )
         return 0;
-    hpet_events->event_handler(hpet_events);
+
+    handle_hpet_broadcast(hpet_events);
+
     return 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 11:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 11:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210875.1522466 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vitHX-0002si-Hn; Thu, 22 Jan 2026 11:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210875.1522466; Thu, 22 Jan 2026 11: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 1vitHX-0002sa-FB; Thu, 22 Jan 2026 11:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1210875;
 Thu, 22 Jan 2026 11: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 1vitHW-0002sQ-BB
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 11: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 1vitHW-00Fris-26
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vitHW-00EVRZ-0u
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11: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=iy5hT08YDSqTa4vqqnzzTKb48ENve1aKvxCBMQ6qcz4=; b=awEejfIh8OWASnx4I0o8UFfgKS
	VXNEk00esDQARFvw4eYzUq9kD+QlpHXCOlXWFBhLd97zsAiBaZ5znZRFA0bAzS+qF0fV8jPcDj77i
	BDYnHJpG2W0fxWJeoA6OO1offeJpJLidNiQrrW+xMr9g6ow5IapoyMgMIYE/W1TNrsHY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: make another channel flags update atomic
Message-Id: <E1vitHW-00EVRZ-0u@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 11:55:22 +0000

commit d4691d3aaa038020815a4962c3247eebd7ff65be
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:11:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:11:43 2026 +0100

    x86/HPET: make another channel flags update atomic
    
    Unlike the setting of HPET_EVT_LEGACY in hpet_broadcast_init(), the
    setting of HPET_EVT_DISABLE in hpet_disable_legacy_broadcast() isn't init-
    only and hence can race other flag manipulation (not all of which occur
    while holding the channel's lock). While possibly any such updates would
    only ever occur when HPET_EVT_LEGACY isn't set in the first place, this
    doesn't look straightforward to prove, so better be on the safe side.
    
    Fixes: d09486dba36a ("cpuidle: Enable hpet broadcast by default")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index d94da24f42..f34863e0df 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -729,7 +729,7 @@ void hpet_disable_legacy_broadcast(void)
 
     spin_lock_irqsave(&hpet_events->lock, flags);
 
-    hpet_events->flags |= HPET_EVT_DISABLE;
+    set_bit(HPET_EVT_DISABLE_BIT, &hpet_events->flags);
 
     /* disable HPET T0 */
     cfg = hpet_read32(HPET_Tn_CFG(0));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 11:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 11:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210876.1522470 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vitHh-0002v3-J3; Thu, 22 Jan 2026 11:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210876.1522470; Thu, 22 Jan 2026 11: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 1vitHh-0002uv-GS; Thu, 22 Jan 2026 11:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1210876;
 Thu, 22 Jan 2026 11: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 1vitHg-0002un-GD
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 11: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 1vitHg-00Frj0-2Q
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vitHg-00EVRy-1B
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11: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=wyVVfoBHxLJkNiaShtg51MphD5UUlKkF+kXKo0zVfQ8=; b=atmsDNp6wWxXXPtLVdQVuLgnfl
	uP9q6FgYb9GRCjmTyzi4g+54UA6p0HH/azNE6K7iWEUDxnSYwttxW6G3NgGt3CcldNQs4GBvtZ5sp
	wP7JD/FGvgTB2RT76M3GM/IBmc9yKgNrERD3/Y/Dufd7A0Myy8N9s0q0b3m+EPTCdt2E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1vitHg-00EVRy-1B@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 11:55:32 +0000

commit cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 09:13:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:13:14 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.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 e42fee009c..119337af5d 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -351,6 +351,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 11:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 11:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1210877.1522474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vitHr-0002x6-KV; Thu, 22 Jan 2026 11:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1210877.1522474; Thu, 22 Jan 2026 11: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 1vitHr-0002wy-Hn; Thu, 22 Jan 2026 11:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1210877;
 Thu, 22 Jan 2026 11: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 1vitHq-0002wp-JR
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 11: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 1vitHq-00FrjO-2v
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vitHq-00EVSe-1W
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 11:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ROsUlI5bApMf90VKWTZrQ56c3OBsFjWMaJp5sOVCJGw=; b=YSgJidQb4D/Q7iqagex+AYk0qd
	8l5hC2SMZSA6FbCTlcr+IJkpwrEsPelrfM/KzuoVQyoyfoynXyJmft9HmJt7SjzlGdePbBllfilVd
	O3Q+OdNPvrCk02RXlNGxl7Gqd4M//C8Htdd56tJI5Vt5bx1WIqV4M4y8Iintl86lsh6A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] INSTALL: remove unsupported XEN_CONFIG_EXPERT from documentation
Message-Id: <E1vitHq-00EVSe-1W@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 11:55:42 +0000

commit 1952fc21568324eccb1899aff4c9a9b19e7760a3
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 22 09:13:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 09:13:49 2026 +0100

    INSTALL: remove unsupported XEN_CONFIG_EXPERT from documentation
    
    Remove XEN_CONFIG_EXPERT explanation and also correct information in
    the entire "Xen Hypervisor" section.
    
    Link: 37339ba9ef46 ("automation: Remove XEN_CONFIG_EXPERT leftovers")
    Suggested-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 INSTALL | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/INSTALL b/INSTALL
index c2e756bf4b..fb9efe884f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -25,19 +25,12 @@ Xen Hypervisor
 Xen itself is configured via a `kconfig' system borrowed from Linux.
 See https://www.kernel.org/doc/html/v5.4/kbuild/.
 
-Note that unlike with Linux, and contrary to that document, you cannot
-look at Kconfig files, or the default or generated config files etc.,
-to find available configuration options.  This is because it is only
-supported (and security supported) by the Xen Project, to change a
-small subset of the options.  Attempts to change other options will be
-silently overridden.  The only way to find which configuration options
-are available is to run `make menuconfig' or the like.
-
-You can counter-override this behaviour by setting XEN_CONFIG_EXPERT=y
-in your environment.  However, doing this is not supported and the
-resulting configurations do not receive security support.  If you set
-this variable there is nothing stopping you setting dangerously
-experimental combinations of features - not even any warnings.
+Only a subset of options is supported or security-supported by Xen
+Project. You can explore all available options, including unsupported
+ones and those recommended only for expert users, e.g. by using `make
+menuconfig` and enabling `CONFIG_UNSUPPORTED` and/or `CONFIG_EXPERT`.
+However, enabling these options is not supported, and configurations
+resulting from them do not receive security support.
 
 Options recognized by configure
 ===============================
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 14:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 14:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211198.1522717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vivk6-0001jA-Mi; Thu, 22 Jan 2026 14:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211198.1522717; Thu, 22 Jan 2026 14: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 1vivk6-0001j2-KD; Thu, 22 Jan 2026 14:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1211198;
 Thu, 22 Jan 2026 14: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 1vivk5-0001iw-Nf
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 14: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 1vivk5-00Fuft-3D
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 14:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vivk5-00EdLM-1l
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 14: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=8tZe3Z02rmb5x3lZLkDw1HoVcWm14BZWDGXC83dthPA=; b=EXWpZa9kRGpy06aqNR2J+Yewhp
	kW/p5SzI9ILL3TVnUsy7MolwarD78KexC4Zkg+1QrFqc2KbgmNupzAVZYSAEw/aTdXOdA2/N8mXHE
	r+hZMm1aD95v/zDocg1aS5oq3ugm6kkdTSV+f4eHTz4P/82IOwA/r/HHdBcEWVDfM9PA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Adjust VMCB comments
Message-Id: <E1vivk5-00EdLM-1l@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 14:33:01 +0000

commit 6382bda1ea4fc161352518826bdb28d0aef6b19c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 21 17:38:31 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 13:05:39 2026 +0000

    x86/svm: Adjust VMCB comments
    
    The Intercept comments provide no value whatsoever.  For the VMCB, label the
    Control area and State Save area, which are the names given by the APM.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/vmcb.c | 4 ++++
 xen/arch/x86/hvm/svm/vmcb.h | 8 ++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index cbee10d046..72173c8fdd 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -430,9 +430,13 @@ static void __init __maybe_unused build_assertions(void)
 
     /* Build-time check of the VMCB layout. */
     BUILD_BUG_ON(sizeof(vmcb) != PAGE_SIZE);
+
+    /* Control area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), _pause_filter_thresh) != 0x03c);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _vintr)               != 0x060);
     BUILD_BUG_ON(offsetof(typeof(vmcb), event_inj)            != 0x0a8);
+
+    /* State Save area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), es)                   != 0x400);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _cpl)                 != 0x4cb);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _cr4)                 != 0x548);
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index ba554a9644..c64386e7ef 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -8,7 +8,6 @@
 
 struct vcpu;
 
-/* general 1 intercepts */
 enum GenericIntercept1bits
 {
     GENERAL1_INTERCEPT_INTR          = 1 << 0,
@@ -45,7 +44,6 @@ enum GenericIntercept1bits
     GENERAL1_INTERCEPT_SHUTDOWN_EVT  = 1u << 31
 };
 
-/* general 2 intercepts */
 enum GenericIntercept2bits
 {
     GENERAL2_INTERCEPT_VMRUN   = 1 << 0,
@@ -65,8 +63,6 @@ enum GenericIntercept2bits
     GENERAL2_INTERCEPT_RDPRU   = 1 << 14,
 };
 
-
-/* control register intercepts */
 enum CRInterceptBits
 {
     CR_INTERCEPT_CR0_READ   = 1 << 0,
@@ -103,8 +99,6 @@ enum CRInterceptBits
     CR_INTERCEPT_CR15_WRITE = 1u << 31,
 };
 
-
-/* debug register intercepts */
 enum DRInterceptBits
 {
     DR_INTERCEPT_DR0_READ   = 1 << 0,
@@ -400,6 +394,7 @@ typedef union
 #define MSRPM_SIZE  (8  * 1024)
 
 struct vmcb_struct {
+    /* Control area */
     u32 _cr_intercepts;         /* offset 0x00 - cleanbit 0 */
     u32 _dr_intercepts;         /* offset 0x04 - cleanbit 0 */
     u32 _exception_intercepts;  /* offset 0x08 - cleanbit 0 */
@@ -491,6 +486,7 @@ struct vmcb_struct {
     u8  guest_ins[15];          /* offset 0xD1 */
     u64 res10a[100];            /* offset 0xE0 pad to save area */
 
+    /* State Save area */
     union {
         struct segment_register sreg[6];
         struct {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 14:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 14:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211199.1522722 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vivkG-0001kt-OD; Thu, 22 Jan 2026 14:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211199.1522722; Thu, 22 Jan 2026 14: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 1vivkG-0001kl-Le; Thu, 22 Jan 2026 14:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1211199;
 Thu, 22 Jan 2026 14: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 1vivkF-0001ka-PM
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 14: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 1vivkG-00Fug2-0H
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 14:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vivkF-00EdNh-2J
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 14: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=kTvcN+ztmojK3nESRDUKRIdDqaA6XK/8cceBB8x32/Q=; b=YuR4wOeIp+g24RdN+Yx1e0OxFH
	u+KDcPYsyFp+5Xg7Tnj6PqfyQ3QVMdtRxOoyzVdawp0434jSiCDodmmPJR+krzc5b9CoYLAeIGMjZ
	d+T0KwwX5L//EhFk+fVqbqZNFlHjg9fpMVYivV2GOJ9fDZZLA+M3r9847/neF73ZLQuY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Add infrastructure for Bus Lock Threshold
Message-Id: <E1vivkF-00EdNh-2J@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 14:33:11 +0000

commit 06d2514278ac725f840482e7b42c9e529c99cd10
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Wed Jan 21 15:28:53 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 13:05:39 2026 +0000

    x86/svm: Add infrastructure for Bus Lock Threshold
    
    Add missing scaffolding to enable BusLock Threshold. That is:
    
      * Add General Intercepts 3
      * Add missing VMEXIT
      * Adjust NPF perf counter base to immediately after the buslock counter
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/vmcb.c           |  1 +
 xen/arch/x86/hvm/svm/vmcb.h           | 15 +++++++++++++--
 xen/arch/x86/include/asm/hvm/svm.h    |  2 ++
 xen/arch/x86/include/asm/perfc_defn.h |  2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 72173c8fdd..8734fd2bca 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -435,6 +435,7 @@ static void __init __maybe_unused build_assertions(void)
     BUILD_BUG_ON(offsetof(typeof(vmcb), _pause_filter_thresh) != 0x03c);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _vintr)               != 0x060);
     BUILD_BUG_ON(offsetof(typeof(vmcb), event_inj)            != 0x0a8);
+    BUILD_BUG_ON(offsetof(typeof(vmcb), bus_lock_count)       != 0x120);
 
     /* State Save area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), es)                   != 0x400);
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index c64386e7ef..69f6047394 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -63,6 +63,11 @@ enum GenericIntercept2bits
     GENERAL2_INTERCEPT_RDPRU   = 1 << 14,
 };
 
+enum GenericIntercept3bits
+{
+    GENERAL3_INTERCEPT_BUS_LOCK = 1 << 5,
+};
+
 enum CRInterceptBits
 {
     CR_INTERCEPT_CR0_READ   = 1 << 0,
@@ -283,6 +288,7 @@ enum VMEXIT_EXITCODE
     VMEXIT_MWAIT_CONDITIONAL= 140, /* 0x8c */
     VMEXIT_XSETBV           = 141, /* 0x8d */
     VMEXIT_RDPRU            = 142, /* 0x8e */
+    VMEXIT_BUS_LOCK         = 165, /* 0xa5 */
     /* Remember to also update VMEXIT_NPF_PERFC! */
     VMEXIT_NPF              = 1024, /* 0x400, nested paging fault */
     /* Remember to also update SVM_PERF_EXIT_REASON_SIZE! */
@@ -400,7 +406,8 @@ struct vmcb_struct {
     u32 _exception_intercepts;  /* offset 0x08 - cleanbit 0 */
     u32 _general1_intercepts;   /* offset 0x0C - cleanbit 0 */
     u32 _general2_intercepts;   /* offset 0x10 - cleanbit 0 */
-    u32 res01[10];
+    u32 _general3_intercepts;   /* offset 0x14 - cleanbit 0 */
+    u32 res01[9];
     u16 _pause_filter_thresh;   /* offset 0x3C - cleanbit 0 */
     u16 _pause_filter_count;    /* offset 0x3E - cleanbit 0 */
     u64 _iopm_base_pa;          /* offset 0x40 - cleanbit 1 */
@@ -484,7 +491,10 @@ struct vmcb_struct {
     u64 nextrip;                /* offset 0xC8 */
     u8  guest_ins_len;          /* offset 0xD0 */
     u8  guest_ins[15];          /* offset 0xD1 */
-    u64 res10a[100];            /* offset 0xE0 pad to save area */
+    u64 res10a[8];              /* offset 0xE0 */
+    u16 bus_lock_count;         /* offset 0x120 */
+    u16 res10b[3];              /* offset 0x122 */
+    u64 res10c[91];             /* offset 0x128 pad to save area */
 
     /* State Save area */
     union {
@@ -579,6 +589,7 @@ VMCB_ACCESSORS(dr_intercepts, intercepts)
 VMCB_ACCESSORS(exception_intercepts, intercepts)
 VMCB_ACCESSORS(general1_intercepts, intercepts)
 VMCB_ACCESSORS(general2_intercepts, intercepts)
+VMCB_ACCESSORS(general3_intercepts, intercepts)
 VMCB_ACCESSORS(pause_filter_count, intercepts)
 VMCB_ACCESSORS(pause_filter_thresh, intercepts)
 VMCB_ACCESSORS(tsc_offset, intercepts)
diff --git a/xen/arch/x86/include/asm/hvm/svm.h b/xen/arch/x86/include/asm/hvm/svm.h
index a6d7e4aed3..15f0268be7 100644
--- a/xen/arch/x86/include/asm/hvm/svm.h
+++ b/xen/arch/x86/include/asm/hvm/svm.h
@@ -37,6 +37,7 @@ extern u32 svm_feature_flags;
 #define SVM_FEATURE_VGIF          16 /* Virtual GIF */
 #define SVM_FEATURE_SSS           19 /* NPT Supervisor Shadow Stacks */
 #define SVM_FEATURE_SPEC_CTRL     20 /* MSR_SPEC_CTRL virtualisation */
+#define SVM_FEATURE_BUS_LOCK      29 /* Bus Lock Threshold */
 
 static inline bool cpu_has_svm_feature(unsigned int feat)
 {
@@ -56,6 +57,7 @@ static inline bool cpu_has_svm_feature(unsigned int feat)
 #define cpu_has_svm_vloadsave cpu_has_svm_feature(SVM_FEATURE_VLOADSAVE)
 #define cpu_has_svm_sss       cpu_has_svm_feature(SVM_FEATURE_SSS)
 #define cpu_has_svm_spec_ctrl cpu_has_svm_feature(SVM_FEATURE_SPEC_CTRL)
+#define cpu_has_svm_bus_lock  cpu_has_svm_feature(SVM_FEATURE_BUS_LOCK)
 
 #define MSR_INTERCEPT_NONE    0
 #define MSR_INTERCEPT_READ    1
diff --git a/xen/arch/x86/include/asm/perfc_defn.h b/xen/arch/x86/include/asm/perfc_defn.h
index d6127cb91e..ac7439b992 100644
--- a/xen/arch/x86/include/asm/perfc_defn.h
+++ b/xen/arch/x86/include/asm/perfc_defn.h
@@ -7,7 +7,7 @@ PERFCOUNTER_ARRAY(exceptions,           "exceptions", 32)
 #ifdef CONFIG_HVM
 
 #define VMX_PERF_EXIT_REASON_SIZE 76
-#define VMEXIT_NPF_PERFC 143
+#define VMEXIT_NPF_PERFC 166
 #define SVM_PERF_EXIT_REASON_SIZE (VMEXIT_NPF_PERFC + 1)
 PERFCOUNTER_ARRAY(vmexits,              "vmexits",
                   MAX(VMX_PERF_EXIT_REASON_SIZE, SVM_PERF_EXIT_REASON_SIZE))
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 14:33:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 14:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211200.1522726 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vivkQ-0001nQ-QC; Thu, 22 Jan 2026 14:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211200.1522726; Thu, 22 Jan 2026 14: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 1vivkQ-0001nI-ND; Thu, 22 Jan 2026 14:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1211200;
 Thu, 22 Jan 2026 14:33:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vivkP-0001nA-SG
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 14: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 1vivkQ-00Fug6-0a
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 14:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vivkP-00EdPh-2c
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 14: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=B7hrnBuziCl93UTbpvYym5vc8znyol6Fmk48eXttYfM=; b=fnTfrnopU2r0PceooPBqNlYIGD
	l7rJPPMF8jhlJn/y4+wFolBYQw3aONXX520HZy5JdHFeAsL0l5gMBQOTH88veCRcsY13R1oZ4G2+s
	YYiRHzYPlDAbDxrQy359iEI7tqsH5GSsLZOK1TjpIAFb6iPpDhi8oV1GhtlDZkrAQ1/I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Intercept Bus Locks for HVM guests
Message-Id: <E1vivkP-00EdPh-2c@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 14:33:21 +0000

commit dd5b8336f5867831f71f4ae9069205a914801432
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Wed Jan 21 15:28:54 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 13:05:39 2026 +0000

    x86/svm: Intercept Bus Locks for HVM guests
    
    Configure the Bus Lock intercept when supported by hardware (Zen5 and
    later). The VMCB counter is initialised to zero so it fires upon the first
    instruction that locks the bus. On the #VMEXIT handler that counter is set to
    1 because it has fault behaviour and the offending instruction needs to
    re-execute.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 CHANGELOG.md                |  4 ++++
 xen/arch/x86/hvm/svm/svm.c  | 11 +++++++++++
 xen/arch/x86/hvm/svm/vmcb.c |  7 +++++++
 3 files changed, 22 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53d92a2597..18f3d10f20 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Changed
 
 ### Added
+ - On x86:
+   - Support for Bus Lock Threshold on AMD Zen5 and later CPUs, used by Xen to
+     mitigate (by rate-limiting) the system wide impact of an HVM guest
+     misusing atomic instructions.
 
 ### Removed
  - On x86:
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 5d23603fc1..18ba837738 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2524,6 +2524,7 @@ const struct hvm_function_table * __init start_svm(void)
     P(cpu_has_tsc_ratio, "TSC Rate MSR");
     P(cpu_has_svm_sss, "NPT Supervisor Shadow Stack");
     P(cpu_has_svm_spec_ctrl, "MSR_SPEC_CTRL virtualisation");
+    P(cpu_has_svm_bus_lock, "Bus Lock Filter");
 #undef P
 
     if ( !printed )
@@ -3087,6 +3088,16 @@ void asmlinkage svm_vmexit_handler(void)
         break;
     }
 
+    case VMEXIT_BUS_LOCK:
+        /*
+         * This is a fault and blocked the Bus Lock inducing action.  We're
+         * only interested in rate limiting the guest, so credit it one "lock"
+         * in order to re-execute the instruction.
+         */
+        perfc_incr(buslock);
+        vmcb->bus_lock_count = 1;
+        break;
+
     default:
     unexpected_exit_type:
         gprintk(XENLOG_ERR, "Unexpected vmexit: reason %#"PRIx64", "
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 8734fd2bca..e583ef8548 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -66,6 +66,13 @@ static int construct_vmcb(struct vcpu *v)
         GENERAL2_INTERCEPT_XSETBV      | GENERAL2_INTERCEPT_ICEBP       |
         GENERAL2_INTERCEPT_RDPRU;
 
+    /*
+     * Well behaved logic shouldn't ever Bus Lock, but we care about rate
+     * limiting buggy/malicious cases.
+     */
+    if ( cpu_has_svm_bus_lock )
+        vmcb->_general3_intercepts |= GENERAL3_INTERCEPT_BUS_LOCK;
+
     /* Intercept all debug-register writes. */
     vmcb->_dr_intercepts = ~0u;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211226.1522740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwKt-0007oX-H3; Thu, 22 Jan 2026 15:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211226.1522740; Thu, 22 Jan 2026 15:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwKt-0007oP-EU; Thu, 22 Jan 2026 15:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1211226;
 Thu, 22 Jan 2026 15:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viwKs-0007oJ-6B
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 15:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwKs-00FvLC-1P
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwKs-00EfiV-0C
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oTIFZJjnP7274V1hEZgxsnjhaOwlbXK/qyKuJVusdmQ=; b=YZ7tNeer7J+6apDZvDHd0bN4pi
	A6xTqdXduNZbMHZTbYpGZVBjRd9PwnB3muEoy6cygMClW1/QOgdim0ZnwdQwYWIkHEN4U6L4VVjUW
	7hYOsirTJgIU4RCwH5uLRxfjHnJuQkdjbAiFjYqObNYQhan6IPGrkeei+8q2+Qwat/fY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: move legacy tick IRQ count adjustment
Message-Id: <E1viwKs-00EfiV-0C@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:11:02 +0000

commit bb34713d9a8916963561e6358843a9602c74ab1d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:11:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: move legacy tick IRQ count adjustment
    
    If already we play with the IRQ count, we should do so only if we actually
    "consume" the interrupt; normal timer IRQs should not have any adjustment
    done.
    
    Fixes: 353533232730 ("cpuidle: fix the menu governor to enhance IO performance")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index f34863e0df..a096547fe8 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -808,13 +808,13 @@ int hpet_broadcast_is_available(void)
 
 int hpet_legacy_irq_tick(void)
 {
-    this_cpu(irq_count)--;
-
     if ( !hpet_events ||
          (hpet_events->flags & (HPET_EVT_DISABLE|HPET_EVT_LEGACY)) !=
          HPET_EVT_LEGACY )
         return 0;
 
+    this_cpu(irq_count)--;
+
     handle_hpet_broadcast(hpet_events);
 
     return 1;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211227.1522744 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwL3-0007q7-Ia; Thu, 22 Jan 2026 15:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211227.1522744; Thu, 22 Jan 2026 15:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwL3-0007pw-Fo; Thu, 22 Jan 2026 15:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1211227;
 Thu, 22 Jan 2026 15:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viwL2-0007pp-70
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 15:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwL2-00FvLM-1h
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwL2-00EfjJ-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=933T/5D1Y+ibLSLObmhFDHGShR4d9fqt2IT+7VKb3Bs=; b=5GF2ZKGKaSfR5s0++RtCAh6weF
	qbiNH+Q1pogmRtiume5I5pR9w3C9qwAgZdlCGlf6Bt/6vEgYxGHazq1keljZEXN9sL3R3rWYCeus8
	m+siNsNUZvuOVkbxZ9xa5s89TLhE0C5q4PP55B53FNY//zSi0vdZav7Jj3n29JtKeNEM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: reduce hpet_next_event() call sites
Message-Id: <E1viwL2-00EfjJ-0U@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:11:12 +0000

commit 8da2d4ec14288f4a518244a7a74a43bf5f66a8dd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:11:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: reduce hpet_next_event() call sites
    
    I'm surprised gcc doesn't manage to do that: At least in debug builds two
    call sites exist, just like source code has it. That's not necessary
    though - by using do/while we can reduce this to a single call site. Then
    the function will be inlined.
    
    While improving code gen, also switch the function's 2nd parameter to
    unsigned.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index a096547fe8..44915d9ecb 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -124,7 +124,7 @@ static inline unsigned long ns2ticks(unsigned long nsec, int shift,
     return (unsigned long) tmp;
 }
 
-static int hpet_next_event(unsigned long delta, int timer)
+static int hpet_next_event(unsigned long delta, unsigned int timer)
 {
     uint32_t cnt, cmp;
     unsigned long flags;
@@ -173,12 +173,10 @@ static int reprogram_hpet_evt_channel(
     delta = max_t(int64_t, delta, MIN_DELTA_NS);
     delta = ns2ticks(delta, ch->shift, ch->mult);
 
-    ret = hpet_next_event(delta, ch->idx);
-    while ( ret && force )
-    {
-        delta += delta;
+    do {
         ret = hpet_next_event(delta, ch->idx);
-    }
+        delta += delta;
+    } while ( ret && force );
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211228.1522748 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwLD-0007sN-Jl; Thu, 22 Jan 2026 15:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211228.1522748; Thu, 22 Jan 2026 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 1viwLD-0007sD-H7; Thu, 22 Jan 2026 15:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1211228;
 Thu, 22 Jan 2026 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 1viwLC-0007rx-CC
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1viwLC-00FvLS-2A
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwLC-00Efkm-0m
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=68R7qrPJpTHj5nJnJmptGb2o2Fn7DI96H1dWZNRzDVs=; b=Antfmls+1jDV5F2lLe6iW5vZj7
	UwiuRWd53rNLKRvxCFar9TZVIo6TwMsQzAnzqtOZzxwBE/9ZMLJHig2PtAZflPvq5eXa8HOjteHvc
	kAN4G13pzrXpO7rBxOHzTUtPGrNefmUjrMskWaVv/CpNpwikw0psyR4Dm5ZhohaUScoo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: drop "long timeout" handling from reprogram_hpet_evt_channel()
Message-Id: <E1viwLC-00Efkm-0m@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:11:22 +0000

commit ae8a5165d644eae9209672d035d80086e05ad443
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:12:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: drop "long timeout" handling from reprogram_hpet_evt_channel()
    
    Neither caller passes STIME_MAX, so (bogusly) handling the case isn't
    necessary.
    
    "Bogusly" because with 32-bit counters, writing 0 means on average half
    the wrapping period until an interrupt would be raised, while of course
    in extreme cases an interrupt would be raised almost right away.
    
    Leave an assertion.
    
    Amends: aa42fc0e9cd9 ("cpuidle: remove hpet access in hpet_broadcast_exit")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 44915d9ecb..368c6eb4a0 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -162,12 +162,7 @@ static int reprogram_hpet_evt_channel(
 
     ch->next_event = expire;
 
-    if ( expire == STIME_MAX )
-    {
-        /* We assume it will take a long time for the timer to wrap. */
-        hpet_write32(0, HPET_Tn_CMP(ch->idx));
-        return 0;
-    }
+    ASSERT(expire != STIME_MAX);
 
     delta = min_t(int64_t, delta, MAX_DELTA_NS);
     delta = max_t(int64_t, delta, MIN_DELTA_NS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211229.1522752 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwLO-0007um-Lh; Thu, 22 Jan 2026 15:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211229.1522752; Thu, 22 Jan 2026 15: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 1viwLO-0007ue-Ig; Thu, 22 Jan 2026 15:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1211229;
 Thu, 22 Jan 2026 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 1viwLM-0007uL-FN
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1viwLM-00FvLX-2W
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwLM-00EflE-1F
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=NhgUm2xdxSFiIpaUKP0R33HExM/zLTWJAzOOwbFPj94=; b=u+3f0iJod+bCFnBnL29S8CupMx
	wQ+ScHGuCeiAJNh0QYfO9TXCup86SfhTYGMrHsQ0pFf1hX0ehg7a/4X6/X0C8UDei7v+0IqZEVx6+
	2vvpnaxQkmbMAx6zG14doRkaYq8JK4d6UR+ekUfY+Aklcx06qn8e2J1BVZ6TkZ8YC6gk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: simplify "expire" check a little in reprogram_hpet_evt_channel()
Message-Id: <E1viwLM-00EflE-1F@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:11:32 +0000

commit 712416dc443315da604d69f6d36b28c6744578f0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:12:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: simplify "expire" check a little in reprogram_hpet_evt_channel()
    
    When this was added, the log message was updated correctly, but the zero
    case was needlessly checked separately: hpet_broadcast_enter() had a zero
    check added at the same time, while handle_hpet_broadcast() can't possibly
    pass 0 here anyway.
    
    Also turn the printk() there into an assertion: NOW() should only ever
    return valid (positive) values.
    
    Fixes: 7145897cfb81 ("cpuidle: Fix for timer_deadline==0 case")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 368c6eb4a0..65253a3f6c 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -147,12 +147,12 @@ static int reprogram_hpet_evt_channel(
     int64_t delta;
     int ret;
 
-    if ( (ch->flags & HPET_EVT_DISABLE) || (expire == 0) )
+    if ( ch->flags & HPET_EVT_DISABLE )
         return 0;
 
-    if ( unlikely(expire < 0) )
+    if ( unlikely(expire <= 0) )
     {
-        printk(KERN_DEBUG "reprogram: expire <= 0\n");
+        ASSERT_UNREACHABLE();
         return -ETIME;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211230.1522755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwLX-0007xM-O0; Thu, 22 Jan 2026 15:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211230.1522755; Thu, 22 Jan 2026 15: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 1viwLX-0007xE-LS; Thu, 22 Jan 2026 15:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1211230;
 Thu, 22 Jan 2026 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 1viwLW-0007x6-IQ
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1viwLW-00FvLh-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwLW-00Efmb-1c
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=MrMr+6YkEBgfQmUP8eP0D7x5wpIhPLuUedBQZILEtvY=; b=wJXVSY+rFTt1ra7aAg+m31ZUxj
	D/PZxHEFlczfSUrtpY8eadP+nvrvgHLX+QS7g2wNhyWTvCh8R+8rv/0thJcHDq7VP0v1Vx/b9famU
	FvE3XJSnuJjRYNRYrjnz/KASQWLnIm+UIw5G563N1JC1SVAqeK1wN4wLYg7nYW2h9+Tc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: drop .set_affinity hook
Message-Id: <E1viwLW-00Efmb-1c@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:11:42 +0000

commit 5ec93b2f19ff8873fca65d38c1164b0a56d3898b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:13:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: drop .set_affinity hook
    
    No IRQ balancing is supposed to be happening on the broadcast IRQs. The
    only entity responsible for fiddling with the CPU affinities is
    set_channel_irq_affinity(). They shouldn't even be fiddled with when
    offlining a CPU: A CPU going down can't at the same time be idle. Some
    properties (->arch.cpu_mask in particular) may transiently reference an
    offline CPU, but that'll be adjusted as soon as a channel goes into active
    use again.
    
    Along with adjusting fixup_irqs() (in a more general way, i.e. covering all
    vectors which are marked in use globally), also adjust section placement of
    used_vectors.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 17 -----------------
 xen/arch/x86/irq.c  | 12 ++++++++----
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 65253a3f6c..722a69ab13 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -296,22 +296,6 @@ static int hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 
 #define hpet_msi_shutdown hpet_msi_mask
 
-static void cf_check hpet_msi_set_affinity(
-    struct irq_desc *desc, const cpumask_t *mask)
-{
-    struct hpet_event_channel *ch = desc->action->dev_id;
-    struct msi_msg msg = ch->msi.msg;
-
-    /* This really is only for dump_irqs(). */
-    cpumask_copy(desc->arch.cpu_mask, mask);
-
-    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.dest32 != ch->msi.msg.dest32 )
-        hpet_msi_write(ch, &msg);
-}
-
 /*
  * IRQ Chip for MSI HPET Devices,
  */
@@ -323,7 +307,6 @@ static hw_irq_controller hpet_msi_type = {
     .disable    = hpet_msi_mask,
     .ack        = irq_actor_none,
     .end        = end_nonmaskable_irq,
-    .set_affinity   = hpet_msi_set_affinity,
 };
 
 static int __hpet_setup_msi_irq(struct irq_desc *desc)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7c3d6efd24..cc2934bfca 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -51,7 +51,7 @@ static vmask_t global_used_vector_map;
 
 struct irq_desc __read_mostly *irq_desc = NULL;
 
-static DECLARE_BITMAP(used_vectors, X86_IDT_VECTORS);
+static DECLARE_BITMAP(used_vectors, X86_IDT_VECTORS) __ro_after_init;
 
 static DEFINE_SPINLOCK(vector_lock);
 
@@ -2644,13 +2644,17 @@ void fixup_irqs(void)
         spin_lock(&desc->lock);
 
         vector = irq_to_vector(irq);
-        if ( vector >= FIRST_HIPRIORITY_VECTOR &&
-             vector <= LAST_HIPRIORITY_VECTOR &&
-             desc->handler == &no_irq_type )
+        if ( (vector >= FIRST_HIPRIORITY_VECTOR &&
+              vector <= LAST_HIPRIORITY_VECTOR &&
+              desc->handler == &no_irq_type) ||
+             test_bit(vector, used_vectors) )
         {
             /*
              * This can in particular happen when parking secondary threads
              * during boot and when the serial console wants to use a PCI IRQ.
+             *
+             * Globally used vectors (like the HPET broadcast IRQ ones), need
+             * to be left alone in any event.
              */
             spin_unlock(&desc->lock);
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:11:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211231.1522760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwLh-0007zT-PT; Thu, 22 Jan 2026 15:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211231.1522760; Thu, 22 Jan 2026 15: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 1viwLh-0007zL-Mo; Thu, 22 Jan 2026 15:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1211231;
 Thu, 22 Jan 2026 15:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viwLg-0007zD-Lg
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 15:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwLg-00FvM4-39
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwLg-00Efn3-1u
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15: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=crb57zxjvlh2NhdHyOoLOKlxdx4qAUOJ6GWlJAvizXU=; b=CAIj5GBsPS7+zhm+MRNC5YF+MK
	QFOYHIJnhCKHYWcEfy8ExM7WQqnbAYPb0D9GodQJ0un3bflKEHot4KMdWdxBV2UBTjf9GKRHNb4tR
	7pxoj7qN77oBAzGGwNCsiddp4okohijjVnYo0/5gw+mhs5qzKXQfaZ74HpOK8GRDur+A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HPET: don't arbitrarily cap delta in reprogram_hpet_evt_channel()
Message-Id: <E1viwLg-00Efn3-1u@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:11:52 +0000

commit 5eedd1fa1dbdbda9304824955582ca38464dd911
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:14:02 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: don't arbitrarily cap delta in reprogram_hpet_evt_channel()
    
    There's no reason to set an arbitrary upper bound of 10 seconds. We can
    simply set the comparator such that it'll take a whole cycle through all
    32-bit values until the next interrupt would be raised. (For an extremely
    fast-running HPET [400 MHz and up] 10 seconds would also be too long.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 722a69ab13..1ea8ae4574 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -23,7 +23,6 @@
 #include <asm/irq-vectors.h>
 #include <asm/msi.h>
 
-#define MAX_DELTA_NS MILLISECS(10*1000)
 #define MIN_DELTA_NS MICROSECS(20)
 
 #define HPET_EVT_USED_BIT    0
@@ -164,10 +163,15 @@ static int reprogram_hpet_evt_channel(
 
     ASSERT(expire != STIME_MAX);
 
-    delta = min_t(int64_t, delta, MAX_DELTA_NS);
     delta = max_t(int64_t, delta, MIN_DELTA_NS);
     delta = ns2ticks(delta, ch->shift, ch->mult);
 
+    if ( delta > UINT32_MAX )
+    {
+        hpet_write32(hpet_read32(HPET_COUNTER), HPET_Tn_CMP(ch->idx));
+        return 0;
+    }
+
     do {
         ret = hpet_next_event(delta, ch->idx);
         delta += delta;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:12:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211232.1522764 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwLr-00081r-Qr; Thu, 22 Jan 2026 15:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211232.1522764; Thu, 22 Jan 2026 15:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwLr-00081i-OB; Thu, 22 Jan 2026 15:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1211232;
 Thu, 22 Jan 2026 15:12:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viwLq-00081a-OK
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 15:12:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwLr-00FvMM-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwLq-00EfoH-2E
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:12:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1fnYpesxMRIYVZXAayR8Ap/KrUWvs158g4BtxFZTtyQ=; b=wg7VJFdoVtq2fRAPpkz1Wi3HSq
	vGiVXUy0iQ2j1XFQVcQmBvhs8smr3UgEdPi9SmIT/Juk7Q21GsfJAcjKgwmp4j+lTpEOu4PywK0TX
	mTWr8lnHiRC+rVmaigJy+4h3bA4yAKdROCMswJUGS9NUcuuQ7fj/EykYzsKOIOHsDG1Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Allow lib-y targets to also be .init.o
Message-Id: <E1viwLq-00EfoH-2E@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:12:02 +0000

commit 420c65c25732e13acadaae222d16a88a9958b083
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Jan 22 14:14:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    xen: Allow lib-y targets to also be .init.o
    
    There's some assumptions as to which targets may be init-only. But
    there's little reason to preclude libraries from being init-only.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Rules.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 2b28d1ac3c..179eb20f4e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -130,7 +130,7 @@ endif
 
 targets += $(targets-for-builtin)
 
-$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS-y += -DINIT_SECTIONS_ONLY
+$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): CFLAGS-y += -DINIT_SECTIONS_ONLY
 
 non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-y))
 
@@ -146,7 +146,7 @@ endif
 $(call cc-option-add,cov-cflags-$(CONFIG_COVERAGE),CC,-fprofile-update=atomic)
 
 # Reset cov-cflags-y in cases where an objects has another one as prerequisite
-$(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \
+$(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): \
     cov-cflags-y :=
 
 $(non-init-objects): _c_flags += $(cov-cflags-y)
@@ -156,7 +156,7 @@ ifeq ($(CONFIG_UBSAN),y)
 UBSAN_FLAGS := $(filter-out -fno-%,$(CFLAGS_UBSAN)) $(filter -fno-%,$(CFLAGS_UBSAN))
 
 # Reset UBSAN_FLAGS in cases where an objects has another one as prerequisite
-$(noubsan-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \
+$(noubsan-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): \
     UBSAN_FLAGS :=
 
 $(non-init-objects): _c_flags += $(UBSAN_FLAGS)
@@ -273,7 +273,7 @@ define cmd_obj_init_o
     $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
 endef
 
-$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): $(obj)/%.init.o: $(obj)/%.o FORCE
+$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): $(obj)/%.init.o: $(obj)/%.o FORCE
 	$(call if_changed,obj_init_o)
 
 quiet_cmd_cpp_i_c = CPP     $@
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 15:12:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 15:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211233.1522768 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwM1-00083p-SD; Thu, 22 Jan 2026 15:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211233.1522768; Thu, 22 Jan 2026 15:12:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1viwM1-00083h-Pa; Thu, 22 Jan 2026 15:12:13 +0000
Received: by outflank-mailman (input) for mailman id 1211233;
 Thu, 22 Jan 2026 15:12:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1viwM0-00083Z-Qs
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 15:12:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwM1-00FvMQ-0S
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1viwM0-00Efp1-2W
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 15:12:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u7W/B5fH2LES5s7HiJVWNRMdluSDHlaBnhZPHVsf6FU=; b=rluO1zY4HWto1pnVazbbg1rke4
	fGfinGtE+H8+zPktsDiFGYs39Ugg55uEypBHXqKGmJRbTcixkxlwHlnCV6pXJTyv1crIWWvz7CahN
	gzH+TcCWt8j8jwlNJWzfL7wE+xAeN57Ju9ohOeGmTvdoqCzytEafpQ8B7tRf7cWDbgKA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: remove Alexandru Isaila and Petre Pircalabu as vm_event reviewers
Message-Id: <E1viwM0-00Efp1-2W@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 15:12:12 +0000

commit 3001d9a19592bb4f12dab33f161ab2148513e30a
Author:     Mihai Donțu <mdontu@bitdefender.com>
AuthorDate: Thu Jan 22 16:07:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:07:04 2026 +0100

    MAINTAINERS: remove Alexandru Isaila and Petre Pircalabu as vm_event reviewers
    
    Alexandru and Petre are no longer with Bitdefender.
    
    Signed-off-by: Mihai Donțu <mdontu@bitdefender.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS | 2 --
 1 file changed, 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index bf00be928c..0ceb4bba21 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -569,8 +569,6 @@ F:	tools/
 
 VM EVENT, MEM ACCESS and MONITOR
 M:	Tamas K Lengyel <tamas@tklengyel.com>
-R:	Alexandru Isaila <aisaila@bitdefender.com>
-R:	Petre Pircalabu <ppircalabu@bitdefender.com>
 S:	Supported
 F:	tools/misc/xen-access.c
 F:	xen/arch/*/*/mem_access.c
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:22:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211294.1522801 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixRc-0002NE-2s; Thu, 22 Jan 2026 16:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211294.1522801; Thu, 22 Jan 2026 16: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 1vixRc-0002N6-09; Thu, 22 Jan 2026 16:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1211294;
 Thu, 22 Jan 2026 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 1vixRa-0002N0-6D
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1vixRa-00Fx2e-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixRa-00EjUu-0I
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=UMmOvSZQj74SDYn0jaRHo1WQMECAQWRUeJxjQJB+wOk=; b=tk+6mwALB+i4pO6Nr++mPOU3b4
	Tvq1+31laKzIp0YOspvT0Z1YTsyETVI59ULI+tKocRYuJFvWRAXAxQkdeSpxTCt+GbZxNRtBXWzEh
	uCrFwQ4o3RQy25/7MDnsOIJ/cy9kiYwROOqs+UKfJdREIAiPwU1NdTv7dkwRTOH0dnE4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Adjust VMCB comments
Message-Id: <E1vixRa-00EjUu-0I@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:22:02 +0000

commit 6382bda1ea4fc161352518826bdb28d0aef6b19c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 21 17:38:31 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 13:05:39 2026 +0000

    x86/svm: Adjust VMCB comments
    
    The Intercept comments provide no value whatsoever.  For the VMCB, label the
    Control area and State Save area, which are the names given by the APM.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/vmcb.c | 4 ++++
 xen/arch/x86/hvm/svm/vmcb.h | 8 ++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index cbee10d046..72173c8fdd 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -430,9 +430,13 @@ static void __init __maybe_unused build_assertions(void)
 
     /* Build-time check of the VMCB layout. */
     BUILD_BUG_ON(sizeof(vmcb) != PAGE_SIZE);
+
+    /* Control area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), _pause_filter_thresh) != 0x03c);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _vintr)               != 0x060);
     BUILD_BUG_ON(offsetof(typeof(vmcb), event_inj)            != 0x0a8);
+
+    /* State Save area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), es)                   != 0x400);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _cpl)                 != 0x4cb);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _cr4)                 != 0x548);
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index ba554a9644..c64386e7ef 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -8,7 +8,6 @@
 
 struct vcpu;
 
-/* general 1 intercepts */
 enum GenericIntercept1bits
 {
     GENERAL1_INTERCEPT_INTR          = 1 << 0,
@@ -45,7 +44,6 @@ enum GenericIntercept1bits
     GENERAL1_INTERCEPT_SHUTDOWN_EVT  = 1u << 31
 };
 
-/* general 2 intercepts */
 enum GenericIntercept2bits
 {
     GENERAL2_INTERCEPT_VMRUN   = 1 << 0,
@@ -65,8 +63,6 @@ enum GenericIntercept2bits
     GENERAL2_INTERCEPT_RDPRU   = 1 << 14,
 };
 
-
-/* control register intercepts */
 enum CRInterceptBits
 {
     CR_INTERCEPT_CR0_READ   = 1 << 0,
@@ -103,8 +99,6 @@ enum CRInterceptBits
     CR_INTERCEPT_CR15_WRITE = 1u << 31,
 };
 
-
-/* debug register intercepts */
 enum DRInterceptBits
 {
     DR_INTERCEPT_DR0_READ   = 1 << 0,
@@ -400,6 +394,7 @@ typedef union
 #define MSRPM_SIZE  (8  * 1024)
 
 struct vmcb_struct {
+    /* Control area */
     u32 _cr_intercepts;         /* offset 0x00 - cleanbit 0 */
     u32 _dr_intercepts;         /* offset 0x04 - cleanbit 0 */
     u32 _exception_intercepts;  /* offset 0x08 - cleanbit 0 */
@@ -491,6 +486,7 @@ struct vmcb_struct {
     u8  guest_ins[15];          /* offset 0xD1 */
     u64 res10a[100];            /* offset 0xE0 pad to save area */
 
+    /* State Save area */
     union {
         struct segment_register sreg[6];
         struct {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211295.1522808 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixRm-0002Oc-4s; Thu, 22 Jan 2026 16:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211295.1522808; Thu, 22 Jan 2026 16:22: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 1vixRm-0002OU-1h; Thu, 22 Jan 2026 16:22:14 +0000
Received: by outflank-mailman (input) for mailman id 1211295;
 Thu, 22 Jan 2026 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 1vixRk-0002OC-8X
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1vixRk-00Fx2i-1o
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixRk-00EjVp-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=PKlPN/c2gGnzMwZ0OEliaxTv1IP1Gk5I6uGrQpSTsVw=; b=u7aXzFrPucfEn8XdyZamklOqdW
	L7IRWBqnM4E/BKKdwikuguww0oLeGZQY7nmewoABAlhVhGoIZbPloIdeh2QPZzs9P8JuwbIUtYd8S
	kJAswztG6WYnjZfS/J+5YRAWSjU5yfss7I3lXvZk8eTbsE4uB4PwpjvDI6ua04Z1rOKQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Add infrastructure for Bus Lock Threshold
Message-Id: <E1vixRk-00EjVp-0b@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:22:12 +0000

commit 06d2514278ac725f840482e7b42c9e529c99cd10
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Wed Jan 21 15:28:53 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 13:05:39 2026 +0000

    x86/svm: Add infrastructure for Bus Lock Threshold
    
    Add missing scaffolding to enable BusLock Threshold. That is:
    
      * Add General Intercepts 3
      * Add missing VMEXIT
      * Adjust NPF perf counter base to immediately after the buslock counter
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/vmcb.c           |  1 +
 xen/arch/x86/hvm/svm/vmcb.h           | 15 +++++++++++++--
 xen/arch/x86/include/asm/hvm/svm.h    |  2 ++
 xen/arch/x86/include/asm/perfc_defn.h |  2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 72173c8fdd..8734fd2bca 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -435,6 +435,7 @@ static void __init __maybe_unused build_assertions(void)
     BUILD_BUG_ON(offsetof(typeof(vmcb), _pause_filter_thresh) != 0x03c);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _vintr)               != 0x060);
     BUILD_BUG_ON(offsetof(typeof(vmcb), event_inj)            != 0x0a8);
+    BUILD_BUG_ON(offsetof(typeof(vmcb), bus_lock_count)       != 0x120);
 
     /* State Save area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), es)                   != 0x400);
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index c64386e7ef..69f6047394 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -63,6 +63,11 @@ enum GenericIntercept2bits
     GENERAL2_INTERCEPT_RDPRU   = 1 << 14,
 };
 
+enum GenericIntercept3bits
+{
+    GENERAL3_INTERCEPT_BUS_LOCK = 1 << 5,
+};
+
 enum CRInterceptBits
 {
     CR_INTERCEPT_CR0_READ   = 1 << 0,
@@ -283,6 +288,7 @@ enum VMEXIT_EXITCODE
     VMEXIT_MWAIT_CONDITIONAL= 140, /* 0x8c */
     VMEXIT_XSETBV           = 141, /* 0x8d */
     VMEXIT_RDPRU            = 142, /* 0x8e */
+    VMEXIT_BUS_LOCK         = 165, /* 0xa5 */
     /* Remember to also update VMEXIT_NPF_PERFC! */
     VMEXIT_NPF              = 1024, /* 0x400, nested paging fault */
     /* Remember to also update SVM_PERF_EXIT_REASON_SIZE! */
@@ -400,7 +406,8 @@ struct vmcb_struct {
     u32 _exception_intercepts;  /* offset 0x08 - cleanbit 0 */
     u32 _general1_intercepts;   /* offset 0x0C - cleanbit 0 */
     u32 _general2_intercepts;   /* offset 0x10 - cleanbit 0 */
-    u32 res01[10];
+    u32 _general3_intercepts;   /* offset 0x14 - cleanbit 0 */
+    u32 res01[9];
     u16 _pause_filter_thresh;   /* offset 0x3C - cleanbit 0 */
     u16 _pause_filter_count;    /* offset 0x3E - cleanbit 0 */
     u64 _iopm_base_pa;          /* offset 0x40 - cleanbit 1 */
@@ -484,7 +491,10 @@ struct vmcb_struct {
     u64 nextrip;                /* offset 0xC8 */
     u8  guest_ins_len;          /* offset 0xD0 */
     u8  guest_ins[15];          /* offset 0xD1 */
-    u64 res10a[100];            /* offset 0xE0 pad to save area */
+    u64 res10a[8];              /* offset 0xE0 */
+    u16 bus_lock_count;         /* offset 0x120 */
+    u16 res10b[3];              /* offset 0x122 */
+    u64 res10c[91];             /* offset 0x128 pad to save area */
 
     /* State Save area */
     union {
@@ -579,6 +589,7 @@ VMCB_ACCESSORS(dr_intercepts, intercepts)
 VMCB_ACCESSORS(exception_intercepts, intercepts)
 VMCB_ACCESSORS(general1_intercepts, intercepts)
 VMCB_ACCESSORS(general2_intercepts, intercepts)
+VMCB_ACCESSORS(general3_intercepts, intercepts)
 VMCB_ACCESSORS(pause_filter_count, intercepts)
 VMCB_ACCESSORS(pause_filter_thresh, intercepts)
 VMCB_ACCESSORS(tsc_offset, intercepts)
diff --git a/xen/arch/x86/include/asm/hvm/svm.h b/xen/arch/x86/include/asm/hvm/svm.h
index a6d7e4aed3..15f0268be7 100644
--- a/xen/arch/x86/include/asm/hvm/svm.h
+++ b/xen/arch/x86/include/asm/hvm/svm.h
@@ -37,6 +37,7 @@ extern u32 svm_feature_flags;
 #define SVM_FEATURE_VGIF          16 /* Virtual GIF */
 #define SVM_FEATURE_SSS           19 /* NPT Supervisor Shadow Stacks */
 #define SVM_FEATURE_SPEC_CTRL     20 /* MSR_SPEC_CTRL virtualisation */
+#define SVM_FEATURE_BUS_LOCK      29 /* Bus Lock Threshold */
 
 static inline bool cpu_has_svm_feature(unsigned int feat)
 {
@@ -56,6 +57,7 @@ static inline bool cpu_has_svm_feature(unsigned int feat)
 #define cpu_has_svm_vloadsave cpu_has_svm_feature(SVM_FEATURE_VLOADSAVE)
 #define cpu_has_svm_sss       cpu_has_svm_feature(SVM_FEATURE_SSS)
 #define cpu_has_svm_spec_ctrl cpu_has_svm_feature(SVM_FEATURE_SPEC_CTRL)
+#define cpu_has_svm_bus_lock  cpu_has_svm_feature(SVM_FEATURE_BUS_LOCK)
 
 #define MSR_INTERCEPT_NONE    0
 #define MSR_INTERCEPT_READ    1
diff --git a/xen/arch/x86/include/asm/perfc_defn.h b/xen/arch/x86/include/asm/perfc_defn.h
index d6127cb91e..ac7439b992 100644
--- a/xen/arch/x86/include/asm/perfc_defn.h
+++ b/xen/arch/x86/include/asm/perfc_defn.h
@@ -7,7 +7,7 @@ PERFCOUNTER_ARRAY(exceptions,           "exceptions", 32)
 #ifdef CONFIG_HVM
 
 #define VMX_PERF_EXIT_REASON_SIZE 76
-#define VMEXIT_NPF_PERFC 143
+#define VMEXIT_NPF_PERFC 166
 #define SVM_PERF_EXIT_REASON_SIZE (VMEXIT_NPF_PERFC + 1)
 PERFCOUNTER_ARRAY(vmexits,              "vmexits",
                   MAX(VMX_PERF_EXIT_REASON_SIZE, SVM_PERF_EXIT_REASON_SIZE))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211296.1522810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixRw-0002R8-6O; Thu, 22 Jan 2026 16:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211296.1522810; Thu, 22 Jan 2026 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 1vixRw-0002R0-35; Thu, 22 Jan 2026 16:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1211296;
 Thu, 22 Jan 2026 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 1vixRu-0002Qk-FF
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1vixRu-00Fx2m-2J
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixRu-00EjWI-0u
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=iTkUaQPfa0Go/Hr+dVQde/qfLA2jzVJIpdaaSyYAVhA=; b=h7DRUgJY3on0Gn402eL91kyzKS
	Ti5smFQyQpgvGjGjaWVxTifLJq49ccQeVSAszPRyc2+CGnhEHF5VstgnXvy5heaxd3ABcCUKhISaC
	C/XYFtKh2a/BlcwYmnY7XEYCFoCaR0fZMCyc2HfjKwV9iOq2KHwVAtGFk3p7D2D7wljw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Intercept Bus Locks for HVM guests
Message-Id: <E1vixRu-00EjWI-0u@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:22:22 +0000

commit dd5b8336f5867831f71f4ae9069205a914801432
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Wed Jan 21 15:28:54 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 13:05:39 2026 +0000

    x86/svm: Intercept Bus Locks for HVM guests
    
    Configure the Bus Lock intercept when supported by hardware (Zen5 and
    later). The VMCB counter is initialised to zero so it fires upon the first
    instruction that locks the bus. On the #VMEXIT handler that counter is set to
    1 because it has fault behaviour and the offending instruction needs to
    re-execute.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 CHANGELOG.md                |  4 ++++
 xen/arch/x86/hvm/svm/svm.c  | 11 +++++++++++
 xen/arch/x86/hvm/svm/vmcb.c |  7 +++++++
 3 files changed, 22 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53d92a2597..18f3d10f20 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Changed
 
 ### Added
+ - On x86:
+   - Support for Bus Lock Threshold on AMD Zen5 and later CPUs, used by Xen to
+     mitigate (by rate-limiting) the system wide impact of an HVM guest
+     misusing atomic instructions.
 
 ### Removed
  - On x86:
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 5d23603fc1..18ba837738 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2524,6 +2524,7 @@ const struct hvm_function_table * __init start_svm(void)
     P(cpu_has_tsc_ratio, "TSC Rate MSR");
     P(cpu_has_svm_sss, "NPT Supervisor Shadow Stack");
     P(cpu_has_svm_spec_ctrl, "MSR_SPEC_CTRL virtualisation");
+    P(cpu_has_svm_bus_lock, "Bus Lock Filter");
 #undef P
 
     if ( !printed )
@@ -3087,6 +3088,16 @@ void asmlinkage svm_vmexit_handler(void)
         break;
     }
 
+    case VMEXIT_BUS_LOCK:
+        /*
+         * This is a fault and blocked the Bus Lock inducing action.  We're
+         * only interested in rate limiting the guest, so credit it one "lock"
+         * in order to re-execute the instruction.
+         */
+        perfc_incr(buslock);
+        vmcb->bus_lock_count = 1;
+        break;
+
     default:
     unexpected_exit_type:
         gprintk(XENLOG_ERR, "Unexpected vmexit: reason %#"PRIx64", "
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 8734fd2bca..e583ef8548 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -66,6 +66,13 @@ static int construct_vmcb(struct vcpu *v)
         GENERAL2_INTERCEPT_XSETBV      | GENERAL2_INTERCEPT_ICEBP       |
         GENERAL2_INTERCEPT_RDPRU;
 
+    /*
+     * Well behaved logic shouldn't ever Bus Lock, but we care about rate
+     * limiting buggy/malicious cases.
+     */
+    if ( cpu_has_svm_bus_lock )
+        vmcb->_general3_intercepts |= GENERAL3_INTERCEPT_BUS_LOCK;
+
     /* Intercept all debug-register writes. */
     vmcb->_dr_intercepts = ~0u;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211297.1522813 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixS6-0002Tq-8W; Thu, 22 Jan 2026 16:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211297.1522813; Thu, 22 Jan 2026 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 1vixS6-0002Ti-5s; Thu, 22 Jan 2026 16:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1211297;
 Thu, 22 Jan 2026 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 1vixS4-0002TU-G9
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1vixS4-00Fx2q-2a
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixS4-00EjYh-1P
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=Tp5898o3MyK0n0cLXyiTNCLCKQXKrC7gu4dsNXN0yyI=; b=0tcuxE8QkJ7IuhBenGLUZw8EsR
	7hRTBlXzGJ/2mOVTl788Op0FiHZ8auZaXd4Dgv49lpWTXQqUP4n2DbnhuEGsJm9bo3z+ZQOSG66R4
	GkBCQYC1pz+qW+xpyV6/aD54kWVCKjmF3M0S5PJX5BtR5u0sGkBAV03diPehjdf2zKdU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: move legacy tick IRQ count adjustment
Message-Id: <E1vixS4-00EjYh-1P@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:22:32 +0000

commit bb34713d9a8916963561e6358843a9602c74ab1d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:11:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: move legacy tick IRQ count adjustment
    
    If already we play with the IRQ count, we should do so only if we actually
    "consume" the interrupt; normal timer IRQs should not have any adjustment
    done.
    
    Fixes: 353533232730 ("cpuidle: fix the menu governor to enhance IO performance")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index f34863e0df..a096547fe8 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -808,13 +808,13 @@ int hpet_broadcast_is_available(void)
 
 int hpet_legacy_irq_tick(void)
 {
-    this_cpu(irq_count)--;
-
     if ( !hpet_events ||
          (hpet_events->flags & (HPET_EVT_DISABLE|HPET_EVT_LEGACY)) !=
          HPET_EVT_LEGACY )
         return 0;
 
+    this_cpu(irq_count)--;
+
     handle_hpet_broadcast(hpet_events);
 
     return 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211299.1522828 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixSG-0002kQ-GC; Thu, 22 Jan 2026 16:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211299.1522828; Thu, 22 Jan 2026 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 1vixSG-0002kI-DZ; Thu, 22 Jan 2026 16:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1211299;
 Thu, 22 Jan 2026 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 1vixSE-0002jO-JA
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 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 1vixSE-00Fx35-2r
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixSE-00EjZ9-1f
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 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=HKZw1WZrK9z9iUuW9NXeMDgDRXeEDbMK0vid2pUX0z0=; b=zUBw4tu+FiqXbuV/DH419taayc
	YcdC79gY9DKyExY3ENzFqCmb5HZM4LTBGVoYcmqculQSApy9lqmvi4C3olIUvZ6lvA0O00nHRtt8N
	7QcPfVrRKwFxvPzD7QloaC2V17eH7oWAaj3Wy6+yXu5EWBlAK+8veeTCWIZIFw1eqmM8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: reduce hpet_next_event() call sites
Message-Id: <E1vixSE-00EjZ9-1f@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:22:42 +0000

commit 8da2d4ec14288f4a518244a7a74a43bf5f66a8dd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:11:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: reduce hpet_next_event() call sites
    
    I'm surprised gcc doesn't manage to do that: At least in debug builds two
    call sites exist, just like source code has it. That's not necessary
    though - by using do/while we can reduce this to a single call site. Then
    the function will be inlined.
    
    While improving code gen, also switch the function's 2nd parameter to
    unsigned.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index a096547fe8..44915d9ecb 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -124,7 +124,7 @@ static inline unsigned long ns2ticks(unsigned long nsec, int shift,
     return (unsigned long) tmp;
 }
 
-static int hpet_next_event(unsigned long delta, int timer)
+static int hpet_next_event(unsigned long delta, unsigned int timer)
 {
     uint32_t cnt, cmp;
     unsigned long flags;
@@ -173,12 +173,10 @@ static int reprogram_hpet_evt_channel(
     delta = max_t(int64_t, delta, MIN_DELTA_NS);
     delta = ns2ticks(delta, ch->shift, ch->mult);
 
-    ret = hpet_next_event(delta, ch->idx);
-    while ( ret && force )
-    {
-        delta += delta;
+    do {
         ret = hpet_next_event(delta, ch->idx);
-    }
+        delta += delta;
+    } while ( ret && force );
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:22:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211301.1522831 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixSP-0002p9-I9; Thu, 22 Jan 2026 16:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211301.1522831; Thu, 22 Jan 2026 16: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 1vixSP-0002p1-F1; Thu, 22 Jan 2026 16:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1211301;
 Thu, 22 Jan 2026 16: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 1vixSO-0002oY-LH
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 16: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 1vixSO-00Fx3P-37
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixSO-00EjZV-1w
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16: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=xV31qmv6muzSgm0uHeJ95c7NH5C6/5VubORHo+Fj/os=; b=2TFqIlSPUAMwM/noiaF+rw+gAt
	8ZR0/k/HgL4IdKY4ZpGVeKg3bkztkY+zPBnlVRc8ivpL3EjZe90EqDuUsK6K3y7jv3rr+iQtX8BSd
	++IjOsb3YmX0IHj29bqGXRRVYLEZ7tThkMUJi5CRPtIUnniIjkKFNR4aQ6Lny/hCol6A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: drop "long timeout" handling from reprogram_hpet_evt_channel()
Message-Id: <E1vixSO-00EjZV-1w@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:22:52 +0000

commit ae8a5165d644eae9209672d035d80086e05ad443
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:12:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: drop "long timeout" handling from reprogram_hpet_evt_channel()
    
    Neither caller passes STIME_MAX, so (bogusly) handling the case isn't
    necessary.
    
    "Bogusly" because with 32-bit counters, writing 0 means on average half
    the wrapping period until an interrupt would be raised, while of course
    in extreme cases an interrupt would be raised almost right away.
    
    Leave an assertion.
    
    Amends: aa42fc0e9cd9 ("cpuidle: remove hpet access in hpet_broadcast_exit")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 44915d9ecb..368c6eb4a0 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -162,12 +162,7 @@ static int reprogram_hpet_evt_channel(
 
     ch->next_event = expire;
 
-    if ( expire == STIME_MAX )
-    {
-        /* We assume it will take a long time for the timer to wrap. */
-        hpet_write32(0, HPET_Tn_CMP(ch->idx));
-        return 0;
-    }
+    ASSERT(expire != STIME_MAX);
 
     delta = min_t(int64_t, delta, MAX_DELTA_NS);
     delta = max_t(int64_t, delta, MIN_DELTA_NS);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:23:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211305.1522836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixSZ-0002wT-JK; Thu, 22 Jan 2026 16:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211305.1522836; Thu, 22 Jan 2026 16: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 1vixSZ-0002wL-Gj; Thu, 22 Jan 2026 16:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1211305;
 Thu, 22 Jan 2026 16: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 1vixSY-0002w3-Od
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 16: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 1vixSZ-00Fx3m-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixSY-00Eja0-2C
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16: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=48QwfDZI784XHFV5xIL33p5IhB0Ho+eexp3w2XkqWEw=; b=MLAQFEZDgjJiBDkqhzszTg9IWe
	DawmH/OQ6mhbAl/kAjBmOe86zh0ceRcE0TvSAX+LrianRKHk4sZQ1trdngzfwAlgdGPS5ggXyCil3
	KjXt+BTLQLwLZbj9smsxQ4L36PZ0TSqkpFvPvn6JbKj6+yAoiEvKFZt5x4sYk5BoIMgM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: simplify "expire" check a little in reprogram_hpet_evt_channel()
Message-Id: <E1vixSY-00Eja0-2C@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:23:02 +0000

commit 712416dc443315da604d69f6d36b28c6744578f0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:12:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: simplify "expire" check a little in reprogram_hpet_evt_channel()
    
    When this was added, the log message was updated correctly, but the zero
    case was needlessly checked separately: hpet_broadcast_enter() had a zero
    check added at the same time, while handle_hpet_broadcast() can't possibly
    pass 0 here anyway.
    
    Also turn the printk() there into an assertion: NOW() should only ever
    return valid (positive) values.
    
    Fixes: 7145897cfb81 ("cpuidle: Fix for timer_deadline==0 case")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 368c6eb4a0..65253a3f6c 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -147,12 +147,12 @@ static int reprogram_hpet_evt_channel(
     int64_t delta;
     int ret;
 
-    if ( (ch->flags & HPET_EVT_DISABLE) || (expire == 0) )
+    if ( ch->flags & HPET_EVT_DISABLE )
         return 0;
 
-    if ( unlikely(expire < 0) )
+    if ( unlikely(expire <= 0) )
     {
-        printk(KERN_DEBUG "reprogram: expire <= 0\n");
+        ASSERT_UNREACHABLE();
         return -ETIME;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:23:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:23:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211309.1522839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixSj-00034f-Kg; Thu, 22 Jan 2026 16:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211309.1522839; Thu, 22 Jan 2026 16: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 1vixSj-00034X-I5; Thu, 22 Jan 2026 16:23:13 +0000
Received: by outflank-mailman (input) for mailman id 1211309;
 Thu, 22 Jan 2026 16: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 1vixSi-00034N-RT
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 16: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 1vixSj-00Fx3v-0V
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixSi-00Ejag-2Y
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16: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=Zkg8yylWNehIY90ntLQhTWpVseydy0x8v2YPRET3wsg=; b=059DjnaSJgBbaZVcwNwIKpoLrA
	3+u/ra/kxmLoCOp2qXliyC4plfG7uvnYmVH+9f6t8sJ6vCYUYk19QgB1qm1Q1SrZ8Ux0lxxS4+Cv0
	KA19JLqyYxTQQHhDTY7BBvJ8a88QuH8f4WZeoUKQaF9rDRwZ0TFz3DvWwhXOs+7qh8II=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: drop .set_affinity hook
Message-Id: <E1vixSi-00Ejag-2Y@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:23:12 +0000

commit 5ec93b2f19ff8873fca65d38c1164b0a56d3898b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:13:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: drop .set_affinity hook
    
    No IRQ balancing is supposed to be happening on the broadcast IRQs. The
    only entity responsible for fiddling with the CPU affinities is
    set_channel_irq_affinity(). They shouldn't even be fiddled with when
    offlining a CPU: A CPU going down can't at the same time be idle. Some
    properties (->arch.cpu_mask in particular) may transiently reference an
    offline CPU, but that'll be adjusted as soon as a channel goes into active
    use again.
    
    Along with adjusting fixup_irqs() (in a more general way, i.e. covering all
    vectors which are marked in use globally), also adjust section placement of
    used_vectors.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 17 -----------------
 xen/arch/x86/irq.c  | 12 ++++++++----
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 65253a3f6c..722a69ab13 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -296,22 +296,6 @@ static int hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 
 #define hpet_msi_shutdown hpet_msi_mask
 
-static void cf_check hpet_msi_set_affinity(
-    struct irq_desc *desc, const cpumask_t *mask)
-{
-    struct hpet_event_channel *ch = desc->action->dev_id;
-    struct msi_msg msg = ch->msi.msg;
-
-    /* This really is only for dump_irqs(). */
-    cpumask_copy(desc->arch.cpu_mask, mask);
-
-    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.dest32 != ch->msi.msg.dest32 )
-        hpet_msi_write(ch, &msg);
-}
-
 /*
  * IRQ Chip for MSI HPET Devices,
  */
@@ -323,7 +307,6 @@ static hw_irq_controller hpet_msi_type = {
     .disable    = hpet_msi_mask,
     .ack        = irq_actor_none,
     .end        = end_nonmaskable_irq,
-    .set_affinity   = hpet_msi_set_affinity,
 };
 
 static int __hpet_setup_msi_irq(struct irq_desc *desc)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7c3d6efd24..cc2934bfca 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -51,7 +51,7 @@ static vmask_t global_used_vector_map;
 
 struct irq_desc __read_mostly *irq_desc = NULL;
 
-static DECLARE_BITMAP(used_vectors, X86_IDT_VECTORS);
+static DECLARE_BITMAP(used_vectors, X86_IDT_VECTORS) __ro_after_init;
 
 static DEFINE_SPINLOCK(vector_lock);
 
@@ -2644,13 +2644,17 @@ void fixup_irqs(void)
         spin_lock(&desc->lock);
 
         vector = irq_to_vector(irq);
-        if ( vector >= FIRST_HIPRIORITY_VECTOR &&
-             vector <= LAST_HIPRIORITY_VECTOR &&
-             desc->handler == &no_irq_type )
+        if ( (vector >= FIRST_HIPRIORITY_VECTOR &&
+              vector <= LAST_HIPRIORITY_VECTOR &&
+              desc->handler == &no_irq_type) ||
+             test_bit(vector, used_vectors) )
         {
             /*
              * This can in particular happen when parking secondary threads
              * during boot and when the serial console wants to use a PCI IRQ.
+             *
+             * Globally used vectors (like the HPET broadcast IRQ ones), need
+             * to be left alone in any event.
              */
             spin_unlock(&desc->lock);
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:23:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211310.1522844 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixSt-000378-MV; Thu, 22 Jan 2026 16:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211310.1522844; Thu, 22 Jan 2026 16:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixSt-000370-JW; Thu, 22 Jan 2026 16:23:23 +0000
Received: by outflank-mailman (input) for mailman id 1211310;
 Thu, 22 Jan 2026 16:23:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vixSs-00036n-U1
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 16:23:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixSt-00Fx3z-0m
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixSs-00Ejby-2o
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vRUnuBuDA9DnnwFqVXp5Ghseww4LPXk3eUc+P+YRR+0=; b=RVy/em20l6yjBOkGOoG2S3kzK2
	+P3eHGibQ3czZGPUrisfbriFoWOjEktQQDm1Wr5lcwI0l30fb+CtQazuYIlXRqxhX+pV/9lTJFzqR
	jPMAncq/SmC1Xm9i8D1VjMjbRdQyeY/3ydsm/WVyX2kRmwAA9WJDrJBwPKIcU4hVNOyc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HPET: don't arbitrarily cap delta in reprogram_hpet_evt_channel()
Message-Id: <E1vixSs-00Ejby-2o@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:23:22 +0000

commit 5eedd1fa1dbdbda9304824955582ca38464dd911
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 22 14:14:02 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    x86/HPET: don't arbitrarily cap delta in reprogram_hpet_evt_channel()
    
    There's no reason to set an arbitrary upper bound of 10 seconds. We can
    simply set the comparator such that it'll take a whole cycle through all
    32-bit values until the next interrupt would be raised. (For an extremely
    fast-running HPET [400 MHz and up] 10 seconds would also be too long.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hpet.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 722a69ab13..1ea8ae4574 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -23,7 +23,6 @@
 #include <asm/irq-vectors.h>
 #include <asm/msi.h>
 
-#define MAX_DELTA_NS MILLISECS(10*1000)
 #define MIN_DELTA_NS MICROSECS(20)
 
 #define HPET_EVT_USED_BIT    0
@@ -164,10 +163,15 @@ static int reprogram_hpet_evt_channel(
 
     ASSERT(expire != STIME_MAX);
 
-    delta = min_t(int64_t, delta, MAX_DELTA_NS);
     delta = max_t(int64_t, delta, MIN_DELTA_NS);
     delta = ns2ticks(delta, ch->shift, ch->mult);
 
+    if ( delta > UINT32_MAX )
+    {
+        hpet_write32(hpet_read32(HPET_COUNTER), HPET_Tn_CMP(ch->idx));
+        return 0;
+    }
+
     do {
         ret = hpet_next_event(delta, ch->idx);
         delta += delta;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:23:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:23:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211311.1522848 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixT3-00039q-Nu; Thu, 22 Jan 2026 16:23:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211311.1522848; Thu, 22 Jan 2026 16:23:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixT3-00039i-Kq; Thu, 22 Jan 2026 16:23:33 +0000
Received: by outflank-mailman (input) for mailman id 1211311;
 Thu, 22 Jan 2026 16:23:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vixT3-00039a-0J
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 16:23:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixT3-00Fx44-11
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixT2-00EjcZ-35
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YqrIzuBLGGcAgCH6bo9NmOWltQ4XjHravgvpG877H/s=; b=vov7CJ5Ve/wMzFCs6/4sHL490v
	FvmExpPPAosMW3E3RpaRVKe9IozTHWghFrBnku+WiaNgp9xHFGg8FzrQCPw7g8kCwaboaJkSJitib
	3uN46m8OnCKWVyi6XZZ1Q+F+JfYwjP+ZXzizs9t2ZPjLbhFbGO6N4ih3cpyloM6hYBY4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Allow lib-y targets to also be .init.o
Message-Id: <E1vixT2-00EjcZ-35@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:23:32 +0000

commit 420c65c25732e13acadaae222d16a88a9958b083
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Jan 22 14:14:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:06:22 2026 +0100

    xen: Allow lib-y targets to also be .init.o
    
    There's some assumptions as to which targets may be init-only. But
    there's little reason to preclude libraries from being init-only.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Rules.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 2b28d1ac3c..179eb20f4e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -130,7 +130,7 @@ endif
 
 targets += $(targets-for-builtin)
 
-$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS-y += -DINIT_SECTIONS_ONLY
+$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): CFLAGS-y += -DINIT_SECTIONS_ONLY
 
 non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-y))
 
@@ -146,7 +146,7 @@ endif
 $(call cc-option-add,cov-cflags-$(CONFIG_COVERAGE),CC,-fprofile-update=atomic)
 
 # Reset cov-cflags-y in cases where an objects has another one as prerequisite
-$(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \
+$(nocov-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): \
     cov-cflags-y :=
 
 $(non-init-objects): _c_flags += $(cov-cflags-y)
@@ -156,7 +156,7 @@ ifeq ($(CONFIG_UBSAN),y)
 UBSAN_FLAGS := $(filter-out -fno-%,$(CFLAGS_UBSAN)) $(filter -fno-%,$(CFLAGS_UBSAN))
 
 # Reset UBSAN_FLAGS in cases where an objects has another one as prerequisite
-$(noubsan-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y)): \
+$(noubsan-y) $(filter %.init.o, $(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): \
     UBSAN_FLAGS :=
 
 $(non-init-objects): _c_flags += $(UBSAN_FLAGS)
@@ -273,7 +273,7 @@ define cmd_obj_init_o
     $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
 endef
 
-$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): $(obj)/%.init.o: $(obj)/%.o FORCE
+$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y) $(lib-y)): $(obj)/%.init.o: $(obj)/%.o FORCE
 	$(call if_changed,obj_init_o)
 
 quiet_cmd_cpp_i_c = CPP     $@
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 16:23:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 16:23:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211312.1522852 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vixTD-0003Ck-Ok; Thu, 22 Jan 2026 16:23:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211312.1522852; Thu, 22 Jan 2026 16:23: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 1vixTD-0003Cc-MC; Thu, 22 Jan 2026 16:23:43 +0000
Received: by outflank-mailman (input) for mailman id 1211312;
 Thu, 22 Jan 2026 16:23: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 1vixTD-0003CR-2Z
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 16:23: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 1vixTD-00Fx4L-1G
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vixTD-00Ejd2-05
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 16:23: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=ldXpgQPTvxccLTynW46vnEqgqpXHdV0OiHbSA5gGOvw=; b=m+PLQKb3Mg7NQYy6tTLcSmYA7o
	5ZRvVq2UB2JVScCh+puMzHrR/BT66mn06vv/iicMqkW7SLfxp+kTvk+siUmvGm8f8UxNGelXQDIyX
	54CTOnP+NDR3NhCVesCympLE2ltFXvVs5Tku9bFDgKaIMzgfAxBu7dqux971Yqa55688=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: remove Alexandru Isaila and Petre Pircalabu as vm_event reviewers
Message-Id: <E1vixTD-00Ejd2-05@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 16:23:43 +0000

commit 3001d9a19592bb4f12dab33f161ab2148513e30a
Author:     Mihai Donțu <mdontu@bitdefender.com>
AuthorDate: Thu Jan 22 16:07:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 22 16:07:04 2026 +0100

    MAINTAINERS: remove Alexandru Isaila and Petre Pircalabu as vm_event reviewers
    
    Alexandru and Petre are no longer with Bitdefender.
    
    Signed-off-by: Mihai Donțu <mdontu@bitdefender.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS | 2 --
 1 file changed, 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index bf00be928c..0ceb4bba21 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -569,8 +569,6 @@ F:	tools/
 
 VM EVENT, MEM ACCESS and MONITOR
 M:	Tamas K Lengyel <tamas@tklengyel.com>
-R:	Alexandru Isaila <aisaila@bitdefender.com>
-R:	Petre Pircalabu <ppircalabu@bitdefender.com>
 S:	Supported
 F:	tools/misc/xen-access.c
 F:	xen/arch/*/*/mem_access.c
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 22:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 22:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211925.1523306 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vj3PH-0007my-6k; Thu, 22 Jan 2026 22:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211925.1523306; Thu, 22 Jan 2026 22:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vj3PH-0007mo-3z; Thu, 22 Jan 2026 22:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1211925;
 Thu, 22 Jan 2026 22: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 1vj3PF-0007mi-F7
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 22: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 1vj3PF-00G40J-2N
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 22:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vj3PF-00F8td-19
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 22: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=1NQkNKvTn4UhWbmqBMwv86yEY8QysWDqXvqKPb4Jalo=; b=cKlpWhgW28yeaw4Cnv5TAZ2JwB
	iq/FJJHcm4qkHw4vVU3sOCrYPZbEUFUzh+3UlDNIUTEeNPYhGYqLUHNfr2LBVOMqR4NXyBG9/vQbj
	tK6Mu1mCh7/+B1bno1NGCrfOC1cfaErB0M0d1+iN4Ih/nbsj2st495GafAOKa5oQfE2A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] earlycpio: lib-ify earlycpio.c
Message-Id: <E1vj3PF-00F8td-19@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 22:44:01 +0000

commit f6cd299be9d344e94e914e2a7f522bcfb40204a6
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Wed Jan 21 16:47:55 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 19:42:36 2026 +0000

    earlycpio: lib-ify earlycpio.c
    
    It's only used for microcode loading on x86. By lib-ifying it, it will be
    discarded automatically by the linker when CONFIG_MICROCODE_LOADING=n.
    
    Update the path in exclude-list.json, as the code is still not clean.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misra/exclude-list.json |   8 +--
 xen/common/Makefile          |   2 +-
 xen/common/earlycpio.c       | 145 -------------------------------------------
 xen/lib/Makefile             |   1 +
 xen/lib/earlycpio.c          | 145 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 151 insertions(+), 150 deletions(-)

diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index 388397dd3b..2b874dfd3b 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -121,10 +121,6 @@
             "rel_path": "common/bunzip2.c",
             "comment": "Imported from Linux, ignore for now"
         },
-        {
-            "rel_path": "common/earlycpio.c",
-            "comment": "Imported from Linux, ignore for now"
-        },
         {
             "rel_path": "common/gzip/*",
             "comment": "Imported from Linux, ignore for now"
@@ -225,6 +221,10 @@
             "rel_path": "include/xen/decompress.h",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "lib/earlycpio.c",
+            "comment": "Imported from Linux, ignore for now"
+        },
         {
             "rel_path": "lib/find-next-bit.c",
             "comment": "Imported from Linux, ignore for now"
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 92c97d641e..4fc0c15088 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -65,7 +65,7 @@ obj-y += wait.o
 obj-bin-y += warning.init.o
 obj-y += xmalloc_tlsf.o
 
-obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 unzstd earlycpio,$(n).init.o)
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 unzstd,$(n).init.o)
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o memory.o multicall.o xlat.o)
 
diff --git a/xen/common/earlycpio.c b/xen/common/earlycpio.c
deleted file mode 100644
index 6c76307c25..0000000000
--- a/xen/common/earlycpio.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- *   Copyright 2012 Intel Corporation; author H. Peter Anvin
- *
- *   This file is part of the Linux kernel, and is made available
- *   under the terms of the GNU General Public License version 2, as
- *   published by the Free Software Foundation.
- *
- *   This program is distributed in the hope it will be useful, but
- *   WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *   General Public License for more details.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * earlycpio.c
- *
- * Find a specific cpio member; must precede any compressed content.
- * This is used to locate data items in the initramfs used by the
- * kernel itself during early boot (before the main initramfs is
- * decompressed.)  It is the responsibility of the initramfs creator
- * to ensure that these items are uncompressed at the head of the
- * blob.  Depending on the boot loader or package tool that may be a
- * separate file or part of the same file.
- */
-
-#include <xen/init.h>
-#include <xen/lib.h>
-#include <xen/string.h>
-#include <xen/earlycpio.h>
-
-#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1))
-#define PTR_ALIGN(p, a)         ((typeof(p))ALIGN((unsigned long)(p), (a)))
-
-enum cpio_fields {
-	C_MAGIC,
-	C_INO,
-	C_MODE,
-	C_UID,
-	C_GID,
-	C_NLINK,
-	C_MTIME,
-	C_FILESIZE,
-	C_MAJ,
-	C_MIN,
-	C_RMAJ,
-	C_RMIN,
-	C_NAMESIZE,
-	C_CHKSUM,
-	C_NFIELDS
-};
-
-/**
- * cpio_data find_cpio_data - Search for files in an uncompressed cpio
- * @path:       The directory to search for, including a slash at the end
- * @data:       Pointer to the the cpio archive or a header inside
- * @len:        Remaining length of the cpio based on data pointer
- *
- * @return:     struct cpio_data containing the address, length and
- *              filename (with the directory path cut off) of the found file.
- *              If you search for a filename and not for files in a directory,
- *              pass the absolute path of the filename in the cpio and make sure
- *              the match returned an empty filename string.
- */
-
-struct cpio_data __init find_cpio_data(const char *path, void *data, size_t len)
-{
-	const size_t cpio_header_len = 8*C_NFIELDS - 2;
-	struct cpio_data cd = { NULL, 0, "" };
-	const char *p, *dptr, *nptr;
-	unsigned int ch[C_NFIELDS], *chp, v;
-	unsigned char c, x;
-	size_t mypathsize = strlen(path);
-	int i, j;
-
-	p = data;
-
-	while (len > cpio_header_len) {
-		if (!*p) {
-			/* All cpio headers need to be 4-byte aligned */
-			p += 4;
-			len -= 4;
-			continue;
-		}
-
-		j = 6;		/* The magic field is only 6 characters */
-		chp = ch;
-		for (i = C_NFIELDS; i; i--) {
-			v = 0;
-			while (j--) {
-				v <<= 4;
-				c = *p++;
-
-				x = c - '0';
-				if (x < 10) {
-					v += x;
-					continue;
-				}
-
-				x = (c | 0x20) - 'a';
-				if (x < 6) {
-					v += x + 10;
-					continue;
-				}
-
-				goto quit; /* Invalid hexadecimal */
-			}
-			*chp++ = v;
-			j = 8;	/* All other fields are 8 characters */
-		}
-
-		if ((ch[C_MAGIC] - 0x070701) > 1)
-			goto quit; /* Invalid magic */
-
-		len -= cpio_header_len;
-
-		dptr = PTR_ALIGN(p + ch[C_NAMESIZE], 4);
-		nptr = PTR_ALIGN(dptr + ch[C_FILESIZE], 4);
-
-		if (nptr > p + len || dptr < p || nptr < dptr)
-			goto quit; /* Buffer overrun */
-
-		if ((ch[C_MODE] & 0170000) == 0100000 &&
-		    ch[C_NAMESIZE] >= mypathsize &&
-		    !memcmp(p, path, mypathsize)) {
-			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
-				printk(
-				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
-				p, MAX_CPIO_FILE_NAME);
-			}
-			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
-
-			cd.data = (void *)dptr;
-			cd.size = ch[C_FILESIZE];
-			return cd; /* Found it! */
-		}
-		len -= (nptr - p);
-		p = nptr;
-	}
-
-quit:
-	return cd;
-}
-
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index efca830d92..3b0137902c 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_X86) += x86/
 lib-y += bsearch.o
 lib-y += ctors.o
 lib-y += ctype.o
+lib-y += earlycpio.init.o
 lib-y += find-next-bit.o
 lib-y += generic-ffsl.o
 lib-y += generic-flsl.o
diff --git a/xen/lib/earlycpio.c b/xen/lib/earlycpio.c
new file mode 100644
index 0000000000..6c76307c25
--- /dev/null
+++ b/xen/lib/earlycpio.c
@@ -0,0 +1,145 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2012 Intel Corporation; author H. Peter Anvin
+ *
+ *   This file is part of the Linux kernel, and is made available
+ *   under the terms of the GNU General Public License version 2, as
+ *   published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope it will be useful, but
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *   General Public License for more details.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * earlycpio.c
+ *
+ * Find a specific cpio member; must precede any compressed content.
+ * This is used to locate data items in the initramfs used by the
+ * kernel itself during early boot (before the main initramfs is
+ * decompressed.)  It is the responsibility of the initramfs creator
+ * to ensure that these items are uncompressed at the head of the
+ * blob.  Depending on the boot loader or package tool that may be a
+ * separate file or part of the same file.
+ */
+
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/string.h>
+#include <xen/earlycpio.h>
+
+#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1))
+#define PTR_ALIGN(p, a)         ((typeof(p))ALIGN((unsigned long)(p), (a)))
+
+enum cpio_fields {
+	C_MAGIC,
+	C_INO,
+	C_MODE,
+	C_UID,
+	C_GID,
+	C_NLINK,
+	C_MTIME,
+	C_FILESIZE,
+	C_MAJ,
+	C_MIN,
+	C_RMAJ,
+	C_RMIN,
+	C_NAMESIZE,
+	C_CHKSUM,
+	C_NFIELDS
+};
+
+/**
+ * cpio_data find_cpio_data - Search for files in an uncompressed cpio
+ * @path:       The directory to search for, including a slash at the end
+ * @data:       Pointer to the the cpio archive or a header inside
+ * @len:        Remaining length of the cpio based on data pointer
+ *
+ * @return:     struct cpio_data containing the address, length and
+ *              filename (with the directory path cut off) of the found file.
+ *              If you search for a filename and not for files in a directory,
+ *              pass the absolute path of the filename in the cpio and make sure
+ *              the match returned an empty filename string.
+ */
+
+struct cpio_data __init find_cpio_data(const char *path, void *data, size_t len)
+{
+	const size_t cpio_header_len = 8*C_NFIELDS - 2;
+	struct cpio_data cd = { NULL, 0, "" };
+	const char *p, *dptr, *nptr;
+	unsigned int ch[C_NFIELDS], *chp, v;
+	unsigned char c, x;
+	size_t mypathsize = strlen(path);
+	int i, j;
+
+	p = data;
+
+	while (len > cpio_header_len) {
+		if (!*p) {
+			/* All cpio headers need to be 4-byte aligned */
+			p += 4;
+			len -= 4;
+			continue;
+		}
+
+		j = 6;		/* The magic field is only 6 characters */
+		chp = ch;
+		for (i = C_NFIELDS; i; i--) {
+			v = 0;
+			while (j--) {
+				v <<= 4;
+				c = *p++;
+
+				x = c - '0';
+				if (x < 10) {
+					v += x;
+					continue;
+				}
+
+				x = (c | 0x20) - 'a';
+				if (x < 6) {
+					v += x + 10;
+					continue;
+				}
+
+				goto quit; /* Invalid hexadecimal */
+			}
+			*chp++ = v;
+			j = 8;	/* All other fields are 8 characters */
+		}
+
+		if ((ch[C_MAGIC] - 0x070701) > 1)
+			goto quit; /* Invalid magic */
+
+		len -= cpio_header_len;
+
+		dptr = PTR_ALIGN(p + ch[C_NAMESIZE], 4);
+		nptr = PTR_ALIGN(dptr + ch[C_FILESIZE], 4);
+
+		if (nptr > p + len || dptr < p || nptr < dptr)
+			goto quit; /* Buffer overrun */
+
+		if ((ch[C_MODE] & 0170000) == 0100000 &&
+		    ch[C_NAMESIZE] >= mypathsize &&
+		    !memcmp(p, path, mypathsize)) {
+			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
+				printk(
+				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
+				p, MAX_CPIO_FILE_NAME);
+			}
+			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
+
+			cd.data = (void *)dptr;
+			cd.size = ch[C_FILESIZE];
+			return cd; /* Found it! */
+		}
+		len -= (nptr - p);
+		p = nptr;
+	}
+
+quit:
+	return cd;
+}
+
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 22 23:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Jan 2026 23:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1211935.1523310 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vj4LL-0006Ef-98; Thu, 22 Jan 2026 23:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1211935.1523310; Thu, 22 Jan 2026 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 1vj4LL-0006EY-6S; Thu, 22 Jan 2026 23:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1211935;
 Thu, 22 Jan 2026 23: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 1vj4LK-0006ES-9G
 for xen-changelog@lists.xenproject.org; Thu, 22 Jan 2026 23: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 1vj4LK-00G50o-1S
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 23:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vj4LK-00FBWW-0B
 for xen-changelog@lists.xenproject.org;
 Thu, 22 Jan 2026 23: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=L/fnNTxzy1iht5Xr3PGP50o5O1R9QX8uMlWdyVrlNwg=; b=ON/xW33VoI7yYxmfU+p5TwIcqT
	NqWWRtGJjzatNGQkbM0TDc/5i1+aFnaPUhOhdVC7bZ/MfE1S6efhLw2K8UVJddDp981hyb9RddIjn
	N8rnhvBHO0Wtw4Iv1/0fzk//zPD13OKsNs8atKCWTU5kRJMMQbnCzT7HwYD5ljnejZ70=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] earlycpio: lib-ify earlycpio.c
Message-Id: <E1vj4LK-00FBWW-0B@xenbits.xenproject.org>
Date: Thu, 22 Jan 2026 23:44:02 +0000

commit f6cd299be9d344e94e914e2a7f522bcfb40204a6
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Wed Jan 21 16:47:55 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Jan 22 19:42:36 2026 +0000

    earlycpio: lib-ify earlycpio.c
    
    It's only used for microcode loading on x86. By lib-ifying it, it will be
    discarded automatically by the linker when CONFIG_MICROCODE_LOADING=n.
    
    Update the path in exclude-list.json, as the code is still not clean.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misra/exclude-list.json |   8 +--
 xen/common/Makefile          |   2 +-
 xen/common/earlycpio.c       | 145 -------------------------------------------
 xen/lib/Makefile             |   1 +
 xen/lib/earlycpio.c          | 145 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 151 insertions(+), 150 deletions(-)

diff --git a/docs/misra/exclude-list.json b/docs/misra/exclude-list.json
index 388397dd3b..2b874dfd3b 100644
--- a/docs/misra/exclude-list.json
+++ b/docs/misra/exclude-list.json
@@ -121,10 +121,6 @@
             "rel_path": "common/bunzip2.c",
             "comment": "Imported from Linux, ignore for now"
         },
-        {
-            "rel_path": "common/earlycpio.c",
-            "comment": "Imported from Linux, ignore for now"
-        },
         {
             "rel_path": "common/gzip/*",
             "comment": "Imported from Linux, ignore for now"
@@ -225,6 +221,10 @@
             "rel_path": "include/xen/decompress.h",
             "comment": "Imported from Linux, ignore for now"
         },
+        {
+            "rel_path": "lib/earlycpio.c",
+            "comment": "Imported from Linux, ignore for now"
+        },
         {
             "rel_path": "lib/find-next-bit.c",
             "comment": "Imported from Linux, ignore for now"
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 92c97d641e..4fc0c15088 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -65,7 +65,7 @@ obj-y += wait.o
 obj-bin-y += warning.init.o
 obj-y += xmalloc_tlsf.o
 
-obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 unzstd earlycpio,$(n).init.o)
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 unzstd,$(n).init.o)
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o memory.o multicall.o xlat.o)
 
diff --git a/xen/common/earlycpio.c b/xen/common/earlycpio.c
deleted file mode 100644
index 6c76307c25..0000000000
--- a/xen/common/earlycpio.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- *   Copyright 2012 Intel Corporation; author H. Peter Anvin
- *
- *   This file is part of the Linux kernel, and is made available
- *   under the terms of the GNU General Public License version 2, as
- *   published by the Free Software Foundation.
- *
- *   This program is distributed in the hope it will be useful, but
- *   WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *   General Public License for more details.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * earlycpio.c
- *
- * Find a specific cpio member; must precede any compressed content.
- * This is used to locate data items in the initramfs used by the
- * kernel itself during early boot (before the main initramfs is
- * decompressed.)  It is the responsibility of the initramfs creator
- * to ensure that these items are uncompressed at the head of the
- * blob.  Depending on the boot loader or package tool that may be a
- * separate file or part of the same file.
- */
-
-#include <xen/init.h>
-#include <xen/lib.h>
-#include <xen/string.h>
-#include <xen/earlycpio.h>
-
-#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1))
-#define PTR_ALIGN(p, a)         ((typeof(p))ALIGN((unsigned long)(p), (a)))
-
-enum cpio_fields {
-	C_MAGIC,
-	C_INO,
-	C_MODE,
-	C_UID,
-	C_GID,
-	C_NLINK,
-	C_MTIME,
-	C_FILESIZE,
-	C_MAJ,
-	C_MIN,
-	C_RMAJ,
-	C_RMIN,
-	C_NAMESIZE,
-	C_CHKSUM,
-	C_NFIELDS
-};
-
-/**
- * cpio_data find_cpio_data - Search for files in an uncompressed cpio
- * @path:       The directory to search for, including a slash at the end
- * @data:       Pointer to the the cpio archive or a header inside
- * @len:        Remaining length of the cpio based on data pointer
- *
- * @return:     struct cpio_data containing the address, length and
- *              filename (with the directory path cut off) of the found file.
- *              If you search for a filename and not for files in a directory,
- *              pass the absolute path of the filename in the cpio and make sure
- *              the match returned an empty filename string.
- */
-
-struct cpio_data __init find_cpio_data(const char *path, void *data, size_t len)
-{
-	const size_t cpio_header_len = 8*C_NFIELDS - 2;
-	struct cpio_data cd = { NULL, 0, "" };
-	const char *p, *dptr, *nptr;
-	unsigned int ch[C_NFIELDS], *chp, v;
-	unsigned char c, x;
-	size_t mypathsize = strlen(path);
-	int i, j;
-
-	p = data;
-
-	while (len > cpio_header_len) {
-		if (!*p) {
-			/* All cpio headers need to be 4-byte aligned */
-			p += 4;
-			len -= 4;
-			continue;
-		}
-
-		j = 6;		/* The magic field is only 6 characters */
-		chp = ch;
-		for (i = C_NFIELDS; i; i--) {
-			v = 0;
-			while (j--) {
-				v <<= 4;
-				c = *p++;
-
-				x = c - '0';
-				if (x < 10) {
-					v += x;
-					continue;
-				}
-
-				x = (c | 0x20) - 'a';
-				if (x < 6) {
-					v += x + 10;
-					continue;
-				}
-
-				goto quit; /* Invalid hexadecimal */
-			}
-			*chp++ = v;
-			j = 8;	/* All other fields are 8 characters */
-		}
-
-		if ((ch[C_MAGIC] - 0x070701) > 1)
-			goto quit; /* Invalid magic */
-
-		len -= cpio_header_len;
-
-		dptr = PTR_ALIGN(p + ch[C_NAMESIZE], 4);
-		nptr = PTR_ALIGN(dptr + ch[C_FILESIZE], 4);
-
-		if (nptr > p + len || dptr < p || nptr < dptr)
-			goto quit; /* Buffer overrun */
-
-		if ((ch[C_MODE] & 0170000) == 0100000 &&
-		    ch[C_NAMESIZE] >= mypathsize &&
-		    !memcmp(p, path, mypathsize)) {
-			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
-				printk(
-				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
-				p, MAX_CPIO_FILE_NAME);
-			}
-			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
-
-			cd.data = (void *)dptr;
-			cd.size = ch[C_FILESIZE];
-			return cd; /* Found it! */
-		}
-		len -= (nptr - p);
-		p = nptr;
-	}
-
-quit:
-	return cd;
-}
-
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index efca830d92..3b0137902c 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_X86) += x86/
 lib-y += bsearch.o
 lib-y += ctors.o
 lib-y += ctype.o
+lib-y += earlycpio.init.o
 lib-y += find-next-bit.o
 lib-y += generic-ffsl.o
 lib-y += generic-flsl.o
diff --git a/xen/lib/earlycpio.c b/xen/lib/earlycpio.c
new file mode 100644
index 0000000000..6c76307c25
--- /dev/null
+++ b/xen/lib/earlycpio.c
@@ -0,0 +1,145 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2012 Intel Corporation; author H. Peter Anvin
+ *
+ *   This file is part of the Linux kernel, and is made available
+ *   under the terms of the GNU General Public License version 2, as
+ *   published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope it will be useful, but
+ *   WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *   General Public License for more details.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * earlycpio.c
+ *
+ * Find a specific cpio member; must precede any compressed content.
+ * This is used to locate data items in the initramfs used by the
+ * kernel itself during early boot (before the main initramfs is
+ * decompressed.)  It is the responsibility of the initramfs creator
+ * to ensure that these items are uncompressed at the head of the
+ * blob.  Depending on the boot loader or package tool that may be a
+ * separate file or part of the same file.
+ */
+
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/string.h>
+#include <xen/earlycpio.h>
+
+#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1))
+#define PTR_ALIGN(p, a)         ((typeof(p))ALIGN((unsigned long)(p), (a)))
+
+enum cpio_fields {
+	C_MAGIC,
+	C_INO,
+	C_MODE,
+	C_UID,
+	C_GID,
+	C_NLINK,
+	C_MTIME,
+	C_FILESIZE,
+	C_MAJ,
+	C_MIN,
+	C_RMAJ,
+	C_RMIN,
+	C_NAMESIZE,
+	C_CHKSUM,
+	C_NFIELDS
+};
+
+/**
+ * cpio_data find_cpio_data - Search for files in an uncompressed cpio
+ * @path:       The directory to search for, including a slash at the end
+ * @data:       Pointer to the the cpio archive or a header inside
+ * @len:        Remaining length of the cpio based on data pointer
+ *
+ * @return:     struct cpio_data containing the address, length and
+ *              filename (with the directory path cut off) of the found file.
+ *              If you search for a filename and not for files in a directory,
+ *              pass the absolute path of the filename in the cpio and make sure
+ *              the match returned an empty filename string.
+ */
+
+struct cpio_data __init find_cpio_data(const char *path, void *data, size_t len)
+{
+	const size_t cpio_header_len = 8*C_NFIELDS - 2;
+	struct cpio_data cd = { NULL, 0, "" };
+	const char *p, *dptr, *nptr;
+	unsigned int ch[C_NFIELDS], *chp, v;
+	unsigned char c, x;
+	size_t mypathsize = strlen(path);
+	int i, j;
+
+	p = data;
+
+	while (len > cpio_header_len) {
+		if (!*p) {
+			/* All cpio headers need to be 4-byte aligned */
+			p += 4;
+			len -= 4;
+			continue;
+		}
+
+		j = 6;		/* The magic field is only 6 characters */
+		chp = ch;
+		for (i = C_NFIELDS; i; i--) {
+			v = 0;
+			while (j--) {
+				v <<= 4;
+				c = *p++;
+
+				x = c - '0';
+				if (x < 10) {
+					v += x;
+					continue;
+				}
+
+				x = (c | 0x20) - 'a';
+				if (x < 6) {
+					v += x + 10;
+					continue;
+				}
+
+				goto quit; /* Invalid hexadecimal */
+			}
+			*chp++ = v;
+			j = 8;	/* All other fields are 8 characters */
+		}
+
+		if ((ch[C_MAGIC] - 0x070701) > 1)
+			goto quit; /* Invalid magic */
+
+		len -= cpio_header_len;
+
+		dptr = PTR_ALIGN(p + ch[C_NAMESIZE], 4);
+		nptr = PTR_ALIGN(dptr + ch[C_FILESIZE], 4);
+
+		if (nptr > p + len || dptr < p || nptr < dptr)
+			goto quit; /* Buffer overrun */
+
+		if ((ch[C_MODE] & 0170000) == 0100000 &&
+		    ch[C_NAMESIZE] >= mypathsize &&
+		    !memcmp(p, path, mypathsize)) {
+			if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
+				printk(
+				"File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
+				p, MAX_CPIO_FILE_NAME);
+			}
+			strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME);
+
+			cd.data = (void *)dptr;
+			cd.size = ch[C_FILESIZE];
+			return cd; /* Found it! */
+		}
+		len -= (nptr - p);
+		p = nptr;
+	}
+
+quit:
+	return cd;
+}
+
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 12:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 12:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213678.1524123 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLQt-0000Yh-9W; Mon, 26 Jan 2026 12:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213678.1524123; Mon, 26 Jan 2026 12:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLQt-0000YZ-72; Mon, 26 Jan 2026 12:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1213678;
 Mon, 26 Jan 2026 12:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkLQs-0000YT-1u
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 12:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLQs-004abC-0z
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLQr-002o6m-30
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vs/Z0s61PtBqh7/yVzo4haSVJkIosRPQ7qrNlMdszIk=; b=ZLevYwkFuXdQIsgvsDZi3AzvMp
	xoW5IQm/CkgEeE29+XCRg7kp0/1FXHqOcCcFgHBu8qtA8FRmIVMQUkNpi3qd05RHgM54WgQ91TAnY
	PwP7sqPm9iwHNZm4+GV/pTBiz+SLVhnOtAAJhDVPrjIg2d9HbLLyUv/ZzqaElmCbixrM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] flask: fix gcov build with gcc14+
Message-Id: <E1vkLQr-002o6m-30@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 12:11:01 +0000

commit 7db4509d80242cc03cc7228c50e88248c8eeb02f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 10:34:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 10:34:14 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 165304c133..f3674371ac 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1271,7 +1271,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1342,7 +1345,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1436,7 +1442,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 12:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213679.1524128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLR3-0000aL-B9; Mon, 26 Jan 2026 12:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213679.1524128; Mon, 26 Jan 2026 12:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLR3-0000aD-8R; Mon, 26 Jan 2026 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1213679;
 Mon, 26 Jan 2026 12:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkLR2-0000a5-4q
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 12:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLR2-004abf-1S
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLR2-002o7z-04
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m/Y30caKGnAKRk5ENeaw97ndRQgoM0uI05dRbhpBUGg=; b=6priiVjhnp5AdqapfAQdw08FNt
	RYI875mwltVmN6ZlM6OBSjTbyvGlSsA7aYpmq7jHlIlVSJdFzIBV9Bj4xH/WqVrYcT739FGzM6+15
	grvvsqL6+EcTxOg83RN84yVqe+YJ/7GuEx9Q7XGPCQjoKar2VL/uq3JVSCHvSVMhBwBM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] symbols: ensure sorting by value yields reproducible outcome
Message-Id: <E1vkLR2-002o7z-04@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 12:11:12 +0000

commit af3466ddd6490e2ff634bfdaca5a40725b466c2a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:49:06 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:49:06 2026 +0100

    symbols: ensure sorting by value yields reproducible outcome
    
    qsort() implementations have freedom towards actions taken when two items
    compare equal. The latest with the introduction of fake "end" symbols,
    inconsistent sorting between the 1st and 2nd run can lead to extra "end"
    symbols in one of the runs, making the resulting symbol table partly
    unusable. (Note in particular that --warn-dup or --error-dup are passed
    only on the 2nd run, and only for xen.syms, and that option has the effect
    of doing a name sort ahead of doing the address sort. I.e. the inputs to
    the 2nd qsort() are pretty different between the 1st and 2nd runs.)
    
    Make the result stable by using original order to break ties.
    
    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>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/tools/symbols.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 0af8a1e91c..a2b46d655c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -40,6 +40,7 @@ struct sym_entry {
 	unsigned long long addr;
 	unsigned long size;
 	unsigned int len;
+	unsigned int orig_idx;
 	unsigned char *sym;
 	char *orig_symbol;
 	unsigned int addr_idx;
@@ -247,6 +248,9 @@ static void read_map(FILE *in)
 				exit (1);
 			}
 		}
+
+		table[table_cnt].orig_idx = table_cnt;
+
 		if (read_symbol(in, &table[table_cnt]) == 0)
 			table_cnt++;
 	}
@@ -639,7 +643,11 @@ static int compare_value(const void *p1, const void *p2)
 		return -1;
 	if (isupper(*sym2->sym))
 		return +1;
-	return 0;
+
+	/* Explicitly request "keep original order" otherwise. */
+	if (sym1->orig_idx < sym2->orig_idx)
+		return -1;
+	return sym1->orig_idx > sym2->orig_idx;
 }
 
 static int compare_name(const void *p1, const void *p2)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 12:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213680.1524132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLRD-0000ch-Cj; Mon, 26 Jan 2026 12:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213680.1524132; Mon, 26 Jan 2026 12:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLRD-0000cZ-9p; Mon, 26 Jan 2026 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1213680;
 Mon, 26 Jan 2026 12:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkLRC-0000cQ-8B
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 12:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLRC-004abl-1o
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLRC-002o95-0Y
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9WSLfB0py6VrU5FBeR0IkxukDFh6U6o9PoahjPEpos8=; b=7Gw0h3NSPpBXXaCy5TR9lIhyAl
	zqXzdQNrrPwSlWDb6l5qi0VzuWl8w40zortcwTlvUQP/S/1KcY6E0jly7XWVVVOOWVhvS+yN9d52G
	j0mMQz51Dj2h17JvU9KmHiXI1/pKUalTy/M5Bwd9qemmBb6yB6xiVav0K4UZ397CG818=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] symbols: don't omit "end" symbols upon mixed code / data aliases
Message-Id: <E1vkLRC-002o95-0Y@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 12:11:22 +0000

commit af2dbe260f3d5bdd5d47dacc87bfcc449bf91c24
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:49:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:49:31 2026 +0100

    symbols: don't omit "end" symbols upon mixed code / data aliases
    
    At the example of _sinitext - that symbol has four aliases on x86:
    __init_begin, __2M_init_start, __2M_rodata_end, and whatever the first
    function in .init.text. With the GNU toolchain all of them are marked
    'T' or 't'. With Clang/LLVM, however, some are marked 'r'. Since, to
    save space, we want fake "end" symbols only for text, right now
    want_symbol_end() has a respective check. That is getting in the way,
    however, when the final of those symbols is 'r'. Remove the check and
    instead zap the size for anything that is non-code.
    
    Fixes: 6eede548df21 ('symbols: avoid emitting "end" symbols for data items')
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/tools/symbols.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index a2b46d655c..509394d5a4 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -165,6 +165,10 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	else if (str[0] == '$')
 		goto skip_tail;
 
+	/* We want fake "end" symbols only for text / code. */
+	if (toupper((uint8_t)stype) != 'T')
+		s->size = 0;
+
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
 	s->len = strlen(str) + 1;
@@ -316,7 +320,6 @@ 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 Mon Jan 26 12:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 12:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213681.1524135 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLRN-0000f1-De; Mon, 26 Jan 2026 12:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213681.1524135; Mon, 26 Jan 2026 12:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLRN-0000eu-BC; Mon, 26 Jan 2026 12:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1213681;
 Mon, 26 Jan 2026 12:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkLRM-0000eo-B2
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 12:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLRM-004abq-25
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLRM-002o9z-0u
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O2ddoqfvmoKW7aoGrFUcouhy6Igk8Sx2NLqvI5jMbIk=; b=Ak1U6NgbrQBmTqcpEGYSOvavtZ
	c3lChNmjy+s8NJrXTqcJg1NX185v78XhXtX4sZGzxb1PLi30DFoAwo0Ft6u+3B/vk66U75D0a5vCk
	vuKq+LfN5qzWSeKBTpMfDYt5yK+a6K2UR/EqH+tFaz+LMYActXDxdJi7IeOoXiOdGKzs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cpufreq: eliminate cpufreq_drv_data[]
Message-Id: <E1vkLRM-002o9z-0u@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 12:11:32 +0000

commit 887cccf03e6ab51254eb60b5ad5cf62c4aa8fe93
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:49:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:49:49 2026 +0100

    cpufreq: eliminate cpufreq_drv_data[]
    
    Possibly many slots of it may be unused (all of them when the HWP or CPPC
    drivers are in use), as it's always strictly associated with the CPU
    recorded in a policy (irrespective of that CPU intermediately being taken
    offline). It is shared by all CPUs sharing a policy. We could therefore
    put the respective pointers in struct cpufreq_policy, but even that level
    of indirection is pointless. Embed the driver data structure directly in
    the policy one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/acpi.c     | 61 +++++++++++-------------------------
 xen/arch/x86/acpi/cpufreq/cpufreq.c  |  2 --
 xen/arch/x86/acpi/cpufreq/powernow.c | 52 +++++++++---------------------
 xen/include/acpi/cpufreq/cpufreq.h   |  6 ++--
 4 files changed, 37 insertions(+), 84 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/acpi.c b/xen/arch/x86/acpi/cpufreq/acpi.c
index 2d08c3094f..d0ca660db1 100644
--- a/xen/arch/x86/acpi/cpufreq/acpi.c
+++ b/xen/arch/x86/acpi/cpufreq/acpi.c
@@ -174,17 +174,18 @@ static u32 get_cur_val(const cpumask_t *mask)
         return 0;
 
     policy = per_cpu(cpufreq_cpu_policy, cpu);
-    if (!policy || !cpufreq_drv_data[policy->cpu])
+    if ( !policy )
         return 0;
 
-    switch (cpufreq_drv_data[policy->cpu]->arch_cpu_flags) {
+    switch ( policy->drv_data.acpi.arch_cpu_flags )
+    {
     case SYSTEM_INTEL_MSR_CAPABLE:
         cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
         cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
         break;
     case SYSTEM_IO_CAPABLE:
         cmd.type = SYSTEM_IO_CAPABLE;
-        perf = cpufreq_drv_data[policy->cpu]->acpi_data;
+        perf = policy->drv_data.acpi.acpi_data;
         cmd.addr.io.port = perf->control_register.address;
         cmd.addr.io.bit_width = perf->control_register.bit_width;
         break;
@@ -210,9 +211,8 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
     if (!policy)
         return 0;
 
-    data = cpufreq_drv_data[policy->cpu];
-    if (unlikely(data == NULL ||
-        data->acpi_data == NULL || data->freq_table == NULL))
+    data = &policy->drv_data.acpi;
+    if ( !data->acpi_data || !data->freq_table )
         return 0;
 
     return extract_freq(get_cur_val(cpumask_of(cpu)), data);
@@ -252,7 +252,7 @@ static int cf_check acpi_cpufreq_target(
     struct cpufreq_policy *policy,
     unsigned int target_freq, unsigned int relation)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     struct processor_performance *perf;
     struct cpufreq_freqs freqs;
     cpumask_t online_policy_cpus;
@@ -262,10 +262,8 @@ static int cf_check acpi_cpufreq_target(
     unsigned int j;
     int result = 0;
 
-    if (unlikely(data == NULL ||
-        data->acpi_data == NULL || data->freq_table == NULL)) {
+    if ( !data->acpi_data || !data->freq_table )
         return -ENODEV;
-    }
 
     if (policy->turbo == CPUFREQ_TURBO_DISABLED)
         if (target_freq > policy->cpuinfo.second_max_freq)
@@ -331,11 +329,9 @@ static int cf_check acpi_cpufreq_target(
 
 static int cf_check acpi_cpufreq_verify(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data;
     struct processor_performance *perf;
 
-    if (!policy || !(data = cpufreq_drv_data[policy->cpu]) ||
-        !processor_pminfo[policy->cpu])
+    if ( !policy || !processor_pminfo[policy->cpu] )
         return -EINVAL;
 
     perf = &processor_pminfo[policy->cpu]->perf;
@@ -343,7 +339,8 @@ static int cf_check acpi_cpufreq_verify(struct cpufreq_policy *policy)
     cpufreq_verify_within_limits(policy, 0,
         perf->states[perf->platform_limit].core_frequency * 1000);
 
-    return cpufreq_frequency_table_verify(policy, data->freq_table);
+    return cpufreq_frequency_table_verify(policy,
+                                          policy->drv_data.acpi.freq_table);
 }
 
 static unsigned long
@@ -379,17 +376,11 @@ static int cf_check acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
     unsigned int i;
     unsigned int valid_states = 0;
     unsigned int cpu = policy->cpu;
-    struct acpi_cpufreq_data *data;
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     unsigned int result = 0;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
     struct processor_performance *perf;
 
-    data = xzalloc(struct acpi_cpufreq_data);
-    if (!data)
-        return -ENOMEM;
-
-    cpufreq_drv_data[cpu] = data;
-
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
     perf = data->acpi_data;
@@ -406,23 +397,18 @@ static int cf_check acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
         if (cpufreq_verbose)
             printk("xen_pminfo: @acpi_cpufreq_cpu_init,"
                    "HARDWARE addr space\n");
-        if (!cpu_has(c, X86_FEATURE_EIST)) {
-            result = -ENODEV;
-            goto err_unreg;
-        }
+        if ( !cpu_has(c, X86_FEATURE_EIST) )
+            return -ENODEV;
         data->arch_cpu_flags = SYSTEM_INTEL_MSR_CAPABLE;
         break;
     default:
-        result = -ENODEV;
-        goto err_unreg;
+        return -ENODEV;
     }
 
     data->freq_table = xmalloc_array(struct cpufreq_frequency_table,
                                     (perf->state_count+1));
-    if (!data->freq_table) {
-        result = -ENOMEM;
-        goto err_unreg;
-    }
+    if ( !data->freq_table )
+        return -ENOMEM;
 
     /* detect transition latency */
     policy->cpuinfo.transition_latency = 0;
@@ -480,23 +466,14 @@ static int cf_check acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
     return result;
 
 err_freqfree:
-    xfree(data->freq_table);
-err_unreg:
-    xfree(data);
-    cpufreq_drv_data[cpu] = NULL;
+    XFREE(data->freq_table);
 
     return result;
 }
 
 static int cf_check acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
-
-    if (data) {
-        cpufreq_drv_data[policy->cpu] = NULL;
-        xfree(data->freq_table);
-        xfree(data);
-    }
+    XFREE(policy->drv_data.acpi.freq_table);
 
     return 0;
 }
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 7d522f84ac..5740c0d438 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -35,8 +35,6 @@
 
 #include <acpi/cpufreq/cpufreq.h>
 
-struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
-
 struct perf_pair {
     union {
         struct {
diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index 71ac0b4526..beab6cac36 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -84,16 +84,14 @@ static int cf_check powernow_cpufreq_target(
     struct cpufreq_policy *policy,
     unsigned int target_freq, unsigned int relation)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     struct processor_performance *perf;
     unsigned int next_state; /* Index into freq_table */
     unsigned int next_perf_state; /* Index into perf table */
     int result;
 
-    if (unlikely(data == NULL ||
-        data->acpi_data == NULL || data->freq_table == NULL)) {
+    if ( !data->acpi_data || !data->freq_table )
         return -ENODEV;
-    }
 
     perf = data->acpi_data;
     result = cpufreq_frequency_table_target(policy,
@@ -187,11 +185,9 @@ static void cf_check get_cpu_data(void *arg)
 
 static int cf_check powernow_cpufreq_verify(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data;
     struct processor_performance *perf;
 
-    if (!policy || !(data = cpufreq_drv_data[policy->cpu]) ||
-        !processor_pminfo[policy->cpu])
+    if ( !policy || !processor_pminfo[policy->cpu] )
         return -EINVAL;
 
     perf = &processor_pminfo[policy->cpu]->perf;
@@ -199,7 +195,8 @@ static int cf_check powernow_cpufreq_verify(struct cpufreq_policy *policy)
     cpufreq_verify_within_limits(policy, 0, 
         perf->states[perf->platform_limit].core_frequency * 1000);
 
-    return cpufreq_frequency_table_verify(policy, data->freq_table);
+    return cpufreq_frequency_table_verify(policy,
+                                          policy->drv_data.acpi.freq_table);
 }
 
 static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
@@ -207,18 +204,12 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     unsigned int i;
     unsigned int valid_states = 0;
     unsigned int cpu = policy->cpu;
-    struct acpi_cpufreq_data *data;
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     unsigned int result = 0;
     struct processor_performance *perf;
     struct amd_cpu_data info;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
 
-    data = xzalloc(struct acpi_cpufreq_data);
-    if (!data)
-        return -ENOMEM;
-
-    cpufreq_drv_data[cpu] = data;
-
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
     info.perf = perf = data->acpi_data;
@@ -230,8 +221,7 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
         if (cpumask_weight(policy->cpus) != 1) {
             printk(XENLOG_WARNING "Unsupported sharing type %d (%u CPUs)\n",
                    policy->shared_type, cpumask_weight(policy->cpus));
-            result = -ENODEV;
-            goto err_unreg;
+            return -ENODEV;
         }
     } else {
         cpumask_copy(policy->cpus, cpumask_of(cpu));
@@ -240,21 +230,16 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     /* capability check */
     if (perf->state_count <= 1) {
         printk("No P-States\n");
-        result = -ENODEV;
-        goto err_unreg;
+        return -ENODEV;
     }
 
-    if (perf->control_register.space_id != perf->status_register.space_id) {
-        result = -ENODEV;
-        goto err_unreg;
-    }
+    if ( perf->control_register.space_id != perf->status_register.space_id )
+        return -ENODEV;
 
     data->freq_table = xmalloc_array(struct cpufreq_frequency_table, 
                                     (perf->state_count+1));
-    if (!data->freq_table) {
-        result = -ENOMEM;
-        goto err_unreg;
-    }
+    if ( !data->freq_table )
+        return -ENOMEM;
 
     /* detect transition latency */
     policy->cpuinfo.transition_latency = 0;
@@ -300,23 +285,14 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     return result;
 
 err_freqfree:
-    xfree(data->freq_table);
-err_unreg:
-    xfree(data);
-    cpufreq_drv_data[cpu] = NULL;
+    XFREE(data->freq_table);
 
     return result;
 }
 
 static int cf_check powernow_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
-
-    if (data) {
-        cpufreq_drv_data[policy->cpu] = NULL;
-        xfree(data->freq_table);
-        xfree(data);
-    }
+    XFREE(policy->drv_data.acpi.freq_table);
 
     return 0;
 }
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 3efa71d442..f4b4f06613 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -38,8 +38,6 @@ struct acpi_cpufreq_data {
     unsigned int arch_cpu_flags;
 };
 
-extern struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
-
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
@@ -82,6 +80,10 @@ struct cpufreq_policy {
                                  * -1 for disable, 1 for enabled
                                  * See CPUFREQ_TURBO_* below for defines */
     unsigned int        policy; /* CPUFREQ_POLICY_* */
+
+    union {
+        struct acpi_cpufreq_data acpi;
+    }                   drv_data;
 };
 DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 12:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 12:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213682.1524141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkLRY-0000hD-GO; Mon, 26 Jan 2026 12:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213682.1524141; Mon, 26 Jan 2026 12: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 1vkLRY-0000h4-Ci; Mon, 26 Jan 2026 12:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1213682;
 Mon, 26 Jan 2026 12:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkLRW-0000gw-Da
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 12:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLRW-004abx-2L
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkLRW-002oAR-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 12:11:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YuK/fmZJWLBlD1x1necwZS6203x+53Fo6c+UDNRxwEw=; b=Nx012m1BXEcvLoXOk/rD+pkuU1
	OHqQNTHPsbHTXiCu1s72K3JFOzowTzaa2+ay+p8PfNMgtjsTjvP0QrajeacX4QtD+cThyqhfWwZqM
	Yv1xHviG0ODt1sLrk2S5jtoCWEbgYB5qIutxfzfA+UpqhG2fapKH/uTUnceZhBXZQkak=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] kconfig: adjust NR_CPUS defaults
Message-Id: <E1vkLRW-002oAR-1A@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 12:11:42 +0000

commit 9f493ad08e08f06dce0d17357f0ebb26f6b1652b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:50:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:50:10 2026 +0100

    kconfig: adjust NR_CPUS defaults
    
    Discussion of a RISC-V change revealed that for PPC and RISC-V we don't
    really set any default, but rather rely on internals of kconfig picking
    the lowest of the permitted values in such a case. Let's make this
    explicit, requiring architectures that mean to permit SMP by default to
    explicitly record some sensible value here.
    
    Leverage the adjustment to the "1" case to simplify all subsequent ones.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
index 9f4835e37f..f9230bfaf8 100644
--- a/xen/arch/Kconfig
+++ b/xen/arch/Kconfig
@@ -9,11 +9,11 @@ config NR_CPUS
 	range 1 1 if ARM && MPU
 	range 1 16383
 	default "256" if X86
-	default "1" if ARM && MPU
-	default "8" if ARM && RCAR3
-	default "4" if ARM && QEMU
-	default "4" if ARM && MPSOC
-	default "128" if ARM
+	default "1" if !ARM || MPU
+	default "8" if RCAR3
+	default "4" if QEMU
+	default "4" if MPSOC
+	default "128"
 	help
 	  Controls the build-time size of various arrays and bitmaps
 	  associated with multiple-cpu management.  It is the upper bound of
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 13:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 13:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213706.1524164 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkMMw-0000gw-Sv; Mon, 26 Jan 2026 13:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213706.1524164; Mon, 26 Jan 2026 13: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 1vkMMw-0000gp-Pt; Mon, 26 Jan 2026 13:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1213706;
 Mon, 26 Jan 2026 13: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 1vkMMv-0000gj-T6
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 13: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 1vkMMw-004blQ-0T
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 13:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkMMv-002sXE-2K
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 13: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=NpDDCFWHdbZckARUzHK1ejIwQjB1jusCVhe92qSMcBE=; b=51YJpx2oU1VrqUgWuKo44s7uQG
	qsuK31990M+ovtUkK7tb42aIKma7zGBw5VP9HiynP2bAauYSh2/fO4EIhdH2GHISAR6yiIgGIlc4j
	EiFFaXu472iWzFbkHcPlgmT+2Flb4saM5wxS967OsIJDFfZFk8Cm1Fjy3N+pjQNnyRek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] flask: fix gcov build with gcc14+
Message-Id: <E1vkMMv-002sXE-2K@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 13:11:01 +0000

commit 7db4509d80242cc03cc7228c50e88248c8eeb02f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 10:34:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 10:34:14 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 165304c133..f3674371ac 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1271,7 +1271,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1342,7 +1345,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1436,7 +1442,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 13:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213707.1524168 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkMN6-0000iq-UT; Mon, 26 Jan 2026 13:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213707.1524168; Mon, 26 Jan 2026 13:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkMN6-0000ii-RS; Mon, 26 Jan 2026 13:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1213707;
 Mon, 26 Jan 2026 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 1vkMN6-0000iY-1X
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 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 1vkMN6-004blr-0v
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 13:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkMN5-002sXe-2n
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 13: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=PGayDCeVAyNdJOvShlp+0d7eR4xYt1nUX6Lc9G6uh2Y=; b=PRZzU47dzYXMtkLU4N7k9tftVu
	2HBbWQpuTyayDP3Wkl0NrGKZM85idxvUT9KUAZBQ3MU4YGqn6WMxZ1+PMrGILF23bwIWqv5t9fz90
	2LdPl641P4KD4/TiyDzd8tMr1SzIto6HbOI+OjM0OmlOgacsruShLzkzcGNV2C9qiQYY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] symbols: ensure sorting by value yields reproducible outcome
Message-Id: <E1vkMN5-002sXe-2n@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 13:11:11 +0000

commit af3466ddd6490e2ff634bfdaca5a40725b466c2a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:49:06 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:49:06 2026 +0100

    symbols: ensure sorting by value yields reproducible outcome
    
    qsort() implementations have freedom towards actions taken when two items
    compare equal. The latest with the introduction of fake "end" symbols,
    inconsistent sorting between the 1st and 2nd run can lead to extra "end"
    symbols in one of the runs, making the resulting symbol table partly
    unusable. (Note in particular that --warn-dup or --error-dup are passed
    only on the 2nd run, and only for xen.syms, and that option has the effect
    of doing a name sort ahead of doing the address sort. I.e. the inputs to
    the 2nd qsort() are pretty different between the 1st and 2nd runs.)
    
    Make the result stable by using original order to break ties.
    
    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>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/tools/symbols.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 0af8a1e91c..a2b46d655c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -40,6 +40,7 @@ struct sym_entry {
 	unsigned long long addr;
 	unsigned long size;
 	unsigned int len;
+	unsigned int orig_idx;
 	unsigned char *sym;
 	char *orig_symbol;
 	unsigned int addr_idx;
@@ -247,6 +248,9 @@ static void read_map(FILE *in)
 				exit (1);
 			}
 		}
+
+		table[table_cnt].orig_idx = table_cnt;
+
 		if (read_symbol(in, &table[table_cnt]) == 0)
 			table_cnt++;
 	}
@@ -639,7 +643,11 @@ static int compare_value(const void *p1, const void *p2)
 		return -1;
 	if (isupper(*sym2->sym))
 		return +1;
-	return 0;
+
+	/* Explicitly request "keep original order" otherwise. */
+	if (sym1->orig_idx < sym2->orig_idx)
+		return -1;
+	return sym1->orig_idx > sym2->orig_idx;
 }
 
 static int compare_name(const void *p1, const void *p2)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 13:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 13:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213708.1524172 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkMNG-0000ky-VW; Mon, 26 Jan 2026 13:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213708.1524172; Mon, 26 Jan 2026 13:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkMNG-0000ko-Sr; Mon, 26 Jan 2026 13:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1213708;
 Mon, 26 Jan 2026 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 1vkMNG-0000ki-6A
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 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 1vkMNG-004blv-1O
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkMNG-002sYP-00
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 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=hOgxp2iTu4QNsT/PHux/vsAcPn2UIe1azBR4VL56/UI=; b=ppSV1ukFL98Hy9Ziz0nivOVnuN
	Mv/4w/Sqv9029J4iQk/mXLMZu81ngeihYQxGaPlznE2BZlZ9Gbtn4apqgMteywpkwQv8dwc4qZ5RF
	IIxongB69UTt8f3DkMBulhVeLhjDputXyjBbYkYWfv128+Tvps+zLLwvCIb5499VjWeo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] symbols: don't omit "end" symbols upon mixed code / data aliases
Message-Id: <E1vkMNG-002sYP-00@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 13:11:22 +0000

commit af2dbe260f3d5bdd5d47dacc87bfcc449bf91c24
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:49:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:49:31 2026 +0100

    symbols: don't omit "end" symbols upon mixed code / data aliases
    
    At the example of _sinitext - that symbol has four aliases on x86:
    __init_begin, __2M_init_start, __2M_rodata_end, and whatever the first
    function in .init.text. With the GNU toolchain all of them are marked
    'T' or 't'. With Clang/LLVM, however, some are marked 'r'. Since, to
    save space, we want fake "end" symbols only for text, right now
    want_symbol_end() has a respective check. That is getting in the way,
    however, when the final of those symbols is 'r'. Remove the check and
    instead zap the size for anything that is non-code.
    
    Fixes: 6eede548df21 ('symbols: avoid emitting "end" symbols for data items')
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/tools/symbols.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index a2b46d655c..509394d5a4 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -165,6 +165,10 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	else if (str[0] == '$')
 		goto skip_tail;
 
+	/* We want fake "end" symbols only for text / code. */
+	if (toupper((uint8_t)stype) != 'T')
+		s->size = 0;
+
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
 	s->len = strlen(str) + 1;
@@ -316,7 +320,6 @@ 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 Mon Jan 26 13:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213709.1524176 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkMNR-0000nJ-0g; Mon, 26 Jan 2026 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213709.1524176; Mon, 26 Jan 2026 13:11: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 1vkMNQ-0000nB-UN; Mon, 26 Jan 2026 13:11:32 +0000
Received: by outflank-mailman (input) for mailman id 1213709;
 Mon, 26 Jan 2026 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 1vkMNQ-0000n3-6d
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 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 1vkMNQ-004bm5-1e
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkMNQ-002sZG-0U
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 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=v5mBGN86MRS1GLZyQGnmExbubarUsKaEaGxH1HOegIM=; b=pTDPSkBWF+F/HKKATd39siU7F+
	J0gT7wtOsHGBdriD8rKNLKOTJuNZubsHO180HcwU3fRKOH5O6RjFcjANyAdzEOh88y76H7SwaILQH
	iFpAlQ2fLvbsZTE4Cx8sPz3drRnHBly7+RcZRcyIpuWPZKftW8cjCG3sARxdgrkj9ktQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cpufreq: eliminate cpufreq_drv_data[]
Message-Id: <E1vkMNQ-002sZG-0U@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 13:11:32 +0000

commit 887cccf03e6ab51254eb60b5ad5cf62c4aa8fe93
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:49:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:49:49 2026 +0100

    cpufreq: eliminate cpufreq_drv_data[]
    
    Possibly many slots of it may be unused (all of them when the HWP or CPPC
    drivers are in use), as it's always strictly associated with the CPU
    recorded in a policy (irrespective of that CPU intermediately being taken
    offline). It is shared by all CPUs sharing a policy. We could therefore
    put the respective pointers in struct cpufreq_policy, but even that level
    of indirection is pointless. Embed the driver data structure directly in
    the policy one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/acpi.c     | 61 +++++++++++-------------------------
 xen/arch/x86/acpi/cpufreq/cpufreq.c  |  2 --
 xen/arch/x86/acpi/cpufreq/powernow.c | 52 +++++++++---------------------
 xen/include/acpi/cpufreq/cpufreq.h   |  6 ++--
 4 files changed, 37 insertions(+), 84 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/acpi.c b/xen/arch/x86/acpi/cpufreq/acpi.c
index 2d08c3094f..d0ca660db1 100644
--- a/xen/arch/x86/acpi/cpufreq/acpi.c
+++ b/xen/arch/x86/acpi/cpufreq/acpi.c
@@ -174,17 +174,18 @@ static u32 get_cur_val(const cpumask_t *mask)
         return 0;
 
     policy = per_cpu(cpufreq_cpu_policy, cpu);
-    if (!policy || !cpufreq_drv_data[policy->cpu])
+    if ( !policy )
         return 0;
 
-    switch (cpufreq_drv_data[policy->cpu]->arch_cpu_flags) {
+    switch ( policy->drv_data.acpi.arch_cpu_flags )
+    {
     case SYSTEM_INTEL_MSR_CAPABLE:
         cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
         cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
         break;
     case SYSTEM_IO_CAPABLE:
         cmd.type = SYSTEM_IO_CAPABLE;
-        perf = cpufreq_drv_data[policy->cpu]->acpi_data;
+        perf = policy->drv_data.acpi.acpi_data;
         cmd.addr.io.port = perf->control_register.address;
         cmd.addr.io.bit_width = perf->control_register.bit_width;
         break;
@@ -210,9 +211,8 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu)
     if (!policy)
         return 0;
 
-    data = cpufreq_drv_data[policy->cpu];
-    if (unlikely(data == NULL ||
-        data->acpi_data == NULL || data->freq_table == NULL))
+    data = &policy->drv_data.acpi;
+    if ( !data->acpi_data || !data->freq_table )
         return 0;
 
     return extract_freq(get_cur_val(cpumask_of(cpu)), data);
@@ -252,7 +252,7 @@ static int cf_check acpi_cpufreq_target(
     struct cpufreq_policy *policy,
     unsigned int target_freq, unsigned int relation)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     struct processor_performance *perf;
     struct cpufreq_freqs freqs;
     cpumask_t online_policy_cpus;
@@ -262,10 +262,8 @@ static int cf_check acpi_cpufreq_target(
     unsigned int j;
     int result = 0;
 
-    if (unlikely(data == NULL ||
-        data->acpi_data == NULL || data->freq_table == NULL)) {
+    if ( !data->acpi_data || !data->freq_table )
         return -ENODEV;
-    }
 
     if (policy->turbo == CPUFREQ_TURBO_DISABLED)
         if (target_freq > policy->cpuinfo.second_max_freq)
@@ -331,11 +329,9 @@ static int cf_check acpi_cpufreq_target(
 
 static int cf_check acpi_cpufreq_verify(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data;
     struct processor_performance *perf;
 
-    if (!policy || !(data = cpufreq_drv_data[policy->cpu]) ||
-        !processor_pminfo[policy->cpu])
+    if ( !policy || !processor_pminfo[policy->cpu] )
         return -EINVAL;
 
     perf = &processor_pminfo[policy->cpu]->perf;
@@ -343,7 +339,8 @@ static int cf_check acpi_cpufreq_verify(struct cpufreq_policy *policy)
     cpufreq_verify_within_limits(policy, 0,
         perf->states[perf->platform_limit].core_frequency * 1000);
 
-    return cpufreq_frequency_table_verify(policy, data->freq_table);
+    return cpufreq_frequency_table_verify(policy,
+                                          policy->drv_data.acpi.freq_table);
 }
 
 static unsigned long
@@ -379,17 +376,11 @@ static int cf_check acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
     unsigned int i;
     unsigned int valid_states = 0;
     unsigned int cpu = policy->cpu;
-    struct acpi_cpufreq_data *data;
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     unsigned int result = 0;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
     struct processor_performance *perf;
 
-    data = xzalloc(struct acpi_cpufreq_data);
-    if (!data)
-        return -ENOMEM;
-
-    cpufreq_drv_data[cpu] = data;
-
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
     perf = data->acpi_data;
@@ -406,23 +397,18 @@ static int cf_check acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
         if (cpufreq_verbose)
             printk("xen_pminfo: @acpi_cpufreq_cpu_init,"
                    "HARDWARE addr space\n");
-        if (!cpu_has(c, X86_FEATURE_EIST)) {
-            result = -ENODEV;
-            goto err_unreg;
-        }
+        if ( !cpu_has(c, X86_FEATURE_EIST) )
+            return -ENODEV;
         data->arch_cpu_flags = SYSTEM_INTEL_MSR_CAPABLE;
         break;
     default:
-        result = -ENODEV;
-        goto err_unreg;
+        return -ENODEV;
     }
 
     data->freq_table = xmalloc_array(struct cpufreq_frequency_table,
                                     (perf->state_count+1));
-    if (!data->freq_table) {
-        result = -ENOMEM;
-        goto err_unreg;
-    }
+    if ( !data->freq_table )
+        return -ENOMEM;
 
     /* detect transition latency */
     policy->cpuinfo.transition_latency = 0;
@@ -480,23 +466,14 @@ static int cf_check acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
     return result;
 
 err_freqfree:
-    xfree(data->freq_table);
-err_unreg:
-    xfree(data);
-    cpufreq_drv_data[cpu] = NULL;
+    XFREE(data->freq_table);
 
     return result;
 }
 
 static int cf_check acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
-
-    if (data) {
-        cpufreq_drv_data[policy->cpu] = NULL;
-        xfree(data->freq_table);
-        xfree(data);
-    }
+    XFREE(policy->drv_data.acpi.freq_table);
 
     return 0;
 }
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index 7d522f84ac..5740c0d438 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -35,8 +35,6 @@
 
 #include <acpi/cpufreq/cpufreq.h>
 
-struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
-
 struct perf_pair {
     union {
         struct {
diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index 71ac0b4526..beab6cac36 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -84,16 +84,14 @@ static int cf_check powernow_cpufreq_target(
     struct cpufreq_policy *policy,
     unsigned int target_freq, unsigned int relation)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     struct processor_performance *perf;
     unsigned int next_state; /* Index into freq_table */
     unsigned int next_perf_state; /* Index into perf table */
     int result;
 
-    if (unlikely(data == NULL ||
-        data->acpi_data == NULL || data->freq_table == NULL)) {
+    if ( !data->acpi_data || !data->freq_table )
         return -ENODEV;
-    }
 
     perf = data->acpi_data;
     result = cpufreq_frequency_table_target(policy,
@@ -187,11 +185,9 @@ static void cf_check get_cpu_data(void *arg)
 
 static int cf_check powernow_cpufreq_verify(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data;
     struct processor_performance *perf;
 
-    if (!policy || !(data = cpufreq_drv_data[policy->cpu]) ||
-        !processor_pminfo[policy->cpu])
+    if ( !policy || !processor_pminfo[policy->cpu] )
         return -EINVAL;
 
     perf = &processor_pminfo[policy->cpu]->perf;
@@ -199,7 +195,8 @@ static int cf_check powernow_cpufreq_verify(struct cpufreq_policy *policy)
     cpufreq_verify_within_limits(policy, 0, 
         perf->states[perf->platform_limit].core_frequency * 1000);
 
-    return cpufreq_frequency_table_verify(policy, data->freq_table);
+    return cpufreq_frequency_table_verify(policy,
+                                          policy->drv_data.acpi.freq_table);
 }
 
 static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
@@ -207,18 +204,12 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     unsigned int i;
     unsigned int valid_states = 0;
     unsigned int cpu = policy->cpu;
-    struct acpi_cpufreq_data *data;
+    struct acpi_cpufreq_data *data = &policy->drv_data.acpi;
     unsigned int result = 0;
     struct processor_performance *perf;
     struct amd_cpu_data info;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
 
-    data = xzalloc(struct acpi_cpufreq_data);
-    if (!data)
-        return -ENOMEM;
-
-    cpufreq_drv_data[cpu] = data;
-
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
     info.perf = perf = data->acpi_data;
@@ -230,8 +221,7 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
         if (cpumask_weight(policy->cpus) != 1) {
             printk(XENLOG_WARNING "Unsupported sharing type %d (%u CPUs)\n",
                    policy->shared_type, cpumask_weight(policy->cpus));
-            result = -ENODEV;
-            goto err_unreg;
+            return -ENODEV;
         }
     } else {
         cpumask_copy(policy->cpus, cpumask_of(cpu));
@@ -240,21 +230,16 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     /* capability check */
     if (perf->state_count <= 1) {
         printk("No P-States\n");
-        result = -ENODEV;
-        goto err_unreg;
+        return -ENODEV;
     }
 
-    if (perf->control_register.space_id != perf->status_register.space_id) {
-        result = -ENODEV;
-        goto err_unreg;
-    }
+    if ( perf->control_register.space_id != perf->status_register.space_id )
+        return -ENODEV;
 
     data->freq_table = xmalloc_array(struct cpufreq_frequency_table, 
                                     (perf->state_count+1));
-    if (!data->freq_table) {
-        result = -ENOMEM;
-        goto err_unreg;
-    }
+    if ( !data->freq_table )
+        return -ENOMEM;
 
     /* detect transition latency */
     policy->cpuinfo.transition_latency = 0;
@@ -300,23 +285,14 @@ static int cf_check powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     return result;
 
 err_freqfree:
-    xfree(data->freq_table);
-err_unreg:
-    xfree(data);
-    cpufreq_drv_data[cpu] = NULL;
+    XFREE(data->freq_table);
 
     return result;
 }
 
 static int cf_check powernow_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    struct acpi_cpufreq_data *data = cpufreq_drv_data[policy->cpu];
-
-    if (data) {
-        cpufreq_drv_data[policy->cpu] = NULL;
-        xfree(data->freq_table);
-        xfree(data);
-    }
+    XFREE(policy->drv_data.acpi.freq_table);
 
     return 0;
 }
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 3efa71d442..f4b4f06613 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -38,8 +38,6 @@ struct acpi_cpufreq_data {
     unsigned int arch_cpu_flags;
 };
 
-extern struct acpi_cpufreq_data *cpufreq_drv_data[NR_CPUS];
-
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
@@ -82,6 +80,10 @@ struct cpufreq_policy {
                                  * -1 for disable, 1 for enabled
                                  * See CPUFREQ_TURBO_* below for defines */
     unsigned int        policy; /* CPUFREQ_POLICY_* */
+
+    union {
+        struct acpi_cpufreq_data acpi;
+    }                   drv_data;
 };
 DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Jan 26 13:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Jan 2026 13:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1213710.1524180 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkMNb-0000pP-2V; Mon, 26 Jan 2026 13:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1213710.1524180; Mon, 26 Jan 2026 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 1vkMNa-0000pF-Vr; Mon, 26 Jan 2026 13:11:42 +0000
Received: by outflank-mailman (input) for mailman id 1213710;
 Mon, 26 Jan 2026 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 1vkMNa-0000p7-9u
 for xen-changelog@lists.xenproject.org; Mon, 26 Jan 2026 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 1vkMNa-004bmF-1z
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 13:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkMNa-002sZj-0j
 for xen-changelog@lists.xenproject.org;
 Mon, 26 Jan 2026 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=jz6DABlEZ4Q2wYeWgqeiHep7haHS3PJSvOOAOyQKbJ8=; b=UeKlnBfo5rDHTCXiL9zO2u1eJg
	SHU4ARsAPu3AcVTyn1Vfc3AeVHqP+bJ66XNX+oIhcA91cA9Xn+Ce/3sUKMiT/b4KYAAM5FaTpcMgo
	KHB3Z75Ya03r5YgexJnJgscX87ZdPWqbiSkS1wHySn0Flqz1zBCAWAfWbCgd6tlgqiOw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] kconfig: adjust NR_CPUS defaults
Message-Id: <E1vkMNa-002sZj-0j@xenbits.xenproject.org>
Date: Mon, 26 Jan 2026 13:11:42 +0000

commit 9f493ad08e08f06dce0d17357f0ebb26f6b1652b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 26 11:50:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 26 11:50:10 2026 +0100

    kconfig: adjust NR_CPUS defaults
    
    Discussion of a RISC-V change revealed that for PPC and RISC-V we don't
    really set any default, but rather rely on internals of kconfig picking
    the lowest of the permitted values in such a case. Let's make this
    explicit, requiring architectures that mean to permit SMP by default to
    explicitly record some sensible value here.
    
    Leverage the adjustment to the "1" case to simplify all subsequent ones.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
index 9f4835e37f..f9230bfaf8 100644
--- a/xen/arch/Kconfig
+++ b/xen/arch/Kconfig
@@ -9,11 +9,11 @@ config NR_CPUS
 	range 1 1 if ARM && MPU
 	range 1 16383
 	default "256" if X86
-	default "1" if ARM && MPU
-	default "8" if ARM && RCAR3
-	default "4" if ARM && QEMU
-	default "4" if ARM && MPSOC
-	default "128" if ARM
+	default "1" if !ARM || MPU
+	default "8" if RCAR3
+	default "4" if QEMU
+	default "4" if MPSOC
+	default "128"
 	help
 	  Controls the build-time size of various arrays and bitmaps
 	  associated with multiple-cpu management.  It is the upper bound of
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 08:11:17 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 08:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214099.1524484 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkeAB-0004Ws-6b; Tue, 27 Jan 2026 08:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214099.1524484; Tue, 27 Jan 2026 08:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkeAB-0004Wi-3d; Tue, 27 Jan 2026 08:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1214099;
 Tue, 27 Jan 2026 08:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkeAA-0004Wc-4O
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 08:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkeAA-0066as-1H
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 08:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkeAA-00433D-04
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 08:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QKJGiaKNOeABLuxCZUT+X1C6ZLaHkf1kWQm04QpgJtA=; b=PJ3BPK1MGa5Dxhtn/KsQzszm1X
	tzUthqfQQBf9awYC/ffFNKi0+nluHQxtu95bitzSdi9jCexxF+7Dotfk+gZSdkPdJsJF1+qJouDtb
	qSVzW9LlBYUnOTP84hNgM/MgSE49Wybjcnn0k08fYROq8TzGIncao4aW9bMksIrYtyNI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Enable GICv3 by default for AArch32 MPU
Message-Id: <E1vkeAA-00433D-04@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 08:11:02 +0000

commit 219b9b69379c3ce660c775e1d3d6ef7201ab71da
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Jan 20 11:51:41 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Jan 27 08:58:12 2026 +0100

    xen/arm: Enable GICv3 by default for AArch32 MPU
    
    All the platforms where ARMv8R AArch32 is being tested use GICv3.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 0d81a4d8b4..442d353b43 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -128,8 +128,7 @@ config GICV2
 config GICV3
 	bool "GICv3 driver"
 	depends on !NEW_VGIC
-	default n if ARM_32
-	default y if ARM_64
+	default y if ARM_64 || MPU
 	help
 
 	  Driver for the ARM Generic Interrupt Controller v3.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 10:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 10:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214193.1524557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgCx-000672-K2; Tue, 27 Jan 2026 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214193.1524557; Tue, 27 Jan 2026 10:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgCx-00066v-HS; Tue, 27 Jan 2026 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1214193;
 Tue, 27 Jan 2026 10:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkgCw-00066g-1G
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 10:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgCw-0069C6-10
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgCv-0049rb-31
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cJ8K2qfhRQb+QetqkMNoOS5EFyyMEKwKeVjC5hgQfwQ=; b=fPD8/ahgwd9wCRI87eFKvFuR55
	amVPYOg1luVHclvSE611IBi2X7iFQd+dWAm7aEQ1uaw+DLGU/1DV5/nFtDIzt13ijvF01skioBsSS
	43BXJRy+DUNTBVcouZBQt1zC+Ki/OZHBUuF7L3rohqnztzEG9rJAFSSKKufMij18082g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Enable GICv3 by default for AArch32 MPU
Message-Id: <E1vkgCv-0049rb-31@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 10:22:01 +0000

commit 219b9b69379c3ce660c775e1d3d6ef7201ab71da
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Jan 20 11:51:41 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Jan 27 08:58:12 2026 +0100

    xen/arm: Enable GICv3 by default for AArch32 MPU
    
    All the platforms where ARMv8R AArch32 is being tested use GICv3.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 0d81a4d8b4..442d353b43 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -128,8 +128,7 @@ config GICV2
 config GICV3
 	bool "GICv3 driver"
 	depends on !NEW_VGIC
-	default n if ARM_32
-	default y if ARM_64
+	default y if ARM_64 || MPU
 	help
 
 	  Driver for the ARM Generic Interrupt Controller v3.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 10:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 10:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214240.1524602 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgit-0003Qx-Nl; Tue, 27 Jan 2026 10:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214240.1524602; Tue, 27 Jan 2026 10:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgit-0003Qp-LA; Tue, 27 Jan 2026 10:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1214240;
 Tue, 27 Jan 2026 10: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 1vkgis-0003Qj-Ih
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 10: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 1vkgis-0069m0-2M
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgis-004BfY-15
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10: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=qqS3eN98kSlAXlO9dEuevk1P5RhEeEo8QFjEcTTKviA=; b=4u2ZfAF6EmRNHhhQp3UOgC9KHP
	Vn6RpdH5fKTy+Z3EKJL5+lUHJAyXHZ6hxiywSNVSEeDOb6vFs6KsfZHzsGVxvhkl9058NwZe0UZir
	vDtGJzlBK/HKUgz2mRArYZzDsTPMTHXcxq76IkeZwEnmL849EqnchTNKnoGayWY3oUVY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vkgis-004BfY-15@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 10:55:02 +0000

commit f0abe60de13b7ca33464d5715d28e77fb545a1f0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:26:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:26:36 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Makefile   | 4 ++--
 xen/arch/ppc/Makefile   | 4 ++--
 xen/arch/riscv/Makefile | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7494a0f926..95bc7ad25e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -87,13 +87,13 @@ endif
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index e80690d3b8..92d68cb808 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -14,13 +14,13 @@ $(TARGET): $(TARGET)-syms
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 87c1148b00..0df139b274 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -28,13 +28,13 @@ $(TARGET): $(TARGET)-syms
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 10:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 10:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214241.1524607 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgj3-0003SP-Pv; Tue, 27 Jan 2026 10:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214241.1524607; Tue, 27 Jan 2026 10:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgj3-0003SH-MZ; Tue, 27 Jan 2026 10:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1214241;
 Tue, 27 Jan 2026 10: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 1vkgj2-0003SB-Gb
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 10: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 1vkgj2-0069o3-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgj2-004Bhb-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10: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=3gffzys51e380KyBy/u45wXSJk4Z1hdeYR5NeEYM0iY=; b=WFDN2FWlz0uio9KgyfasePywBR
	WVgmotdBjp7deiYVjjqtgeXFKddy5O9Z96UjqglcL6gP1t8NLYGgu1P7/fLQaAn82CZWH8YcewMFn
	oFl1oQ4nS155OUFjjmkCB7RXpFhLafW71WQM39bjUuybYmkP3D/AY1ToUeFmEZ5H0KVA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cpufreq/hwp: move driver data into policy
Message-Id: <E1vkgj2-004Bhb-1S@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 10:55:12 +0000

commit cbb4bd7e92feb6677875690ec7cf124c9d5fb9de
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:27:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:27:14 2026 +0100

    cpufreq/hwp: move driver data into policy
    
    Share space with the ACPI and powernow drivers, avoiding a separate
    allocation for each CPU. Except for get_hwp_para() all use sites already
    have the policy available, and this one function can simply be brought
    closer to its sibling set_hwp_para().
    
    This then also eliminates the concern over hwp_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in
    policy->cpu (which would result in accesses of per-CPU data of offline
    CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 86 +++++++-------------------------------
 xen/drivers/acpi/pm-op.c           |  6 ++-
 xen/include/acpi/cpufreq/cpufreq.h | 39 ++++++++++++++++-
 3 files changed, 56 insertions(+), 75 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 8af02070bf..440d9be3a7 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -22,50 +22,6 @@ static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
-union hwp_request
-{
-    struct
-    {
-        unsigned int min_perf:8;
-        unsigned int max_perf:8;
-        unsigned int desired:8;
-        unsigned int energy_perf:8;
-        unsigned int activity_window:10;
-        bool package_control:1;
-        unsigned int :16;
-        bool activity_window_valid:1;
-        bool energy_perf_valid:1;
-        bool desired_valid:1;
-        bool max_perf_valid:1;
-        bool min_perf_valid:1;
-    };
-    uint64_t raw;
-};
-
-struct hwp_drv_data
-{
-    union
-    {
-        uint64_t hwp_caps;
-        struct
-        {
-            unsigned int highest:8;
-            unsigned int guaranteed:8;
-            unsigned int most_efficient:8;
-            unsigned int lowest:8;
-            unsigned int :32;
-        } hw;
-    };
-    union hwp_request curr_req;
-    int ret;
-    uint16_t activity_window;
-    uint8_t minimum;
-    uint8_t maximum;
-    uint8_t desired;
-    uint8_t energy_perf;
-};
-static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);
-
 #define hwp_err(cpu, fmt, args...) \
     printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ## args)
 #define hwp_info(fmt, args...)    printk(XENLOG_INFO "HWP: " fmt, ## args)
@@ -212,7 +168,7 @@ static bool __init hwp_available(void)
 
 static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
 {
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
 
     if ( !cpu_has_hwp_activity_window && data->activity_window )
     {
@@ -226,8 +182,8 @@ static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
 
 static void cf_check hwp_write_request(void *info)
 {
-    const struct cpufreq_policy *policy = info;
-    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     union hwp_request hwp_req = data->curr_req;
 
     data->ret = 0;
@@ -247,7 +203,7 @@ static int cf_check hwp_cpufreq_target(struct cpufreq_policy *policy,
                                        unsigned int relation)
 {
     unsigned int cpu = policy->cpu;
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     /* Zero everything to ensure reserved bits are zero... */
     union hwp_request hwp_req = { .raw = 0 };
 
@@ -338,7 +294,7 @@ static void hwp_get_cpu_speeds(struct cpufreq_policy *policy)
 static void cf_check hwp_init_msrs(void *info)
 {
     struct cpufreq_policy *policy = info;
-    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     uint64_t val;
 
     /*
@@ -406,23 +362,15 @@ static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
     static bool __read_mostly first_run = true;
     static union hwp_request initial_req;
     unsigned int cpu = policy->cpu;
-    struct hwp_drv_data *data;
-
-    data = xzalloc(struct hwp_drv_data);
-    if ( !data )
-        return -ENOMEM;
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
 
     policy->governor = &cpufreq_gov_hwp;
 
-    per_cpu(hwp_drv_data, cpu) = data;
-
     on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
 
     if ( data->curr_req.raw == -1 )
     {
         hwp_err(cpu, "Could not initialize HWP properly\n");
-        per_cpu(hwp_drv_data, cpu) = NULL;
-        xfree(data);
         return -ENODEV;
     }
 
@@ -450,11 +398,6 @@ static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
 static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
-
-    per_cpu(hwp_drv_data, policy->cpu) = NULL;
-    xfree(data);
-
     return 0;
 }
 
@@ -467,8 +410,8 @@ static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
  */
 static void cf_check hwp_set_misc_turbo(void *info)
 {
-    const struct cpufreq_policy *policy = info;
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     uint64_t msr;
 
     data->ret = 0;
@@ -499,7 +442,7 @@ static int cf_check hwp_cpufreq_update(unsigned int cpu, struct cpufreq_policy *
 {
     on_selected_cpus(cpumask_of(cpu), hwp_set_misc_turbo, policy, 1);
 
-    return per_cpu(hwp_drv_data, cpu)->ret;
+    return policy->drv_data.hwp.ret;
 }
 #endif /* CONFIG_PM_OP */
 
@@ -516,12 +459,12 @@ hwp_cpufreq_driver = {
 };
 
 #ifdef CONFIG_PM_OP
-int get_hwp_para(unsigned int cpu,
+int get_hwp_para(const struct cpufreq_policy *policy,
                  struct xen_get_cppc_para *cppc_para)
 {
-    const struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    const struct hwp_drv_data *data = &policy->drv_data.hwp;
 
-    if ( data == NULL )
+    if ( !data->maximum )
         return -ENODATA;
 
     cppc_para->features         =
@@ -542,11 +485,10 @@ int get_hwp_para(unsigned int cpu,
 int set_hwp_para(struct cpufreq_policy *policy,
                  struct xen_set_cppc_para *set_cppc)
 {
-    unsigned int cpu = policy->cpu;
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     bool cleared_act_window = false;
 
-    if ( data == NULL )
+    if ( !data->maximum )
         return -ENOENT;
 
     /* Validate all parameters - Disallow reserved bits. */
diff --git a/xen/drivers/acpi/pm-op.c b/xen/drivers/acpi/pm-op.c
index 4cca42c4fc..07bddc58d9 100644
--- a/xen/drivers/acpi/pm-op.c
+++ b/xen/drivers/acpi/pm-op.c
@@ -80,10 +80,12 @@ static int read_scaling_available_governors(char *scaling_available_governors,
 static int get_cpufreq_cppc(unsigned int cpu,
                             struct xen_get_cppc_para *cppc_para)
 {
+    const struct cpufreq_policy *policy =
+        per_cpu(cpufreq_cpu_policy, cpu);
     int ret = -ENODEV;
 
-    if ( hwp_active() )
-        ret = get_hwp_para(cpu, cppc_para);
+    if ( policy && hwp_active() )
+        ret = get_hwp_para(policy, cppc_para);
 
     return ret;
 }
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index f4b4f06613..0ffeab9aba 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -38,6 +38,42 @@ struct acpi_cpufreq_data {
     unsigned int arch_cpu_flags;
 };
 
+struct hwp_drv_data {
+    union {
+        uint64_t hwp_caps;
+        struct {
+            unsigned int highest:8;
+            unsigned int guaranteed:8;
+            unsigned int most_efficient:8;
+            unsigned int lowest:8;
+            unsigned int :32;
+        } hw;
+    };
+    union hwp_request {
+        struct {
+            unsigned int min_perf:8;
+            unsigned int max_perf:8;
+            unsigned int desired:8;
+            unsigned int energy_perf:8;
+            unsigned int activity_window:10;
+            bool package_control:1;
+            unsigned int :16;
+            bool activity_window_valid:1;
+            bool energy_perf_valid:1;
+            bool desired_valid:1;
+            bool max_perf_valid:1;
+            bool min_perf_valid:1;
+        };
+        uint64_t raw;
+    } curr_req;
+    int ret;
+    uint16_t activity_window;
+    uint8_t minimum;
+    uint8_t maximum;
+    uint8_t desired;
+    uint8_t energy_perf;
+};
+
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
@@ -83,6 +119,7 @@ struct cpufreq_policy {
 
     union {
         struct acpi_cpufreq_data acpi;
+        struct hwp_drv_data hwp;
     }                   drv_data;
 };
 DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
@@ -286,7 +323,7 @@ bool hwp_active(void);
 static inline bool hwp_active(void) { return false; }
 #endif
 
-int get_hwp_para(unsigned int cpu,
+int get_hwp_para(const struct cpufreq_policy *policy,
                  struct xen_get_cppc_para *cppc_para);
 int set_hwp_para(struct cpufreq_policy *policy,
                  struct xen_set_cppc_para *set_cppc);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 10:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 10:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214242.1524610 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgjD-0003V8-RG; Tue, 27 Jan 2026 10:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214242.1524610; Tue, 27 Jan 2026 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgjD-0003V0-O4; Tue, 27 Jan 2026 10:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1214242;
 Tue, 27 Jan 2026 10:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkgjC-0003Uk-JS
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 10:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgjC-0069oQ-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgjC-004Bhy-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10: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=5o+Ps/+dO1t0eAYkfwTpi2PyCSS06r37+iCT65tjwmY=; b=SFY8DYrVyOPvFj7LRNs/O0dGTq
	e2u+UjCETKyfUDLCbBffYRqN9eBkF1hfAuGEP4EjxeME/SQXkq/cLNH7qyWwBwcFmM0HOeCO+NQzh
	/6/gJ9grIW7BdvHJvoaOoXikNTWiIb2SaNsqr6BvNEkTpH3eK7x3kiOszFfLeSSPRjoI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cpufreq/amd-cppc: move driver data into policy
Message-Id: <E1vkgjC-004Bhy-1j@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 10:55:22 +0000

commit fc1d8c851a044022da81cd1052ec3093f4e349b6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:27:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:27:50 2026 +0100

    cpufreq/amd-cppc: move driver data into policy
    
    Share space with the ACPI, powernow, and HWP drivers, avoiding a separate
    allocation for each CPU.
    
    This then also reduces the concern over amd_cppc_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in policy->cpu
    (which would result in accesses of per-CPU data of offline CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Penny Zheng <penny.zheng@amd.com>
---
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 108 ++++-------------------------------
 xen/include/acpi/cpufreq/cpufreq.h   |  73 +++++++++++++++++++++++
 2 files changed, 85 insertions(+), 96 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/amd-cppc.c b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
index bb7f4e4a9e..4f16045a1c 100644
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -30,81 +30,6 @@
         printk(XENLOG_DEBUG "AMD-CPPC: CPU%u " fmt, cpu, ## args);  \
 })
 
-/*
- * Field highest_perf, nominal_perf, lowest_nonlinear_perf, and lowest_perf
- * contain the values read from CPPC capability MSR. They represent the limits
- * of managed performance range as well as the dynamic capability, which may
- * change during processor operation
- * Field highest_perf represents highest performance, which is the absolute
- * maximum performance an individual processor may reach, assuming ideal
- * conditions. This performance level may not be sustainable for long
- * durations and may only be achievable if other platform components
- * are in a specific state; for example, it may require other processors be
- * in an idle state. This would be equivalent to the highest frequencies
- * supported by the processor.
- * Field nominal_perf represents maximum sustained performance level of the
- * processor, assuming ideal operating conditions. All cores/processors are
- * expected to be able to sustain their nominal performance state
- * simultaneously.
- * Field lowest_nonlinear_perf represents Lowest Nonlinear Performance, which
- * is the lowest performance level at which nonlinear power savings are
- * achieved. Above this threshold, lower performance levels should be
- * generally more energy efficient than higher performance levels. So in
- * traditional terms, this represents the P-state range of performance levels.
- * Field lowest_perf represents the absolute lowest performance level of the
- * platform. Selecting it may cause an efficiency penalty but should reduce
- * the instantaneous power consumption of the processor. So in traditional
- * terms, this represents the T-state range of performance levels.
- *
- * Field max_perf, min_perf, des_perf store the values for CPPC request MSR.
- * Software passes performance goals through these fields.
- * Field max_perf conveys the maximum performance level at which the platform
- * may run. And it may be set to any performance value in the range
- * [lowest_perf, highest_perf], inclusive.
- * Field min_perf conveys the minimum performance level at which the platform
- * may run. And it may be set to any performance value in the range
- * [lowest_perf, highest_perf], inclusive but must be less than or equal to
- * max_perf.
- * Field des_perf conveys performance level Xen governor is requesting. And it
- * may be set to any performance value in the range [min_perf, max_perf],
- * inclusive. In active mode, des_perf must be zero.
- * Field epp represents energy performance preference, which only has meaning
- * when active mode is enabled. The EPP is used in the CCLK DPM controller
- * to drive the frequency that a core is going to operate during short periods
- * of activity, called minimum active frequency, It could contatin a range of
- * values from 0 to 0xff. An EPP of zero sets the min active frequency to
- * maximum frequency, while an EPP of 0xff sets the min active frequency to
- * approxiately Idle frequency.
- */
-struct amd_cppc_drv_data
-{
-    const struct xen_processor_cppc *cppc_data;
-    union {
-        uint64_t raw;
-        struct {
-            unsigned int lowest_perf:8;
-            unsigned int lowest_nonlinear_perf:8;
-            unsigned int nominal_perf:8;
-            unsigned int highest_perf:8;
-            unsigned int :32;
-        };
-    } caps;
-    union {
-        uint64_t raw;
-        struct {
-            unsigned int max_perf:8;
-            unsigned int min_perf:8;
-            unsigned int des_perf:8;
-            unsigned int epp:8;
-            unsigned int :32;
-        };
-    } req;
-
-    int err;
-};
-
-static DEFINE_PER_CPU_READ_MOSTLY(struct amd_cppc_drv_data *,
-                                  amd_cppc_drv_data);
 /*
  * Core max frequency read from PstateDef as anchor point
  * for freq-to-perf transition
@@ -279,11 +204,11 @@ static void cf_check amd_cppc_write_request_msrs(void *info)
     wrmsrl(MSR_AMD_CPPC_REQ, data->req.raw);
 }
 
-static void amd_cppc_write_request(unsigned int cpu, uint8_t min_perf,
-                                   uint8_t des_perf, uint8_t max_perf,
-                                   uint8_t epp)
+static void amd_cppc_write_request(struct cpufreq_policy *policy,
+                                   uint8_t min_perf, uint8_t des_perf,
+                                   uint8_t max_perf, uint8_t epp)
 {
-    struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data, cpu);
+    struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
     uint64_t prev = data->req.raw;
 
     data->req.min_perf = min_perf;
@@ -295,15 +220,15 @@ static void amd_cppc_write_request(unsigned int cpu, uint8_t min_perf,
     if ( prev == data->req.raw )
         return;
 
-    on_selected_cpus(cpumask_of(cpu), amd_cppc_write_request_msrs, data, 1);
+    on_selected_cpus(cpumask_of(policy->cpu), amd_cppc_write_request_msrs,
+                     data, 1);
 }
 
 static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
                                             unsigned int target_freq,
                                             unsigned int relation)
 {
-    unsigned int cpu = policy->cpu;
-    const struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data, cpu);
+    const struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
     uint8_t des_perf;
     int res;
 
@@ -320,7 +245,7 @@ static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
      * may actually cause an efficiency penalty, So when deciding the min_perf
      * value, we prefer lowest nonlinear performance over lowest performance.
      */
-    amd_cppc_write_request(policy->cpu, data->caps.lowest_nonlinear_perf,
+    amd_cppc_write_request(policy, data->caps.lowest_nonlinear_perf,
                            des_perf, data->caps.highest_perf,
                            /* Pre-defined BIOS value for passive mode */
                            per_cpu(epp_init, policy->cpu));
@@ -330,7 +255,7 @@ static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
 static void cf_check amd_cppc_init_msrs(void *info)
 {
     struct cpufreq_policy *policy = info;
-    struct amd_cppc_drv_data *data = this_cpu(amd_cppc_drv_data);
+    struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
     uint64_t val;
     unsigned int min_freq = 0, nominal_freq = 0, max_freq;
 
@@ -431,24 +356,16 @@ static void amd_cppc_boost_init(struct cpufreq_policy *policy,
 
 static int cf_check amd_cppc_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    XVFREE(per_cpu(amd_cppc_drv_data, policy->cpu));
-
     return 0;
 }
 
 static int amd_cppc_cpufreq_init_perf(struct cpufreq_policy *policy)
 {
     unsigned int cpu = policy->cpu;
-    struct amd_cppc_drv_data *data;
-
-    data = xvzalloc(struct amd_cppc_drv_data);
-    if ( !data )
-        return -ENOMEM;
+    struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
 
     data->cppc_data = &processor_pminfo[cpu]->cppc_data;
 
-    per_cpu(amd_cppc_drv_data, cpu) = data;
-
     on_selected_cpus(cpumask_of(cpu), amd_cppc_init_msrs, policy, 1);
 
     /*
@@ -506,8 +423,7 @@ static void amd_cppc_prepare_policy(struct cpufreq_policy *policy,
                                     uint8_t *max_perf, uint8_t *min_perf,
                                     uint8_t *epp)
 {
-    const struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data,
-                                                   policy->cpu);
+    const struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
 
     /*
      * On default, set min_perf with lowest_nonlinear_perf, and max_perf
@@ -560,7 +476,7 @@ static int cf_check amd_cppc_epp_set_policy(struct cpufreq_policy *policy)
 
     amd_cppc_prepare_policy(policy, &max_perf, &min_perf, &epp);
 
-    amd_cppc_write_request(policy->cpu, min_perf,
+    amd_cppc_write_request(policy, min_perf,
                            0 /* no des_perf in active mode */,
                            max_perf, epp);
     return 0;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 0ffeab9aba..479cf19b6a 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -74,6 +74,78 @@ struct hwp_drv_data {
     uint8_t energy_perf;
 };
 
+/*
+ * Field highest_perf, nominal_perf, lowest_nonlinear_perf, and lowest_perf
+ * contain the values read from CPPC capability MSR. They represent the limits
+ * of managed performance range as well as the dynamic capability, which may
+ * change during processor operation
+ * Field highest_perf represents highest performance, which is the absolute
+ * maximum performance an individual processor may reach, assuming ideal
+ * conditions. This performance level may not be sustainable for long
+ * durations and may only be achievable if other platform components
+ * are in a specific state; for example, it may require other processors be
+ * in an idle state. This would be equivalent to the highest frequencies
+ * supported by the processor.
+ * Field nominal_perf represents maximum sustained performance level of the
+ * processor, assuming ideal operating conditions. All cores/processors are
+ * expected to be able to sustain their nominal performance state
+ * simultaneously.
+ * Field lowest_nonlinear_perf represents Lowest Nonlinear Performance, which
+ * is the lowest performance level at which nonlinear power savings are
+ * achieved. Above this threshold, lower performance levels should be
+ * generally more energy efficient than higher performance levels. So in
+ * traditional terms, this represents the P-state range of performance levels.
+ * Field lowest_perf represents the absolute lowest performance level of the
+ * platform. Selecting it may cause an efficiency penalty but should reduce
+ * the instantaneous power consumption of the processor. So in traditional
+ * terms, this represents the T-state range of performance levels.
+ *
+ * Field max_perf, min_perf, des_perf store the values for CPPC request MSR.
+ * Software passes performance goals through these fields.
+ * Field max_perf conveys the maximum performance level at which the platform
+ * may run. And it may be set to any performance value in the range
+ * [lowest_perf, highest_perf], inclusive.
+ * Field min_perf conveys the minimum performance level at which the platform
+ * may run. And it may be set to any performance value in the range
+ * [lowest_perf, highest_perf], inclusive but must be less than or equal to
+ * max_perf.
+ * Field des_perf conveys performance level Xen governor is requesting. And it
+ * may be set to any performance value in the range [min_perf, max_perf],
+ * inclusive. In active mode, des_perf must be zero.
+ * Field epp represents energy performance preference, which only has meaning
+ * when active mode is enabled. The EPP is used in the CCLK DPM controller
+ * to drive the frequency that a core is going to operate during short periods
+ * of activity, called minimum active frequency, It could contatin a range of
+ * values from 0 to 0xff. An EPP of zero sets the min active frequency to
+ * maximum frequency, while an EPP of 0xff sets the min active frequency to
+ * approxiately Idle frequency.
+ */
+struct amd_cppc_drv_data {
+    const struct xen_processor_cppc *cppc_data;
+    union {
+        uint64_t raw;
+        struct {
+            unsigned int lowest_perf:8;
+            unsigned int lowest_nonlinear_perf:8;
+            unsigned int nominal_perf:8;
+            unsigned int highest_perf:8;
+            unsigned int :32;
+        };
+    } caps;
+    union {
+        uint64_t raw;
+        struct {
+            unsigned int max_perf:8;
+            unsigned int min_perf:8;
+            unsigned int des_perf:8;
+            unsigned int epp:8;
+            unsigned int :32;
+        };
+    } req;
+
+    int err;
+};
+
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
@@ -120,6 +192,7 @@ struct cpufreq_policy {
     union {
         struct acpi_cpufreq_data acpi;
         struct hwp_drv_data hwp;
+        struct amd_cppc_drv_data amd_cppc;
     }                   drv_data;
 };
 DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 10:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 10:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214243.1524615 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgjN-0003Xs-Tx; Tue, 27 Jan 2026 10:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214243.1524615; Tue, 27 Jan 2026 10:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgjN-0003Xk-R4; Tue, 27 Jan 2026 10:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1214243;
 Tue, 27 Jan 2026 10:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkgjM-0003XX-MN
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 10:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgjM-0069oU-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgjM-004BiN-20
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ytm1y3JSHyfJf3toq8GPQD483Yyc79QUkIHInNpUDlk=; b=LAcNPN5/Zfhrd+m8oomSlfqcfj
	gmKnrSBUeBGtxub7DbwE5Xhk3punVLrpBHG2x1fNztccyhosw7d+ZlD5h88LMqONPTFhIiLdLXQP4
	gNk0mHVJTTuGNF3LuNAA1DpXp/39Cyl4RGYLfDx8FlQWwC7SngTaxOp/3DCJ+aeP5MD0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cpufreq/amd-cppc: move epp_init into driver data
Message-Id: <E1vkgjM-004BiN-20@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 10:55:32 +0000

commit b8e26d974784a56bb5b438b43017ebe99e8abb13
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:28:09 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:28:09 2026 +0100

    cpufreq/amd-cppc: move epp_init into driver data
    
    No reason for it to be a separate per-CPU item; it's connected to a
    struct cpufreq_policy instance just like other driver data.
    
    This further reduces the concern over amd_cppc_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in policy->cpu
    (which would result in accesses of per-CPU data of offline CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Penny Zheng <penny.zheng@amd.com>
---
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 7 +++----
 xen/include/acpi/cpufreq/cpufreq.h   | 2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/amd-cppc.c b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
index 4f16045a1c..c034d84767 100644
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -35,7 +35,6 @@
  * for freq-to-perf transition
  */
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned int, pxfreq_mhz);
-static DEFINE_PER_CPU_READ_MOSTLY(uint8_t, epp_init);
 #ifndef NDEBUG
 static bool __ro_after_init opt_active_mode;
 #else
@@ -248,7 +247,7 @@ static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
     amd_cppc_write_request(policy, data->caps.lowest_nonlinear_perf,
                            des_perf, data->caps.highest_perf,
                            /* Pre-defined BIOS value for passive mode */
-                           per_cpu(epp_init, policy->cpu));
+                           data->epp_init);
     return 0;
 }
 
@@ -326,7 +325,7 @@ static void cf_check amd_cppc_init_msrs(void *info)
 
     /* Store pre-defined BIOS value for passive mode */
     rdmsrl(MSR_AMD_CPPC_REQ, val);
-    this_cpu(epp_init) = MASK_EXTR(val, AMD_CPPC_EPP_MASK);
+    data->epp_init = MASK_EXTR(val, AMD_CPPC_EPP_MASK);
 
     return;
 
@@ -465,7 +464,7 @@ static void amd_cppc_prepare_policy(struct cpufreq_policy *policy,
         break;
 
     default:
-        *epp = per_cpu(epp_init, policy->cpu);
+        *epp = data->epp_init;
         break;
     }
 }
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 479cf19b6a..5c39d38c79 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -143,6 +143,8 @@ struct amd_cppc_drv_data {
         };
     } req;
 
+    uint8_t epp_init;
+
     int err;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 10:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 10:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214244.1524618 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkgjX-0003a0-V7; Tue, 27 Jan 2026 10:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214244.1524618; Tue, 27 Jan 2026 10: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 1vkgjX-0003Zs-SZ; Tue, 27 Jan 2026 10:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1214244;
 Tue, 27 Jan 2026 10: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 1vkgjW-0003Zk-Oy
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 10: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 1vkgjX-0069oc-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkgjW-004BjT-2J
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 10:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X5zaDFqmnpKIhL6k1H0LocTGLN2DE6+x64f6p5JM19o=; b=A9hTTHdisTOLZe1drV463e7Slj
	Yiw2pNN5T3mOHQB7TWeMgEwoNRMCDfQty2Fy2jTBJhVyYPjtlgk0tpfauh2R5jG8Ue1GqClQc7xoX
	lukWduJ2k2ZFXFNfUCUxMw0DOjUOwE1H99Pum6mrxG6vwyf1H7PkPeTyTACfTK4g8c3w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cpufreq/amd-cppc: move pxfreq_mhz into driver data
Message-Id: <E1vkgjW-004BjT-2J@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 10:55:42 +0000

commit 02bbdda863697096b63e83c2c0a37aa167045476
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:28:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:28:27 2026 +0100

    cpufreq/amd-cppc: move pxfreq_mhz into driver data
    
    No reason for it to be a separate per-CPU item; it's connected to a
    struct cpufreq_policy instance just like other driver data.
    
    This also eliminates the concern over amd_cppc_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in policy->cpu
    (which would result in accesses of per-CPU data of offline CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Penny Zheng <penny.zheng@amd.com>
---
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 11 +++--------
 xen/include/acpi/cpufreq/cpufreq.h   |  6 ++++++
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/amd-cppc.c b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
index c034d84767..ae9b8beaab 100644
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -30,11 +30,6 @@
         printk(XENLOG_DEBUG "AMD-CPPC: CPU%u " fmt, cpu, ## args);  \
 })
 
-/*
- * Core max frequency read from PstateDef as anchor point
- * for freq-to-perf transition
- */
-static DEFINE_PER_CPU_READ_MOSTLY(unsigned int, pxfreq_mhz);
 #ifndef NDEBUG
 static bool __ro_after_init opt_active_mode;
 #else
@@ -117,7 +112,7 @@ static int amd_cppc_khz_to_perf(const struct amd_cppc_drv_data *data,
     {
         /* Read Processor Max Speed(MHz) as anchor point */
         mul = data->caps.highest_perf;
-        div = this_cpu(pxfreq_mhz);
+        div = data->pxfreq_mhz;
         if ( !div )
             return -EOPNOTSUPP;
     }
@@ -160,7 +155,7 @@ static int amd_get_cpc_freq(const struct amd_cppc_drv_data *data,
     }
 
     /* Read Processor Max Speed(MHz) as anchor point */
-    mul = this_cpu(pxfreq_mhz);
+    mul = data->pxfreq_mhz;
     if ( !mul )
         return -EOPNOTSUPP;
     div = data->caps.highest_perf;
@@ -287,7 +282,7 @@ static void cf_check amd_cppc_init_msrs(void *info)
     }
 
     amd_process_freq(&cpu_data[policy->cpu],
-                     NULL, NULL, &this_cpu(pxfreq_mhz));
+                     NULL, NULL, &data->pxfreq_mhz);
 
     data->err = amd_get_cpc_freq(data, data->cppc_data->cpc.lowest_mhz,
                                  data->caps.lowest_perf, &min_freq);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 5c39d38c79..0171ccf0ba 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -145,6 +145,12 @@ struct amd_cppc_drv_data {
 
     uint8_t epp_init;
 
+    /*
+     * Core max frequency read from PstateDef as anchor point
+     * for freq-to-perf transition
+     */
+    unsigned int pxfreq_mhz;
+
     int err;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 12:00:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 12:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214306.1524674 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhjm-0005Pk-GO; Tue, 27 Jan 2026 12:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214306.1524674; Tue, 27 Jan 2026 12:00:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhjm-0005PZ-CM; Tue, 27 Jan 2026 12:00:02 +0000
Received: by outflank-mailman (input) for mailman id 1214306;
 Tue, 27 Jan 2026 12: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 1vkhjl-0005Ie-NM
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 12: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 1vkhjl-006AxD-3A
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkhjl-004FFp-1y
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12: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=MloHgqDgysFHeUWYX1uQPLo0JtmTk7oWn0Dn+SoVmmE=; b=Cj9zZZvbxHfX4zY41i0EJtIpSQ
	Jf/7wFHxj/cVqB3eTd9h5lOxFLKY9u+4fgOVLIJo4affpVgsEiYLCyV9h8p6ZMrnqQgAP8RUEk3l8
	YJzLrYUUnBAsJ2QhLg5oRv5QmiC7o0LxtP3KsIYInUw4hb5wNLndE4YMX0RasjasgoFE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vkhjl-004FFp-1y@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 12:00:01 +0000

commit f0abe60de13b7ca33464d5715d28e77fb545a1f0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:26:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:26:36 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Makefile   | 4 ++--
 xen/arch/ppc/Makefile   | 4 ++--
 xen/arch/riscv/Makefile | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7494a0f926..95bc7ad25e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -87,13 +87,13 @@ endif
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index e80690d3b8..92d68cb808 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -14,13 +14,13 @@ $(TARGET): $(TARGET)-syms
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 87c1148b00..0df139b274 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -28,13 +28,13 @@ $(TARGET): $(TARGET)-syms
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 12:00:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 12:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214307.1524676 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhjw-0006Jf-He; Tue, 27 Jan 2026 12:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214307.1524676; Tue, 27 Jan 2026 12:00:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhjw-0006JX-Ew; Tue, 27 Jan 2026 12:00:12 +0000
Received: by outflank-mailman (input) for mailman id 1214307;
 Tue, 27 Jan 2026 12:00: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 1vkhjv-0006JL-Qy
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 12:00: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 1vkhjw-006AzJ-0E
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkhjv-004FHk-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ueNObwjEPW+1oFqAgp7qMlrqSu39GcLWesxuPLze6rM=; b=HlO1h0IZrSeUJfItaWSmKrPAIj
	AEbrfI67Q+TovIu14oIsBgQfrsGJRb+jbvbUBmoYeczlNMIpkCZBXx3N3O6b7j/A3XktVUHB+6nvl
	OxNq/z47klxdmziCjx5kogiKhMG+JNKaz75DBhO4OVmCdFq27qeAOQRrYEVVeLvhTN5o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cpufreq/hwp: move driver data into policy
Message-Id: <E1vkhjv-004FHk-2G@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 12:00:11 +0000

commit cbb4bd7e92feb6677875690ec7cf124c9d5fb9de
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:27:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:27:14 2026 +0100

    cpufreq/hwp: move driver data into policy
    
    Share space with the ACPI and powernow drivers, avoiding a separate
    allocation for each CPU. Except for get_hwp_para() all use sites already
    have the policy available, and this one function can simply be brought
    closer to its sibling set_hwp_para().
    
    This then also eliminates the concern over hwp_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in
    policy->cpu (which would result in accesses of per-CPU data of offline
    CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpufreq/hwp.c    | 86 +++++++-------------------------------
 xen/drivers/acpi/pm-op.c           |  6 ++-
 xen/include/acpi/cpufreq/cpufreq.h | 39 ++++++++++++++++-
 3 files changed, 56 insertions(+), 75 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hwp.c
index 8af02070bf..440d9be3a7 100644
--- a/xen/arch/x86/acpi/cpufreq/hwp.c
+++ b/xen/arch/x86/acpi/cpufreq/hwp.c
@@ -22,50 +22,6 @@ static bool __read_mostly feature_hdc;
 
 static bool __ro_after_init opt_cpufreq_hdc = true;
 
-union hwp_request
-{
-    struct
-    {
-        unsigned int min_perf:8;
-        unsigned int max_perf:8;
-        unsigned int desired:8;
-        unsigned int energy_perf:8;
-        unsigned int activity_window:10;
-        bool package_control:1;
-        unsigned int :16;
-        bool activity_window_valid:1;
-        bool energy_perf_valid:1;
-        bool desired_valid:1;
-        bool max_perf_valid:1;
-        bool min_perf_valid:1;
-    };
-    uint64_t raw;
-};
-
-struct hwp_drv_data
-{
-    union
-    {
-        uint64_t hwp_caps;
-        struct
-        {
-            unsigned int highest:8;
-            unsigned int guaranteed:8;
-            unsigned int most_efficient:8;
-            unsigned int lowest:8;
-            unsigned int :32;
-        } hw;
-    };
-    union hwp_request curr_req;
-    int ret;
-    uint16_t activity_window;
-    uint8_t minimum;
-    uint8_t maximum;
-    uint8_t desired;
-    uint8_t energy_perf;
-};
-static DEFINE_PER_CPU_READ_MOSTLY(struct hwp_drv_data *, hwp_drv_data);
-
 #define hwp_err(cpu, fmt, args...) \
     printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, ## args)
 #define hwp_info(fmt, args...)    printk(XENLOG_INFO "HWP: " fmt, ## args)
@@ -212,7 +168,7 @@ static bool __init hwp_available(void)
 
 static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
 {
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
 
     if ( !cpu_has_hwp_activity_window && data->activity_window )
     {
@@ -226,8 +182,8 @@ static int cf_check hwp_cpufreq_verify(struct cpufreq_policy *policy)
 
 static void cf_check hwp_write_request(void *info)
 {
-    const struct cpufreq_policy *policy = info;
-    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     union hwp_request hwp_req = data->curr_req;
 
     data->ret = 0;
@@ -247,7 +203,7 @@ static int cf_check hwp_cpufreq_target(struct cpufreq_policy *policy,
                                        unsigned int relation)
 {
     unsigned int cpu = policy->cpu;
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     /* Zero everything to ensure reserved bits are zero... */
     union hwp_request hwp_req = { .raw = 0 };
 
@@ -338,7 +294,7 @@ static void hwp_get_cpu_speeds(struct cpufreq_policy *policy)
 static void cf_check hwp_init_msrs(void *info)
 {
     struct cpufreq_policy *policy = info;
-    struct hwp_drv_data *data = this_cpu(hwp_drv_data);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     uint64_t val;
 
     /*
@@ -406,23 +362,15 @@ static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
     static bool __read_mostly first_run = true;
     static union hwp_request initial_req;
     unsigned int cpu = policy->cpu;
-    struct hwp_drv_data *data;
-
-    data = xzalloc(struct hwp_drv_data);
-    if ( !data )
-        return -ENOMEM;
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
 
     policy->governor = &cpufreq_gov_hwp;
 
-    per_cpu(hwp_drv_data, cpu) = data;
-
     on_selected_cpus(cpumask_of(cpu), hwp_init_msrs, policy, 1);
 
     if ( data->curr_req.raw == -1 )
     {
         hwp_err(cpu, "Could not initialize HWP properly\n");
-        per_cpu(hwp_drv_data, cpu) = NULL;
-        xfree(data);
         return -ENODEV;
     }
 
@@ -450,11 +398,6 @@ static int cf_check hwp_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
 static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
-
-    per_cpu(hwp_drv_data, policy->cpu) = NULL;
-    xfree(data);
-
     return 0;
 }
 
@@ -467,8 +410,8 @@ static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq_policy *policy)
  */
 static void cf_check hwp_set_misc_turbo(void *info)
 {
-    const struct cpufreq_policy *policy = info;
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, policy->cpu);
+    struct cpufreq_policy *policy = info;
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     uint64_t msr;
 
     data->ret = 0;
@@ -499,7 +442,7 @@ static int cf_check hwp_cpufreq_update(unsigned int cpu, struct cpufreq_policy *
 {
     on_selected_cpus(cpumask_of(cpu), hwp_set_misc_turbo, policy, 1);
 
-    return per_cpu(hwp_drv_data, cpu)->ret;
+    return policy->drv_data.hwp.ret;
 }
 #endif /* CONFIG_PM_OP */
 
@@ -516,12 +459,12 @@ hwp_cpufreq_driver = {
 };
 
 #ifdef CONFIG_PM_OP
-int get_hwp_para(unsigned int cpu,
+int get_hwp_para(const struct cpufreq_policy *policy,
                  struct xen_get_cppc_para *cppc_para)
 {
-    const struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    const struct hwp_drv_data *data = &policy->drv_data.hwp;
 
-    if ( data == NULL )
+    if ( !data->maximum )
         return -ENODATA;
 
     cppc_para->features         =
@@ -542,11 +485,10 @@ int get_hwp_para(unsigned int cpu,
 int set_hwp_para(struct cpufreq_policy *policy,
                  struct xen_set_cppc_para *set_cppc)
 {
-    unsigned int cpu = policy->cpu;
-    struct hwp_drv_data *data = per_cpu(hwp_drv_data, cpu);
+    struct hwp_drv_data *data = &policy->drv_data.hwp;
     bool cleared_act_window = false;
 
-    if ( data == NULL )
+    if ( !data->maximum )
         return -ENOENT;
 
     /* Validate all parameters - Disallow reserved bits. */
diff --git a/xen/drivers/acpi/pm-op.c b/xen/drivers/acpi/pm-op.c
index 4cca42c4fc..07bddc58d9 100644
--- a/xen/drivers/acpi/pm-op.c
+++ b/xen/drivers/acpi/pm-op.c
@@ -80,10 +80,12 @@ static int read_scaling_available_governors(char *scaling_available_governors,
 static int get_cpufreq_cppc(unsigned int cpu,
                             struct xen_get_cppc_para *cppc_para)
 {
+    const struct cpufreq_policy *policy =
+        per_cpu(cpufreq_cpu_policy, cpu);
     int ret = -ENODEV;
 
-    if ( hwp_active() )
-        ret = get_hwp_para(cpu, cppc_para);
+    if ( policy && hwp_active() )
+        ret = get_hwp_para(policy, cppc_para);
 
     return ret;
 }
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index f4b4f06613..0ffeab9aba 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -38,6 +38,42 @@ struct acpi_cpufreq_data {
     unsigned int arch_cpu_flags;
 };
 
+struct hwp_drv_data {
+    union {
+        uint64_t hwp_caps;
+        struct {
+            unsigned int highest:8;
+            unsigned int guaranteed:8;
+            unsigned int most_efficient:8;
+            unsigned int lowest:8;
+            unsigned int :32;
+        } hw;
+    };
+    union hwp_request {
+        struct {
+            unsigned int min_perf:8;
+            unsigned int max_perf:8;
+            unsigned int desired:8;
+            unsigned int energy_perf:8;
+            unsigned int activity_window:10;
+            bool package_control:1;
+            unsigned int :16;
+            bool activity_window_valid:1;
+            bool energy_perf_valid:1;
+            bool desired_valid:1;
+            bool max_perf_valid:1;
+            bool min_perf_valid:1;
+        };
+        uint64_t raw;
+    } curr_req;
+    int ret;
+    uint16_t activity_window;
+    uint8_t minimum;
+    uint8_t maximum;
+    uint8_t desired;
+    uint8_t energy_perf;
+};
+
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
@@ -83,6 +119,7 @@ struct cpufreq_policy {
 
     union {
         struct acpi_cpufreq_data acpi;
+        struct hwp_drv_data hwp;
     }                   drv_data;
 };
 DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
@@ -286,7 +323,7 @@ bool hwp_active(void);
 static inline bool hwp_active(void) { return false; }
 #endif
 
-int get_hwp_para(unsigned int cpu,
+int get_hwp_para(const struct cpufreq_policy *policy,
                  struct xen_get_cppc_para *cppc_para);
 int set_hwp_para(struct cpufreq_policy *policy,
                  struct xen_set_cppc_para *set_cppc);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 12:00:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 12:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214308.1524680 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhk6-0006MI-J4; Tue, 27 Jan 2026 12:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214308.1524680; Tue, 27 Jan 2026 12:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhk6-0006MA-GM; Tue, 27 Jan 2026 12:00:22 +0000
Received: by outflank-mailman (input) for mailman id 1214308;
 Tue, 27 Jan 2026 12:00: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 1vkhk5-0006M2-RV
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 12:00: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 1vkhk6-006AzP-0W
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkhk5-004FJ2-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2GnFyo5cbLCPILj+JK49uiXVEvqoMW0Kpj3O2d017ek=; b=uMTitEclmSIx0ac3nKNhZ/409i
	d9ieeQiqMz5amAZQOQk80oIhLrTwS9/5GrF8tKum7XRiWJ6er+n+ZZ22s457N2nrZvEK3trE5ZJPr
	nTpqPDtiSOh4X9IFiInqkMJoEyQMf/S3WWYgWlPas3Vrl3flsMsk91AJ7+m09xaYR570=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cpufreq/amd-cppc: move driver data into policy
Message-Id: <E1vkhk5-004FJ2-2Y@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 12:00:21 +0000

commit fc1d8c851a044022da81cd1052ec3093f4e349b6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:27:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:27:50 2026 +0100

    cpufreq/amd-cppc: move driver data into policy
    
    Share space with the ACPI, powernow, and HWP drivers, avoiding a separate
    allocation for each CPU.
    
    This then also reduces the concern over amd_cppc_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in policy->cpu
    (which would result in accesses of per-CPU data of offline CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Penny Zheng <penny.zheng@amd.com>
---
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 108 ++++-------------------------------
 xen/include/acpi/cpufreq/cpufreq.h   |  73 +++++++++++++++++++++++
 2 files changed, 85 insertions(+), 96 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/amd-cppc.c b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
index bb7f4e4a9e..4f16045a1c 100644
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -30,81 +30,6 @@
         printk(XENLOG_DEBUG "AMD-CPPC: CPU%u " fmt, cpu, ## args);  \
 })
 
-/*
- * Field highest_perf, nominal_perf, lowest_nonlinear_perf, and lowest_perf
- * contain the values read from CPPC capability MSR. They represent the limits
- * of managed performance range as well as the dynamic capability, which may
- * change during processor operation
- * Field highest_perf represents highest performance, which is the absolute
- * maximum performance an individual processor may reach, assuming ideal
- * conditions. This performance level may not be sustainable for long
- * durations and may only be achievable if other platform components
- * are in a specific state; for example, it may require other processors be
- * in an idle state. This would be equivalent to the highest frequencies
- * supported by the processor.
- * Field nominal_perf represents maximum sustained performance level of the
- * processor, assuming ideal operating conditions. All cores/processors are
- * expected to be able to sustain their nominal performance state
- * simultaneously.
- * Field lowest_nonlinear_perf represents Lowest Nonlinear Performance, which
- * is the lowest performance level at which nonlinear power savings are
- * achieved. Above this threshold, lower performance levels should be
- * generally more energy efficient than higher performance levels. So in
- * traditional terms, this represents the P-state range of performance levels.
- * Field lowest_perf represents the absolute lowest performance level of the
- * platform. Selecting it may cause an efficiency penalty but should reduce
- * the instantaneous power consumption of the processor. So in traditional
- * terms, this represents the T-state range of performance levels.
- *
- * Field max_perf, min_perf, des_perf store the values for CPPC request MSR.
- * Software passes performance goals through these fields.
- * Field max_perf conveys the maximum performance level at which the platform
- * may run. And it may be set to any performance value in the range
- * [lowest_perf, highest_perf], inclusive.
- * Field min_perf conveys the minimum performance level at which the platform
- * may run. And it may be set to any performance value in the range
- * [lowest_perf, highest_perf], inclusive but must be less than or equal to
- * max_perf.
- * Field des_perf conveys performance level Xen governor is requesting. And it
- * may be set to any performance value in the range [min_perf, max_perf],
- * inclusive. In active mode, des_perf must be zero.
- * Field epp represents energy performance preference, which only has meaning
- * when active mode is enabled. The EPP is used in the CCLK DPM controller
- * to drive the frequency that a core is going to operate during short periods
- * of activity, called minimum active frequency, It could contatin a range of
- * values from 0 to 0xff. An EPP of zero sets the min active frequency to
- * maximum frequency, while an EPP of 0xff sets the min active frequency to
- * approxiately Idle frequency.
- */
-struct amd_cppc_drv_data
-{
-    const struct xen_processor_cppc *cppc_data;
-    union {
-        uint64_t raw;
-        struct {
-            unsigned int lowest_perf:8;
-            unsigned int lowest_nonlinear_perf:8;
-            unsigned int nominal_perf:8;
-            unsigned int highest_perf:8;
-            unsigned int :32;
-        };
-    } caps;
-    union {
-        uint64_t raw;
-        struct {
-            unsigned int max_perf:8;
-            unsigned int min_perf:8;
-            unsigned int des_perf:8;
-            unsigned int epp:8;
-            unsigned int :32;
-        };
-    } req;
-
-    int err;
-};
-
-static DEFINE_PER_CPU_READ_MOSTLY(struct amd_cppc_drv_data *,
-                                  amd_cppc_drv_data);
 /*
  * Core max frequency read from PstateDef as anchor point
  * for freq-to-perf transition
@@ -279,11 +204,11 @@ static void cf_check amd_cppc_write_request_msrs(void *info)
     wrmsrl(MSR_AMD_CPPC_REQ, data->req.raw);
 }
 
-static void amd_cppc_write_request(unsigned int cpu, uint8_t min_perf,
-                                   uint8_t des_perf, uint8_t max_perf,
-                                   uint8_t epp)
+static void amd_cppc_write_request(struct cpufreq_policy *policy,
+                                   uint8_t min_perf, uint8_t des_perf,
+                                   uint8_t max_perf, uint8_t epp)
 {
-    struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data, cpu);
+    struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
     uint64_t prev = data->req.raw;
 
     data->req.min_perf = min_perf;
@@ -295,15 +220,15 @@ static void amd_cppc_write_request(unsigned int cpu, uint8_t min_perf,
     if ( prev == data->req.raw )
         return;
 
-    on_selected_cpus(cpumask_of(cpu), amd_cppc_write_request_msrs, data, 1);
+    on_selected_cpus(cpumask_of(policy->cpu), amd_cppc_write_request_msrs,
+                     data, 1);
 }
 
 static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
                                             unsigned int target_freq,
                                             unsigned int relation)
 {
-    unsigned int cpu = policy->cpu;
-    const struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data, cpu);
+    const struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
     uint8_t des_perf;
     int res;
 
@@ -320,7 +245,7 @@ static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
      * may actually cause an efficiency penalty, So when deciding the min_perf
      * value, we prefer lowest nonlinear performance over lowest performance.
      */
-    amd_cppc_write_request(policy->cpu, data->caps.lowest_nonlinear_perf,
+    amd_cppc_write_request(policy, data->caps.lowest_nonlinear_perf,
                            des_perf, data->caps.highest_perf,
                            /* Pre-defined BIOS value for passive mode */
                            per_cpu(epp_init, policy->cpu));
@@ -330,7 +255,7 @@ static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
 static void cf_check amd_cppc_init_msrs(void *info)
 {
     struct cpufreq_policy *policy = info;
-    struct amd_cppc_drv_data *data = this_cpu(amd_cppc_drv_data);
+    struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
     uint64_t val;
     unsigned int min_freq = 0, nominal_freq = 0, max_freq;
 
@@ -431,24 +356,16 @@ static void amd_cppc_boost_init(struct cpufreq_policy *policy,
 
 static int cf_check amd_cppc_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
-    XVFREE(per_cpu(amd_cppc_drv_data, policy->cpu));
-
     return 0;
 }
 
 static int amd_cppc_cpufreq_init_perf(struct cpufreq_policy *policy)
 {
     unsigned int cpu = policy->cpu;
-    struct amd_cppc_drv_data *data;
-
-    data = xvzalloc(struct amd_cppc_drv_data);
-    if ( !data )
-        return -ENOMEM;
+    struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
 
     data->cppc_data = &processor_pminfo[cpu]->cppc_data;
 
-    per_cpu(amd_cppc_drv_data, cpu) = data;
-
     on_selected_cpus(cpumask_of(cpu), amd_cppc_init_msrs, policy, 1);
 
     /*
@@ -506,8 +423,7 @@ static void amd_cppc_prepare_policy(struct cpufreq_policy *policy,
                                     uint8_t *max_perf, uint8_t *min_perf,
                                     uint8_t *epp)
 {
-    const struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data,
-                                                   policy->cpu);
+    const struct amd_cppc_drv_data *data = &policy->drv_data.amd_cppc;
 
     /*
      * On default, set min_perf with lowest_nonlinear_perf, and max_perf
@@ -560,7 +476,7 @@ static int cf_check amd_cppc_epp_set_policy(struct cpufreq_policy *policy)
 
     amd_cppc_prepare_policy(policy, &max_perf, &min_perf, &epp);
 
-    amd_cppc_write_request(policy->cpu, min_perf,
+    amd_cppc_write_request(policy, min_perf,
                            0 /* no des_perf in active mode */,
                            max_perf, epp);
     return 0;
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 0ffeab9aba..479cf19b6a 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -74,6 +74,78 @@ struct hwp_drv_data {
     uint8_t energy_perf;
 };
 
+/*
+ * Field highest_perf, nominal_perf, lowest_nonlinear_perf, and lowest_perf
+ * contain the values read from CPPC capability MSR. They represent the limits
+ * of managed performance range as well as the dynamic capability, which may
+ * change during processor operation
+ * Field highest_perf represents highest performance, which is the absolute
+ * maximum performance an individual processor may reach, assuming ideal
+ * conditions. This performance level may not be sustainable for long
+ * durations and may only be achievable if other platform components
+ * are in a specific state; for example, it may require other processors be
+ * in an idle state. This would be equivalent to the highest frequencies
+ * supported by the processor.
+ * Field nominal_perf represents maximum sustained performance level of the
+ * processor, assuming ideal operating conditions. All cores/processors are
+ * expected to be able to sustain their nominal performance state
+ * simultaneously.
+ * Field lowest_nonlinear_perf represents Lowest Nonlinear Performance, which
+ * is the lowest performance level at which nonlinear power savings are
+ * achieved. Above this threshold, lower performance levels should be
+ * generally more energy efficient than higher performance levels. So in
+ * traditional terms, this represents the P-state range of performance levels.
+ * Field lowest_perf represents the absolute lowest performance level of the
+ * platform. Selecting it may cause an efficiency penalty but should reduce
+ * the instantaneous power consumption of the processor. So in traditional
+ * terms, this represents the T-state range of performance levels.
+ *
+ * Field max_perf, min_perf, des_perf store the values for CPPC request MSR.
+ * Software passes performance goals through these fields.
+ * Field max_perf conveys the maximum performance level at which the platform
+ * may run. And it may be set to any performance value in the range
+ * [lowest_perf, highest_perf], inclusive.
+ * Field min_perf conveys the minimum performance level at which the platform
+ * may run. And it may be set to any performance value in the range
+ * [lowest_perf, highest_perf], inclusive but must be less than or equal to
+ * max_perf.
+ * Field des_perf conveys performance level Xen governor is requesting. And it
+ * may be set to any performance value in the range [min_perf, max_perf],
+ * inclusive. In active mode, des_perf must be zero.
+ * Field epp represents energy performance preference, which only has meaning
+ * when active mode is enabled. The EPP is used in the CCLK DPM controller
+ * to drive the frequency that a core is going to operate during short periods
+ * of activity, called minimum active frequency, It could contatin a range of
+ * values from 0 to 0xff. An EPP of zero sets the min active frequency to
+ * maximum frequency, while an EPP of 0xff sets the min active frequency to
+ * approxiately Idle frequency.
+ */
+struct amd_cppc_drv_data {
+    const struct xen_processor_cppc *cppc_data;
+    union {
+        uint64_t raw;
+        struct {
+            unsigned int lowest_perf:8;
+            unsigned int lowest_nonlinear_perf:8;
+            unsigned int nominal_perf:8;
+            unsigned int highest_perf:8;
+            unsigned int :32;
+        };
+    } caps;
+    union {
+        uint64_t raw;
+        struct {
+            unsigned int max_perf:8;
+            unsigned int min_perf:8;
+            unsigned int des_perf:8;
+            unsigned int epp:8;
+            unsigned int :32;
+        };
+    } req;
+
+    int err;
+};
+
 struct cpufreq_cpuinfo {
     unsigned int        max_freq;
     unsigned int        second_max_freq;    /* P1 if Turbo Mode is on */
@@ -120,6 +192,7 @@ struct cpufreq_policy {
     union {
         struct acpi_cpufreq_data acpi;
         struct hwp_drv_data hwp;
+        struct amd_cppc_drv_data amd_cppc;
     }                   drv_data;
 };
 DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 12:00:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 12:00:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214309.1524683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhkG-0006Ox-LX; Tue, 27 Jan 2026 12:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214309.1524683; Tue, 27 Jan 2026 12:00:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhkG-0006Op-J1; Tue, 27 Jan 2026 12:00:32 +0000
Received: by outflank-mailman (input) for mailman id 1214309;
 Tue, 27 Jan 2026 12:00: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 1vkhkF-0006Oc-UQ
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 12:00: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 1vkhkG-006Azn-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkhkF-004FMO-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wAE08gDxqSbgDQacRyh5sFvO6r5HTnseHLwN3DrmcJs=; b=5nlKU9EdPqISnUJPhV8ktc8EB9
	IQfNZhZv82dmLXm9oGJlL0yHwdtu8uyIjYoCOA8jDsimDH7sK7vXzlDwdkSRSyX6WSGSfgSp+esDx
	c7qAfR6VQ0Nw7pMNlA7oMkVX+YG83IS1RbqEmENRy052cxiRCa2etS5bOK9HijzkXx7A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cpufreq/amd-cppc: move epp_init into driver data
Message-Id: <E1vkhkF-004FMO-2p@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 12:00:31 +0000

commit b8e26d974784a56bb5b438b43017ebe99e8abb13
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:28:09 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:28:09 2026 +0100

    cpufreq/amd-cppc: move epp_init into driver data
    
    No reason for it to be a separate per-CPU item; it's connected to a
    struct cpufreq_policy instance just like other driver data.
    
    This further reduces the concern over amd_cppc_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in policy->cpu
    (which would result in accesses of per-CPU data of offline CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Penny Zheng <penny.zheng@amd.com>
---
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 7 +++----
 xen/include/acpi/cpufreq/cpufreq.h   | 2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/amd-cppc.c b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
index 4f16045a1c..c034d84767 100644
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -35,7 +35,6 @@
  * for freq-to-perf transition
  */
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned int, pxfreq_mhz);
-static DEFINE_PER_CPU_READ_MOSTLY(uint8_t, epp_init);
 #ifndef NDEBUG
 static bool __ro_after_init opt_active_mode;
 #else
@@ -248,7 +247,7 @@ static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
     amd_cppc_write_request(policy, data->caps.lowest_nonlinear_perf,
                            des_perf, data->caps.highest_perf,
                            /* Pre-defined BIOS value for passive mode */
-                           per_cpu(epp_init, policy->cpu));
+                           data->epp_init);
     return 0;
 }
 
@@ -326,7 +325,7 @@ static void cf_check amd_cppc_init_msrs(void *info)
 
     /* Store pre-defined BIOS value for passive mode */
     rdmsrl(MSR_AMD_CPPC_REQ, val);
-    this_cpu(epp_init) = MASK_EXTR(val, AMD_CPPC_EPP_MASK);
+    data->epp_init = MASK_EXTR(val, AMD_CPPC_EPP_MASK);
 
     return;
 
@@ -465,7 +464,7 @@ static void amd_cppc_prepare_policy(struct cpufreq_policy *policy,
         break;
 
     default:
-        *epp = per_cpu(epp_init, policy->cpu);
+        *epp = data->epp_init;
         break;
     }
 }
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 479cf19b6a..5c39d38c79 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -143,6 +143,8 @@ struct amd_cppc_drv_data {
         };
     } req;
 
+    uint8_t epp_init;
+
     int err;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 12:00:42 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 12:00:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214310.1524688 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhkQ-0006R0-Mo; Tue, 27 Jan 2026 12:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214310.1524688; Tue, 27 Jan 2026 12:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkhkQ-0006Qs-KK; Tue, 27 Jan 2026 12:00:42 +0000
Received: by outflank-mailman (input) for mailman id 1214310;
 Tue, 27 Jan 2026 12:00: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 1vkhkQ-0006Qi-11
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 12:00: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 1vkhkQ-006Azz-15
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkhkP-004FPV-38
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 12:00:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2MK66ivEsUEcWFUlFiqDemRY2lVSdjTIsYTc1X0Wr5Q=; b=hOCnfZpC1wJTKPV8Hu79i0/CDm
	GipyS8ddVMB0DORLD/TjTGAvF5Cn4+kLZ4vNhudGRs0343iahiU/HrIYmkoeKLEvPVMR9caBlCrJO
	YyqLDA+Mh+HdXIFphzKcFdXvtm1zIrp97I8ERfHA516LTqF5cHKRcMyY98WL9gEhu3eU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cpufreq/amd-cppc: move pxfreq_mhz into driver data
Message-Id: <E1vkhkP-004FPV-38@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 12:00:41 +0000

commit 02bbdda863697096b63e83c2c0a37aa167045476
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 10:28:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 10:28:27 2026 +0100

    cpufreq/amd-cppc: move pxfreq_mhz into driver data
    
    No reason for it to be a separate per-CPU item; it's connected to a
    struct cpufreq_policy instance just like other driver data.
    
    This also eliminates the concern over amd_cppc_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in policy->cpu
    (which would result in accesses of per-CPU data of offline CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Penny Zheng <penny.zheng@amd.com>
---
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 11 +++--------
 xen/include/acpi/cpufreq/cpufreq.h   |  6 ++++++
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/amd-cppc.c b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
index c034d84767..ae9b8beaab 100644
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -30,11 +30,6 @@
         printk(XENLOG_DEBUG "AMD-CPPC: CPU%u " fmt, cpu, ## args);  \
 })
 
-/*
- * Core max frequency read from PstateDef as anchor point
- * for freq-to-perf transition
- */
-static DEFINE_PER_CPU_READ_MOSTLY(unsigned int, pxfreq_mhz);
 #ifndef NDEBUG
 static bool __ro_after_init opt_active_mode;
 #else
@@ -117,7 +112,7 @@ static int amd_cppc_khz_to_perf(const struct amd_cppc_drv_data *data,
     {
         /* Read Processor Max Speed(MHz) as anchor point */
         mul = data->caps.highest_perf;
-        div = this_cpu(pxfreq_mhz);
+        div = data->pxfreq_mhz;
         if ( !div )
             return -EOPNOTSUPP;
     }
@@ -160,7 +155,7 @@ static int amd_get_cpc_freq(const struct amd_cppc_drv_data *data,
     }
 
     /* Read Processor Max Speed(MHz) as anchor point */
-    mul = this_cpu(pxfreq_mhz);
+    mul = data->pxfreq_mhz;
     if ( !mul )
         return -EOPNOTSUPP;
     div = data->caps.highest_perf;
@@ -287,7 +282,7 @@ static void cf_check amd_cppc_init_msrs(void *info)
     }
 
     amd_process_freq(&cpu_data[policy->cpu],
-                     NULL, NULL, &this_cpu(pxfreq_mhz));
+                     NULL, NULL, &data->pxfreq_mhz);
 
     data->err = amd_get_cpc_freq(data, data->cppc_data->cpc.lowest_mhz,
                                  data->caps.lowest_perf, &min_freq);
diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h
index 5c39d38c79..0171ccf0ba 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -145,6 +145,12 @@ struct amd_cppc_drv_data {
 
     uint8_t epp_init;
 
+    /*
+     * Core max frequency read from PstateDef as anchor point
+     * for freq-to-perf transition
+     */
+    unsigned int pxfreq_mhz;
+
     int err;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214659.1524864 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkiqV-00084a-DJ; Tue, 27 Jan 2026 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214659.1524864; Tue, 27 Jan 2026 13:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkiqV-00084S-Ao; Tue, 27 Jan 2026 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1214659;
 Tue, 27 Jan 2026 13: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 1vkiqT-00084M-N7
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13: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 1vkiqU-006CQY-00
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkiqT-004JXi-21
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13: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=zSE+2lECLVqNgOqPes0J+W3N8knpxxKYKqMNchPQjeA=; b=6eoZ1K4042xnBB5ktd1wq8oGc9
	6mXuC5UjcvcRPMDGMuDEy196NPkSFTpUYXAMFEpOkc7nQXEdG9BUAJO473RHqQsPagvuqEGfy1z1E
	DwFSvD0tmbI7G2ZQ0OGj39qyb2RCl1KPvKbcbb7GthisKauc/P2XLiY/QKtFS66i1o24=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkiqT-004JXi-21@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:11:01 +0000

commit a6626b613a843c6d4c3c453e45f84046f2d10302
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 13:55:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 13:55:01 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 03be61e225..e24ef0686f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1970,15 +1970,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2048,11 +2048,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2077,13 +2080,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2672,7 +2678,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 4e955ef35b..e1d940bf6a 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214660.1524869 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkiqf-00086J-El; Tue, 27 Jan 2026 13:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214660.1524869; Tue, 27 Jan 2026 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 1vkiqf-00086B-C7; Tue, 27 Jan 2026 13:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1214660;
 Tue, 27 Jan 2026 13: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 1vkiqd-00085r-Pl
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13: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 1vkiqe-006CQs-0J
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkiqd-004JYx-2J
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13: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=r4nkDKEr4zLwK0FK9D9oQNSkywsIYgOVfLp3jsL49m4=; b=QsLWv/MVM8yp64ju1XE/t+813E
	ft0DrT/kcJiuX2CtC1GaH4HNHihdKZGgrlDq7LT3++7puvBF1Fwc0o8GNLHVKOSAE/kkaD8HwJK61
	uVzG0MVn2rxg2Ji3hfJXEBNR4+t5p8mX+ozl7FQ+Ba6Z+V2FuStAZbWKK9AMMp3EFmsI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkiqd-004JYx-2J@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:11:11 +0000

commit 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 13:55:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 13:55:27 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c29a6b0dec..edb76366b5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2174,33 +2174,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214661.1524874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkiqp-00088p-Gg; Tue, 27 Jan 2026 13:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214661.1524874; Tue, 27 Jan 2026 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 1vkiqp-00088h-DR; Tue, 27 Jan 2026 13:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1214661;
 Tue, 27 Jan 2026 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 1vkiqo-00088T-6a
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 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 1vkiqo-006CQw-1d
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkiqo-004JaN-0Q
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 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=lCVvpoPXwLiCyhEVy7iR+uo2JWUXvxlMdWT6pK64hR8=; b=6P+89Lrc531hetR4sDcvKzzB29
	QhIVU13WZmh5K/SVhart2Dxlrh/XhmhIsCw9b0/zFeuLIuRvxfs9OhVn3qG8GU4UgwPYI4yLhrL28
	53Ry9xDsMM2BaQOV9wZOCcIM4B0DvGfLsRAvxuLESLVyCUNQMsC7B3KwrwKO8hspQFcQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
Message-Id: <E1vkiqo-004JaN-0Q@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:11:22 +0000

commit 2872cd31219843b5aa5d51b3c88da191e13a4a1d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Dec 3 11:18:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:54:06 2026 +0000

    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit cfb767759b21096fa499d6889d5987c93ebb6cfd)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214662.1524877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkiqz-0008B1-Id; Tue, 27 Jan 2026 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214662.1524877; Tue, 27 Jan 2026 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 1vkiqz-0008At-F2; Tue, 27 Jan 2026 13:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1214662;
 Tue, 27 Jan 2026 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 1vkiqy-0008An-Ae
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 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 1vkiqy-006CRL-23
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkiqy-004JbO-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 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=dnNUXT9VJpVHJSu8QMfvqCpq0fCGMjfpzvlhJwY4qrY=; b=QgjGampnNuvnJlqSiWny7ydcu7
	qGuW4v8cmhsU/ZufeGIFpqFvV+l6zIHB5Sx8kCgr6DyCJYPJjcfRy3nI3z2LIgfnDaM0xj6JHvGXA
	9yT6RLgU6mm3o6mWqoLpq6fIa5nNF5ATDVXxCN1M4m/vXWxpRRQOrYgVxxwBt3/B7AqU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkiqy-004JbO-0q@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:11:32 +0000

commit 41b9ae5d7e5c5f5e14fd3c362e033188815f6deb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:01:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:01:58 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 7be9c180ec..5a7b2f99f5 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1970,15 +1970,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2048,11 +2048,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2077,13 +2080,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2672,7 +2678,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214663.1524881 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkir9-0008Da-LE; Tue, 27 Jan 2026 13:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214663.1524881; Tue, 27 Jan 2026 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 1vkir9-0008DS-IW; Tue, 27 Jan 2026 13:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1214663;
 Tue, 27 Jan 2026 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 1vkir8-0008DM-Ek
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 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 1vkir8-006CRS-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkir8-004JcI-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 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=4F7qiY2ljD0M7KzY67IDBHQWLT6Sf39hn+RJO8KPowE=; b=Y2QBYofyAlMG6ASjZm4VuaGG32
	hk6a5hHxqkKu6GC37b5gSzirvEHGlHn0SFgj+k63upbNIWESGfq8MrI4MI8tcB2AQjla4qfaWYn59
	rVTfMsJm+psFu8kUZt/lI8PB2v4f2FxXEvXZmVKgy+RGwhq50jq/N9ojN0fMQy/OflCA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkir8-004JcI-1D@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:11:42 +0000

commit 3146587dbc489cce60cae471fd63ef822b5c05a4
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:02:52 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:02:52 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 19fd86ce88..d8cf91ba34 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2204,33 +2204,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214701.1524915 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj19-0002e4-8A; Tue, 27 Jan 2026 13:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214701.1524915; Tue, 27 Jan 2026 13: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 1vkj19-0002dw-5f; Tue, 27 Jan 2026 13:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1214701;
 Tue, 27 Jan 2026 13:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkj18-0002do-F1
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj18-006CfD-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj18-004KxX-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bz+30NPX7dum/ElsXs6lnzbjbBCKATCqtQLzKCvjHIs=; b=YPgUsjFNCDHDU6I/WjZOZ+j2Rd
	J+WLGPuPlSsdtOiGsldy1tOdCEBxq9L20XrFiXgT0crY5upXlixxy+qms9vHv0souU7ZfO6SvdO+4
	MBJ4cbRG9QhAD7RwwSH9P0/lxipDp9BQltbh1or+XIKnLn/WBZ74Sn+SregUbM3UR2p4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
Message-Id: <E1vkj18-004KxX-1D@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:22:02 +0000

commit dacc9da9a73fbeec189db98709bd6c30979318a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 11:50:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:52:51 2026 +0000

    CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 331f94d0bbd11b93d12c762300039c9b36e561c5)
    
    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit cfb767759b21096fa499d6889d5987c93ebb6cfd)
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 3163ab8f11..aaa6cc8bf4 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -2,8 +2,8 @@
 freebsd_versions: &FREEBSD_VERSIONS
   env:
     FREEBSD_LEGACY:     freebsd-13-5
-    FREEBSD_PRODUCTION: freebsd-14-2
-    FREEBSD_CURRENT:    freebsd-15-0-snap
+    FREEBSD_PRODUCTION: freebsd-14-3
+    FREEBSD_CURRENT:    freebsd-15-0-amd64-ufs
 
 # Build jobs
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214702.1524918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj1J-0002gQ-9j; Tue, 27 Jan 2026 13:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214702.1524918; Tue, 27 Jan 2026 13: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 1vkj1J-0002gI-7B; Tue, 27 Jan 2026 13:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1214702;
 Tue, 27 Jan 2026 13:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkj1I-0002g8-HZ
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj1I-006CfO-2k
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj1I-004Kzp-1Y
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wNrZE4tbhD1O4dgdeXD/xtJihBq2m/SP6xA5WwV1N5I=; b=2CPL0WvXKpPX5ouhe/FZnz+Ati
	ceuMn6v3yz8reO99OPXgUQh2TFNBF0K/liRpm8R4xBtU5EzPCwmG6KTQTpMs+MAOy3cm320/ibfMt
	0lP74dvMW0jKCIl6fZHv1EULR0tCzdWBeMwVaFuWQGi+K2CDxNVzu08lYQgxk1F1F7C8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkj1I-004Kzp-1Y@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:22:12 +0000

commit f63a5ba705b929ba1fb2e7b7d106c610e0353b87
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:03:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:03:48 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 10ddc408ff..ccaac3c5ae 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1965,15 +1965,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2043,11 +2043,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2072,13 +2075,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2659,7 +2665,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214703.1524924 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj1U-0002jF-Bm; Tue, 27 Jan 2026 13:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214703.1524924; Tue, 27 Jan 2026 13: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 1vkj1U-0002j5-8Z; Tue, 27 Jan 2026 13:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1214703;
 Tue, 27 Jan 2026 13:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkj1S-0002iv-L5
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj1S-006Cfc-33
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj1S-004L2U-1q
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vQQrG7epYNYErrYFxZ2IvnW9BzcrF552kmVSI4ZnWIw=; b=YGhySJQfon3wMSQ1EXSN/qqB+s
	Ddpa994W+eAnL9xmwlDLZKlEAClvspQueO2Q217TFpGdx6Ogi5T5q58sKpVLkhZm0Os9N9wk7zc8s
	MK/AOdZIA4toiiaGVncL5qG8hieSFc9lXHULVG1UnU1maHihk9oSl1pCjoxFg4jqQHvY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkj1S-004L2U-1q@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:22:22 +0000

commit f48e4904ab8167ecb0ce78a165d1a446f6af9260
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:04:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:04:20 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 78a13e6812..93580b9a58 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2100,33 +2100,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214704.1524927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj1e-0002lT-Cd; Tue, 27 Jan 2026 13:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214704.1524927; Tue, 27 Jan 2026 13: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 1vkj1e-0002lL-9w; Tue, 27 Jan 2026 13:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1214704;
 Tue, 27 Jan 2026 13:22: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 1vkj1d-0002lD-15
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:22: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 1vkj1d-006CgC-16
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj1c-004L6X-39
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13: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=eUfgQoYmmpJqL/mNnAw1f7dc0iXCKIPBpfrcneDz5yM=; b=ap+7ELUpPxDWAxTTeJM3kPewRx
	LCjauBqUq8PrDwGflAGi5hEcMAIcW7PJEzb/W1NCy0WwE+cJSl7ucEnsLfFSbCV3+GP2X8H7J7E/B
	TpmkAufdO4ctso8tQxhXl8XfUUplitDD64PcfobLxoBkwN0/f3BVH3RvfGk6ovLBH8KA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
Message-Id: <E1vkj1c-004L6X-39@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:22:32 +0000

commit fb0dd88d59a87edec86874006b8a0b8f4f595da2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 11:50:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:53:13 2026 +0000

    CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 331f94d0bbd11b93d12c762300039c9b36e561c5)
    
    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit cfb767759b21096fa499d6889d5987c93ebb6cfd)
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 3163ab8f11..aaa6cc8bf4 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -2,8 +2,8 @@
 freebsd_versions: &FREEBSD_VERSIONS
   env:
     FREEBSD_LEGACY:     freebsd-13-5
-    FREEBSD_PRODUCTION: freebsd-14-2
-    FREEBSD_CURRENT:    freebsd-15-0-snap
+    FREEBSD_PRODUCTION: freebsd-14-3
+    FREEBSD_CURRENT:    freebsd-15-0-amd64-ufs
 
 # Build jobs
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214706.1524931 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj1o-0002nv-E1; Tue, 27 Jan 2026 13:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214706.1524931; Tue, 27 Jan 2026 13: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 1vkj1o-0002nn-BI; Tue, 27 Jan 2026 13:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1214706;
 Tue, 27 Jan 2026 13: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 1vkj1n-0002nf-3u
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13: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 1vkj1n-006CgP-1N
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj1n-004L7H-0D
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22: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=c6538TWauIGXeH1KPXbmC8Gg7pB0uARkFEgJE+uN+DQ=; b=Hpc9yH0Sxh2/mF/ebgQXLJDvau
	18Zp2v+aiKleqeeR9hbeYI1jBayQ99AuAxuIhXjRPRGUL/WdHCadM7+JMUV+hyFE15IsOz7OVTxxk
	3Sfm6Hg+2Rnl8uXLfDlTFotXMkZ/I7sYT+VnTRBxxlUkt9JJaYli5KCfVYTLfveHWgo8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkj1n-004L7H-0D@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:22:43 +0000

commit a9d58e5e40cfbcc3004ae69777e38aab78c96b84
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:05:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:05:04 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 8e0046ae69..27022c3e0e 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1965,15 +1965,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2043,11 +2043,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2072,13 +2075,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2659,7 +2665,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214707.1524935 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj1y-0002qV-Gp; Tue, 27 Jan 2026 13:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214707.1524935; Tue, 27 Jan 2026 13:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj1y-0002qN-Dw; Tue, 27 Jan 2026 13:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1214707;
 Tue, 27 Jan 2026 13:22: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 1vkj1x-0002qH-6h
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:22: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 1vkj1x-006Cgd-1f
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj1x-004L8L-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:22: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=rS0CF4MH6tn+xSt/DxlE7Ah2f2qK7j4H+3QBDClS4lM=; b=vUzTOuyLKgocMDmerdW6/aB7ue
	2KD6PW+ED7FpuVYKR+km+JD0qL7p5VvXqDv008iwj686gX+3/2ESuou52EEDL60jAkzf7TFQZaHPO
	MFO+Q+lf/OhHXQkmwj6DMS69eXsYVSOXr4gai7SEwZI2/qsWJz5KtH6dttK4LDgHzRfY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkj1x-004L8L-0T@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:22:53 +0000

commit 495cfdccc53895097376bad6a55b4c67b89edc6f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:05:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:05:35 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index ccadfe0c9e..4c60117215 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2113,33 +2113,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214708.1524938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj28-0002se-Hu; Tue, 27 Jan 2026 13:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214708.1524938; Tue, 27 Jan 2026 13:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj28-0002sW-FQ; Tue, 27 Jan 2026 13:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1214708;
 Tue, 27 Jan 2026 13:23:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkj27-0002sO-JN
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:23:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj27-006Ch3-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj27-004LAm-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:23: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=8358uKmuht2LMFWtVw11sEEtqCnX2F3w/tI2IabzMME=; b=w2yKB+tQYhU/1qQNv0Bw6hgBTJ
	/McldH77A5gxIVQ2lZUzSfuszl+ZGl+YuTj6B6L38bUr4ExWV0ft6Seecz0IlKhDY2J63aGdyx8Km
	rse+Vh41r8iQ4jbNxvYD/b9pGG4SUA7ZTGfCg+OkVG+qdAaQy140ulRAOSNKmYFLAQew=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] CI: Refresh CirrusCI configuration (FreeBSD 14.3)
Message-Id: <E1vkj27-004LAm-1j@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:23:03 +0000

commit 502d206de62f3b80c7ea2b837dd62480ca0245b8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 11:50:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:53:23 2026 +0000

    CI: Refresh CirrusCI configuration (FreeBSD 14.3)
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 331f94d0bbd11b93d12c762300039c9b36e561c5)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index eb46227892..04247d8b60 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -23,5 +23,5 @@ task:
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-2
+    image_family: freebsd-14-3
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:23:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214709.1524943 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj2I-0002uk-JF; Tue, 27 Jan 2026 13:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214709.1524943; Tue, 27 Jan 2026 13:23:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj2I-0002uc-Gh; Tue, 27 Jan 2026 13:23:14 +0000
Received: by outflank-mailman (input) for mailman id 1214709;
 Tue, 27 Jan 2026 13:23: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 1vkj2H-0002uW-MC
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:23: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 1vkj2H-006ChL-3C
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:23:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj2H-004LDf-22
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:23: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=/0TK5xm1lPI21gN7+XKq1n+8GN8PaFIEsa0UuiusftA=; b=m6JXsy16COMMhtbnCUSoMbttCW
	FIKVGEafRuqcWjhvL91UpVZ5t9oE07IGg4uG2ELs/g/PKNksbQkfsr+S5fmzR+EyDPdYN/kErXf5n
	vXbzHGCR/IjKi2/rFQny7MIgPcxk9QR00vPJ8o/pQX2PyLqymN14GST9ggDb3uyv0XNc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkj2H-004LDf-22@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:23:13 +0000

commit f196c2f4dcf5711aa159c32b8053af60bade588c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:06:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:06:39 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 24 ++++++++++++++++--------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 90cf0ceaa3..5585944b6f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1965,15 +1965,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 static inline void trace_shadow_gen(u32 event, guest_va_t va)
 {
     if ( tb_init_done )
@@ -2062,11 +2062,14 @@ static inline void trace_shadow_emulate_other(u32 event,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2088,8 +2091,13 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
     if ( tb_init_done )
     {
         struct __packed {
-            /* for PAE, guest_l1e may be 64 while guest_va may be 32;
-               so put it first for alignment sake. */
+            /*
+             * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
+             * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
+             */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
@@ -2099,7 +2107,7 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
         event = TRC_SHADOW_EMULATE | ((GUEST_PAGING_LEVELS-2)<<8);
 
         d.gl1e = gl1e;
-        d.write_val.l1 = this_cpu(trace_emulate_write_val);
+        d.write_val = this_cpu(trace_emulate_write_val);
         d.va = va;
 #if GUEST_PAGING_LEVELS == 3
         d.emulation_count = this_cpu(trace_extra_emulation_count);
@@ -2680,7 +2688,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 13:23:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 13:23:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214710.1524947 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkj2T-0002xA-Kf; Tue, 27 Jan 2026 13:23:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214710.1524947; Tue, 27 Jan 2026 13:23: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 1vkj2T-0002x2-I3; Tue, 27 Jan 2026 13:23:25 +0000
Received: by outflank-mailman (input) for mailman id 1214710;
 Tue, 27 Jan 2026 13:23:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkj2R-0002wu-Oi
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 13:23: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 1vkj2S-006Chb-0F
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkj2R-004LFQ-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 13:23: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=ll/FsSM0LjUPGZFFlssgeQO1yIOK7i6p3+oaSXv+RYM=; b=1RYq6pDz6mp8qNFAZHINK5FRrP
	TME8xG+durXsLOX/bu25cMl8P010vWvMd6ClL2HsARtYmXILXHLu40H+IVvT84Ty5G5JP8Di+/oOO
	eeOzxqpT+U5ARkppLv4Qc1xuGcPLogM90Kv4i3OS4/J73cZIyeQopB2c+HkvAyEhGjz4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkj2R-004LFQ-2I@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 13:23:23 +0000

commit d4775257e38c2f932f7a38bac45f6dc2525fc793
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:07:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:07:03 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5feb0d0679..d81cb6f006 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2082,33 +2082,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 14:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 14:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214837.1525070 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjmZ-0007AR-Ih; Tue, 27 Jan 2026 14:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214837.1525070; Tue, 27 Jan 2026 14:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjmZ-0007AJ-G6; Tue, 27 Jan 2026 14:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1214837;
 Tue, 27 Jan 2026 14: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 1vkjmX-0007AB-Jj
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 14: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 1vkjmX-006Dhn-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkjmX-004SGn-1T
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14: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=+fNheEz4zjU7lO1bvGhqwYAhcYQ4wboh75LVgcUjS1w=; b=Vv+2x9BTw2cEFNPte/lkNFCdG1
	Fx26TLJrjeDbVUVvQG6fTGXsTbKZfY/kfU98nuSrtuLiZaJeLbr61ctrMrANZvqqvIm3TRh6Q+jYd
	PWv5JMhfdLMwb+ZC0hCYk1DB7k2BQAzKqc4zQhAvlwlMnZP534RFFONGbeco6dbQ9lH4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkjmX-004SGn-1T@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 14:11:01 +0000

commit a6626b613a843c6d4c3c453e45f84046f2d10302
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 13:55:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 13:55:01 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 03be61e225..e24ef0686f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1970,15 +1970,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2048,11 +2048,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2077,13 +2080,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2672,7 +2678,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 4e955ef35b..e1d940bf6a 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 14:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 14:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214838.1525075 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjmj-0007Cs-KK; Tue, 27 Jan 2026 14:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214838.1525075; Tue, 27 Jan 2026 14:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjmj-0007Ck-HR; Tue, 27 Jan 2026 14:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1214838;
 Tue, 27 Jan 2026 14: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 1vkjmh-0007CS-N5
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 14: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 1vkjmh-006Dhv-37
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkjmh-004SJO-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14: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=v0zvwdztsXlFtKKUf7aLqMIi6flKyeAbzGwMBgFp4Is=; b=kMdRGO6spdHJZFw5D8oUV0w+Bm
	O4twIzrYUj5f6tZBH8KATvhTMb+54/uhzMhtPM1SR0XfkjMV/vWk3lBsIrOhGp4abHdFQHJjQPo3q
	dchaUn/i5L+xVaG2Z0hBnQiVKIDxJtuzndqi39mcT8JW4WJmoL010kjdjrBJLeeQ3W4g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkjmh-004SJO-1t@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 14:11:11 +0000

commit 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 13:55:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 13:55:27 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c29a6b0dec..edb76366b5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2174,33 +2174,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 14:11:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 14:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214839.1525079 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjms-0007Fp-NS; Tue, 27 Jan 2026 14:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214839.1525079; Tue, 27 Jan 2026 14:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjms-0007Fh-Kq; Tue, 27 Jan 2026 14:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1214839;
 Tue, 27 Jan 2026 14: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 1vkjms-0007FZ-6Q
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 14: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 1vkjms-006Di0-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkjms-004SOb-0Q
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14: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=mz2QjHENYyEpejZuJOsMoPd30yWp+6Mk6NR31M3n/0M=; b=t1oS1ycZmQ3tSk1eMrD8xtBIBE
	MPtXhWAJyIrsblcRUs/GIbDX3vUTRhmabEQTFi+Abnovf0l4SGFpPnInDgyKyhkoZGE4xFw73EwB9
	MSqC8hDRD7FhW5WfNLB5K3L9nXajmJxkn6pggGqwvSdA91DMdbC5OIxm4u2MDXjD2ppg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Adjust parse_ucode() to match other list handling
Message-Id: <E1vkjms-004SOb-0Q@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 14:11:22 +0000

commit 3a814060bbbd43b4ed0263d0b9441d31d1a3d051
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 19 19:35:05 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 13:59:12 2026 +0000

    x86/ucode: Adjust parse_ucode() to match other list handling
    
    parse_ucode() is abnormal compared to similar parsing elsewhere in Xen.
    
    Invert the ucode_mod_forced check with respect to the "scan" and integer
    handling, so we can warn the user when we've elected to ignore the parameters,
    and yield -EINVAL for any unrecognised list element.
    
    Rewrite the ucode= command line docs for clarity.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.pandoc | 66 +++++++++++++++++++++++++--------------
 xen/arch/x86/cpu/microcode/core.c | 22 ++++++++-----
 2 files changed, 57 insertions(+), 31 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index ece4dd4c93..d29ab08423 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2746,35 +2746,53 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
+> `= List of [ <integer>, scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
     Default: `scan` is selectable via Kconfig, `nmi,digest-check`
 
 Controls for CPU microcode loading, available when `CONFIG_MICROCODE_LOADING`
-is enabled. For early loading, this parameter can specify how and where to
-find the microcode update blob. For late loading, this parameter specifies if
-the update happens within a NMI handler.
-
-'integer' specifies the CPU microcode update blob module index. When positive,
-this specifies the n-th module (in the GrUB entry, zero based) to be used
-for updating CPU micrcode. When negative, counting starts at the end of
-the modules in the GrUB entry (so with the blob commonly being last,
-one could specify `ucode=-1`). Note that the value of zero is not valid
-here (entry zero, i.e. the first module, is always the Dom0 kernel
-image). Note further that use of this option has an unspecified effect
-when used with xen.efi (there the concept of modules doesn't exist, and
-the blob gets specified via the `ucode=<filename>` config file/section
-entry; see [EFI configuration file description](efi.html)).
-
-'scan' instructs the hypervisor to scan the multiboot images for an cpio
-image that contains microcode. Depending on the platform the blob with the
-microcode in the cpio name space must be:
-  - on Intel: kernel/x86/microcode/GenuineIntel.bin
-  - on AMD  : kernel/x86/microcode/AuthenticAMD.bin
-When using xen.efi, the `ucode=<filename>` config file setting takes
-precedence over `scan`. The default value for `scan` is set with
-`CONFIG_MICROCODE_SCAN_DEFAULT`.
+is enabled.
+
+In order to load microcode at boot, Xen needs to find a suitable update
+amongst the modules provided by the bootloader.  Two kinds of microcode update
+are supported:
+
+ 1. Raw microcode containers.  The format of the container is CPU vendor
+    specific.
+
+ 2. CPIO archive.  This is Linux's preferred mechanism, and involves having
+    the raw containers expressed as files
+    (e.g. `kernel/x86/microcode/{GenuineIntel,AuthenticAMD}.bin`) in a CPIO
+    archive, typically prepended to the initrd.
+
+The `<integer>` and `scan=<bool>` options are mutually exclusive and select
+between these two options.  Further restrictions exist for booting xen.efi
+(see below).
+
+ *  The `<integer>` option nominates a specific multiboot module as a raw
+    container (option 1 above).  Valid options start from 1 (module 0 is
+    always the dom0 kernel).  A negative number may be used, and will
+    back-reference from the end of the module list.  i.e. `ucode=-1` will
+    nominate the final multiboot module.
+
+ *  The `scan=` option causes Xen to search all modules in order to find the
+    first CPIO archive containing the appropriate file (option 2 above).  The
+    default for this option can be chosen at build time via
+    `CONFIG_MICROCODE_SCAN_DEFAULT`.
+
+When booting xen.efi natively, the concept of multiboot modules doesn't exist.
+Instead:
+
+ *  In the [EFI configuration file](efi.html), `ucode=<filename>` can be used
+    to identify a file as a raw container (option 1 above).  Use of this
+    mechanism will disable both `<integer>` and `scan=`.
+
+ *  If `ucode=<filename>` in the EFI configuration file is not used, it is
+    still possible to use `scan=` to search all modules.  The order of module
+    is undefined, but there is only a single `ramdisk=<filename>`
+    configuration option available.  The use of `<integer>` for xen.efi is
+    always undefined.
 
 'nmi' determines late loading is performed in NMI handler or just in
 stop_machine context. In NMI handler, even NMIs are blocked, which is
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index efaf808f1a..55baf73864 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -116,11 +116,6 @@ void __init microcode_set_module(unsigned int idx)
     ucode_mod_forced = 1;
 }
 
-/*
- * The format is '[<integer>|scan=<bool>, nmi=<bool>]'. Both options are
- * optional. If the EFI has forced which of the multiboot payloads is to be
- * used, only nmi=<bool> is parsed.
- */
 static int __init cf_check parse_ucode(const char *s)
 {
     const char *ss;
@@ -135,13 +130,24 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
             opt_digest_check = val;
-        else if ( !ucode_mod_forced ) /* Not forced by EFI */
+        else if ( (val = parse_boolean("scan", s, ss)) >= 0 )
         {
-            if ( (val = parse_boolean("scan", s, ss)) >= 0 )
+            if ( ucode_mod_forced )
+                printk(XENLOG_WARNING
+                       "Ignoring ucode=%.*s setting; overridden by EFI\n",
+                       (int)(ss - s), s);
+            else
             {
                 opt_scan = val;
                 opt_mod_idx = 0;
             }
+        }
+        else if ( isdigit(s[0]) || s[0] == '-' )
+        {
+            if ( ucode_mod_forced )
+                printk(XENLOG_WARNING
+                       "Ignoring ucode=%.*s setting; overridden by EFI\n",
+                       (int)(ss - s), s);
             else
             {
                 const char *q;
@@ -156,6 +162,8 @@ static int __init cf_check parse_ucode(const char *s)
                     opt_scan = false;
             }
         }
+        else
+            rc = -EINVAL;
 
         s = ss + 1;
     } while ( *ss );
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 14:11:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 14:11:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214840.1525083 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjn2-0007I1-Oj; Tue, 27 Jan 2026 14:11:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214840.1525083; Tue, 27 Jan 2026 14:11: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 1vkjn2-0007Ht-MD; Tue, 27 Jan 2026 14:11:32 +0000
Received: by outflank-mailman (input) for mailman id 1214840;
 Tue, 27 Jan 2026 14: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 1vkjn2-0007Hm-9I
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 14: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 1vkjn2-006DiO-1v
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkjn2-004SRb-0h
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14: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=ye+mRh/8CoTFX+5O0fp88/DaV/09KjM8yYRRkbgXWjE=; b=icxuzBohucfnI6ZWgketwRiauC
	guSFWUs8HgC5w1MTlNskG/CQuDuA/DihWYEsxKLnbrfjoi2QajOr4X3YTcDKsRveZH0x06wnOmHWv
	3ui+YMawAyD5Rl9tgcgXMKkrgmMMI7ldn4OtGjL0ueJMByfjDPYrQx5aGfspyOq3kIkk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vkjn2-004SRb-0h@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 14:11:32 +0000

commit f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 1 21:56:50 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 13:59:12 2026 +0000

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 8c5bdf0bd5..f9bcf4ed2c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -920,6 +920,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->family == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1201,15 +1208,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 14:11:42 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 14:11:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214841.1525087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkjnC-0007K8-QN; Tue, 27 Jan 2026 14:11:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214841.1525087; Tue, 27 Jan 2026 14:11: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 1vkjnC-0007K0-NZ; Tue, 27 Jan 2026 14:11:42 +0000
Received: by outflank-mailman (input) for mailman id 1214841;
 Tue, 27 Jan 2026 14: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 1vkjnC-0007Ju-Cg
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 14: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 1vkjnC-006DiV-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkjnC-004SUU-11
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 14: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=7so2Hgm3xuRIDauVf4nWALahh/jkhjthvDeHp+7IaJw=; b=GQjs88FY7dTDa441pkd0YpS1vV
	T3QOdvwRQ6CEQmdJXYK/ftA0tSIlyYSXQb8YcplanUf3mIDJtv7su8WgJycq4ZhifYaSLEGFZ/FDI
	Bd7+I4APfXp2WaTlWNPcI4rQzirdgpMpHLVAfQiMke9+D3AEfJC0W/PgEgudF77wQefA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/amd: Exclude K8 RevD and earlier from levelling
Message-Id: <E1vkjnC-004SUU-11@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 14:11:42 +0000

commit 18e255253a5a326deff0ade386e36d7965164533
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 1 20:33:15 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 13:59:12 2026 +0000

    x86/amd: Exclude K8 RevD and earlier from levelling
    
    Between RevD and RevE silicon, the feature MSRs moved location.  This property
    is highlighted by the suggested workaround for Erratum #110 which gives the
    two different MSRs for the extended feature leaf.
    
    The other feature MSRs are not given and while they're easy enough to figure
    out I don't have any K8's to test the result with.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index f9bcf4ed2c..fc496dc43e 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -117,10 +117,12 @@ static void __init noinline probe_masking_msrs(void)
 	/*
 	 * First, work out which masking MSRs we should have, based on
 	 * revision and cpuid.
+	 *
+	 * Fam11h doesn't support masking at all.  FamFh RevD and earlier had
+	 * the feature MSRs in different locations, as can be seen by the
+	 * suggested workaround for Erratum #110, doc 25759.
 	 */
-
-	/* Fam11 doesn't support masking at all. */
-	if (c->x86 == 0x11)
+	if (c->family == 0x11 || (c->family == 0xf && c->model < 0x20))
 		return;
 
 	cpuidmask_defaults._1cd =
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 15:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 15:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214955.1525191 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkktG-0005NY-Ro; Tue, 27 Jan 2026 15:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214955.1525191; Tue, 27 Jan 2026 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 1vkktG-0005NQ-P5; Tue, 27 Jan 2026 15:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1214955;
 Tue, 27 Jan 2026 15:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkktF-0005NE-Om
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 15:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkktG-006F0I-06
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkktF-004bPR-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qy5D103QMy7lTmKwGjBzCcT2YTTe4dqHLBzSapMNXG8=; b=PU+MhUIFi8xr6wG22csudocO1d
	XL1GOkpm3xY41/ZP1CPxMAGO1fkY/e2kxJa6b4WUuH4IO+EwnOzNIrG6S+p2Q+PKlprXeA9BfqhCt
	0EHc+n0Koh98p/wPEkP/yajbenArfhpSwITW7Qg1ou4lUd+4FmuX8/XE1EEJR3IyA23U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
Message-Id: <E1vkktF-004bPR-1u@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 15:22:01 +0000

commit 2872cd31219843b5aa5d51b3c88da191e13a4a1d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Dec 3 11:18:59 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:54:06 2026 +0000

    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit cfb767759b21096fa499d6889d5987c93ebb6cfd)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 0de1012d8c..7bbb4f1c5c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -3,7 +3,7 @@ freebsd_versions: &FREEBSD_VERSIONS
   env:
     FREEBSD_LEGACY:     freebsd-13-5
     FREEBSD_PRODUCTION: freebsd-14-3
-    FREEBSD_CURRENT:    freebsd-15-0-snap
+    FREEBSD_CURRENT:    freebsd-15-0-amd64-ufs
 
 # Build jobs
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 15:22:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 15:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214956.1525195 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkktQ-0005QD-TC; Tue, 27 Jan 2026 15:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214956.1525195; Tue, 27 Jan 2026 15: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 1vkktQ-0005Q5-QT; Tue, 27 Jan 2026 15:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1214956;
 Tue, 27 Jan 2026 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 1vkktP-0005Pr-Sg
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 15:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkktQ-006F0a-0a
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkktP-004bQl-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Za6yDnerQUhaM1qlHv3nalCD8HoWKSVY90BkUhRb5gA=; b=aC4kU7mvlBrytzGnNQ+aGvGjBU
	nxLpJ1f9PHen3Azkagxk7QjD/eOvwc9kT72aLF1y9ltF0UekH6ry7/67IOU8pFTCtgwjwzwzezsO1
	Vkn7Vz1secmUOpzNMbsqa5IitKSqaS75cxwcqrNhht7eZ3j5jSoTgzpPH5vpSDq71G88=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkktP-004bQl-2R@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 15:22:11 +0000

commit 41b9ae5d7e5c5f5e14fd3c362e033188815f6deb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:01:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:01:58 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 7be9c180ec..5a7b2f99f5 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1970,15 +1970,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2048,11 +2048,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2077,13 +2080,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2672,7 +2678,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 15:22:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 15:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214957.1525200 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkkta-0005TI-V6; Tue, 27 Jan 2026 15:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214957.1525200; Tue, 27 Jan 2026 15: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 1vkkta-0005TA-Rq; Tue, 27 Jan 2026 15:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1214957;
 Tue, 27 Jan 2026 15:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkktZ-0005Sz-Vg
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 15:22: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 1vkkta-006F0i-0t
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkktZ-004bTd-2t
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uxSew1Mg1h8BMK3SPxnrSBGUQ6iFGPYCiI+bLR7m0tE=; b=XMqcnpjMvW6ZCJbCeBjLhvTyaZ
	RZq5BYv6m46+xsv2RdwUFiRc7lHedOleiO2Zg2fi0pJhI4M/rM7OQ4SlHoaHj5t9t/gtNrfHCWGpz
	Rm0boA8V1MTefWgdt7N03+25EQN5rfBMgvfhfyRQCSsyMYW+MIRhtB0YCxaFYUJbKXco=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkktZ-004bTd-2t@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 15:22:21 +0000

commit 3146587dbc489cce60cae471fd63ef822b5c05a4
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:02:52 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:02:52 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 19fd86ce88..d8cf91ba34 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2204,33 +2204,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 15:33:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 15:33:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214972.1525214 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkl3u-0007Zp-Ux; Tue, 27 Jan 2026 15:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214972.1525214; Tue, 27 Jan 2026 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 1vkl3u-0007Zh-RB; Tue, 27 Jan 2026 15:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1214972;
 Tue, 27 Jan 2026 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 1vkl3t-0007Zb-I0
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 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 1vkl3t-006FC0-2d
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkl3t-004cpM-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 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=/3/U7rdijX2gvRrQs7EbCSrkBGaa5ugguevW7JN2xX4=; b=dAGg/BzhudSGpQB2U+5c2YAYZY
	UxN7HQh6WDQQ/VDSuHVPoEuhc9oJq+99KhjEg/cqVjufVxQgRYlITefFDPOkSs2oMn8y1aSGg7wTc
	OxUwjcI8mTTMPw/8CB0/yidxkrwUHbNCg7FBbphhShjgx8XCkdrjy4HFUowyu1TbbDa0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
Message-Id: <E1vkl3t-004cpM-1R@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 15:33:01 +0000

commit dacc9da9a73fbeec189db98709bd6c30979318a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 11:50:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:52:51 2026 +0000

    CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 331f94d0bbd11b93d12c762300039c9b36e561c5)
    
    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit cfb767759b21096fa499d6889d5987c93ebb6cfd)
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 3163ab8f11..aaa6cc8bf4 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -2,8 +2,8 @@
 freebsd_versions: &FREEBSD_VERSIONS
   env:
     FREEBSD_LEGACY:     freebsd-13-5
-    FREEBSD_PRODUCTION: freebsd-14-2
-    FREEBSD_CURRENT:    freebsd-15-0-snap
+    FREEBSD_PRODUCTION: freebsd-14-3
+    FREEBSD_CURRENT:    freebsd-15-0-amd64-ufs
 
 # Build jobs
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 15:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 15:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214973.1525217 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkl44-0007bp-VL; Tue, 27 Jan 2026 15:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214973.1525217; Tue, 27 Jan 2026 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 1vkl44-0007bh-Sa; Tue, 27 Jan 2026 15:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1214973;
 Tue, 27 Jan 2026 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 1vkl43-0007bM-JN
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 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 1vkl43-006FC9-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkl43-004cq7-1k
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 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=PfWayuPSIQ2u6vh8qp/szbuee7H+BicmjK2XLghB2WM=; b=yRoFsqz0HGYrGbmgJN038ow6kY
	grucSPTKmsVf9db5sRupT8D7PSqVtpe4gDEGgg380tecVSvOX9xjouC8wD9kruOhKJ6G7rWg9yWKF
	3T1zcqpnDwHWBpv57KbRNGAKe2lsKfmqpEJczDx0zb+Yp3yMtf1NIExP2+fyntrsd7SU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkl43-004cq7-1k@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 15:33:11 +0000

commit f63a5ba705b929ba1fb2e7b7d106c610e0353b87
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:03:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:03:48 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 10ddc408ff..ccaac3c5ae 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1965,15 +1965,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2043,11 +2043,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2072,13 +2075,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2659,7 +2665,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 15:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 15:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1214974.1525220 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkl4F-0007eF-0U; Tue, 27 Jan 2026 15:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1214974.1525220; Tue, 27 Jan 2026 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 1vkl4E-0007e6-U6; Tue, 27 Jan 2026 15:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1214974;
 Tue, 27 Jan 2026 15:33:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vkl4D-0007ds-QN
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 15: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 1vkl4E-006FCF-0N
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 15:33:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkl4D-004crC-21
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 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=KxEIsa/v5unhX2COuDeu+Sx5HAnDJoD2oJWW31IuHnA=; b=A9kYMbMmFwF6y5LjMnVBr7DmJS
	+xq+fM9chrynIAg1Y1HJ3XyCmr0Zb5blHh+P9O6jpdyjw1ljNl4dkcSWgk633hm6r08NHevMXnHnC
	++ZmrmZ6VsyiDnsoaCmcFAdOn0Fx5UM+5wXUjaELoCS4F+NBW5QyQInpEkASecRYHrK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkl4D-004crC-21@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 15:33:21 +0000

commit f48e4904ab8167ecb0ce78a165d1a446f6af9260
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:04:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:04:20 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 78a13e6812..93580b9a58 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2100,33 +2100,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 16:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 16:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215071.1525315 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkleg-0001Ua-Qw; Tue, 27 Jan 2026 16:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215071.1525315; Tue, 27 Jan 2026 16: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 1vkleg-0001US-OJ; Tue, 27 Jan 2026 16:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1215071;
 Tue, 27 Jan 2026 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 1vklef-0001UM-Sw
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 16:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkleg-006GOv-0Y
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 16:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vklef-004i5c-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 16:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EYuUoInWn8RAbP6w9DS13RK7jSSRmXDcEzLA59oDyrQ=; b=O7QOH84EPhSGpI6LM0IaE0yLgW
	r8kD70vz7nEld9zt2wY2p8Fv3HrmwwqaGQE/mgr1Oatb8tCWrKib/ymejMiMnMjbYCkqPooRxdOyn
	aCqQlt423mgyIntcl4gKC7hTrlKw+Z9GliXmaPvANWJfJk88CsocaLHm8ilADaTGl2Co=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
Message-Id: <E1vklef-004i5c-2a@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 16:11:01 +0000

commit fb0dd88d59a87edec86874006b8a0b8f4f595da2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 11:50:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:53:13 2026 +0000

    CI: Refresh CirrusCI configuration (FreeBSD 14.3, 15.0)
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 331f94d0bbd11b93d12c762300039c9b36e561c5)
    
    cirrus-ci: introduce FreeBSD 15.0-RELEASE as "current" version
    
    Switch the current version to 15.0-RELEASE.  Sadly the 16 snapshot images
    are not working, hence use the FREEBSD_CURRENT variable as a placeholder
    for 15.0 until the issues with FreeBSD 16.0 snapshot images is solved.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit cfb767759b21096fa499d6889d5987c93ebb6cfd)
---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 3163ab8f11..aaa6cc8bf4 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -2,8 +2,8 @@
 freebsd_versions: &FREEBSD_VERSIONS
   env:
     FREEBSD_LEGACY:     freebsd-13-5
-    FREEBSD_PRODUCTION: freebsd-14-2
-    FREEBSD_CURRENT:    freebsd-15-0-snap
+    FREEBSD_PRODUCTION: freebsd-14-3
+    FREEBSD_CURRENT:    freebsd-15-0-amd64-ufs
 
 # Build jobs
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 16:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 16:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215072.1525319 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkleq-0001WY-SS; Tue, 27 Jan 2026 16:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215072.1525319; Tue, 27 Jan 2026 16:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkleq-0001WQ-Po; Tue, 27 Jan 2026 16:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1215072;
 Tue, 27 Jan 2026 16:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vklep-0001WF-Uu
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 16:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkleq-006GP3-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 16:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vklep-004i9S-2t
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 16:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F31EAi9OsrNkx7uSjyJCcb1LsboXHbnShPRGXjXdhLg=; b=BbhqJJO0OvIIDyM3fHEPo9AndY
	+mMua+2ldZl93y/+BMYLPOXthcioWQanZA6B7N3UkZb74V54VLVTZxqvnTkRFtrGpuL/t0KTurnaT
	jYsxnYZgF63/TLNHxjogecYBRPM0BVAqpnrdvVbtfy4w5ejZRFvyPOCF38I/js8pppHk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vklep-004i9S-2t@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 16:11:11 +0000

commit a9d58e5e40cfbcc3004ae69777e38aab78c96b84
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:05:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:05:04 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 18 ++++++++++++------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 8e0046ae69..27022c3e0e 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1965,15 +1965,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 /* Shadow trace event with GUEST_PAGING_LEVELS folded into the event field. */
 static void sh_trace(uint32_t event, unsigned int extra, const void *extra_data)
 {
@@ -2043,11 +2043,14 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2072,13 +2075,16 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
             /*
              * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
              * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
              */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
         } d = {
             .gl1e            = gl1e,
-            .write_val.l1    = this_cpu(trace_emulate_write_val),
+            .write_val       = this_cpu(trace_emulate_write_val),
             .va              = va,
 #if GUEST_PAGING_LEVELS == 3
             .emulation_count = this_cpu(trace_extra_emulation_count),
@@ -2659,7 +2665,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 16:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 16:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215073.1525322 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vklf1-0001Z2-U8; Tue, 27 Jan 2026 16:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215073.1525322; Tue, 27 Jan 2026 16: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 1vklf1-0001Yu-RL; Tue, 27 Jan 2026 16:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1215073;
 Tue, 27 Jan 2026 16: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 1vklf0-0001Yl-3N
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 16: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 1vklf0-006GP9-19
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 16:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vklez-004iAO-3B
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 16: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=rzEUsBkNL3M2qOyn1spm6xPW6wQ+y6a8abRIbeMLUOE=; b=im9zUI/mni9+7JVnYH7mgXa9to
	ZZYH+XIGJzBGNeIAg2OzYz2NPBxMPRBwHex/ByUiBuiS9HggCxgUF1PCvj5GGt7wSYbpezLlSGFGH
	8MwY0cLGE/3hqz9Y/hBTZS/eRlJKwn2PGp5azZsyE9EYTWkMk5jZNVcOuUFh/Ng1zm/g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vklez-004iAO-3B@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 16:11:21 +0000

commit 495cfdccc53895097376bad6a55b4c67b89edc6f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:05:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:05:35 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index ccadfe0c9e..4c60117215 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2113,33 +2113,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 17:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 17:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215112.1525356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkmw2-0004tn-Uo; Tue, 27 Jan 2026 17:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215112.1525356; Tue, 27 Jan 2026 17: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 1vkmw2-0004tf-SB; Tue, 27 Jan 2026 17:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1215112;
 Tue, 27 Jan 2026 17: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 1vkmw1-0004tZ-Tb
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 17: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 1vkmw2-006IHt-0a
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkmw1-004uyd-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17: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=wLM0DypkLml59l0Sl7GxhtbmlJdUEDNKx1Rvc9hgsfc=; b=zwq3UevDnHD+JKNLOdBPYdgT+A
	R1oSstYrPqMzibyin3U+F6TAs6ljbqKKZyJJjIBrb+QWx/Mn8Zb0dZis08jE602E5HaAlRAdpllsg
	mP/rfjETKY7SD8mJPDxrrI2MdMxA69NDYGuyd9YrHlyNs1wxvtgei6fL1DpaU86fKYmY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] CI: Refresh CirrusCI configuration (FreeBSD 14.3)
Message-Id: <E1vkmw1-004uyd-2R@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 17:33:01 +0000

commit 502d206de62f3b80c7ea2b837dd62480ca0245b8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jan 27 11:50:35 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 11:53:23 2026 +0000

    CI: Refresh CirrusCI configuration (FreeBSD 14.3)
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 331f94d0bbd11b93d12c762300039c9b36e561c5)
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index eb46227892..04247d8b60 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -23,5 +23,5 @@ task:
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-2
+    image_family: freebsd-14-3
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 17:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 17:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215113.1525360 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkmwC-0004vd-W4; Tue, 27 Jan 2026 17:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215113.1525360; Tue, 27 Jan 2026 17: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 1vkmwC-0004vV-TX; Tue, 27 Jan 2026 17:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1215113;
 Tue, 27 Jan 2026 17: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 1vkmwB-0004vG-VJ
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 17: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 1vkmwC-006IID-0t
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkmwB-004uzk-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17: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=2gFCrhuCEHDCj+2lOVNd+uLFgunQT2aPAIQnCOCctOk=; b=mcWSQ5yZBpI7uQbTBwUtNFLHId
	ZbeqAe9Cpxh72mtCuIzChIT/UJgOEYUT4WW2xNlYXE/EP2oAGbi900E1zM53aI5HU/889j9yy4CMi
	16rygTGd8FWUFMMntZ/AOxS/aLj+xtzcRY7RWCcTOuj17WHiYVC8x+UB/d4J0nYNxz4o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vkmwB-004uzk-2v@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 17:33:11 +0000

commit f196c2f4dcf5711aa159c32b8053af60bade588c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jan 27 14:06:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:06:39 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 24 ++++++++++++++++--------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 90cf0ceaa3..5585944b6f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1965,15 +1965,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 static inline void trace_shadow_gen(u32 event, guest_va_t va)
 {
     if ( tb_init_done )
@@ -2062,11 +2062,14 @@ static inline void trace_shadow_emulate_other(u32 event,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
+    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
+        bytes = sizeof(this_cpu(trace_emulate_write_val));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2088,8 +2091,13 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
     if ( tb_init_done )
     {
         struct __packed {
-            /* for PAE, guest_l1e may be 64 while guest_va may be 32;
-               so put it first for alignment sake. */
+            /*
+             * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
+             * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
+             */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
@@ -2099,7 +2107,7 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
         event = TRC_SHADOW_EMULATE | ((GUEST_PAGING_LEVELS-2)<<8);
 
         d.gl1e = gl1e;
-        d.write_val.l1 = this_cpu(trace_emulate_write_val);
+        d.write_val = this_cpu(trace_emulate_write_val);
         d.va = va;
 #if GUEST_PAGING_LEVELS == 3
         d.emulation_count = this_cpu(trace_extra_emulation_count);
@@ -2680,7 +2688,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index cef9dbef2e..62c7884e63 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -120,14 +120,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 17:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 17:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215114.1525365 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkmwN-0004yD-1E; Tue, 27 Jan 2026 17:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215114.1525365; Tue, 27 Jan 2026 17: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 1vkmwM-0004y5-Ut; Tue, 27 Jan 2026 17:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1215114;
 Tue, 27 Jan 2026 17: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 1vkmwM-0004xy-29
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 17: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 1vkmwM-006IIW-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkmwL-004v0W-3C
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17: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=HGokdQS3Cgnz/xRE7RGL/oSxnKKNGuqiGSJQs91FTKc=; b=doCLVJfcdps2ZAO3O5kP9ZRO8u
	UhQnWIPXxz26IUPv8DDLUDjnJnJ4SCD68ISBPd28wopxRULYdTZ0DNg+EoyBtH955jbyRtEiGozqK
	+4h49LNLuh9fqXSn4A3qUeJPy6Yuk34bcUcRJ8SVqU5facgd+uMg9e5XGR2oRXMs8ueM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vkmwL-004v0W-3C@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 17:33:21 +0000

commit d4775257e38c2f932f7a38bac45f6dc2525fc793
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jan 27 14:07:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 27 14:07:03 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5feb0d0679..d81cb6f006 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2082,33 +2082,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 17:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 17:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215117.1525369 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkn6g-0006Mq-PO; Tue, 27 Jan 2026 17:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215117.1525369; Tue, 27 Jan 2026 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 1vkn6g-0006Mi-MX; Tue, 27 Jan 2026 17:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1215117;
 Tue, 27 Jan 2026 17: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 1vkn6g-0006Mb-8X
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 17: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 1vkn6g-006Ift-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkn6g-004vlw-0Y
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17: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=OSnxZdp9o3M+KHUT4eHnF6TgfYaY99dXL/iIi4Mmggs=; b=ajmo31yMlfKw1climaKpI1jIlE
	c2ER+99kIE7G8/AHigTZhCzmr1bKOOW3ZhsJfTZb/sCDC2iE5Ef1N+bLCWPSpwXe/fLdEyZd6gXM7
	MTlEzsOB36zg8wnHEntjxHXwauetV7yEPlZ/3dHS5bS39+671b5Tt91q9IxI6xJk8Mlw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Adjust parse_ucode() to match other list handling
Message-Id: <E1vkn6g-004vlw-0Y@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 17:44:02 +0000

commit 3a814060bbbd43b4ed0263d0b9441d31d1a3d051
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 19 19:35:05 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 13:59:12 2026 +0000

    x86/ucode: Adjust parse_ucode() to match other list handling
    
    parse_ucode() is abnormal compared to similar parsing elsewhere in Xen.
    
    Invert the ucode_mod_forced check with respect to the "scan" and integer
    handling, so we can warn the user when we've elected to ignore the parameters,
    and yield -EINVAL for any unrecognised list element.
    
    Rewrite the ucode= command line docs for clarity.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.pandoc | 66 +++++++++++++++++++++++++--------------
 xen/arch/x86/cpu/microcode/core.c | 22 ++++++++-----
 2 files changed, 57 insertions(+), 31 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index ece4dd4c93..d29ab08423 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2746,35 +2746,53 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
+> `= List of [ <integer>, scan=<bool>, nmi=<bool>, digest-check=<bool> ]`
 
     Applicability: x86
     Default: `scan` is selectable via Kconfig, `nmi,digest-check`
 
 Controls for CPU microcode loading, available when `CONFIG_MICROCODE_LOADING`
-is enabled. For early loading, this parameter can specify how and where to
-find the microcode update blob. For late loading, this parameter specifies if
-the update happens within a NMI handler.
-
-'integer' specifies the CPU microcode update blob module index. When positive,
-this specifies the n-th module (in the GrUB entry, zero based) to be used
-for updating CPU micrcode. When negative, counting starts at the end of
-the modules in the GrUB entry (so with the blob commonly being last,
-one could specify `ucode=-1`). Note that the value of zero is not valid
-here (entry zero, i.e. the first module, is always the Dom0 kernel
-image). Note further that use of this option has an unspecified effect
-when used with xen.efi (there the concept of modules doesn't exist, and
-the blob gets specified via the `ucode=<filename>` config file/section
-entry; see [EFI configuration file description](efi.html)).
-
-'scan' instructs the hypervisor to scan the multiboot images for an cpio
-image that contains microcode. Depending on the platform the blob with the
-microcode in the cpio name space must be:
-  - on Intel: kernel/x86/microcode/GenuineIntel.bin
-  - on AMD  : kernel/x86/microcode/AuthenticAMD.bin
-When using xen.efi, the `ucode=<filename>` config file setting takes
-precedence over `scan`. The default value for `scan` is set with
-`CONFIG_MICROCODE_SCAN_DEFAULT`.
+is enabled.
+
+In order to load microcode at boot, Xen needs to find a suitable update
+amongst the modules provided by the bootloader.  Two kinds of microcode update
+are supported:
+
+ 1. Raw microcode containers.  The format of the container is CPU vendor
+    specific.
+
+ 2. CPIO archive.  This is Linux's preferred mechanism, and involves having
+    the raw containers expressed as files
+    (e.g. `kernel/x86/microcode/{GenuineIntel,AuthenticAMD}.bin`) in a CPIO
+    archive, typically prepended to the initrd.
+
+The `<integer>` and `scan=<bool>` options are mutually exclusive and select
+between these two options.  Further restrictions exist for booting xen.efi
+(see below).
+
+ *  The `<integer>` option nominates a specific multiboot module as a raw
+    container (option 1 above).  Valid options start from 1 (module 0 is
+    always the dom0 kernel).  A negative number may be used, and will
+    back-reference from the end of the module list.  i.e. `ucode=-1` will
+    nominate the final multiboot module.
+
+ *  The `scan=` option causes Xen to search all modules in order to find the
+    first CPIO archive containing the appropriate file (option 2 above).  The
+    default for this option can be chosen at build time via
+    `CONFIG_MICROCODE_SCAN_DEFAULT`.
+
+When booting xen.efi natively, the concept of multiboot modules doesn't exist.
+Instead:
+
+ *  In the [EFI configuration file](efi.html), `ucode=<filename>` can be used
+    to identify a file as a raw container (option 1 above).  Use of this
+    mechanism will disable both `<integer>` and `scan=`.
+
+ *  If `ucode=<filename>` in the EFI configuration file is not used, it is
+    still possible to use `scan=` to search all modules.  The order of module
+    is undefined, but there is only a single `ramdisk=<filename>`
+    configuration option available.  The use of `<integer>` for xen.efi is
+    always undefined.
 
 'nmi' determines late loading is performed in NMI handler or just in
 stop_machine context. In NMI handler, even NMIs are blocked, which is
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index efaf808f1a..55baf73864 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -116,11 +116,6 @@ void __init microcode_set_module(unsigned int idx)
     ucode_mod_forced = 1;
 }
 
-/*
- * The format is '[<integer>|scan=<bool>, nmi=<bool>]'. Both options are
- * optional. If the EFI has forced which of the multiboot payloads is to be
- * used, only nmi=<bool> is parsed.
- */
 static int __init cf_check parse_ucode(const char *s)
 {
     const char *ss;
@@ -135,13 +130,24 @@ static int __init cf_check parse_ucode(const char *s)
             ucode_in_nmi = val;
         else if ( (val = parse_boolean("digest-check", s, ss)) >= 0 )
             opt_digest_check = val;
-        else if ( !ucode_mod_forced ) /* Not forced by EFI */
+        else if ( (val = parse_boolean("scan", s, ss)) >= 0 )
         {
-            if ( (val = parse_boolean("scan", s, ss)) >= 0 )
+            if ( ucode_mod_forced )
+                printk(XENLOG_WARNING
+                       "Ignoring ucode=%.*s setting; overridden by EFI\n",
+                       (int)(ss - s), s);
+            else
             {
                 opt_scan = val;
                 opt_mod_idx = 0;
             }
+        }
+        else if ( isdigit(s[0]) || s[0] == '-' )
+        {
+            if ( ucode_mod_forced )
+                printk(XENLOG_WARNING
+                       "Ignoring ucode=%.*s setting; overridden by EFI\n",
+                       (int)(ss - s), s);
             else
             {
                 const char *q;
@@ -156,6 +162,8 @@ static int __init cf_check parse_ucode(const char *s)
                     opt_scan = false;
             }
         }
+        else
+            rc = -EINVAL;
 
         s = ss + 1;
     } while ( *ss );
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 17:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 17:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215118.1525373 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkn6r-0006Os-R7; Tue, 27 Jan 2026 17:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215118.1525373; Tue, 27 Jan 2026 17:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkn6r-0006Oi-O3; Tue, 27 Jan 2026 17:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1215118;
 Tue, 27 Jan 2026 17: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 1vkn6q-0006OY-Ef
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 17: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 1vkn6q-006IgA-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkn6q-004vnF-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17: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=tBPtTUJE41DtlMFH3pHCkhIlZrtX5WTKnqycfzxssxY=; b=Npx9+3xUTazeIO0PHcUU4FZsFr
	ig2GpOf5rCfG2bQkuUAa7YKu5us66XjXnBQGDb76MJrmF13TV4B6v6VLDLICI4LAF6Y0f9Zm5uGoy
	6ehdgNluhd06X4aJzJxDJC+W0gAweojUau4YMDouc6Wlaf4C7HHH4426Mv7vBlkOJU54=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vkn6q-004vnF-0r@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 17:44:12 +0000

commit f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 1 21:56:50 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 13:59:12 2026 +0000

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 8c5bdf0bd5..f9bcf4ed2c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -920,6 +920,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->family == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1201,15 +1208,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Jan 27 17:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Jan 2026 17:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215119.1525377 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkn71-0006Rb-Rz; Tue, 27 Jan 2026 17:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215119.1525377; Tue, 27 Jan 2026 17:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vkn71-0006RT-PV; Tue, 27 Jan 2026 17:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1215119;
 Tue, 27 Jan 2026 17: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 1vkn70-0006RF-FO
 for xen-changelog@lists.xenproject.org; Tue, 27 Jan 2026 17: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 1vkn70-006IgR-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vkn70-004vp6-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 27 Jan 2026 17:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TaK33wSRTT+XwaCXsObo9/aqK0TYVReiSFfRiT/qNJI=; b=HNo19ZMpyWPT02Go9QYxrVBAoe
	L/DjJiyeHipchbnIhyYHMxOPqZCDP6edRd9w/hNfTA3XF8lbbUI+jELrKMM+npv3lQFTBra+S0feN
	2KDawHGZGql58lgGSJBq2LVE5o/+NRH7llOiwFBQPynrzWePwlyCIgyWwp9x3435YLgY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/amd: Exclude K8 RevD and earlier from levelling
Message-Id: <E1vkn70-004vp6-1M@xenbits.xenproject.org>
Date: Tue, 27 Jan 2026 17:44:22 +0000

commit 18e255253a5a326deff0ade386e36d7965164533
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 1 20:33:15 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Jan 27 13:59:12 2026 +0000

    x86/amd: Exclude K8 RevD and earlier from levelling
    
    Between RevD and RevE silicon, the feature MSRs moved location.  This property
    is highlighted by the suggested workaround for Erratum #110 which gives the
    two different MSRs for the extended feature leaf.
    
    The other feature MSRs are not given and while they're easy enough to figure
    out I don't have any K8's to test the result with.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/amd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index f9bcf4ed2c..fc496dc43e 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -117,10 +117,12 @@ static void __init noinline probe_masking_msrs(void)
 	/*
 	 * First, work out which masking MSRs we should have, based on
 	 * revision and cpuid.
+	 *
+	 * Fam11h doesn't support masking at all.  FamFh RevD and earlier had
+	 * the feature MSRs in different locations, as can be seen by the
+	 * suggested workaround for Erratum #110, doc 25759.
 	 */
-
-	/* Fam11 doesn't support masking at all. */
-	if (c->x86 == 0x11)
+	if (c->family == 0x11 || (c->family == 0xf && c->model < 0x20))
 		return;
 
 	cpuidmask_defaults._1cd =
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 28 13:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jan 2026 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215696.1525815 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl5qA-0000wu-5E; Wed, 28 Jan 2026 13:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215696.1525815; Wed, 28 Jan 2026 13:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl5qA-0000wm-2d; Wed, 28 Jan 2026 13:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1215696;
 Wed, 28 Jan 2026 13:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vl5q8-0000wc-J4
 for xen-changelog@lists.xenproject.org; Wed, 28 Jan 2026 13:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl5q8-007vQl-2q
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl5q8-005wTR-1e
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 13:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=J7OLNTKcknMydabjo18UynZgcDJ+4BN8HjKoU1GuOb0=; b=YF+eq7LqrRPJ8bC+pqHzIhU2AB
	jtjjcykTjnKIws4QJL34iB/l8J3Uzzkf4y0W665ZHD5MmryMkVf0zmKXOme8ATSBFIy/13bsJV8a3
	C8BripI2lydUgWEmJvjYVqlMIjivHe/kgW+ff5D3DDSDnvumY/8RWXhYeI/9sv91nBl0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Rename the cpu_request_microcode() hook to parse()
Message-Id: <E1vl5q8-005wTR-1e@xenbits.xenproject.org>
Date: Wed, 28 Jan 2026 13:44:12 +0000

commit ef31a8cefc4cae4ceee2b33245f091f782a71923
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 23 19:49:22 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 28 12:33:04 2026 +0000

    x86/ucode: Rename the cpu_request_microcode() hook to parse()
    
    cpu_request_microcode() was never a good name, and the microcode suffix is
    redundant.  Rename it to simply parse().
    
    Introduce ucode_parse() and ucode_parse_dup() wrappers around the parse()
    hook, also abstracting away the make_copy parameter and associated
    const-correctness.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/microcode/amd.c     |  4 ++--
 xen/arch/x86/cpu/microcode/core.c    | 21 ++++++++++++++++-----
 xen/arch/x86/cpu/microcode/intel.c   |  4 ++--
 xen/arch/x86/cpu/microcode/private.h |  2 +-
 4 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index c1ab6deb4d..a3c4a07cac 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -422,7 +422,7 @@ static int scan_equiv_cpu_table(const struct container_equiv_table *et)
     return -ESRCH;
 }
 
-static struct microcode_patch *cf_check cpu_request_microcode(
+static struct microcode_patch *cf_check amd_ucode_parse(
     const void *buf, size_t size, bool make_copy)
 {
     const struct microcode_patch *saved = NULL;
@@ -562,7 +562,7 @@ static const char __initconst amd_cpio_path[] =
 
 static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
-    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .parse                            = MICROCODE_OP(amd_ucode_parse),
     .apply_microcode                  = MICROCODE_OP(apply_microcode),
     .compare                          = MICROCODE_OP(amd_compare),
     .cpio_path                        = MICROCODE_OP(amd_cpio_path),
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 3000a9c442..a0ea6e188a 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -175,6 +175,18 @@ custom_param("ucode", parse_ucode);
 
 static struct microcode_ops __ro_after_init ucode_ops;
 
+/* Parse a ucode blob.  Returns a pointer to a heap-allocated copy, or PTR_ERR. */
+static struct microcode_patch *ucode_parse_dup(const char *buf, size_t len)
+{
+    return alternative_call(ucode_ops.parse, buf, len, true);
+}
+
+/* Parse a ucode blob.  Returns a pointer into @buf, or PTR_ERR. */
+static const struct microcode_patch *__init ucode_parse(const char *buf, size_t len)
+{
+    return ucode_ops.parse(buf, len, false);
+}
+
 static DEFINE_SPINLOCK(microcode_mutex);
 
 DEFINE_PER_CPU(struct cpu_signature, cpu_sig);
@@ -499,8 +511,7 @@ static long cf_check __maybe_unused ucode_update_hcall_cont(void *data)
         goto put;
     }
 
-    patch = alternative_call(ucode_ops.cpu_request_microcode,
-                             (const void *)buffer->buffer, buffer->len, true);
+    patch = ucode_parse_dup(buffer->buffer, buffer->len);
     patch_with_flags.flags = buffer->flags;
 
     xfree(buffer);
@@ -715,7 +726,7 @@ static int __init cf_check microcode_init_cache(void)
         size = cd.size;
     }
 
-    patch = alternative_call(ucode_ops.cpu_request_microcode, data, size, true);
+    patch = ucode_parse_dup(data, size);
     if ( IS_ERR(patch) )
     {
         rc = PTR_ERR(patch);
@@ -749,7 +760,7 @@ static int __init early_microcode_load(struct boot_info *bi)
 {
     void *data = NULL;
     size_t size;
-    struct microcode_patch *patch;
+    const struct microcode_patch *patch;
     int idx = opt_mod_idx;
     int rc;
 
@@ -841,7 +852,7 @@ static int __init early_microcode_load(struct boot_info *bi)
     return 0;
 
  found:
-    patch = ucode_ops.cpu_request_microcode(data, size, false);
+    patch = ucode_parse(data, size);
     if ( IS_ERR(patch) )
     {
         rc = PTR_ERR(patch);
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index dac464961a..ce70ce2ad1 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -333,7 +333,7 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
     return 0;
 }
 
-static struct microcode_patch *cf_check cpu_request_microcode(
+static struct microcode_patch *cf_check intel_ucode_parse(
     const void *buf, size_t size, bool make_copy)
 {
     int error = 0;
@@ -409,7 +409,7 @@ static const char __initconst intel_cpio_path[] =
 
 static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
-    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .parse                            = MICROCODE_OP(intel_ucode_parse),
     .apply_microcode                  = MICROCODE_OP(apply_microcode),
     .compare                          = MICROCODE_OP(intel_compare),
     .cpio_path                        = MICROCODE_OP(intel_cpio_path),
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 77ce816c1a..deebe78adf 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -33,7 +33,7 @@ struct microcode_ops {
      * If one is not found, (nothing matches the current CPU), return NULL.
      * Also may return ERR_PTR(-err), e.g. bad container, out of memory.
      */
-    struct microcode_patch *(*cpu_request_microcode)(
+    struct microcode_patch *(*parse)(
         const void *buf, size_t size, bool make_copy);
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 28 13:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jan 2026 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215695.1525811 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl5q0-0000vS-4D; Wed, 28 Jan 2026 13:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215695.1525811; Wed, 28 Jan 2026 13:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl5q0-0000vK-1C; Wed, 28 Jan 2026 13:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1215695;
 Wed, 28 Jan 2026 13:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vl5py-0000vE-HA
 for xen-changelog@lists.xenproject.org; Wed, 28 Jan 2026 13:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl5py-007vQf-2Y
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl5py-005wRm-0v
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 13:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rbTeLgjIl4DjRiP8XFPL0rFw1qjgjhxXN2Fop3P3Rpw=; b=AbHVb5nLEjFUFltzS/tYMZ75Sh
	/G60vEXyBElHAOVTZrIHSyByuGr22R+R4BHzMh3hdzCqHMrQfb1j85RtfEn+Nx2+AhS4UFbNkaFWj
	w3ykmHuH3XKBOoUh+mOtd7Qz78rqnSEHgk6oJFIeMMwba4MpaGiK4u3/VLLPOHCDgQ8A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Drop the parse_blob() wrapper
Message-Id: <E1vl5py-005wRm-0v@xenbits.xenproject.org>
Date: Wed, 28 Jan 2026 13:44:02 +0000

commit fafa6c9f29830e6c3cbda24106f6c5e6f751c504
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 24 20:34:17 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 28 12:33:04 2026 +0000

    x86/ucode: Drop the parse_blob() wrapper
    
    This frees up the name to be reused a little differently.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/microcode/core.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 55baf73864..3000a9c442 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -195,17 +195,6 @@ static struct patch_with_flags nmi_patch =
     .patch  = ZERO_BLOCK_PTR,
 };
 
-/*
- * Return a patch that covers current CPU. If there are multiple patches,
- * return the one with the highest revision number. Return error If no
- * patch is found and an error occurs during the parsing process. Otherwise
- * return NULL.
- */
-static struct microcode_patch *parse_blob(const char *buf, size_t len)
-{
-    return alternative_call(ucode_ops.cpu_request_microcode, buf, len, true);
-}
-
 /* Returns true if ucode should be loaded on a given cpu */
 static bool is_cpu_primary(unsigned int cpu)
 {
@@ -510,7 +499,8 @@ static long cf_check __maybe_unused ucode_update_hcall_cont(void *data)
         goto put;
     }
 
-    patch = parse_blob(buffer->buffer, buffer->len);
+    patch = alternative_call(ucode_ops.cpu_request_microcode,
+                             (const void *)buffer->buffer, buffer->len, true);
     patch_with_flags.flags = buffer->flags;
 
     xfree(buffer);
@@ -725,7 +715,7 @@ static int __init cf_check microcode_init_cache(void)
         size = cd.size;
     }
 
-    patch = parse_blob(data, size);
+    patch = alternative_call(ucode_ops.cpu_request_microcode, data, size, true);
     if ( IS_ERR(patch) )
     {
         rc = PTR_ERR(patch);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 28 13:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jan 2026 13:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215697.1525819 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl5qK-0000zR-6o; Wed, 28 Jan 2026 13:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215697.1525819; Wed, 28 Jan 2026 13:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl5qK-0000zJ-48; Wed, 28 Jan 2026 13:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1215697;
 Wed, 28 Jan 2026 13:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vl5qI-0000z6-Ns
 for xen-changelog@lists.xenproject.org; Wed, 28 Jan 2026 13:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl5qI-007vQp-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl5qI-005wV7-1w
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 13:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q5ZiFtZ9qFqSYo7hfTYoI2NhE/MUXeYQbzUy96iNR0I=; b=zrrJ1T+lcfZoQqN7BFtImCsfN8
	u+uH/H6AnUech10dUBxwcjuPxIf4BiWda7F7Uf2zD7BcntCGHGY4UJnjUWA+/nHns4NYXXfCx0u5z
	SHwvISya9rCevwxzFlE1HbRkyn2AmQIxZbQ5xJGTTF3pBECpBlgp/mGw+tKCKYHtj7zo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Rename the apply_microcode() hook to load()
Message-Id: <E1vl5qI-005wV7-1w@xenbits.xenproject.org>
Date: Wed, 28 Jan 2026 13:44:22 +0000

commit 4ae1962cdb2402c207b7129f67123a808763c108
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 23 19:35:36 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 28 12:33:04 2026 +0000

    x86/ucode: Rename the apply_microcode() hook to load()
    
    The microcode suffix is redundant, and "microcode loading" is the more common
    term.
    
    Introduce the ucode_load() wrapper to encapsulate the alternative_call().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/microcode/amd.c     |  6 +++---
 xen/arch/x86/cpu/microcode/core.c    | 24 +++++++++++++++---------
 xen/arch/x86/cpu/microcode/intel.c   |  8 ++++----
 xen/arch/x86/cpu/microcode/private.h |  7 +++----
 4 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index a3c4a07cac..90f10ac8be 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -310,8 +310,8 @@ static bool check_min_rev(const struct microcode_patch *patch)
     return this_cpu(cpu_sig).rev >= patch->min_rev;
 }
 
-static int cf_check apply_microcode(const struct microcode_patch *patch,
-                                    unsigned int flags)
+static int cf_check amd_ucode_load(const struct microcode_patch *patch,
+                                   unsigned int flags)
 {
     int hw_err, result;
     unsigned int cpu = smp_processor_id();
@@ -563,7 +563,7 @@ static const char __initconst amd_cpio_path[] =
 static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
     .parse                            = MICROCODE_OP(amd_ucode_parse),
-    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .load                             = MICROCODE_OP(amd_ucode_load),
     .compare                          = MICROCODE_OP(amd_compare),
     .cpio_path                        = MICROCODE_OP(amd_cpio_path),
 };
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index a0ea6e188a..ea0b35c499 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -187,6 +187,12 @@ static const struct microcode_patch *__init ucode_parse(const char *buf, size_t
     return ucode_ops.parse(buf, len, false);
 }
 
+/* Load a ucode blob.  Returns -errno. */
+static int ucode_load(const struct microcode_patch *patch, unsigned int flags)
+{
+    return alternative_call(ucode_ops.load, patch, flags);
+}
+
 static DEFINE_SPINLOCK(microcode_mutex);
 
 DEFINE_PER_CPU(struct cpu_signature, cpu_sig);
@@ -287,7 +293,7 @@ static int primary_thread_work(const struct microcode_patch *patch,
     if ( !wait_for_state(LOADING_ENTER) )
         return 0;
 
-    ret = alternative_call(ucode_ops.apply_microcode, patch, flags);
+    ret = ucode_load(patch, flags);
     if ( !ret )
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
@@ -397,7 +403,7 @@ static int control_thread_fn(const struct microcode_patch *patch,
         goto out;
 
     /* Control thread loads ucode first while others are in NMI handler. */
-    ret = alternative_call(ucode_ops.apply_microcode, patch, flags);
+    ret = ucode_load(patch, flags);
     if ( !ret )
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
@@ -634,7 +640,7 @@ int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf,
     if ( flags & ~XENPF_UCODE_FORCE )
         return -EINVAL;
 
-    if ( !ucode_ops.apply_microcode )
+    if ( !ucode_ops.load )
         return -EINVAL;
 
     buffer = xmalloc_flex_struct(struct ucode_buf, buffer, len);
@@ -671,12 +677,12 @@ int microcode_update_one(void)
     if ( ucode_ops.collect_cpu_info )
         alternative_vcall(ucode_ops.collect_cpu_info);
 
-    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || !ucode_ops.apply_microcode )
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || !ucode_ops.load )
         return -EOPNOTSUPP;
 
     spin_lock(&microcode_mutex);
     if ( microcode_cache )
-        rc = alternative_call(ucode_ops.apply_microcode, microcode_cache, 0);
+        rc = ucode_load(microcode_cache, 0);
     else
         rc = -ENOENT;
     spin_unlock(&microcode_mutex);
@@ -876,7 +882,7 @@ static int __init early_microcode_load(struct boot_info *bi)
      */
     early_mod_idx = idx;
 
-    rc = ucode_ops.apply_microcode(patch, 0);
+    rc = ucode_load(patch, 0);
 
     if ( rc == 0 )
         /* Rescan CPUID/MSR features, which may have changed after a load. */
@@ -925,11 +931,11 @@ int __init early_microcode_init(struct boot_info *bi)
      *
      * Take the hint in either case and ignore the microcode interface.
      */
-    if ( !ucode_ops.apply_microcode || this_cpu(cpu_sig).rev == ~0 )
+    if ( !ucode_ops.load || this_cpu(cpu_sig).rev == ~0 )
     {
         printk(XENLOG_INFO "Microcode loading disabled due to: %s\n",
-               ucode_ops.apply_microcode ? "rev = ~0" : "HW toggle");
-        ucode_ops.apply_microcode = NULL;
+               ucode_ops.load ? "rev = ~0" : "HW toggle");
+        ucode_ops.load = NULL;
         return -ENODEV;
     }
 
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index ce70ce2ad1..c45b00c6b0 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -286,8 +286,8 @@ static int cf_check intel_compare(
     return compare_revisions(old->rev, new->rev);
 }
 
-static int cf_check apply_microcode(const struct microcode_patch *patch,
-                                    unsigned int flags)
+static int cf_check intel_ucode_load(const struct microcode_patch *patch,
+                                     unsigned int flags)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
@@ -410,7 +410,7 @@ static const char __initconst intel_cpio_path[] =
 static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
     .parse                            = MICROCODE_OP(intel_ucode_parse),
-    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .load                             = MICROCODE_OP(intel_ucode_load),
     .compare                          = MICROCODE_OP(intel_compare),
     .cpio_path                        = MICROCODE_OP(intel_cpio_path),
 };
@@ -423,5 +423,5 @@ void __init ucode_probe_intel(struct microcode_ops *ops)
         return;
 
     if ( !can_load_microcode() )
-        ops->apply_microcode = NULL;
+        ops->load = NULL;
 }
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index deebe78adf..9306d98065 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -46,8 +46,7 @@ struct microcode_ops {
      * Attempt to load the provided patch into the CPU.  Returns an error if
      * anything didn't go as expected.
      */
-    int (*apply_microcode)(const struct microcode_patch *patch,
-                           unsigned int flags);
+    int (*load)(const struct microcode_patch *patch, unsigned int flags);
 
     /*
      * Given a current patch, and a proposed new patch, order them based on revision.
@@ -79,8 +78,8 @@ extern bool opt_digest_check;
  *   - Loading available
  *
  * These are encoded by (not) filling in ops->collect_cpu_info (i.e. no
- * support available) and (not) ops->apply_microcode (i.e. read only).
- * Otherwise, all hooks must be filled in.
+ * support available) and (not) ops->load (i.e. read only).  Otherwise, all
+ * hooks must be filled in.
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Jan 28 14:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jan 2026 14:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215749.1525863 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl6m3-0001h5-38; Wed, 28 Jan 2026 14:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215749.1525863; Wed, 28 Jan 2026 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 1vl6m3-0001gx-0S; Wed, 28 Jan 2026 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1215749;
 Wed, 28 Jan 2026 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 1vl6m2-0001gr-GZ
 for xen-changelog@lists.xenproject.org; Wed, 28 Jan 2026 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 1vl6m2-007wWv-2O
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl6m2-006000-1C
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 14:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N4WwyaUoTRAuB7Gh+EyiE86Wnig9QAJFPG4w4/qd6cs=; b=gPIZP50M+Ic3vPGeJVH7XtXOFa
	+BZcqmGnilPdAXVjso1EyAiqNqHyyaq2CdMxOIxsDoWTOsiHrM/7WCrx938BiCF8imYz7BjVA7YUU
	XgzWY2BP6k4fzoLrudqRsttKhyIpmoCnMLDifuc78b1ElSgqMFEoiHnPQERNs7pDvzn0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Drop the parse_blob() wrapper
Message-Id: <E1vl6m2-006000-1C@xenbits.xenproject.org>
Date: Wed, 28 Jan 2026 14:44:02 +0000

commit fafa6c9f29830e6c3cbda24106f6c5e6f751c504
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 24 20:34:17 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 28 12:33:04 2026 +0000

    x86/ucode: Drop the parse_blob() wrapper
    
    This frees up the name to be reused a little differently.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/microcode/core.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 55baf73864..3000a9c442 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -195,17 +195,6 @@ static struct patch_with_flags nmi_patch =
     .patch  = ZERO_BLOCK_PTR,
 };
 
-/*
- * Return a patch that covers current CPU. If there are multiple patches,
- * return the one with the highest revision number. Return error If no
- * patch is found and an error occurs during the parsing process. Otherwise
- * return NULL.
- */
-static struct microcode_patch *parse_blob(const char *buf, size_t len)
-{
-    return alternative_call(ucode_ops.cpu_request_microcode, buf, len, true);
-}
-
 /* Returns true if ucode should be loaded on a given cpu */
 static bool is_cpu_primary(unsigned int cpu)
 {
@@ -510,7 +499,8 @@ static long cf_check __maybe_unused ucode_update_hcall_cont(void *data)
         goto put;
     }
 
-    patch = parse_blob(buffer->buffer, buffer->len);
+    patch = alternative_call(ucode_ops.cpu_request_microcode,
+                             (const void *)buffer->buffer, buffer->len, true);
     patch_with_flags.flags = buffer->flags;
 
     xfree(buffer);
@@ -725,7 +715,7 @@ static int __init cf_check microcode_init_cache(void)
         size = cd.size;
     }
 
-    patch = parse_blob(data, size);
+    patch = alternative_call(ucode_ops.cpu_request_microcode, data, size, true);
     if ( IS_ERR(patch) )
     {
         rc = PTR_ERR(patch);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 28 14:44:17 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jan 2026 14:44:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215750.1525867 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl6mD-0001ic-4b; Wed, 28 Jan 2026 14:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215750.1525867; Wed, 28 Jan 2026 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 1vl6mD-0001iV-1s; Wed, 28 Jan 2026 14:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1215750;
 Wed, 28 Jan 2026 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 1vl6mC-0001iN-HL
 for xen-changelog@lists.xenproject.org; Wed, 28 Jan 2026 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 1vl6mC-007wX0-2g
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl6mC-00601e-1T
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 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=ym7colUBv7ECl+KHEFnr120L4ddlTA29Esm+w5egYVk=; b=p5ueF/RzrQjghl66ft5VRH4tYa
	oovquNyFxJe8h5VllddqnNsm0as17rIe1EvdUlvXOwap6xs5nCyZT2B3G6OZlNLitIPPIoH7v/vaS
	nG0sHk3QClTidYhiLYzfln1LRFPmqPJB1nsq4CH6130kU1jKd2FpCbSHZOBhdIKEjwWM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Rename the cpu_request_microcode() hook to parse()
Message-Id: <E1vl6mC-00601e-1T@xenbits.xenproject.org>
Date: Wed, 28 Jan 2026 14:44:12 +0000

commit ef31a8cefc4cae4ceee2b33245f091f782a71923
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 23 19:49:22 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 28 12:33:04 2026 +0000

    x86/ucode: Rename the cpu_request_microcode() hook to parse()
    
    cpu_request_microcode() was never a good name, and the microcode suffix is
    redundant.  Rename it to simply parse().
    
    Introduce ucode_parse() and ucode_parse_dup() wrappers around the parse()
    hook, also abstracting away the make_copy parameter and associated
    const-correctness.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/microcode/amd.c     |  4 ++--
 xen/arch/x86/cpu/microcode/core.c    | 21 ++++++++++++++++-----
 xen/arch/x86/cpu/microcode/intel.c   |  4 ++--
 xen/arch/x86/cpu/microcode/private.h |  2 +-
 4 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index c1ab6deb4d..a3c4a07cac 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -422,7 +422,7 @@ static int scan_equiv_cpu_table(const struct container_equiv_table *et)
     return -ESRCH;
 }
 
-static struct microcode_patch *cf_check cpu_request_microcode(
+static struct microcode_patch *cf_check amd_ucode_parse(
     const void *buf, size_t size, bool make_copy)
 {
     const struct microcode_patch *saved = NULL;
@@ -562,7 +562,7 @@ static const char __initconst amd_cpio_path[] =
 
 static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
-    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .parse                            = MICROCODE_OP(amd_ucode_parse),
     .apply_microcode                  = MICROCODE_OP(apply_microcode),
     .compare                          = MICROCODE_OP(amd_compare),
     .cpio_path                        = MICROCODE_OP(amd_cpio_path),
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 3000a9c442..a0ea6e188a 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -175,6 +175,18 @@ custom_param("ucode", parse_ucode);
 
 static struct microcode_ops __ro_after_init ucode_ops;
 
+/* Parse a ucode blob.  Returns a pointer to a heap-allocated copy, or PTR_ERR. */
+static struct microcode_patch *ucode_parse_dup(const char *buf, size_t len)
+{
+    return alternative_call(ucode_ops.parse, buf, len, true);
+}
+
+/* Parse a ucode blob.  Returns a pointer into @buf, or PTR_ERR. */
+static const struct microcode_patch *__init ucode_parse(const char *buf, size_t len)
+{
+    return ucode_ops.parse(buf, len, false);
+}
+
 static DEFINE_SPINLOCK(microcode_mutex);
 
 DEFINE_PER_CPU(struct cpu_signature, cpu_sig);
@@ -499,8 +511,7 @@ static long cf_check __maybe_unused ucode_update_hcall_cont(void *data)
         goto put;
     }
 
-    patch = alternative_call(ucode_ops.cpu_request_microcode,
-                             (const void *)buffer->buffer, buffer->len, true);
+    patch = ucode_parse_dup(buffer->buffer, buffer->len);
     patch_with_flags.flags = buffer->flags;
 
     xfree(buffer);
@@ -715,7 +726,7 @@ static int __init cf_check microcode_init_cache(void)
         size = cd.size;
     }
 
-    patch = alternative_call(ucode_ops.cpu_request_microcode, data, size, true);
+    patch = ucode_parse_dup(data, size);
     if ( IS_ERR(patch) )
     {
         rc = PTR_ERR(patch);
@@ -749,7 +760,7 @@ static int __init early_microcode_load(struct boot_info *bi)
 {
     void *data = NULL;
     size_t size;
-    struct microcode_patch *patch;
+    const struct microcode_patch *patch;
     int idx = opt_mod_idx;
     int rc;
 
@@ -841,7 +852,7 @@ static int __init early_microcode_load(struct boot_info *bi)
     return 0;
 
  found:
-    patch = ucode_ops.cpu_request_microcode(data, size, false);
+    patch = ucode_parse(data, size);
     if ( IS_ERR(patch) )
     {
         rc = PTR_ERR(patch);
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index dac464961a..ce70ce2ad1 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -333,7 +333,7 @@ static int cf_check apply_microcode(const struct microcode_patch *patch,
     return 0;
 }
 
-static struct microcode_patch *cf_check cpu_request_microcode(
+static struct microcode_patch *cf_check intel_ucode_parse(
     const void *buf, size_t size, bool make_copy)
 {
     int error = 0;
@@ -409,7 +409,7 @@ static const char __initconst intel_cpio_path[] =
 
 static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
-    .cpu_request_microcode            = MICROCODE_OP(cpu_request_microcode),
+    .parse                            = MICROCODE_OP(intel_ucode_parse),
     .apply_microcode                  = MICROCODE_OP(apply_microcode),
     .compare                          = MICROCODE_OP(intel_compare),
     .cpio_path                        = MICROCODE_OP(intel_cpio_path),
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 77ce816c1a..deebe78adf 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -33,7 +33,7 @@ struct microcode_ops {
      * If one is not found, (nothing matches the current CPU), return NULL.
      * Also may return ERR_PTR(-err), e.g. bad container, out of memory.
      */
-    struct microcode_patch *(*cpu_request_microcode)(
+    struct microcode_patch *(*parse)(
         const void *buf, size_t size, bool make_copy);
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Jan 28 14:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Jan 2026 14:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1215751.1525871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl6mO-0001lI-7a; Wed, 28 Jan 2026 14:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1215751.1525871; Wed, 28 Jan 2026 14:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vl6mO-0001lA-4q; Wed, 28 Jan 2026 14:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1215751;
 Wed, 28 Jan 2026 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 1vl6mM-0001kx-O9
 for xen-changelog@lists.xenproject.org; Wed, 28 Jan 2026 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 1vl6mM-007wX4-3D
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vl6mM-00603I-1m
 for xen-changelog@lists.xenproject.org;
 Wed, 28 Jan 2026 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=b1JDp38Y/vnvOfVF09Njr219FRUTmt6NneOa62lcZX8=; b=2HEbxNsA+cTpaYTMAzgO3xAn7r
	NolUSm7uJCIj9ENaAt68vUUMbanbyhvUIH9VfZWiZ7OIZAay8D8Diyv07HVur9h2ZnwtHriyrPJX3
	CNbLCQ8UUECBylbK4pFbWV2exh6FYBGJFxXFqNXWW6LqrhDUkrWqFB/oO5IZUFwZvcUk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Rename the apply_microcode() hook to load()
Message-Id: <E1vl6mM-00603I-1m@xenbits.xenproject.org>
Date: Wed, 28 Jan 2026 14:44:22 +0000

commit 4ae1962cdb2402c207b7129f67123a808763c108
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 23 19:35:36 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Jan 28 12:33:04 2026 +0000

    x86/ucode: Rename the apply_microcode() hook to load()
    
    The microcode suffix is redundant, and "microcode loading" is the more common
    term.
    
    Introduce the ucode_load() wrapper to encapsulate the alternative_call().
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/microcode/amd.c     |  6 +++---
 xen/arch/x86/cpu/microcode/core.c    | 24 +++++++++++++++---------
 xen/arch/x86/cpu/microcode/intel.c   |  8 ++++----
 xen/arch/x86/cpu/microcode/private.h |  7 +++----
 4 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index a3c4a07cac..90f10ac8be 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -310,8 +310,8 @@ static bool check_min_rev(const struct microcode_patch *patch)
     return this_cpu(cpu_sig).rev >= patch->min_rev;
 }
 
-static int cf_check apply_microcode(const struct microcode_patch *patch,
-                                    unsigned int flags)
+static int cf_check amd_ucode_load(const struct microcode_patch *patch,
+                                   unsigned int flags)
 {
     int hw_err, result;
     unsigned int cpu = smp_processor_id();
@@ -563,7 +563,7 @@ static const char __initconst amd_cpio_path[] =
 static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
     .parse                            = MICROCODE_OP(amd_ucode_parse),
-    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .load                             = MICROCODE_OP(amd_ucode_load),
     .compare                          = MICROCODE_OP(amd_compare),
     .cpio_path                        = MICROCODE_OP(amd_cpio_path),
 };
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index a0ea6e188a..ea0b35c499 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -187,6 +187,12 @@ static const struct microcode_patch *__init ucode_parse(const char *buf, size_t
     return ucode_ops.parse(buf, len, false);
 }
 
+/* Load a ucode blob.  Returns -errno. */
+static int ucode_load(const struct microcode_patch *patch, unsigned int flags)
+{
+    return alternative_call(ucode_ops.load, patch, flags);
+}
+
 static DEFINE_SPINLOCK(microcode_mutex);
 
 DEFINE_PER_CPU(struct cpu_signature, cpu_sig);
@@ -287,7 +293,7 @@ static int primary_thread_work(const struct microcode_patch *patch,
     if ( !wait_for_state(LOADING_ENTER) )
         return 0;
 
-    ret = alternative_call(ucode_ops.apply_microcode, patch, flags);
+    ret = ucode_load(patch, flags);
     if ( !ret )
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
@@ -397,7 +403,7 @@ static int control_thread_fn(const struct microcode_patch *patch,
         goto out;
 
     /* Control thread loads ucode first while others are in NMI handler. */
-    ret = alternative_call(ucode_ops.apply_microcode, patch, flags);
+    ret = ucode_load(patch, flags);
     if ( !ret )
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
@@ -634,7 +640,7 @@ int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf,
     if ( flags & ~XENPF_UCODE_FORCE )
         return -EINVAL;
 
-    if ( !ucode_ops.apply_microcode )
+    if ( !ucode_ops.load )
         return -EINVAL;
 
     buffer = xmalloc_flex_struct(struct ucode_buf, buffer, len);
@@ -671,12 +677,12 @@ int microcode_update_one(void)
     if ( ucode_ops.collect_cpu_info )
         alternative_vcall(ucode_ops.collect_cpu_info);
 
-    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || !ucode_ops.apply_microcode )
+    if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || !ucode_ops.load )
         return -EOPNOTSUPP;
 
     spin_lock(&microcode_mutex);
     if ( microcode_cache )
-        rc = alternative_call(ucode_ops.apply_microcode, microcode_cache, 0);
+        rc = ucode_load(microcode_cache, 0);
     else
         rc = -ENOENT;
     spin_unlock(&microcode_mutex);
@@ -876,7 +882,7 @@ static int __init early_microcode_load(struct boot_info *bi)
      */
     early_mod_idx = idx;
 
-    rc = ucode_ops.apply_microcode(patch, 0);
+    rc = ucode_load(patch, 0);
 
     if ( rc == 0 )
         /* Rescan CPUID/MSR features, which may have changed after a load. */
@@ -925,11 +931,11 @@ int __init early_microcode_init(struct boot_info *bi)
      *
      * Take the hint in either case and ignore the microcode interface.
      */
-    if ( !ucode_ops.apply_microcode || this_cpu(cpu_sig).rev == ~0 )
+    if ( !ucode_ops.load || this_cpu(cpu_sig).rev == ~0 )
     {
         printk(XENLOG_INFO "Microcode loading disabled due to: %s\n",
-               ucode_ops.apply_microcode ? "rev = ~0" : "HW toggle");
-        ucode_ops.apply_microcode = NULL;
+               ucode_ops.load ? "rev = ~0" : "HW toggle");
+        ucode_ops.load = NULL;
         return -ENODEV;
     }
 
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index ce70ce2ad1..c45b00c6b0 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -286,8 +286,8 @@ static int cf_check intel_compare(
     return compare_revisions(old->rev, new->rev);
 }
 
-static int cf_check apply_microcode(const struct microcode_patch *patch,
-                                    unsigned int flags)
+static int cf_check intel_ucode_load(const struct microcode_patch *patch,
+                                     unsigned int flags)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
@@ -410,7 +410,7 @@ static const char __initconst intel_cpio_path[] =
 static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
     .collect_cpu_info                 = collect_cpu_info,
     .parse                            = MICROCODE_OP(intel_ucode_parse),
-    .apply_microcode                  = MICROCODE_OP(apply_microcode),
+    .load                             = MICROCODE_OP(intel_ucode_load),
     .compare                          = MICROCODE_OP(intel_compare),
     .cpio_path                        = MICROCODE_OP(intel_cpio_path),
 };
@@ -423,5 +423,5 @@ void __init ucode_probe_intel(struct microcode_ops *ops)
         return;
 
     if ( !can_load_microcode() )
-        ops->apply_microcode = NULL;
+        ops->load = NULL;
 }
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index deebe78adf..9306d98065 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -46,8 +46,7 @@ struct microcode_ops {
      * Attempt to load the provided patch into the CPU.  Returns an error if
      * anything didn't go as expected.
      */
-    int (*apply_microcode)(const struct microcode_patch *patch,
-                           unsigned int flags);
+    int (*load)(const struct microcode_patch *patch, unsigned int flags);
 
     /*
      * Given a current patch, and a proposed new patch, order them based on revision.
@@ -79,8 +78,8 @@ extern bool opt_digest_check;
  *   - Loading available
  *
  * These are encoded by (not) filling in ops->collect_cpu_info (i.e. no
- * support available) and (not) ops->apply_microcode (i.e. read only).
- * Otherwise, all hooks must be filled in.
+ * support available) and (not) ops->load (i.e. read only).  Otherwise, all
+ * hooks must be filled in.
  */
 #ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 11:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 11:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216309.1526225 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlQGl-0006fr-80; Thu, 29 Jan 2026 11:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216309.1526225; Thu, 29 Jan 2026 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 1vlQGl-0006fj-5O; Thu, 29 Jan 2026 11:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1216309;
 Thu, 29 Jan 2026 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 1vlQGj-0006fb-T2
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 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 1vlQGk-009SKA-0Z
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 11:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlQGj-007Djf-2a
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 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=vdQ9mXTIvEXsp+BPnFLtu2KwGra0ashT3wGNFK1IeAY=; b=dANM4uGwr3XgY/Nhrz6WxHJIPL
	1HpbIdselrH8iySeWNKXntyGjALm2IFUoJmmoSDoQgvgLiJPq+YWvbJldsOUHc3LFjEBbFhZWJlfo
	VRS/jRsVZSvZpDOxTrb+2x9AZd3xZouXxwbL573vd/cB/ULWsjbR6n8qa5B9eskGvBLc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: suppress trace_emul_write_val hook when !TRACEBUFFER
Message-Id: <E1vlQGj-007Djf-2a@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 11:33:01 +0000

commit afdf0bc854f462995af5abec7fdd53cd9d310574
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 09:52:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 09:52:30 2026 +0100

    x86/shadow: suppress trace_emul_write_val hook when !TRACEBUFFER
    
    The hook is never invoked in that case, and hence needlessly offers an
    extra valid indirect call target. With the hook suppressed, no consumer
    of the three local per-CPU variables exists either, so they're
    suppressed as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/paging.h |  6 ++++--
 xen/arch/x86/mm/shadow/hvm.c      |  2 ++
 xen/arch/x86/mm/shadow/multi.c    | 14 ++++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 72d7c077e4..9668deed4c 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -90,10 +90,12 @@ struct shadow_paging_mode {
     int           (*guess_wrmap           )(struct vcpu *v, 
                                             unsigned long vaddr, mfn_t gmfn);
     void          (*pagetable_dying       )(paddr_t gpa);
+#ifdef CONFIG_TRACEBUFFER
     void          (*trace_emul_write_val  )(const void *ptr, unsigned long vaddr,
                                             const void *src, unsigned int bytes);
-#endif
-#endif
+#endif /* CONFIG_TRACEBUFFER */
+#endif /* CONFIG_HVM */
+#endif /* CONFIG_SHADOW_PAGING */
     /* For outsiders to tell what mode we're in */
     unsigned int shadow_levels;
 };
diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index 69334c0956..d857b1d9d6 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -211,9 +211,11 @@ hvm_emulate_write(enum x86_segment seg,
     default: memcpy(ptr, p_data, bytes);                break;
     }
 
+#ifdef CONFIG_TRACEBUFFER
     if ( tb_init_done )
         v->arch.paging.mode->shadow.trace_emul_write_val(ptr, addr,
                                                          p_data, bytes);
+#endif
 
     sh_emulate_unmap_dest(v, ptr, bytes, sh_ctxt);
     shadow_audit_tables(v);
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e24ef0686f..72f0c6fcbc 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2044,6 +2044,7 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 }
 
 #ifdef CONFIG_HVM
+#ifdef CONFIG_TRACEBUFFER
 #if GUEST_PAGING_LEVELS == 3
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
@@ -2071,9 +2072,11 @@ static void cf_check trace_emulate_write_val(
     memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
 #endif
 }
+#endif /* CONFIG_TRACEBUFFER */
 
 static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
 {
+#ifdef CONFIG_TRACEBUFFER
     if ( tb_init_done )
     {
         struct __packed {
@@ -2099,6 +2102,7 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
 
         sh_trace(TRC_SHADOW_EMULATE, sizeof(d), &d);
     }
+#endif /* CONFIG_TRACEBUFFER */
 }
 #endif /* CONFIG_HVM */
 
@@ -2678,7 +2682,9 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
+#ifdef CONFIG_TRACEBUFFER
     this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
+#endif
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
@@ -2794,7 +2800,10 @@ static int cf_check sh_page_fault(
     if ( r == X86EMUL_OKAY && !emul_ctxt.ctxt.retire.raw )
     {
         int i, emulation_count=0;
+
+#ifdef CONFIG_TRACEBUFFER
         this_cpu(trace_emulate_initial_va) = va;
+#endif
 
         for ( i = 0 ; i < 4 ; i++ )
         {
@@ -2830,7 +2839,10 @@ static int cf_check sh_page_fault(
                 break; /* Don't emulate again if we failed! */
             }
         }
+
+#ifdef CONFIG_TRACEBUFFER
         this_cpu(trace_extra_emulation_count)=emulation_count;
+#endif
     }
 #endif /* PAE guest */
 
@@ -4130,7 +4142,9 @@ const struct paging_mode sh_paging_mode = {
     .shadow.guess_wrmap            = sh_guess_wrmap,
 #endif
     .shadow.pagetable_dying        = sh_pagetable_dying,
+#ifdef CONFIG_TRACEBUFFER
     .shadow.trace_emul_write_val   = trace_emulate_write_val,
+#endif /* CONFIG_TRACEBUFFER */
 #endif /* CONFIG_HVM */
     .shadow.shadow_levels          = SHADOW_PAGING_LEVELS,
 };
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 11:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 11:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216310.1526229 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlQGv-0006hl-9K; Thu, 29 Jan 2026 11:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216310.1526229; Thu, 29 Jan 2026 11: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 1vlQGv-0006hd-6o; Thu, 29 Jan 2026 11:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1216310;
 Thu, 29 Jan 2026 11: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 1vlQGu-0006hR-4S
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 11: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 1vlQGu-009SKZ-1Q
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlQGt-007Dkc-2t
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 11: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=e0c+/UzMLrsyIIHlSrDhF+0NGxNCEvFn741jlt0/DxQ=; b=S2g96hMzal+bUESCvpUX4GmrUe
	V7P3Alt6A4j67YLe+DZy3yb8MhlMiTUqou9F0p1voZ1dpUcnb8wRtRSZpwSTrxB0D/HvV8gJKKJmG
	blNFd6eU2FcFv//2X4vjp/jqvdoCeLXKlxRgh7vTLLZl/4k69CO6hTPKlXlBQt5B6qOw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: dump GPRs and CSRs on unexpected traps
Message-Id: <E1vlQGt-007Dkc-2t@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 11:33:11 +0000

commit 3babc8d2e54614334e353096e1fdd14bb83516a9
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Jan 29 09:53:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 09:53:10 2026 +0100

    xen/riscv: dump GPRs and CSRs on unexpected traps
    
    Provide additional context when an unexpected exception occurs by dumping
    the relevant Supervisor, Virtual Supervisor (VS), and Hypervisor CSRs,
    along with the general-purpose registers associated with the trap.
    
    Dumping VS-mode CSRs in addition to host CSRs is beneficial when analysing
    VS-mode traps. VSCAUSE, VSEPC, VSTVAL, and related VS state are required to
    properly diagnose unexpected guest traps and potential hypervisor
    misconfiguration.
    For example, on an illegal-instruction exception the hardware may record
    the faulting instruction in VSTVAL. If VSTVAL is zero, VSEPC should always
    be inspected, and can be used together with objdump to identify the
    faulting instruction. Dumping VSCAUSE is also useful when the guest does
    not report it, or when the hypervisor redirects a trap to the guest using
    VSCAUSE, VSTATUS, and VSTVEC, allowing verification that a subsequent trap
    is not caused by incorrect VS state.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/traps.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 58 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index e9c9677863..84b5ab4142 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -99,11 +99,66 @@ static const char *decode_cause(unsigned long cause)
     return decode_trap_cause(cause);
 }
 
-static void do_unexpected_trap(const struct cpu_user_regs *regs)
+static void dump_general_regs(const struct cpu_user_regs *regs)
 {
-    unsigned long cause = csr_read(CSR_SCAUSE);
+#define X(regs, name, delim) \
+    printk("%-4s: %016lx" delim, #name, (regs)->name)
+
+    X(regs, ra, " "); X(regs, sp, "\n");
+    X(regs, gp, " "); X(regs, tp, "\n");
+    X(regs, t0, " "); X(regs, t1, "\n");
+    X(regs, t2, " "); X(regs, s0, "\n");
+    X(regs, s1, " "); X(regs, a0, "\n");
+    X(regs, a1, " "); X(regs, a2, "\n");
+    X(regs, a3, " "); X(regs, a4, "\n");
+    X(regs, a5, " "); X(regs, a6, "\n");
+    X(regs, a7, " "); X(regs, s2, "\n");
+    X(regs, s3, " "); X(regs, s4, "\n");
+    X(regs, s5, " "); X(regs, s6, "\n");
+    X(regs, s7, " "); X(regs, s8, "\n");
+    X(regs, s9, " "); X(regs, s10, "\n");
+    X(regs, s11, " "); X(regs, t3, "\n");
+    X(regs, t4, " "); X(regs, t5, "\n");
+    X(regs, t6, "\n");
+
+#undef X
+}
+
+static void dump_csrs(const char *ctx)
+{
+    unsigned long v;
+
+#define X(name, csr, fmt, ...) \
+    v = csr_read(csr); \
+    printk("%-10s: %016lx" fmt, #name, v, ##__VA_ARGS__)
+
+    X(scause, CSR_SCAUSE, " %s[%s]\n", ctx, decode_cause(v));
+
+    X(htval, CSR_HTVAL, " ");  X(htinst, CSR_HTINST, "\n");
+    X(hedeleg, CSR_HEDELEG, " "); X(hideleg, CSR_HIDELEG, "\n");
+    X(hstatus, CSR_HSTATUS, " [%s%s%s%s%s%s ]\n",
+      (v & HSTATUS_VTSR) ? " VTSR" : "",
+      (v & HSTATUS_VTVM) ? " VTVM" : "",
+      (v & HSTATUS_HU)   ? " HU"   : "",
+      (v & HSTATUS_SPVP) ? " SPVP" : "",
+      (v & HSTATUS_SPV)  ? " SPV"  : "",
+      (v & HSTATUS_GVA)  ? " GVA"  : "");
+    X(hgatp, CSR_HGATP, "\n");
+    X(hstateen0, CSR_HSTATEEN0, "\n");
+    X(stvec, CSR_STVEC, " "); X(vstvec, CSR_VSTVEC, "\n");
+    X(sepc, CSR_SEPC, " "); X(vsepc, CSR_VSEPC, "\n");
+    X(stval, CSR_STVAL, " "); X(vstval, CSR_VSTVAL, "\n");
+    X(status, CSR_SSTATUS, " "); X(vsstatus, CSR_VSSTATUS, "\n");
+    X(satp, CSR_SATP, "\n");
+    X(vscause, CSR_VSCAUSE, " [%s]\n", decode_cause(v));
+
+#undef X
+}
 
-    printk("Unhandled exception: %s\n", decode_cause(cause));
+static void do_unexpected_trap(const struct cpu_user_regs *regs)
+{
+    dump_csrs("Unhandled exception");
+    dump_general_regs(regs);
 
     die();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216362.1526253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRCp-0006ZT-PX; Thu, 29 Jan 2026 12:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216362.1526253; Thu, 29 Jan 2026 12: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 1vlRCp-0006ZL-Mm; Thu, 29 Jan 2026 12:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1216362;
 Thu, 29 Jan 2026 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 1vlRCo-0006ZF-B7
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 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 1vlRCo-009TQY-1w
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRCo-007HDB-0Z
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 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=e4qfdl3H/6mBXCN3H9q3022QNKjpYApzjklRsnSEn5E=; b=TVWx+jf3MAjtWHfgjtdX5ktek7
	DbQ6JcPwn3dEOC5eHl6TaZooRWVIJb746cMNqbFyHJKyqucJUwm/k4fD+0vSO6e/dyPFcRYTZui63
	B+LfQYPfv59ZdBTTc0+AX9+cQk9hCuS5I8Ho6mOpcul51zVS1Q/tBhikXrfuz+TNKXlw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: suppress trace_emul_write_val hook when !TRACEBUFFER
Message-Id: <E1vlRCo-007HDB-0Z@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:33:02 +0000

commit afdf0bc854f462995af5abec7fdd53cd9d310574
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 09:52:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 09:52:30 2026 +0100

    x86/shadow: suppress trace_emul_write_val hook when !TRACEBUFFER
    
    The hook is never invoked in that case, and hence needlessly offers an
    extra valid indirect call target. With the hook suppressed, no consumer
    of the three local per-CPU variables exists either, so they're
    suppressed as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/paging.h |  6 ++++--
 xen/arch/x86/mm/shadow/hvm.c      |  2 ++
 xen/arch/x86/mm/shadow/multi.c    | 14 ++++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 72d7c077e4..9668deed4c 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -90,10 +90,12 @@ struct shadow_paging_mode {
     int           (*guess_wrmap           )(struct vcpu *v, 
                                             unsigned long vaddr, mfn_t gmfn);
     void          (*pagetable_dying       )(paddr_t gpa);
+#ifdef CONFIG_TRACEBUFFER
     void          (*trace_emul_write_val  )(const void *ptr, unsigned long vaddr,
                                             const void *src, unsigned int bytes);
-#endif
-#endif
+#endif /* CONFIG_TRACEBUFFER */
+#endif /* CONFIG_HVM */
+#endif /* CONFIG_SHADOW_PAGING */
     /* For outsiders to tell what mode we're in */
     unsigned int shadow_levels;
 };
diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index 69334c0956..d857b1d9d6 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -211,9 +211,11 @@ hvm_emulate_write(enum x86_segment seg,
     default: memcpy(ptr, p_data, bytes);                break;
     }
 
+#ifdef CONFIG_TRACEBUFFER
     if ( tb_init_done )
         v->arch.paging.mode->shadow.trace_emul_write_val(ptr, addr,
                                                          p_data, bytes);
+#endif
 
     sh_emulate_unmap_dest(v, ptr, bytes, sh_ctxt);
     shadow_audit_tables(v);
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e24ef0686f..72f0c6fcbc 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2044,6 +2044,7 @@ static void __maybe_unused sh_trace_gfn_va(uint32_t event, gfn_t gfn,
 }
 
 #ifdef CONFIG_HVM
+#ifdef CONFIG_TRACEBUFFER
 #if GUEST_PAGING_LEVELS == 3
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
@@ -2071,9 +2072,11 @@ static void cf_check trace_emulate_write_val(
     memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
 #endif
 }
+#endif /* CONFIG_TRACEBUFFER */
 
 static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
 {
+#ifdef CONFIG_TRACEBUFFER
     if ( tb_init_done )
     {
         struct __packed {
@@ -2099,6 +2102,7 @@ static inline void sh_trace_emulate(guest_l1e_t gl1e, unsigned long va)
 
         sh_trace(TRC_SHADOW_EMULATE, sizeof(d), &d);
     }
+#endif /* CONFIG_TRACEBUFFER */
 }
 #endif /* CONFIG_HVM */
 
@@ -2678,7 +2682,9 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
+#ifdef CONFIG_TRACEBUFFER
     this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
+#endif
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
@@ -2794,7 +2800,10 @@ static int cf_check sh_page_fault(
     if ( r == X86EMUL_OKAY && !emul_ctxt.ctxt.retire.raw )
     {
         int i, emulation_count=0;
+
+#ifdef CONFIG_TRACEBUFFER
         this_cpu(trace_emulate_initial_va) = va;
+#endif
 
         for ( i = 0 ; i < 4 ; i++ )
         {
@@ -2830,7 +2839,10 @@ static int cf_check sh_page_fault(
                 break; /* Don't emulate again if we failed! */
             }
         }
+
+#ifdef CONFIG_TRACEBUFFER
         this_cpu(trace_extra_emulation_count)=emulation_count;
+#endif
     }
 #endif /* PAE guest */
 
@@ -4130,7 +4142,9 @@ const struct paging_mode sh_paging_mode = {
     .shadow.guess_wrmap            = sh_guess_wrmap,
 #endif
     .shadow.pagetable_dying        = sh_pagetable_dying,
+#ifdef CONFIG_TRACEBUFFER
     .shadow.trace_emul_write_val   = trace_emulate_write_val,
+#endif /* CONFIG_TRACEBUFFER */
 #endif /* CONFIG_HVM */
     .shadow.shadow_levels          = SHADOW_PAGING_LEVELS,
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:33:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216363.1526257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRCz-0006bI-Qs; Thu, 29 Jan 2026 12:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216363.1526257; Thu, 29 Jan 2026 12: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 1vlRCz-0006bA-OC; Thu, 29 Jan 2026 12:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1216363;
 Thu, 29 Jan 2026 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 1vlRCy-0006aw-D9
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 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 1vlRCy-009TQy-2G
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRCy-007HDp-11
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 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=ZSuIRCUbTvb/KZAVvIz30lvccrovzE0cn1+FrktWNRg=; b=5oRxYptDHzwTNarR50DvB10B8D
	ckKvFDabycXnPxqKWgQxWLC2ZyMmdhnCtgwuvnFyaQ0nS6vYFcsPM7Pn+A5z8FQWJbHGczf9iJ7OO
	wHp349Y6TecSSBlghapp18mQUfFhdLfCw/zrKhWwxSfpkKE3NNT4DXR+ppdh44uIPRpo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: dump GPRs and CSRs on unexpected traps
Message-Id: <E1vlRCy-007HDp-11@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:33:12 +0000

commit 3babc8d2e54614334e353096e1fdd14bb83516a9
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Jan 29 09:53:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 09:53:10 2026 +0100

    xen/riscv: dump GPRs and CSRs on unexpected traps
    
    Provide additional context when an unexpected exception occurs by dumping
    the relevant Supervisor, Virtual Supervisor (VS), and Hypervisor CSRs,
    along with the general-purpose registers associated with the trap.
    
    Dumping VS-mode CSRs in addition to host CSRs is beneficial when analysing
    VS-mode traps. VSCAUSE, VSEPC, VSTVAL, and related VS state are required to
    properly diagnose unexpected guest traps and potential hypervisor
    misconfiguration.
    For example, on an illegal-instruction exception the hardware may record
    the faulting instruction in VSTVAL. If VSTVAL is zero, VSEPC should always
    be inspected, and can be used together with objdump to identify the
    faulting instruction. Dumping VSCAUSE is also useful when the guest does
    not report it, or when the hypervisor redirects a trap to the guest using
    VSCAUSE, VSTATUS, and VSTVEC, allowing verification that a subsequent trap
    is not caused by incorrect VS state.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/traps.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 58 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index e9c9677863..84b5ab4142 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -99,11 +99,66 @@ static const char *decode_cause(unsigned long cause)
     return decode_trap_cause(cause);
 }
 
-static void do_unexpected_trap(const struct cpu_user_regs *regs)
+static void dump_general_regs(const struct cpu_user_regs *regs)
 {
-    unsigned long cause = csr_read(CSR_SCAUSE);
+#define X(regs, name, delim) \
+    printk("%-4s: %016lx" delim, #name, (regs)->name)
+
+    X(regs, ra, " "); X(regs, sp, "\n");
+    X(regs, gp, " "); X(regs, tp, "\n");
+    X(regs, t0, " "); X(regs, t1, "\n");
+    X(regs, t2, " "); X(regs, s0, "\n");
+    X(regs, s1, " "); X(regs, a0, "\n");
+    X(regs, a1, " "); X(regs, a2, "\n");
+    X(regs, a3, " "); X(regs, a4, "\n");
+    X(regs, a5, " "); X(regs, a6, "\n");
+    X(regs, a7, " "); X(regs, s2, "\n");
+    X(regs, s3, " "); X(regs, s4, "\n");
+    X(regs, s5, " "); X(regs, s6, "\n");
+    X(regs, s7, " "); X(regs, s8, "\n");
+    X(regs, s9, " "); X(regs, s10, "\n");
+    X(regs, s11, " "); X(regs, t3, "\n");
+    X(regs, t4, " "); X(regs, t5, "\n");
+    X(regs, t6, "\n");
+
+#undef X
+}
+
+static void dump_csrs(const char *ctx)
+{
+    unsigned long v;
+
+#define X(name, csr, fmt, ...) \
+    v = csr_read(csr); \
+    printk("%-10s: %016lx" fmt, #name, v, ##__VA_ARGS__)
+
+    X(scause, CSR_SCAUSE, " %s[%s]\n", ctx, decode_cause(v));
+
+    X(htval, CSR_HTVAL, " ");  X(htinst, CSR_HTINST, "\n");
+    X(hedeleg, CSR_HEDELEG, " "); X(hideleg, CSR_HIDELEG, "\n");
+    X(hstatus, CSR_HSTATUS, " [%s%s%s%s%s%s ]\n",
+      (v & HSTATUS_VTSR) ? " VTSR" : "",
+      (v & HSTATUS_VTVM) ? " VTVM" : "",
+      (v & HSTATUS_HU)   ? " HU"   : "",
+      (v & HSTATUS_SPVP) ? " SPVP" : "",
+      (v & HSTATUS_SPV)  ? " SPV"  : "",
+      (v & HSTATUS_GVA)  ? " GVA"  : "");
+    X(hgatp, CSR_HGATP, "\n");
+    X(hstateen0, CSR_HSTATEEN0, "\n");
+    X(stvec, CSR_STVEC, " "); X(vstvec, CSR_VSTVEC, "\n");
+    X(sepc, CSR_SEPC, " "); X(vsepc, CSR_VSEPC, "\n");
+    X(stval, CSR_STVAL, " "); X(vstval, CSR_VSTVAL, "\n");
+    X(status, CSR_SSTATUS, " "); X(vsstatus, CSR_VSSTATUS, "\n");
+    X(satp, CSR_SATP, "\n");
+    X(vscause, CSR_VSCAUSE, " [%s]\n", decode_cause(v));
+
+#undef X
+}
 
-    printk("Unhandled exception: %s\n", decode_cause(cause));
+static void do_unexpected_trap(const struct cpu_user_regs *regs)
+{
+    dump_csrs("Unhandled exception");
+    dump_general_regs(regs);
 
     die();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:55:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216377.1526261 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRY7-0000Ww-6u; Thu, 29 Jan 2026 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216377.1526261; Thu, 29 Jan 2026 12:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRY7-0000Wo-4N; Thu, 29 Jan 2026 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1216377;
 Thu, 29 Jan 2026 12:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRY6-0000Wh-Dn
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRY6-009TnM-27
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRY6-007JHT-0t
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lI/meOOMrbYapIGArRH5MCWXd+UObzHEyV4dwvApwvk=; b=D/rR6CVkW/xJHIQGy9yVVg9ZVn
	Ar4QXuPNK1UWBAo01dNjus5V94z48ef5I29ay0prbr5G8tP1ZmVF2lENPFhYzmxigUs3NMYBnkV/i
	Di84cnFHI8mH1wNacxu1J6eGXyfyfZ3Sx0x/Wcw4ptyaP4/KZVS4jPQv9HXjYpSEphLw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] symbols: re-number intermediate files
Message-Id: <E1vlRY6-007JHT-0t@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:55:02 +0000

commit ee66c421661cd59291fff21f5b1422e5631065bb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:35:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:35:01 2026 +0100

    symbols: re-number intermediate files
    
    symbols/x86: re-number intermediate files
    
    In preparation to do away with symbols-dummy, re-number the assembly and
    object files used, for the numbers to match the next passes real output.
    This is to make 0 available to use for what now is handled by
    symbols-dummy. (Mirror the numbering to the intermediate reloc files for
    xen.efi, just to avoid confusion.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    
    symbols/arm: re-number intermediate files
    
    In preparation to do away with symbols-dummy, re-number the assembly and
    object files used, for the numbers to match the next passes real output.
    This is to make 0 available to use for what now is handled by
    symbols-dummy.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5c1c05b27bf28bb7670e2b7fe729d853fa8a4b05
    master date: 2025-11-26 12:09:32 +0100
    master commit: ba7974b5d2581fb1f5b439c49a5d5b301817591d
    master date: 2025-12-08 15:28:43 +0100
---
 xen/arch/arm/Makefile | 12 ++++++------
 xen/arch/x86/Makefile | 28 ++++++++++++++--------------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7e88ddd3d7..11c6b6b06d 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -89,16 +89,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).0.S
-	$(MAKE) $(build)=$(@D) $(dot-target).0.o
+		> $(dot-target).1.S
+	$(MAKE) $(build)=$(@D) $(dot-target).1.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
-	    $(dot-target).0.o -o $(dot-target).1
+	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).1.S
-	$(MAKE) $(build)=$(@D) $(dot-target).1.o
+		> $(dot-target).2.S
+	$(MAKE) $(build)=$(@D) $(dot-target).2.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).1.o -o $@
+	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 407571c510..6fe6cddea4 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -138,16 +138,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).0.S
-	$(MAKE) $(build)=$(@D) $(dot-target).0.o
+		> $(dot-target).1.S
+	$(MAKE) $(build)=$(@D) $(dot-target).1.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).0.o -o $(dot-target).1
+	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
-		> $(dot-target).1.S
-	$(MAKE) $(build)=$(@D) $(dot-target).1.o
+		> $(dot-target).2.S
+	$(MAKE) $(build)=$(@D) $(dot-target).2.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(orphan-handling-y) $(dot-target).1.o -o $@
+	    $(orphan-handling-y) $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
@@ -211,23 +211,23 @@ endif
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
-		> $(dot-target).0r.S
+		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).0s.S
-	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
+		> $(dot-target).1s.S
+	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
-	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
+	                $(dot-target).1r.o $(dot-target).1s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
-		> $(dot-target).1r.S
+		> $(dot-target).2r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).1s.S
-	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
+		> $(dot-target).2s.S
+	$(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
-	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
+	      $(dot-target).2r.o $(dot-target).2s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216379.1526267 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYH-0000Yi-98; Thu, 29 Jan 2026 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216379.1526267; Thu, 29 Jan 2026 12:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYH-0000Ya-5j; Thu, 29 Jan 2026 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1216379;
 Thu, 29 Jan 2026 12:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRYG-0000YN-Ed
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYG-009Tpf-2Q
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYG-007JIm-1E
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mhkJK6Dka+5fVz+JUXwJiTdyNfEu/0Gk+GYdhqYHIbs=; b=A3uOnpGV39zyr94ns+u+MorGDF
	Lo6abmaeypUhRn0NhKcx3YJr3GA3Mil2CBwz3eci5lSr4PRDH+2zbUpAyRxkV/c068OxLw7NOWIo/
	8K3C7dz835boe7c1OJbsMtxFFvsno7G9YsMFKltWKItA6yrSjrkgI7RJ9eNnpCpkytAY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] symbols: don't use symbols-dummy
Message-Id: <E1vlRYG-007JIm-1E@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:55:12 +0000

commit 97593f78ea1b702fdbad5a2b44baf457078c9538
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:35:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:35:28 2026 +0100

    symbols: don't use symbols-dummy
    
    symbols/x86: don't use symbols-dummy
    
    In particular when linking with lld, which converts hidden symbols to
    local ones, the ELF symbol table can change in unhelpful ways between the
    first two linking passes, resulting in the .rodata contributions to change
    between the 2nd and 3rd pass. That, however, renders our embedded symbol
    table pretty much unusable; the recently introduced self-test may then
    also fail. (Another difference between compiling a C file and assembling
    the generated ones is that - with -fdata-sections in use - the .rodata
    contributions move between passes 1 and 2, when we'd prefer them not to.)
    
    Make tools/symbols capable of producing an "empty" assembly file, such
    that unwanted differences between passes 1 and 2 go away when then using
    the corresponding objects in place of common/symbols-dummy.o.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    
    symbols/arm: don't use symbols-dummy
    
    In particular when linking with lld, which converts hidden symbols to
    local ones, the ELF symbol table can change in unhelpful ways between the
    first two linking passes, resulting in the .rodata contributions to change
    between the 2nd and 3rd pass. That, however, renders our embedded symbol
    table pretty much unusable; the recently introduced self-test may then
    also fail. (Another difference between compiling a C file and assembling
    the generated ones is that - with -fdata-sections in use - the .rodata
    contributions move between passes 1 and 2, when we'd prefer them not to.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 92f3beb62750f9b1f14d0e4693e793355a99c185
    master date: 2025-11-26 12:10:00 +0100
    master commit: d88873d01f4ec638daf722e332e2cab9f8ab3019
    master date: 2025-12-08 15:29:12 +0100
---
 xen/arch/arm/Makefile | 4 +++-
 xen/arch/x86/Makefile | 8 ++++++--
 xen/tools/symbols.c   | 5 ++++-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 11c6b6b06d..7494a0f926 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -85,8 +85,10 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
+	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
+	$(MAKE) $(build)=$(@D) $(dot-target).0.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
-	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
+	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 6fe6cddea4..9d07a0a0d6 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -134,8 +134,10 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
+	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
+	$(MAKE) $(build)=$(@D) $(dot-target).0.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
+	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
@@ -206,9 +208,11 @@ $(TARGET).efi: $(objtree)/prelink.o $(note_file) $(obj)/efi.lds $(obj)/efi/reloc
 ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
+	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0s.S
+	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
-	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
+	                $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
 		> $(dot-target).1r.S
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 7685866b97..0af8a1e91c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -675,7 +675,10 @@ int main(int argc, char **argv)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
 				warn_dup = error_dup = true;
-			else if (strcmp(argv[i], "--xensyms") == 0)
+			else if (strcmp(argv[i], "--empty") == 0) {
+				write_src();
+				return 0;
+			} else if (strcmp(argv[i], "--xensyms") == 0)
 				map_only = true;
 			else
 				usage();
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216382.1526269 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYR-0000bI-A5; Thu, 29 Jan 2026 12:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216382.1526269; Thu, 29 Jan 2026 12:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYR-0000bA-77; Thu, 29 Jan 2026 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1216382;
 Thu, 29 Jan 2026 12:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRYQ-0000b4-HV
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYQ-009Tpj-2j
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYQ-007JJA-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/PDk2j5vvTt+CFgjlZAP3/D9c6wnWQVyulRpBvorlag=; b=lf0XICdmJ0VCOotdRTvF7H0OGB
	zCTM+jS1w00b5kGNR99QPdTfP63xQufkoqurrfJmRS80fUIoMwSP8hbr/egaRSBeXLg9fteEK4hTA
	iEtjh9qz0LlG6Fi+ToiB1BxazGjaA0wDM8B6J/Nuu78Nh9w23lN3V5+YaxJF0W7cA9oE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/domain: Disallow XENMEM_claim_pages on dying domains
Message-Id: <E1vlRYQ-007JJA-1V@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:55:22 +0000

commit bc63b09ecc03570ed760980957840329f9610f9b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:36:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:36:14 2026 +0100

    xen/domain: Disallow XENMEM_claim_pages on dying domains
    
    XENMEM_claim_pages can be issued on a domain in the later stages of
    domain_kill().  In that case, the claimed memory is leaked, as there's no way
    to subsequently release the claim.
    
    Claims are intended for use during domain construction; to reserve sufficient
    RAM to construct the domain fully.  There's no legitimate reason to be calling
    it on a dying domain.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 2379ca04feab7df40051d03f73487d9e0cef43ac
    master date: 2025-12-17 17:35:24 +0000
---
 xen/common/memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 3cb6fa9495..10becf7c1f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1685,6 +1685,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_claim_pages(XSM_PRIV, d);
 
+        if ( !rc && d->is_dying )
+            rc = -EINVAL;
+
         if ( !rc )
             rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216383.1526273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYb-0000dx-Cq; Thu, 29 Jan 2026 12:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216383.1526273; Thu, 29 Jan 2026 12:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYb-0000dq-AE; Thu, 29 Jan 2026 12:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1216383;
 Thu, 29 Jan 2026 12:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRYa-0000dk-Mb
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYb-009Tpp-02
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYa-007JLX-1q
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ri4VTj17+nTAt5oIfVrgEs+B8QocqCi/pHjN4ylbYqA=; b=lrVAQlOCoHfTbG3Ayg6LQMOjmV
	wI7gQySByIo5HYt8Qikvl6Xxgz5Kno9SAn3FK0Da155OnROVZmV9d31/1t7mbln2aYxacJEnAD+f3
	Hrs1SxOJWRteC4ZZ/ba7P9cXze7xkzg+xUdYEjJ8SKu9BtcmLQ022jT07CEWzkiMi/h0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vlRYa-007JLX-1q@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:55:32 +0000

commit b3f59203a542001ff7485bb0be95658cbb9bb106
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:37:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:37:12 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
    master date: 2026-01-20 09:03:17 +0100
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ece9ae0b34..3b451525a9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1649,8 +1649,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216385.1526277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYl-0000gA-EX; Thu, 29 Jan 2026 12:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216385.1526277; Thu, 29 Jan 2026 12:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYl-0000g2-Bh; Thu, 29 Jan 2026 12:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1216385;
 Thu, 29 Jan 2026 12:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRYk-0000fw-Px
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYl-009Tpt-0M
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYk-007JMV-2M
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XdSy+bkt/ZJc1GPLz+rZGlxLCSlHGhQexZ2TeWrypB0=; b=xbUejltx0vQYwO6gADUEwBH8FS
	SAoeg014yEo6bddFAZap103AqfcT2ztM4aZ9BZbgh39ujC6M/PcxAOW+SJKMX/WD7UlU9iEXXNmhg
	uzPKlasZrdb4AI+A8DT6E1ZrAIou8eUWoYRQGhCaL8WrldmcB7ZS+NWlg0hqBSkz4LE8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1vlRYk-007JMV-2M@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:55:42 +0000

commit 4e3c9c2eca01e2437395296ee44d48b1341f52a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:37:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:37:54 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
    master date: 2026-01-22 09:10:10 +0100
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 8c8bf1a806..5869fff8f9 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -109,7 +109,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216386.1526281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYw-0000iX-Fx; Thu, 29 Jan 2026 12:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216386.1526281; Thu, 29 Jan 2026 12:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRYw-0000iP-DE; Thu, 29 Jan 2026 12:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1216386;
 Thu, 29 Jan 2026 12:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRYu-0000iH-TX
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYv-009Tpz-0j
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRYu-007JN3-2g
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i9mg0ukk30w1zrvgxsO17jvkqyqFCSn7UQecW9ZK6vo=; b=zIUuVJ0mOL9NW1Dlfptc5XHFCF
	76WfSnVYLuEjZn1zF6KlOdD3xm/CXfZrt5mp/IhyfzuSgFNmh/NE7Sc/NqnHOeVH4hKGymtlHRbft
	wQZk0aUTeEhwEtBGN8PLVg5PzsuXBV0z5VDLhEW8yu5K6AOZswDW1mV17Jt1u89fwlNY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1vlRYu-007JN3-2g@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:55:52 +0000

commit 8cb60ba2365c36570fddebdfda321d63e17cb2e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:38:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:38:31 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
    master date: 2026-01-22 09:13:14 +0100
---
 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 52c22fa50c..fc2372c523 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -351,6 +351,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:56:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216387.1526285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZ6-0000kX-Ha; Thu, 29 Jan 2026 12:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216387.1526285; Thu, 29 Jan 2026 12:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZ6-0000kQ-Ed; Thu, 29 Jan 2026 12:56:04 +0000
Received: by outflank-mailman (input) for mailman id 1216387;
 Thu, 29 Jan 2026 12:56:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRZ5-0000kK-02
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:56:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZ5-009TqE-0z
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZ4-007JOL-32
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sM61eN/D7AdqpYPFs5q1laYZ9/G7wqIoJhBhoTb8cbI=; b=1xQvp6cJoPpkPCVOdsrgiA/b+6
	pxA/TbcN7IQY6LcRggZH4yU5Jw1Th7BZewbyuWUzknIhNw9KrrBMg3czGCZVnBXf2nbQBFr6APbXc
	8UiOnhDIVLxdUIJrNfcSJNhpKPKG6gQ1/T3VTGE+Iuzlka1iiiJbK6Nd4CMbkDSIcEwY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] flask: fix gcov build with gcc14+
Message-Id: <E1vlRZ4-007JOL-32@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:56:02 +0000

commit b75f39c692dcc73e3d762393f479742b73faa01e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:38:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:38:48 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 7db4509d80242cc03cc7228c50e88248c8eeb02f
    master date: 2026-01-26 10:34:14 +0100
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 165304c133..f3674371ac 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1271,7 +1271,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1342,7 +1345,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1436,7 +1442,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:56:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216388.1526289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZG-0000ml-Iw; Thu, 29 Jan 2026 12:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216388.1526289; Thu, 29 Jan 2026 12:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZG-0000md-GI; Thu, 29 Jan 2026 12:56:14 +0000
Received: by outflank-mailman (input) for mailman id 1216388;
 Thu, 29 Jan 2026 12:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRZF-0000mT-2c
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZF-009Tqh-1F
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZF-007JPU-04
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N6ywqOIEing7m35hRyJpLypNx3jMTc2y0jkScQ1Ht8Y=; b=RYA81kotY00aBbf4JeZ42Ma3kw
	wB9qMCckrLgzHFdijPylP3re3h4a85AUz3SWQiQUF62PjBybGlxTE2wUAd6cXbRt5iDoTMZmahIi+
	n5IK6PbP2U2Ot9GyGKaIcrPJ1K2uxdWDFhwG7H8mjSkXWpAWRYFIBAVDf7mUCq4Tsw6A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] symbols: ensure sorting by value yields reproducible outcome
Message-Id: <E1vlRZF-007JPU-04@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:56:13 +0000

commit fc024ebf24baedcef98310347abd2480662aca74
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:39:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:39:03 2026 +0100

    symbols: ensure sorting by value yields reproducible outcome
    
    qsort() implementations have freedom towards actions taken when two items
    compare equal. The latest with the introduction of fake "end" symbols,
    inconsistent sorting between the 1st and 2nd run can lead to extra "end"
    symbols in one of the runs, making the resulting symbol table partly
    unusable. (Note in particular that --warn-dup or --error-dup are passed
    only on the 2nd run, and only for xen.syms, and that option has the effect
    of doing a name sort ahead of doing the address sort. I.e. the inputs to
    the 2nd qsort() are pretty different between the 1st and 2nd runs.)
    
    Make the result stable by using original order to break ties.
    
    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>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: af3466ddd6490e2ff634bfdaca5a40725b466c2a
    master date: 2026-01-26 11:49:06 +0100
---
 xen/tools/symbols.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 0af8a1e91c..a2b46d655c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -40,6 +40,7 @@ struct sym_entry {
 	unsigned long long addr;
 	unsigned long size;
 	unsigned int len;
+	unsigned int orig_idx;
 	unsigned char *sym;
 	char *orig_symbol;
 	unsigned int addr_idx;
@@ -247,6 +248,9 @@ static void read_map(FILE *in)
 				exit (1);
 			}
 		}
+
+		table[table_cnt].orig_idx = table_cnt;
+
 		if (read_symbol(in, &table[table_cnt]) == 0)
 			table_cnt++;
 	}
@@ -639,7 +643,11 @@ static int compare_value(const void *p1, const void *p2)
 		return -1;
 	if (isupper(*sym2->sym))
 		return +1;
-	return 0;
+
+	/* Explicitly request "keep original order" otherwise. */
+	if (sym1->orig_idx < sym2->orig_idx)
+		return -1;
+	return sym1->orig_idx > sym2->orig_idx;
 }
 
 static int compare_name(const void *p1, const void *p2)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:56:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216390.1526293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZQ-0000p7-Kc; Thu, 29 Jan 2026 12:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216390.1526293; Thu, 29 Jan 2026 12:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZQ-0000oz-Hi; Thu, 29 Jan 2026 12:56:24 +0000
Received: by outflank-mailman (input) for mailman id 1216390;
 Thu, 29 Jan 2026 12:56:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRZP-0000or-4w
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZP-009Tql-1U
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZP-007JS6-0K
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O6GXSHX73vICoHCxo6ROl1/CfC0LIjMIWVhSnJ7uc/g=; b=Zrs3ILeTHEVbR1/gizjvwSqrEj
	U+JdTGPF+FnhkEETOA3P8U+8kiDvBzMnHjzdzv18MtkhM+oPNndtilhAMeNkzBBbmB+1Josmu+Xdy
	I3kACVq8qoU3MKo8dpgKmSM0yJdrYRF2aGTSC0lvqxKG3jANK/VJhlfqI8/TQ0sf3WMo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] symbols: don't omit "end" symbols upon mixed code / data aliases
Message-Id: <E1vlRZP-007JS6-0K@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:56:23 +0000

commit 25db82b062f49c52e897a024e69339c69181928c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:39:26 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:39:26 2026 +0100

    symbols: don't omit "end" symbols upon mixed code / data aliases
    
    At the example of _sinitext - that symbol has four aliases on x86:
    __init_begin, __2M_init_start, __2M_rodata_end, and whatever the first
    function in .init.text. With the GNU toolchain all of them are marked
    'T' or 't'. With Clang/LLVM, however, some are marked 'r'. Since, to
    save space, we want fake "end" symbols only for text, right now
    want_symbol_end() has a respective check. That is getting in the way,
    however, when the final of those symbols is 'r'. Remove the check and
    instead zap the size for anything that is non-code.
    
    Fixes: 6eede548df21 ('symbols: avoid emitting "end" symbols for data items')
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: af2dbe260f3d5bdd5d47dacc87bfcc449bf91c24
    master date: 2026-01-26 11:49:31 +0100
---
 xen/tools/symbols.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index a2b46d655c..509394d5a4 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -165,6 +165,10 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	else if (str[0] == '$')
 		goto skip_tail;
 
+	/* We want fake "end" symbols only for text / code. */
+	if (toupper((uint8_t)stype) != 'T')
+		s->size = 0;
+
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
 	s->len = strlen(str) + 1;
@@ -316,7 +320,6 @@ 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-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:56:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216391.1526297 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZa-0000rG-Lv; Thu, 29 Jan 2026 12:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216391.1526297; Thu, 29 Jan 2026 12:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZa-0000r8-JD; Thu, 29 Jan 2026 12:56:34 +0000
Received: by outflank-mailman (input) for mailman id 1216391;
 Thu, 29 Jan 2026 12:56:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRZZ-0000r0-7V
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:56:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZZ-009Tqq-1k
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZZ-007JSz-0a
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qV/a+ZZtOC1T6EZj4kbHlD2T/zuon8Dj4PyRgAoZkK4=; b=ghvcdEDT3Rh6bboGRDivY6DeHA
	4lE/tls48yK2cY+gdV3PpOdDW1tmPUIbjQXXKr3DD3ydwvv7rfiWRVrKYEPlmqqL/d2/ZUTYAILs0
	L3Sj07t8ILnXaoTe4pWTe+UJIqSnZFlwTOYvIR6ZI5JXYdW0+0IUHQLxcOzys44q8cF4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vlRZZ-007JSz-0a@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:56:33 +0000

commit 8d7a0f86619c2e2c00c98f2aa5708cd638039815
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:40:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:40:28 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    [jb: backport limited to Arm]
    master commit: f0abe60de13b7ca33464d5715d28e77fb545a1f0
    master date: 2026-01-27 10:26:36 +0100
---
 xen/arch/arm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7494a0f926..95bc7ad25e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -87,13 +87,13 @@ endif
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:56:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216392.1526300 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZk-0000tL-NQ; Thu, 29 Jan 2026 12:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216392.1526300; Thu, 29 Jan 2026 12:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZk-0000tD-Ka; Thu, 29 Jan 2026 12:56:44 +0000
Received: by outflank-mailman (input) for mailman id 1216392;
 Thu, 29 Jan 2026 12:56: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 1vlRZj-0000t5-A2
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:56: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 1vlRZj-009Tqz-1z
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZj-007JTh-0q
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YuDdxIkEhNo3XvPawnlmU6xHKFfSdFa3JCMSTeDd5uc=; b=r0z0jdFPpX+0gb5hdYzqchCcRo
	UcpWJVHSyqk3kQXI0V8auSpB0PYd/JsUmZjKbyHy7eAAH5bcOzDCAImR2XppeJh6oePpLP2aap/Nx
	YqMYerWlY0m+UNWINq4AdaCLSPhXDYPZtGuluRwjgMAkO6XaqrdO6iW9zkAntLrYXebI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vlRZj-007JTh-0q@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:56:43 +0000

commit 3f4bf1e876c38e1898de745da69223b4519d4fb6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:40:41 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:40:41 2026 +0100

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
    master date: 2026-01-27 13:59:12 +0000
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index fb5c6acded..b7c71ebc67 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1023,6 +1023,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->family == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1310,15 +1317,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:56:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216393.1526306 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZu-0000wG-QP; Thu, 29 Jan 2026 12:56:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216393.1526306; Thu, 29 Jan 2026 12:56:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRZu-0000w7-NU; Thu, 29 Jan 2026 12:56:54 +0000
Received: by outflank-mailman (input) for mailman id 1216393;
 Thu, 29 Jan 2026 12:56: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 1vlRZt-0000w0-OW
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:56: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 1vlRZu-009Tr3-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRZt-007JV0-2H
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:56:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KeBwySwZWhu8ELWyQJz7tuPdg118Gh7RvEkEmyGhZM4=; b=llAz1ssrcz86NzdwypolHEaGiK
	CdtoeT31lLfbPpQ7XFIhwENWBQ19t93OyShc04cAp0EabRD5XldPFRU/MdGLbS77u202yNgxZablF
	G2upO5SfIQpR2ogzycs1ObcSeGUZj4fgmixsaK9VlU4vRUvrdMeW2WqqM1brmJjpB8AY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/domain: Disallow XENMEM_claim_pages on dying domains
Message-Id: <E1vlRZt-007JV0-2H@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:56:53 +0000

commit 95c476191fbb654cf62571b4e59da77ba9289bff
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:43:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:43:29 2026 +0100

    xen/domain: Disallow XENMEM_claim_pages on dying domains
    
    XENMEM_claim_pages can be issued on a domain in the later stages of
    domain_kill().  In that case, the claimed memory is leaked, as there's no way
    to subsequently release the claim.
    
    Claims are intended for use during domain construction; to reserve sufficient
    RAM to construct the domain fully.  There's no legitimate reason to be calling
    it on a dying domain.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 2379ca04feab7df40051d03f73487d9e0cef43ac
    master date: 2025-12-17 17:35:24 +0000
---
 xen/common/memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1165ef200f..c78f0dcd0a 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1683,6 +1683,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_claim_pages(XSM_PRIV, d);
 
+        if ( !rc && d->is_dying )
+            rc = -EINVAL;
+
         if ( !rc )
             rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:57:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:57:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216394.1526308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRa4-0000yL-RR; Thu, 29 Jan 2026 12:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216394.1526308; Thu, 29 Jan 2026 12:57:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRa4-0000yD-Os; Thu, 29 Jan 2026 12:57:04 +0000
Received: by outflank-mailman (input) for mailman id 1216394;
 Thu, 29 Jan 2026 12:57: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 1vlRa3-0000y7-RL
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:57: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 1vlRa4-009TrN-0V
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRa3-007JWN-2Y
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VvH4NsirRMIOHJIcXH2Wwq/8HCSM/wSGMePP9EO9Acs=; b=6+xIMqRaTtV5bZXoPiIFRCIa+d
	gbNXBMODpTnrdQd8N/0s7edPC5CJ6GGFatp8n+vWar7qF9OgXBsaiScl1Wyv7GnbJfT9V9nb3Cbzc
	rMm9kXU9R5bd5AX8QzKnupePyrUStIPzGgCQ2+0ggqZp6O9Y7T7+cJOXUh16eq3EHH8Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vlRa3-007JWN-2Y@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:57:03 +0000

commit 36bea779033985b0e0d5454f987227428b1439e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:44:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:44:05 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
    master date: 2026-01-20 09:03:17 +0100
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ece9ae0b34..3b451525a9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1649,8 +1649,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:57:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:57:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216395.1526313 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRaE-00010V-T0; Thu, 29 Jan 2026 12:57:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216395.1526313; Thu, 29 Jan 2026 12:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRaE-00010N-QJ; Thu, 29 Jan 2026 12:57:14 +0000
Received: by outflank-mailman (input) for mailman id 1216395;
 Thu, 29 Jan 2026 12:57: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 1vlRaD-00010F-Tr
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:57: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 1vlRaE-009Trj-0l
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRaD-007JWy-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QhU7BZUeG4ghGGxF3LF+BxJFaop3GqNc2oxv4TSUbZY=; b=YWDsiZuBRP5syHM/COYXbYNYzU
	KLAtWy+RpoCbWqjaBLD+q0tddUg9V289RVTbyhyYO2anvuTugBXnTQWQFm1avHRgIUccTEY/+lu1X
	G8kpDCkRcXjaOAgQ/mIejxzL5aXvoQw4Wmh9jB7G8n8IkA9IlGvUAWED1sAqMPtCve8s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1vlRaD-007JWy-2p@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:57:13 +0000

commit 2e5aae39cde3170141c6cd79a3ef0c4553fa8adf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:44:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:44:30 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
    master date: 2026-01-22 09:10:10 +0100
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 168cd3a9ee..eb8f4ef8fe 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -103,7 +103,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:57:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216396.1526317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRaO-00015D-UF; Thu, 29 Jan 2026 12:57:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216396.1526317; Thu, 29 Jan 2026 12:57: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 1vlRaO-000155-Ri; Thu, 29 Jan 2026 12:57:24 +0000
Received: by outflank-mailman (input) for mailman id 1216396;
 Thu, 29 Jan 2026 12:57: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 1vlRaO-00014z-0P
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:57: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 1vlRaO-009Trn-10
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRaN-007JXq-34
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57: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=uY+nIbhGYhNZP7AOs/pf/Io0Rp0Mew90tBZxy5V1CNM=; b=FaNl40sbDoxVbSMmhazEwrxMbe
	+gZo8jfBaQhUZcEnyuAloeGbxPJoyN2xOvZ1Lt1FjLhrEs1qZb6t4kOh8MDxrsArGTGAParsuAasB
	5tJEbDQMk2GwKtUQ/5anzNgTktMzAu8WcW8TMua2RVjR9FrKURvL9r1pIl9e2SrCOyaY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1vlRaN-007JXq-34@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:57:23 +0000

commit ab487e9ba17fdc83337133a0429d101620d61d84
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:44:45 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:44:45 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
    master date: 2026-01-22 09:13:14 +0100
---
 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 7e071c71b3..651bf2b448 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -357,6 +357,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:57:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:57:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216397.1526321 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRaY-00017M-Vm; Thu, 29 Jan 2026 12:57:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216397.1526321; Thu, 29 Jan 2026 12:57: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 1vlRaY-00017E-TB; Thu, 29 Jan 2026 12:57:34 +0000
Received: by outflank-mailman (input) for mailman id 1216397;
 Thu, 29 Jan 2026 12:57: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 1vlRaY-000176-2e
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:57: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 1vlRaY-009Trz-1G
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRaY-007JaP-05
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CvzmF982yjo5F72W1scIrGJGbNfJerUs7ofGsiP/wVU=; b=5OvJJAt4AW4dLN+J3h0ri4I8RV
	wO+EVfxf6L90OVclyKEuk3ysiznPT17+pMakRi3rtWciehva6FnS4gK6ZxM1ZQj2GHi2DBT3DPrFz
	0BtA66mI5kEtPRYjpu1S55b+lzACGUT9qgAKQV8tQpA/XbwKxgyeGS1MIhzwuYUis9nY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] flask: fix gcov build with gcc14+
Message-Id: <E1vlRaY-007JaP-05@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:57:34 +0000

commit 2bc123400820b8290320ccab017882aaa826f0cb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:45:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:45:23 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 7db4509d80242cc03cc7228c50e88248c8eeb02f
    master date: 2026-01-26 10:34:14 +0100
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 5af45fdc27..17e98ded50 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1272,7 +1272,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1343,7 +1346,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1437,7 +1443,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:57:46 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:57:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216398.1526325 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRak-00019T-0w; Thu, 29 Jan 2026 12:57:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216398.1526325; Thu, 29 Jan 2026 12:57:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRaj-00019L-Ua; Thu, 29 Jan 2026 12:57:45 +0000
Received: by outflank-mailman (input) for mailman id 1216398;
 Thu, 29 Jan 2026 12:57: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 1vlRai-00019D-58
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:57: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 1vlRai-009Ts4-1W
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRai-007JbS-0L
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1ALOhgbPcLnpbfuXrJwI01hE6XWPcs59Z3Xr5vt1l9k=; b=CgPH0mUf9uYhRh3eU0j+o7yk0E
	anxrsbEzj16coofVTSlwcAFUtm1vOoHBx+tbG0S2gSQdXHw5+5RPJMzBCAcoR+yg3mMg1xuEiJiyi
	CcPoHD8cjrTHz3eL+pdX2sv8wgj0haVO5Wld1/rmn145kCjJXf8Mp8p26tFrMMjpT2F0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vlRai-007JbS-0L@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:57:44 +0000

commit e6b861fc84d10d05e3b1b079019630d57ccbc922
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:45:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:45:33 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    [jb: backport limited to Arm]
    master commit: f0abe60de13b7ca33464d5715d28e77fb545a1f0
    master date: 2026-01-27 10:26:36 +0100
---
 xen/arch/arm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 54e3905e01..86812cb2db 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -96,13 +96,13 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:57:56 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:57:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216399.1526329 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRau-0001Bv-2D; Thu, 29 Jan 2026 12:57:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216399.1526329; Thu, 29 Jan 2026 12:57: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 1vlRat-0001Bn-Vn; Thu, 29 Jan 2026 12:57:55 +0000
Received: by outflank-mailman (input) for mailman id 1216399;
 Thu, 29 Jan 2026 12:57: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 1vlRas-0001Bd-7j
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:57: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 1vlRas-009TsA-1m
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRas-007Jcd-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:57:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QC6MjBejbJxLztxdYa7K/9EUa+6DqHi8+90FBEXeD/o=; b=M7Ri8WCTIYtuAXfMXKYENxFrro
	/ut5SNihXpfZnYdshcor4brbxQ9cy0y3hk1DgbuWtR3Ce8CS3o5yBRlBtZtGdBsJHERRtVT5TskBC
	XANunykfvAYzjp3ok19erK7x/F7N+xJBYcqVb2tPIRdmNY3hgFEFelMStgwvREr93aLs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vlRas-007Jcd-0b@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:57:54 +0000

commit 75013fc5c523b8a969310016d436296d1c34ad99
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:45:41 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:45:41 2026 +0100

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
    master date: 2026-01-27 13:59:12 +0000
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ce555ec8cf..d5069a7ec1 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -957,6 +957,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->x86 == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1245,15 +1252,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:58:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:58:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216400.1526332 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRb4-0001E1-3f; Thu, 29 Jan 2026 12:58:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216400.1526332; Thu, 29 Jan 2026 12:58:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRb4-0001Dt-0r; Thu, 29 Jan 2026 12:58:06 +0000
Received: by outflank-mailman (input) for mailman id 1216400;
 Thu, 29 Jan 2026 12:58: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 1vlRb2-0001Dl-MG
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:58: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 1vlRb2-009TsT-3D
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRb2-007JfB-23
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qDWtPVSp0xQerPu/J7U7SPonWfirUNM/haFM+JQpNJk=; b=68mwMcbS4GqP6kkroUFbnbe/tS
	EycKibZN7eZL0jhfxhyKIndmLJa/qdFZCMORNX/f/jSbUDsOQmV7EPkI2XLkOI3XoHXYZkRtWQxVF
	/TURlicJFyscwO6o/mHE40bLBXPEHmFFKC+ivWkI3nN5pXTfPDhqo8/kWTAYFdg1HyEA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/domain: Disallow XENMEM_claim_pages on dying domains
Message-Id: <E1vlRb2-007JfB-23@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:58:04 +0000

commit 4eb4bb4e0b66c6db481dd2aee654bb53cd7266e6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:47:19 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:47:19 2026 +0100

    xen/domain: Disallow XENMEM_claim_pages on dying domains
    
    XENMEM_claim_pages can be issued on a domain in the later stages of
    domain_kill().  In that case, the claimed memory is leaked, as there's no way
    to subsequently release the claim.
    
    Claims are intended for use during domain construction; to reserve sufficient
    RAM to construct the domain fully.  There's no legitimate reason to be calling
    it on a dying domain.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 2379ca04feab7df40051d03f73487d9e0cef43ac
    master date: 2025-12-17 17:35:24 +0000
---
 xen/common/memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1f0a9d7e5f..9b23cd0bdb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1678,6 +1678,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_claim_pages(XSM_PRIV, d);
 
+        if ( !rc && d->is_dying )
+            rc = -EINVAL;
+
         if ( !rc )
             rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:58:16 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:58:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216401.1526337 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbE-0001Gl-6H; Thu, 29 Jan 2026 12:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216401.1526337; Thu, 29 Jan 2026 12:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbE-0001Ge-3S; Thu, 29 Jan 2026 12:58:16 +0000
Received: by outflank-mailman (input) for mailman id 1216401;
 Thu, 29 Jan 2026 12:58: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 1vlRbC-0001GR-P5
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:58: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 1vlRbD-009Tsv-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRbC-007Jfe-2J
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RCe52rSHJ7In1cOhnxEdHeUryYnDWELaGb2OyTMWLVY=; b=z/G2xu5MI0foBA75BYk9CC4g2q
	wNkiW76pWBiqiOCfoYmQ9RsymjzANzTC3PP57Xhsx/vHD4jrBLmWQHM93k3qOR85TZecjr36Nf/YO
	Y6b7CMqfyl+hH9vlFNL/odv86J9RFOEkugMQYMq3eeIQydmacsg5ftCM4T+qBecepljA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vlRbC-007Jfe-2J@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:58:14 +0000

commit 489b5bb0c2af18f4f0757c6b7cfe904568859ca3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:48:02 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:48:02 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
    master date: 2026-01-20 09:03:17 +0100
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index a12e3b28a8..2addacb2bf 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1532,8 +1532,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:58:26 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:58:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216404.1526342 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbO-0001J2-8L; Thu, 29 Jan 2026 12:58:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216404.1526342; Thu, 29 Jan 2026 12:58:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbO-0001Iu-4y; Thu, 29 Jan 2026 12:58:26 +0000
Received: by outflank-mailman (input) for mailman id 1216404;
 Thu, 29 Jan 2026 12:58: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 1vlRbM-0001Im-Rp
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:58: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 1vlRbN-009Tsz-0Y
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRbM-007JgV-2Z
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58: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=ESN98UatrWyBHpRwR/1XcbrvqmiWMr1cFUL3bhnIyxA=; b=2D4Q0LM4l2Wc1IRaZsRZbNgx8v
	O3r5UCGvFOS1g4vypBFxFvPreCCKcg+ybe3jt+M8YsBHDA1B2lEPFyiqPJ/JDxDDjPwB/NlSBHnJF
	yv4vKgj+to7eN5IwZIxQM0Dbvx89qvklANdunqqAEhitqSBidsg5IAuZ0WjpQH6uybpQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1vlRbM-007JgV-2Z@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:58:24 +0000

commit 7482ce01cd2343588377cf73c5ffa39ffd5535a2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:48:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:48:20 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
    master date: 2026-01-22 09:10:10 +0100
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 859df977a0..130d4e2a35 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -104,7 +104,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:58:36 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:58:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216405.1526345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbY-0001LC-8s; Thu, 29 Jan 2026 12:58:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216405.1526345; Thu, 29 Jan 2026 12:58:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbY-0001L4-6L; Thu, 29 Jan 2026 12:58:36 +0000
Received: by outflank-mailman (input) for mailman id 1216405;
 Thu, 29 Jan 2026 12:58:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRbW-0001Kw-V6
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:58: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 1vlRbX-009Tt5-0t
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRbW-007JhB-2s
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58: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=RBxbQiDXESjs2WcNuNnbpGiL3k96O4ciItUTFqHuH5M=; b=sDz3CvyHP+rb4XInpuBr+XDjoe
	CXu/5bvwezTPnc36WIAJb2urXAL9w0ho7/Zy8mFOy/WC26qp5DIPvIc1/ETN9WuW6wUdCN0h6BLUH
	7yKBGZkbaKDghmTqNlNFSW6Bo5BwnLg/+PX5uzlww83+m/XR1p62sTs65MAeyFDwO/FE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1vlRbW-007JhB-2s@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:58:34 +0000

commit 91926059d531a24c4f6a60396329679d3d477096
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:48:52 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:48:52 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
    master date: 2026-01-22 09:13:14 +0100
---
 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 80e06c0a78..1633825738 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -354,6 +354,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:58:46 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:58:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216407.1526350 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbi-0001NN-Aw; Thu, 29 Jan 2026 12:58:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216407.1526350; Thu, 29 Jan 2026 12:58: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 1vlRbi-0001NF-7n; Thu, 29 Jan 2026 12:58:46 +0000
Received: by outflank-mailman (input) for mailman id 1216407;
 Thu, 29 Jan 2026 12:58:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlRbh-0001N7-1V
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:58:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRbh-009TtC-19
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRbg-007JiQ-3C
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58: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=IBVNTx3rgLotTu6d0VbtIwHDsa5KRfpHq49EuYw+RG0=; b=OizsUlkugnI0rlio2gMoSdnoUk
	4BkRfLHJuRP9r+si/XCxy64twgOJdCh8nYAcBQrjEdoRSWTkOvrnELSEdLr3G5HLRRtnzvPYb8Ej8
	sa1QB/PRrW9TJ069en5MtRi287odW0fX2tuDVVqOYFewnvmnPesnkIG7V6+pG8hEhSt0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] flask: fix gcov build with gcc14+
Message-Id: <E1vlRbg-007JiQ-3C@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:58:44 +0000

commit fad76f0d20e0f47f0da0eb89eb12063e1d29a60f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:49:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:49:12 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 7db4509d80242cc03cc7228c50e88248c8eeb02f
    master date: 2026-01-26 10:34:14 +0100
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 5af45fdc27..17e98ded50 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1272,7 +1272,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1343,7 +1346,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1437,7 +1443,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:58:56 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:58:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216408.1526352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRbs-0001RN-Bm; Thu, 29 Jan 2026 12:58:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216408.1526352; Thu, 29 Jan 2026 12:58: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 1vlRbs-0001RF-9F; Thu, 29 Jan 2026 12:58:56 +0000
Received: by outflank-mailman (input) for mailman id 1216408;
 Thu, 29 Jan 2026 12:58: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 1vlRbr-0001R7-3p
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:58: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 1vlRbr-009TtG-1O
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRbr-007Jis-0E
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:58:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=glGY55hE/2NYSVnyxLqc+KMmuE6JwNxsSvA77qT5DUU=; b=23T+SNoPX8cwYt+SmFoJW7cY3g
	1cO4lhf7FV+QfsUq8IhlYLkhGS6iWZYK4qkUZByR7QfAnnYVn1ypHVmamWtscxj2N2XugFpT2F96l
	eo39V/nivM07y9M/ttRAFi9PTUirZV8wVGT4CZtIYSlZ5FT3AZMPT7k7cxMY1dR17nuY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vlRbr-007Jis-0E@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:58:55 +0000

commit 6b4480fe71d8684dcecacf17bd3e9816428cbb0e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:49:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:49:20 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    [jb: backport limited to Arm]
    master commit: f0abe60de13b7ca33464d5715d28e77fb545a1f0
    master date: 2026-01-27 10:26:36 +0100
---
 xen/arch/arm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 940de246b5..bfb36dd304 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -97,13 +97,13 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 12:59:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 12:59:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216409.1526356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlRc2-0001TR-D6; Thu, 29 Jan 2026 12:59:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216409.1526356; Thu, 29 Jan 2026 12:59: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 1vlRc2-0001TJ-AZ; Thu, 29 Jan 2026 12:59:06 +0000
Received: by outflank-mailman (input) for mailman id 1216409;
 Thu, 29 Jan 2026 12:59: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 1vlRc1-0001TB-6P
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 12:59: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 1vlRc1-009Tto-1d
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:59:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlRc1-007Jjy-0T
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 12:59:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wVLK7NpygknjE72h+cNs7wXKGJ4B1VAOvu17DdyZoDM=; b=Vv+5BEh2qp/LXqgjwbnQ+egRuM
	tGWIU9n/DEp/p+sLeFHyopo06NzOCcTJGewksctBWvHV9PjzUSYX60+n0NYMRgyoB+S9Y5Hhv1cWl
	B2kFLY6/XIeR60YJgsjG5fcXAzZhixLrhpe4mqByLsTboFOyuDz/eGWpnyNDsTzPXYxI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vlRc1-007Jjy-0T@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 12:59:05 +0000

commit 991f480a8f1246ae5db0b91a62f819d3ea1dc539
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:49:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:49:28 2026 +0100

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
    master date: 2026-01-27 13:59:12 +0000
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 84fac6ade2..ebeed00941 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -957,6 +957,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->x86 == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1245,15 +1252,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 14:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 14:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216610.1526541 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSuJ-00053Y-F4; Thu, 29 Jan 2026 14:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216610.1526541; Thu, 29 Jan 2026 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 1vlSuJ-00053Q-CW; Thu, 29 Jan 2026 14:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1216610;
 Thu, 29 Jan 2026 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 1vlSuI-00053K-BK
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 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 1vlSuI-009VaR-1y
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSuI-007PBw-0l
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14: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=EQTudmBVfkWySBUCuGJh40qXhzS5Tzd4rs3WE8xLLsk=; b=i5zQYrMAbMlPLu3eg3M1iuO3Pd
	kwgnm/p2dIawqGo4IjduJ5SLpi2eY3Mrpj3PhK3IGViawrvLYWWHXtDjBXthC1NldiyA2Lx+57qVl
	qfkp0U3kkxPxQutxkWc1x+NrDakrrngT5yBOk7OCtPBM5KKDjGGx4irNGcbArztaFNA4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/domain: Disallow XENMEM_claim_pages on dying domains
Message-Id: <E1vlSuI-007PBw-0l@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 14:22:02 +0000

commit 95c476191fbb654cf62571b4e59da77ba9289bff
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:43:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:43:29 2026 +0100

    xen/domain: Disallow XENMEM_claim_pages on dying domains
    
    XENMEM_claim_pages can be issued on a domain in the later stages of
    domain_kill().  In that case, the claimed memory is leaked, as there's no way
    to subsequently release the claim.
    
    Claims are intended for use during domain construction; to reserve sufficient
    RAM to construct the domain fully.  There's no legitimate reason to be calling
    it on a dying domain.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 2379ca04feab7df40051d03f73487d9e0cef43ac
    master date: 2025-12-17 17:35:24 +0000
---
 xen/common/memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1165ef200f..c78f0dcd0a 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1683,6 +1683,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_claim_pages(XSM_PRIV, d);
 
+        if ( !rc && d->is_dying )
+            rc = -EINVAL;
+
         if ( !rc )
             rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 14:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 14:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216611.1526544 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSuT-00055H-GO; Thu, 29 Jan 2026 14:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216611.1526544; Thu, 29 Jan 2026 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 1vlSuT-00055A-Ds; Thu, 29 Jan 2026 14:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1216611;
 Thu, 29 Jan 2026 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 1vlSuS-000552-Ck
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 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 1vlSuS-009Vao-2G
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSuS-007PCv-14
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 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=syHJY7hFN2NqdaoDeoL51BAo3CtJwt9zng2qb6NY3nE=; b=t3olDhsrymprRFhLCxemSr6Alz
	CNGCeFqAl4faRJUUKU/MFUpxUWGTsnJofdM8meNf5Zf7UcLCQIRL9zdDiaAbcPRRpWE8W/emfDO4p
	4T7aDcvb1G/NyvlwWEHZGegyO5zfunmp0/4MK2O4DW58YKxWgqJMTZbEBg82zVl2N0E8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vlSuS-007PCv-14@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 14:22:12 +0000

commit 36bea779033985b0e0d5454f987227428b1439e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:44:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:44:05 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
    master date: 2026-01-20 09:03:17 +0100
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ece9ae0b34..3b451525a9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1649,8 +1649,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 14:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 14:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216612.1526549 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSue-00058M-JF; Thu, 29 Jan 2026 14:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216612.1526549; Thu, 29 Jan 2026 14: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 1vlSue-00058E-Gd; Thu, 29 Jan 2026 14:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1216612;
 Thu, 29 Jan 2026 14:22: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 1vlSud-00057x-1c
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 14:22: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 1vlSud-009Vat-17
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSuc-007PEO-1L
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 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=S+noUTxflO6UaQYTnTrYvq9kyDkUBseQ2vXMzfEP/kM=; b=aQuvEb8etKxFCPX+dzgUTAOsjN
	tDzZNXQtSE/X3eDs7HDFXQD/ramAL27N+henHUkLFCNUIvhhW1xac+dHxmuoZPVXI1AAkbvsfvnnP
	T0AIlZgQFzQKK5rzTbK/quoIM0x24fI9Ijb0+OcdjvXQdP/87D4INZ8hMSNH3393elV8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1vlSuc-007PEO-1L@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 14:22:22 +0000

commit 2e5aae39cde3170141c6cd79a3ef0c4553fa8adf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:44:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:44:30 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
    master date: 2026-01-22 09:10:10 +0100
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 168cd3a9ee..eb8f4ef8fe 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -103,7 +103,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 14:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 14:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216614.1526552 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSuo-0005AV-KX; Thu, 29 Jan 2026 14:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216614.1526552; Thu, 29 Jan 2026 14: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 1vlSuo-0005AN-Hu; Thu, 29 Jan 2026 14:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1216614;
 Thu, 29 Jan 2026 14:22: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 1vlSun-0005AF-4Q
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 14:22: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 1vlSun-009VbK-1R
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSun-007PIl-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22: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=k0zAQxxKIRy9TnP4WKDr/RpJViogkwuojwObcp3jvo0=; b=tPPhuN+Y6pUQV4/tibwBBHKWnK
	pMsK/6GhD7E5DgKG4myim5zs8bX5OJs6tWyYy8dpL32jKjLe10OnajseQZNDr9mV67OBdh5MhNkfv
	t/ofmLWA3Xy0GwBthdXkeLTPWviCk/0lJnLlcKjWLqVaH4Gdico+2cRlhXl3bL/CPNm4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1vlSun-007PIl-0D@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 14:22:33 +0000

commit ab487e9ba17fdc83337133a0429d101620d61d84
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:44:45 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:44:45 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
    master date: 2026-01-22 09:13:14 +0100
---
 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 7e071c71b3..651bf2b448 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -357,6 +357,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 14:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 14:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216615.1526557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSuy-0005Cd-M1; Thu, 29 Jan 2026 14:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216615.1526557; Thu, 29 Jan 2026 14: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 1vlSuy-0005CV-JL; Thu, 29 Jan 2026 14:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1216615;
 Thu, 29 Jan 2026 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 1vlSux-0005CM-7J
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 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 1vlSux-009VbS-1i
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSux-007PJr-0W
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22: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=MmPQiDxqFoM8gwBM1EuTUBZljALqcNQJsHr23q6g2e4=; b=mdhpsgKir9tC1GSygcTKro+A85
	JlF/II58HdZi9zMhkX0ibPZfotn+IV6Azitk/rURxwmvx53PzdCowNfdhIQ6WZp29G5kbd1a9sKpI
	O7g1J9dYO3TqDCTYLqxUl0LtVAZUmlw59pSNzfZYQ7jJSYVK25tEOTL5LdbtKHM1Daqo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] flask: fix gcov build with gcc14+
Message-Id: <E1vlSux-007PJr-0W@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 14:22:43 +0000

commit 2bc123400820b8290320ccab017882aaa826f0cb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:45:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:45:23 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 7db4509d80242cc03cc7228c50e88248c8eeb02f
    master date: 2026-01-26 10:34:14 +0100
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 5af45fdc27..17e98ded50 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1272,7 +1272,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1343,7 +1346,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1437,7 +1443,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 14:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 14:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216616.1526560 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSv8-0005F3-NN; Thu, 29 Jan 2026 14:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216616.1526560; Thu, 29 Jan 2026 14:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSv8-0005Ev-Kp; Thu, 29 Jan 2026 14:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1216616;
 Thu, 29 Jan 2026 14:22: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 1vlSv7-0005En-9s
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 14:22: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 1vlSv7-009VbY-1y
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSv7-007PKO-0o
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:22: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=rQeSHzWTyY+lSGe7jdnP1irVf+U+7nsMKeLm3py3kHs=; b=vh/uE1LlKFWU4AlE/dwfRRJjoq
	3sTIV38Wbo2hj4Io1zBxf5FwO/kXxddQSb0Mo4FB+7100ce0lIeYO3k0QLBUP1whjtGr8ewjSPyZF
	bJ5ixIl7VKXhSxkesLaQiWsudguWhDdl4ZDMu4y9j3XEELBIcH/W1Lraa1PTxeCzpyjs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vlSv7-007PKO-0o@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 14:22:53 +0000

commit e6b861fc84d10d05e3b1b079019630d57ccbc922
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:45:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:45:33 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    [jb: backport limited to Arm]
    master commit: f0abe60de13b7ca33464d5715d28e77fb545a1f0
    master date: 2026-01-27 10:26:36 +0100
---
 xen/arch/arm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 54e3905e01..86812cb2db 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -96,13 +96,13 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 14:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 14:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216618.1526565 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSvI-0005HJ-P7; Thu, 29 Jan 2026 14:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216618.1526565; Thu, 29 Jan 2026 14:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlSvI-0005HC-MG; Thu, 29 Jan 2026 14:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1216618;
 Thu, 29 Jan 2026 14:23:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vlSvH-0005Gy-CU
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 14:23:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSvH-009Vbs-2E
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlSvH-007PLA-14
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 14:23: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=B0DCNqwXau1vAxHRJNkK6WyzxxfpfXmLQyzgeEmi/LI=; b=bzP+ujJMj2//u6IQFupgM2MB/N
	Y0YT8XhQe2j6kB+pQX64IuTmfyWuLkCRaexkE1rlRfkMR8c8Nd/QJrJo3XwGqakwC9TxzsBHOZN79
	K4V2yf3h5mzgYa3ojVhjaUSkMiW1OOncFVbX5YmhzGzwQWkVFFclmy59gsHcha5Wua4Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vlSvH-007PLA-14@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 14:23:03 +0000

commit 75013fc5c523b8a969310016d436296d1c34ad99
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:45:41 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:45:41 2026 +0100

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
    master date: 2026-01-27 13:59:12 +0000
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ce555ec8cf..d5069a7ec1 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -957,6 +957,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->x86 == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1245,15 +1252,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 15:00:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 15:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216690.1526619 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTV5-0004H6-Eb; Thu, 29 Jan 2026 15:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216690.1526619; Thu, 29 Jan 2026 15: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 1vlTV5-0004Gm-Bu; Thu, 29 Jan 2026 15:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1216690;
 Thu, 29 Jan 2026 15: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 1vlTV4-00042P-8o
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 15: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 1vlTV4-009WFB-1k
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlTV4-007SFD-0L
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15: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=qsfcXJoYkVcydI+odvXQZS/9SH0XtpVZTSbjHsvbqMo=; b=SVDH1uLZM+aURF3uG2WSdgD6sD
	nHNMqehLCG7R0LiWGhOFI+Z/pyV3aGepTp12iEKib+bj/1svOfWiIZH8QbpruoMbsS2iR3BAELS08
	Bu67JOWrhK3HT9TskGOfmZpDufNtYaL4IPijqFqpLvzm07q+4e2oABB2Dx9PCzKl/NLI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/domain: Disallow XENMEM_claim_pages on dying domains
Message-Id: <E1vlTV4-007SFD-0L@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 15:00:02 +0000

commit 4eb4bb4e0b66c6db481dd2aee654bb53cd7266e6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:47:19 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:47:19 2026 +0100

    xen/domain: Disallow XENMEM_claim_pages on dying domains
    
    XENMEM_claim_pages can be issued on a domain in the later stages of
    domain_kill().  In that case, the claimed memory is leaked, as there's no way
    to subsequently release the claim.
    
    Claims are intended for use during domain construction; to reserve sufficient
    RAM to construct the domain fully.  There's no legitimate reason to be calling
    it on a dying domain.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 2379ca04feab7df40051d03f73487d9e0cef43ac
    master date: 2025-12-17 17:35:24 +0000
---
 xen/common/memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1f0a9d7e5f..9b23cd0bdb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1678,6 +1678,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_claim_pages(XSM_PRIV, d);
 
+        if ( !rc && d->is_dying )
+            rc = -EINVAL;
+
         if ( !rc )
             rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 15:00:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 15:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216691.1526622 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVF-0004su-Ft; Thu, 29 Jan 2026 15:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216691.1526622; Thu, 29 Jan 2026 15:00:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVF-0004so-DG; Thu, 29 Jan 2026 15:00:13 +0000
Received: by outflank-mailman (input) for mailman id 1216691;
 Thu, 29 Jan 2026 15: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 1vlTVE-0004se-E2
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 15: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 1vlTVE-009WHY-22
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlTVE-007SGX-0q
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15: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=Zr2kHN6i67OwVkKQVx/lePJhG9kG15cmYOYWbbRYEFE=; b=h1HkK7VedUlauRFrLcdpDzGQve
	IwSVQSzOPxsBkYPK48XVCeRjej8rasiJcX/ljUJiDvhZieidpNWlkM6ukLmXOp0yujdAHBkBBSSaH
	9LHqaiR5snGRuRA/HikOT0jxarJBC3nn+IjLd79FqctpdmN7mQqY82p1mFsEtIoutgUs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vlTVE-007SGX-0q@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 15:00:12 +0000

commit 489b5bb0c2af18f4f0757c6b7cfe904568859ca3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:48:02 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:48:02 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
    master date: 2026-01-20 09:03:17 +0100
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index a12e3b28a8..2addacb2bf 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1532,8 +1532,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 15:00:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 15:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216692.1526626 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVP-0004vg-HJ; Thu, 29 Jan 2026 15:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216692.1526626; Thu, 29 Jan 2026 15:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVP-0004vY-Ee; Thu, 29 Jan 2026 15:00:23 +0000
Received: by outflank-mailman (input) for mailman id 1216692;
 Thu, 29 Jan 2026 15:00: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 1vlTVO-0004vO-Dd
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 15:00: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 1vlTVO-009WHc-2M
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlTVO-007SGt-17
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UI4nTFl8olMJdRLnbP/RLlOqPEkk1GW+T9REYcGyic0=; b=O5AqvTDa8NKE2hTynnvd30XtZv
	8I1D4DY/urLQcSDsX4t3PoSQi5eTnmoQGFofKovzU93FJfIZSdKQ5XfciTQnnjHJEKjjRw4v56DAp
	SSOoFnjJ2ABHVzgAeCChPCygGqKZ3VdEFoumRjHcaa5bXGrWdvwkvXuEyt1+Hvx8izpU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1vlTVO-007SGt-17@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 15:00:22 +0000

commit 7482ce01cd2343588377cf73c5ffa39ffd5535a2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:48:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:48:20 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
    master date: 2026-01-22 09:10:10 +0100
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 859df977a0..130d4e2a35 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -104,7 +104,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 15:00:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 15:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216693.1526631 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVZ-0004yH-Js; Thu, 29 Jan 2026 15:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216693.1526631; Thu, 29 Jan 2026 15:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVZ-0004y9-HN; Thu, 29 Jan 2026 15:00:33 +0000
Received: by outflank-mailman (input) for mailman id 1216693;
 Thu, 29 Jan 2026 15:00: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 1vlTVY-0004y1-H6
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 15:00: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 1vlTVY-009WHg-2g
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlTVY-007SHQ-1R
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F4X7yE+HwPWLu57RLpc9nRBDnM/j1I0f7SJO0e9OJ/I=; b=VB1/vjrMp2P19CPQjmPLplmenl
	SiQHST2pwAi/xkyaEx4tvKDJSnN1h5w+oD33M4kHNFSxGg1FFuh81v1LeXCLFp8ZElM2oMFBxftkC
	MJ8EJNxWWfWsFgiucDI74cscINQ5nNNmKwkwBwrSwJ0r9D6g7avJO9+ql8BgUCSuz4pA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1vlTVY-007SHQ-1R@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 15:00:32 +0000

commit 91926059d531a24c4f6a60396329679d3d477096
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:48:52 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:48:52 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
    master date: 2026-01-22 09:13:14 +0100
---
 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 80e06c0a78..1633825738 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -354,6 +354,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 15:00:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 15:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216694.1526635 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVj-00050P-LM; Thu, 29 Jan 2026 15:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216694.1526635; Thu, 29 Jan 2026 15:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVj-00050H-Ij; Thu, 29 Jan 2026 15:00:43 +0000
Received: by outflank-mailman (input) for mailman id 1216694;
 Thu, 29 Jan 2026 15:00: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 1vlTVi-000505-K4
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 15:00: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 1vlTVi-009WHk-30
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlTVi-007SHm-1m
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GThKJwZ7KkNeN1p2odiRfGh+LQ0jGdMnMNvuboKQOG8=; b=Imw4u5yiVVtCIC3Ahq72Hhl8oz
	hTwlQc4pYMTYW1pM3s8bC4TCNGPD3NtmNtqPdEOhyIL/SARzHao+ibgdnVtUL43JxGzCvkImnsTCA
	FWEOglBYLUyy9W1MfzqfIUk5zq0J7UXL8sno88nUmEXoLq/X9tG4X7n1VmLpXUWRW6Y8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] flask: fix gcov build with gcc14+
Message-Id: <E1vlTVi-007SHm-1m@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 15:00:42 +0000

commit fad76f0d20e0f47f0da0eb89eb12063e1d29a60f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:49:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:49:12 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 7db4509d80242cc03cc7228c50e88248c8eeb02f
    master date: 2026-01-26 10:34:14 +0100
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 5af45fdc27..17e98ded50 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1272,7 +1272,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1343,7 +1346,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1437,7 +1443,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 15:00:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 15:00:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216695.1526638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVt-00052l-Ml; Thu, 29 Jan 2026 15:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216695.1526638; Thu, 29 Jan 2026 15:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTVt-00052d-K6; Thu, 29 Jan 2026 15:00:53 +0000
Received: by outflank-mailman (input) for mailman id 1216695;
 Thu, 29 Jan 2026 15:00: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 1vlTVs-00052T-Mk
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 15:00: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 1vlTVt-009WHo-02
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlTVs-007SIM-25
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:00:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=imh6eVk06uEvKBahaHhRo2m8fvJ4aG9uVZz3TyLl9Lg=; b=HUDM9FCf61Sc3N+6hSITGiIke+
	f6RAHwZ1rvcCbjQyGa2KRiPNI+eUhKy/4SxNS5MrqJSfLc7XIRSi7/S7zNhoZXiqIkX9xFNPBYxV7
	EEd4/XxCGxbMwxF4R812qJjz1Y/M5WCIZez6gUiU7wiz1oLDqHJ0neqbUMKH05yMl18g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vlTVs-007SIM-25@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 15:00:52 +0000

commit 6b4480fe71d8684dcecacf17bd3e9816428cbb0e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:49:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:49:20 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    [jb: backport limited to Arm]
    master commit: f0abe60de13b7ca33464d5715d28e77fb545a1f0
    master date: 2026-01-27 10:26:36 +0100
---
 xen/arch/arm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 940de246b5..bfb36dd304 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -97,13 +97,13 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).0.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Jan 29 15:01:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Jan 2026 15:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1216696.1526643 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTW3-000553-OL; Thu, 29 Jan 2026 15:01:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1216696.1526643; Thu, 29 Jan 2026 15:01:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vlTW3-00054v-La; Thu, 29 Jan 2026 15:01:03 +0000
Received: by outflank-mailman (input) for mailman id 1216696;
 Thu, 29 Jan 2026 15:01: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 1vlTW2-00054i-PN
 for xen-changelog@lists.xenproject.org; Thu, 29 Jan 2026 15:01: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 1vlTW3-009WI5-0J
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:01:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vlTW2-007SJD-2M
 for xen-changelog@lists.xenproject.org;
 Thu, 29 Jan 2026 15:01:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BRSmfUYHWt6/+cPjp6EcrtNUm2XC7rZIxMl6cFvH8Zg=; b=jwiH20zHbAc0RR1Biz0v2heyHn
	eawWke0s6IXF/B7rthwr97qb5m4AeQfTwhWL8ArYGh7LPZXWhCUu3KTn9U/clkj+ymVPol3behxHh
	IeksVV9fNlX5KbWQ77BU6VkK1xnBG4bQfLSqvQH5nnSQG5ctYxdLpLmx8TYyouRxEfwc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vlTW2-007SJD-2M@xenbits.xenproject.org>
Date: Thu, 29 Jan 2026 15:01:02 +0000

commit 991f480a8f1246ae5db0b91a62f819d3ea1dc539
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:49:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:49:28 2026 +0100

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
    master date: 2026-01-27 13:59:12 +0000
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 84fac6ade2..ebeed00941 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -957,6 +957,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->x86 == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1245,15 +1252,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


