From xen-changelog-bounces@lists.xenproject.org Sun Aug 02 04:22:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 02 Aug 2026 04:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1380479.1624273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqNi7-0006R4-AL; Sun, 02 Aug 2026 04:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1380479.1624273; Sun, 02 Aug 2026 04: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 1wqNi7-0006Qv-7K; Sun, 02 Aug 2026 04:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1380479;
 Sun, 02 Aug 2026 04: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 1wqNi6-0006Qp-Au
 for xen-changelog@lists.xenproject.org; Sun, 02 Aug 2026 04: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 1wqNi6-001RzU-0w
 for xen-changelog@lists.xenproject.org;
 Sun, 02 Aug 2026 04:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqNi5-006fxp-39
 for xen-changelog@lists.xenproject.org;
 Sun, 02 Aug 2026 04: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=snX6aY+UDvwrTysPCzzfu0z1XmR9Kyv4qnUohh1DKsY=; b=4o87NeNR13Y8Wu+38/H/o4QH4A
	YpzNy0crOegH2drthds/P8BLNkmMFBkqQo0ynM87UIRjqn8rswqd0N+XBxRCG7jXJCSGPsXTt8fcz
	rUeVEHBdTX9EkkUu9s1miWvwxCtsXE5pRoJDvaY8SmN3cji0mu3j42ZqLPOZxcxsuDhQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/elfstructs: Fix includes
Message-Id: <E1wqNi5-006fxp-39@xenbits.xenproject.org>
Date: Sun, 02 Aug 2026 04:22:01 +0000

commit 7c77acd452fb6a3079661e75ebb5cf23ed985cc7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 7 14:40:27 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Jul 31 16:49:15 2026 +0100

    xen/elfstructs: Fix includes
    
    elfstructs.h needs the stdint.h types.  Two headers arrange this manually, but
    elf.h and livepatch.h do not, which breaks source files whose headers are
    properly sorted.
    
    elfstructs.h is used by tools too, so use stdint directly outside of Xen.
    
    Clean up trailing whitespace.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/include/xen/elfstructs.h    | 8 +++++++-
 xen/include/xen/livepatch_elf.h | 1 -
 xen/include/xen/version.h       | 1 -
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/elfstructs.h b/xen/include/xen/elfstructs.h
index 62225bb8a0..8ee0d5aa5b 100644
--- a/xen/include/xen/elfstructs.h
+++ b/xen/include/xen/elfstructs.h
@@ -26,6 +26,12 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef __XEN__
+#include <xen/stdint.h>
+#else
+#include <stdint.h>
+#endif
+
 typedef uint32_t	Elf32_Addr;	/* Unsigned program address */
 typedef uint32_t	Elf32_Off;	/* Unsigned file offset */
 typedef uint16_t	Elf32_Half;	/* Unsigned medium integer */
@@ -45,7 +51,7 @@ typedef uint64_t	Elf64_Xword;
 
 /*
  * e_ident[] identification indexes
- * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html 
+ * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html
  */
 #define EI_MAG0		0		/* file ID */
 #define EI_MAG1		1		/* file ID */
diff --git a/xen/include/xen/livepatch_elf.h b/xen/include/xen/livepatch_elf.h
index 842111e145..a8aafecd34 100644
--- a/xen/include/xen/livepatch_elf.h
+++ b/xen/include/xen/livepatch_elf.h
@@ -5,7 +5,6 @@
 #ifndef __XEN_LIVEPATCH_ELF_H__
 #define __XEN_LIVEPATCH_ELF_H__
 
-#include <xen/types.h>
 #include <xen/elfstructs.h>
 
 /* The following describes an Elf file as consumed by Xen Live Patch. */
diff --git a/xen/include/xen/version.h b/xen/include/xen/version.h
index 6f5d9c9560..b9fa8d7052 100644
--- a/xen/include/xen/version.h
+++ b/xen/include/xen/version.h
@@ -1,7 +1,6 @@
 #ifndef __XEN_VERSION_H__
 #define __XEN_VERSION_H__
 
-#include <xen/types.h>
 #include <xen/elfstructs.h>
 
 const char *xen_compile_date(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:00:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381293.1624839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoWs-0006xF-AJ; Mon, 03 Aug 2026 09:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381293.1624839; Mon, 03 Aug 2026 09:00:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoWs-0006x5-7Y; Mon, 03 Aug 2026 09:00:14 +0000
Received: by outflank-mailman (input) for mailman id 1381293;
 Mon, 03 Aug 2026 09: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 1wqoWq-0006wu-Dq
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqoWq-0038NB-26
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoWq-00Hb4w-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=cTCySkJKlEjLDc/xvxMQsLNIjeFXlk9hVwHTxQLJ53M=; b=uWR8D2/x5CqP03cl3Mw/xpUUA9
	Z86e4wHm6tejfvmv+FWza9Y2WexVfvdpbS7tAlrZ82CUnRtj61si44jYVZdeMH0JoXANPNjxPmvcg
	erbLLInFmtuz97ig91dq21Mj/2OfQPPFGwW4nVg+LdYF3v7o7ekU2ca7wfj53EWa5bNA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/domain: make shutdown state explicit
Message-Id: <E1wqoWq-00Hb4w-1A@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:00:12 +0000

commit 388ce1472d0666243efdbf70984c84ec34dce141
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon Aug 3 09:41:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:41:20 2026 +0200

    xen/domain: make shutdown state explicit
    
    The shutdown flow currently uses is_shutting_down and is_shut_down to
    represent the domain shutdown lifecycle. The two flags are not mutually
    exclusive: after shutdown completion is_shutting_down remains set until
    domain_resume() clears both flags.
    
    Replace the two booleans with an enum domain_shutdown_state. Keep
    domain_shutting_down() as the direct replacement for the old
    is_shutting_down flag: it is true once shutdown has been initiated and
    remains true after completion, until domain_resume(). Add
    domain_shutdown_completed() for users that need the final completed
    state.
    
    This makes the state transition explicit while avoiding a semantic split
    between "in progress" and "completed" at call sites where the old code
    only cared that shutdown had started and had not yet been reset by
    domain_resume().
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Juergen Gross <jgross@suse.com>
---
 xen/arch/x86/hvm/viridian/time.c |  2 +-
 xen/arch/x86/mm.c                |  2 +-
 xen/arch/x86/mm/hap/hap.c        |  2 +-
 xen/arch/x86/mm/shadow/common.c  |  5 +++--
 xen/arch/x86/mm/shadow/multi.c   | 12 +++++++-----
 xen/common/domain.c              | 20 ++++++++++----------
 xen/common/domctl.c              |  2 +-
 xen/common/sched/core.c          |  2 +-
 xen/drivers/passthrough/iommu.c  |  8 ++++----
 xen/drivers/passthrough/pci.c    |  2 +-
 xen/include/xen/sched.h          | 23 +++++++++++++++++++----
 11 files changed, 49 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/time.c b/xen/arch/x86/hvm/viridian/time.c
index 15f629af0f..082528dc94 100644
--- a/xen/arch/x86/hvm/viridian/time.c
+++ b/xen/arch/x86/hvm/viridian/time.c
@@ -102,7 +102,7 @@ static void time_ref_count_thaw(const struct domain *d)
     struct viridian_domain *vd = d->arch.hvm.viridian;
     struct viridian_time_ref_count *trc = &vd->time_ref_count;
 
-    if ( d->is_shutting_down ||
+    if ( domain_shutting_down(d) ||
          test_and_set_bit(_TRC_running, &trc->flags) )
         return;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index bb4ba0afe2..511de4cc38 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1219,7 +1219,7 @@ void put_page_from_l1e(l1_pgentry_t l1e, struct domain *l1e_owner)
      */
 #if _PAGE_GNTTAB
     if ( (l1e_get_flags(l1e) & _PAGE_GNTTAB) &&
-         !l1e_owner->is_shutting_down && !l1e_owner->is_dying )
+         !domain_shutting_down(l1e_owner) && !l1e_owner->is_dying )
     {
         gprintk(XENLOG_WARNING,
                 "Attempt to implicitly unmap %pd's grant PTE %" PRIpte "\n",
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 5ccb80bda5..0ede4181a0 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -414,7 +414,7 @@ static mfn_t hap_make_monitor_table(struct vcpu *v)
 
  oom:
     if ( !d->is_dying &&
-         (!d->is_shutting_down || d->shutdown_code != SHUTDOWN_crash) )
+         (!domain_shutting_down(d) || d->shutdown_code != SHUTDOWN_crash) )
     {
         printk(XENLOG_G_ERR "%pd: out of memory building monitor pagetable\n",
                d);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index b167cc3ce2..e30c6c49e1 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -164,7 +164,7 @@ void shadow_promote(struct domain *d, mfn_t gmfn, unsigned int type)
     /* We should never try to promote a gmfn that has writeable mappings */
     ASSERT((page->u.inuse.type_info & PGT_type_mask) != PGT_writable_page
            || (page->u.inuse.type_info & PGT_count_mask) == 0
-           || d->is_shutting_down);
+           || domain_shutting_down(d));
 
     /* Is the page already shadowed? */
     if ( !test_and_set_bit(_PGC_shadowed_pt, &page->count_info) )
@@ -442,7 +442,8 @@ bool shadow_prealloc(struct domain *d, unsigned int type, unsigned int count)
         count += paging_logdirty_levels();
 
     ret = _shadow_prealloc(d, count);
-    if ( !ret && (!d->is_shutting_down || d->shutdown_code != SHUTDOWN_crash) )
+    if ( !ret &&
+         (!domain_shutting_down(d) || d->shutdown_code != SHUTDOWN_crash) )
         /*
          * Failing to allocate memory required for shadow usage can only result in
          * a domain crash, do it here rather that relying on every caller to do it.
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 1b0477ed2b..1ae1091acd 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2370,7 +2370,8 @@ static int cf_check sh_page_fault(
      * already used for some special purpose (ioreq pages, or granted pages).
      * If that happens we'll have killed the guest already but it's still not
      * safe to propagate entries out of the guest PT so get out now. */
-    if ( unlikely(d->is_shutting_down && d->shutdown_code == SHUTDOWN_crash) )
+    if ( unlikely(domain_shutting_down(d)) &&
+         d->shutdown_code == SHUTDOWN_crash )
     {
         SHADOW_PRINTK("guest is shutting down\n");
         goto propagate;
@@ -2480,7 +2481,7 @@ static int cf_check sh_page_fault(
 #if GUEST_PAGING_LEVELS == 3
         sh_update_cr3(v, false);
 #else
-        ASSERT(d->is_shutting_down);
+        ASSERT(domain_shutting_down(d));
         sh_trace_va(TRC_SHADOW_DOMF_DYING, va);
 #endif
         paging_unlock(d);
@@ -2494,7 +2495,8 @@ static int cf_check sh_page_fault(
          && ft == ft_demand_write )
         sh_unsync(v, gmfn);
 
-    if ( unlikely(d->is_shutting_down && d->shutdown_code == SHUTDOWN_crash) )
+    if ( unlikely(domain_shutting_down(d)) &&
+         d->shutdown_code == SHUTDOWN_crash )
     {
         /* We might end up with a crashed domain here if
          * sh_remove_shadows() in a previous sh_resync() call has
@@ -3265,7 +3267,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
                                        sh_make_shadow);
     if ( unlikely(pagetable_is_null(v->arch.paging.shadow.shadow_table[0])) )
     {
-        ASSERT(d->is_dying || d->is_shutting_down);
+        ASSERT(d->is_dying || domain_shutting_down(d));
         return old_entry;
     }
     if ( !paging_mode_external(d) && !is_pv_32bit_domain(d) )
@@ -3332,7 +3334,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     ASSERT(pagetable_is_null(old_entry));
     if ( unlikely(pagetable_is_null(v->arch.paging.shadow.shadow_table[0])) )
     {
-        ASSERT(d->is_dying || d->is_shutting_down);
+        ASSERT(d->is_dying || domain_shutting_down(d));
         return old_entry;
     }
 #else
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0df008f72d..e16f1ac383 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -191,7 +191,7 @@ static void set_domain_state_info(struct xen_domctl_get_domain_state *info,
                                   const struct domain *d)
 {
     info->state = XEN_DOMCTL_GETDOMSTATE_STATE_EXIST;
-    if ( d->is_shut_down )
+    if ( domain_shutdown_completed(d) )
         info->state |= XEN_DOMCTL_GETDOMSTATE_STATE_SHUTDOWN;
     if ( d->is_dying == DOMDYING_dying )
         info->state |= XEN_DOMCTL_GETDOMSTATE_STATE_DYING;
@@ -278,14 +278,14 @@ static void __domain_finalise_shutdown(struct domain *d)
 
     BUG_ON(!spin_is_locked(&d->shutdown_lock));
 
-    if ( d->is_shut_down )
+    if ( domain_shutdown_completed(d) )
         return;
 
     for_each_vcpu ( d, v )
         if ( !v->paused_for_shutdown )
             return;
 
-    d->is_shut_down = 1;
+    d->shutdown_state = DOMSHUTDOWN_complete;
     domain_changed_state(d);
     if ( (d->shutdown_code == SHUTDOWN_suspend) && d->suspend_evtchn )
         evtchn_send(d, d->suspend_evtchn);
@@ -299,7 +299,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
 
     spin_lock(&d->shutdown_lock);
 
-    if ( d->is_shutting_down )
+    if ( domain_shutting_down(d) )
     {
         if ( !v->paused_for_shutdown )
             vcpu_pause_nosync(v);
@@ -1358,7 +1358,7 @@ int domain_kill(struct domain *d)
 
 void __domain_crash(struct domain *d)
 {
-    if ( d->is_shutting_down )
+    if ( domain_shutting_down(d) )
     {
         /* Print nothing: the domain is already shutting down. */
     }
@@ -1396,13 +1396,13 @@ int domain_shutdown(struct domain *d, u8 reason)
     if ( is_hardware_domain(d) )
         hwdom_shutdown(reason);
 
-    if ( d->is_shutting_down )
+    if ( domain_shutting_down(d) )
     {
         spin_unlock(&d->shutdown_lock);
         return 0;
     }
 
-    d->is_shutting_down = 1;
+    d->shutdown_state = DOMSHUTDOWN_in_progress;
 
     smp_mb(); /* set shutdown status /then/ check for per-cpu deferrals */
 
@@ -1437,7 +1437,7 @@ void domain_resume(struct domain *d)
 
     spin_lock(&d->shutdown_lock);
 
-    d->is_shutting_down = d->is_shut_down = 0;
+    d->shutdown_state = DOMSHUTDOWN_none;
 
     arch_domain_resume(d);
 
@@ -1462,7 +1462,7 @@ int vcpu_start_shutdown_deferral(struct vcpu *v)
 
     v->defer_shutdown = 1;
     smp_mb(); /* set deferral status /then/ check for shutdown */
-    if ( unlikely(v->domain->is_shutting_down) )
+    if ( unlikely(domain_shutting_down(v->domain)) )
         vcpu_check_shutdown(v);
 
     return v->defer_shutdown;
@@ -1472,7 +1472,7 @@ void vcpu_end_shutdown_deferral(struct vcpu *v)
 {
     v->defer_shutdown = 0;
     smp_mb(); /* clear deferral status /then/ check for shutdown */
-    if ( unlikely(v->domain->is_shutting_down) )
+    if ( unlikely(domain_shutting_down(v->domain)) )
         vcpu_check_shutdown(v);
 }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 227313e62b..a6210db4fb 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -84,7 +84,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
 
     info->flags = (info->nr_online_vcpus ? flags : 0) |
         ((d->is_dying == DOMDYING_dead) ? XEN_DOMINF_dying     : 0) |
-        (d->is_shut_down                ? XEN_DOMINF_shutdown  : 0) |
+        (domain_shutdown_completed(d)   ? XEN_DOMINF_shutdown  : 0) |
         (d->controller_pause_count > 0  ? XEN_DOMINF_paused    : 0) |
         (d->debugger_attached           ? XEN_DOMINF_debugged  : 0) |
         (is_xenstore_domain(d)          ? XEN_DOMINF_xs_domain : 0) |
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 9ccf5811bf..8afcefd939 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1552,7 +1552,7 @@ static void cf_check domain_watchdog_timeout(void *data)
 
     BUILD_BUG_ON(alignof(*d) < PAGE_SIZE);
 
-    if ( d->is_shutting_down || d->is_dying )
+    if ( domain_shutting_down(d) || d->is_dying )
         return;
 
     printk("Watchdog timer %u fired for %pd\n", id, d);
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index c9425d6971..4b22ecfe65 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -355,7 +355,7 @@ long iommu_map(struct domain *d, dfn_t dfn0, mfn_t mfn0,
         if ( likely(!rc) )
             continue;
 
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU mapping dfn %"PRI_dfn" to mfn %"PRI_mfn" failed: %d\n",
                    d->domain_id, dfn_x(dfn), mfn_x(mfn), rc);
@@ -427,7 +427,7 @@ long iommu_unmap(struct domain *d, dfn_t dfn0, unsigned long page_count,
         if ( likely(!err) )
             continue;
 
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU unmapping dfn %"PRI_dfn" failed: %d\n",
                    d->domain_id, dfn_x(dfn), err);
@@ -492,7 +492,7 @@ int iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned long page_count,
                     flush_flags);
     if ( unlikely(rc) )
     {
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU IOTLB flush failed: %d, dfn %"PRI_dfn", page count %lu flags %x\n",
                    d->domain_id, rc, dfn_x(dfn), page_count, flush_flags);
@@ -517,7 +517,7 @@ int iommu_iotlb_flush_all(struct domain *d, unsigned int flush_flags)
                     flush_flags | IOMMU_FLUSHF_all);
     if ( unlikely(rc) )
     {
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU IOTLB flush all failed: %d\n",
                    d->domain_id, rc);
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 0adf573150..578472d068 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1746,7 +1746,7 @@ void iommu_dev_iotlb_flush_timeout(struct domain *d, struct pci_dev *pdev)
 
     pdev->broken = true;
 
-    if ( !d->is_shutting_down && printk_ratelimit() )
+    if ( !domain_shutting_down(d) && printk_ratelimit() )
         printk(XENLOG_ERR "dom%d: ATS device %pp flush failed\n",
                d->domain_id, &pdev->sbdf);
     if ( !is_hardware_domain(d) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 011292e9f7..eef10c2ea2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -224,7 +224,7 @@ struct vcpu
     bool             force_context_switch;
     /* Require shutdown to be deferred for some asynchronous operation? */
     bool             defer_shutdown;
-    /* VCPU is paused following shutdown request (d->is_shutting_down)? */
+    /* VCPU is paused following a domain shutdown request? */
     bool             paused_for_shutdown;
     /* VCPU need affinity restored */
     uint8_t          affinity_broken;
@@ -384,6 +384,12 @@ struct domain_console {
     char buf[256];
 };
 
+enum __packed domain_shutdown_state {
+    DOMSHUTDOWN_none, /* Must remain first, as domains are zero-initialized. */
+    DOMSHUTDOWN_in_progress,
+    DOMSHUTDOWN_complete,
+};
+
 struct domain
 {
     domid_t          domain_id;
@@ -555,10 +561,9 @@ struct domain
     struct rangeset *iomem_caps;
     struct rangeset *irq_caps;
 
-    /* Guest has shut down (inc. reason code)? */
+    /* Guest shutdown state and associated reason code. */
     spinlock_t       shutdown_lock;
-    bool             is_shutting_down; /* in process of shutting down? */
-    bool             is_shut_down;     /* fully shut down? */
+    enum domain_shutdown_state shutdown_state;
 #define SHUTDOWN_CODE_INVALID ~0u
     unsigned int     shutdown_code;
 
@@ -677,6 +682,16 @@ struct domain
     unsigned int pending_scrub_index;
 } __aligned(PAGE_SIZE);
 
+static inline bool domain_shutting_down(const struct domain *d)
+{
+    return d->shutdown_state != DOMSHUTDOWN_none;
+}
+
+static inline bool domain_shutdown_completed(const struct domain *d)
+{
+    return d->shutdown_state == DOMSHUTDOWN_complete;
+}
+
 static inline struct page_list_head *page_to_list(
     struct domain *d, const struct page_info *pg)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:00:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381290.1624835 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoWi-0006aF-9H; Mon, 03 Aug 2026 09:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381290.1624835; Mon, 03 Aug 2026 09:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoWi-0006Zq-65; Mon, 03 Aug 2026 09:00:04 +0000
Received: by outflank-mailman (input) for mailman id 1381290;
 Mon, 03 Aug 2026 09: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 1wqoWg-0006Ac-IB
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqoWg-0038My-1g
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoWg-00Hb0p-0g
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=Z71JvHH6BTEhPbgDfGyE2VsIVYGo1v9wQhnD0H+oDPU=; b=tKXeDS5emvJqPhfuRpRcTzCC7c
	+nvWP7cJDSiuI7i0ekhakECQnddQhSbd4p9zu3T3P0lLTrksHnFpl+7f8pN4X4ImkcCb5PugwXebl
	t9ti3vMddhpkLRgnlApJkwXqwjWvRyfy336nq8dLb46gAEV28xeIVhmPQBgzyfi2YuSQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mm: Introduce per-node free page counter
Message-Id: <E1wqoWg-00Hb0p-0g@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:00:02 +0000

commit 44adbac3c7a6a6993e5c435a968e6556fb18452e
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Mon Aug 3 09:40:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:40:05 2026 +0200

    xen/mm: Introduce per-node free page counter
    
    Add node_avail_pages[], updated under heap_lock in sync with
    avail[node][zone] to cache the per-node sum of free pages.
    
    Use it in avail_node_heap_pages() to avoid summing all zones on each
    call. Guard it with nodeid < MAX_NUMNODES and node_online(nodeid).
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Signed-off-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 40fdb5fb98..598222e2c2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -485,6 +485,7 @@ static unsigned long node_need_scrub[MAX_NUMNODES];
 
 static unsigned long *avail[MAX_NUMNODES];
 static unsigned long total_avail_pages;
+static unsigned long node_avail_pages[MAX_NUMNODES];
 
 static DEFINE_SPINLOCK(heap_lock);
 /* Total outstanding claims by all domains */
@@ -1050,6 +1051,8 @@ static struct page_info *alloc_heap_pages(
     avail[node][zone] -= request;
     ASSERT(total_avail_pages >= request);
     total_avail_pages -= request;
+    ASSERT(node_avail_pages[node] >= request);
+    node_avail_pages[node] -= request;
 
     if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
     {
@@ -1250,6 +1253,8 @@ static int reserve_offlined_page(struct page_info *head)
         avail[node][zone]--;
         ASSERT(total_avail_pages > 0);
         total_avail_pages--;
+        ASSERT(node_avail_pages[node] > 0);
+        node_avail_pages[node]--;
 
         /*
          * All offlined pages are standalone pages: If this offlined page was
@@ -1579,6 +1584,7 @@ static void free_heap_pages(
 
     avail[node][zone] += 1 << order;
     total_avail_pages += 1 << order;
+    node_avail_pages[node] += 1 << order;
     if ( need_scrub )
     {
         node_need_scrub[node] += 1 << order;
@@ -2844,7 +2850,10 @@ unsigned long avail_domheap_pages_region(
 
 unsigned long avail_node_heap_pages(unsigned int nodeid)
 {
-    return avail_heap_pages(MEMZONE_XEN, NR_ZONES -1, nodeid);
+    if ( nodeid < MAX_NUMNODES && node_online(nodeid) )
+        return node_avail_pages[nodeid];
+
+    return 0;
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:00:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381294.1624843 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoX2-0006zq-C5; Mon, 03 Aug 2026 09:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381294.1624843; Mon, 03 Aug 2026 09:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoX2-0006zi-90; Mon, 03 Aug 2026 09:00:24 +0000
Received: by outflank-mailman (input) for mailman id 1381294;
 Mon, 03 Aug 2026 09: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 1wqoX0-0006zW-Ib
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqoX0-0038NN-2P
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoX0-00Hb7J-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=3ay/G9o8utzmT3HNZAS929JIP3HJV2kU5PkHCUijMHM=; b=K8C6kAL32ryYfXaHg22HuLqcpZ
	57NhLgcdYD6PWJ43q7t8x/3TiBzkIEKh9Mp4YkXBfFZr/V53kiZbKQ8LBeOhDsFQplDwa+ztISCat
	x+93dW/VWr1xDEXPSchnL6DPda+XvezSMj2En9tcXbI9Em9LhJMvD/CWMB+DoMbHsaaU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pci: Use pci_sbdf_t in pci_prepare_msix()
Message-Id: <E1wqoX0-00Hb7J-1T@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:00:22 +0000

commit 00af54ff6ae3e1f4ab702b9529a22f8523d53ea5
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Mon Aug 3 09:42:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:42:16 2026 +0200

    x86/pci: Use pci_sbdf_t in pci_prepare_msix()
    
    Also take the opportunity to clean up a bit PHYSDEVOP_{prepare,release}_msix.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/msi.h |  2 +-
 xen/arch/x86/msi.c             |  4 ++--
 xen/arch/x86/physdev.c         | 16 +++++++++-------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index 00059d4a3a..6fb663b2e7 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -83,7 +83,7 @@ struct msi_desc;
 extern int pci_enable_msi(struct pci_dev *pdev, struct msi_info *msi,
                           struct msi_desc **desc);
 extern void pci_disable_msi(struct msi_desc *msi_desc);
-extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off);
+extern int pci_prepare_msix(pci_sbdf_t sbdf, bool off);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
 extern void pci_disable_msi_all(void);
 extern int setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc);
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3fe22b3b6d..8831ce068c 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1153,7 +1153,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
     _pci_cleanup_msix(dev->msix);
 }
 
-int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off)
+int pci_prepare_msix(pci_sbdf_t sbdf, bool off)
 {
     int rc;
     struct pci_dev *pdev;
@@ -1162,7 +1162,7 @@ int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off)
         return 0;
 
     pcidevs_lock();
-    pdev = pci_get_pdev(NULL, PCI_SBDF(seg, bus, devfn));
+    pdev = pci_get_pdev(NULL, sbdf);
     if ( !pdev )
         rc = -ENODEV;
     else if ( pdev->msix->used_entries != !!off )
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 5bbcf3b530..86d7b82127 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -512,15 +512,17 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_prepare_msix:
     case PHYSDEVOP_release_msix: {
         struct physdev_pci_device dev;
+        pci_sbdf_t sbdf;
 
+        ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) )
-            ret = -EFAULT;
-        else
-            ret = xsm_resource_setup_pci(XSM_PRIV,
-                                         (dev.seg << 16) | (dev.bus << 8) |
-                                         dev.devfn) ?:
-                  pci_prepare_msix(dev.seg, dev.bus, dev.devfn,
-                                   cmd != PHYSDEVOP_prepare_msix);
+            break;
+        
+        sbdf = PCI_SBDF(dev.seg, dev.bus, dev.devfn);
+
+        ret = xsm_resource_setup_pci(XSM_PRIV, sbdf.sbdf);
+        if ( !ret )
+            ret = pci_prepare_msix(sbdf, cmd != PHYSDEVOP_prepare_msix);
         break;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:00:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381295.1624848 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXC-00071o-Ei; Mon, 03 Aug 2026 09:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381295.1624848; Mon, 03 Aug 2026 09:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXC-00071g-AL; Mon, 03 Aug 2026 09:00:34 +0000
Received: by outflank-mailman (input) for mailman id 1381295;
 Mon, 03 Aug 2026 09: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 1wqoXA-00071Y-KZ
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqoXA-0038NR-2k
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoXA-000090-1n
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=Fdlt+vFVejvKLqO9SajvKa7Zu3d4YvaHQdChgTHSlc0=; b=uU1cnDLYxN3pu+f6Zuq2/pQSwF
	oFZaVTS0tXXE8MVmcX2t/gvv0XFV+0QDnS8O7ldVVzEFQZBZfVvsrOyu6obTzxRN4q/sEY/mTfMGk
	semldoAlz3cHwpO5fG4P3OP8DT2fDEklSws/vNG7BjUN0QbjD11Yqema9cDgC+Vx7Q+M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: update p2m_set_allocation() prototype
Message-Id: <E1wqoXA-000090-1n@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:00:32 +0000

commit 04073cd5f679e281f996d4e10e3c6f1cc365f99a
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Aug 3 09:49:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:49:00 2026 +0200

    xen/arm: update p2m_set_allocation() prototype
    
    p2m_set_allocation() uses a bool *preempted out-argument that overloads two
    meanings. When non-NULL, the value written back (true) duplicates information
    already carried by the -ERESTART return code — pure redundancy, which the
    caller-side ASSERT(preempted == (rc == -ERESTART)) only documents. Separately,
    a NULL pointer is an implicit calling convention meaning "preemption is not
    permitted in this context".
    
    Replace the pointer with a plain bool can_preempt that explicitly controls
    whether the preemption check runs, making the NULL-to-suppress convention
    type-safe and self-documenting, and rely on the -ERESTART return code alone to
    report that preemption occurred.
    
    Since p2m_set_allocation() is called by the common dom0less build code,
    move its declaration from the ARM-specific asm/p2m.h to xen/p2m-common.h.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/p2m.h          |  1 -
 xen/arch/arm/mmu/p2m.c                  | 24 ++++++------------------
 xen/arch/riscv/include/asm/paging.h     |  2 +-
 xen/arch/riscv/p2m.c                    |  9 ++-------
 xen/arch/riscv/paging.c                 |  7 ++-----
 xen/common/device-tree/dom0less-build.c |  2 +-
 xen/include/xen/p2m-common.h            |  8 ++++++++
 7 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 4a4913716b..737da60dcf 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -238,7 +238,6 @@ void p2m_restore_state(struct vcpu *n);
 /* Print debugging/statistial info about a domain's p2m */
 void p2m_dump_info(struct domain *d);
 
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted);
 int p2m_teardown_allocation(struct domain *d);
 
 static inline void p2m_write_lock(struct p2m_domain *p2m)
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 51abf3504f..2cf35d8a37 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -65,12 +65,7 @@ int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct page_info *pg;
 
@@ -112,11 +107,8 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
             break;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
@@ -125,7 +117,6 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
 {
     unsigned long pages = size >> PAGE_SHIFT;
-    bool preempted = false;
     int rc;
 
     if ( (size & ~PAGE_MASK) ||          /* Non page-sized request? */
@@ -133,27 +124,24 @@ int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
         return -EINVAL;
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, pages, &preempted);
+    rc = p2m_set_allocation(d, pages, /* can_preempt */ true);
     spin_unlock(&d->arch.paging.lock);
 
-    ASSERT(preempted == (rc == -ERESTART));
-
     return rc;
 }
 
 int p2m_teardown_allocation(struct domain *d)
 {
     int ret = 0;
-    bool preempted = false;
 
     spin_lock(&d->arch.paging.lock);
     if ( d->arch.paging.p2m_total_pages != 0 )
     {
-        ret = p2m_set_allocation(d, 0, &preempted);
-        if ( preempted )
+        ret = p2m_set_allocation(d, 0, /* can_preempt */ true);
+        if ( ret == -ERESTART )
         {
             spin_unlock(&d->arch.paging.lock);
-            return -ERESTART;
+            return ret;
         }
         ASSERT(d->arch.paging.p2m_total_pages == 0);
     }
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index e487c89a4c..103384723d 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -9,7 +9,7 @@ struct page_info;
 int paging_domain_init(struct domain *d);
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted);
+                           bool can_preempt);
 
 int paging_ret_to_domheap(struct domain *d, unsigned int nr_pages);
 int paging_refill_from_domheap(struct domain *d, unsigned int nr_pages);
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 703b9f4d25..566266e3e7 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -428,17 +428,12 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int rc;
 
-    if ( (rc = paging_freelist_adjust(d, pages, preempted)) )
+    if ( (rc = paging_freelist_adjust(d, pages, can_preempt)) )
         return rc;
 
     /*
diff --git a/xen/arch/riscv/paging.c b/xen/arch/riscv/paging.c
index 76a203edbb..35f572689a 100644
--- a/xen/arch/riscv/paging.c
+++ b/xen/arch/riscv/paging.c
@@ -47,7 +47,7 @@ static int _paging_add_to_freelist(struct domain *d)
 }
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted)
+                           bool can_preempt)
 {
     ASSERT(spin_is_locked(&d->arch.paging.lock));
 
@@ -66,11 +66,8 @@ int paging_freelist_adjust(struct domain *d, unsigned long pages,
             return rc;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 9513c1c837..fcbeb8adbd 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -760,7 +760,7 @@ static int __init domain_p2m_set_allocation(struct domain *d, uint64_t mem,
                 domain_p2m_pages(mem, d->max_vcpus);
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, p2m_pages, NULL);
+    rc = p2m_set_allocation(d, p2m_pages, /* can_preempt */ false);
     spin_unlock(&d->arch.paging.lock);
 
     return rc;
diff --git a/xen/include/xen/p2m-common.h b/xen/include/xen/p2m-common.h
index f0bd9a6b98..0eb0619912 100644
--- a/xen/include/xen/p2m-common.h
+++ b/xen/include/xen/p2m-common.h
@@ -43,5 +43,13 @@ int __must_check check_get_page_from_gfn(struct domain *d, gfn_t gfn,
                                          bool readonly, p2m_type_t *p2mt_p,
                                          struct page_info **page_p);
 
+/*
+ * Set the pool of pages to the required number of pages.
+ * Returns 0 for success, -ERESTART if preempted (only when can_preempt is
+ * true), or a negative error code on failure.
+ * Call with d->arch.paging.lock held.
+ */
+int __must_check p2m_set_allocation(struct domain *d, unsigned long pages,
+                                    bool can_preempt);
 
 #endif /* _XEN_P2M_COMMON_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:00:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381296.1624850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXM-0007Ct-HG; Mon, 03 Aug 2026 09:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381296.1624850; Mon, 03 Aug 2026 09:00:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXM-0007Cj-Eb; Mon, 03 Aug 2026 09:00:44 +0000
Received: by outflank-mailman (input) for mailman id 1381296;
 Mon, 03 Aug 2026 09: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 1wqoXK-0007Cd-P0
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqoXL-0038NX-00
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoXK-0000G4-26
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=+iCUryingsSwmyQtafwhVMHxvwGR+0IEiND8o54jqIc=; b=zlBpd4QzTXG76OXGADIxtq531G
	TVDH1WqP+JB/1Nefcd3zCHSgPfpu1a7E2wEHSTFmbViH81StJeSmBmQq6xjkytkSrM9SvMITo3rzU
	wyAlBhskKwlJZMVHwVZjp6Fqe6FtUAWxd8CfM8VyknpD62YRL08GyYGZ9Ya5jMUjFuOA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: Implement ARCH_PAGING_MEMPOOL
Message-Id: <E1wqoXK-0000G4-26@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:00:42 +0000

commit a8606445b129bfd515b74acd5ce7f078e3353b51
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Aug 3 09:49:43 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:49:43 2026 +0200

    xen/riscv: Implement ARCH_PAGING_MEMPOOL
    
    The p2m_freelist is used to allocate pages for the P2M. To initialize
    this list, domain_p2m_set_allocation() may be called from construct_domU()
    in the common Dom0less code, so RISC-V provides an implementation and
    enables CONFIG_ARCH_PAGING_MEMPOOL unconditionally.
    
    Additionally, implement arch_{set,get}_paging_mempool_size(). They are
    not directly used yet, but are required to support the
    XEN_DOMCTL_{get,set}_paging_mempool_size hypercalls.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Kconfig |  1 +
 xen/arch/riscv/p2m.c   | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 41426c2052..48520588fe 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,5 +1,6 @@
 config RISCV
 	def_bool y
+	select ARCH_PAGING_MEMPOOL
 	select DOMAIN_BUILD_HELPERS
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 566266e3e7..1cea86512c 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1600,3 +1600,27 @@ struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
 
     return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
 }
+
+int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
+{
+    unsigned long pages = PFN_DOWN(size);
+    int rc;
+
+    /* Non page-sized request or 32-bit overflow? */
+    if ( pfn_to_paddr(pages) != size )
+        return -EINVAL;
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, pages, true);
+    spin_unlock(&d->arch.paging.lock);
+
+    return rc;
+}
+
+/* Return the size of the pool, in bytes. */
+int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
+{
+    *size = pfn_to_paddr(ACCESS_ONCE(d->arch.paging.total_pages));
+
+    return 0;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:00:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:00:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381297.1624855 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXW-0007Ez-IP; Mon, 03 Aug 2026 09:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381297.1624855; Mon, 03 Aug 2026 09:00:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXW-0007Er-Fu; Mon, 03 Aug 2026 09:00:54 +0000
Received: by outflank-mailman (input) for mailman id 1381297;
 Mon, 03 Aug 2026 09: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 1wqoXU-0007El-S0
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqoXV-0038Nd-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoXU-0000RS-2Z
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=Gzb2C9Qgz4Uv6Gu3HwhnFVCCtxFAGVZlIdIIuzmlJMA=; b=2lscAJMM+AKprmWq8j4FbfyaJN
	trNHV1l9dZ46AqukZKkP7wmW8YY+QJ/pBlQRp5itVsN0FOxJqD9fyTxT9UiiYqWhkaLZyOFPDo7eO
	YZquHBKpRKW1He4/mrkBSET+YuIOyPnzwHDkUwXzcC/383bXJROlInrfkw2GmKr1xOgQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wqoXU-0000RS-2Z@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:00:52 +0000

commit 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 3 09:50:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:50:07 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index and the offset into the page
    addressed by the array element.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:01:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381298.1624859 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXg-0007Gw-Jq; Mon, 03 Aug 2026 09:01:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381298.1624859; Mon, 03 Aug 2026 09:01:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXg-0007Go-HE; Mon, 03 Aug 2026 09:01:04 +0000
Received: by outflank-mailman (input) for mailman id 1381298;
 Mon, 03 Aug 2026 09:01: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 1wqoXe-0007Gi-Vy
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqoXf-0038OD-0i
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:01:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoXe-0000Uo-2w
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=cDM+M+pmSAxuBHCOvmJAbefwjg5dqijYCaSdtbscB/o=; b=aEZFAxAdYLDqvihG/3CD2GCEXH
	8r9Am+KIdA4IEyQggSOFgfMn/wJUaMFPST8AVudY1qQbL+DDdecAcDyGG7l/sAZIyQyS9BO1FjG+G
	n6IAIrcjQB2uu/mJGy/dE8nCjhkFh4nvCPl97WzolJR1J7Eg/LOXVN0LN0fL9CToQsiM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: split vex_np from vex_none
Message-Id: <E1wqoXe-0000Uo-2w@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:01:02 +0000

commit 9462d81b6ec47fd3563934cc222d4f6e50b06a02
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 09:50:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:50:59 2026 +0200

    x86emul: split vex_np from vex_none
    
    ..., undoing the aliasing between two distinct enums, and more in line
    with how the SDM nowadays names things.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/0f01.c        | 8 ++++----
 xen/arch/x86/x86_emulate/decode.c      | 2 +-
 xen/arch/x86/x86_emulate/private.h     | 8 ++++----
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 36a8881410..d2a106557d 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -34,7 +34,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xc6:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* wrmsrns */
+        case vex_np: /* wrmsrns */
             vcpu_must_have(wrmsrns);
             generate_exception_if(!mode_ring0(), X86_EXC_GP, 0);
             fail_if(!ops->write_msr);
@@ -120,7 +120,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xe8:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* serialize */
+        case vex_np: /* serialize */
             vcpu_must_have(serialize);
             asm volatile ( ".byte 0x0f, 0x01, 0xe8" ); /* Binutils >= 2.34, Clang >= 11 */
             break;
@@ -154,7 +154,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xee:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* rdpkru */
+        case vex_np: /* rdpkru */
             if ( !ops->read_cr ||
                  ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
                 cr4 = 0;
@@ -171,7 +171,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xef:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* wrpkru */
+        case vex_np: /* wrpkru */
             if ( !ops->read_cr ||
                  ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
                 cr4 = 0;
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 48e8c79964..947f49d870 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -1862,7 +1862,7 @@ int x86emul_decode(struct x86_emulate_state *s,
     case simd_packed_int:
         switch ( s->vex.pfx )
         {
-        case vex_none:
+        case vex_np:
             if ( !s->vex.opcx )
             {
                 s->op_bytes = 8;
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index 2d69c24b86..7892b5603b 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -195,10 +195,9 @@ enum simd_opsize {
 };
 typedef uint8_t simd_opsize_t;
 
-#define vex_none 0
-
 enum vex_opcx {
-    vex_0f = vex_none + 1,
+    vex_none,
+    vex_0f,
     vex_0f38,
     vex_0f3a,
     evex_map5 = 5,
@@ -206,7 +205,8 @@ enum vex_opcx {
 };
 
 enum vex_pfx {
-    vex_66 = vex_none + 1,
+    vex_np,
+    vex_66,
     vex_f3,
     vex_f2
 };
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 587e836d56..e15ab37758 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6031,7 +6031,7 @@ x86_emulate(
         pvex = copy_VEX(opc, vex);
         pvex->opcx = vex_0f;
         if ( elem_bytes == 4 )
-            pvex->pfx = vex_none;
+            pvex->pfx = vex_np;
         opc[0] = 0x50; /* vmovmskp{s,d} */
         /* Use %rax as GPR destination and VEX.vvvv as source. */
         pvex->r = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:01:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:01:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381299.1624863 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqoXq-0007Jy-L5; Mon, 03 Aug 2026 09:01:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381299.1624863; Mon, 03 Aug 2026 09:01: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 1wqoXq-0007Jp-Ia; Mon, 03 Aug 2026 09:01:14 +0000
Received: by outflank-mailman (input) for mailman id 1381299;
 Mon, 03 Aug 2026 09:01: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 1wqoXp-0007Jj-2O
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09:01: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 1wqoXp-0038ON-0z
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:01:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqoXp-0000dO-03
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:01: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=uKDC4VlEyAReK17dq5sOUTMicK30zkeiDKGw1/C6e6o=; b=tS+rP4Xk9nnEnN057YlAFPRKla
	SrFmARbPojjeqSq+uBad3i2wMrL1h5/Cq0iROieVz9iP+TlRdiNe9Qs0x/h8NE43UXHsAqKHXPeK9
	Jh9tMIwG8/yUmjIa6dVo9cZMV4PVx3rKF89gcCfSpVAjnbC8HhIwJZ6dexAZPZrZsAMc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: annotate saved_cmdline with __ro_after_init
Message-Id: <E1wqoXp-0000dO-03@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:01:13 +0000

commit 43c77e051cf86b34834330f6e0a0d65d18a7d4f3
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Mon Aug 3 09:51:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:51:20 2026 +0200

    xen/common: annotate saved_cmdline with __ro_after_init
    
    The hypervisor command line is not modified after initialization.
    Annotate saved_cmdline with __ro_after_init to place it in the
    dedicated read-only-after-init section.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index fb45f81399..d1bef9ac2b 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -34,7 +34,7 @@ bool __ro_after_init opt_dit = IS_ENABLED(CONFIG_DIT_DEFAULT);
 boolean_param("dit", opt_dit);
 #endif
 
-static xen_commandline_t saved_cmdline;
+static xen_commandline_t __ro_after_init saved_cmdline;
 static const char __initconst opt_builtin_cmdline[] = CONFIG_CMDLINE;
 char __ro_after_init xen_cap_info[128];
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381326.1624885 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpNv-0001Mk-NX; Mon, 03 Aug 2026 09:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381326.1624885; Mon, 03 Aug 2026 09:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpNv-0001Ma-Kw; Mon, 03 Aug 2026 09:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1381326;
 Mon, 03 Aug 2026 09:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqpNu-0001MU-Mm
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpNu-0039LZ-28
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpNu-000Pmn-18
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=47NOjgorOA9kLECzX7vs29iP7H8L1fhLRxy1eXgiq00=; b=NiwqmQbh0XhrT3yTd8Mv7SbE4r
	+/Qzjx92/C+zZ66NrHTL6/G8mj8oVOdm11eWcS3t830xrLi4N4DjxMKiMo9vEE0NStxg+Pepl6CwZ
	g88uMvQMV8VtbgcYppW6ILBNJZ5Ci73ENDXMSjFcXyUyc0cwkUg7Nwh4AblPQ87c8WnI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: Introduce per-node free page counter
Message-Id: <E1wqpNu-000Pmn-18@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:55:02 +0000

commit 44adbac3c7a6a6993e5c435a968e6556fb18452e
Author:     Alejandro Vallejo <alejandro.vallejo@cloud.com>
AuthorDate: Mon Aug 3 09:40:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:40:05 2026 +0200

    xen/mm: Introduce per-node free page counter
    
    Add node_avail_pages[], updated under heap_lock in sync with
    avail[node][zone] to cache the per-node sum of free pages.
    
    Use it in avail_node_heap_pages() to avoid summing all zones on each
    call. Guard it with nodeid < MAX_NUMNODES and node_online(nodeid).
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Signed-off-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 40fdb5fb98..598222e2c2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -485,6 +485,7 @@ static unsigned long node_need_scrub[MAX_NUMNODES];
 
 static unsigned long *avail[MAX_NUMNODES];
 static unsigned long total_avail_pages;
+static unsigned long node_avail_pages[MAX_NUMNODES];
 
 static DEFINE_SPINLOCK(heap_lock);
 /* Total outstanding claims by all domains */
@@ -1050,6 +1051,8 @@ static struct page_info *alloc_heap_pages(
     avail[node][zone] -= request;
     ASSERT(total_avail_pages >= request);
     total_avail_pages -= request;
+    ASSERT(node_avail_pages[node] >= request);
+    node_avail_pages[node] -= request;
 
     if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
     {
@@ -1250,6 +1253,8 @@ static int reserve_offlined_page(struct page_info *head)
         avail[node][zone]--;
         ASSERT(total_avail_pages > 0);
         total_avail_pages--;
+        ASSERT(node_avail_pages[node] > 0);
+        node_avail_pages[node]--;
 
         /*
          * All offlined pages are standalone pages: If this offlined page was
@@ -1579,6 +1584,7 @@ static void free_heap_pages(
 
     avail[node][zone] += 1 << order;
     total_avail_pages += 1 << order;
+    node_avail_pages[node] += 1 << order;
     if ( need_scrub )
     {
         node_need_scrub[node] += 1 << order;
@@ -2844,7 +2850,10 @@ unsigned long avail_domheap_pages_region(
 
 unsigned long avail_node_heap_pages(unsigned int nodeid)
 {
-    return avail_heap_pages(MEMZONE_XEN, NR_ZONES -1, nodeid);
+    if ( nodeid < MAX_NUMNODES && node_online(nodeid) )
+        return node_avail_pages[nodeid];
+
+    return 0;
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381327.1624889 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpO5-0001OT-Oo; Mon, 03 Aug 2026 09:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381327.1624889; Mon, 03 Aug 2026 09:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpO5-0001OM-MF; Mon, 03 Aug 2026 09:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1381327;
 Mon, 03 Aug 2026 09:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqpO4-0001OE-Iy
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpO4-0039Lf-2a
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpO4-000PyK-1c
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YrYNAMI735uPASE1UPDa/Dqq0q/FZdbFsSiy4BO+jUk=; b=IdUG0FDIzoezX2weAKS8+cYehx
	RYOjZzlpFd5clGcbeRQOmXC36rSBMlY6igdiFSdFNMd3CgB0wQLKUZq+P2K5BGSdP1oc84RxvwYYT
	fItrgYXhKuwLB5K3XLlRJeYiumpSDJLGxxSfebgF0r6mf4AdOCWWYydvUriRBsXYtH18=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domain: make shutdown state explicit
Message-Id: <E1wqpO4-000PyK-1c@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:55:12 +0000

commit 388ce1472d0666243efdbf70984c84ec34dce141
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon Aug 3 09:41:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:41:20 2026 +0200

    xen/domain: make shutdown state explicit
    
    The shutdown flow currently uses is_shutting_down and is_shut_down to
    represent the domain shutdown lifecycle. The two flags are not mutually
    exclusive: after shutdown completion is_shutting_down remains set until
    domain_resume() clears both flags.
    
    Replace the two booleans with an enum domain_shutdown_state. Keep
    domain_shutting_down() as the direct replacement for the old
    is_shutting_down flag: it is true once shutdown has been initiated and
    remains true after completion, until domain_resume(). Add
    domain_shutdown_completed() for users that need the final completed
    state.
    
    This makes the state transition explicit while avoiding a semantic split
    between "in progress" and "completed" at call sites where the old code
    only cared that shutdown had started and had not yet been reset by
    domain_resume().
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Juergen Gross <jgross@suse.com>
---
 xen/arch/x86/hvm/viridian/time.c |  2 +-
 xen/arch/x86/mm.c                |  2 +-
 xen/arch/x86/mm/hap/hap.c        |  2 +-
 xen/arch/x86/mm/shadow/common.c  |  5 +++--
 xen/arch/x86/mm/shadow/multi.c   | 12 +++++++-----
 xen/common/domain.c              | 20 ++++++++++----------
 xen/common/domctl.c              |  2 +-
 xen/common/sched/core.c          |  2 +-
 xen/drivers/passthrough/iommu.c  |  8 ++++----
 xen/drivers/passthrough/pci.c    |  2 +-
 xen/include/xen/sched.h          | 23 +++++++++++++++++++----
 11 files changed, 49 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/time.c b/xen/arch/x86/hvm/viridian/time.c
index 15f629af0f..082528dc94 100644
--- a/xen/arch/x86/hvm/viridian/time.c
+++ b/xen/arch/x86/hvm/viridian/time.c
@@ -102,7 +102,7 @@ static void time_ref_count_thaw(const struct domain *d)
     struct viridian_domain *vd = d->arch.hvm.viridian;
     struct viridian_time_ref_count *trc = &vd->time_ref_count;
 
-    if ( d->is_shutting_down ||
+    if ( domain_shutting_down(d) ||
          test_and_set_bit(_TRC_running, &trc->flags) )
         return;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index bb4ba0afe2..511de4cc38 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1219,7 +1219,7 @@ void put_page_from_l1e(l1_pgentry_t l1e, struct domain *l1e_owner)
      */
 #if _PAGE_GNTTAB
     if ( (l1e_get_flags(l1e) & _PAGE_GNTTAB) &&
-         !l1e_owner->is_shutting_down && !l1e_owner->is_dying )
+         !domain_shutting_down(l1e_owner) && !l1e_owner->is_dying )
     {
         gprintk(XENLOG_WARNING,
                 "Attempt to implicitly unmap %pd's grant PTE %" PRIpte "\n",
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 5ccb80bda5..0ede4181a0 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -414,7 +414,7 @@ static mfn_t hap_make_monitor_table(struct vcpu *v)
 
  oom:
     if ( !d->is_dying &&
-         (!d->is_shutting_down || d->shutdown_code != SHUTDOWN_crash) )
+         (!domain_shutting_down(d) || d->shutdown_code != SHUTDOWN_crash) )
     {
         printk(XENLOG_G_ERR "%pd: out of memory building monitor pagetable\n",
                d);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index b167cc3ce2..e30c6c49e1 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -164,7 +164,7 @@ void shadow_promote(struct domain *d, mfn_t gmfn, unsigned int type)
     /* We should never try to promote a gmfn that has writeable mappings */
     ASSERT((page->u.inuse.type_info & PGT_type_mask) != PGT_writable_page
            || (page->u.inuse.type_info & PGT_count_mask) == 0
-           || d->is_shutting_down);
+           || domain_shutting_down(d));
 
     /* Is the page already shadowed? */
     if ( !test_and_set_bit(_PGC_shadowed_pt, &page->count_info) )
@@ -442,7 +442,8 @@ bool shadow_prealloc(struct domain *d, unsigned int type, unsigned int count)
         count += paging_logdirty_levels();
 
     ret = _shadow_prealloc(d, count);
-    if ( !ret && (!d->is_shutting_down || d->shutdown_code != SHUTDOWN_crash) )
+    if ( !ret &&
+         (!domain_shutting_down(d) || d->shutdown_code != SHUTDOWN_crash) )
         /*
          * Failing to allocate memory required for shadow usage can only result in
          * a domain crash, do it here rather that relying on every caller to do it.
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 1b0477ed2b..1ae1091acd 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2370,7 +2370,8 @@ static int cf_check sh_page_fault(
      * already used for some special purpose (ioreq pages, or granted pages).
      * If that happens we'll have killed the guest already but it's still not
      * safe to propagate entries out of the guest PT so get out now. */
-    if ( unlikely(d->is_shutting_down && d->shutdown_code == SHUTDOWN_crash) )
+    if ( unlikely(domain_shutting_down(d)) &&
+         d->shutdown_code == SHUTDOWN_crash )
     {
         SHADOW_PRINTK("guest is shutting down\n");
         goto propagate;
@@ -2480,7 +2481,7 @@ static int cf_check sh_page_fault(
 #if GUEST_PAGING_LEVELS == 3
         sh_update_cr3(v, false);
 #else
-        ASSERT(d->is_shutting_down);
+        ASSERT(domain_shutting_down(d));
         sh_trace_va(TRC_SHADOW_DOMF_DYING, va);
 #endif
         paging_unlock(d);
@@ -2494,7 +2495,8 @@ static int cf_check sh_page_fault(
          && ft == ft_demand_write )
         sh_unsync(v, gmfn);
 
-    if ( unlikely(d->is_shutting_down && d->shutdown_code == SHUTDOWN_crash) )
+    if ( unlikely(domain_shutting_down(d)) &&
+         d->shutdown_code == SHUTDOWN_crash )
     {
         /* We might end up with a crashed domain here if
          * sh_remove_shadows() in a previous sh_resync() call has
@@ -3265,7 +3267,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
                                        sh_make_shadow);
     if ( unlikely(pagetable_is_null(v->arch.paging.shadow.shadow_table[0])) )
     {
-        ASSERT(d->is_dying || d->is_shutting_down);
+        ASSERT(d->is_dying || domain_shutting_down(d));
         return old_entry;
     }
     if ( !paging_mode_external(d) && !is_pv_32bit_domain(d) )
@@ -3332,7 +3334,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     ASSERT(pagetable_is_null(old_entry));
     if ( unlikely(pagetable_is_null(v->arch.paging.shadow.shadow_table[0])) )
     {
-        ASSERT(d->is_dying || d->is_shutting_down);
+        ASSERT(d->is_dying || domain_shutting_down(d));
         return old_entry;
     }
 #else
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0df008f72d..e16f1ac383 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -191,7 +191,7 @@ static void set_domain_state_info(struct xen_domctl_get_domain_state *info,
                                   const struct domain *d)
 {
     info->state = XEN_DOMCTL_GETDOMSTATE_STATE_EXIST;
-    if ( d->is_shut_down )
+    if ( domain_shutdown_completed(d) )
         info->state |= XEN_DOMCTL_GETDOMSTATE_STATE_SHUTDOWN;
     if ( d->is_dying == DOMDYING_dying )
         info->state |= XEN_DOMCTL_GETDOMSTATE_STATE_DYING;
@@ -278,14 +278,14 @@ static void __domain_finalise_shutdown(struct domain *d)
 
     BUG_ON(!spin_is_locked(&d->shutdown_lock));
 
-    if ( d->is_shut_down )
+    if ( domain_shutdown_completed(d) )
         return;
 
     for_each_vcpu ( d, v )
         if ( !v->paused_for_shutdown )
             return;
 
-    d->is_shut_down = 1;
+    d->shutdown_state = DOMSHUTDOWN_complete;
     domain_changed_state(d);
     if ( (d->shutdown_code == SHUTDOWN_suspend) && d->suspend_evtchn )
         evtchn_send(d, d->suspend_evtchn);
@@ -299,7 +299,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
 
     spin_lock(&d->shutdown_lock);
 
-    if ( d->is_shutting_down )
+    if ( domain_shutting_down(d) )
     {
         if ( !v->paused_for_shutdown )
             vcpu_pause_nosync(v);
@@ -1358,7 +1358,7 @@ int domain_kill(struct domain *d)
 
 void __domain_crash(struct domain *d)
 {
-    if ( d->is_shutting_down )
+    if ( domain_shutting_down(d) )
     {
         /* Print nothing: the domain is already shutting down. */
     }
@@ -1396,13 +1396,13 @@ int domain_shutdown(struct domain *d, u8 reason)
     if ( is_hardware_domain(d) )
         hwdom_shutdown(reason);
 
-    if ( d->is_shutting_down )
+    if ( domain_shutting_down(d) )
     {
         spin_unlock(&d->shutdown_lock);
         return 0;
     }
 
-    d->is_shutting_down = 1;
+    d->shutdown_state = DOMSHUTDOWN_in_progress;
 
     smp_mb(); /* set shutdown status /then/ check for per-cpu deferrals */
 
@@ -1437,7 +1437,7 @@ void domain_resume(struct domain *d)
 
     spin_lock(&d->shutdown_lock);
 
-    d->is_shutting_down = d->is_shut_down = 0;
+    d->shutdown_state = DOMSHUTDOWN_none;
 
     arch_domain_resume(d);
 
@@ -1462,7 +1462,7 @@ int vcpu_start_shutdown_deferral(struct vcpu *v)
 
     v->defer_shutdown = 1;
     smp_mb(); /* set deferral status /then/ check for shutdown */
-    if ( unlikely(v->domain->is_shutting_down) )
+    if ( unlikely(domain_shutting_down(v->domain)) )
         vcpu_check_shutdown(v);
 
     return v->defer_shutdown;
@@ -1472,7 +1472,7 @@ void vcpu_end_shutdown_deferral(struct vcpu *v)
 {
     v->defer_shutdown = 0;
     smp_mb(); /* clear deferral status /then/ check for shutdown */
-    if ( unlikely(v->domain->is_shutting_down) )
+    if ( unlikely(domain_shutting_down(v->domain)) )
         vcpu_check_shutdown(v);
 }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 227313e62b..a6210db4fb 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -84,7 +84,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
 
     info->flags = (info->nr_online_vcpus ? flags : 0) |
         ((d->is_dying == DOMDYING_dead) ? XEN_DOMINF_dying     : 0) |
-        (d->is_shut_down                ? XEN_DOMINF_shutdown  : 0) |
+        (domain_shutdown_completed(d)   ? XEN_DOMINF_shutdown  : 0) |
         (d->controller_pause_count > 0  ? XEN_DOMINF_paused    : 0) |
         (d->debugger_attached           ? XEN_DOMINF_debugged  : 0) |
         (is_xenstore_domain(d)          ? XEN_DOMINF_xs_domain : 0) |
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 9ccf5811bf..8afcefd939 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1552,7 +1552,7 @@ static void cf_check domain_watchdog_timeout(void *data)
 
     BUILD_BUG_ON(alignof(*d) < PAGE_SIZE);
 
-    if ( d->is_shutting_down || d->is_dying )
+    if ( domain_shutting_down(d) || d->is_dying )
         return;
 
     printk("Watchdog timer %u fired for %pd\n", id, d);
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index c9425d6971..4b22ecfe65 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -355,7 +355,7 @@ long iommu_map(struct domain *d, dfn_t dfn0, mfn_t mfn0,
         if ( likely(!rc) )
             continue;
 
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU mapping dfn %"PRI_dfn" to mfn %"PRI_mfn" failed: %d\n",
                    d->domain_id, dfn_x(dfn), mfn_x(mfn), rc);
@@ -427,7 +427,7 @@ long iommu_unmap(struct domain *d, dfn_t dfn0, unsigned long page_count,
         if ( likely(!err) )
             continue;
 
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU unmapping dfn %"PRI_dfn" failed: %d\n",
                    d->domain_id, dfn_x(dfn), err);
@@ -492,7 +492,7 @@ int iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned long page_count,
                     flush_flags);
     if ( unlikely(rc) )
     {
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU IOTLB flush failed: %d, dfn %"PRI_dfn", page count %lu flags %x\n",
                    d->domain_id, rc, dfn_x(dfn), page_count, flush_flags);
@@ -517,7 +517,7 @@ int iommu_iotlb_flush_all(struct domain *d, unsigned int flush_flags)
                     flush_flags | IOMMU_FLUSHF_all);
     if ( unlikely(rc) )
     {
-        if ( !d->is_shutting_down && printk_ratelimit() )
+        if ( !domain_shutting_down(d) && printk_ratelimit() )
             printk(XENLOG_ERR
                    "d%d: IOMMU IOTLB flush all failed: %d\n",
                    d->domain_id, rc);
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 0adf573150..578472d068 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1746,7 +1746,7 @@ void iommu_dev_iotlb_flush_timeout(struct domain *d, struct pci_dev *pdev)
 
     pdev->broken = true;
 
-    if ( !d->is_shutting_down && printk_ratelimit() )
+    if ( !domain_shutting_down(d) && printk_ratelimit() )
         printk(XENLOG_ERR "dom%d: ATS device %pp flush failed\n",
                d->domain_id, &pdev->sbdf);
     if ( !is_hardware_domain(d) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 011292e9f7..eef10c2ea2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -224,7 +224,7 @@ struct vcpu
     bool             force_context_switch;
     /* Require shutdown to be deferred for some asynchronous operation? */
     bool             defer_shutdown;
-    /* VCPU is paused following shutdown request (d->is_shutting_down)? */
+    /* VCPU is paused following a domain shutdown request? */
     bool             paused_for_shutdown;
     /* VCPU need affinity restored */
     uint8_t          affinity_broken;
@@ -384,6 +384,12 @@ struct domain_console {
     char buf[256];
 };
 
+enum __packed domain_shutdown_state {
+    DOMSHUTDOWN_none, /* Must remain first, as domains are zero-initialized. */
+    DOMSHUTDOWN_in_progress,
+    DOMSHUTDOWN_complete,
+};
+
 struct domain
 {
     domid_t          domain_id;
@@ -555,10 +561,9 @@ struct domain
     struct rangeset *iomem_caps;
     struct rangeset *irq_caps;
 
-    /* Guest has shut down (inc. reason code)? */
+    /* Guest shutdown state and associated reason code. */
     spinlock_t       shutdown_lock;
-    bool             is_shutting_down; /* in process of shutting down? */
-    bool             is_shut_down;     /* fully shut down? */
+    enum domain_shutdown_state shutdown_state;
 #define SHUTDOWN_CODE_INVALID ~0u
     unsigned int     shutdown_code;
 
@@ -677,6 +682,16 @@ struct domain
     unsigned int pending_scrub_index;
 } __aligned(PAGE_SIZE);
 
+static inline bool domain_shutting_down(const struct domain *d)
+{
+    return d->shutdown_state != DOMSHUTDOWN_none;
+}
+
+static inline bool domain_shutdown_completed(const struct domain *d)
+{
+    return d->shutdown_state == DOMSHUTDOWN_complete;
+}
+
 static inline struct page_list_head *page_to_list(
     struct domain *d, const struct page_info *pg)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381328.1624892 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpOF-0001Qy-Re; Mon, 03 Aug 2026 09:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381328.1624892; Mon, 03 Aug 2026 09: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 1wqpOF-0001Qq-PC; Mon, 03 Aug 2026 09:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1381328;
 Mon, 03 Aug 2026 09: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 1wqpOE-0001Qk-OS
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqpOE-0039Lp-36
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpOE-000QBA-1w
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hTiL5+3KDHyH5aUNkM6ynBoU1xvqiVniWtZV648hE+Y=; b=AT6lw/FxWT8wprwzbLUIp9P6cB
	SK7/PddWeTslGE8UE89tSZO0S4gKl1jWc60KpgUeaSr66H3wvwcTotTF5VzTh8/3dUWBV1rG9chfx
	6h29AlbeU39XFmZIDqROJOIaPOclAEHa0yFfe4cLh/25X3//qPPRqGTu0RVz3gAZBviA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pci: Use pci_sbdf_t in pci_prepare_msix()
Message-Id: <E1wqpOE-000QBA-1w@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:55:22 +0000

commit 00af54ff6ae3e1f4ab702b9529a22f8523d53ea5
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Mon Aug 3 09:42:16 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:42:16 2026 +0200

    x86/pci: Use pci_sbdf_t in pci_prepare_msix()
    
    Also take the opportunity to clean up a bit PHYSDEVOP_{prepare,release}_msix.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/msi.h |  2 +-
 xen/arch/x86/msi.c             |  4 ++--
 xen/arch/x86/physdev.c         | 16 +++++++++-------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h
index 00059d4a3a..6fb663b2e7 100644
--- a/xen/arch/x86/include/asm/msi.h
+++ b/xen/arch/x86/include/asm/msi.h
@@ -83,7 +83,7 @@ struct msi_desc;
 extern int pci_enable_msi(struct pci_dev *pdev, struct msi_info *msi,
                           struct msi_desc **desc);
 extern void pci_disable_msi(struct msi_desc *msi_desc);
-extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off);
+extern int pci_prepare_msix(pci_sbdf_t sbdf, bool off);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
 extern void pci_disable_msi_all(void);
 extern int setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc);
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 3fe22b3b6d..8831ce068c 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1153,7 +1153,7 @@ static void __pci_disable_msix(struct msi_desc *entry)
     _pci_cleanup_msix(dev->msix);
 }
 
-int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off)
+int pci_prepare_msix(pci_sbdf_t sbdf, bool off)
 {
     int rc;
     struct pci_dev *pdev;
@@ -1162,7 +1162,7 @@ int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool off)
         return 0;
 
     pcidevs_lock();
-    pdev = pci_get_pdev(NULL, PCI_SBDF(seg, bus, devfn));
+    pdev = pci_get_pdev(NULL, sbdf);
     if ( !pdev )
         rc = -ENODEV;
     else if ( pdev->msix->used_entries != !!off )
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 5bbcf3b530..86d7b82127 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -512,15 +512,17 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_prepare_msix:
     case PHYSDEVOP_release_msix: {
         struct physdev_pci_device dev;
+        pci_sbdf_t sbdf;
 
+        ret = -EFAULT;
         if ( copy_from_guest(&dev, arg, 1) )
-            ret = -EFAULT;
-        else
-            ret = xsm_resource_setup_pci(XSM_PRIV,
-                                         (dev.seg << 16) | (dev.bus << 8) |
-                                         dev.devfn) ?:
-                  pci_prepare_msix(dev.seg, dev.bus, dev.devfn,
-                                   cmd != PHYSDEVOP_prepare_msix);
+            break;
+        
+        sbdf = PCI_SBDF(dev.seg, dev.bus, dev.devfn);
+
+        ret = xsm_resource_setup_pci(XSM_PRIV, sbdf.sbdf);
+        if ( !ret )
+            ret = pci_prepare_msix(sbdf, cmd != PHYSDEVOP_prepare_msix);
         break;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381329.1624897 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpOP-0001Ss-T7; Mon, 03 Aug 2026 09:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381329.1624897; Mon, 03 Aug 2026 09: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 1wqpOP-0001Sk-QV; Mon, 03 Aug 2026 09:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1381329;
 Mon, 03 Aug 2026 09:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqpOO-0001Sd-RE
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpOP-0039Lt-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpOO-000QCF-2U
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=nlkKsCIgFhCzhv+Jccx6rdd36HCVUHHc302+weUePd4=; b=nKbOvant+1Z8y6vCCwlTI7FgJM
	/hDd52sEWHkikwKqh002zHdGyMXhHAwKD7ytbnKBVnPjt/PxfL4CRrbYuFTSfYlYJtrpK2UT1hMw3
	v96bLJLvY6EBJa73/dDcmFLxA6FJ+mVEXzpvy+rPMbTpKfa8Wij3ae8fvcbtRj+UVB18=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: update p2m_set_allocation() prototype
Message-Id: <E1wqpOO-000QCF-2U@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:55:32 +0000

commit 04073cd5f679e281f996d4e10e3c6f1cc365f99a
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Aug 3 09:49:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:49:00 2026 +0200

    xen/arm: update p2m_set_allocation() prototype
    
    p2m_set_allocation() uses a bool *preempted out-argument that overloads two
    meanings. When non-NULL, the value written back (true) duplicates information
    already carried by the -ERESTART return code — pure redundancy, which the
    caller-side ASSERT(preempted == (rc == -ERESTART)) only documents. Separately,
    a NULL pointer is an implicit calling convention meaning "preemption is not
    permitted in this context".
    
    Replace the pointer with a plain bool can_preempt that explicitly controls
    whether the preemption check runs, making the NULL-to-suppress convention
    type-safe and self-documenting, and rely on the -ERESTART return code alone to
    report that preemption occurred.
    
    Since p2m_set_allocation() is called by the common dom0less build code,
    move its declaration from the ARM-specific asm/p2m.h to xen/p2m-common.h.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/p2m.h          |  1 -
 xen/arch/arm/mmu/p2m.c                  | 24 ++++++------------------
 xen/arch/riscv/include/asm/paging.h     |  2 +-
 xen/arch/riscv/p2m.c                    |  9 ++-------
 xen/arch/riscv/paging.c                 |  7 ++-----
 xen/common/device-tree/dom0less-build.c |  2 +-
 xen/include/xen/p2m-common.h            |  8 ++++++++
 7 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 4a4913716b..737da60dcf 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -238,7 +238,6 @@ void p2m_restore_state(struct vcpu *n);
 /* Print debugging/statistial info about a domain's p2m */
 void p2m_dump_info(struct domain *d);
 
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted);
 int p2m_teardown_allocation(struct domain *d);
 
 static inline void p2m_write_lock(struct p2m_domain *p2m)
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 51abf3504f..2cf35d8a37 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -65,12 +65,7 @@ int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct page_info *pg;
 
@@ -112,11 +107,8 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
             break;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
@@ -125,7 +117,6 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
 {
     unsigned long pages = size >> PAGE_SHIFT;
-    bool preempted = false;
     int rc;
 
     if ( (size & ~PAGE_MASK) ||          /* Non page-sized request? */
@@ -133,27 +124,24 @@ int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
         return -EINVAL;
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, pages, &preempted);
+    rc = p2m_set_allocation(d, pages, /* can_preempt */ true);
     spin_unlock(&d->arch.paging.lock);
 
-    ASSERT(preempted == (rc == -ERESTART));
-
     return rc;
 }
 
 int p2m_teardown_allocation(struct domain *d)
 {
     int ret = 0;
-    bool preempted = false;
 
     spin_lock(&d->arch.paging.lock);
     if ( d->arch.paging.p2m_total_pages != 0 )
     {
-        ret = p2m_set_allocation(d, 0, &preempted);
-        if ( preempted )
+        ret = p2m_set_allocation(d, 0, /* can_preempt */ true);
+        if ( ret == -ERESTART )
         {
             spin_unlock(&d->arch.paging.lock);
-            return -ERESTART;
+            return ret;
         }
         ASSERT(d->arch.paging.p2m_total_pages == 0);
     }
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index e487c89a4c..103384723d 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -9,7 +9,7 @@ struct page_info;
 int paging_domain_init(struct domain *d);
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted);
+                           bool can_preempt);
 
 int paging_ret_to_domheap(struct domain *d, unsigned int nr_pages);
 int paging_refill_from_domheap(struct domain *d, unsigned int nr_pages);
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 703b9f4d25..566266e3e7 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -428,17 +428,12 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int rc;
 
-    if ( (rc = paging_freelist_adjust(d, pages, preempted)) )
+    if ( (rc = paging_freelist_adjust(d, pages, can_preempt)) )
         return rc;
 
     /*
diff --git a/xen/arch/riscv/paging.c b/xen/arch/riscv/paging.c
index 76a203edbb..35f572689a 100644
--- a/xen/arch/riscv/paging.c
+++ b/xen/arch/riscv/paging.c
@@ -47,7 +47,7 @@ static int _paging_add_to_freelist(struct domain *d)
 }
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted)
+                           bool can_preempt)
 {
     ASSERT(spin_is_locked(&d->arch.paging.lock));
 
@@ -66,11 +66,8 @@ int paging_freelist_adjust(struct domain *d, unsigned long pages,
             return rc;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 9513c1c837..fcbeb8adbd 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -760,7 +760,7 @@ static int __init domain_p2m_set_allocation(struct domain *d, uint64_t mem,
                 domain_p2m_pages(mem, d->max_vcpus);
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, p2m_pages, NULL);
+    rc = p2m_set_allocation(d, p2m_pages, /* can_preempt */ false);
     spin_unlock(&d->arch.paging.lock);
 
     return rc;
diff --git a/xen/include/xen/p2m-common.h b/xen/include/xen/p2m-common.h
index f0bd9a6b98..0eb0619912 100644
--- a/xen/include/xen/p2m-common.h
+++ b/xen/include/xen/p2m-common.h
@@ -43,5 +43,13 @@ int __must_check check_get_page_from_gfn(struct domain *d, gfn_t gfn,
                                          bool readonly, p2m_type_t *p2mt_p,
                                          struct page_info **page_p);
 
+/*
+ * Set the pool of pages to the required number of pages.
+ * Returns 0 for success, -ERESTART if preempted (only when can_preempt is
+ * true), or a negative error code on failure.
+ * Call with d->arch.paging.lock held.
+ */
+int __must_check p2m_set_allocation(struct domain *d, unsigned long pages,
+                                    bool can_preempt);
 
 #endif /* _XEN_P2M_COMMON_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381330.1624900 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpOZ-0001Ul-UM; Mon, 03 Aug 2026 09:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381330.1624900; Mon, 03 Aug 2026 09: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 1wqpOZ-0001Ue-Rr; Mon, 03 Aug 2026 09:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1381330;
 Mon, 03 Aug 2026 09: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 1wqpOY-0001UX-UC
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqpOZ-0039Lx-0W
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpOY-000QGI-2o
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=cVJ+Q8ooaaA1N6XWRoY3edwkAgKDlzzBtjsMniP0yNs=; b=G7fXaCJHtNu5TPo7fmuwVQI0+T
	TY5jLrz/ghusGehx4q2SO8k/pbNPpr/czF73S9FGKjm9jmaBq16EuRF0sbe89SjV68xdG09AZXS5l
	oCCmAYgNBTBpAzh8dWWoxV7ubXd1dhlwQ2NPfM8N6leHmlWcU64mQzJ/911pl4zhsWHk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: Implement ARCH_PAGING_MEMPOOL
Message-Id: <E1wqpOY-000QGI-2o@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:55:42 +0000

commit a8606445b129bfd515b74acd5ce7f078e3353b51
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Aug 3 09:49:43 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:49:43 2026 +0200

    xen/riscv: Implement ARCH_PAGING_MEMPOOL
    
    The p2m_freelist is used to allocate pages for the P2M. To initialize
    this list, domain_p2m_set_allocation() may be called from construct_domU()
    in the common Dom0less code, so RISC-V provides an implementation and
    enables CONFIG_ARCH_PAGING_MEMPOOL unconditionally.
    
    Additionally, implement arch_{set,get}_paging_mempool_size(). They are
    not directly used yet, but are required to support the
    XEN_DOMCTL_{get,set}_paging_mempool_size hypercalls.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Kconfig |  1 +
 xen/arch/riscv/p2m.c   | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 41426c2052..48520588fe 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,5 +1,6 @@
 config RISCV
 	def_bool y
+	select ARCH_PAGING_MEMPOOL
 	select DOMAIN_BUILD_HELPERS
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 566266e3e7..1cea86512c 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1600,3 +1600,27 @@ struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
 
     return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
 }
+
+int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
+{
+    unsigned long pages = PFN_DOWN(size);
+    int rc;
+
+    /* Non page-sized request or 32-bit overflow? */
+    if ( pfn_to_paddr(pages) != size )
+        return -EINVAL;
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, pages, true);
+    spin_unlock(&d->arch.paging.lock);
+
+    return rc;
+}
+
+/* Return the size of the pool, in bytes. */
+int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
+{
+    *size = pfn_to_paddr(ACCESS_ONCE(d->arch.paging.total_pages));
+
+    return 0;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381332.1624908 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpOk-0001Ye-6q; Mon, 03 Aug 2026 09:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381332.1624908; Mon, 03 Aug 2026 09: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 1wqpOk-0001Y1-3J; Mon, 03 Aug 2026 09:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1381332;
 Mon, 03 Aug 2026 09:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqpOj-0001Wt-1A
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09:55:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpOj-0039M3-0q
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpOi-000QK6-36
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=cB4IQT4w/IjsAuIdLk+PW26qqRizwvKl+gs8o6FSIKI=; b=lCu10a6R+/3+BeyeXtsVjnVuPj
	b5brYO2IMvmz6lxAtsJbyuIckt9+5aRiR9wuUKopj1/PTBsUYq6V94Mi9XmK9Gg+NJsboBn3qy1LA
	8uIus6PAA6Y/ltrVxay+RESvkV70GObv9CyelQKatkUSS7nEakSiTmKzqMprGO2X8Jjg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wqpOi-000QK6-36@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:55:52 +0000

commit 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 3 09:50:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:50:07 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index and the offset into the page
    addressed by the array element.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:56:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381334.1624918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpOu-0001nz-7R; Mon, 03 Aug 2026 09:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381334.1624918; Mon, 03 Aug 2026 09: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 1wqpOu-0001nr-4n; Mon, 03 Aug 2026 09:56:04 +0000
Received: by outflank-mailman (input) for mailman id 1381334;
 Mon, 03 Aug 2026 09: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 1wqpOt-0001nQ-4Q
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqpOt-0039Ma-1A
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpOt-000QNS-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:56:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Dk6PGV5YvFnjqNEbZfnQYsfKP4U0sduJgsRfZKjfsuY=; b=J1RLk2zUrlJPAG+s3fpNn6xohk
	don8cegrwdIAOttcnSOxhciPbTicTmz+LJCOzpsy4efKMbE/alNoDq+bFmdm2leNhnHT9sRD+C6LM
	j3ZCyKj08EbYEXUAIudp0BKn0GvAclVMFmLIow9rHUQA5tj+mMgo4K2me3C+AH0a64ew=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: split vex_np from vex_none
Message-Id: <E1wqpOt-000QNS-0E@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:56:03 +0000

commit 9462d81b6ec47fd3563934cc222d4f6e50b06a02
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 09:50:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:50:59 2026 +0200

    x86emul: split vex_np from vex_none
    
    ..., undoing the aliasing between two distinct enums, and more in line
    with how the SDM nowadays names things.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/0f01.c        | 8 ++++----
 xen/arch/x86/x86_emulate/decode.c      | 2 +-
 xen/arch/x86/x86_emulate/private.h     | 8 ++++----
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 36a8881410..d2a106557d 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -34,7 +34,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xc6:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* wrmsrns */
+        case vex_np: /* wrmsrns */
             vcpu_must_have(wrmsrns);
             generate_exception_if(!mode_ring0(), X86_EXC_GP, 0);
             fail_if(!ops->write_msr);
@@ -120,7 +120,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xe8:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* serialize */
+        case vex_np: /* serialize */
             vcpu_must_have(serialize);
             asm volatile ( ".byte 0x0f, 0x01, 0xe8" ); /* Binutils >= 2.34, Clang >= 11 */
             break;
@@ -154,7 +154,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xee:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* rdpkru */
+        case vex_np: /* rdpkru */
             if ( !ops->read_cr ||
                  ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
                 cr4 = 0;
@@ -171,7 +171,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
     case 0xef:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* wrpkru */
+        case vex_np: /* wrpkru */
             if ( !ops->read_cr ||
                  ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
                 cr4 = 0;
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 48e8c79964..947f49d870 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -1862,7 +1862,7 @@ int x86emul_decode(struct x86_emulate_state *s,
     case simd_packed_int:
         switch ( s->vex.pfx )
         {
-        case vex_none:
+        case vex_np:
             if ( !s->vex.opcx )
             {
                 s->op_bytes = 8;
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index 2d69c24b86..7892b5603b 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -195,10 +195,9 @@ enum simd_opsize {
 };
 typedef uint8_t simd_opsize_t;
 
-#define vex_none 0
-
 enum vex_opcx {
-    vex_0f = vex_none + 1,
+    vex_none,
+    vex_0f,
     vex_0f38,
     vex_0f3a,
     evex_map5 = 5,
@@ -206,7 +205,8 @@ enum vex_opcx {
 };
 
 enum vex_pfx {
-    vex_66 = vex_none + 1,
+    vex_np,
+    vex_66,
     vex_f3,
     vex_f2
 };
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 587e836d56..e15ab37758 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6031,7 +6031,7 @@ x86_emulate(
         pvex = copy_VEX(opc, vex);
         pvex->opcx = vex_0f;
         if ( elem_bytes == 4 )
-            pvex->pfx = vex_none;
+            pvex->pfx = vex_np;
         opc[0] = 0x50; /* vmovmskp{s,d} */
         /* Use %rax as GPR destination and VEX.vvvv as source. */
         pvex->r = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:56:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381337.1624922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpP4-0001vy-9A; Mon, 03 Aug 2026 09:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381337.1624922; Mon, 03 Aug 2026 09: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 1wqpP4-0001vq-69; Mon, 03 Aug 2026 09:56:14 +0000
Received: by outflank-mailman (input) for mailman id 1381337;
 Mon, 03 Aug 2026 09: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 1wqpP3-0001vZ-7D
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqpP3-0039Mi-1R
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpP3-000QPx-0V
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=M7jbkPA3WT8/jdUu0GoZBOWKK/W2k3oSFbQM2sCB4D4=; b=eaEg/2B0PQWgy/8gYaYVuOTWID
	VabVTIRdakVAaPXP29T7XYhpnYghQwzq0adRGtcwfKr+3q98GVlZCyv85tOOl1Nf9JhJpJnYrF669
	42bIfweypWeIiw8OItxKk+Rt6Pteeh58I7ihV5tsgvpTNEEiDhoqlefxlRF2iifrLh9E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: annotate saved_cmdline with __ro_after_init
Message-Id: <E1wqpP3-000QPx-0V@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:56:13 +0000

commit 43c77e051cf86b34834330f6e0a0d65d18a7d4f3
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Mon Aug 3 09:51:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 09:51:20 2026 +0200

    xen/common: annotate saved_cmdline with __ro_after_init
    
    The hypervisor command line is not modified after initialization.
    Annotate saved_cmdline with __ro_after_init to place it in the
    dedicated read-only-after-init section.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index fb45f81399..d1bef9ac2b 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -34,7 +34,7 @@ bool __ro_after_init opt_dit = IS_ENABLED(CONFIG_DIT_DEFAULT);
 boolean_param("dit", opt_dit);
 #endif
 
-static xen_commandline_t saved_cmdline;
+static xen_commandline_t __ro_after_init saved_cmdline;
 static const char __initconst opt_builtin_cmdline[] = CONFIG_CMDLINE;
 char __ro_after_init xen_cap_info[128];
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:56:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:56:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381340.1624926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpPF-00022B-Bi; Mon, 03 Aug 2026 09:56:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381340.1624926; Mon, 03 Aug 2026 09:56:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpPF-000223-9A; Mon, 03 Aug 2026 09:56:25 +0000
Received: by outflank-mailman (input) for mailman id 1381340;
 Mon, 03 Aug 2026 09: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 1wqpPD-00021p-Oa
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqpPD-0039Mm-3C
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpPD-000QU1-2F
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=4Ni5tBWExG9yqmn5Nd9RrM71bEUr8qZfV/pwHEOwRDk=; b=DslSB4xj5etwVA4DbVuN7GKrzA
	a2Qz1oVxSBJvfZNSUNK4SD9bA3iC3nl3TJ4Ep7JH1LK16FF2abHSfEuKACXE4w8JcEu1mo0CzJCYO
	v/ehpZuESAORujPeCBPKUfvz1dxaX28dV9ZnbACOVLXwYPObgASXYwUmFRGNKAGxmKf0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm: Fix PT_PT table descriptor value and comment
Message-Id: <E1wqpPD-000QU1-2F@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:56:23 +0000

commit eb372d90624124e2ab6b05561fbbfe8b54cc0d26
Author:     Gabriel Quintáns Souto <gabi.qs.mail@gmail.com>
AuthorDate: Mon May 18 23:00:08 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 3 11:48:59 2026 +0200

    arm: Fix PT_PT table descriptor value and comment
    
    Per ARMv7-A/ARMv8-A ARM, bits [11:2] of table descriptors are
    ignored by hardware. The original comment incorrectly described
    block/page descriptor fields which are not present in table
    descriptors.
    
    Use the minimal valid encoding for table descriptors by setting
    PT_PT to 0x3.
    
    This updates both arm32 and arm64 for consistency.
    
    Signed-off-by: Gabriel Quintáns Souto <gabi.qs.mail@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/arm32/mmu/head.S | 2 +-
 xen/arch/arm/arm64/mmu/head.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
index 5032e6c075..3731322f7e 100644
--- a/xen/arch/arm/arm32/mmu/head.S
+++ b/xen/arch/arm/arm32/mmu/head.S
@@ -8,7 +8,7 @@
 #include <asm/page.h>
 #include <asm/early_printk.h>
 
-#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
+#define PT_PT     0x3   /* T=1 P=1 */
 #define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
 #define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
 #define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
index d14780ad19..8e514d2114 100644
--- a/xen/arch/arm/arm64/mmu/head.S
+++ b/xen/arch/arm/arm64/mmu/head.S
@@ -8,7 +8,7 @@
 #include <asm/page.h>
 #include <asm/early_printk.h>
 
-#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
+#define PT_PT     0x3   /* T=1 P=1 */
 #define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
 #define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
 #define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 09:56:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 09:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381342.1624930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpPP-00025a-DO; Mon, 03 Aug 2026 09:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381342.1624930; Mon, 03 Aug 2026 09:56:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqpPP-00025S-AS; Mon, 03 Aug 2026 09:56:35 +0000
Received: by outflank-mailman (input) for mailman id 1381342;
 Mon, 03 Aug 2026 09: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 1wqpPN-00025I-RD
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 09: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 1wqpPO-0039Mr-0E
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqpPN-000QWW-2Y
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 09: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=JjmaUC7aWLGmLro5xbpsz9BL+iH1jbMctk9WfTA/ajM=; b=TW+RL14o8eOHW0ynlkhE/9UeDc
	QahUzkux/7bEeO1tBfncELKElyPVEoLlyT2UNhTRY5wxhnTb8Fy7u4q3YwcLCFhRnBXUPbV/ueCXY
	t3Y5Gigx+ey1jK1qai7J50R/k/YHUZ1IMS+k0L251Pw0MaMiXJEldY35n6cDeFpyVF/Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: mask debug exceptions in initial AArch64 guest state
Message-Id: <E1wqpPN-000QWW-2Y@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 09:56:33 +0000

commit ad8663a75aa8db4255d6690bfc210d559edc9f5b
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Fri Jun 19 20:37:38 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 3 11:48:59 2026 +0200

    xen/arm: mask debug exceptions in initial AArch64 guest state
    
    PSR_GUEST64_INIT currently masks SError, IRQ and FIQ, but leaves debug
    exceptions unmasked. Both the AArch64 Linux boot protocol and PSCI entry
    requirements expect PSTATE.DAIF to be masked.
    
    Add PSR_DBG_MASK to PSR_GUEST64_INIT. This fixes the initial AArch64 guest
    entry state as well as virtual PSCI CPU_ON and SYSTEM_SUSPEND resume entry.
    
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Julien Grall <julien@xen.org>
---
 xen/include/public/arch-arm.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 7d6f87e8b2..00de30b896 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -420,7 +420,8 @@ typedef uint64_t xen_callback_t;
  * zImage kernels on aarch32.
  */
 #define PSR_GUEST32_INIT (PSR_Z|PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC)
-#define PSR_GUEST64_INIT (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_EL1h)
+#define PSR_GUEST64_INIT \
+    (PSR_DBG_MASK|PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_EL1h)
 
 #define SCTLR_GUEST_INIT    xen_mk_ullong(0x00c50078)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 10:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 10:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381380.1624970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqq9L-0005D9-NU; Mon, 03 Aug 2026 10:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381380.1624970; Mon, 03 Aug 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 1wqq9L-0005D1-Ks; Mon, 03 Aug 2026 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1381380;
 Mon, 03 Aug 2026 10: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 1wqq9J-0005Cu-TY
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 10: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 1wqq9K-003AKO-0G
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 10:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqq9J-000qRM-2S
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 10:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uxMcG52AjiasjWfu6eA5GwEgD3M81BOAXRVbTTwnaDo=; b=sYxMfi6ZU3leOowhJlcfotpZJI
	2wxoyLPLHonuZRXchBbFaSwITpj+2+VPrDhM4Olowmqtbz1e0+h0nPfsF9WhZSuZlqMsJpRZGRPlE
	VNggdaixG/5auFPoxluqsAzoPbnjjSaEPTwebZQSmEJXdna97fvLlMbpy4p0ooJLWOWo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm: Fix PT_PT table descriptor value and comment
Message-Id: <E1wqq9J-000qRM-2S@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 10:44:01 +0000

commit eb372d90624124e2ab6b05561fbbfe8b54cc0d26
Author:     Gabriel Quintáns Souto <gabi.qs.mail@gmail.com>
AuthorDate: Mon May 18 23:00:08 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 3 11:48:59 2026 +0200

    arm: Fix PT_PT table descriptor value and comment
    
    Per ARMv7-A/ARMv8-A ARM, bits [11:2] of table descriptors are
    ignored by hardware. The original comment incorrectly described
    block/page descriptor fields which are not present in table
    descriptors.
    
    Use the minimal valid encoding for table descriptors by setting
    PT_PT to 0x3.
    
    This updates both arm32 and arm64 for consistency.
    
    Signed-off-by: Gabriel Quintáns Souto <gabi.qs.mail@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/arm32/mmu/head.S | 2 +-
 xen/arch/arm/arm64/mmu/head.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
index 5032e6c075..3731322f7e 100644
--- a/xen/arch/arm/arm32/mmu/head.S
+++ b/xen/arch/arm/arm32/mmu/head.S
@@ -8,7 +8,7 @@
 #include <asm/page.h>
 #include <asm/early_printk.h>
 
-#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
+#define PT_PT     0x3   /* T=1 P=1 */
 #define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
 #define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
 #define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
index d14780ad19..8e514d2114 100644
--- a/xen/arch/arm/arm64/mmu/head.S
+++ b/xen/arch/arm/arm64/mmu/head.S
@@ -8,7 +8,7 @@
 #include <asm/page.h>
 #include <asm/early_printk.h>
 
-#define PT_PT     0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
+#define PT_PT     0x3   /* T=1 P=1 */
 #define PT_MEM    0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
 #define PT_MEM_L3 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */
 #define PT_DEV    0xe71 /* nG=1 AF=1 SH=10 AP=01 NS=1 ATTR=100 T=0 P=1 */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 10:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381381.1624973 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqq9V-0005Ey-Ol; Mon, 03 Aug 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 1381381.1624973; Mon, 03 Aug 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 1wqq9V-0005Eq-MG; Mon, 03 Aug 2026 10:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1381381;
 Mon, 03 Aug 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 1wqq9T-0005Eg-Ui
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 10: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 1wqq9U-003AKZ-0Z
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 10:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqq9T-000qW8-2q
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 10: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=z/yXQWkyGQGBUTALH0cA8XMZe4MnH1r0I1FuLKAnerA=; b=qEZ2JPqPvEbxanIWiC/NQViBqo
	pHQ1Jjzfg4ZLraU0bGP8K4ZDer2ZbxHhf8IzuSNSGcvXYKCE3Rdxjpk/QczOcoP7ClglrlQRlTvaa
	PLwogoiIMfPF0gx1l0CZ7OMvwkDF+Gy6VGMTl/jKHseRgIsJD90zlpBXf50CfYbDrEM8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: mask debug exceptions in initial AArch64 guest state
Message-Id: <E1wqq9T-000qW8-2q@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 10:44:11 +0000

commit ad8663a75aa8db4255d6690bfc210d559edc9f5b
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Fri Jun 19 20:37:38 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 3 11:48:59 2026 +0200

    xen/arm: mask debug exceptions in initial AArch64 guest state
    
    PSR_GUEST64_INIT currently masks SError, IRQ and FIQ, but leaves debug
    exceptions unmasked. Both the AArch64 Linux boot protocol and PSCI entry
    requirements expect PSTATE.DAIF to be masked.
    
    Add PSR_DBG_MASK to PSR_GUEST64_INIT. This fixes the initial AArch64 guest
    entry state as well as virtual PSCI CPU_ON and SYSTEM_SUSPEND resume entry.
    
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Julien Grall <julien@xen.org>
---
 xen/include/public/arch-arm.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 7d6f87e8b2..00de30b896 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -420,7 +420,8 @@ typedef uint64_t xen_callback_t;
  * zImage kernels on aarch32.
  */
 #define PSR_GUEST32_INIT (PSR_Z|PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_SVC)
-#define PSR_GUEST64_INIT (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_EL1h)
+#define PSR_GUEST64_INIT \
+    (PSR_DBG_MASK|PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK|PSR_MODE_EL1h)
 
 #define SCTLR_GUEST_INIT    xen_mk_ullong(0x00c50078)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381649.1625172 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqupe-0005qk-S6; Mon, 03 Aug 2026 15:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381649.1625172; Mon, 03 Aug 2026 15:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqupe-0005qd-PT; Mon, 03 Aug 2026 15:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1381649;
 Mon, 03 Aug 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 1wqupe-0005qX-7J
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 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 1wqupe-003FhZ-00
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqupd-002ra2-2D
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SwORA2mjSZSlY6WE0VTDj77zGAO89BY/kASd6n1yqEQ=; b=L2Uxr1+wY59P6EUlclbdjswAOR
	iUJyw6CUR0aRoaH1KTN5w6B9kl9YQPtgKeSz/gxvwrdfWmFiyBXe6zXqDt63WRYzXzjX7VsJcpzUk
	tEjxvkJf9gNkiPcqur/ifWT0FeDKXqaJ8hcj0FyQm7BrXw+kSdM1x6E9n6R8r/4djf3k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: reduce redundancy in hook machinery
Message-Id: <E1wqupd-002ra2-2D@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:44:01 +0000

commit 813a62811fc6c84b2e8d597c75406cc55776d997
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 14:22:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 14:22:22 2026 +0200

    XSM: reduce redundancy in hook machinery
    
    Hook definition (in struct xsm_ops), wrappers, dummy_ops, and flask_ops
    need keeping in sync (including any involved #ifdef-ary), i.e. require
    consistent adjustments in multiple places when a change is necessary.
    Reduce this by introducing a multi-use helper header file. (However,
    hooks not taking xsm_default_t as first argument in the wrappers aren't
    covered.)
    
    As there's some re-arrangement of field order in struct xsm_ops anyway,
    also group together everything depending on SYSCTL=y. Similarly move
    .mem_sharing_op() into the MEM_SHARING conditional.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/hooks.h | 137 ++++++++++++
 xen/include/xsm/xsm.h   | 568 +++++-------------------------------------------
 xen/xsm/dummy.c         | 105 +--------
 xen/xsm/flask/hooks.c   | 108 +--------
 4 files changed, 211 insertions(+), 707 deletions(-)

diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
new file mode 100644
index 0000000000..87e357508d
--- /dev/null
+++ b/xen/include/xsm/hooks.h
@@ -0,0 +1,137 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/* This file is intended to be included multiple times. */
+
+#ifndef XSM_HOOK
+
+#include <xen/macros.h>
+
+#define XSM_HOOK__(rtype, name, nargs, types...) \
+    XSM_HOOK ## nargs(rtype, name, ## types)
+
+#define XSM_HOOK_(rtype, name, nargs, types...) \
+    XSM_HOOK__(rtype, name, nargs, ## types)
+
+#define XSM_HOOK(rtype, name, types...) \
+    XSM_HOOK_(rtype, name, count_args(types), ## types)
+
+#endif /* XSM_HOOK */
+
+XSM_HOOK(int, domain_create, struct domain *, uint32_t)
+XSM_HOOK(int, getdomaininfo, struct domain *)
+XSM_HOOK(int, get_domain_state, struct domain *)
+
+#ifdef CONFIG_SYSCTL
+XSM_HOOK(int, sysctl, const struct xen_sysctl *)
+#endif
+
+XSM_HOOK(int, set_target, struct domain *, struct domain *)
+XSM_HOOK(int, domctl, struct domain *, struct xen_domctl *)
+
+XSM_HOOK(int, evtchn_unbound, struct domain *, struct evtchn *, domid_t)
+XSM_HOOK(int, evtchn_interdomain, struct domain *, struct evtchn *,
+                                  struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_send, struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
+
+XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
+XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
+XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
+XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
+XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
+XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
+
+XSM_HOOK(int, init_hardware_domain, struct domain *)
+
+XSM_HOOK(int, get_pod_target, struct domain *)
+XSM_HOOK(int, set_pod_target, struct domain *)
+
+XSM_HOOK(int, memory_exchange, struct domain *)
+XSM_HOOK(int, memory_adjust_reservation, struct domain *, struct domain *)
+XSM_HOOK(int, memory_stat_reservation, struct domain *, struct domain *)
+XSM_HOOK(int, memory_pin_page, struct domain *, struct domain *,
+                               struct page_info *)
+XSM_HOOK(int, add_to_physmap, struct domain *, struct domain *)
+XSM_HOOK(int, remove_from_physmap, struct domain *, struct domain *)
+XSM_HOOK(int, map_gmfn_foreign, struct domain *, struct domain *)
+XSM_HOOK(int, claim_pages, struct domain *)
+
+XSM_HOOK(int, console_io, struct domain *, int)
+
+XSM_HOOK(int, kexec)
+
+XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
+
+XSM_HOOK(int, map_domain_pirq, struct domain *)
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
+XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
+XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
+XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
+
+XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
+XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
+                                     uint16_t, uint8_t)
+
+XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
+
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+XSM_HOOK(int, get_device_group, uint32_t)
+#endif
+
+XSM_HOOK(int, resource_plug_pci, uint32_t)
+XSM_HOOK(int, resource_unplug_pci, uint32_t)
+XSM_HOOK(int, resource_setup_pci, uint32_t)
+XSM_HOOK(int, resource_setup_gsi, int)
+XSM_HOOK(int, resource_setup_misc)
+
+XSM_HOOK(int, hypfs_op)
+
+XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
+XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
+XSM_HOOK(int, get_vnumainfo, struct domain *)
+
+#ifdef CONFIG_VM_EVENT
+XSM_HOOK(int, mem_access, struct domain *)
+#endif
+
+#ifdef CONFIG_MEM_PAGING
+XSM_HOOK(int, mem_paging, struct domain *)
+#endif
+
+#ifdef CONFIG_MEM_SHARING
+XSM_HOOK(int, mem_sharing, struct domain *)
+XSM_HOOK(int, mem_sharing_op, struct domain *, struct domain *, int)
+#endif
+
+XSM_HOOK(int, platform_op, uint32_t)
+
+#ifdef CONFIG_X86
+XSM_HOOK(int, do_mca)
+XSM_HOOK(int, apic, struct domain *, int)
+XSM_HOOK(int, machine_memory_map)
+XSM_HOOK(int, domain_memory_map, struct domain *)
+XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
+                          uint32_t)
+XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
+XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
+XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
+XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
+XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
+XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
+#endif /* CONFIG_X86 */
+
+XSM_HOOK(int, dm_op, struct domain *)
+XSM_HOOK(int, xen_version, uint32_t)
+XSM_HOOK(int, domain_resource_map, struct domain *)
+
+#undef XSM_HOOK0
+#undef XSM_HOOK1
+#undef XSM_HOOK2
+#undef XSM_HOOK3
+#undef XSM_HOOK4
+#undef XSM_HOOK5
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 852eac7d20..53c722f868 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,6 +41,13 @@ enum xsm_default {
 };
 typedef enum xsm_default xsm_default_t;
 
+#ifdef CONFIG_X86
+#define XSM_MMU_UPDATE_READ      1
+#define XSM_MMU_UPDATE_WRITE     2
+#define XSM_MMU_NORMAL_UPDATE    4
+#define XSM_MMU_MACHPHYS_UPDATE  8
+#endif /* CONFIG_X86 */
+
 /*
  * !!! WARNING !!!
  *
@@ -54,131 +61,36 @@ struct xsm_ops {
     int (*set_system_active)(void);
     void (*security_domaininfo)(struct domain *d,
                                 struct xen_domctl_getdomaininfo *info);
-    int (*domain_create)(struct domain *d, uint32_t ssidref);
-    int (*getdomaininfo)(struct domain *d);
-    int (*set_target)(struct domain *d, struct domain *e);
-    int (*domctl)(struct domain *d, struct xen_domctl *op);
-#ifdef CONFIG_SYSCTL
-    int (*sysctl)(const struct xen_sysctl *op);
-#endif
 
-    int (*evtchn_unbound)(struct domain *d, struct evtchn *chn, domid_t id2);
-    int (*evtchn_interdomain)(struct domain *d1, struct evtchn *chn1,
-                              struct domain *d2, struct evtchn *chn2);
-    void (*evtchn_close_post)(struct evtchn *chn);
-    int (*evtchn_send)(struct domain *d, struct evtchn *chn);
-    int (*evtchn_status)(struct domain *d, struct evtchn *chn);
-    int (*evtchn_reset)(struct domain *d1, struct domain *d2);
+#define XSM_HOOK0(rtype, name) rtype (*name)(void);
+#define XSM_HOOK1(rtype, name, type1) \
+    rtype (*name)(type1 arg1);
+#define XSM_HOOK2(rtype, name, type1, type2) \
+    rtype (*name)(type1 arg1, type2 arg2);
+#define XSM_HOOK3(rtype, name, type1, type2, type3) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3);
+#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4);
+#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5);
+
+#include "hooks.h"
 
-    int (*grant_mapref)(struct domain *d1, struct domain *d2, uint32_t flags);
-    int (*grant_unmapref)(struct domain *d1, struct domain *d2);
-    int (*grant_setup)(struct domain *d1, struct domain *d2);
-    int (*grant_transfer)(struct domain *d1, struct domain *d2);
-    int (*grant_copy)(struct domain *d1, struct domain *d2);
-    int (*grant_query_size)(struct domain *d1, struct domain *d2);
+    void (*evtchn_close_post)(struct evtchn *chn);
 
     int (*alloc_security_domain)(struct domain *d);
     void (*free_security_domain)(struct domain *d);
     int (*alloc_security_evtchns)(struct evtchn chn[], unsigned int nr);
     void (*free_security_evtchns)(struct evtchn chn[], unsigned int nr);
     char *(*show_security_evtchn)(struct domain *d, const struct evtchn *chn);
-    int (*init_hardware_domain)(struct domain *d);
-
-    int (*get_pod_target)(struct domain *d);
-    int (*set_pod_target)(struct domain *d);
-    int (*memory_exchange)(struct domain *d);
-    int (*memory_adjust_reservation)(struct domain *d1, struct domain *d2);
-    int (*memory_stat_reservation)(struct domain *d1, struct domain *d2);
-    int (*memory_pin_page)(struct domain *d1, struct domain *d2,
-                           struct page_info *page);
-    int (*add_to_physmap)(struct domain *d1, struct domain *d2);
-    int (*remove_from_physmap)(struct domain *d1, struct domain *d2);
-    int (*map_gmfn_foreign)(struct domain *d, struct domain *t);
-    int (*claim_pages)(struct domain *d);
-
-    int (*console_io)(struct domain *d, int cmd);
-
-    int (*kexec)(void);
-    int (*schedop_shutdown)(struct domain *d1, struct domain *d2);
 
     char *(*show_irq_sid)(int irq);
-    int (*map_domain_pirq)(struct domain *d);
-    int (*map_domain_irq)(struct domain *d, int irq, const void *data);
-    int (*unmap_domain_pirq)(struct domain *d);
-    int (*unmap_domain_irq)(struct domain *d, int irq, const void *data);
-    int (*bind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*irq_permission)(struct domain *d, int pirq, uint8_t allow);
-    int (*iomem_permission)(struct domain *d, uint64_t s, uint64_t e,
-                            uint8_t allow);
-    int (*iomem_mapping)(struct domain *d, uint64_t s, uint64_t e,
-                         uint8_t allow);
-    int (*iomem_mapping_vpci)(struct domain *d, uint64_t s, uint64_t e,
-                              uint8_t allow);
-    int (*pci_config_permission)(struct domain *d, uint32_t machine_bdf,
-                                 uint16_t start, uint16_t end, uint8_t access);
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    int (*get_device_group)(uint32_t machine_bdf);
-#endif
-
-    int (*resource_plug_pci)(uint32_t machine_bdf);
-    int (*resource_unplug_pci)(uint32_t machine_bdf);
-    int (*resource_setup_pci)(uint32_t machine_bdf);
-    int (*resource_setup_gsi)(int gsi);
-    int (*resource_setup_misc)(void);
-
-    int (*hypfs_op)(void);
 
     long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
 #ifdef CONFIG_COMPAT
     int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
 #endif
 
-    int (*hvm_param)(struct domain *d, unsigned long op);
-    int (*hvm_param_altp2mhvm)(struct domain *d);
-    int (*hvm_altp2mhvm_op)(struct domain *d, uint64_t mode, uint32_t op);
-    int (*get_vnumainfo)(struct domain *d);
-
-#ifdef CONFIG_VM_EVENT
-    int (*mem_access)(struct domain *d);
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    int (*mem_paging)(struct domain *d);
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    int (*mem_sharing)(struct domain *d);
-#endif
-
-    int (*platform_op)(uint32_t cmd);
-
-#ifdef CONFIG_X86
-    int (*do_mca)(void);
-    int (*mem_sharing_op)(struct domain *d, struct domain *cd, int op);
-    int (*apic)(struct domain *d, int cmd);
-    int (*machine_memory_map)(void);
-    int (*domain_memory_map)(struct domain *d);
-#define XSM_MMU_UPDATE_READ      1
-#define XSM_MMU_UPDATE_WRITE     2
-#define XSM_MMU_NORMAL_UPDATE    4
-#define XSM_MMU_MACHPHYS_UPDATE  8
-    int (*mmu_update)(struct domain *d, struct domain *t,
-                      struct domain *f, uint32_t flags);
-    int (*mmuext_op)(struct domain *d, struct domain *f);
-    int (*update_va_mapping)(struct domain *d, struct domain *f,
-                             l1_pgentry_t pte);
-    int (*priv_mapping)(struct domain *d, struct domain *t);
-    int (*ioport_permission)(struct domain *d, uint32_t s, uint32_t e,
-                             uint8_t allow);
-    int (*ioport_mapping)(struct domain *d, uint32_t s, uint32_t e,
-                          uint8_t allow);
-    int (*pmu_op)(struct domain *d, unsigned int op);
-#endif
-    int (*dm_op)(struct domain *d);
-    int (*xen_version)(uint32_t cmd);
-    int (*domain_resource_map)(struct domain *d);
 #ifdef CONFIG_ARGO
     int (*argo_enable)(const struct domain *d);
     int (*argo_register_single_source)(const struct domain *d,
@@ -186,7 +98,6 @@ struct xsm_ops {
     int (*argo_register_any_source)(const struct domain *d);
     int (*argo_send)(const struct domain *d, const struct domain *t);
 #endif
-    int (*get_domain_state)(struct domain *d);
 };
 
 #ifdef CONFIG_XSM
@@ -206,113 +117,57 @@ static inline void xsm_security_domaininfo(
     alternative_vcall(xsm_ops.security_domaininfo, d, info);
 }
 
-static inline int xsm_domain_create(
-    xsm_default_t def, struct domain *d, uint32_t ssidref)
-{
-    return alternative_call(xsm_ops.domain_create, d, ssidref);
-}
+#define XSM_ALT_void alternative_vcall
+#define XSM_ALT_int  return alternative_call
 
-static inline int xsm_getdomaininfo(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.getdomaininfo, d);
+#define XSM_HOOK0(rtype, name) \
+static inline rtype xsm_ ## name(xsm_default_t def) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name); \
 }
 
-static inline int xsm_get_domain_state(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_domain_state, d);
+#define XSM_HOOK1(rtype, name, type1) \
+static inline rtype xsm_ ## name(xsm_default_t def, type1 arg1) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1); \
 }
 
-static inline int xsm_set_target(
-    xsm_default_t def, struct domain *d, struct domain *e)
-{
-    return alternative_call(xsm_ops.set_target, d, e);
+#define XSM_HOOK2(rtype, name, type1, type2) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2); \
 }
 
-static inline int xsm_domctl(xsm_default_t def, struct domain *d,
-                             struct xen_domctl *op)
-{
-    return alternative_call(xsm_ops.domctl, d, op);
+#define XSM_HOOK3(rtype, name, type1, type2, type3) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3); \
 }
 
-#ifdef CONFIG_SYSCTL
-static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
-{
-    return alternative_call(xsm_ops.sysctl, op);
+#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4); \
 }
-#endif
 
-static inline int xsm_evtchn_unbound(
-    xsm_default_t def, struct domain *d1, struct evtchn *chn, domid_t id2)
-{
-    return alternative_call(xsm_ops.evtchn_unbound, d1, chn, id2);
+#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
+    type5 arg5) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4, arg5); \
 }
 
-static inline int xsm_evtchn_interdomain(
-    xsm_default_t def, struct domain *d1, struct evtchn *chan1,
-    struct domain *d2, struct evtchn *chan2)
-{
-    return alternative_call(xsm_ops.evtchn_interdomain, d1, chan1, d2, chan2);
-}
+#include "hooks.h"
 
 static inline void xsm_evtchn_close_post(struct evtchn *chn)
 {
     alternative_vcall(xsm_ops.evtchn_close_post, chn);
 }
 
-static inline int xsm_evtchn_send(
-    xsm_default_t def, struct domain *d, struct evtchn *chn)
-{
-    return alternative_call(xsm_ops.evtchn_send, d, chn);
-}
-
-static inline int xsm_evtchn_status(
-    xsm_default_t def, struct domain *d, struct evtchn *chn)
-{
-    return alternative_call(xsm_ops.evtchn_status, d, chn);
-}
-
-static inline int xsm_evtchn_reset(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.evtchn_reset, d1, d2);
-}
-
-static inline int xsm_grant_mapref(
-    xsm_default_t def, struct domain *d1, struct domain *d2, uint32_t flags)
-{
-    return alternative_call(xsm_ops.grant_mapref, d1, d2, flags);
-}
-
-static inline int xsm_grant_unmapref(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_unmapref, d1, d2);
-}
-
-static inline int xsm_grant_setup(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_setup, d1, d2);
-}
-
-static inline int xsm_grant_transfer(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_transfer, d1, d2);
-}
-
-static inline int xsm_grant_copy(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_copy, d1, d2);
-}
-
-static inline int xsm_grant_query_size(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_query_size, d1, d2);
-}
-
 static inline int xsm_alloc_security_domain(struct domain *d)
 {
     return alternative_call(xsm_ops.alloc_security_domain, d);
@@ -341,193 +196,11 @@ static inline char *xsm_show_security_evtchn(
     return alternative_call(xsm_ops.show_security_evtchn, d, chn);
 }
 
-static inline int xsm_init_hardware_domain(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.init_hardware_domain, d);
-}
-
-static inline int xsm_get_pod_target(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_pod_target, d);
-}
-
-static inline int xsm_set_pod_target(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.set_pod_target, d);
-}
-
-static inline int xsm_memory_exchange(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.memory_exchange, d);
-}
-
-static inline int xsm_memory_adjust_reservation(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.memory_adjust_reservation, d1, d2);
-}
-
-static inline int xsm_memory_stat_reservation(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.memory_stat_reservation, d1, d2);
-}
-
-static inline int xsm_memory_pin_page(
-    xsm_default_t def, struct domain *d1, struct domain *d2,
-    struct page_info *page)
-{
-    return alternative_call(xsm_ops.memory_pin_page, d1, d2, page);
-}
-
-static inline int xsm_add_to_physmap(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.add_to_physmap, d1, d2);
-}
-
-static inline int xsm_remove_from_physmap(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.remove_from_physmap, d1, d2);
-}
-
-static inline int xsm_map_gmfn_foreign(
-    xsm_default_t def, struct domain *d, struct domain *t)
-{
-    return alternative_call(xsm_ops.map_gmfn_foreign, d, t);
-}
-
-static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.claim_pages, d);
-}
-
-static inline int xsm_console_io(xsm_default_t def, struct domain *d, int cmd)
-{
-    return alternative_call(xsm_ops.console_io, d, cmd);
-}
-
-static inline int xsm_kexec(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.kexec);
-}
-
-static inline int xsm_schedop_shutdown(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.schedop_shutdown, d1, d2);
-}
-
 static inline char *xsm_show_irq_sid(int irq)
 {
     return alternative_call(xsm_ops.show_irq_sid, irq);
 }
 
-static inline int xsm_map_domain_pirq(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.map_domain_pirq, d);
-}
-
-static inline int xsm_map_domain_irq(
-    xsm_default_t def, struct domain *d, int irq, void *data)
-{
-    return alternative_call(xsm_ops.map_domain_irq, d, irq, data);
-}
-
-static inline int xsm_unmap_domain_pirq(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.unmap_domain_pirq, d);
-}
-
-static inline int xsm_unmap_domain_irq(
-    xsm_default_t def, struct domain *d, int irq, void *data)
-{
-    return alternative_call(xsm_ops.unmap_domain_irq, d, irq, data);
-}
-
-static inline int xsm_bind_pt_irq(
-    xsm_default_t def, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return alternative_call(xsm_ops.bind_pt_irq, d, bind);
-}
-
-static inline int xsm_unbind_pt_irq(
-    xsm_default_t def, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return alternative_call(xsm_ops.unbind_pt_irq, d, bind);
-}
-
-static inline int xsm_irq_permission(
-    xsm_default_t def, struct domain *d, int pirq, uint8_t allow)
-{
-    return alternative_call(xsm_ops.irq_permission, d, pirq, allow);
-}
-
-static inline int xsm_iomem_permission(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_permission, d, s, e, allow);
-}
-
-static inline int xsm_iomem_mapping(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_mapping, d, s, e, allow);
-}
-
-static inline int xsm_iomem_mapping_vpci(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_mapping_vpci, d, s, e, allow);
-}
-
-static inline int xsm_pci_config_permission(
-    xsm_default_t def, struct domain *d, uint32_t machine_bdf, uint16_t start,
-    uint16_t end, uint8_t access)
-{
-    return alternative_call(xsm_ops.pci_config_permission, d, machine_bdf, start, end, access);
-}
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-static inline int xsm_get_device_group(xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.get_device_group, machine_bdf);
-}
-#endif /* HAS_PASSTHROUGH && HAS_PCI) */
-
-static inline int xsm_resource_plug_pci(xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_plug_pci, machine_bdf);
-}
-
-static inline int xsm_resource_unplug_pci(
-    xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_unplug_pci, machine_bdf);
-}
-
-static inline int xsm_resource_setup_pci(
-    xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_setup_pci, machine_bdf);
-}
-
-static inline int xsm_resource_setup_gsi(xsm_default_t def, int gsi)
-{
-    return alternative_call(xsm_ops.resource_setup_gsi, gsi);
-}
-
-static inline int xsm_resource_setup_misc(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.resource_setup_misc);
-}
-
-static inline int xsm_hypfs_op(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.hypfs_op);
-}
-
 static inline long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return alternative_call(xsm_ops.do_xsm_op, op);
@@ -540,141 +213,6 @@ static inline int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
 }
 #endif
 
-static inline int xsm_hvm_param(
-    xsm_default_t def, struct domain *d, unsigned long op)
-{
-    return alternative_call(xsm_ops.hvm_param, d, op);
-}
-
-static inline int xsm_hvm_param_altp2mhvm(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.hvm_param_altp2mhvm, d);
-}
-
-static inline int xsm_hvm_altp2mhvm_op(
-    xsm_default_t def, struct domain *d, uint64_t mode, uint32_t op)
-{
-    return alternative_call(xsm_ops.hvm_altp2mhvm_op, d, mode, op);
-}
-
-static inline int xsm_get_vnumainfo(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_vnumainfo, d);
-}
-
-#ifdef CONFIG_VM_EVENT
-static inline int xsm_mem_access(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_access, d);
-}
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-static inline int xsm_mem_paging(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_paging, d);
-}
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-static inline int xsm_mem_sharing(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_sharing, d);
-}
-#endif
-
-static inline int xsm_platform_op(xsm_default_t def, uint32_t op)
-{
-    return alternative_call(xsm_ops.platform_op, op);
-}
-
-#ifdef CONFIG_X86
-static inline int xsm_do_mca(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.do_mca);
-}
-
-static inline int xsm_mem_sharing_op(
-    xsm_default_t def, struct domain *d, struct domain *cd, int op)
-{
-    return alternative_call(xsm_ops.mem_sharing_op, d, cd, op);
-}
-
-static inline int xsm_apic(xsm_default_t def, struct domain *d, int cmd)
-{
-    return alternative_call(xsm_ops.apic, d, cmd);
-}
-
-static inline int xsm_machine_memory_map(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.machine_memory_map);
-}
-
-static inline int xsm_domain_memory_map(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.domain_memory_map, d);
-}
-
-static inline int xsm_mmu_update(
-    xsm_default_t def, struct domain *d, struct domain *t, struct domain *f,
-    uint32_t flags)
-{
-    return alternative_call(xsm_ops.mmu_update, d, t, f, flags);
-}
-
-static inline int xsm_mmuext_op(
-    xsm_default_t def, struct domain *d, struct domain *f)
-{
-    return alternative_call(xsm_ops.mmuext_op, d, f);
-}
-
-static inline int xsm_update_va_mapping(
-    xsm_default_t def, struct domain *d, struct domain *f, l1_pgentry_t pte)
-{
-    return alternative_call(xsm_ops.update_va_mapping, d, f, pte);
-}
-
-static inline int xsm_priv_mapping(
-    xsm_default_t def, struct domain *d, struct domain *t)
-{
-    return alternative_call(xsm_ops.priv_mapping, d, t);
-}
-
-static inline int xsm_ioport_permission(
-    xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.ioport_permission, d, s, e, allow);
-}
-
-static inline int xsm_ioport_mapping(
-    xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.ioport_mapping, d, s, e, allow);
-}
-
-static inline int xsm_pmu_op(
-    xsm_default_t def, struct domain *d, unsigned int op)
-{
-    return alternative_call(xsm_ops.pmu_op, d, op);
-}
-
-#endif /* CONFIG_X86 */
-
-static inline int xsm_dm_op(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.dm_op, d);
-}
-
-static inline int xsm_xen_version(xsm_default_t def, uint32_t op)
-{
-    return alternative_call(xsm_ops.xen_version, op);
-}
-
-static inline int xsm_domain_resource_map(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.domain_resource_map, d);
-}
-
 #ifdef CONFIG_ARGO
 static inline int xsm_argo_enable(const struct domain *d)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 2d02655703..dfe1cf41c7 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -16,124 +16,37 @@
 static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
     .set_system_active             = xsm_set_system_active,
     .security_domaininfo           = xsm_security_domaininfo,
-    .domain_create                 = xsm_domain_create,
-    .getdomaininfo                 = xsm_getdomaininfo,
-    .set_target                    = xsm_set_target,
-    .domctl                        = xsm_domctl,
-#ifdef CONFIG_SYSCTL
-    .sysctl                        = xsm_sysctl,
-#endif
 
-    .evtchn_unbound                = xsm_evtchn_unbound,
-    .evtchn_interdomain            = xsm_evtchn_interdomain,
-    .evtchn_close_post             = xsm_evtchn_close_post,
-    .evtchn_send                   = xsm_evtchn_send,
-    .evtchn_status                 = xsm_evtchn_status,
-    .evtchn_reset                  = xsm_evtchn_reset,
+#define XSM_HOOK0(rtype, name) .name = xsm_ ## name,
+#define XSM_HOOK1(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK2(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK3(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK4(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK5(rtype, name, ...) XSM_HOOK0(rtype, name)
 
-    .grant_mapref                  = xsm_grant_mapref,
-    .grant_unmapref                = xsm_grant_unmapref,
-    .grant_setup                   = xsm_grant_setup,
-    .grant_transfer                = xsm_grant_transfer,
-    .grant_copy                    = xsm_grant_copy,
-    .grant_query_size              = xsm_grant_query_size,
+#include <xsm/hooks.h>
+
+    .evtchn_close_post             = xsm_evtchn_close_post,
 
     .alloc_security_domain         = xsm_alloc_security_domain,
     .free_security_domain          = xsm_free_security_domain,
     .alloc_security_evtchns        = xsm_alloc_security_evtchns,
     .free_security_evtchns         = xsm_free_security_evtchns,
     .show_security_evtchn          = xsm_show_security_evtchn,
-    .init_hardware_domain          = xsm_init_hardware_domain,
-
-    .get_pod_target                = xsm_get_pod_target,
-    .set_pod_target                = xsm_set_pod_target,
-
-    .memory_exchange               = xsm_memory_exchange,
-    .memory_adjust_reservation     = xsm_memory_adjust_reservation,
-    .memory_stat_reservation       = xsm_memory_stat_reservation,
-    .memory_pin_page               = xsm_memory_pin_page,
-    .claim_pages                   = xsm_claim_pages,
-
-    .console_io                    = xsm_console_io,
-
-    .kexec                         = xsm_kexec,
-    .schedop_shutdown              = xsm_schedop_shutdown,
 
     .show_irq_sid                  = xsm_show_irq_sid,
-    .map_domain_pirq               = xsm_map_domain_pirq,
-    .map_domain_irq                = xsm_map_domain_irq,
-    .unmap_domain_pirq             = xsm_unmap_domain_pirq,
-    .unmap_domain_irq              = xsm_unmap_domain_irq,
-    .bind_pt_irq                   = xsm_bind_pt_irq,
-    .unbind_pt_irq                 = xsm_unbind_pt_irq,
-    .irq_permission                = xsm_irq_permission,
-    .iomem_permission              = xsm_iomem_permission,
-    .iomem_mapping                 = xsm_iomem_mapping,
-    .iomem_mapping_vpci            = xsm_iomem_mapping_vpci,
-    .pci_config_permission         = xsm_pci_config_permission,
-    .get_vnumainfo                 = xsm_get_vnumainfo,
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    .get_device_group              = xsm_get_device_group,
-#endif
-
-    .resource_plug_pci             = xsm_resource_plug_pci,
-    .resource_unplug_pci           = xsm_resource_unplug_pci,
-    .resource_setup_pci            = xsm_resource_setup_pci,
-    .resource_setup_gsi            = xsm_resource_setup_gsi,
-    .resource_setup_misc           = xsm_resource_setup_misc,
-
-    .hypfs_op                      = xsm_hypfs_op,
-    .hvm_param                     = xsm_hvm_param,
-    .hvm_param_altp2mhvm           = xsm_hvm_param_altp2mhvm,
-    .hvm_altp2mhvm_op              = xsm_hvm_altp2mhvm_op,
 
     .do_xsm_op                     = xsm_do_xsm_op,
 #ifdef CONFIG_COMPAT
     .do_compat_op                  = xsm_do_compat_op,
 #endif
 
-    .add_to_physmap                = xsm_add_to_physmap,
-    .remove_from_physmap           = xsm_remove_from_physmap,
-    .map_gmfn_foreign              = xsm_map_gmfn_foreign,
-
-#ifdef CONFIG_VM_EVENT
-    .mem_access                    = xsm_mem_access,
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    .mem_paging                    = xsm_mem_paging,
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    .mem_sharing                   = xsm_mem_sharing,
-#endif
-
-    .platform_op                   = xsm_platform_op,
-#ifdef CONFIG_X86
-    .do_mca                        = xsm_do_mca,
-    .mem_sharing_op                = xsm_mem_sharing_op,
-    .apic                          = xsm_apic,
-    .machine_memory_map            = xsm_machine_memory_map,
-    .domain_memory_map             = xsm_domain_memory_map,
-    .mmu_update                    = xsm_mmu_update,
-    .mmuext_op                     = xsm_mmuext_op,
-    .update_va_mapping             = xsm_update_va_mapping,
-    .priv_mapping                  = xsm_priv_mapping,
-    .ioport_permission             = xsm_ioport_permission,
-    .ioport_mapping                = xsm_ioport_mapping,
-    .pmu_op                        = xsm_pmu_op,
-#endif
-    .dm_op                         = xsm_dm_op,
-    .xen_version                   = xsm_xen_version,
-    .domain_resource_map           = xsm_domain_resource_map,
 #ifdef CONFIG_ARGO
     .argo_enable                   = xsm_argo_enable,
     .argo_register_single_source   = xsm_argo_register_single_source,
     .argo_register_any_source      = xsm_argo_register_any_source,
     .argo_send                     = xsm_argo_send,
 #endif
-    .get_domain_state              = xsm_get_domain_state,
 };
 
 void __init xsm_fixup_ops(struct xsm_ops *ops)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a6cef9d2a5..d7dac0dea3 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1215,6 +1215,7 @@ static int cf_check flask_iomem_mapping(struct domain *d, uint64_t start, uint64
 {
     return flask_iomem_permission(d, start, end, access);
 }
+#define flask_iomem_mapping_vpci flask_iomem_mapping
 
 static int cf_check flask_pci_config_permission(
     struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end,
@@ -1713,6 +1714,7 @@ static int cf_check flask_ioport_mapping(
     return flask_ioport_permission(d, start, end, access);
 }
 
+#ifdef CONFIG_MEM_SHARING
 static int cf_check flask_mem_sharing_op(
     struct domain *d, struct domain *cd, int op)
 {
@@ -1721,6 +1723,7 @@ static int cf_check flask_mem_sharing_op(
         return rc;
     return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
 }
+#endif
 
 static int cf_check flask_apic(struct domain *d, int cmd)
 {
@@ -1911,125 +1914,38 @@ static int cf_check flask_get_domain_state(struct domain *d)
 static const struct xsm_ops __initconst_cf_clobber flask_ops = {
     .set_system_active = flask_set_system_active,
     .security_domaininfo = flask_security_domaininfo,
-    .domain_create = flask_domain_create,
-    .getdomaininfo = flask_getdomaininfo,
-    .set_target = flask_set_target,
-    .domctl = flask_domctl,
-#ifdef CONFIG_SYSCTL
-    .sysctl = flask_sysctl,
-#endif
 
-    .evtchn_unbound = flask_evtchn_unbound,
-    .evtchn_interdomain = flask_evtchn_interdomain,
-    .evtchn_close_post = flask_evtchn_close_post,
-    .evtchn_send = flask_evtchn_send,
-    .evtchn_status = flask_evtchn_status,
-    .evtchn_reset = flask_evtchn_reset,
+#define XSM_HOOK0(rtype, name) .name = flask_ ## name,
+#define XSM_HOOK1(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK2(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK3(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK4(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK5(rtype, name, ...) XSM_HOOK0(rtype, name)
+
+#include <xsm/hooks.h>
 
-    .grant_mapref = flask_grant_mapref,
-    .grant_unmapref = flask_grant_unmapref,
-    .grant_setup = flask_grant_setup,
-    .grant_transfer = flask_grant_transfer,
-    .grant_copy = flask_grant_copy,
-    .grant_query_size = flask_grant_query_size,
+    .evtchn_close_post = flask_evtchn_close_post,
 
     .alloc_security_domain = flask_domain_alloc_security,
     .free_security_domain = flask_domain_free_security,
     .alloc_security_evtchns = flask_alloc_security_evtchns,
     .free_security_evtchns = flask_free_security_evtchns,
     .show_security_evtchn = flask_show_security_evtchn,
-    .init_hardware_domain = flask_init_hardware_domain,
-
-    .get_pod_target = flask_get_pod_target,
-    .set_pod_target = flask_set_pod_target,
-    .memory_exchange = flask_memory_exchange,
-    .memory_adjust_reservation = flask_memory_adjust_reservation,
-    .memory_stat_reservation = flask_memory_stat_reservation,
-    .memory_pin_page = flask_memory_pin_page,
-    .claim_pages = flask_claim_pages,
-
-    .console_io = flask_console_io,
-
-    .kexec = flask_kexec,
-    .schedop_shutdown = flask_schedop_shutdown,
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .map_domain_pirq = flask_map_domain_pirq,
-    .map_domain_irq = flask_map_domain_irq,
-    .unmap_domain_pirq = flask_unmap_domain_pirq,
-    .unmap_domain_irq = flask_unmap_domain_irq,
-    .bind_pt_irq = flask_bind_pt_irq,
-    .unbind_pt_irq = flask_unbind_pt_irq,
-    .irq_permission = flask_irq_permission,
-    .iomem_permission = flask_iomem_permission,
-    .iomem_mapping = flask_iomem_mapping,
-    .iomem_mapping_vpci = flask_iomem_mapping,
-    .pci_config_permission = flask_pci_config_permission,
-
-    .resource_plug_pci = flask_resource_plug_pci,
-    .resource_unplug_pci = flask_resource_unplug_pci,
-    .resource_setup_pci = flask_resource_setup_pci,
-    .resource_setup_gsi = flask_resource_setup_gsi,
-    .resource_setup_misc = flask_resource_setup_misc,
-
-    .hypfs_op = flask_hypfs_op,
-    .hvm_param = flask_hvm_param,
-    .hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,
-    .hvm_altp2mhvm_op = flask_hvm_altp2mhvm_op,
-
     .do_xsm_op = do_flask_op,
-    .get_vnumainfo = flask_get_vnumainfo,
-
-#ifdef CONFIG_VM_EVENT
-    .mem_access = flask_mem_access,
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    .mem_paging = flask_mem_paging,
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    .mem_sharing = flask_mem_sharing,
-#endif
 
 #ifdef CONFIG_COMPAT
     .do_compat_op = compat_flask_op,
 #endif
 
-    .add_to_physmap = flask_add_to_physmap,
-    .remove_from_physmap = flask_remove_from_physmap,
-    .map_gmfn_foreign = flask_map_gmfn_foreign,
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    .get_device_group = flask_get_device_group,
-#endif
-
-    .platform_op = flask_platform_op,
-#ifdef CONFIG_X86
-    .do_mca = flask_do_mca,
-    .mem_sharing_op = flask_mem_sharing_op,
-    .apic = flask_apic,
-    .machine_memory_map = flask_machine_memory_map,
-    .domain_memory_map = flask_domain_memory_map,
-    .mmu_update = flask_mmu_update,
-    .mmuext_op = flask_mmuext_op,
-    .update_va_mapping = flask_update_va_mapping,
-    .priv_mapping = flask_priv_mapping,
-    .ioport_permission = flask_ioport_permission,
-    .ioport_mapping = flask_ioport_mapping,
-    .pmu_op = flask_pmu_op,
-#endif
-    .dm_op = flask_dm_op,
-    .xen_version = flask_xen_version,
-    .domain_resource_map = flask_domain_resource_map,
 #ifdef CONFIG_ARGO
     .argo_enable = flask_argo_enable,
     .argo_register_single_source = flask_argo_register_single_source,
     .argo_register_any_source = flask_argo_register_any_source,
     .argo_send = flask_argo_send,
 #endif
-    .get_domain_state = flask_get_domain_state,
 };
 
 const struct xsm_ops *__init flask_init(
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381650.1625177 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqupo-0005ss-VM; Mon, 03 Aug 2026 15:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381650.1625177; Mon, 03 Aug 2026 15:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqupo-0005sk-SV; Mon, 03 Aug 2026 15:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1381650;
 Mon, 03 Aug 2026 15: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 1wqupn-0005sa-SZ
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 15: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 1wqupo-003Fhi-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqupn-002rck-2b
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CBq+tqUQ/Vf2HNIq80kexizSPG+o/t7hR66Diq8ENs4=; b=ek/5moCi0MtQi+meIwRyNhN1MP
	645SpFCtE2F+9JHDIB3JraxCejuuQJIcjGdfcbzbVHZ738ViBZRYdakRdCwCOb4c1wCHGslzE3KMo
	X/WaOEGVW6/AgSqgTUjBLhwVcNDGsfhdHNYNK8Dj1U0q6yyPwb3GaTKq3uiqSs80UTr4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .grant_*() hooks dependent upon GRANT_TABLE=y
Message-Id: <E1wqupn-002rck-2b@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:44:11 +0000

commit d1d1287764911f869e373703f53edc1b706edbbf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:32:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:32:25 2026 +0200

    XSM: make .grant_*() hooks dependent upon GRANT_TABLE=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 4 ++++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 4 ++++
 xen/xsm/silo.c          | 6 ++++++
 4 files changed, 16 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 50ef246467..d75285477d 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -191,6 +191,8 @@ static XSM_INLINE void cf_check xsm_free_security_domain(struct domain *d)
     return;
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static XSM_INLINE int cf_check xsm_grant_mapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -233,6 +235,8 @@ static XSM_INLINE int cf_check xsm_grant_query_size(
     return xsm_default_action(action, d1, d2);
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 static XSM_INLINE int cf_check xsm_memory_exchange(
     XSM_DEFAULT_ARG struct domain *d)
 {
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 87e357508d..8dbce67bd1 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -35,12 +35,14 @@ XSM_HOOK(int, evtchn_send, struct domain *, struct evtchn *)
 XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
 XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
 
+#ifdef CONFIG_GRANT_TABLE
 XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
 XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
 XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
 XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
 XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
 XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
+#endif
 
 XSM_HOOK(int, init_hardware_domain, struct domain *)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d7dac0dea3..d861b08d8b 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -434,6 +434,8 @@ static int cf_check flask_init_hardware_domain(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__CREATE_HARDWARE_DOMAIN);
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static int cf_check flask_grant_mapref(
     struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -470,6 +472,8 @@ static int cf_check flask_grant_query_size(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 static int cf_check flask_get_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
diff --git a/xen/xsm/silo.c b/xen/xsm/silo.c
index b89b364287..39f4f581a3 100644
--- a/xen/xsm/silo.c
+++ b/xen/xsm/silo.c
@@ -60,6 +60,8 @@ static int cf_check silo_evtchn_interdomain(
     return -EPERM;
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static int cf_check silo_grant_mapref(
     struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -82,6 +84,8 @@ static int cf_check silo_grant_copy(struct domain *d1, struct domain *d2)
     return -EPERM;
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 #ifdef CONFIG_ARGO
 
 static int cf_check silo_argo_register_single_source(
@@ -105,9 +109,11 @@ static int cf_check silo_argo_send(
 static const struct xsm_ops __initconst_cf_clobber silo_xsm_ops = {
     .evtchn_unbound = silo_evtchn_unbound,
     .evtchn_interdomain = silo_evtchn_interdomain,
+#ifdef CONFIG_GRANT_TABLE
     .grant_mapref = silo_grant_mapref,
     .grant_transfer = silo_grant_transfer,
     .grant_copy = silo_grant_copy,
+#endif
 #ifdef CONFIG_ARGO
     .argo_register_single_source = silo_argo_register_single_source,
     .argo_send = silo_argo_send,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381651.1625181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqupz-0005w6-0J; Mon, 03 Aug 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 1381651.1625181; Mon, 03 Aug 2026 15:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqupy-0005vy-Tx; Mon, 03 Aug 2026 15:44:22 +0000
Received: by outflank-mailman (input) for mailman id 1381651;
 Mon, 03 Aug 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 1wqupx-0005vs-V3
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 15:44:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqupy-003Fhm-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqupx-002rev-2u
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T2hjoLiWc/0HFwziXMz8BhCqpIeCfzY8vop6hpxVzb0=; b=oi1pqXpWvprOfMHvmYeYqa43zz
	/Ga9zdY1bXkcVgv6WeGoygM0UXx0b+Y9AnBVQXFHcWK3DSdVXqo5pzYUhXKetCqEygVCtsfhqEF5S
	fvpufGlN48cYewFWDSkTA9pMWw7luGLg3rtN+iRaDFvJE+uWuGPZGYiuY/nyd0QA++Gc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .{,un}map_domain_pirq() hooks dependent upon HAS_PIRQ=y
Message-Id: <E1wqupx-002rev-2u@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:44:21 +0000

commit 51eaa9d1a8ae392e6238b71efde61123c02ea89b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:32:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:32:44 2026 +0200

    XSM: make .{,un}map_domain_pirq() hooks dependent upon HAS_PIRQ=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 16 ++++++++++------
 xen/include/xsm/hooks.h |  5 ++++-
 xen/xsm/flask/hooks.c   | 14 +++++++++-----
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index d75285477d..8fb73d032c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -450,6 +450,8 @@ static XSM_INLINE char *cf_check xsm_show_irq_sid(int irq)
     return NULL;
 }
 
+#ifdef CONFIG_HAS_PIRQ
+
 static XSM_INLINE int cf_check xsm_map_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
@@ -457,17 +459,19 @@ static XSM_INLINE int cf_check xsm_map_domain_pirq(
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_map_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
+static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
+    XSM_DEFAULT_ARG struct domain *d)
 {
-    XSM_ASSERT_ACTION(XSM_HOOK);
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
-    XSM_DEFAULT_ARG struct domain *d)
+#endif /* CONFIG_HAS_PIRQ */
+
+static XSM_INLINE int cf_check xsm_map_domain_irq(
+    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
-    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 8dbce67bd1..97b0d95169 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -65,9 +65,12 @@ XSM_HOOK(int, kexec)
 
 XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
 
+#ifdef CONFIG_HAS_PIRQ
 XSM_HOOK(int, map_domain_pirq, struct domain *)
-XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+#endif
+
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d861b08d8b..bd9d9e1bcf 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1018,11 +1018,20 @@ static char *cf_check flask_show_irq_sid(int irq)
     return ctx;
 }
 
+#ifdef CONFIG_HAS_PIRQ
+
 static int cf_check flask_map_domain_pirq(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
 }
 
+static int cf_check flask_unmap_domain_pirq(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+}
+
+#endif /* CONFIG_HAS_PIRQ */
+
 static int flask_map_domain_msi (
     struct domain *d, int irq, const void *data, uint32_t *sid,
     struct avc_audit_data *ad)
@@ -1085,11 +1094,6 @@ static int cf_check flask_map_domain_irq(
     return rc;
 }
 
-static int cf_check flask_unmap_domain_pirq(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
-}
-
 static int flask_unmap_domain_msi (
     struct domain *d, int irq, const void *data, uint32_t *sid,
     struct avc_audit_data *ad)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381652.1625184 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquq9-0005zb-1X; Mon, 03 Aug 2026 15:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381652.1625184; Mon, 03 Aug 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 1wquq8-0005zT-VG; Mon, 03 Aug 2026 15:44:32 +0000
Received: by outflank-mailman (input) for mailman id 1381652;
 Mon, 03 Aug 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 1wquq8-0005zN-2O
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 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 1wquq8-003Fhq-0v
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquq7-002rh0-3C
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E6XafYHVMkCzKQA8mgMW+tPcRDkPwkuNQ6+ICJqXG34=; b=VX9dwqXIqNGrJFZhi3H9SYi34e
	lo0mNq7lnid6Anfg9ZKyYSvzVG8ZNxNQg76UYLlw1nuYBjTFjeNNPGFefVbJmDA6pvauZbybJVbVA
	UykwJCguxflKdhjRm7pjP4ob5fgjSd+zep5eKg5n8wil/0afc6M2ayC9ISQqgDHLmqUo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make PCI hooks dependent upon HAS_PCI=y
Message-Id: <E1wquq7-002rh0-3C@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:44:31 +0000

commit d9605dee5cb20e7f833d5f26730faec82b206764
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:34:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:34:32 2026 +0200

    XSM: make PCI hooks dependent upon HAS_PCI=y
    
    They're unreachable / dead otherwise. Really resource_{,un}plug_pci() is
    further limited to PCI pass-through.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 10 ++++++++++
 xen/include/xsm/hooks.h | 13 ++++++++-----
 xen/xsm/flask/hooks.c   | 10 ++++++++++
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 8fb73d032c..b777c2eb47 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -394,6 +394,8 @@ static XSM_INLINE int cf_check xsm_get_device_group(
 }
 #endif /* HAS_PASSTHROUGH && HAS_PCI */
 
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+
 static XSM_INLINE int cf_check xsm_resource_plug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
@@ -408,6 +410,10 @@ static XSM_INLINE int cf_check xsm_resource_unplug_pci(
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_PCI */
+
+#ifdef CONFIG_HAS_PCI
+
 static XSM_INLINE int cf_check xsm_resource_setup_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
@@ -421,6 +427,8 @@ static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#endif /* CONFIG_HAS_PCI */
+
 static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -524,6 +532,7 @@ static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_HAS_PCI
 static XSM_INLINE int cf_check xsm_pci_config_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf, uint16_t start,
     uint16_t end, uint8_t access)
@@ -531,6 +540,7 @@ static XSM_INLINE int cf_check xsm_pci_config_permission(
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
+#endif /* CONFIG_HAS_PCI */
 
 static XSM_INLINE int cf_check xsm_add_to_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 97b0d95169..1ca935a43d 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -77,21 +77,24 @@ XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 
 XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
 XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
-XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
-                                     uint16_t, uint8_t)
 
 XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
 XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+XSM_HOOK(int, resource_plug_pci, uint32_t)
+XSM_HOOK(int, resource_unplug_pci, uint32_t)
 XSM_HOOK(int, get_device_group, uint32_t)
 #endif
 
-XSM_HOOK(int, resource_plug_pci, uint32_t)
-XSM_HOOK(int, resource_unplug_pci, uint32_t)
+XSM_HOOK(int, resource_setup_misc)
+
+#ifdef CONFIG_HAS_PCI
 XSM_HOOK(int, resource_setup_pci, uint32_t)
 XSM_HOOK(int, resource_setup_gsi, int)
-XSM_HOOK(int, resource_setup_misc)
+XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
+                                     uint16_t, uint8_t)
+#endif
 
 XSM_HOOK(int, hypfs_op)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index bd9d9e1bcf..8b1834ca0a 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1225,6 +1225,7 @@ static int cf_check flask_iomem_mapping(struct domain *d, uint64_t start, uint64
 }
 #define flask_iomem_mapping_vpci flask_iomem_mapping
 
+#ifdef CONFIG_HAS_PCI
 static int cf_check flask_pci_config_permission(
     struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end,
     uint8_t access)
@@ -1250,6 +1251,7 @@ static int cf_check flask_pci_config_permission(
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, perm, &ad);
 
 }
+#endif /* CONFIG_HAS_PCI */
 
 #if defined(CONFIG_SYSCTL) || defined(CONFIG_X86)
 static int flask_resource_plug_core(void)
@@ -1270,6 +1272,8 @@ static int flask_resource_use_core(void)
 }
 #endif /* CONFIG_SYSCTL */
 
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+
 static int cf_check flask_resource_plug_pci(uint32_t machine_bdf)
 {
     uint32_t rsid;
@@ -1300,6 +1304,10 @@ static int cf_check flask_resource_unplug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_PCI */
+
+#ifdef CONFIG_HAS_PCI
+
 static int cf_check flask_resource_setup_pci(uint32_t machine_bdf)
 {
     uint32_t rsid;
@@ -1328,6 +1336,8 @@ static int cf_check flask_resource_setup_gsi(int gsi)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
+#endif /* CONFIG_HAS_PCI */
+
 static int cf_check flask_resource_setup_misc(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381653.1625189 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqJ-00062f-2q; Mon, 03 Aug 2026 15:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381653.1625189; Mon, 03 Aug 2026 15: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 1wquqJ-00062Y-0J; Mon, 03 Aug 2026 15:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1381653;
 Mon, 03 Aug 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 1wquqI-00062R-4p
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 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 1wquqI-003Fhu-1C
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquqI-002rii-0G
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 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=i0YLT+M6comZDMiItctJWrhf96SKxPQ2fC3nHNWJhKU=; b=FVKXjLDRZ+DwlfZ/qLh5SG6/VK
	GIdX4l0nief4VUIzgrPF1wpWWnGkoYdzn+ZDyAeHGUTRM1Mp/YvZ5KdcJ3lUovOSzL0Le70hKGYoR
	j5eO2niSxAPNwjrz9nDsG3T1WHLXYheH540wxwCkEgcTEISijaBJtAP4/qHoGBwxIaYA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .iomem_mapping_vpci() hook dependent upon HAS_VPCI=y
Message-Id: <E1wquqI-002rii-0G@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:44:42 +0000

commit 7a01c8179cc08840e1d6ce853eda8af685392068
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:34:50 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:34:50 2026 +0200

    XSM: make .iomem_mapping_vpci() hook dependent upon HAS_VPCI=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index b777c2eb47..7cedad01eb 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -525,12 +525,14 @@ static XSM_INLINE int cf_check xsm_iomem_mapping(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_HAS_VPCI
 static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
+#endif
 
 #ifdef CONFIG_HAS_PCI
 static XSM_INLINE int cf_check xsm_pci_config_permission(
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 1ca935a43d..e85c035f66 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -79,7 +79,9 @@ XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
 XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
 
 XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
+#ifdef CONFIG_HAS_VPCI
 XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
+#endif
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
 XSM_HOOK(int, resource_plug_pci, uint32_t)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:44:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381654.1625192 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqT-00064x-4Q; Mon, 03 Aug 2026 15:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381654.1625192; Mon, 03 Aug 2026 15: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 1wquqT-00064o-1m; Mon, 03 Aug 2026 15:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1381654;
 Mon, 03 Aug 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 1wquqS-00064h-7Z
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 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 1wquqS-003Fi4-1U
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquqS-002rkn-0Y
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 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=ZNh+KfpbN0FGSLA4e+NlpA1XCcBtnJzm/UJ5jyYOdFQ=; b=Nva3yO2HAJKc29ndZWpdB0LcrW
	bTT+UdpWgDNM270gasaTk0IcZIo94oKu/MYo54PnL38fSo4R/XWuqHoJiTQyNoWkI2CjHPBqJuFJJ
	F/DRfWVEBZCtqgM/dkUTSBwtrw5I3wKMHxHZoatSUyD0+bF+hSomarAk0Ez43/uOxsvI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .kexec() hook dependent upon KEXEC=y
Message-Id: <E1wquqS-002rkn-0Y@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:44:52 +0000

commit 430673b8455ea56f533991f52abcbea721843482
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:35:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:35:12 2026 +0200

    XSM: make .kexec() hook dependent upon KEXEC=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 7cedad01eb..4fe12f3c85 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -271,11 +271,13 @@ static XSM_INLINE int cf_check xsm_console_io(
     return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
+#ifdef CONFIG_KEXEC
 static XSM_INLINE int cf_check xsm_kexec(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
+#endif
 
 static XSM_INLINE int cf_check xsm_schedop_shutdown(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index e85c035f66..41c12c9306 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -61,7 +61,9 @@ XSM_HOOK(int, claim_pages, struct domain *)
 
 XSM_HOOK(int, console_io, struct domain *, int)
 
+#ifdef CONFIG_KEXEC
 XSM_HOOK(int, kexec)
+#endif
 
 XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 8b1834ca0a..1656ac8f3c 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -536,10 +536,12 @@ static int cf_check flask_console_io(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
+#ifdef CONFIG_KEXEC
 static int cf_check flask_kexec(void)
 {
     return domain_has_xen(current->domain, XEN__KEXEC);
 }
+#endif
 
 static int cf_check flask_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:45:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381655.1625197 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqd-00066p-5i; Mon, 03 Aug 2026 15:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381655.1625197; Mon, 03 Aug 2026 15:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqd-00066h-36; Mon, 03 Aug 2026 15:45:03 +0000
Received: by outflank-mailman (input) for mailman id 1381655;
 Mon, 03 Aug 2026 15: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 1wquqc-00066b-AS
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 15: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 1wquqc-003Fip-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquqc-002rn2-0q
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15: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=ypbmxa/lUDbEPPWh1asjDST8Ddz2TMIqK/kZHai/9GA=; b=y+thBFeEUHrqfqFpVE2ZC07Ffp
	9GdWcNFZY4gvcBvNt2FYov5ol/Zddn7aEg449VLQp+xbkzzVFhObaE5/ZiZsBDHdKKQJQrPkKOiX1
	GB23PH6JURIHVwtWQlfoElSRJImBEJBwWyY9QJS3vPGv3S7qij45jriTYojEVvhTLEF0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .hypfs() hook dependent upon HYPFS=y
Message-Id: <E1wquqc-002rn2-0q@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:45:02 +0000

commit dd60120e2a0f95ff31bd662922d22747a3c53dcc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:35:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:35:32 2026 +0200

    XSM: make .hypfs() hook dependent upon HYPFS=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 4fe12f3c85..f000d1f60a 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -437,11 +437,13 @@ static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#ifdef CONFIG_HYPFS
 static XSM_INLINE int cf_check xsm_hypfs_op(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
+#endif
 
 static XSM_INLINE long cf_check xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 41c12c9306..c309a7ca43 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -100,7 +100,9 @@ XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
                                      uint16_t, uint8_t)
 #endif
 
+#ifdef CONFIG_HYPFS
 XSM_HOOK(int, hypfs_op)
+#endif
 
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 1656ac8f3c..f6675cb298 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1345,10 +1345,12 @@ static int cf_check flask_resource_setup_misc(void)
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
+#ifdef CONFIG_HYPFS
 static inline int cf_check flask_hypfs_op(void)
 {
     return domain_has_xen(current->domain, XEN__HYPFS_OP);
 }
+#endif
 
 static int cf_check flask_add_to_physmap(struct domain *d1, struct domain *d2)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:45:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381656.1625202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqn-00069E-8a; Mon, 03 Aug 2026 15:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381656.1625202; Mon, 03 Aug 2026 15:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqn-000695-5a; Mon, 03 Aug 2026 15:45:13 +0000
Received: by outflank-mailman (input) for mailman id 1381656;
 Mon, 03 Aug 2026 15:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wquqm-00068z-DO
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 15:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquqm-003Fit-22
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquqm-002rpZ-17
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/Ytsc5/U8LuyP+1xEuZe/h+wSufmDfLFc3MT+XxRb1M=; b=nZtSwGvlSXckGUIUs3+vXN0plb
	NBvk1HN9IGju4yBPxRZygV42oGGbfcHinR8k34IiqQptQzx9ukKKEYy9rNFq36ZG41STAVe4rWpbf
	oggfEtCF9EwFYqa+Cd3nbQ/n3Q585zXt+ML7s76roSFR5+sxZGlP1ks39Y8Nl9d3vkVc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .hvm_altp2mhvm_op() hook dependent upon ALTP2M=y
Message-Id: <E1wquqm-002rpZ-17@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:45:12 +0000

commit 754ae0860a125d6f8b6bff498d05d556dbe8629f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:35:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:35:54 2026 +0200

    XSM: make .hvm_altp2mhvm_op() hook dependent upon ALTP2M=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 4 ++++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f000d1f60a..47a704c01e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -583,6 +583,7 @@ static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_ALTP2M
 static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
 {
@@ -602,6 +603,7 @@ static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
         return -EPERM;
     }
 }
+#endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
 static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index c309a7ca43..117640f95b 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -106,7 +106,11 @@ XSM_HOOK(int, hypfs_op)
 
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+
+#ifdef CONFIG_ALTP2M
 XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
+#endif
+
 XSM_HOOK(int, get_vnumainfo, struct domain *)
 
 #ifdef CONFIG_VM_EVENT
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f6675cb298..789e815377 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1393,6 +1393,7 @@ static int cf_check flask_hvm_param_altp2mhvm(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
 }
 
+#ifdef CONFIG_ALTP2M
 static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op)
 {
     /*
@@ -1416,6 +1417,7 @@ static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint
 
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM_OP);
 }
+#endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
 static int cf_check flask_mem_access(struct domain *d)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:45:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:45:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381657.1625205 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqx-0006B6-9Y; Mon, 03 Aug 2026 15:45:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381657.1625205; Mon, 03 Aug 2026 15:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wquqx-0006Az-6s; Mon, 03 Aug 2026 15:45:23 +0000
Received: by outflank-mailman (input) for mailman id 1381657;
 Mon, 03 Aug 2026 15:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wquqw-0006At-Fo
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 15:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquqw-003Fj3-2K
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wquqw-002rsp-1O
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HDkNYXj/+8/72hZOjt1BipbpZCaSFKKddnVKKChrejw=; b=hZBLdjan+TF/7u38SOHzCmdGsY
	2x1UlHAWe9SBZMaYBQcBfWX8q71fwgrI8F8Qf0I6EYmCDlt/PkdrWIxd/JJ23Q0QMd27LZROt1o6T
	K9OT9lgtSBTmYGthgEeZ6ASoQZCaIbiPDKkqFSuhFOeC7R2OEGa4Vt0CGkH6UhpHRt+w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .hvm_param*() hooks dependent upon HVM=y
Message-Id: <E1wquqw-002rsp-1O@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:45:22 +0000

commit 29df230854b5775f845127360d6c1b0de86b51eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:36:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:36:13 2026 +0200

    XSM: make .hvm_param*() hooks dependent upon HVM=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 4 ++++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 47a704c01e..773666a778 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -569,6 +569,8 @@ static XSM_INLINE int cf_check xsm_map_gmfn_foreign(
     return xsm_default_action(action, d, t);
 }
 
+#ifdef CONFIG_HVM
+
 static XSM_INLINE int cf_check xsm_hvm_param(
     XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
@@ -583,6 +585,8 @@ static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
     return xsm_default_action(action, current->domain, d);
 }
 
+#endif /* CONFIG_HVM */
+
 #ifdef CONFIG_ALTP2M
 static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 117640f95b..54e91497b8 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -104,8 +104,10 @@ XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
 XSM_HOOK(int, hypfs_op)
 #endif
 
+#ifdef CONFIG_HVM
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+#endif
 
 #ifdef CONFIG_ALTP2M
 XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 789e815377..2e27dc2b8a 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1368,6 +1368,8 @@ static int cf_check flask_map_gmfn_foreign(struct domain *d, struct domain *t)
     return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
 }
 
+#ifdef CONFIG_HVM
+
 static int cf_check flask_hvm_param(struct domain *d, unsigned long op)
 {
     uint32_t perm;
@@ -1393,6 +1395,8 @@ static int cf_check flask_hvm_param_altp2mhvm(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
 }
 
+#endif /* CONFIG_HVM */
+
 #ifdef CONFIG_ALTP2M
 static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:45:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381658.1625209 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqur7-0006Cz-B6; Mon, 03 Aug 2026 15:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381658.1625209; Mon, 03 Aug 2026 15:45:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqur7-0006Cs-8U; Mon, 03 Aug 2026 15:45:33 +0000
Received: by outflank-mailman (input) for mailman id 1381658;
 Mon, 03 Aug 2026 15:45: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 1wqur6-0006Cm-If
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 15:45:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqur6-003Fj7-2a
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqur6-002rv8-1g
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=htIfPRcMPfoj5H76OH8tI7xxORb0dc900c5ZR3Qi7oU=; b=1EuDiz/0V0vFmu3s4Ir5slpdVJ
	YMfrVNjlD7cGMviqSrv0XLvHRCM+hhw9bvQBPkC0iBWKTzyOjojhYOp05zCLpbW+JmfcrB9A/5x3L
	9MKFPVJ0RqaXt2tLlmyiVOLUMvoIsY+Zf8jumnAHgCXPDZ5kmwNi59MdyK1ZVlN2P/Fk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make .dm_op() hook dependent upon IOREQ_SERVER=y
Message-Id: <E1wqur6-002rv8-1g@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:45:32 +0000

commit 7d15b10f6c9c870e88017b54239a590ec22e173c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:36:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:36:34 2026 +0200

    XSM: make .dm_op() hook dependent upon IOREQ_SERVER=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 3 +++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 773666a778..fb339120bb 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -739,11 +739,13 @@ static XSM_INLINE int cf_check xsm_pmu_op(
 
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
+#endif
 
 #ifdef CONFIG_ARGO
 static XSM_INLINE int cf_check xsm_argo_enable(const struct domain *d)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 54e91497b8..dd5627c901 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -145,7 +145,10 @@ XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
 XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 XSM_HOOK(int, dm_op, struct domain *)
+#endif
+
 XSM_HOOK(int, xen_version, uint32_t)
 XSM_HOOK(int, domain_resource_map, struct domain *)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 2e27dc2b8a..5de7139da0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1852,10 +1852,12 @@ static int cf_check flask_pmu_op(struct domain *d, unsigned int op)
 }
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 static int cf_check flask_dm_op(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__DM);
 }
+#endif
 
 static int cf_check flask_xen_version(uint32_t op)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 15:45:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 15:45:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381660.1625213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqurH-0006F0-CY; Mon, 03 Aug 2026 15:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381660.1625213; Mon, 03 Aug 2026 15:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqurH-0006Es-9y; Mon, 03 Aug 2026 15:45:43 +0000
Received: by outflank-mailman (input) for mailman id 1381660;
 Mon, 03 Aug 2026 15:45: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 1wqurG-0006Em-LS
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 15:45: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 1wqurG-003FjE-2s
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqurG-002rxG-1x
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 15:45:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qWQEpBzho8L4q9XFskP3hVMGi9nAe6Pe65A8fbCbs5A=; b=HrvqrSeAHP31fLNABWeL4Xt+Aj
	jwUl4gewE4rdWlVpTS1DuPbPoBwfNBNaJPZIqwqBoMKqaqNJnWk2EEve+IJzDhlvUgJy/m9+GpJkd
	J/xkNuFTVXVQBiYnvyIYZCKc0rCIss4GL0E/bqc0g98fAbJsCGJTUgdGbfnMiU2nEA9E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make certain x86-specific hooks dependent upon PV=y
Message-Id: <E1wqurG-002rxG-1x@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 15:45:42 +0000

commit 5b965555b17f7b5e662323ceaf07548eff6d3867
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:36:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:36:54 2026 +0200

    XSM: make certain x86-specific hooks dependent upon PV=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 15 ++++++++++-----
 xen/include/xsm/hooks.h |  4 +++-
 xen/xsm/flask/hooks.c   | 13 +++++++++----
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fb339120bb..131631cb27 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -640,11 +640,6 @@ static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, NULL);
-}
 
 static XSM_INLINE int cf_check xsm_mem_sharing_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
@@ -673,6 +668,14 @@ static XSM_INLINE int cf_check xsm_domain_memory_map(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_PV
+
+static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
+}
+
 static XSM_INLINE int cf_check xsm_mmu_update(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t, struct domain *f,
     uint32_t flags)
@@ -700,6 +703,8 @@ static XSM_INLINE int cf_check xsm_update_va_mapping(
     return xsm_default_action(action, d, f);
 }
 
+#endif /* CONFIG_PV */
+
 static XSM_INLINE int cf_check xsm_priv_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index dd5627c901..5bdb23f26d 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -131,14 +131,16 @@ XSM_HOOK(int, mem_sharing_op, struct domain *, struct domain *, int)
 XSM_HOOK(int, platform_op, uint32_t)
 
 #ifdef CONFIG_X86
-XSM_HOOK(int, do_mca)
 XSM_HOOK(int, apic, struct domain *, int)
 XSM_HOOK(int, machine_memory_map)
 XSM_HOOK(int, domain_memory_map, struct domain *)
+#ifdef CONFIG_PV
+XSM_HOOK(int, do_mca)
 XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
                           uint32_t)
 XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
 XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
+#endif /* CONFIG_PV */
 XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
 XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
 XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 5de7139da0..3cfdf6bf08 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1654,10 +1654,6 @@ static int cf_check flask_platform_op(uint32_t op)
 }
 
 #ifdef CONFIG_X86
-static int cf_check flask_do_mca(void)
-{
-    return domain_has_xen(current->domain, XEN__MCA_OP);
-}
 
 static int flask_shadow_control(struct domain *d, unsigned int op)
 {
@@ -1783,6 +1779,13 @@ static int cf_check flask_domain_memory_map(struct domain *d)
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
+#ifdef CONFIG_PV
+
+static int cf_check flask_do_mca(void)
+{
+    return domain_has_xen(current->domain, XEN__MCA_OP);
+}
+
 static int cf_check flask_mmu_update(
     struct domain *d, struct domain *t, struct domain *f, uint32_t flags)
 {
@@ -1823,6 +1826,8 @@ static int cf_check flask_update_va_mapping(
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
+#endif /* CONFIG_PV */
+
 static int cf_check flask_priv_mapping(struct domain *d, struct domain *t)
 {
     return domain_has_perm(d, t, SECCLASS_MMU, MMU__TARGET_HACK);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381699.1625226 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvb5-0007Ai-UB; Mon, 03 Aug 2026 16:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381699.1625226; Mon, 03 Aug 2026 16:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvb5-0007Aa-R5; Mon, 03 Aug 2026 16:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1381699;
 Mon, 03 Aug 2026 16:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvb4-00079P-Mn
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvb4-003H5o-2Z
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvb4-0031bI-1Z
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gLwDBRatRh2ATX2CTaUOekYrphqjtPOZhjyWf7D7FlE=; b=XtEwqYqV/ksjYf3R3jLvh7KfOT
	1fyPRMu2gB9EObwjAGXcgmarHlykfuRmthKVTQznRb82+u0J+NgZnQgLaS3VvOcun+LWE2qpMhZpH
	uOMlczcMCLRixIz1wWiOjwQYZDYY5Noxbx7kBcQDAJQ9tHe5SjWkFhl85VIQ0BlqgYJg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: reduce redundancy in hook machinery
Message-Id: <E1wqvb4-0031bI-1Z@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:33:02 +0000

commit 813a62811fc6c84b2e8d597c75406cc55776d997
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 14:22:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 14:22:22 2026 +0200

    XSM: reduce redundancy in hook machinery
    
    Hook definition (in struct xsm_ops), wrappers, dummy_ops, and flask_ops
    need keeping in sync (including any involved #ifdef-ary), i.e. require
    consistent adjustments in multiple places when a change is necessary.
    Reduce this by introducing a multi-use helper header file. (However,
    hooks not taking xsm_default_t as first argument in the wrappers aren't
    covered.)
    
    As there's some re-arrangement of field order in struct xsm_ops anyway,
    also group together everything depending on SYSCTL=y. Similarly move
    .mem_sharing_op() into the MEM_SHARING conditional.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/hooks.h | 137 ++++++++++++
 xen/include/xsm/xsm.h   | 568 +++++-------------------------------------------
 xen/xsm/dummy.c         | 105 +--------
 xen/xsm/flask/hooks.c   | 108 +--------
 4 files changed, 211 insertions(+), 707 deletions(-)

diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
new file mode 100644
index 0000000000..87e357508d
--- /dev/null
+++ b/xen/include/xsm/hooks.h
@@ -0,0 +1,137 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/* This file is intended to be included multiple times. */
+
+#ifndef XSM_HOOK
+
+#include <xen/macros.h>
+
+#define XSM_HOOK__(rtype, name, nargs, types...) \
+    XSM_HOOK ## nargs(rtype, name, ## types)
+
+#define XSM_HOOK_(rtype, name, nargs, types...) \
+    XSM_HOOK__(rtype, name, nargs, ## types)
+
+#define XSM_HOOK(rtype, name, types...) \
+    XSM_HOOK_(rtype, name, count_args(types), ## types)
+
+#endif /* XSM_HOOK */
+
+XSM_HOOK(int, domain_create, struct domain *, uint32_t)
+XSM_HOOK(int, getdomaininfo, struct domain *)
+XSM_HOOK(int, get_domain_state, struct domain *)
+
+#ifdef CONFIG_SYSCTL
+XSM_HOOK(int, sysctl, const struct xen_sysctl *)
+#endif
+
+XSM_HOOK(int, set_target, struct domain *, struct domain *)
+XSM_HOOK(int, domctl, struct domain *, struct xen_domctl *)
+
+XSM_HOOK(int, evtchn_unbound, struct domain *, struct evtchn *, domid_t)
+XSM_HOOK(int, evtchn_interdomain, struct domain *, struct evtchn *,
+                                  struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_send, struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
+
+XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
+XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
+XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
+XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
+XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
+XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
+
+XSM_HOOK(int, init_hardware_domain, struct domain *)
+
+XSM_HOOK(int, get_pod_target, struct domain *)
+XSM_HOOK(int, set_pod_target, struct domain *)
+
+XSM_HOOK(int, memory_exchange, struct domain *)
+XSM_HOOK(int, memory_adjust_reservation, struct domain *, struct domain *)
+XSM_HOOK(int, memory_stat_reservation, struct domain *, struct domain *)
+XSM_HOOK(int, memory_pin_page, struct domain *, struct domain *,
+                               struct page_info *)
+XSM_HOOK(int, add_to_physmap, struct domain *, struct domain *)
+XSM_HOOK(int, remove_from_physmap, struct domain *, struct domain *)
+XSM_HOOK(int, map_gmfn_foreign, struct domain *, struct domain *)
+XSM_HOOK(int, claim_pages, struct domain *)
+
+XSM_HOOK(int, console_io, struct domain *, int)
+
+XSM_HOOK(int, kexec)
+
+XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
+
+XSM_HOOK(int, map_domain_pirq, struct domain *)
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
+XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
+XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
+XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
+
+XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
+XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
+                                     uint16_t, uint8_t)
+
+XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
+
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+XSM_HOOK(int, get_device_group, uint32_t)
+#endif
+
+XSM_HOOK(int, resource_plug_pci, uint32_t)
+XSM_HOOK(int, resource_unplug_pci, uint32_t)
+XSM_HOOK(int, resource_setup_pci, uint32_t)
+XSM_HOOK(int, resource_setup_gsi, int)
+XSM_HOOK(int, resource_setup_misc)
+
+XSM_HOOK(int, hypfs_op)
+
+XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
+XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
+XSM_HOOK(int, get_vnumainfo, struct domain *)
+
+#ifdef CONFIG_VM_EVENT
+XSM_HOOK(int, mem_access, struct domain *)
+#endif
+
+#ifdef CONFIG_MEM_PAGING
+XSM_HOOK(int, mem_paging, struct domain *)
+#endif
+
+#ifdef CONFIG_MEM_SHARING
+XSM_HOOK(int, mem_sharing, struct domain *)
+XSM_HOOK(int, mem_sharing_op, struct domain *, struct domain *, int)
+#endif
+
+XSM_HOOK(int, platform_op, uint32_t)
+
+#ifdef CONFIG_X86
+XSM_HOOK(int, do_mca)
+XSM_HOOK(int, apic, struct domain *, int)
+XSM_HOOK(int, machine_memory_map)
+XSM_HOOK(int, domain_memory_map, struct domain *)
+XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
+                          uint32_t)
+XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
+XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
+XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
+XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
+XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
+XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
+#endif /* CONFIG_X86 */
+
+XSM_HOOK(int, dm_op, struct domain *)
+XSM_HOOK(int, xen_version, uint32_t)
+XSM_HOOK(int, domain_resource_map, struct domain *)
+
+#undef XSM_HOOK0
+#undef XSM_HOOK1
+#undef XSM_HOOK2
+#undef XSM_HOOK3
+#undef XSM_HOOK4
+#undef XSM_HOOK5
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 852eac7d20..53c722f868 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,6 +41,13 @@ enum xsm_default {
 };
 typedef enum xsm_default xsm_default_t;
 
+#ifdef CONFIG_X86
+#define XSM_MMU_UPDATE_READ      1
+#define XSM_MMU_UPDATE_WRITE     2
+#define XSM_MMU_NORMAL_UPDATE    4
+#define XSM_MMU_MACHPHYS_UPDATE  8
+#endif /* CONFIG_X86 */
+
 /*
  * !!! WARNING !!!
  *
@@ -54,131 +61,36 @@ struct xsm_ops {
     int (*set_system_active)(void);
     void (*security_domaininfo)(struct domain *d,
                                 struct xen_domctl_getdomaininfo *info);
-    int (*domain_create)(struct domain *d, uint32_t ssidref);
-    int (*getdomaininfo)(struct domain *d);
-    int (*set_target)(struct domain *d, struct domain *e);
-    int (*domctl)(struct domain *d, struct xen_domctl *op);
-#ifdef CONFIG_SYSCTL
-    int (*sysctl)(const struct xen_sysctl *op);
-#endif
 
-    int (*evtchn_unbound)(struct domain *d, struct evtchn *chn, domid_t id2);
-    int (*evtchn_interdomain)(struct domain *d1, struct evtchn *chn1,
-                              struct domain *d2, struct evtchn *chn2);
-    void (*evtchn_close_post)(struct evtchn *chn);
-    int (*evtchn_send)(struct domain *d, struct evtchn *chn);
-    int (*evtchn_status)(struct domain *d, struct evtchn *chn);
-    int (*evtchn_reset)(struct domain *d1, struct domain *d2);
+#define XSM_HOOK0(rtype, name) rtype (*name)(void);
+#define XSM_HOOK1(rtype, name, type1) \
+    rtype (*name)(type1 arg1);
+#define XSM_HOOK2(rtype, name, type1, type2) \
+    rtype (*name)(type1 arg1, type2 arg2);
+#define XSM_HOOK3(rtype, name, type1, type2, type3) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3);
+#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4);
+#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5);
+
+#include "hooks.h"
 
-    int (*grant_mapref)(struct domain *d1, struct domain *d2, uint32_t flags);
-    int (*grant_unmapref)(struct domain *d1, struct domain *d2);
-    int (*grant_setup)(struct domain *d1, struct domain *d2);
-    int (*grant_transfer)(struct domain *d1, struct domain *d2);
-    int (*grant_copy)(struct domain *d1, struct domain *d2);
-    int (*grant_query_size)(struct domain *d1, struct domain *d2);
+    void (*evtchn_close_post)(struct evtchn *chn);
 
     int (*alloc_security_domain)(struct domain *d);
     void (*free_security_domain)(struct domain *d);
     int (*alloc_security_evtchns)(struct evtchn chn[], unsigned int nr);
     void (*free_security_evtchns)(struct evtchn chn[], unsigned int nr);
     char *(*show_security_evtchn)(struct domain *d, const struct evtchn *chn);
-    int (*init_hardware_domain)(struct domain *d);
-
-    int (*get_pod_target)(struct domain *d);
-    int (*set_pod_target)(struct domain *d);
-    int (*memory_exchange)(struct domain *d);
-    int (*memory_adjust_reservation)(struct domain *d1, struct domain *d2);
-    int (*memory_stat_reservation)(struct domain *d1, struct domain *d2);
-    int (*memory_pin_page)(struct domain *d1, struct domain *d2,
-                           struct page_info *page);
-    int (*add_to_physmap)(struct domain *d1, struct domain *d2);
-    int (*remove_from_physmap)(struct domain *d1, struct domain *d2);
-    int (*map_gmfn_foreign)(struct domain *d, struct domain *t);
-    int (*claim_pages)(struct domain *d);
-
-    int (*console_io)(struct domain *d, int cmd);
-
-    int (*kexec)(void);
-    int (*schedop_shutdown)(struct domain *d1, struct domain *d2);
 
     char *(*show_irq_sid)(int irq);
-    int (*map_domain_pirq)(struct domain *d);
-    int (*map_domain_irq)(struct domain *d, int irq, const void *data);
-    int (*unmap_domain_pirq)(struct domain *d);
-    int (*unmap_domain_irq)(struct domain *d, int irq, const void *data);
-    int (*bind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*irq_permission)(struct domain *d, int pirq, uint8_t allow);
-    int (*iomem_permission)(struct domain *d, uint64_t s, uint64_t e,
-                            uint8_t allow);
-    int (*iomem_mapping)(struct domain *d, uint64_t s, uint64_t e,
-                         uint8_t allow);
-    int (*iomem_mapping_vpci)(struct domain *d, uint64_t s, uint64_t e,
-                              uint8_t allow);
-    int (*pci_config_permission)(struct domain *d, uint32_t machine_bdf,
-                                 uint16_t start, uint16_t end, uint8_t access);
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    int (*get_device_group)(uint32_t machine_bdf);
-#endif
-
-    int (*resource_plug_pci)(uint32_t machine_bdf);
-    int (*resource_unplug_pci)(uint32_t machine_bdf);
-    int (*resource_setup_pci)(uint32_t machine_bdf);
-    int (*resource_setup_gsi)(int gsi);
-    int (*resource_setup_misc)(void);
-
-    int (*hypfs_op)(void);
 
     long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
 #ifdef CONFIG_COMPAT
     int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
 #endif
 
-    int (*hvm_param)(struct domain *d, unsigned long op);
-    int (*hvm_param_altp2mhvm)(struct domain *d);
-    int (*hvm_altp2mhvm_op)(struct domain *d, uint64_t mode, uint32_t op);
-    int (*get_vnumainfo)(struct domain *d);
-
-#ifdef CONFIG_VM_EVENT
-    int (*mem_access)(struct domain *d);
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    int (*mem_paging)(struct domain *d);
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    int (*mem_sharing)(struct domain *d);
-#endif
-
-    int (*platform_op)(uint32_t cmd);
-
-#ifdef CONFIG_X86
-    int (*do_mca)(void);
-    int (*mem_sharing_op)(struct domain *d, struct domain *cd, int op);
-    int (*apic)(struct domain *d, int cmd);
-    int (*machine_memory_map)(void);
-    int (*domain_memory_map)(struct domain *d);
-#define XSM_MMU_UPDATE_READ      1
-#define XSM_MMU_UPDATE_WRITE     2
-#define XSM_MMU_NORMAL_UPDATE    4
-#define XSM_MMU_MACHPHYS_UPDATE  8
-    int (*mmu_update)(struct domain *d, struct domain *t,
-                      struct domain *f, uint32_t flags);
-    int (*mmuext_op)(struct domain *d, struct domain *f);
-    int (*update_va_mapping)(struct domain *d, struct domain *f,
-                             l1_pgentry_t pte);
-    int (*priv_mapping)(struct domain *d, struct domain *t);
-    int (*ioport_permission)(struct domain *d, uint32_t s, uint32_t e,
-                             uint8_t allow);
-    int (*ioport_mapping)(struct domain *d, uint32_t s, uint32_t e,
-                          uint8_t allow);
-    int (*pmu_op)(struct domain *d, unsigned int op);
-#endif
-    int (*dm_op)(struct domain *d);
-    int (*xen_version)(uint32_t cmd);
-    int (*domain_resource_map)(struct domain *d);
 #ifdef CONFIG_ARGO
     int (*argo_enable)(const struct domain *d);
     int (*argo_register_single_source)(const struct domain *d,
@@ -186,7 +98,6 @@ struct xsm_ops {
     int (*argo_register_any_source)(const struct domain *d);
     int (*argo_send)(const struct domain *d, const struct domain *t);
 #endif
-    int (*get_domain_state)(struct domain *d);
 };
 
 #ifdef CONFIG_XSM
@@ -206,113 +117,57 @@ static inline void xsm_security_domaininfo(
     alternative_vcall(xsm_ops.security_domaininfo, d, info);
 }
 
-static inline int xsm_domain_create(
-    xsm_default_t def, struct domain *d, uint32_t ssidref)
-{
-    return alternative_call(xsm_ops.domain_create, d, ssidref);
-}
+#define XSM_ALT_void alternative_vcall
+#define XSM_ALT_int  return alternative_call
 
-static inline int xsm_getdomaininfo(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.getdomaininfo, d);
+#define XSM_HOOK0(rtype, name) \
+static inline rtype xsm_ ## name(xsm_default_t def) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name); \
 }
 
-static inline int xsm_get_domain_state(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_domain_state, d);
+#define XSM_HOOK1(rtype, name, type1) \
+static inline rtype xsm_ ## name(xsm_default_t def, type1 arg1) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1); \
 }
 
-static inline int xsm_set_target(
-    xsm_default_t def, struct domain *d, struct domain *e)
-{
-    return alternative_call(xsm_ops.set_target, d, e);
+#define XSM_HOOK2(rtype, name, type1, type2) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2); \
 }
 
-static inline int xsm_domctl(xsm_default_t def, struct domain *d,
-                             struct xen_domctl *op)
-{
-    return alternative_call(xsm_ops.domctl, d, op);
+#define XSM_HOOK3(rtype, name, type1, type2, type3) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3); \
 }
 
-#ifdef CONFIG_SYSCTL
-static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
-{
-    return alternative_call(xsm_ops.sysctl, op);
+#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4); \
 }
-#endif
 
-static inline int xsm_evtchn_unbound(
-    xsm_default_t def, struct domain *d1, struct evtchn *chn, domid_t id2)
-{
-    return alternative_call(xsm_ops.evtchn_unbound, d1, chn, id2);
+#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
+    type5 arg5) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4, arg5); \
 }
 
-static inline int xsm_evtchn_interdomain(
-    xsm_default_t def, struct domain *d1, struct evtchn *chan1,
-    struct domain *d2, struct evtchn *chan2)
-{
-    return alternative_call(xsm_ops.evtchn_interdomain, d1, chan1, d2, chan2);
-}
+#include "hooks.h"
 
 static inline void xsm_evtchn_close_post(struct evtchn *chn)
 {
     alternative_vcall(xsm_ops.evtchn_close_post, chn);
 }
 
-static inline int xsm_evtchn_send(
-    xsm_default_t def, struct domain *d, struct evtchn *chn)
-{
-    return alternative_call(xsm_ops.evtchn_send, d, chn);
-}
-
-static inline int xsm_evtchn_status(
-    xsm_default_t def, struct domain *d, struct evtchn *chn)
-{
-    return alternative_call(xsm_ops.evtchn_status, d, chn);
-}
-
-static inline int xsm_evtchn_reset(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.evtchn_reset, d1, d2);
-}
-
-static inline int xsm_grant_mapref(
-    xsm_default_t def, struct domain *d1, struct domain *d2, uint32_t flags)
-{
-    return alternative_call(xsm_ops.grant_mapref, d1, d2, flags);
-}
-
-static inline int xsm_grant_unmapref(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_unmapref, d1, d2);
-}
-
-static inline int xsm_grant_setup(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_setup, d1, d2);
-}
-
-static inline int xsm_grant_transfer(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_transfer, d1, d2);
-}
-
-static inline int xsm_grant_copy(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_copy, d1, d2);
-}
-
-static inline int xsm_grant_query_size(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_query_size, d1, d2);
-}
-
 static inline int xsm_alloc_security_domain(struct domain *d)
 {
     return alternative_call(xsm_ops.alloc_security_domain, d);
@@ -341,193 +196,11 @@ static inline char *xsm_show_security_evtchn(
     return alternative_call(xsm_ops.show_security_evtchn, d, chn);
 }
 
-static inline int xsm_init_hardware_domain(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.init_hardware_domain, d);
-}
-
-static inline int xsm_get_pod_target(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_pod_target, d);
-}
-
-static inline int xsm_set_pod_target(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.set_pod_target, d);
-}
-
-static inline int xsm_memory_exchange(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.memory_exchange, d);
-}
-
-static inline int xsm_memory_adjust_reservation(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.memory_adjust_reservation, d1, d2);
-}
-
-static inline int xsm_memory_stat_reservation(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.memory_stat_reservation, d1, d2);
-}
-
-static inline int xsm_memory_pin_page(
-    xsm_default_t def, struct domain *d1, struct domain *d2,
-    struct page_info *page)
-{
-    return alternative_call(xsm_ops.memory_pin_page, d1, d2, page);
-}
-
-static inline int xsm_add_to_physmap(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.add_to_physmap, d1, d2);
-}
-
-static inline int xsm_remove_from_physmap(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.remove_from_physmap, d1, d2);
-}
-
-static inline int xsm_map_gmfn_foreign(
-    xsm_default_t def, struct domain *d, struct domain *t)
-{
-    return alternative_call(xsm_ops.map_gmfn_foreign, d, t);
-}
-
-static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.claim_pages, d);
-}
-
-static inline int xsm_console_io(xsm_default_t def, struct domain *d, int cmd)
-{
-    return alternative_call(xsm_ops.console_io, d, cmd);
-}
-
-static inline int xsm_kexec(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.kexec);
-}
-
-static inline int xsm_schedop_shutdown(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.schedop_shutdown, d1, d2);
-}
-
 static inline char *xsm_show_irq_sid(int irq)
 {
     return alternative_call(xsm_ops.show_irq_sid, irq);
 }
 
-static inline int xsm_map_domain_pirq(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.map_domain_pirq, d);
-}
-
-static inline int xsm_map_domain_irq(
-    xsm_default_t def, struct domain *d, int irq, void *data)
-{
-    return alternative_call(xsm_ops.map_domain_irq, d, irq, data);
-}
-
-static inline int xsm_unmap_domain_pirq(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.unmap_domain_pirq, d);
-}
-
-static inline int xsm_unmap_domain_irq(
-    xsm_default_t def, struct domain *d, int irq, void *data)
-{
-    return alternative_call(xsm_ops.unmap_domain_irq, d, irq, data);
-}
-
-static inline int xsm_bind_pt_irq(
-    xsm_default_t def, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return alternative_call(xsm_ops.bind_pt_irq, d, bind);
-}
-
-static inline int xsm_unbind_pt_irq(
-    xsm_default_t def, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return alternative_call(xsm_ops.unbind_pt_irq, d, bind);
-}
-
-static inline int xsm_irq_permission(
-    xsm_default_t def, struct domain *d, int pirq, uint8_t allow)
-{
-    return alternative_call(xsm_ops.irq_permission, d, pirq, allow);
-}
-
-static inline int xsm_iomem_permission(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_permission, d, s, e, allow);
-}
-
-static inline int xsm_iomem_mapping(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_mapping, d, s, e, allow);
-}
-
-static inline int xsm_iomem_mapping_vpci(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_mapping_vpci, d, s, e, allow);
-}
-
-static inline int xsm_pci_config_permission(
-    xsm_default_t def, struct domain *d, uint32_t machine_bdf, uint16_t start,
-    uint16_t end, uint8_t access)
-{
-    return alternative_call(xsm_ops.pci_config_permission, d, machine_bdf, start, end, access);
-}
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-static inline int xsm_get_device_group(xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.get_device_group, machine_bdf);
-}
-#endif /* HAS_PASSTHROUGH && HAS_PCI) */
-
-static inline int xsm_resource_plug_pci(xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_plug_pci, machine_bdf);
-}
-
-static inline int xsm_resource_unplug_pci(
-    xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_unplug_pci, machine_bdf);
-}
-
-static inline int xsm_resource_setup_pci(
-    xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_setup_pci, machine_bdf);
-}
-
-static inline int xsm_resource_setup_gsi(xsm_default_t def, int gsi)
-{
-    return alternative_call(xsm_ops.resource_setup_gsi, gsi);
-}
-
-static inline int xsm_resource_setup_misc(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.resource_setup_misc);
-}
-
-static inline int xsm_hypfs_op(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.hypfs_op);
-}
-
 static inline long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return alternative_call(xsm_ops.do_xsm_op, op);
@@ -540,141 +213,6 @@ static inline int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
 }
 #endif
 
-static inline int xsm_hvm_param(
-    xsm_default_t def, struct domain *d, unsigned long op)
-{
-    return alternative_call(xsm_ops.hvm_param, d, op);
-}
-
-static inline int xsm_hvm_param_altp2mhvm(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.hvm_param_altp2mhvm, d);
-}
-
-static inline int xsm_hvm_altp2mhvm_op(
-    xsm_default_t def, struct domain *d, uint64_t mode, uint32_t op)
-{
-    return alternative_call(xsm_ops.hvm_altp2mhvm_op, d, mode, op);
-}
-
-static inline int xsm_get_vnumainfo(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_vnumainfo, d);
-}
-
-#ifdef CONFIG_VM_EVENT
-static inline int xsm_mem_access(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_access, d);
-}
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-static inline int xsm_mem_paging(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_paging, d);
-}
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-static inline int xsm_mem_sharing(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_sharing, d);
-}
-#endif
-
-static inline int xsm_platform_op(xsm_default_t def, uint32_t op)
-{
-    return alternative_call(xsm_ops.platform_op, op);
-}
-
-#ifdef CONFIG_X86
-static inline int xsm_do_mca(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.do_mca);
-}
-
-static inline int xsm_mem_sharing_op(
-    xsm_default_t def, struct domain *d, struct domain *cd, int op)
-{
-    return alternative_call(xsm_ops.mem_sharing_op, d, cd, op);
-}
-
-static inline int xsm_apic(xsm_default_t def, struct domain *d, int cmd)
-{
-    return alternative_call(xsm_ops.apic, d, cmd);
-}
-
-static inline int xsm_machine_memory_map(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.machine_memory_map);
-}
-
-static inline int xsm_domain_memory_map(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.domain_memory_map, d);
-}
-
-static inline int xsm_mmu_update(
-    xsm_default_t def, struct domain *d, struct domain *t, struct domain *f,
-    uint32_t flags)
-{
-    return alternative_call(xsm_ops.mmu_update, d, t, f, flags);
-}
-
-static inline int xsm_mmuext_op(
-    xsm_default_t def, struct domain *d, struct domain *f)
-{
-    return alternative_call(xsm_ops.mmuext_op, d, f);
-}
-
-static inline int xsm_update_va_mapping(
-    xsm_default_t def, struct domain *d, struct domain *f, l1_pgentry_t pte)
-{
-    return alternative_call(xsm_ops.update_va_mapping, d, f, pte);
-}
-
-static inline int xsm_priv_mapping(
-    xsm_default_t def, struct domain *d, struct domain *t)
-{
-    return alternative_call(xsm_ops.priv_mapping, d, t);
-}
-
-static inline int xsm_ioport_permission(
-    xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.ioport_permission, d, s, e, allow);
-}
-
-static inline int xsm_ioport_mapping(
-    xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.ioport_mapping, d, s, e, allow);
-}
-
-static inline int xsm_pmu_op(
-    xsm_default_t def, struct domain *d, unsigned int op)
-{
-    return alternative_call(xsm_ops.pmu_op, d, op);
-}
-
-#endif /* CONFIG_X86 */
-
-static inline int xsm_dm_op(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.dm_op, d);
-}
-
-static inline int xsm_xen_version(xsm_default_t def, uint32_t op)
-{
-    return alternative_call(xsm_ops.xen_version, op);
-}
-
-static inline int xsm_domain_resource_map(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.domain_resource_map, d);
-}
-
 #ifdef CONFIG_ARGO
 static inline int xsm_argo_enable(const struct domain *d)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 2d02655703..dfe1cf41c7 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -16,124 +16,37 @@
 static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
     .set_system_active             = xsm_set_system_active,
     .security_domaininfo           = xsm_security_domaininfo,
-    .domain_create                 = xsm_domain_create,
-    .getdomaininfo                 = xsm_getdomaininfo,
-    .set_target                    = xsm_set_target,
-    .domctl                        = xsm_domctl,
-#ifdef CONFIG_SYSCTL
-    .sysctl                        = xsm_sysctl,
-#endif
 
-    .evtchn_unbound                = xsm_evtchn_unbound,
-    .evtchn_interdomain            = xsm_evtchn_interdomain,
-    .evtchn_close_post             = xsm_evtchn_close_post,
-    .evtchn_send                   = xsm_evtchn_send,
-    .evtchn_status                 = xsm_evtchn_status,
-    .evtchn_reset                  = xsm_evtchn_reset,
+#define XSM_HOOK0(rtype, name) .name = xsm_ ## name,
+#define XSM_HOOK1(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK2(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK3(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK4(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK5(rtype, name, ...) XSM_HOOK0(rtype, name)
 
-    .grant_mapref                  = xsm_grant_mapref,
-    .grant_unmapref                = xsm_grant_unmapref,
-    .grant_setup                   = xsm_grant_setup,
-    .grant_transfer                = xsm_grant_transfer,
-    .grant_copy                    = xsm_grant_copy,
-    .grant_query_size              = xsm_grant_query_size,
+#include <xsm/hooks.h>
+
+    .evtchn_close_post             = xsm_evtchn_close_post,
 
     .alloc_security_domain         = xsm_alloc_security_domain,
     .free_security_domain          = xsm_free_security_domain,
     .alloc_security_evtchns        = xsm_alloc_security_evtchns,
     .free_security_evtchns         = xsm_free_security_evtchns,
     .show_security_evtchn          = xsm_show_security_evtchn,
-    .init_hardware_domain          = xsm_init_hardware_domain,
-
-    .get_pod_target                = xsm_get_pod_target,
-    .set_pod_target                = xsm_set_pod_target,
-
-    .memory_exchange               = xsm_memory_exchange,
-    .memory_adjust_reservation     = xsm_memory_adjust_reservation,
-    .memory_stat_reservation       = xsm_memory_stat_reservation,
-    .memory_pin_page               = xsm_memory_pin_page,
-    .claim_pages                   = xsm_claim_pages,
-
-    .console_io                    = xsm_console_io,
-
-    .kexec                         = xsm_kexec,
-    .schedop_shutdown              = xsm_schedop_shutdown,
 
     .show_irq_sid                  = xsm_show_irq_sid,
-    .map_domain_pirq               = xsm_map_domain_pirq,
-    .map_domain_irq                = xsm_map_domain_irq,
-    .unmap_domain_pirq             = xsm_unmap_domain_pirq,
-    .unmap_domain_irq              = xsm_unmap_domain_irq,
-    .bind_pt_irq                   = xsm_bind_pt_irq,
-    .unbind_pt_irq                 = xsm_unbind_pt_irq,
-    .irq_permission                = xsm_irq_permission,
-    .iomem_permission              = xsm_iomem_permission,
-    .iomem_mapping                 = xsm_iomem_mapping,
-    .iomem_mapping_vpci            = xsm_iomem_mapping_vpci,
-    .pci_config_permission         = xsm_pci_config_permission,
-    .get_vnumainfo                 = xsm_get_vnumainfo,
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    .get_device_group              = xsm_get_device_group,
-#endif
-
-    .resource_plug_pci             = xsm_resource_plug_pci,
-    .resource_unplug_pci           = xsm_resource_unplug_pci,
-    .resource_setup_pci            = xsm_resource_setup_pci,
-    .resource_setup_gsi            = xsm_resource_setup_gsi,
-    .resource_setup_misc           = xsm_resource_setup_misc,
-
-    .hypfs_op                      = xsm_hypfs_op,
-    .hvm_param                     = xsm_hvm_param,
-    .hvm_param_altp2mhvm           = xsm_hvm_param_altp2mhvm,
-    .hvm_altp2mhvm_op              = xsm_hvm_altp2mhvm_op,
 
     .do_xsm_op                     = xsm_do_xsm_op,
 #ifdef CONFIG_COMPAT
     .do_compat_op                  = xsm_do_compat_op,
 #endif
 
-    .add_to_physmap                = xsm_add_to_physmap,
-    .remove_from_physmap           = xsm_remove_from_physmap,
-    .map_gmfn_foreign              = xsm_map_gmfn_foreign,
-
-#ifdef CONFIG_VM_EVENT
-    .mem_access                    = xsm_mem_access,
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    .mem_paging                    = xsm_mem_paging,
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    .mem_sharing                   = xsm_mem_sharing,
-#endif
-
-    .platform_op                   = xsm_platform_op,
-#ifdef CONFIG_X86
-    .do_mca                        = xsm_do_mca,
-    .mem_sharing_op                = xsm_mem_sharing_op,
-    .apic                          = xsm_apic,
-    .machine_memory_map            = xsm_machine_memory_map,
-    .domain_memory_map             = xsm_domain_memory_map,
-    .mmu_update                    = xsm_mmu_update,
-    .mmuext_op                     = xsm_mmuext_op,
-    .update_va_mapping             = xsm_update_va_mapping,
-    .priv_mapping                  = xsm_priv_mapping,
-    .ioport_permission             = xsm_ioport_permission,
-    .ioport_mapping                = xsm_ioport_mapping,
-    .pmu_op                        = xsm_pmu_op,
-#endif
-    .dm_op                         = xsm_dm_op,
-    .xen_version                   = xsm_xen_version,
-    .domain_resource_map           = xsm_domain_resource_map,
 #ifdef CONFIG_ARGO
     .argo_enable                   = xsm_argo_enable,
     .argo_register_single_source   = xsm_argo_register_single_source,
     .argo_register_any_source      = xsm_argo_register_any_source,
     .argo_send                     = xsm_argo_send,
 #endif
-    .get_domain_state              = xsm_get_domain_state,
 };
 
 void __init xsm_fixup_ops(struct xsm_ops *ops)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a6cef9d2a5..d7dac0dea3 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1215,6 +1215,7 @@ static int cf_check flask_iomem_mapping(struct domain *d, uint64_t start, uint64
 {
     return flask_iomem_permission(d, start, end, access);
 }
+#define flask_iomem_mapping_vpci flask_iomem_mapping
 
 static int cf_check flask_pci_config_permission(
     struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end,
@@ -1713,6 +1714,7 @@ static int cf_check flask_ioport_mapping(
     return flask_ioport_permission(d, start, end, access);
 }
 
+#ifdef CONFIG_MEM_SHARING
 static int cf_check flask_mem_sharing_op(
     struct domain *d, struct domain *cd, int op)
 {
@@ -1721,6 +1723,7 @@ static int cf_check flask_mem_sharing_op(
         return rc;
     return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
 }
+#endif
 
 static int cf_check flask_apic(struct domain *d, int cmd)
 {
@@ -1911,125 +1914,38 @@ static int cf_check flask_get_domain_state(struct domain *d)
 static const struct xsm_ops __initconst_cf_clobber flask_ops = {
     .set_system_active = flask_set_system_active,
     .security_domaininfo = flask_security_domaininfo,
-    .domain_create = flask_domain_create,
-    .getdomaininfo = flask_getdomaininfo,
-    .set_target = flask_set_target,
-    .domctl = flask_domctl,
-#ifdef CONFIG_SYSCTL
-    .sysctl = flask_sysctl,
-#endif
 
-    .evtchn_unbound = flask_evtchn_unbound,
-    .evtchn_interdomain = flask_evtchn_interdomain,
-    .evtchn_close_post = flask_evtchn_close_post,
-    .evtchn_send = flask_evtchn_send,
-    .evtchn_status = flask_evtchn_status,
-    .evtchn_reset = flask_evtchn_reset,
+#define XSM_HOOK0(rtype, name) .name = flask_ ## name,
+#define XSM_HOOK1(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK2(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK3(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK4(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK5(rtype, name, ...) XSM_HOOK0(rtype, name)
+
+#include <xsm/hooks.h>
 
-    .grant_mapref = flask_grant_mapref,
-    .grant_unmapref = flask_grant_unmapref,
-    .grant_setup = flask_grant_setup,
-    .grant_transfer = flask_grant_transfer,
-    .grant_copy = flask_grant_copy,
-    .grant_query_size = flask_grant_query_size,
+    .evtchn_close_post = flask_evtchn_close_post,
 
     .alloc_security_domain = flask_domain_alloc_security,
     .free_security_domain = flask_domain_free_security,
     .alloc_security_evtchns = flask_alloc_security_evtchns,
     .free_security_evtchns = flask_free_security_evtchns,
     .show_security_evtchn = flask_show_security_evtchn,
-    .init_hardware_domain = flask_init_hardware_domain,
-
-    .get_pod_target = flask_get_pod_target,
-    .set_pod_target = flask_set_pod_target,
-    .memory_exchange = flask_memory_exchange,
-    .memory_adjust_reservation = flask_memory_adjust_reservation,
-    .memory_stat_reservation = flask_memory_stat_reservation,
-    .memory_pin_page = flask_memory_pin_page,
-    .claim_pages = flask_claim_pages,
-
-    .console_io = flask_console_io,
-
-    .kexec = flask_kexec,
-    .schedop_shutdown = flask_schedop_shutdown,
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .map_domain_pirq = flask_map_domain_pirq,
-    .map_domain_irq = flask_map_domain_irq,
-    .unmap_domain_pirq = flask_unmap_domain_pirq,
-    .unmap_domain_irq = flask_unmap_domain_irq,
-    .bind_pt_irq = flask_bind_pt_irq,
-    .unbind_pt_irq = flask_unbind_pt_irq,
-    .irq_permission = flask_irq_permission,
-    .iomem_permission = flask_iomem_permission,
-    .iomem_mapping = flask_iomem_mapping,
-    .iomem_mapping_vpci = flask_iomem_mapping,
-    .pci_config_permission = flask_pci_config_permission,
-
-    .resource_plug_pci = flask_resource_plug_pci,
-    .resource_unplug_pci = flask_resource_unplug_pci,
-    .resource_setup_pci = flask_resource_setup_pci,
-    .resource_setup_gsi = flask_resource_setup_gsi,
-    .resource_setup_misc = flask_resource_setup_misc,
-
-    .hypfs_op = flask_hypfs_op,
-    .hvm_param = flask_hvm_param,
-    .hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,
-    .hvm_altp2mhvm_op = flask_hvm_altp2mhvm_op,
-
     .do_xsm_op = do_flask_op,
-    .get_vnumainfo = flask_get_vnumainfo,
-
-#ifdef CONFIG_VM_EVENT
-    .mem_access = flask_mem_access,
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    .mem_paging = flask_mem_paging,
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    .mem_sharing = flask_mem_sharing,
-#endif
 
 #ifdef CONFIG_COMPAT
     .do_compat_op = compat_flask_op,
 #endif
 
-    .add_to_physmap = flask_add_to_physmap,
-    .remove_from_physmap = flask_remove_from_physmap,
-    .map_gmfn_foreign = flask_map_gmfn_foreign,
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    .get_device_group = flask_get_device_group,
-#endif
-
-    .platform_op = flask_platform_op,
-#ifdef CONFIG_X86
-    .do_mca = flask_do_mca,
-    .mem_sharing_op = flask_mem_sharing_op,
-    .apic = flask_apic,
-    .machine_memory_map = flask_machine_memory_map,
-    .domain_memory_map = flask_domain_memory_map,
-    .mmu_update = flask_mmu_update,
-    .mmuext_op = flask_mmuext_op,
-    .update_va_mapping = flask_update_va_mapping,
-    .priv_mapping = flask_priv_mapping,
-    .ioport_permission = flask_ioport_permission,
-    .ioport_mapping = flask_ioport_mapping,
-    .pmu_op = flask_pmu_op,
-#endif
-    .dm_op = flask_dm_op,
-    .xen_version = flask_xen_version,
-    .domain_resource_map = flask_domain_resource_map,
 #ifdef CONFIG_ARGO
     .argo_enable = flask_argo_enable,
     .argo_register_single_source = flask_argo_register_single_source,
     .argo_register_any_source = flask_argo_register_any_source,
     .argo_send = flask_argo_send,
 #endif
-    .get_domain_state = flask_get_domain_state,
 };
 
 const struct xsm_ops *__init flask_init(
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381700.1625229 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvbG-0007Cd-0a; Mon, 03 Aug 2026 16:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381700.1625229; Mon, 03 Aug 2026 16: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 1wqvbF-0007CW-UH; Mon, 03 Aug 2026 16:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1381700;
 Mon, 03 Aug 2026 16:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvbE-0007CQ-MZ
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvbE-003H7A-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvbE-0031cM-1w
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vq4+oAaLTLwmzdc7obrPD/+8RLty8azU0SeuDFc6TlM=; b=iorGPCvQol16Vbxy8zvbrHh4Mg
	ZV6uN85FFxPNcVGoxIvq7I+z4CEyR8P4zCtrZkJOPQP9HRqoEO6h09J8IX0oOwEZwIUxjj+1iXaa+
	PQG2oK3D7vAcCgJU44QdneT+0uV2LBkEh3VnCyf0A3LzpG/DoerZXNN5P7rI7/ImJ5/U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .grant_*() hooks dependent upon GRANT_TABLE=y
Message-Id: <E1wqvbE-0031cM-1w@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:33:12 +0000

commit d1d1287764911f869e373703f53edc1b706edbbf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:32:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:32:25 2026 +0200

    XSM: make .grant_*() hooks dependent upon GRANT_TABLE=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 4 ++++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 4 ++++
 xen/xsm/silo.c          | 6 ++++++
 4 files changed, 16 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 50ef246467..d75285477d 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -191,6 +191,8 @@ static XSM_INLINE void cf_check xsm_free_security_domain(struct domain *d)
     return;
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static XSM_INLINE int cf_check xsm_grant_mapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -233,6 +235,8 @@ static XSM_INLINE int cf_check xsm_grant_query_size(
     return xsm_default_action(action, d1, d2);
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 static XSM_INLINE int cf_check xsm_memory_exchange(
     XSM_DEFAULT_ARG struct domain *d)
 {
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 87e357508d..8dbce67bd1 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -35,12 +35,14 @@ XSM_HOOK(int, evtchn_send, struct domain *, struct evtchn *)
 XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
 XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
 
+#ifdef CONFIG_GRANT_TABLE
 XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
 XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
 XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
 XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
 XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
 XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
+#endif
 
 XSM_HOOK(int, init_hardware_domain, struct domain *)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d7dac0dea3..d861b08d8b 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -434,6 +434,8 @@ static int cf_check flask_init_hardware_domain(struct domain *d)
     return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__CREATE_HARDWARE_DOMAIN);
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static int cf_check flask_grant_mapref(
     struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -470,6 +472,8 @@ static int cf_check flask_grant_query_size(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 static int cf_check flask_get_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
diff --git a/xen/xsm/silo.c b/xen/xsm/silo.c
index b89b364287..39f4f581a3 100644
--- a/xen/xsm/silo.c
+++ b/xen/xsm/silo.c
@@ -60,6 +60,8 @@ static int cf_check silo_evtchn_interdomain(
     return -EPERM;
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static int cf_check silo_grant_mapref(
     struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -82,6 +84,8 @@ static int cf_check silo_grant_copy(struct domain *d1, struct domain *d2)
     return -EPERM;
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 #ifdef CONFIG_ARGO
 
 static int cf_check silo_argo_register_single_source(
@@ -105,9 +109,11 @@ static int cf_check silo_argo_send(
 static const struct xsm_ops __initconst_cf_clobber silo_xsm_ops = {
     .evtchn_unbound = silo_evtchn_unbound,
     .evtchn_interdomain = silo_evtchn_interdomain,
+#ifdef CONFIG_GRANT_TABLE
     .grant_mapref = silo_grant_mapref,
     .grant_transfer = silo_grant_transfer,
     .grant_copy = silo_grant_copy,
+#endif
 #ifdef CONFIG_ARGO
     .argo_register_single_source = silo_argo_register_single_source,
     .argo_send = silo_argo_send,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381701.1625235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvbQ-0007Ex-2Y; Mon, 03 Aug 2026 16:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381701.1625235; Mon, 03 Aug 2026 16: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 1wqvbP-0007Ep-Vj; Mon, 03 Aug 2026 16:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1381701;
 Mon, 03 Aug 2026 16: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 1wqvbO-0007Ei-Pe
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16: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 1wqvbP-003H7E-02
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvbO-0031el-2K
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16: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=9WRwQeA/nFdR9ypjsM3MXlKkGR5ONbGHJ+wtPZdfmO0=; b=esQ+uh2SjOVE3LLQenVSec2sqT
	A+j6rsiN7tKMBtSWJY6jhHFqUJfh8nB2nGPEOefUF7UIxbC6mqpxX/NaYvKVpybP6UyWMxJy1cyeI
	iUnFINDTIFMpLqz10cLvddFsMlfJQlHT9JavtQzkzsu5PELzKifali4J1sPGIOM3mbNM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .{,un}map_domain_pirq() hooks dependent upon HAS_PIRQ=y
Message-Id: <E1wqvbO-0031el-2K@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:33:22 +0000

commit 51eaa9d1a8ae392e6238b71efde61123c02ea89b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:32:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:32:44 2026 +0200

    XSM: make .{,un}map_domain_pirq() hooks dependent upon HAS_PIRQ=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 16 ++++++++++------
 xen/include/xsm/hooks.h |  5 ++++-
 xen/xsm/flask/hooks.c   | 14 +++++++++-----
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index d75285477d..8fb73d032c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -450,6 +450,8 @@ static XSM_INLINE char *cf_check xsm_show_irq_sid(int irq)
     return NULL;
 }
 
+#ifdef CONFIG_HAS_PIRQ
+
 static XSM_INLINE int cf_check xsm_map_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
@@ -457,17 +459,19 @@ static XSM_INLINE int cf_check xsm_map_domain_pirq(
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_map_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
+static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
+    XSM_DEFAULT_ARG struct domain *d)
 {
-    XSM_ASSERT_ACTION(XSM_HOOK);
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
-    XSM_DEFAULT_ARG struct domain *d)
+#endif /* CONFIG_HAS_PIRQ */
+
+static XSM_INLINE int cf_check xsm_map_domain_irq(
+    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
-    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 8dbce67bd1..97b0d95169 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -65,9 +65,12 @@ XSM_HOOK(int, kexec)
 
 XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
 
+#ifdef CONFIG_HAS_PIRQ
 XSM_HOOK(int, map_domain_pirq, struct domain *)
-XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+#endif
+
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index d861b08d8b..bd9d9e1bcf 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1018,11 +1018,20 @@ static char *cf_check flask_show_irq_sid(int irq)
     return ctx;
 }
 
+#ifdef CONFIG_HAS_PIRQ
+
 static int cf_check flask_map_domain_pirq(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
 }
 
+static int cf_check flask_unmap_domain_pirq(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+}
+
+#endif /* CONFIG_HAS_PIRQ */
+
 static int flask_map_domain_msi (
     struct domain *d, int irq, const void *data, uint32_t *sid,
     struct avc_audit_data *ad)
@@ -1085,11 +1094,6 @@ static int cf_check flask_map_domain_irq(
     return rc;
 }
 
-static int cf_check flask_unmap_domain_pirq(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
-}
-
 static int flask_unmap_domain_msi (
     struct domain *d, int irq, const void *data, uint32_t *sid,
     struct avc_audit_data *ad)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381702.1625238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvba-0007Hx-3Q; Mon, 03 Aug 2026 16:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381702.1625238; Mon, 03 Aug 2026 16: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 1wqvba-0007Hp-0l; Mon, 03 Aug 2026 16:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1381702;
 Mon, 03 Aug 2026 16: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 1wqvbY-0007Gd-T7
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16: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 1wqvbZ-003H7K-0M
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvbY-0031g2-2d
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16: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=asVHCp9qYK6jJD3308WJjatzy0M/n7l926o5G8hAwJY=; b=Kl4ZNOPCn4YJ7aLi4xVYeFYW6W
	QeEY9ndx5Zw1z5vgfSx4ZPQUDYettjEpFXnLNma9jIFygAZZZWSWE6DY78wwWl2EX2gsgFfq/F4LS
	wgEB3/VpIYdHci/v+yq4iJ4Az+zGlvZUXkfigUVXidecR5Q+VYOXfkdLHeA/4+dnY44U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make PCI hooks dependent upon HAS_PCI=y
Message-Id: <E1wqvbY-0031g2-2d@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:33:32 +0000

commit d9605dee5cb20e7f833d5f26730faec82b206764
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:34:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:34:32 2026 +0200

    XSM: make PCI hooks dependent upon HAS_PCI=y
    
    They're unreachable / dead otherwise. Really resource_{,un}plug_pci() is
    further limited to PCI pass-through.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 10 ++++++++++
 xen/include/xsm/hooks.h | 13 ++++++++-----
 xen/xsm/flask/hooks.c   | 10 ++++++++++
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 8fb73d032c..b777c2eb47 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -394,6 +394,8 @@ static XSM_INLINE int cf_check xsm_get_device_group(
 }
 #endif /* HAS_PASSTHROUGH && HAS_PCI */
 
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+
 static XSM_INLINE int cf_check xsm_resource_plug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
@@ -408,6 +410,10 @@ static XSM_INLINE int cf_check xsm_resource_unplug_pci(
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_PCI */
+
+#ifdef CONFIG_HAS_PCI
+
 static XSM_INLINE int cf_check xsm_resource_setup_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
@@ -421,6 +427,8 @@ static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#endif /* CONFIG_HAS_PCI */
+
 static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -524,6 +532,7 @@ static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_HAS_PCI
 static XSM_INLINE int cf_check xsm_pci_config_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf, uint16_t start,
     uint16_t end, uint8_t access)
@@ -531,6 +540,7 @@ static XSM_INLINE int cf_check xsm_pci_config_permission(
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
+#endif /* CONFIG_HAS_PCI */
 
 static XSM_INLINE int cf_check xsm_add_to_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 97b0d95169..1ca935a43d 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -77,21 +77,24 @@ XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 
 XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
 XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
-XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
-                                     uint16_t, uint8_t)
 
 XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
 XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+XSM_HOOK(int, resource_plug_pci, uint32_t)
+XSM_HOOK(int, resource_unplug_pci, uint32_t)
 XSM_HOOK(int, get_device_group, uint32_t)
 #endif
 
-XSM_HOOK(int, resource_plug_pci, uint32_t)
-XSM_HOOK(int, resource_unplug_pci, uint32_t)
+XSM_HOOK(int, resource_setup_misc)
+
+#ifdef CONFIG_HAS_PCI
 XSM_HOOK(int, resource_setup_pci, uint32_t)
 XSM_HOOK(int, resource_setup_gsi, int)
-XSM_HOOK(int, resource_setup_misc)
+XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
+                                     uint16_t, uint8_t)
+#endif
 
 XSM_HOOK(int, hypfs_op)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index bd9d9e1bcf..8b1834ca0a 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1225,6 +1225,7 @@ static int cf_check flask_iomem_mapping(struct domain *d, uint64_t start, uint64
 }
 #define flask_iomem_mapping_vpci flask_iomem_mapping
 
+#ifdef CONFIG_HAS_PCI
 static int cf_check flask_pci_config_permission(
     struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end,
     uint8_t access)
@@ -1250,6 +1251,7 @@ static int cf_check flask_pci_config_permission(
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, perm, &ad);
 
 }
+#endif /* CONFIG_HAS_PCI */
 
 #if defined(CONFIG_SYSCTL) || defined(CONFIG_X86)
 static int flask_resource_plug_core(void)
@@ -1270,6 +1272,8 @@ static int flask_resource_use_core(void)
 }
 #endif /* CONFIG_SYSCTL */
 
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+
 static int cf_check flask_resource_plug_pci(uint32_t machine_bdf)
 {
     uint32_t rsid;
@@ -1300,6 +1304,10 @@ static int cf_check flask_resource_unplug_pci(uint32_t machine_bdf)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_PCI */
+
+#ifdef CONFIG_HAS_PCI
+
 static int cf_check flask_resource_setup_pci(uint32_t machine_bdf)
 {
     uint32_t rsid;
@@ -1328,6 +1336,8 @@ static int cf_check flask_resource_setup_gsi(int gsi)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
+#endif /* CONFIG_HAS_PCI */
+
 static int cf_check flask_resource_setup_misc(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381703.1625243 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvbk-0007Jr-5P; Mon, 03 Aug 2026 16:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381703.1625243; Mon, 03 Aug 2026 16: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 1wqvbk-0007Jj-21; Mon, 03 Aug 2026 16:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1381703;
 Mon, 03 Aug 2026 16:33:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvbi-0007Jc-W0
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16: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 1wqvbj-003H7O-0f
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvbi-0031h9-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16: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=dM4sInX/W8WsD5UKB3UABaRPRkZZqwgd1mN2juv0NrY=; b=pEnLYg68woczXQihsYdsQZRalk
	9i1XOTuwfV3Vpk3QLwTuFzNB0qJ0bVENQeR8QnPhrHoQPGkcNvsS8UHLkH/If688mSVzNn1OjxnBJ
	C24kfQ89LXG0RxyaEdwx3UCPrZDmzx5wqjR1cEPms3ZNY8DfcH9bJIz4uPzxPQEJM9D0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .iomem_mapping_vpci() hook dependent upon HAS_VPCI=y
Message-Id: <E1wqvbi-0031h9-2x@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:33:42 +0000

commit 7a01c8179cc08840e1d6ce853eda8af685392068
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:34:50 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:34:50 2026 +0200

    XSM: make .iomem_mapping_vpci() hook dependent upon HAS_VPCI=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index b777c2eb47..7cedad01eb 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -525,12 +525,14 @@ static XSM_INLINE int cf_check xsm_iomem_mapping(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_HAS_VPCI
 static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
+#endif
 
 #ifdef CONFIG_HAS_PCI
 static XSM_INLINE int cf_check xsm_pci_config_permission(
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 1ca935a43d..e85c035f66 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -79,7 +79,9 @@ XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
 XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
 
 XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
+#ifdef CONFIG_HAS_VPCI
 XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
+#endif
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
 XSM_HOOK(int, resource_plug_pci, uint32_t)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381704.1625246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvbu-0007M3-5r; Mon, 03 Aug 2026 16:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381704.1625246; Mon, 03 Aug 2026 16: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 1wqvbu-0007Lv-3N; Mon, 03 Aug 2026 16:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1381704;
 Mon, 03 Aug 2026 16:33:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvbt-0007Lo-2R
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:33:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvbt-003H7V-0y
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvbt-0031iU-01
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aLYKc764zuPKyG0V+SoP7TRt1RdYUiooLeZY4mcIQzk=; b=jnZnxkdDDKEeY4O+6oTBT4qVOg
	RK9XfPHD8b26N/EO/QB6n3o2s2/f+eECSrtoW5PH4KPYgkfOkmoYkl1CRTZ5RiGPks4qwSsT0wMEv
	tXh3wAs22HyLqhZzx+g/tm0cjCQA137zz61CSgLhNVSl7bX7fVGBoBW3QDoTcaDlnuac=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .kexec() hook dependent upon KEXEC=y
Message-Id: <E1wqvbt-0031iU-01@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:33:53 +0000

commit 430673b8455ea56f533991f52abcbea721843482
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:35:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:35:12 2026 +0200

    XSM: make .kexec() hook dependent upon KEXEC=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 7cedad01eb..4fe12f3c85 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -271,11 +271,13 @@ static XSM_INLINE int cf_check xsm_console_io(
     return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
+#ifdef CONFIG_KEXEC
 static XSM_INLINE int cf_check xsm_kexec(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
+#endif
 
 static XSM_INLINE int cf_check xsm_schedop_shutdown(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index e85c035f66..41c12c9306 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -61,7 +61,9 @@ XSM_HOOK(int, claim_pages, struct domain *)
 
 XSM_HOOK(int, console_io, struct domain *, int)
 
+#ifdef CONFIG_KEXEC
 XSM_HOOK(int, kexec)
+#endif
 
 XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 8b1834ca0a..1656ac8f3c 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -536,10 +536,12 @@ static int cf_check flask_console_io(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
+#ifdef CONFIG_KEXEC
 static int cf_check flask_kexec(void)
 {
     return domain_has_xen(current->domain, XEN__KEXEC);
 }
+#endif
 
 static int cf_check flask_schedop_shutdown(struct domain *d1, struct domain *d2)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:34:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381705.1625250 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvc5-0007Ny-7O; Mon, 03 Aug 2026 16:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381705.1625250; Mon, 03 Aug 2026 16:34: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 1wqvc5-0007Nq-4i; Mon, 03 Aug 2026 16:34:05 +0000
Received: by outflank-mailman (input) for mailman id 1381705;
 Mon, 03 Aug 2026 16:34:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvc3-0007Nj-54
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:34:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvc3-003H80-1F
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvc3-0031kQ-0K
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1vQG0wB4mBpkIiGOS0ViH0oENlwVrgU/+mP1JiuFZlI=; b=wzu31+f5Lo7x3D27x7W3ucF/XE
	Zi5FwA0IDNLuEaQBjnVsWhS5GDVVlVilqX7J+FyblQiPbb4SRjijdAn9jD09h62q6SVjLwD3FFrWs
	y5zlCqFXG3h8kkaNvjy+C+TUIpxULyspWX4qHKn6OQvEQQyDZq922eSlItnR2dygDZeo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .hypfs() hook dependent upon HYPFS=y
Message-Id: <E1wqvc3-0031kQ-0K@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:34:03 +0000

commit dd60120e2a0f95ff31bd662922d22747a3c53dcc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:35:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:35:32 2026 +0200

    XSM: make .hypfs() hook dependent upon HYPFS=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 4fe12f3c85..f000d1f60a 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -437,11 +437,13 @@ static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#ifdef CONFIG_HYPFS
 static XSM_INLINE int cf_check xsm_hypfs_op(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
+#endif
 
 static XSM_INLINE long cf_check xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 41c12c9306..c309a7ca43 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -100,7 +100,9 @@ XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
                                      uint16_t, uint8_t)
 #endif
 
+#ifdef CONFIG_HYPFS
 XSM_HOOK(int, hypfs_op)
+#endif
 
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 1656ac8f3c..f6675cb298 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1345,10 +1345,12 @@ static int cf_check flask_resource_setup_misc(void)
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
+#ifdef CONFIG_HYPFS
 static inline int cf_check flask_hypfs_op(void)
 {
     return domain_has_xen(current->domain, XEN__HYPFS_OP);
 }
+#endif
 
 static int cf_check flask_add_to_physmap(struct domain *d1, struct domain *d2)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:34:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381706.1625254 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvcF-0007QM-AF; Mon, 03 Aug 2026 16:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381706.1625254; Mon, 03 Aug 2026 16:34: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 1wqvcF-0007QE-7W; Mon, 03 Aug 2026 16:34:15 +0000
Received: by outflank-mailman (input) for mailman id 1381706;
 Mon, 03 Aug 2026 16:34:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvcD-0007Q6-8k
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:34:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvcD-003H89-1Y
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvcD-0031lZ-0b
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VWgdhwrayDriBb/gOuPFCCngyZYLPUQUn0O6/cKPJW8=; b=ATA7/K6GEJAV7dciwMc4GQa5eb
	fkyy++FyZbnRm6S+djgr2BJW0sPAJ4wFY9ySyIs5WU/y2UdzzXB+blFVHjwL+M0wm79bH1K8DNQl3
	pOW6RPgv/0RuvRc3KQkWf+a4eOXAof4BYleXa8aP+PVYbLzSf+SFotWEFfa7FjTYqlNM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .hvm_altp2mhvm_op() hook dependent upon ALTP2M=y
Message-Id: <E1wqvcD-0031lZ-0b@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:34:13 +0000

commit 754ae0860a125d6f8b6bff498d05d556dbe8629f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:35:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:35:54 2026 +0200

    XSM: make .hvm_altp2mhvm_op() hook dependent upon ALTP2M=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 4 ++++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f000d1f60a..47a704c01e 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -583,6 +583,7 @@ static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_ALTP2M
 static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
 {
@@ -602,6 +603,7 @@ static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
         return -EPERM;
     }
 }
+#endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
 static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index c309a7ca43..117640f95b 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -106,7 +106,11 @@ XSM_HOOK(int, hypfs_op)
 
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+
+#ifdef CONFIG_ALTP2M
 XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
+#endif
+
 XSM_HOOK(int, get_vnumainfo, struct domain *)
 
 #ifdef CONFIG_VM_EVENT
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f6675cb298..789e815377 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1393,6 +1393,7 @@ static int cf_check flask_hvm_param_altp2mhvm(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
 }
 
+#ifdef CONFIG_ALTP2M
 static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op)
 {
     /*
@@ -1416,6 +1417,7 @@ static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint
 
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM_OP);
 }
+#endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
 static int cf_check flask_mem_access(struct domain *d)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:34:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381707.1625258 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvcP-0007SF-BN; Mon, 03 Aug 2026 16:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381707.1625258; Mon, 03 Aug 2026 16:34: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 1wqvcP-0007S7-8m; Mon, 03 Aug 2026 16:34:25 +0000
Received: by outflank-mailman (input) for mailman id 1381707;
 Mon, 03 Aug 2026 16:34:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvcN-0007Rz-B7
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:34:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvcN-003H8F-1q
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvcN-0031mm-0u
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hj93tYdIqqsY+25TVSSL5bGJxYKiI2NM6Aq6TdJt/Vg=; b=an3m0+B0Tw+R8vy5hM2ksMYejM
	qO0aDgnwShbk0MRkqrxlDli2EwR2vjyPKJ/UOEWFpg71STGuaAVmsNOoP+cguQoxtpGAKT/66/73N
	xDBaj1guuUAUni6w3qTw3SFZOwEP2UXelAB+PWIwm3FWgqkGjVD51VjjYH+5/sSdYoio=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .hvm_param*() hooks dependent upon HVM=y
Message-Id: <E1wqvcN-0031mm-0u@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:34:23 +0000

commit 29df230854b5775f845127360d6c1b0de86b51eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:36:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:36:13 2026 +0200

    XSM: make .hvm_param*() hooks dependent upon HVM=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 4 ++++
 xen/include/xsm/hooks.h | 2 ++
 xen/xsm/flask/hooks.c   | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 47a704c01e..773666a778 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -569,6 +569,8 @@ static XSM_INLINE int cf_check xsm_map_gmfn_foreign(
     return xsm_default_action(action, d, t);
 }
 
+#ifdef CONFIG_HVM
+
 static XSM_INLINE int cf_check xsm_hvm_param(
     XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
@@ -583,6 +585,8 @@ static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
     return xsm_default_action(action, current->domain, d);
 }
 
+#endif /* CONFIG_HVM */
+
 #ifdef CONFIG_ALTP2M
 static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 117640f95b..54e91497b8 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -104,8 +104,10 @@ XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
 XSM_HOOK(int, hypfs_op)
 #endif
 
+#ifdef CONFIG_HVM
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+#endif
 
 #ifdef CONFIG_ALTP2M
 XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 789e815377..2e27dc2b8a 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1368,6 +1368,8 @@ static int cf_check flask_map_gmfn_foreign(struct domain *d, struct domain *t)
     return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
 }
 
+#ifdef CONFIG_HVM
+
 static int cf_check flask_hvm_param(struct domain *d, unsigned long op)
 {
     uint32_t perm;
@@ -1393,6 +1395,8 @@ static int cf_check flask_hvm_param_altp2mhvm(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
 }
 
+#endif /* CONFIG_HVM */
+
 #ifdef CONFIG_ALTP2M
 static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:34:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381708.1625263 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvcZ-0007Wo-D5; Mon, 03 Aug 2026 16:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381708.1625263; Mon, 03 Aug 2026 16:34:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvcZ-0007Wf-A8; Mon, 03 Aug 2026 16:34:35 +0000
Received: by outflank-mailman (input) for mailman id 1381708;
 Mon, 03 Aug 2026 16:34:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvcX-0007WY-Du
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:34:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvcX-003H8L-27
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvcX-0031np-1C
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IjH6A6IePvQWiHi/+5FzKYec0KMn8lgFSKJKX7+O/MU=; b=QvzrpkBkLDAesrZl6V1YlVAhwu
	V+Oti/wI0ZZcgJBzhze7UDZmDAjw+7fpA5Syown11j0ceubPtO36FcdqtgTptGv9CvUtekvDu1wqj
	vGYY78Ug3+HMGmAedz5WQriFcN8HL8Ap7RR81xn+gNnz/Au+/eOCPJUX1EWwQOWQ3/IY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make .dm_op() hook dependent upon IOREQ_SERVER=y
Message-Id: <E1wqvcX-0031np-1C@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:34:33 +0000

commit 7d15b10f6c9c870e88017b54239a590ec22e173c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:36:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:36:34 2026 +0200

    XSM: make .dm_op() hook dependent upon IOREQ_SERVER=y
    
    It's unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 2 ++
 xen/include/xsm/hooks.h | 3 +++
 xen/xsm/flask/hooks.c   | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 773666a778..fb339120bb 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -739,11 +739,13 @@ static XSM_INLINE int cf_check xsm_pmu_op(
 
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
+#endif
 
 #ifdef CONFIG_ARGO
 static XSM_INLINE int cf_check xsm_argo_enable(const struct domain *d)
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 54e91497b8..dd5627c901 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -145,7 +145,10 @@ XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
 XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 XSM_HOOK(int, dm_op, struct domain *)
+#endif
+
 XSM_HOOK(int, xen_version, uint32_t)
 XSM_HOOK(int, domain_resource_map, struct domain *)
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 2e27dc2b8a..5de7139da0 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1852,10 +1852,12 @@ static int cf_check flask_pmu_op(struct domain *d, unsigned int op)
 }
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 static int cf_check flask_dm_op(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__DM);
 }
+#endif
 
 static int cf_check flask_xen_version(uint32_t op)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 03 16:34:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 03 Aug 2026 16:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1381709.1625266 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvci-0007Ym-Dy; Mon, 03 Aug 2026 16:34:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1381709.1625266; Mon, 03 Aug 2026 16:34:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wqvci-0007Yd-BO; Mon, 03 Aug 2026 16:34:44 +0000
Received: by outflank-mailman (input) for mailman id 1381709;
 Mon, 03 Aug 2026 16:34:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wqvch-0007YX-Ge
 for xen-changelog@lists.xenproject.org; Mon, 03 Aug 2026 16:34:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvch-003H8X-2P
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wqvch-0031pA-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 03 Aug 2026 16:34:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tRI9kls8c6NGlSpBbzWYg8Hj56/Zvpx0NvfjmeIU5fQ=; b=m6MDaANmyroZI7GoWwMA0J9Fzg
	X5XClptdXvzPmmMFE1PrmkPDWC1nRzbYXinviATA/shdX8Y3s6k5oBVL3mXoMizgNi3yS1YVDB0Nx
	2gJXEYhlepaVsHVC73tbz7fN4lQuSmKNhy1RooBUPfJjhGkSv30QDhB6CbZjQRES52tQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make certain x86-specific hooks dependent upon PV=y
Message-Id: <E1wqvch-0031pA-1T@xenbits.xenproject.org>
Date: Mon, 03 Aug 2026 16:34:43 +0000

commit 5b965555b17f7b5e662323ceaf07548eff6d3867
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 3 16:36:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 3 16:36:54 2026 +0200

    XSM: make certain x86-specific hooks dependent upon PV=y
    
    They're unreachable / dead otherwise.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 15 ++++++++++-----
 xen/include/xsm/hooks.h |  4 +++-
 xen/xsm/flask/hooks.c   | 13 +++++++++----
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index fb339120bb..131631cb27 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -640,11 +640,6 @@ static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, NULL);
-}
 
 static XSM_INLINE int cf_check xsm_mem_sharing_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
@@ -673,6 +668,14 @@ static XSM_INLINE int cf_check xsm_domain_memory_map(
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_PV
+
+static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
+}
+
 static XSM_INLINE int cf_check xsm_mmu_update(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t, struct domain *f,
     uint32_t flags)
@@ -700,6 +703,8 @@ static XSM_INLINE int cf_check xsm_update_va_mapping(
     return xsm_default_action(action, d, f);
 }
 
+#endif /* CONFIG_PV */
+
 static XSM_INLINE int cf_check xsm_priv_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index dd5627c901..5bdb23f26d 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -131,14 +131,16 @@ XSM_HOOK(int, mem_sharing_op, struct domain *, struct domain *, int)
 XSM_HOOK(int, platform_op, uint32_t)
 
 #ifdef CONFIG_X86
-XSM_HOOK(int, do_mca)
 XSM_HOOK(int, apic, struct domain *, int)
 XSM_HOOK(int, machine_memory_map)
 XSM_HOOK(int, domain_memory_map, struct domain *)
+#ifdef CONFIG_PV
+XSM_HOOK(int, do_mca)
 XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
                           uint32_t)
 XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
 XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
+#endif /* CONFIG_PV */
 XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
 XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
 XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 5de7139da0..3cfdf6bf08 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1654,10 +1654,6 @@ static int cf_check flask_platform_op(uint32_t op)
 }
 
 #ifdef CONFIG_X86
-static int cf_check flask_do_mca(void)
-{
-    return domain_has_xen(current->domain, XEN__MCA_OP);
-}
 
 static int flask_shadow_control(struct domain *d, unsigned int op)
 {
@@ -1783,6 +1779,13 @@ static int cf_check flask_domain_memory_map(struct domain *d)
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
+#ifdef CONFIG_PV
+
+static int cf_check flask_do_mca(void)
+{
+    return domain_has_xen(current->domain, XEN__MCA_OP);
+}
+
 static int cf_check flask_mmu_update(
     struct domain *d, struct domain *t, struct domain *f, uint32_t flags)
 {
@@ -1823,6 +1826,8 @@ static int cf_check flask_update_va_mapping(
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
+#endif /* CONFIG_PV */
+
 static int cf_check flask_priv_mapping(struct domain *d, struct domain *t)
 {
     return domain_has_perm(d, t, SECCLASS_MMU, MMU__TARGET_HACK);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 04 16:55:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Aug 2026 16:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1382477.1625832 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrIPw-0005nP-0o; Tue, 04 Aug 2026 16:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1382477.1625832; Tue, 04 Aug 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 1wrIPv-0005nH-UU; Tue, 04 Aug 2026 16:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1382477;
 Tue, 04 Aug 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 1wrIPu-0005nB-9w
 for xen-changelog@lists.xenproject.org; Tue, 04 Aug 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 1wrIPu-004rKt-0b
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 16:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrIPt-00BEiX-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 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=nzVvjrKr4uHC6Jw4mT/JomkH0cnfFTdIreZAyvKC+8o=; b=nYVqEFaRvhEHPosj1qJK496rWL
	Kue5NsT+mXE/S7xeVVjVdeoYTVvXUwtlD2WLJaGdmof0oZYoCa97caQFP+dQg+G7K6jyv2iSlIEBh
	eim0+YDUGsGkqRivNn+61aMLDA2F4qn8lpLcgaCa+as6xwwj+zuVFKuAj9KK6qLelcLw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/livepatch: Fix include hierarchy
Message-Id: <E1wrIPt-00BEiX-2p@xenbits.xenproject.org>
Date: Tue, 04 Aug 2026 16:55:01 +0000

commit 2cb0ea59d2fbf06577e5506025d644e69d4cd229
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 7 14:55:37 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 17:32:23 2026 +0100

    xen/livepatch: Fix include hierarchy
    
    xen/livepatch.h includes public/sysctl.h twice, which can be deduplicated.
    xen/livepatch.h also includes asm/livepatch.h meaning that each livepatch.c
    does not need to include both.
    
    Comment the #else and #endif cases to aid legibility.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/arm/arm32/livepatch.c |  1 -
 xen/arch/arm/arm64/livepatch.c |  1 -
 xen/arch/arm/livepatch.c       |  1 -
 xen/arch/x86/livepatch.c       |  1 -
 xen/include/xen/livepatch.h    | 12 ++++++------
 5 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/arm32/livepatch.c b/xen/arch/arm/arm32/livepatch.c
index 134d07a175..8541c71d6e 100644
--- a/xen/arch/arm/arm32/livepatch.c
+++ b/xen/arch/arm/arm32/livepatch.c
@@ -9,7 +9,6 @@
 #include <xen/livepatch.h>
 
 #include <asm/page.h>
-#include <asm/livepatch.h>
 
 void arch_livepatch_apply(const struct livepatch_func *func,
                           struct livepatch_fstate *state)
diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
index e135bd5bf9..39159ba8b5 100644
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -13,7 +13,6 @@
 
 #include <asm/bitops.h>
 #include <asm/insn.h>
-#include <asm/livepatch.h>
 
 void arch_livepatch_apply(const struct livepatch_func *func,
                           struct livepatch_fstate *state)
diff --git a/xen/arch/arm/livepatch.c b/xen/arch/arm/livepatch.c
index 3805b29746..2fbb7bce60 100644
--- a/xen/arch/arm/livepatch.c
+++ b/xen/arch/arm/livepatch.c
@@ -11,7 +11,6 @@
 #include <xen/vmap.h>
 
 #include <asm/cpufeature.h>
-#include <asm/livepatch.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef virt_to_mfn
diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c
index be40f625d2..bdca355dc6 100644
--- a/xen/arch/x86/livepatch.c
+++ b/xen/arch/x86/livepatch.c
@@ -17,7 +17,6 @@
 #include <asm/endbr.h>
 #include <asm/fixmap.h>
 #include <asm/nmi.h>
-#include <asm/livepatch.h>
 #include <asm/setup.h>
 
 static bool has_active_waitqueue(const struct vm_event_domain *ved)
diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
index 45c8924f34..b40928c3e6 100644
--- a/xen/include/xen/livepatch.h
+++ b/xen/include/xen/livepatch.h
@@ -14,12 +14,14 @@ struct xen_sysctl_livepatch_op;
 #include <xen/elfstructs.h>
 #include <xen/errno.h> /* For -ENOSYS or -EOVERFLOW */
 
-#include <public/sysctl.h> /* For LIVEPATCH_OPAQUE_SIZE */
-
 #ifdef CONFIG_LIVEPATCH
 
 #include <xen/lib.h>
 
+#include <asm/livepatch.h>
+
+#include <public/sysctl.h>
+
 /*
  * We use alternative and exception table code - which by default are __init
  * only, however we need them during runtime. These macros allows us to build
@@ -93,8 +95,6 @@ int arch_livepatch_secure(const void *va, unsigned int pages, enum va_type type)
 
 void arch_livepatch_init(void);
 
-#include <public/sysctl.h> /* For struct livepatch_func. */
-#include <asm/livepatch.h>
 int arch_livepatch_verify_func(const struct livepatch_func *func);
 
 static inline
@@ -143,7 +143,7 @@ struct payload;
 int revert_payload(struct payload *data);
 void revert_payload_tail(struct payload *data);
 
-#else
+#else /* !CONFIG_LIVEPATCH */
 
 /*
  * If not compiling with Live Patch certain functionality should stay as
@@ -165,7 +165,7 @@ static inline bool is_patch(const void *addr)
 {
     return 0;
 }
-#endif /* CONFIG_LIVEPATCH */
+#endif /* !CONFIG_LIVEPATCH */
 
 #endif /* __XEN_LIVEPATCH_H__ */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 04 16:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Aug 2026 16:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1382478.1625836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrIQ6-0005p1-2S; Tue, 04 Aug 2026 16:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1382478.1625836; Tue, 04 Aug 2026 16:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrIQ5-0005os-Vk; Tue, 04 Aug 2026 16:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1382478;
 Tue, 04 Aug 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 1wrIQ4-0005ok-2K
 for xen-changelog@lists.xenproject.org; Tue, 04 Aug 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 1wrIQ4-004rKx-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 16:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrIQ4-00BEld-00
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 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=e608+L/tMEvmFriCRq9IFJaFX5uL/UGMWpRkyZksEWY=; b=DwrEAZYNZUWOm6ZCDZRZVRhFuf
	CcaE6zAUi7Qls2Q9tNffvXf3ipj2pwmeRbtj0/JAFwrAZ2ZOxuL8op3nzg4ksOXA6jC/oOUYpBaeg
	UJAdc012W2H2JJX5QiOb8+l8zef4H7MLMTd1Yk+vTvK1r9mATFgFltos0y7WBnxwU4cA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Sort includes
Message-Id: <E1wrIQ4-00BEld-00@xenbits.xenproject.org>
Date: Tue, 04 Aug 2026 16:55:12 +0000

commit 8efaec38d87db34957a0b8650b42cd40c1e4cfb7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 7 17:28:35 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 17:32:23 2026 +0100

    xen: Sort includes
    
    Drop types.h when it's clearly not needed.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 12 ++++++------
 xen/arch/x86/livepatch.c   |  8 ++++----
 xen/common/memory.c        |  3 ++-
 xen/common/page_alloc.c    |  5 ++---
 xen/include/xen/mm.h       |  6 +++---
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 5ed0c26725..95960b4a46 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -4,19 +4,19 @@
  */
 
 #include <xen/delay.h>
-#include <xen/types.h>
+#include <xen/init.h>
+#include <xen/livepatch.h>
+
+#include <asm/alternative.h>
 #include <asm/apic.h>
 #include <asm/endbr.h>
+#include <asm/nmi.h>
+#include <asm/nops.h>
 #include <asm/processor.h>
-#include <asm/alternative.h>
-#include <xen/init.h>
 #include <asm/setup.h>
 #include <asm/stubs.h>
 #include <asm/system.h>
 #include <asm/traps.h>
-#include <asm/nmi.h>
-#include <asm/nops.h>
-#include <xen/livepatch.h>
 
 #define MAX_PATCH_LEN (255-1)
 
diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c
index bdca355dc6..5158e91f7e 100644
--- a/xen/arch/x86/livepatch.c
+++ b/xen/arch/x86/livepatch.c
@@ -5,14 +5,14 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/livepatch.h>
+#include <xen/livepatch_elf.h>
 #include <xen/mm.h>
 #include <xen/pfn.h>
-#include <xen/vmap.h>
-#include <xen/livepatch_elf.h>
-#include <xen/livepatch.h>
 #include <xen/sched.h>
-#include <xen/vm_event.h>
 #include <xen/virtual_region.h>
+#include <xen/vm_event.h>
+#include <xen/vmap.h>
 
 #include <asm/endbr.h>
 #include <asm/fixmap.h>
diff --git a/xen/common/memory.c b/xen/common/memory.c
index e245b160d4..9443e35a7f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -26,14 +26,15 @@
 #include <xen/sched.h>
 #include <xen/sections.h>
 #include <xen/trace.h>
-#include <xen/types.h>
 #include <xen/xvmalloc.h>
 
 #include <asm/current.h>
 #include <asm/hardirq.h>
 #include <asm/p2m.h>
 #include <asm/page.h>
+
 #include <public/memory.h>
+
 #include <xsm/xsm.h>
 
 #ifdef CONFIG_X86
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 598222e2c2..1e47f38721 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -133,7 +133,6 @@
 #include <xen/param.h>
 #include <xen/perfc.h>
 #include <xen/pfn.h>
-#include <xen/types.h>
 #include <xen/sched.h>
 #include <xen/scrub.h>
 #include <xen/sections.h>
@@ -145,14 +144,14 @@
 #include <asm/flushtlb.h>
 #include <asm/page.h>
 
-#include <public/sysctl.h>
 #include <public/sched.h>
+#include <public/sysctl.h>
 
 #ifdef CONFIG_X86
 #include <asm/guest.h>
 #include <asm/p2m.h>
-#include <asm/setup.h> /* for highmem_start only */
 #include <asm/paging.h>
+#include <asm/setup.h>
 #else
 #define p2m_pod_offline_or_broken_hit(pg) 0
 #define p2m_pod_offline_or_broken_replace(pg) BUG_ON(pg)
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index b80bec00c1..fd8b0ba3f5 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -63,12 +63,12 @@
 
 #include <xen/bug.h>
 #include <xen/compiler.h>
+#include <xen/list.h>
 #include <xen/mm-frame.h>
 #include <xen/mm-types.h>
-#include <xen/types.h>
-#include <xen/list.h>
-#include <xen/spinlock.h>
 #include <xen/perfc.h>
+#include <xen/spinlock.h>
+
 #include <public/memory.h>
 
 struct page_info;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 04 16:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Aug 2026 16:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1382479.1625840 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrIQG-0005rS-3N; Tue, 04 Aug 2026 16:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1382479.1625840; Tue, 04 Aug 2026 16:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrIQG-0005rK-0m; Tue, 04 Aug 2026 16:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1382479;
 Tue, 04 Aug 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 1wrIQE-0005rB-7N
 for xen-changelog@lists.xenproject.org; Tue, 04 Aug 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 1wrIQE-004rLR-1T
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 16:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrIQE-00BEph-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 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=qeHj4HnngngLFtg0RPrxBeKaEbHkl9RgsW9zg9qPLV4=; b=j+xLQcFkl66t3TIEnDzYtYhFp4
	YudwKekSRYOl3SG+dRrJAZQjyhD0CcFHmYkLzvbTVC+HwOF+1GscUQbAQzaS4o+m6+vywcdWjLtv5
	ZEdlBn52GIMLM7XUx+jpoUT/X2PZ/EoUBwX5vcwprIYXcM2o6y2v0M3ouy/pVaV+hdNI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/livepatch: Move init_or_livepatch_* into xen/init.h
Message-Id: <E1wrIQE-00BEph-0L@xenbits.xenproject.org>
Date: Tue, 04 Aug 2026 16:55:22 +0000

commit 4ee301544edee3ec1a87894717511cc47b36dc0d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 3 15:46:45 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 17:32:23 2026 +0100

    xen/livepatch: Move init_or_livepatch_* into xen/init.h
    
    xen/livepatch.h is a fairly heavyweight header pulling in public/sysctl.h, and
    a reasonable number of users care only for the init_or_livepatch_* tags.
    
    They're arguably more init than livepatch anyway, and by moving them to
    init.h, we can remove a number of includes.
    
    The include in vsprintf was leftover from early versions of the work.  In the
    version committed, d5ccf4482e4f ("x86, xsplice: Print payload's symbol name
    and payload name in backtraces"), symbol_lookup() had been adjusted to handle
    the livepatch symbol names properly.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/riscv/extable.c    |  1 -
 xen/arch/x86/alternative.c  |  1 -
 xen/arch/x86/extable.c      |  1 -
 xen/arch/x86/mm.c           |  1 -
 xen/common/vsprintf.c       |  1 -
 xen/include/xen/init.h      | 19 +++++++++++++++++++
 xen/include/xen/livepatch.h | 21 ---------------------
 7 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/xen/arch/riscv/extable.c b/xen/arch/riscv/extable.c
index 77e5e9e894..5b89c4278c 100644
--- a/xen/arch/riscv/extable.c
+++ b/xen/arch/riscv/extable.c
@@ -3,7 +3,6 @@
 #include <xen/init.h>
 #include <xen/bsearch.h>
 #include <xen/lib.h>
-#include <xen/livepatch.h>
 #include <xen/sort.h>
 #include <xen/virtual_region.h>
 
diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 95960b4a46..c87665bffe 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -5,7 +5,6 @@
 
 #include <xen/delay.h>
 #include <xen/init.h>
-#include <xen/livepatch.h>
 
 #include <asm/alternative.h>
 #include <asm/apic.h>
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index e1c8c9fab8..1425ea1765 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -2,7 +2,6 @@
 #include <xen/domain_page.h>
 #include <xen/init.h>
 #include <xen/list.h>
-#include <xen/livepatch.h>
 #include <xen/perfc.h>
 #include <xen/rcupdate.h>
 #include <xen/sort.h>
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 511de4cc38..b158742408 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -101,7 +101,6 @@
 #include <xen/irq.h>
 #include <xen/kernel.h>
 #include <xen/lib.h>
-#include <xen/livepatch.h>
 #include <xen/mm.h>
 #include <xen/param.h>
 #include <xen/perfc.h>
diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c
index 612751c90f..90192fd9e8 100644
--- a/xen/common/vsprintf.c
+++ b/xen/common/vsprintf.c
@@ -20,7 +20,6 @@
 #include <xen/symbols.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
-#include <xen/livepatch.h>
 #include <asm/div64.h>
 #include <asm/page.h>
 
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 0c921672c1..2e5bea2bff 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -19,6 +19,25 @@
 #define __initdata_cf_clobber  __section(".init.data.cf_clobber")
 #define __initconst_cf_clobber __section(".init.rodata.cf_clobber")
 
+/*
+ * Various pieces of functionality are needed at runtime only if livepatching
+ * is enabled.  Provide tags which resolve to the appropriate section
+ * annotation in either configuration.
+ */
+#ifdef CONFIG_LIVEPATCH
+# define init_or_livepatch_const
+# define init_or_livepatch_constrel
+# define init_or_livepatch_data
+# define init_or_livepatch_read_mostly __read_mostly
+# define init_or_livepatch
+#else /* !CONFIG_LIVEPATCH */
+# define init_or_livepatch_const       __initconst
+# define init_or_livepatch_constrel    __initconstrel
+# define init_or_livepatch_data        __initdata
+# define init_or_livepatch_read_mostly __initdata
+# define init_or_livepatch             __init
+#endif /* !CONFIG_LIVEPATCH */
+
 /* These macros are used to mark some functions or 
  * initialized data (doesn't apply to uninitialized data)
  * as `initialization' functions. The kernel can take this
diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
index b40928c3e6..5dc8c61d37 100644
--- a/xen/include/xen/livepatch.h
+++ b/xen/include/xen/livepatch.h
@@ -22,17 +22,6 @@ struct xen_sysctl_livepatch_op;
 
 #include <public/sysctl.h>
 
-/*
- * We use alternative and exception table code - which by default are __init
- * only, however we need them during runtime. These macros allows us to build
- * the image with these functions built-in. (See the #else below).
- */
-#define init_or_livepatch_const
-#define init_or_livepatch_constrel
-#define init_or_livepatch_data
-#define init_or_livepatch_read_mostly __read_mostly
-#define init_or_livepatch
-
 /* Convenience define for printk. */
 #define LIVEPATCH             "livepatch: "
 /* ELF payload special section names. */
@@ -145,16 +134,6 @@ void revert_payload_tail(struct payload *data);
 
 #else /* !CONFIG_LIVEPATCH */
 
-/*
- * If not compiling with Live Patch certain functionality should stay as
- * __init.
- */
-#define init_or_livepatch_const       __initconst
-#define init_or_livepatch_constrel    __initconstrel
-#define init_or_livepatch_data        __initdata
-#define init_or_livepatch_read_mostly __initdata
-#define init_or_livepatch             __init
-
 static inline int livepatch_op(struct xen_sysctl_livepatch_op *op)
 {
     return -ENOSYS;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 04 18:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Aug 2026 18:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1382549.1625898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrJbS-0002BF-Hf; Tue, 04 Aug 2026 18:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1382549.1625898; Tue, 04 Aug 2026 18: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 1wrJbS-0002B7-F5; Tue, 04 Aug 2026 18:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1382549;
 Tue, 04 Aug 2026 18:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wrJbS-0002B1-36
 for xen-changelog@lists.xenproject.org; Tue, 04 Aug 2026 18: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 1wrJbS-004sji-07
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 18:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrJbR-00BVCp-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 18:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uRY/S24SfGtP3TUkQWHpXllDkBq6TPOI1RIkJ3E4nBc=; b=qeViDwuWLVNPg+3jcdO2JmrkdP
	WrEOQXWpz51TmB9/ios9mqWXwLZnsMDZvHrC8Y7VTmRuzfpE+2vNMtannsqjsigpGWIrLi+4wfe+u
	E+212/cQC2AUKKHF77lXNPtqcVZN+F1Av/peczDDGAZ2YXYX+G4RYHM7NtjeSptUTUCU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/livepatch: Fix include hierarchy
Message-Id: <E1wrJbR-00BVCp-2O@xenbits.xenproject.org>
Date: Tue, 04 Aug 2026 18:11:01 +0000

commit 2cb0ea59d2fbf06577e5506025d644e69d4cd229
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 7 14:55:37 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 17:32:23 2026 +0100

    xen/livepatch: Fix include hierarchy
    
    xen/livepatch.h includes public/sysctl.h twice, which can be deduplicated.
    xen/livepatch.h also includes asm/livepatch.h meaning that each livepatch.c
    does not need to include both.
    
    Comment the #else and #endif cases to aid legibility.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/arm/arm32/livepatch.c |  1 -
 xen/arch/arm/arm64/livepatch.c |  1 -
 xen/arch/arm/livepatch.c       |  1 -
 xen/arch/x86/livepatch.c       |  1 -
 xen/include/xen/livepatch.h    | 12 ++++++------
 5 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/arm32/livepatch.c b/xen/arch/arm/arm32/livepatch.c
index 134d07a175..8541c71d6e 100644
--- a/xen/arch/arm/arm32/livepatch.c
+++ b/xen/arch/arm/arm32/livepatch.c
@@ -9,7 +9,6 @@
 #include <xen/livepatch.h>
 
 #include <asm/page.h>
-#include <asm/livepatch.h>
 
 void arch_livepatch_apply(const struct livepatch_func *func,
                           struct livepatch_fstate *state)
diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
index e135bd5bf9..39159ba8b5 100644
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -13,7 +13,6 @@
 
 #include <asm/bitops.h>
 #include <asm/insn.h>
-#include <asm/livepatch.h>
 
 void arch_livepatch_apply(const struct livepatch_func *func,
                           struct livepatch_fstate *state)
diff --git a/xen/arch/arm/livepatch.c b/xen/arch/arm/livepatch.c
index 3805b29746..2fbb7bce60 100644
--- a/xen/arch/arm/livepatch.c
+++ b/xen/arch/arm/livepatch.c
@@ -11,7 +11,6 @@
 #include <xen/vmap.h>
 
 #include <asm/cpufeature.h>
-#include <asm/livepatch.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef virt_to_mfn
diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c
index be40f625d2..bdca355dc6 100644
--- a/xen/arch/x86/livepatch.c
+++ b/xen/arch/x86/livepatch.c
@@ -17,7 +17,6 @@
 #include <asm/endbr.h>
 #include <asm/fixmap.h>
 #include <asm/nmi.h>
-#include <asm/livepatch.h>
 #include <asm/setup.h>
 
 static bool has_active_waitqueue(const struct vm_event_domain *ved)
diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
index 45c8924f34..b40928c3e6 100644
--- a/xen/include/xen/livepatch.h
+++ b/xen/include/xen/livepatch.h
@@ -14,12 +14,14 @@ struct xen_sysctl_livepatch_op;
 #include <xen/elfstructs.h>
 #include <xen/errno.h> /* For -ENOSYS or -EOVERFLOW */
 
-#include <public/sysctl.h> /* For LIVEPATCH_OPAQUE_SIZE */
-
 #ifdef CONFIG_LIVEPATCH
 
 #include <xen/lib.h>
 
+#include <asm/livepatch.h>
+
+#include <public/sysctl.h>
+
 /*
  * We use alternative and exception table code - which by default are __init
  * only, however we need them during runtime. These macros allows us to build
@@ -93,8 +95,6 @@ int arch_livepatch_secure(const void *va, unsigned int pages, enum va_type type)
 
 void arch_livepatch_init(void);
 
-#include <public/sysctl.h> /* For struct livepatch_func. */
-#include <asm/livepatch.h>
 int arch_livepatch_verify_func(const struct livepatch_func *func);
 
 static inline
@@ -143,7 +143,7 @@ struct payload;
 int revert_payload(struct payload *data);
 void revert_payload_tail(struct payload *data);
 
-#else
+#else /* !CONFIG_LIVEPATCH */
 
 /*
  * If not compiling with Live Patch certain functionality should stay as
@@ -165,7 +165,7 @@ static inline bool is_patch(const void *addr)
 {
     return 0;
 }
-#endif /* CONFIG_LIVEPATCH */
+#endif /* !CONFIG_LIVEPATCH */
 
 #endif /* __XEN_LIVEPATCH_H__ */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 04 18:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Aug 2026 18:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1382550.1625902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrJbc-0002FX-J0; Tue, 04 Aug 2026 18:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1382550.1625902; Tue, 04 Aug 2026 18: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 1wrJbc-0002FP-GS; Tue, 04 Aug 2026 18:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1382550;
 Tue, 04 Aug 2026 18: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 1wrJbb-0002FA-U8
 for xen-changelog@lists.xenproject.org; Tue, 04 Aug 2026 18: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 1wrJbc-004sjm-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 18:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrJbb-00BVE2-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 18: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=o1zyuEM9xy/PrhHhi3w2PNobp7FKjmdRHxIh9Cg3ANc=; b=D4d/g2wxI8OWUbv4WGzBA3HfvE
	Xek+ElYhNNTg2jAiAOoZ5Gg9bv6O57UlmLk3DU+qAxfnbgDcwtdzjwPlZ3CSOdVBDdRwCKAPc5QDt
	JmKOTaW/dKfs4gcnoouXtqkJjcWkL6ULP6yuQwvIYQhjaly+Ztn73N6rWeRousUw1IO4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Sort includes
Message-Id: <E1wrJbb-00BVE2-2i@xenbits.xenproject.org>
Date: Tue, 04 Aug 2026 18:11:11 +0000

commit 8efaec38d87db34957a0b8650b42cd40c1e4cfb7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Mar 7 17:28:35 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 17:32:23 2026 +0100

    xen: Sort includes
    
    Drop types.h when it's clearly not needed.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 12 ++++++------
 xen/arch/x86/livepatch.c   |  8 ++++----
 xen/common/memory.c        |  3 ++-
 xen/common/page_alloc.c    |  5 ++---
 xen/include/xen/mm.h       |  6 +++---
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 5ed0c26725..95960b4a46 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -4,19 +4,19 @@
  */
 
 #include <xen/delay.h>
-#include <xen/types.h>
+#include <xen/init.h>
+#include <xen/livepatch.h>
+
+#include <asm/alternative.h>
 #include <asm/apic.h>
 #include <asm/endbr.h>
+#include <asm/nmi.h>
+#include <asm/nops.h>
 #include <asm/processor.h>
-#include <asm/alternative.h>
-#include <xen/init.h>
 #include <asm/setup.h>
 #include <asm/stubs.h>
 #include <asm/system.h>
 #include <asm/traps.h>
-#include <asm/nmi.h>
-#include <asm/nops.h>
-#include <xen/livepatch.h>
 
 #define MAX_PATCH_LEN (255-1)
 
diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c
index bdca355dc6..5158e91f7e 100644
--- a/xen/arch/x86/livepatch.c
+++ b/xen/arch/x86/livepatch.c
@@ -5,14 +5,14 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/livepatch.h>
+#include <xen/livepatch_elf.h>
 #include <xen/mm.h>
 #include <xen/pfn.h>
-#include <xen/vmap.h>
-#include <xen/livepatch_elf.h>
-#include <xen/livepatch.h>
 #include <xen/sched.h>
-#include <xen/vm_event.h>
 #include <xen/virtual_region.h>
+#include <xen/vm_event.h>
+#include <xen/vmap.h>
 
 #include <asm/endbr.h>
 #include <asm/fixmap.h>
diff --git a/xen/common/memory.c b/xen/common/memory.c
index e245b160d4..9443e35a7f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -26,14 +26,15 @@
 #include <xen/sched.h>
 #include <xen/sections.h>
 #include <xen/trace.h>
-#include <xen/types.h>
 #include <xen/xvmalloc.h>
 
 #include <asm/current.h>
 #include <asm/hardirq.h>
 #include <asm/p2m.h>
 #include <asm/page.h>
+
 #include <public/memory.h>
+
 #include <xsm/xsm.h>
 
 #ifdef CONFIG_X86
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 598222e2c2..1e47f38721 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -133,7 +133,6 @@
 #include <xen/param.h>
 #include <xen/perfc.h>
 #include <xen/pfn.h>
-#include <xen/types.h>
 #include <xen/sched.h>
 #include <xen/scrub.h>
 #include <xen/sections.h>
@@ -145,14 +144,14 @@
 #include <asm/flushtlb.h>
 #include <asm/page.h>
 
-#include <public/sysctl.h>
 #include <public/sched.h>
+#include <public/sysctl.h>
 
 #ifdef CONFIG_X86
 #include <asm/guest.h>
 #include <asm/p2m.h>
-#include <asm/setup.h> /* for highmem_start only */
 #include <asm/paging.h>
+#include <asm/setup.h>
 #else
 #define p2m_pod_offline_or_broken_hit(pg) 0
 #define p2m_pod_offline_or_broken_replace(pg) BUG_ON(pg)
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index b80bec00c1..fd8b0ba3f5 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -63,12 +63,12 @@
 
 #include <xen/bug.h>
 #include <xen/compiler.h>
+#include <xen/list.h>
 #include <xen/mm-frame.h>
 #include <xen/mm-types.h>
-#include <xen/types.h>
-#include <xen/list.h>
-#include <xen/spinlock.h>
 #include <xen/perfc.h>
+#include <xen/spinlock.h>
+
 #include <public/memory.h>
 
 struct page_info;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 04 18:11:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Aug 2026 18:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1382552.1625905 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrJbm-0002I6-Lb; Tue, 04 Aug 2026 18:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1382552.1625905; Tue, 04 Aug 2026 18: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 1wrJbm-0002Hy-J0; Tue, 04 Aug 2026 18:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1382552;
 Tue, 04 Aug 2026 18: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 1wrJbm-0002Hr-2o
 for xen-changelog@lists.xenproject.org; Tue, 04 Aug 2026 18: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 1wrJbm-004sk9-11
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 18:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrJbl-00BVFA-35
 for xen-changelog@lists.xenproject.org;
 Tue, 04 Aug 2026 18: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=l8T9PWQAtxDk1Pun7sXlpRLjwE6kIIHgJ8H5e3ZfLmc=; b=BU6QoClaIgYtUhFdI/S9Ych3R4
	dguH9oj3gKznxfv7ZDraqtUOETy39q5c+lEdWqI7PnXXLuMc+jR3LlgxjXkJc6jpC5WzIAccxjZSf
	7Hx0cXEK1M7RL5Bict5884HonLtikKrk240m8I3csdIa8BdcG+jJpliaOYVdr8VCUcg0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/livepatch: Move init_or_livepatch_* into xen/init.h
Message-Id: <E1wrJbl-00BVFA-35@xenbits.xenproject.org>
Date: Tue, 04 Aug 2026 18:11:21 +0000

commit 4ee301544edee3ec1a87894717511cc47b36dc0d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 3 15:46:45 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 17:32:23 2026 +0100

    xen/livepatch: Move init_or_livepatch_* into xen/init.h
    
    xen/livepatch.h is a fairly heavyweight header pulling in public/sysctl.h, and
    a reasonable number of users care only for the init_or_livepatch_* tags.
    
    They're arguably more init than livepatch anyway, and by moving them to
    init.h, we can remove a number of includes.
    
    The include in vsprintf was leftover from early versions of the work.  In the
    version committed, d5ccf4482e4f ("x86, xsplice: Print payload's symbol name
    and payload name in backtraces"), symbol_lookup() had been adjusted to handle
    the livepatch symbol names properly.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/riscv/extable.c    |  1 -
 xen/arch/x86/alternative.c  |  1 -
 xen/arch/x86/extable.c      |  1 -
 xen/arch/x86/mm.c           |  1 -
 xen/common/vsprintf.c       |  1 -
 xen/include/xen/init.h      | 19 +++++++++++++++++++
 xen/include/xen/livepatch.h | 21 ---------------------
 7 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/xen/arch/riscv/extable.c b/xen/arch/riscv/extable.c
index 77e5e9e894..5b89c4278c 100644
--- a/xen/arch/riscv/extable.c
+++ b/xen/arch/riscv/extable.c
@@ -3,7 +3,6 @@
 #include <xen/init.h>
 #include <xen/bsearch.h>
 #include <xen/lib.h>
-#include <xen/livepatch.h>
 #include <xen/sort.h>
 #include <xen/virtual_region.h>
 
diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 95960b4a46..c87665bffe 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -5,7 +5,6 @@
 
 #include <xen/delay.h>
 #include <xen/init.h>
-#include <xen/livepatch.h>
 
 #include <asm/alternative.h>
 #include <asm/apic.h>
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index e1c8c9fab8..1425ea1765 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -2,7 +2,6 @@
 #include <xen/domain_page.h>
 #include <xen/init.h>
 #include <xen/list.h>
-#include <xen/livepatch.h>
 #include <xen/perfc.h>
 #include <xen/rcupdate.h>
 #include <xen/sort.h>
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 511de4cc38..b158742408 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -101,7 +101,6 @@
 #include <xen/irq.h>
 #include <xen/kernel.h>
 #include <xen/lib.h>
-#include <xen/livepatch.h>
 #include <xen/mm.h>
 #include <xen/param.h>
 #include <xen/perfc.h>
diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c
index 612751c90f..90192fd9e8 100644
--- a/xen/common/vsprintf.c
+++ b/xen/common/vsprintf.c
@@ -20,7 +20,6 @@
 #include <xen/symbols.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
-#include <xen/livepatch.h>
 #include <asm/div64.h>
 #include <asm/page.h>
 
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 0c921672c1..2e5bea2bff 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -19,6 +19,25 @@
 #define __initdata_cf_clobber  __section(".init.data.cf_clobber")
 #define __initconst_cf_clobber __section(".init.rodata.cf_clobber")
 
+/*
+ * Various pieces of functionality are needed at runtime only if livepatching
+ * is enabled.  Provide tags which resolve to the appropriate section
+ * annotation in either configuration.
+ */
+#ifdef CONFIG_LIVEPATCH
+# define init_or_livepatch_const
+# define init_or_livepatch_constrel
+# define init_or_livepatch_data
+# define init_or_livepatch_read_mostly __read_mostly
+# define init_or_livepatch
+#else /* !CONFIG_LIVEPATCH */
+# define init_or_livepatch_const       __initconst
+# define init_or_livepatch_constrel    __initconstrel
+# define init_or_livepatch_data        __initdata
+# define init_or_livepatch_read_mostly __initdata
+# define init_or_livepatch             __init
+#endif /* !CONFIG_LIVEPATCH */
+
 /* These macros are used to mark some functions or 
  * initialized data (doesn't apply to uninitialized data)
  * as `initialization' functions. The kernel can take this
diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
index b40928c3e6..5dc8c61d37 100644
--- a/xen/include/xen/livepatch.h
+++ b/xen/include/xen/livepatch.h
@@ -22,17 +22,6 @@ struct xen_sysctl_livepatch_op;
 
 #include <public/sysctl.h>
 
-/*
- * We use alternative and exception table code - which by default are __init
- * only, however we need them during runtime. These macros allows us to build
- * the image with these functions built-in. (See the #else below).
- */
-#define init_or_livepatch_const
-#define init_or_livepatch_constrel
-#define init_or_livepatch_data
-#define init_or_livepatch_read_mostly __read_mostly
-#define init_or_livepatch
-
 /* Convenience define for printk. */
 #define LIVEPATCH             "livepatch: "
 /* ELF payload special section names. */
@@ -145,16 +134,6 @@ void revert_payload_tail(struct payload *data);
 
 #else /* !CONFIG_LIVEPATCH */
 
-/*
- * If not compiling with Live Patch certain functionality should stay as
- * __init.
- */
-#define init_or_livepatch_const       __initconst
-#define init_or_livepatch_constrel    __initconstrel
-#define init_or_livepatch_data        __initdata
-#define init_or_livepatch_read_mostly __initdata
-#define init_or_livepatch             __init
-
 static inline int livepatch_op(struct xen_sysctl_livepatch_op *op)
 {
     return -ENOSYS;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 09:55:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 09:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383227.1626486 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrYL2-0007F1-56; Wed, 05 Aug 2026 09:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383227.1626486; Wed, 05 Aug 2026 09:55:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrYL2-0007Et-2T; Wed, 05 Aug 2026 09:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1383227;
 Wed, 05 Aug 2026 09:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wrYL0-0007En-HF
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 09:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrYL0-006IRP-1i
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 09:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrYL0-00FMzM-0l
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 09:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bCUaItkZjkQRkELd3dG0Upr4yyV3rwDzImjjJ7zhsoA=; b=7PFNg2einLRFW8cl7yNy8YInoD
	fUNEYrwuWdBeT6eeBKXipTAxppKKrL3n8XR6JsSDj4O2kfqpngYPpEYuhFQnsxL5EpSafzWdlZXzy
	cMDUymy+1J7G06X5zo0WwcVwQEa4fvKvVcKdUH2m79UpudRTrTkxL5pu1KWwhvhlO7zk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/alternatives: Factor out access to ideal_nops[]
Message-Id: <E1wrYL0-00FMzM-0l@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 09:55:02 +0000

commit 0d32eb28447ebc9800d53a573839dbc4441cc3b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 21 22:40:52 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 18:15:59 2026 +0100

    x86/alternatives: Factor out access to ideal_nops[]
    
    ... in order to rework the calculation.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index c87665bffe..f0644055d3 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -86,6 +86,11 @@ static bool init_or_livepatch_read_mostly toolchain_nops_are_ideal;
 # define toolchain_nops_are_ideal false
 #endif
 
+static const unsigned char *init_or_livepatch get_ideal_nops(unsigned int noplen)
+{
+    return ideal_nops[noplen];
+}
+
 static void __init arch_init_ideal_nops(void)
 {
     switch ( boot_cpu_data.vendor )
@@ -116,7 +121,7 @@ static void __init arch_init_ideal_nops(void)
     }
 
 #ifdef HAVE_AS_NOPS_DIRECTIVE
-    if ( memcmp(ideal_nops[ASM_NOP_MAX], toolchain_nops, ASM_NOP_MAX) == 0 )
+    if ( memcmp(get_ideal_nops(ASM_NOP_MAX), toolchain_nops, ASM_NOP_MAX) == 0 )
         toolchain_nops_are_ideal = true;
 #endif
 }
@@ -127,9 +132,11 @@ void init_or_livepatch add_nops(void *insns, unsigned int len)
     while ( len > 0 )
     {
         unsigned int noplen = len;
+
         if ( noplen > ASM_NOP_MAX )
             noplen = ASM_NOP_MAX;
-        memcpy(insns, ideal_nops[noplen], noplen);
+
+        memcpy(insns, get_ideal_nops(noplen), noplen);
         insns += noplen;
         len -= noplen;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 09:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 09:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383228.1626490 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrYLC-0007Gn-6O; Wed, 05 Aug 2026 09:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383228.1626490; Wed, 05 Aug 2026 09:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrYLC-0007Gf-3j; Wed, 05 Aug 2026 09:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1383228;
 Wed, 05 Aug 2026 09:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wrYLA-0007GT-Eb
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 09:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrYLA-006IRW-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 09:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrYLA-00FN2a-14
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 09:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SS9mKgC0G1pTfndqfN2McMTSpn/UyzSu62I0NBYisw8=; b=Wjhw0MwjjcJoSzr7YZY9GeQd1Q
	IQl1wjOxRSf0jErz2aPqX6vLQvG5Kl8txE4tpFNPgrIoJtE1o7Y/QuNK18E0gI2cmLTgFlXtM/ESf
	GdShibQuFM3telZkz4Liv9CWJzXud4FSlANoGfg0cHDE+O6mzYOWxl1STUvh93CwMQ58=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/alternatives: Rework get_ideal_nops()
Message-Id: <E1wrYLA-00FN2a-14@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 09:55:12 +0000

commit ea20eafb46cafbe5c64364c9f3a2660a8209a141
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 21 22:36:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Aug 5 09:49:32 2026 +0100

    x86/alternatives: Rework get_ideal_nops()
    
    The {k8,p6}_nops[] arrays are both 80-byte structures indexing 45-byte
    structures.  Furthermore, perhaps unusually for C, the source layout is an
    obvious hint about the triangular nature of the structure.
    
    Therefore, we can replace the pointer chase with some simple arithmetic.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 48 +++++++++++++++++++---------------------------
 1 file changed, 20 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index f0644055d3..30c5ccaa8b 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -20,7 +20,7 @@
 #define MAX_PATCH_LEN (255-1)
 
 #ifdef K8_NOP1
-static const unsigned char k8nops[] init_or_livepatch_const = {
+static const unsigned char k8_nops[] init_or_livepatch_const = {
     K8_NOP1,
     K8_NOP2,
     K8_NOP3,
@@ -31,22 +31,10 @@ static const unsigned char k8nops[] init_or_livepatch_const = {
     K8_NOP8,
     K8_NOP9,
 };
-static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
-    NULL,
-    k8nops,
-    k8nops + 1,
-    k8nops + 1 + 2,
-    k8nops + 1 + 2 + 3,
-    k8nops + 1 + 2 + 3 + 4,
-    k8nops + 1 + 2 + 3 + 4 + 5,
-    k8nops + 1 + 2 + 3 + 4 + 5 + 6,
-    k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
-    k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8,
-};
 #endif
 
 #ifdef P6_NOP1
-static const unsigned char p6nops[] init_or_livepatch_const = {
+static const unsigned char p6_nops[] init_or_livepatch_const = {
     P6_NOP1,
     P6_NOP2,
     P6_NOP3,
@@ -57,21 +45,9 @@ static const unsigned char p6nops[] init_or_livepatch_const = {
     P6_NOP8,
     P6_NOP9,
 };
-static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
-    NULL,
-    p6nops,
-    p6nops + 1,
-    p6nops + 1 + 2,
-    p6nops + 1 + 2 + 3,
-    p6nops + 1 + 2 + 3 + 4,
-    p6nops + 1 + 2 + 3 + 4 + 5,
-    p6nops + 1 + 2 + 3 + 4 + 5 + 6,
-    p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
-    p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8,
-};
 #endif
 
-static const unsigned char * const *ideal_nops init_or_livepatch_data = p6_nops;
+static const unsigned char *ideal_nops init_or_livepatch_data = p6_nops;
 
 #ifdef HAVE_AS_NOPS_DIRECTIVE
 
@@ -86,9 +62,19 @@ static bool init_or_livepatch_read_mostly toolchain_nops_are_ideal;
 # define toolchain_nops_are_ideal false
 #endif
 
+#define TRIANGLE(x) (((x) * ((x) + 1)) / 2)
+
+/*
+ * Both k8_nops[] and p6_nops[] are flattened triangular data structures,
+ * making the offsets easy to calculate.
+ *
+ * To get the start of NOP $N, we want to calculate TRIANGLE($N - 1)
+ */
 static const unsigned char *init_or_livepatch get_ideal_nops(unsigned int noplen)
 {
-    return ideal_nops[noplen];
+    unsigned int offset = TRIANGLE(noplen - 1);
+
+    return &ideal_nops[offset];
 }
 
 static void __init arch_init_ideal_nops(void)
@@ -601,3 +587,9 @@ void __init boot_apply_alt_calls(void)
     _alternative_instructions(ALT_CALLS);
     local_irq_enable();
 }
+
+static void __init __maybe_unused build_assertions(void)
+{
+    BUILD_BUG_ON(ARRAY_SIZE(k8_nops) != TRIANGLE(ASM_NOP_MAX));
+    BUILD_BUG_ON(ARRAY_SIZE(p6_nops) != TRIANGLE(ASM_NOP_MAX));
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 09:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 09:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383230.1626503 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrYLL-0007Vr-Dh; Wed, 05 Aug 2026 09:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383230.1626503; Wed, 05 Aug 2026 09: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 1wrYLL-0007Vh-Az; Wed, 05 Aug 2026 09:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1383230;
 Wed, 05 Aug 2026 09: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 1wrYLK-0007VT-Hd
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 09: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 1wrYLK-006IRd-2U
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 09:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrYLK-00FN9B-1X
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 09:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WC0X7nqKUoPEMnYkDyzgpDpaY75dM7CpIYAKXpT9ySo=; b=0QVBl3gBEYiWGNSq29L4MNpYCL
	4ZGAJ7dHVzymL5Mh3JfYk6hyGLwfkPrhXZDgpBqb5WGD6/DW1d1nTt8YdbJICHChhWNQyOnU0XQJO
	3+S48vuOyhA2UCt5BIlZuDh0LcNN8YGhexWGo64tRbTityLKefgzOr0bbX9ZLGTMSZyE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/alternatives: Introduce init_or_livepatch_ro_after_init
Message-Id: <E1wrYLK-00FN9B-1X@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 09:55:22 +0000

commit 0dc67f3aab0a080b756f9e54b8a58a4a887f702b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 21 22:36:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Aug 5 09:49:45 2026 +0100

    x86/alternatives: Introduce init_or_livepatch_ro_after_init
    
    ... and use it for ideal_nops and toolchain_nops_are_ideal; both of which are
    invariant after arch_init_ideal_nops() has run.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c |  4 ++--
 xen/include/xen/init.h     | 14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 30c5ccaa8b..5709c0b514 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -47,7 +47,7 @@ static const unsigned char p6_nops[] init_or_livepatch_const = {
 };
 #endif
 
-static const unsigned char *ideal_nops init_or_livepatch_data = p6_nops;
+static const unsigned char *init_or_livepatch_ro_after_init ideal_nops = p6_nops;
 
 #ifdef HAVE_AS_NOPS_DIRECTIVE
 
@@ -56,7 +56,7 @@ asm ( ".pushsection .init.rodata, \"a\", @progbits\n\t"
       "toolchain_nops: .nops " __stringify(ASM_NOP_MAX) "\n\t"
       ".popsection\n\t");
 extern char toolchain_nops[ASM_NOP_MAX];
-static bool init_or_livepatch_read_mostly toolchain_nops_are_ideal;
+static bool init_or_livepatch_ro_after_init toolchain_nops_are_ideal;
 
 #else
 # define toolchain_nops_are_ideal false
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 2e5bea2bff..caf37fed0e 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -28,14 +28,16 @@
 # define init_or_livepatch_const
 # define init_or_livepatch_constrel
 # define init_or_livepatch_data
-# define init_or_livepatch_read_mostly __read_mostly
+# define init_or_livepatch_read_mostly      __read_mostly
+# define init_or_livepatch_ro_after_init    __ro_after_init
 # define init_or_livepatch
 #else /* !CONFIG_LIVEPATCH */
-# define init_or_livepatch_const       __initconst
-# define init_or_livepatch_constrel    __initconstrel
-# define init_or_livepatch_data        __initdata
-# define init_or_livepatch_read_mostly __initdata
-# define init_or_livepatch             __init
+# define init_or_livepatch_const            __initconst
+# define init_or_livepatch_constrel         __initconstrel
+# define init_or_livepatch_data             __initdata
+# define init_or_livepatch_read_mostly      __initdata
+# define init_or_livepatch_ro_after_init    __initdata
+# define init_or_livepatch                  __init
 #endif /* !CONFIG_LIVEPATCH */
 
 /* These macros are used to mark some functions or 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 11:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 11:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383327.1626578 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wraDA-0002oE-5V; Wed, 05 Aug 2026 11:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383327.1626578; Wed, 05 Aug 2026 11: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 1wraDA-0002o6-2s; Wed, 05 Aug 2026 11:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1383327;
 Wed, 05 Aug 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 1wraD8-0002ny-EX
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 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 1wraD8-006KeL-1E
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wraD8-00G5F7-0F
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 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=tyUYx/o2F9J1ch9tlaUU1fno8vykllhvGWtn5gG0oBM=; b=HQJUHAZQoyRlNDG4AZvAeijcTm
	PgyWCbI8SxLZLQEmoH+kA4kB0YEnqJIn7E9AJeCxk1JYUwkWXixuvm5kST741K9eVJ1GvFkHMhzZz
	0ZKPsRRvSjOwY8Hh0ikVVzcTcdh5Rm/KBsAuo4HDZjLnDKPv9EbvXiSeH6nxAcU05FnQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vtd: Print originating iommu on faults
Message-Id: <E1wraD8-00G5F7-0F@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 11:55:02 +0000

commit 7a091bd8b04a56afbf8b2a3e7f9a807fc2ba7ce4
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Wed Aug 5 11:59:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 5 11:59:31 2026 +0200

    vtd: Print originating iommu on faults
    
    When a fault occurs on an IOMMU, print the IOMMU the fault is coming from.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 3d6f787b3c..b41a1d41c8 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,8 +991,8 @@ static int iommu_page_fault_do_one(struct vtd_iommu *iommu, int type,
         break;
     }
 
-    printk(XENLOG_G_WARNING VTDPREFIX "%s: reason %02x - %s\n",
-           kind, fault_reason, reason);
+    printk(XENLOG_G_WARNING VTDPREFIX "%s: reason %02x - %s on iommu:%u\n",
+           kind, fault_reason, reason, iommu->index);
 
     if ( iommu_verbose && fault_type == DMA_REMAP )
         print_vtd_entries(iommu, PCI_BUS(source_id), PCI_DEVFN(source_id),
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 11:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 11:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383328.1626583 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wraDJ-0002pt-6i; Wed, 05 Aug 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 1383328.1626583; Wed, 05 Aug 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 1wraDJ-0002pl-4E; Wed, 05 Aug 2026 11:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1383328;
 Wed, 05 Aug 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 1wraDI-0002pf-8M
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 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 1wraDI-006KeR-1Z
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wraDI-00G5Gi-0a
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 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=dj3X2LPOJgqAuN0Nu0LvuJoU/PVw199D4qRO4aFsRBc=; b=JSYmImLDqxNB7xZK/j7wzQyd2i
	OR8tgWlwD3nsc9dPQOUyPLRHV0V2RFCbC2u2u3aoor+SQIRp0h++3Qr80aOQ8gK+w6BFkTspCTjhF
	3OFsIbveN6ih3R64uBp36KtO4a/3cPRtxdUx+dSNYrB4GoQWnrjg5dVp6uU/JMzep+Po=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wraDI-00G5Gi-0a@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 11:55:12 +0000

commit 1077a93425d2dcca894883cf8565ee9ecf1672cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 5 12:00:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 5 12:00:17 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index ca610d36fc..bc1e8d0c04 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -80,7 +74,16 @@ static void radix_tree_node_free(struct radix_tree_node *node)
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -705,27 +708,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 12:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 12:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383384.1626641 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrayZ-0004CZ-VR; Wed, 05 Aug 2026 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383384.1626641; Wed, 05 Aug 2026 12:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrayZ-0004CQ-St; Wed, 05 Aug 2026 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1383384;
 Wed, 05 Aug 2026 12:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wrayY-0004CH-En
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrayY-006LX8-1N
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrayY-00GOAd-0N
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5BlPSpPUkcFDK9cemhbnb//2EbMt42fJURkrmPOC/xc=; b=PObpnjRr0Wq0KAFWB4z0uBQHwc
	r2NpJ09q85mFisPt6ruCuhdRN33XVB4/399lREV2TXgCXNuBwjRKnjq6Z2nOtxIMSOix36B00lTWh
	Ypd+sOGYORM3wCsmn+VH1vC8g8dmhBzX2soXkQY7F8oHPoSMv29H1BD1vKGJk7IxxaTE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/alternatives: Factor out access to ideal_nops[]
Message-Id: <E1wrayY-00GOAd-0N@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 12:44:02 +0000

commit 0d32eb28447ebc9800d53a573839dbc4441cc3b2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 21 22:40:52 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 4 18:15:59 2026 +0100

    x86/alternatives: Factor out access to ideal_nops[]
    
    ... in order to rework the calculation.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index c87665bffe..f0644055d3 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -86,6 +86,11 @@ static bool init_or_livepatch_read_mostly toolchain_nops_are_ideal;
 # define toolchain_nops_are_ideal false
 #endif
 
+static const unsigned char *init_or_livepatch get_ideal_nops(unsigned int noplen)
+{
+    return ideal_nops[noplen];
+}
+
 static void __init arch_init_ideal_nops(void)
 {
     switch ( boot_cpu_data.vendor )
@@ -116,7 +121,7 @@ static void __init arch_init_ideal_nops(void)
     }
 
 #ifdef HAVE_AS_NOPS_DIRECTIVE
-    if ( memcmp(ideal_nops[ASM_NOP_MAX], toolchain_nops, ASM_NOP_MAX) == 0 )
+    if ( memcmp(get_ideal_nops(ASM_NOP_MAX), toolchain_nops, ASM_NOP_MAX) == 0 )
         toolchain_nops_are_ideal = true;
 #endif
 }
@@ -127,9 +132,11 @@ void init_or_livepatch add_nops(void *insns, unsigned int len)
     while ( len > 0 )
     {
         unsigned int noplen = len;
+
         if ( noplen > ASM_NOP_MAX )
             noplen = ASM_NOP_MAX;
-        memcpy(insns, ideal_nops[noplen], noplen);
+
+        memcpy(insns, get_ideal_nops(noplen), noplen);
         insns += noplen;
         len -= noplen;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 12:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 12:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383385.1626645 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrayk-0004Ej-0P; Wed, 05 Aug 2026 12:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383385.1626645; Wed, 05 Aug 2026 12:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrayj-0004Eb-UA; Wed, 05 Aug 2026 12:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1383385;
 Wed, 05 Aug 2026 12:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wrayi-0004EQ-9S
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 12:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrayi-006LXJ-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrayi-00GODy-0k
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JwIqBztLRhNmnBGpLbWlZ95Q69ui6jbSxZ9dz9Ad4l0=; b=q9hiG9p2+uuhwju2OjmPabfIT6
	uA1OH8N/+7oKzxMCNajGUVsrXfFLdg1VLicL6cCN9tx2v7E/pFHDeG0u4N+ntFc4iJZFPXjxuSi1r
	fMs4TUINMgXxAKY1su7hfxYX1RCV6foj+fm2eZzRkir2ftPORKM2F0B1p2XwHKbb1eD4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/alternatives: Rework get_ideal_nops()
Message-Id: <E1wrayi-00GODy-0k@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 12:44:12 +0000

commit ea20eafb46cafbe5c64364c9f3a2660a8209a141
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 21 22:36:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Aug 5 09:49:32 2026 +0100

    x86/alternatives: Rework get_ideal_nops()
    
    The {k8,p6}_nops[] arrays are both 80-byte structures indexing 45-byte
    structures.  Furthermore, perhaps unusually for C, the source layout is an
    obvious hint about the triangular nature of the structure.
    
    Therefore, we can replace the pointer chase with some simple arithmetic.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c | 48 +++++++++++++++++++---------------------------
 1 file changed, 20 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index f0644055d3..30c5ccaa8b 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -20,7 +20,7 @@
 #define MAX_PATCH_LEN (255-1)
 
 #ifdef K8_NOP1
-static const unsigned char k8nops[] init_or_livepatch_const = {
+static const unsigned char k8_nops[] init_or_livepatch_const = {
     K8_NOP1,
     K8_NOP2,
     K8_NOP3,
@@ -31,22 +31,10 @@ static const unsigned char k8nops[] init_or_livepatch_const = {
     K8_NOP8,
     K8_NOP9,
 };
-static const unsigned char * const k8_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
-    NULL,
-    k8nops,
-    k8nops + 1,
-    k8nops + 1 + 2,
-    k8nops + 1 + 2 + 3,
-    k8nops + 1 + 2 + 3 + 4,
-    k8nops + 1 + 2 + 3 + 4 + 5,
-    k8nops + 1 + 2 + 3 + 4 + 5 + 6,
-    k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
-    k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8,
-};
 #endif
 
 #ifdef P6_NOP1
-static const unsigned char p6nops[] init_or_livepatch_const = {
+static const unsigned char p6_nops[] init_or_livepatch_const = {
     P6_NOP1,
     P6_NOP2,
     P6_NOP3,
@@ -57,21 +45,9 @@ static const unsigned char p6nops[] init_or_livepatch_const = {
     P6_NOP8,
     P6_NOP9,
 };
-static const unsigned char * const p6_nops[ASM_NOP_MAX+1] init_or_livepatch_constrel = {
-    NULL,
-    p6nops,
-    p6nops + 1,
-    p6nops + 1 + 2,
-    p6nops + 1 + 2 + 3,
-    p6nops + 1 + 2 + 3 + 4,
-    p6nops + 1 + 2 + 3 + 4 + 5,
-    p6nops + 1 + 2 + 3 + 4 + 5 + 6,
-    p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
-    p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8,
-};
 #endif
 
-static const unsigned char * const *ideal_nops init_or_livepatch_data = p6_nops;
+static const unsigned char *ideal_nops init_or_livepatch_data = p6_nops;
 
 #ifdef HAVE_AS_NOPS_DIRECTIVE
 
@@ -86,9 +62,19 @@ static bool init_or_livepatch_read_mostly toolchain_nops_are_ideal;
 # define toolchain_nops_are_ideal false
 #endif
 
+#define TRIANGLE(x) (((x) * ((x) + 1)) / 2)
+
+/*
+ * Both k8_nops[] and p6_nops[] are flattened triangular data structures,
+ * making the offsets easy to calculate.
+ *
+ * To get the start of NOP $N, we want to calculate TRIANGLE($N - 1)
+ */
 static const unsigned char *init_or_livepatch get_ideal_nops(unsigned int noplen)
 {
-    return ideal_nops[noplen];
+    unsigned int offset = TRIANGLE(noplen - 1);
+
+    return &ideal_nops[offset];
 }
 
 static void __init arch_init_ideal_nops(void)
@@ -601,3 +587,9 @@ void __init boot_apply_alt_calls(void)
     _alternative_instructions(ALT_CALLS);
     local_irq_enable();
 }
+
+static void __init __maybe_unused build_assertions(void)
+{
+    BUILD_BUG_ON(ARRAY_SIZE(k8_nops) != TRIANGLE(ASM_NOP_MAX));
+    BUILD_BUG_ON(ARRAY_SIZE(p6_nops) != TRIANGLE(ASM_NOP_MAX));
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 12:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 12:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383386.1626649 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrayu-0004H8-2T; Wed, 05 Aug 2026 12:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383386.1626649; Wed, 05 Aug 2026 12:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrayt-0004Gx-Vh; Wed, 05 Aug 2026 12:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1383386;
 Wed, 05 Aug 2026 12:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wrays-0004Gq-CU
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 12:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrays-006LXN-1y
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrays-00GOI8-11
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2LzxIiE3YyGVS6dVA+GSPumuAykeWtW57Q+4r8l742I=; b=mFK0mMxhLl3nDhzdn9I5xfGi7U
	jnGU2wpeF2kGT/TaxgRJh99yeuM5i9cnxLfCCl/1tBLjswy7TVxiV0wzyJIoJx11sUEHwMrgnsJFn
	mBVQSKBnhj3ZN8QUTufK/MF+TbKmNMfptUBzI0kVDvbt8Hs3roxueqGWyqMRHY+8kdMI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/alternatives: Introduce init_or_livepatch_ro_after_init
Message-Id: <E1wrays-00GOI8-11@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 12:44:22 +0000

commit 0dc67f3aab0a080b756f9e54b8a58a4a887f702b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 21 22:36:45 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Aug 5 09:49:45 2026 +0100

    x86/alternatives: Introduce init_or_livepatch_ro_after_init
    
    ... and use it for ideal_nops and toolchain_nops_are_ideal; both of which are
    invariant after arch_init_ideal_nops() has run.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/alternative.c |  4 ++--
 xen/include/xen/init.h     | 14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 30c5ccaa8b..5709c0b514 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -47,7 +47,7 @@ static const unsigned char p6_nops[] init_or_livepatch_const = {
 };
 #endif
 
-static const unsigned char *ideal_nops init_or_livepatch_data = p6_nops;
+static const unsigned char *init_or_livepatch_ro_after_init ideal_nops = p6_nops;
 
 #ifdef HAVE_AS_NOPS_DIRECTIVE
 
@@ -56,7 +56,7 @@ asm ( ".pushsection .init.rodata, \"a\", @progbits\n\t"
       "toolchain_nops: .nops " __stringify(ASM_NOP_MAX) "\n\t"
       ".popsection\n\t");
 extern char toolchain_nops[ASM_NOP_MAX];
-static bool init_or_livepatch_read_mostly toolchain_nops_are_ideal;
+static bool init_or_livepatch_ro_after_init toolchain_nops_are_ideal;
 
 #else
 # define toolchain_nops_are_ideal false
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index 2e5bea2bff..caf37fed0e 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -28,14 +28,16 @@
 # define init_or_livepatch_const
 # define init_or_livepatch_constrel
 # define init_or_livepatch_data
-# define init_or_livepatch_read_mostly __read_mostly
+# define init_or_livepatch_read_mostly      __read_mostly
+# define init_or_livepatch_ro_after_init    __ro_after_init
 # define init_or_livepatch
 #else /* !CONFIG_LIVEPATCH */
-# define init_or_livepatch_const       __initconst
-# define init_or_livepatch_constrel    __initconstrel
-# define init_or_livepatch_data        __initdata
-# define init_or_livepatch_read_mostly __initdata
-# define init_or_livepatch             __init
+# define init_or_livepatch_const            __initconst
+# define init_or_livepatch_constrel         __initconstrel
+# define init_or_livepatch_data             __initdata
+# define init_or_livepatch_read_mostly      __initdata
+# define init_or_livepatch_ro_after_init    __initdata
+# define init_or_livepatch                  __init
 #endif /* !CONFIG_LIVEPATCH */
 
 /* These macros are used to mark some functions or 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 12:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 12:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383387.1626653 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wraz3-0004Ki-3q; Wed, 05 Aug 2026 12:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383387.1626653; Wed, 05 Aug 2026 12:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wraz3-0004Ka-0f; Wed, 05 Aug 2026 12:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1383387;
 Wed, 05 Aug 2026 12:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wraz2-0004KT-Fi
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 12:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wraz2-006LXV-2I
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wraz2-00GONT-1L
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iqMvPOcI8wSHiCtD1qHitiOexqRE+3D4NuJTieO0SUM=; b=OAv90NkRrrzucHzhzigm05DkGZ
	6i57VNrCGWyIiyexBPovvqKfdD58+1g8ZojDOBdceqVYuoXY5FPnTIQr5YElOqk1crsZXqbhBDoW3
	BCDLdi0uzelzPIKHw8JBRffmXNBKieE9XhyRa6T6TEgah/7gr6gMCZpyG/foBhp095+g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vtd: Print originating iommu on faults
Message-Id: <E1wraz2-00GONT-1L@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 12:44:32 +0000

commit 7a091bd8b04a56afbf8b2a3e7f9a807fc2ba7ce4
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Wed Aug 5 11:59:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 5 11:59:31 2026 +0200

    vtd: Print originating iommu on faults
    
    When a fault occurs on an IOMMU, print the IOMMU the fault is coming from.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 3d6f787b3c..b41a1d41c8 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -991,8 +991,8 @@ static int iommu_page_fault_do_one(struct vtd_iommu *iommu, int type,
         break;
     }
 
-    printk(XENLOG_G_WARNING VTDPREFIX "%s: reason %02x - %s\n",
-           kind, fault_reason, reason);
+    printk(XENLOG_G_WARNING VTDPREFIX "%s: reason %02x - %s on iommu:%u\n",
+           kind, fault_reason, reason, iommu->index);
 
     if ( iommu_verbose && fault_type == DMA_REMAP )
         print_vtd_entries(iommu, PCI_BUS(source_id), PCI_DEVFN(source_id),
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 05 12:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Aug 2026 12:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1383388.1626656 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrazD-0004Ms-4W; Wed, 05 Aug 2026 12:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1383388.1626656; Wed, 05 Aug 2026 12:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrazD-0004Ml-1z; Wed, 05 Aug 2026 12:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1383388;
 Wed, 05 Aug 2026 12:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wrazC-0004Mf-I8
 for xen-changelog@lists.xenproject.org; Wed, 05 Aug 2026 12:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrazC-006LXr-2X
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrazC-00GORR-1d
 for xen-changelog@lists.xenproject.org;
 Wed, 05 Aug 2026 12:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aoIWPdA4EExd1h4tTMbt7MJs2KpZMVCLz//lrMDjFYg=; b=0dwhJAZpnJxbL5A7opHq5OEWmj
	un4rrzQBJgLrgRNXFK9zoFcBY8L2ETiWn3h1ZtUOm4ejCjvM8jv+WICNBNIWNFg1MOeRtNRqT6WGz
	rVkfI4/ukOl+MEEcyiqhjgWWTjFVMRnbJIk0EJowbf/T6MFisVfDjtsDtk+WJv+blcRM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wrazC-00GORR-1d@xenbits.xenproject.org>
Date: Wed, 05 Aug 2026 12:44:42 +0000

commit 1077a93425d2dcca894883cf8565ee9ecf1672cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 5 12:00:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 5 12:00:17 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index ca610d36fc..bc1e8d0c04 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -80,7 +74,16 @@ static void radix_tree_node_free(struct radix_tree_node *node)
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -705,27 +708,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 06 07:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Aug 2026 07:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1384259.1627273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrsFs-0000bU-24; Thu, 06 Aug 2026 07:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1384259.1627273; Thu, 06 Aug 2026 07: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 1wrsFr-0000bM-Vl; Thu, 06 Aug 2026 07:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1384259;
 Thu, 06 Aug 2026 07: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 1wrsFq-0000bG-3i
 for xen-changelog@lists.xenproject.org; Thu, 06 Aug 2026 07: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 1wrsFp-007sTT-39
 for xen-changelog@lists.xenproject.org;
 Thu, 06 Aug 2026 07:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrsFp-004stz-25
 for xen-changelog@lists.xenproject.org;
 Thu, 06 Aug 2026 07: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=HbxSuZdkDvT8h7SRx396JB6B/2QPL0mRaDLSdVTOYW0=; b=LZLVK1ydtXXahMTT7o3b1BNJo5
	/vafbDeysDVpFhiwKq0hrGalwLrrF+/B1wpY3OVi66m1hbFxh/gbT43PDXEZTgakj7ItMoiGbpd2m
	48KFAmPG+1YPL5betaWIu+MzbZpV+ilFgSbruqYt2MBGx8haJQFDwlwDXcAsKn8fGY9Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dt: reject "xen,static-mem" when CONFIG_STATIC_MEMORY is disabled
Message-Id: <E1wrsFp-004stz-25@xenbits.xenproject.org>
Date: Thu, 06 Aug 2026 07:11:01 +0000

commit e888192d133eeec8a94275eaf4194117f198a7e2
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Aug 5 14:11:24 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 6 08:54:14 2026 +0200

    xen/dt: reject "xen,static-mem" when CONFIG_STATIC_MEMORY is disabled
    
    process_domain_node() parses "xen,static-mem" regardless of
    CONFIG_STATIC_MEMORY. With the feature off, init_staticmem_pages() is a
    no-op stub, so boot carries on until construct_domU() reaches the
    ASSERT_UNREACHABLE() stubs of allocate_static_memory() /
    assign_static_memory_11(): a debug build trips the assertion, a production
    build gives the domain no memory at all.
    
    Bail out at parse time instead, like process_shm_node() already does for
    CONFIG_STATIC_SHM.
    
    Fixes: 41c031ff437b ("xen/arm: introduce domain on Static Allocation")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/common/device-tree/bootinfo-fdt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/device-tree/bootinfo-fdt.c b/xen/common/device-tree/bootinfo-fdt.c
index 272b5a6c0a..ca64daf4cd 100644
--- a/xen/common/device-tree/bootinfo-fdt.c
+++ b/xen/common/device-tree/bootinfo-fdt.c
@@ -349,6 +349,12 @@ static int __init process_domain_node(const void *fdt, int node,
         /* No "xen,static-mem" present. */
         return 0;
 
+    if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) )
+    {
+        printk("CONFIG_STATIC_MEMORY must be enabled for parsing xen,static-mem\n");
+        return -EINVAL;
+    }
+
     return device_tree_get_meminfo(fdt, node, "xen,static-mem", address_cells,
                                    size_cells, bootinfo_get_reserved_mem(),
                                    MEMBANK_STATIC_DOMAIN);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 06 08:00:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Aug 2026 08:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1384320.1627314 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrt1I-0005Bl-FH; Thu, 06 Aug 2026 08:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1384320.1627314; Thu, 06 Aug 2026 08:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wrt1I-0005BR-8m; Thu, 06 Aug 2026 08:00:04 +0000
Received: by outflank-mailman (input) for mailman id 1384320;
 Thu, 06 Aug 2026 08: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 1wrt1G-0004TS-C1
 for xen-changelog@lists.xenproject.org; Thu, 06 Aug 2026 08: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 1wrt1G-007tdf-0V
 for xen-changelog@lists.xenproject.org;
 Thu, 06 Aug 2026 08:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wrt1F-0057Ov-2l
 for xen-changelog@lists.xenproject.org;
 Thu, 06 Aug 2026 08: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=4T0Gx7rpHmEwRPYMc3r82Zc99uKcl6cdb6tYiCaudWw=; b=LwFdKNaj45f7mrKqAfQtdOwmHz
	9gFFE+XPsiyU73+lOQ/aeFhKZrpxk8xvv6u+Ru2zkjG6VINlDh9XEvS/1CB3zenVouhAL89vcgcol
	uyELKe80mx+X1m0NoxzdV5vT5+Ncau490s94r43CtPWU4QQ25Rdift6OHm0KSI+B6Zsc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dt: reject "xen,static-mem" when CONFIG_STATIC_MEMORY is disabled
Message-Id: <E1wrt1F-0057Ov-2l@xenbits.xenproject.org>
Date: Thu, 06 Aug 2026 08:00:01 +0000

commit e888192d133eeec8a94275eaf4194117f198a7e2
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Aug 5 14:11:24 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 6 08:54:14 2026 +0200

    xen/dt: reject "xen,static-mem" when CONFIG_STATIC_MEMORY is disabled
    
    process_domain_node() parses "xen,static-mem" regardless of
    CONFIG_STATIC_MEMORY. With the feature off, init_staticmem_pages() is a
    no-op stub, so boot carries on until construct_domU() reaches the
    ASSERT_UNREACHABLE() stubs of allocate_static_memory() /
    assign_static_memory_11(): a debug build trips the assertion, a production
    build gives the domain no memory at all.
    
    Bail out at parse time instead, like process_shm_node() already does for
    CONFIG_STATIC_SHM.
    
    Fixes: 41c031ff437b ("xen/arm: introduce domain on Static Allocation")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/common/device-tree/bootinfo-fdt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/device-tree/bootinfo-fdt.c b/xen/common/device-tree/bootinfo-fdt.c
index 272b5a6c0a..ca64daf4cd 100644
--- a/xen/common/device-tree/bootinfo-fdt.c
+++ b/xen/common/device-tree/bootinfo-fdt.c
@@ -349,6 +349,12 @@ static int __init process_domain_node(const void *fdt, int node,
         /* No "xen,static-mem" present. */
         return 0;
 
+    if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) )
+    {
+        printk("CONFIG_STATIC_MEMORY must be enabled for parsing xen,static-mem\n");
+        return -EINVAL;
+    }
+
     return device_tree_get_meminfo(fdt, node, "xen,static-mem", address_cells,
                                    size_cells, bootinfo_get_reserved_mem(),
                                    MEMBANK_STATIC_DOMAIN);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388124.1629317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkj9-0005Yx-Sw; Tue, 11 Aug 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 1388124.1629317; Tue, 11 Aug 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 1wtkj9-0005Yo-Q0; Tue, 11 Aug 2026 11:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1388124;
 Tue, 11 Aug 2026 11: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 1wtkj8-0005Yi-Mp
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 11: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 1wtkj8-00GMoE-1x
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkj8-004XKO-0w
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11: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=uBzbJiwrL73zZ1VRJQAaEnYYZMJUz+7IY5cGs3lhZ2Q=; b=BllnvZ3RDJhv3Q+r9zrqK5u5+F
	RSxS9lhvhgBBYNr88h/avi4PikWfYHZuvqNFyAfVWrtoocf7vQFMGJKy49VRYZO+HGVNgougAROFz
	NV1yyLhWD1i+2ufJGjJMsw2zNtYBabf1mHssKJ9Ptgrt1ERg7MEc73LxFUBVmaPr+hEM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation/eclair: Restrict where eclair jobs are auto-started
Message-Id: <E1wtkj8-004XKO-0w@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:33:02 +0000

commit d14794c332d63c643721b12425c6dac83fa0d3a6
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Tue May 12 18:07:22 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Aug 10 17:06:41 2026 +0200

    automation/eclair: Restrict where eclair jobs are auto-started
    
    This will prevent eclair jobs from been started automatically
    everywhere but in the main push repo, but still have the option to
    start a jobs manually.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/analyze.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index c650ed61c4..2f782c38c8 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -34,7 +34,7 @@
       when: never
     - if: $CI_JOB_NAME !~ $SELECTED_JOBS_ONLY
       when: never
-    - if: $WTOKEN && $CI_PROJECT_PATH =~ /^xen-project\/people\/.*$/
+    - if: $WTOKEN && $CI_PROJECT_PATH !~ /^xen-project\/hardware\//
       when: manual
       allow_failure: true
     - !reference [.eclair-analysis, rules]
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388125.1629320 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkjI-0005ac-UE; Tue, 11 Aug 2026 11:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388125.1629320; Tue, 11 Aug 2026 11: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 1wtkjI-0005aS-RI; Tue, 11 Aug 2026 11:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1388125;
 Tue, 11 Aug 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 1wtkjI-0005aK-GY
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 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 1wtkjI-00GMpy-2M
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkjI-004Y9d-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11: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=z5zHAu6IhqgEAHYFESXtdNFK9ugWXt0rjZuXy4J/O5g=; b=HHBOmJlCOYOsYI+W/L8QVY8YW/
	5x391H4OuCkoZpQLM0SLhPqE8cJD0c+Pfa4/UxufbU2DbUGlU9+r9G5ouBP0aBLTudLLvzrM6aiIg
	UBRLWV2umR1GJVLzrfuNWdPgkVp21SZk5oMS53+Ji2VEj6TdI40Y0uS2rnt2jQzwvsHU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] get_maintainer: Add maintainers based on keyword after removing THE REST
Message-Id: <E1wtkjI-004Y9d-1M@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:33:12 +0000

commit a2267eea69333d0556ea2ab071f7f4e039f7d819
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Wed Jul 1 18:20:22 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Aug 10 17:06:44 2026 +0200

    get_maintainer: Add maintainers based on keyword after removing THE REST
    
    There's some logic to avoid CC committers (THE REST section) when a
    file is fully maintained by a list of maintainers. There's also some
    logic to add maintainers if a patch or file contains some keywords.
    
    We do add maintainers based on keyword to the list of $email_to before
    checking if we can remove emails from THE REST. And at the time when
    checking if we can drop THE REST, we've lost the information which
    tell if the maintainers was added because of a keyword of because they
    maintain the file.
    
    Reorder the logic, add maintainers based on keywords only after
    checking if we can drop THE REST.
    
    For example, if we have a file covered by a sections with only
    reviewers, but this file also contains the keyword "XSM", then:
        scripts/get_maintainer.pl -f $file
    would suppress THE REST without this patch.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 scripts/get_maintainer.pl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 533d0df72a..b788665c08 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -720,13 +720,6 @@ sub get_maintainers {
 	$suppress_the_rest = 0 if $file_maintained_by_the_rest;
     }
 
-    if ($keywords) {
-	@keyword_tvi = sort_and_uniq(@keyword_tvi);
-	foreach my $line (@keyword_tvi) {
-	    add_categories($line);
-	}
-    }
-
     if ($email_drop_the_rest_supporter_if_supporter_found &&
 	$suppress_the_rest && $#email_to > 0) {
         my @email_new;
@@ -748,6 +741,13 @@ sub get_maintainers {
             if $do_replace;
     }
 
+    if ($keywords) {
+	@keyword_tvi = sort_and_uniq(@keyword_tvi);
+	foreach my $line (@keyword_tvi) {
+	    add_categories($line);
+	}
+    }
+
     foreach my $email (@email_to, @list_to) {
 	$email->[0] = deduplicate_email($email->[0]);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388127.1629323 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkjT-0005du-VG; Tue, 11 Aug 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 1388127.1629323; Tue, 11 Aug 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 1wtkjT-0005dm-Sg; Tue, 11 Aug 2026 11:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1388127;
 Tue, 11 Aug 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 1wtkjS-0005dc-LR
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 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 1wtkjS-00GMq2-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkjS-004Yv3-1n
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 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=seQHLNMsCMpahzDPs2jzi9CzdfLO5NOq2pYzYdhfrQU=; b=SNcndZawuWUMuj5x26EVqnpQ1s
	DNsbU5TlaQQY/KSHlldT2xErqV3IePHJZoVB+zqBSBb+xeyVOpeuVi9EkBXtPai76UQA2z5SwyqIR
	AQMlV2fGqEbp+17Nbph742lOphoG/CGqXlykeGd3oNFq01uZvReNfpZvr40CH6XhrOFA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libs/call: cache up to 4 pages in hypercall bounce buffers
Message-Id: <E1wtkjS-004Yv3-1n@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:33:22 +0000

commit a91d1616d8350a502ac7b6c9ab6455fd462ce5c5
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Mon Jul 13 21:47:59 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Aug 10 17:09:22 2026 +0200

    libs/call: cache up to 4 pages in hypercall bounce buffers
    
    During migration there are a lot of mmap/munmap calls,
    because xc_get_pfn_type_batch() exceeds the default hypercall bounce
    buffer cache size, and needs to allocate every time it is called.
    
    munmap() is slow, especially in a PV Dom0 (takes an emulation fault),
    so is best avoided.
    
    Eventually it'd be good if the memory pool from  xmalloc_tlsf.c
    was reused here, but for now make it handle the commonly encountered
    sizes (so far up to 4 pages).
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/call/buffer.c  | 34 +++++++++++++++++++++++-----------
 tools/libs/call/core.c    |  3 ++-
 tools/libs/call/private.h |  8 +++++---
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
index 155e4f9d43..b7d00185c4 100644
--- a/tools/libs/call/buffer.c
+++ b/tools/libs/call/buffer.c
@@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
 {
     void *p = NULL;
 
+    if ( nr_pages == 0 )
+        return NULL;
+
     cache_lock(xcall);
 
     xcall->buffer_total_allocations++;
@@ -56,13 +59,13 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
     if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allocations )
         xcall->buffer_maximum_allocations = xcall->buffer_current_allocations;
 
-    if ( nr_pages > 1 )
+    if ( nr_pages > ARRAY_SIZE(xcall->buffer_cache) )
     {
         xcall->buffer_cache_toobig++;
     }
-    else if ( xcall->buffer_cache_nr > 0 )
+    else if ( xcall->buffer_cache_nr[nr_pages-1] > 0 )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        p = xcall->buffer_cache[nr_pages-1][--xcall->buffer_cache_nr[nr_pages-1]];
         xcall->buffer_cache_hits++;
     }
     else
@@ -79,15 +82,18 @@ static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
 {
     int rc = 0;
 
+    if ( nr_pages == 0 )
+        return 0;
+
     cache_lock(xcall);
 
     xcall->buffer_total_releases++;
     xcall->buffer_current_allocations--;
 
-    if ( nr_pages == 1 &&
-         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+    if ( nr_pages && nr_pages <= ARRAY_SIZE(xcall->buffer_cache) &&
+         xcall->buffer_cache_nr[nr_pages-1] < BUFFER_CACHE_SIZE )
     {
-        xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
+        xcall->buffer_cache[nr_pages-1][xcall->buffer_cache_nr[nr_pages-1]++] = p;
         rc = 1;
     }
 
@@ -108,17 +114,23 @@ void buffer_release_cache(xencall_handle *xcall)
     DBGPRINTF("current allocations:%d maximum allocations:%d",
               xcall->buffer_current_allocations,
               xcall->buffer_maximum_allocations);
-    DBGPRINTF("cache current size:%d",
-              xcall->buffer_cache_nr);
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
+    {
+        DBGPRINTF("cache current size[%u pages]:%d", i+1,
+                xcall->buffer_cache_nr[i]);
+    }
     DBGPRINTF("cache hits:%d misses:%d toobig:%d",
               xcall->buffer_cache_hits,
               xcall->buffer_cache_misses,
               xcall->buffer_cache_toobig);
 
-    while ( xcall->buffer_cache_nr > 0 )
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
-        osdep_free_pages(xcall, p, 1);
+        while ( xcall->buffer_cache_nr[i] > 0 )
+        {
+            p = xcall->buffer_cache[i][--xcall->buffer_cache_nr[i]];
+            osdep_free_pages(xcall, p, i + 1);
+        }
     }
 
     cache_unlock(xcall);
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index 02c4f8e1ae..dd8877c1a0 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -14,6 +14,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "private.h"
 
@@ -44,7 +45,7 @@ xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
     xentoolcore__register_active_handle(&xcall->tc_ah);
 
     xcall->flags = open_flags;
-    xcall->buffer_cache_nr = 0;
+    memset(xcall->buffer_cache_nr, 0, sizeof(xcall->buffer_cache_nr));
 
     xcall->buffer_total_allocations = 0;
     xcall->buffer_total_releases = 0;
diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
index 9c3aa432ef..8e6a208975 100644
--- a/tools/libs/call/private.h
+++ b/tools/libs/call/private.h
@@ -31,13 +31,15 @@ struct xencall_handle {
     Xentoolcore__Active_Handle tc_ah;
 
     /*
-     * A simple cache of unused, single page, hypercall buffers
+     * A simple cache of unused, small, hypercall buffers
+     * buffer_cache[i]'s size is (i+1) pages
      *
      * Protected by a global lock.
      */
 #define BUFFER_CACHE_SIZE 4
-    int buffer_cache_nr;
-    void *buffer_cache[BUFFER_CACHE_SIZE];
+#define BUFFER_CACHE_NRPAGES 4
+    int buffer_cache_nr[BUFFER_CACHE_NRPAGES];
+    void *buffer_cache[BUFFER_CACHE_NRPAGES][BUFFER_CACHE_SIZE];
 
     /*
      * Hypercall buffer statistics. All protected by the global
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388128.1629328 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkje-0005fq-0G; Tue, 11 Aug 2026 11:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388128.1629328; Tue, 11 Aug 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 1wtkjd-0005fi-U1; Tue, 11 Aug 2026 11:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1388128;
 Tue, 11 Aug 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 1wtkjc-0005fc-Tp
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 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 1wtkjd-00GMq8-0U
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkjc-004ZvD-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 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=LINjn26A45HUYwwJbGQDry2cO9px30DPvf2a7//CKVI=; b=rUcxVZ/nE3PVjMP+Xk5/Fz38CR
	5eskJHoLkYTP0w09rXPGypBLjqKtGWZVMqEzUFih8evl6SxoadLRXAfU+VHQmYzRLv3EFQXcdhSqN
	6+JeKOL4FFjLVIPV9zntmLR/aic7viaZpk1nmPANVFlEbSlnwlAH72D9Lfhr3RsSpTKY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libs/guest: move batch_pfns into a separate structure
Message-Id: <E1wtkjc-004ZvD-2e@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:33:32 +0000

commit 9b0adb928c635f01a4a60ba031548a8c6712d3f1
Author:     Frediano Ziglio <frediano.ziglio@citrix.com>
AuthorDate: Mon Jul 13 21:48:00 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:08 2026 +0200

    libs/guest: move batch_pfns into a separate structure
    
    Preparation for a followup patch "libs/guest: allocate various migration
    arrays just once".
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/guest/xg_sr_common.h |  5 ++++-
 tools/libs/guest/xg_sr_save.c   | 28 ++++++++++++++--------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index f1573aefcb..7574c9f5b6 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -239,11 +239,14 @@ struct xc_sr_context
 
             struct precopy_stats stats;
 
-            xen_pfn_t *batch_pfns;
             unsigned int nr_batch_pfns;
             unsigned long *deferred_pages;
             unsigned long nr_deferred_pages;
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
+            struct xc_sr_context_save_buffers
+            {
+                xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+            } *buffers;
         } save;
 
         struct /* Restore data. */
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 84fdbe4140..22348db445 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 
 /*
  * Writes a batch of memory as a PAGE_DATA record into the stream.  The batch
- * is constructed in ctx->save.batch_pfns.
+ * is constructed in ctx->save.buffers->batch_pfns.
  *
  * This function:
  * - gets the types for each pfn in the batch.
@@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
     struct iovec *iov = NULL; int iovcnt = 0;
+    xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
         struct xc_sr_rec_page_data_header page_data;
@@ -110,6 +111,7 @@ static int write_batch(struct xc_sr_context *ctx)
     };
 
     assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
 
     /* Mfns of the batch pfns. */
     mfns = malloc(nr_pfns * sizeof(*mfns));
@@ -141,13 +143,12 @@ static int write_batch(struct xc_sr_context *ctx)
 
     for ( i = 0; i < nr_pfns; ++i )
     {
-        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
-                                                      ctx->save.batch_pfns[i]);
+        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx, batch_pfns[i]);
 
         /* Likely a ballooned page. */
         if ( mfns[i] == INVALID_MFN )
         {
-            set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+            set_bit(batch_pfns[i], ctx->save.deferred_pages);
             ++ctx->save.nr_deferred_pages;
         }
     }
@@ -193,7 +194,7 @@ static int write_batch(struct xc_sr_context *ctx)
             if ( errors[p] )
             {
                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
-                      ctx->save.batch_pfns[i], mfns[p], errors[p]);
+                      batch_pfns[i], mfns[p], errors[p]);
                 goto err;
             }
 
@@ -207,7 +208,7 @@ static int write_batch(struct xc_sr_context *ctx)
             {
                 if ( rc == -1 && errno == EAGAIN )
                 {
-                    set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+                    set_bit(batch_pfns[i], ctx->save.deferred_pages);
                     ++ctx->save.nr_deferred_pages;
                     types[i] = XEN_DOMCTL_PFINFO_XTAB;
                     --nr_pages;
@@ -235,7 +236,7 @@ static int write_batch(struct xc_sr_context *ctx)
     hdrs.rec.length += nr_pages * PAGE_SIZE;
 
     for ( i = 0; i < nr_pfns; ++i )
-        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
+        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | batch_pfns[i];
 
     if ( writev_exact(ctx->fd, iov, iovcnt) )
     {
@@ -274,9 +275,9 @@ static int flush_batch(struct xc_sr_context *ctx)
 
     if ( !rc )
     {
-        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.batch_pfns,
+        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.buffers->batch_pfns,
                                     MAX_BATCH_SIZE *
-                                    sizeof(*ctx->save.batch_pfns));
+                                    sizeof(*ctx->save.buffers->batch_pfns));
     }
 
     return rc;
@@ -293,7 +294,7 @@ static int add_to_batch(struct xc_sr_context *ctx, xen_pfn_t pfn)
         rc = flush_batch(ctx);
 
     if ( rc == 0 )
-        ctx->save.batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
+        ctx->save.buffers->batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
 
     return rc;
 }
@@ -784,11 +785,10 @@ static int setup(struct xc_sr_context *ctx)
 
     dirty_bitmap = xc_hypercall_buffer_alloc_pages(
         xch, dirty_bitmap, NRPAGES(bitmap_size(ctx->save.p2m_size)));
-    ctx->save.batch_pfns = malloc(MAX_BATCH_SIZE *
-                                  sizeof(*ctx->save.batch_pfns));
     ctx->save.deferred_pages = bitmap_alloc(ctx->save.p2m_size);
+    ctx->save.buffers = calloc(1, sizeof(*ctx->save.buffers));
 
-    if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
+    if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
         ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
               " deferred pages");
@@ -819,7 +819,7 @@ static void cleanup(struct xc_sr_context *ctx)
     xc_hypercall_buffer_free_pages(xch, dirty_bitmap,
                                    NRPAGES(bitmap_size(ctx->save.p2m_size)));
     free(ctx->save.deferred_pages);
-    free(ctx->save.batch_pfns);
+    free(ctx->save.buffers);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388129.1629332 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkjo-0005hr-1u; Tue, 11 Aug 2026 11:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388129.1629332; Tue, 11 Aug 2026 11: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 1wtkjn-0005hi-VP; Tue, 11 Aug 2026 11:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1388129;
 Tue, 11 Aug 2026 11:33:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wtkjn-0005ha-2s
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 11:33:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkjn-00GMqZ-0z
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkjm-004ar2-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0aJcxQ0aOLrSYo4sSNY09YMO235MwgA6i86mNerB3n4=; b=0Ri5A8hyHWom/LJAGOa56l4peo
	QXK3wOxjO5dsTWmJrBrs0k6AfmWrh7oeUTcKQG6wgOWbAPJjlIdEQFRN6ySkfAYrFi/A7ZSpvROgN
	ZauENhKc9k2qX2tinV+mdUCK1m4XkRMsxW2VEIm6jnkMRtjcD0dmFS1gYDRT4mRaEynE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libs/guest: allocate various migration arrays just once
Message-Id: <E1wtkjm-004ar2-3D@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:33:42 +0000

commit 0f133c8c73752f572cc31e4e9908f4955ae59550
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Mon Jul 13 21:48:01 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    libs/guest: allocate various migration arrays just once
    
    Allocate these array just once at the start of migration,
    using the maximum batch size, and free them at the end.
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/guest/xg_sr_common.h |  6 ++++++
 tools/libs/guest/xg_sr_save.c   | 45 +++++++++++++++--------------------------
 2 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 7574c9f5b6..c07c6db59e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -246,6 +246,12 @@ struct xc_sr_context
             struct xc_sr_context_save_buffers
             {
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                xen_pfn_t mfns[MAX_BATCH_SIZE];
+                xen_pfn_t types[MAX_BATCH_SIZE];
+                void *local_pages[MAX_BATCH_SIZE];
+                struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                uint64_t rec_pfns[MAX_BATCH_SIZE];
+                int errors[MAX_BATCH_SIZE];
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 22348db445..6a77e33a47 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -86,15 +86,12 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 static int write_batch(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    xen_pfn_t *mfns = NULL, *types = NULL;
     void *guest_mapping = NULL;
-    void **local_pages = NULL;
-    int *errors = NULL, rc = -1;
+    int rc = -1;
     unsigned int i, p, nr_pages = 0, nr_pages_mapped = 0;
     unsigned int nr_pfns = ctx->save.nr_batch_pfns;
     void *page, *orig_page;
-    uint64_t *rec_pfns = NULL;
-    struct iovec *iov = NULL; int iovcnt = 0;
+    int iovcnt = 0;
     xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
@@ -110,28 +107,21 @@ static int write_batch(struct xc_sr_context *ctx)
         },
     };
 
-    assert(nr_pfns != 0);
-    assert(nr_pfns <= MAX_BATCH_SIZE);
-
     /* Mfns of the batch pfns. */
-    mfns = malloc(nr_pfns * sizeof(*mfns));
+    xen_pfn_t *const mfns = ctx->save.buffers->mfns;
     /* Types of the batch pfns. */
-    types = malloc(nr_pfns * sizeof(*types));
+    xen_pfn_t *const types = ctx->save.buffers->types;
     /* Errors from attempting to map the gfns. */
-    errors = malloc(nr_pfns * sizeof(*errors));
+    int *const errors = ctx->save.buffers->errors;
     /* Pointers to locally allocated pages.  Need freeing. */
-    local_pages = calloc(nr_pfns, sizeof(*local_pages));
+    void **const local_pages = ctx->save.buffers->local_pages;
     /* iovec[] for writev(). */
-    iov = malloc((nr_pfns + 2) * sizeof(*iov));
+    struct iovec *const iov = ctx->save.buffers->iov;
     /* page_data record PFNs list */
-    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
+    uint64_t *const rec_pfns = ctx->save.buffers->rec_pfns;
 
-    if ( !mfns || !types || !errors || !local_pages || !iov || !rec_pfns )
-    {
-        ERROR("Unable to allocate arrays for a batch of %u pages",
-              nr_pfns);
-        goto err;
-    }
+    assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
 
     iov[0].iov_base = &hdrs;
     iov[0].iov_len = sizeof(hdrs);
@@ -249,14 +239,11 @@ static int write_batch(struct xc_sr_context *ctx)
  err:
     if ( guest_mapping )
         xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
-    for ( i = 0; local_pages && i < nr_pfns; ++i )
+    for ( i = 0; i < nr_pfns; ++i )
+    {
         free(local_pages[i]);
-    free(rec_pfns);
-    free(iov);
-    free(local_pages);
-    free(errors);
-    free(types);
-    free(mfns);
+        local_pages[i] = NULL;
+    }
 
     return rc;
 }
@@ -790,8 +777,8 @@ static int setup(struct xc_sr_context *ctx)
 
     if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
-        ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
-              " deferred pages");
+        ERROR("Unable to allocate memory for dirty bitmaps, deferred pages"
+              " and various batch buffers");
         rc = -1;
         errno = ENOMEM;
         goto err;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388131.1629337 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkjy-0005kP-4x; Tue, 11 Aug 2026 11:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388131.1629337; Tue, 11 Aug 2026 11: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 1wtkjy-0005kD-1o; Tue, 11 Aug 2026 11:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1388131;
 Tue, 11 Aug 2026 11:33:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wtkjx-0005k7-9w
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 11:33:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkjx-00GMqh-1d
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkjx-004bcg-0a
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8r1LVWQ6RAFrz44J6XSD2wcaY4hPHM46ja6WiyJ9G1k=; b=rHn0RH+6RZdlkf01AiA7wjFD1y
	7ZybLgMBtuBhpL5IwhqTafBZ9Bv77bvbegkMEKqoBAw76NZEI9sfDg6KELwk+mgAA4kyFbXZ45GGd
	pEO39ZFTkfERSQ7E98hMiJbNa/rXS4vJjzQktX402vsQfR/Lb8+LfOE0/ps0aidxrtCA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/scripts: import gen_compile_commands.py from Linux
Message-Id: <E1wtkjx-004bcg-0a@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:33:53 +0000

commit 359dae385290e7da959964ed1d652af2d106343d
Author:     George Dunlap <gwd@xenproject.org>
AuthorDate: Mon Aug 10 10:49:43 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    xen/scripts: import gen_compile_commands.py from Linux
    
    Xen's Kbuild-derived build system records the exact command line used
    to compile each object in .<target>.o.cmd files.  That is everything
    needed to produce a compile_commands.json compilation database, the
    format clangd and other tooling consume to provide accurate
    cross-referencing (go to definition, find references, call hierarchy)
    in LSP-capable editors.
    
    Import scripts/clang-tools/gen_compile_commands.py from the Linux
    kernel, unmodified, so that the provenance of the code is easy to
    verify (commit 90efe2b9119f, Linux v6.16).
    
    As-is the script produces an empty database on a Xen tree, since
    Xen's compile command lines differ slightly from Linux's; the
    following patch adapts it.
    
    Assisted-by: LLM
    Signed-off-by: George Dunlap <gwd@xenproject.org>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 xen/scripts/gen_compile_commands.py | 228 ++++++++++++++++++++++++++++++++++++
 1 file changed, 228 insertions(+)

diff --git a/xen/scripts/gen_compile_commands.py b/xen/scripts/gen_compile_commands.py
new file mode 100755
index 0000000000..96e6e46ad1
--- /dev/null
+++ b/xen/scripts/gen_compile_commands.py
@@ -0,0 +1,228 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) Google LLC, 2018
+#
+# Author: Tom Roeder <tmroeder@google.com>
+#
+"""A tool for generating compile_commands.json in the Linux kernel."""
+
+import argparse
+import json
+import logging
+import os
+import re
+import subprocess
+import sys
+
+_DEFAULT_OUTPUT = 'compile_commands.json'
+_DEFAULT_LOG_LEVEL = 'WARNING'
+
+_FILENAME_PATTERN = r'^\..*\.cmd$'
+_LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P<command_prefix>.* )(?P<file_path>[^ ]*\.[cS]) *(;|$)'
+_VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
+# The tools/ directory adopts a different build system, and produces .cmd
+# files in a different format. Do not support it.
+_EXCLUDE_DIRS = ['.git', 'Documentation', 'include', 'tools']
+
+def parse_arguments():
+    """Sets up and parses command-line arguments.
+
+    Returns:
+        log_level: A logging level to filter log output.
+        directory: The work directory where the objects were built.
+        ar: Command used for parsing .a archives.
+        output: Where to write the compile-commands JSON file.
+        paths: The list of files/directories to handle to find .cmd files.
+    """
+    usage = 'Creates a compile_commands.json database from kernel .cmd files'
+    parser = argparse.ArgumentParser(description=usage)
+
+    directory_help = ('specify the output directory used for the kernel build '
+                      '(defaults to the working directory)')
+    parser.add_argument('-d', '--directory', type=str, default='.',
+                        help=directory_help)
+
+    output_help = ('path to the output command database (defaults to ' +
+                   _DEFAULT_OUTPUT + ')')
+    parser.add_argument('-o', '--output', type=str, default=_DEFAULT_OUTPUT,
+                        help=output_help)
+
+    log_level_help = ('the level of log messages to produce (defaults to ' +
+                      _DEFAULT_LOG_LEVEL + ')')
+    parser.add_argument('--log_level', choices=_VALID_LOG_LEVELS,
+                        default=_DEFAULT_LOG_LEVEL, help=log_level_help)
+
+    ar_help = 'command used for parsing .a archives'
+    parser.add_argument('-a', '--ar', type=str, default='llvm-ar', help=ar_help)
+
+    paths_help = ('directories to search or files to parse '
+                  '(files should be *.o, *.a, or modules.order). '
+                  'If nothing is specified, the current directory is searched')
+    parser.add_argument('paths', type=str, nargs='*', help=paths_help)
+
+    args = parser.parse_args()
+
+    return (args.log_level,
+            os.path.realpath(args.directory),
+            args.output,
+            args.ar,
+            args.paths if len(args.paths) > 0 else [args.directory])
+
+
+def cmdfiles_in_dir(directory):
+    """Generate the iterator of .cmd files found under the directory.
+
+    Walk under the given directory, and yield every .cmd file found.
+
+    Args:
+        directory: The directory to search for .cmd files.
+
+    Yields:
+        The path to a .cmd file.
+    """
+
+    filename_matcher = re.compile(_FILENAME_PATTERN)
+    exclude_dirs = [ os.path.join(directory, d) for d in _EXCLUDE_DIRS ]
+
+    for dirpath, dirnames, filenames in os.walk(directory, topdown=True):
+        # Prune unwanted directories.
+        if dirpath in exclude_dirs:
+            dirnames[:] = []
+            continue
+
+        for filename in filenames:
+            if filename_matcher.match(filename):
+                yield os.path.join(dirpath, filename)
+
+
+def to_cmdfile(path):
+    """Return the path of .cmd file used for the given build artifact
+
+    Args:
+        Path: file path
+
+    Returns:
+        The path to .cmd file
+    """
+    dir, base = os.path.split(path)
+    return os.path.join(dir, '.' + base + '.cmd')
+
+
+def cmdfiles_for_a(archive, ar):
+    """Generate the iterator of .cmd files associated with the archive.
+
+    Parse the given archive, and yield every .cmd file used to build it.
+
+    Args:
+        archive: The archive to parse
+
+    Yields:
+        The path to every .cmd file found
+    """
+    for obj in subprocess.check_output([ar, '-t', archive]).decode().split():
+        yield to_cmdfile(obj)
+
+
+def cmdfiles_for_modorder(modorder):
+    """Generate the iterator of .cmd files associated with the modules.order.
+
+    Parse the given modules.order, and yield every .cmd file used to build the
+    contained modules.
+
+    Args:
+        modorder: The modules.order file to parse
+
+    Yields:
+        The path to every .cmd file found
+    """
+    with open(modorder) as f:
+        for line in f:
+            obj = line.rstrip()
+            base, ext = os.path.splitext(obj)
+            if ext != '.o':
+                sys.exit('{}: module path must end with .o'.format(obj))
+            mod = base + '.mod'
+            # Read from *.mod, to get a list of objects that compose the module.
+            with open(mod) as m:
+                for mod_line in m:
+                    yield to_cmdfile(mod_line.rstrip())
+
+
+def process_line(root_directory, command_prefix, file_path):
+    """Extracts information from a .cmd line and creates an entry from it.
+
+    Args:
+        root_directory: The directory that was searched for .cmd files. Usually
+            used directly in the "directory" entry in compile_commands.json.
+        command_prefix: The extracted command line, up to the last element.
+        file_path: The .c file from the end of the extracted command.
+            Usually relative to root_directory, but sometimes absolute.
+
+    Returns:
+        An entry to append to compile_commands.
+
+    Raises:
+        ValueError: Could not find the extracted file based on file_path and
+            root_directory or file_directory.
+    """
+    # The .cmd files are intended to be included directly by Make, so they
+    # escape the pound sign '#' as '$(pound)'. The compile_commands.json file
+    # is not interepreted by Make, so this code replaces the escaped version
+    # with '#'.
+    prefix = command_prefix.replace('$(pound)', '#')
+
+    # Return the canonical path, eliminating any symbolic links encountered in the path.
+    abs_path = os.path.realpath(os.path.join(root_directory, file_path))
+    if not os.path.exists(abs_path):
+        raise ValueError('File %s not found' % abs_path)
+    return {
+        'directory': root_directory,
+        'file': abs_path,
+        'command': prefix + file_path,
+    }
+
+
+def main():
+    """Walks through the directory and finds and parses .cmd files."""
+    log_level, directory, output, ar, paths = parse_arguments()
+
+    level = getattr(logging, log_level)
+    logging.basicConfig(format='%(levelname)s: %(message)s', level=level)
+
+    line_matcher = re.compile(_LINE_PATTERN)
+
+    compile_commands = []
+
+    for path in paths:
+        # If 'path' is a directory, handle all .cmd files under it.
+        # Otherwise, handle .cmd files associated with the file.
+        # built-in objects are linked via vmlinux.a
+        # Modules are listed in modules.order.
+        if os.path.isdir(path):
+            cmdfiles = cmdfiles_in_dir(path)
+        elif path.endswith('.a'):
+            cmdfiles = cmdfiles_for_a(path, ar)
+        elif path.endswith('modules.order'):
+            cmdfiles = cmdfiles_for_modorder(path)
+        else:
+            sys.exit('{}: unknown file type'.format(path))
+
+        for cmdfile in cmdfiles:
+            with open(cmdfile, 'rt') as f:
+                result = line_matcher.match(f.readline())
+                if result:
+                    try:
+                        entry = process_line(directory, result.group('command_prefix'),
+                                             result.group('file_path'))
+                        compile_commands.append(entry)
+                    except ValueError as err:
+                        logging.info('Could not add line from %s: %s',
+                                     cmdfile, err)
+
+    with open(output, 'wt') as f:
+        json.dump(sorted(compile_commands, key=lambda x: x["file"]), f, indent=2, sort_keys=True)
+
+
+if __name__ == '__main__':
+    main()
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388132.1629340 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkk8-0005nl-5v; Tue, 11 Aug 2026 11:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388132.1629340; Tue, 11 Aug 2026 11:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkk8-0005nb-3C; Tue, 11 Aug 2026 11:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1388132;
 Tue, 11 Aug 2026 11:34:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wtkk7-0005nT-Do
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 11:34:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkk7-00GMqw-27
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkk7-004cSp-1B
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:34:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Cj5HiTEHREXb4UYCTTbUUKuzoLzVc6QNbOXLn9yAmz4=; b=SecTfbQv7eXoz8khsBeGJQpKx+
	n1DalUszB8RpG6WtHuR3Myl892yOXrI1zSB09SUFYox/+junGK99U9rQc9QlKzONsua3wDIzy9xJj
	7viIcEZ1oiK9yqTgoZOOlcP6P4r/uVrsubcQP85PmZVX5o9rY+MouJstBNCvp8BcxWlU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/scripts: adapt gen_compile_commands.py to Xen
Message-Id: <E1wtkk7-004cSp-1B@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:34:03 +0000

commit 79ea30888d08f54bd9bfabf0dee8ab3c2d125ef2
Author:     George Dunlap <gwd@xenproject.org>
AuthorDate: Mon Aug 10 10:49:44 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    xen/scripts: adapt gen_compile_commands.py to Xen
    
    Two changes from the Linux original:
    
     - Linux's compiler invocations end with the source file
       ("... -c -o foo.o foo.c"), and the script's line pattern relies
       on that; Xen's cmd_cc_o_c places "-c $<" before "-o" and "-MQ",
       so on a Xen object tree the unmodified script matches nothing and
       produces an empty database.  Adjust _LINE_PATTERN to capture the
       command up to and including "-c" plus the source file, dropping
       the remainder, which database consumers do not need.
    
     - Reword the docstring and help text to refer to Xen.
    
    The support for reading object lists from archives and modules.order
    is unused in Xen but retained to minimise divergence from the
    original.
    
    Assisted-by: LLM
    Signed-off-by: George Dunlap <gwd@xenproject.org>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 xen/scripts/gen_compile_commands.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/scripts/gen_compile_commands.py b/xen/scripts/gen_compile_commands.py
index 96e6e46ad1..1c9b05e4dd 100755
--- a/xen/scripts/gen_compile_commands.py
+++ b/xen/scripts/gen_compile_commands.py
@@ -5,7 +5,7 @@
 #
 # Author: Tom Roeder <tmroeder@google.com>
 #
-"""A tool for generating compile_commands.json in the Linux kernel."""
+"""A tool for generating compile_commands.json for the Xen hypervisor."""
 
 import argparse
 import json
@@ -19,7 +19,11 @@ _DEFAULT_OUTPUT = 'compile_commands.json'
 _DEFAULT_LOG_LEVEL = 'WARNING'
 
 _FILENAME_PATTERN = r'^\..*\.cmd$'
-_LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P<command_prefix>.* )(?P<file_path>[^ ]*\.[cS]) *(;|$)'
+# Capture the command up to and including "-c" plus the source file, and
+# drop the remainder: all that follows the source file is the output
+# location and dependency-tracking arguments ("-o ...", "-MQ ..."), which
+# database consumers do not need.
+_LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P<command_prefix>.* -c )(?P<file_path>[^ ]*\.[cS])( .*)?$'
 _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
 # The tools/ directory adopts a different build system, and produces .cmd
 # files in a different format. Do not support it.
@@ -35,10 +39,10 @@ def parse_arguments():
         output: Where to write the compile-commands JSON file.
         paths: The list of files/directories to handle to find .cmd files.
     """
-    usage = 'Creates a compile_commands.json database from kernel .cmd files'
+    usage = 'Creates a compile_commands.json database from Xen .cmd files'
     parser = argparse.ArgumentParser(description=usage)
 
-    directory_help = ('specify the output directory used for the kernel build '
+    directory_help = ('specify the output directory used for the Xen build '
                       '(defaults to the working directory)')
     parser.add_argument('-d', '--directory', type=str, default='.',
                         help=directory_help)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 11:34:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 11:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388133.1629344 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkkI-0005pd-7H; Tue, 11 Aug 2026 11:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388133.1629344; Tue, 11 Aug 2026 11:34:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtkkI-0005pV-4c; Tue, 11 Aug 2026 11:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1388133;
 Tue, 11 Aug 2026 11:34:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wtkkH-0005pP-J7
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 11:34:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkkH-00GMr5-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtkkH-004dXq-1f
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 11:34:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MDvNiK8VsWgBtDzuf2UyEGQm+5UYPOYL1UOMX7CVa0A=; b=exGQ6BYKjLlA+nAZhtrXMBFwzc
	Aov8HiLmp/k+34HEt5MnFygyoIY4KIZVSkz74TWcTqzYHg0NLcwsyc+79aGe6JFlbH3eHOiljl/5U
	zlarVKecMINJT4nzDry8t4Vxy6BsgG+JgfyV2bsqCTInefRCBT4jDC1uUMJhCeN1uAIg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build: add compile_commands.json target
Message-Id: <E1wtkkH-004dXq-1f@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 11:34:13 +0000

commit ad82632486e72a05dce928434739f663da005f62
Author:     George Dunlap <gwd@xenproject.org>
AuthorDate: Mon Aug 10 10:49:45 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    build: add compile_commands.json target
    
    Add a convenience target generating the compilation database from a
    built object tree, alongside the other developer conveniences (tags,
    cscope, cloc -- the last of which already walks the same .cmd files):
    
        make -C xen compile_commands.json
    
    The output lands in the object tree root.  For an in-tree build,
    clangd and other consumers discover it there automatically when
    opening files; for an out-of-tree build, symlink it into the source
    tree root (consumers search the ancestors of the file being edited).
    
    Note the database records the compiler invocations actually used.
    With a clang build it is consumable by clangd as-is; for a gcc build,
    clang-based tools may need a small .clangd configuration
    (CompileFlags: Remove/Add) dropping gcc-only flags.
    
    Also add the generated file to .gitignore.
    
    Assisted-by: LLM
    Signed-off-by: George Dunlap <gwd@xenproject.org>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 .gitignore   | 1 +
 xen/Makefile | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/.gitignore b/.gitignore
index bfc7bdf043..0aa9b801de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -192,6 +192,7 @@ xen/arch/*/include/generated
 xen/build-dir-cppcheck/
 xen/common/config_data.S
 xen/common/config.gz
+xen/compile_commands.json
 xen/cppcheck-htmlreport/
 xen/cppcheck-report/
 xen/cppcheck-misra.*
diff --git a/xen/Makefile b/xen/Makefile
index d39bdfdd53..d10c29162f 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -685,6 +685,9 @@ cloc:
 	    done; \
 	done | cloc --list-file=-
 
+compile_commands.json: FORCE
+	$(PYTHON) $(srctree)/scripts/gen_compile_commands.py -d $(objtree)
+
 # Target used by xen-analysis.sh script to retrieve Xen build system variables
 export-variable-%:
 	$(info $*=$($*))
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:11:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388171.1629366 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlJw-0004GQ-9y; Tue, 11 Aug 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 1388171.1629366; Tue, 11 Aug 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 1wtlJw-0004GI-7N; Tue, 11 Aug 2026 12:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1388171;
 Tue, 11 Aug 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 1wtlJu-0004GC-J0
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 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 1wtlJu-00GNWb-1d
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlJu-007lyc-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 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=P+VHaXNecaSkR2jLw5RkxsPsbg6NGSg36JDUqKJxAfQ=; b=vnCpwITquKwe4FXYrMqn+L/ybZ
	4xsa67nqIzEnJIz/5Isvw1Abm+YzdpaNtsReD4fObNK/0PlPIRLXfDG2Yj628cLagRqqO1EXhJfPZ
	wRUMAFce1Is9fYXqedS04GDAGTsVdaqVD9S2CYM0NldyCvLLxgIx6K5LOAIkWO725nEs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/eclair: Restrict where eclair jobs are auto-started
Message-Id: <E1wtlJu-007lyc-0c@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:11:02 +0000

commit d14794c332d63c643721b12425c6dac83fa0d3a6
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Tue May 12 18:07:22 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Aug 10 17:06:41 2026 +0200

    automation/eclair: Restrict where eclair jobs are auto-started
    
    This will prevent eclair jobs from been started automatically
    everywhere but in the main push repo, but still have the option to
    start a jobs manually.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/analyze.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index c650ed61c4..2f782c38c8 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -34,7 +34,7 @@
       when: never
     - if: $CI_JOB_NAME !~ $SELECTED_JOBS_ONLY
       when: never
-    - if: $WTOKEN && $CI_PROJECT_PATH =~ /^xen-project\/people\/.*$/
+    - if: $WTOKEN && $CI_PROJECT_PATH !~ /^xen-project\/hardware\//
       when: manual
       allow_failure: true
     - !reference [.eclair-analysis, rules]
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388172.1629369 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlK6-0004I9-BM; Tue, 11 Aug 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 1388172.1629369; Tue, 11 Aug 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 1wtlK6-0004I1-8l; Tue, 11 Aug 2026 12:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1388172;
 Tue, 11 Aug 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 1wtlK4-0004Hl-De
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 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 1wtlK4-00GNWf-24
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlK4-007nHh-15
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 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=1xs5aJcNGAt7kDqoCp9kv3eu0r2x35i7Vt8pMcb0mlI=; b=zvU0cx0n7NfULIsWmQEuTlyYCt
	ZDtL9fFEswjrvzXIBllSxu38DGgwcEsnPEp53+3ehQO/toXhS6zSietc7jwvA5v0XDqM0L+PhCShb
	Hcd8/15vF++mElfqzh+7jiTYZYWzkwMjSLkeTjrRLzxpEcDSJjpNAnhCd9e1r95AHaGg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] get_maintainer: Add maintainers based on keyword after removing THE REST
Message-Id: <E1wtlK4-007nHh-15@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:11:12 +0000

commit a2267eea69333d0556ea2ab071f7f4e039f7d819
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Wed Jul 1 18:20:22 2026 +0200
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Aug 10 17:06:44 2026 +0200

    get_maintainer: Add maintainers based on keyword after removing THE REST
    
    There's some logic to avoid CC committers (THE REST section) when a
    file is fully maintained by a list of maintainers. There's also some
    logic to add maintainers if a patch or file contains some keywords.
    
    We do add maintainers based on keyword to the list of $email_to before
    checking if we can remove emails from THE REST. And at the time when
    checking if we can drop THE REST, we've lost the information which
    tell if the maintainers was added because of a keyword of because they
    maintain the file.
    
    Reorder the logic, add maintainers based on keywords only after
    checking if we can drop THE REST.
    
    For example, if we have a file covered by a sections with only
    reviewers, but this file also contains the keyword "XSM", then:
        scripts/get_maintainer.pl -f $file
    would suppress THE REST without this patch.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 scripts/get_maintainer.pl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 533d0df72a..b788665c08 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -720,13 +720,6 @@ sub get_maintainers {
 	$suppress_the_rest = 0 if $file_maintained_by_the_rest;
     }
 
-    if ($keywords) {
-	@keyword_tvi = sort_and_uniq(@keyword_tvi);
-	foreach my $line (@keyword_tvi) {
-	    add_categories($line);
-	}
-    }
-
     if ($email_drop_the_rest_supporter_if_supporter_found &&
 	$suppress_the_rest && $#email_to > 0) {
         my @email_new;
@@ -748,6 +741,13 @@ sub get_maintainers {
             if $do_replace;
     }
 
+    if ($keywords) {
+	@keyword_tvi = sort_and_uniq(@keyword_tvi);
+	foreach my $line (@keyword_tvi) {
+	    add_categories($line);
+	}
+    }
+
     foreach my $email (@email_to, @list_to) {
 	$email->[0] = deduplicate_email($email->[0]);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388173.1629374 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlKG-0004KC-Cm; Tue, 11 Aug 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 1388173.1629374; Tue, 11 Aug 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 1wtlKG-0004K3-AA; Tue, 11 Aug 2026 12:11:24 +0000
Received: by outflank-mailman (input) for mailman id 1388173;
 Tue, 11 Aug 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 1wtlKE-0004Ju-LF
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 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 1wtlKE-00GNWj-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlKE-007oQc-1m
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 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=BEJu9QP1xJltLHYngHAePZQgq/+wEyiLE+doRkQ+UZQ=; b=EMEvTQh7knykA+8l8tNBvXvvBc
	S7N4LHyiiN6S1/G+g6Fb+U6aJktklaC4vkVY0Yemi3mu8h7np5RYcmRWvS0u9hOG0DlnSG2jIqh5X
	ts9VUEV3A3YIjIJMNcxgyg0XCv3q04PDDYXGrjjbh5y1hl4Su+OKNaZz2/0/o2yIIGas=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libs/call: cache up to 4 pages in hypercall bounce buffers
Message-Id: <E1wtlKE-007oQc-1m@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:11:22 +0000

commit a91d1616d8350a502ac7b6c9ab6455fd462ce5c5
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Mon Jul 13 21:47:59 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Mon Aug 10 17:09:22 2026 +0200

    libs/call: cache up to 4 pages in hypercall bounce buffers
    
    During migration there are a lot of mmap/munmap calls,
    because xc_get_pfn_type_batch() exceeds the default hypercall bounce
    buffer cache size, and needs to allocate every time it is called.
    
    munmap() is slow, especially in a PV Dom0 (takes an emulation fault),
    so is best avoided.
    
    Eventually it'd be good if the memory pool from  xmalloc_tlsf.c
    was reused here, but for now make it handle the commonly encountered
    sizes (so far up to 4 pages).
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/call/buffer.c  | 34 +++++++++++++++++++++++-----------
 tools/libs/call/core.c    |  3 ++-
 tools/libs/call/private.h |  8 +++++---
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
index 155e4f9d43..b7d00185c4 100644
--- a/tools/libs/call/buffer.c
+++ b/tools/libs/call/buffer.c
@@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
 {
     void *p = NULL;
 
+    if ( nr_pages == 0 )
+        return NULL;
+
     cache_lock(xcall);
 
     xcall->buffer_total_allocations++;
@@ -56,13 +59,13 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
     if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allocations )
         xcall->buffer_maximum_allocations = xcall->buffer_current_allocations;
 
-    if ( nr_pages > 1 )
+    if ( nr_pages > ARRAY_SIZE(xcall->buffer_cache) )
     {
         xcall->buffer_cache_toobig++;
     }
-    else if ( xcall->buffer_cache_nr > 0 )
+    else if ( xcall->buffer_cache_nr[nr_pages-1] > 0 )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        p = xcall->buffer_cache[nr_pages-1][--xcall->buffer_cache_nr[nr_pages-1]];
         xcall->buffer_cache_hits++;
     }
     else
@@ -79,15 +82,18 @@ static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
 {
     int rc = 0;
 
+    if ( nr_pages == 0 )
+        return 0;
+
     cache_lock(xcall);
 
     xcall->buffer_total_releases++;
     xcall->buffer_current_allocations--;
 
-    if ( nr_pages == 1 &&
-         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+    if ( nr_pages && nr_pages <= ARRAY_SIZE(xcall->buffer_cache) &&
+         xcall->buffer_cache_nr[nr_pages-1] < BUFFER_CACHE_SIZE )
     {
-        xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
+        xcall->buffer_cache[nr_pages-1][xcall->buffer_cache_nr[nr_pages-1]++] = p;
         rc = 1;
     }
 
@@ -108,17 +114,23 @@ void buffer_release_cache(xencall_handle *xcall)
     DBGPRINTF("current allocations:%d maximum allocations:%d",
               xcall->buffer_current_allocations,
               xcall->buffer_maximum_allocations);
-    DBGPRINTF("cache current size:%d",
-              xcall->buffer_cache_nr);
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
+    {
+        DBGPRINTF("cache current size[%u pages]:%d", i+1,
+                xcall->buffer_cache_nr[i]);
+    }
     DBGPRINTF("cache hits:%d misses:%d toobig:%d",
               xcall->buffer_cache_hits,
               xcall->buffer_cache_misses,
               xcall->buffer_cache_toobig);
 
-    while ( xcall->buffer_cache_nr > 0 )
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
-        osdep_free_pages(xcall, p, 1);
+        while ( xcall->buffer_cache_nr[i] > 0 )
+        {
+            p = xcall->buffer_cache[i][--xcall->buffer_cache_nr[i]];
+            osdep_free_pages(xcall, p, i + 1);
+        }
     }
 
     cache_unlock(xcall);
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index 02c4f8e1ae..dd8877c1a0 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -14,6 +14,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "private.h"
 
@@ -44,7 +45,7 @@ xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
     xentoolcore__register_active_handle(&xcall->tc_ah);
 
     xcall->flags = open_flags;
-    xcall->buffer_cache_nr = 0;
+    memset(xcall->buffer_cache_nr, 0, sizeof(xcall->buffer_cache_nr));
 
     xcall->buffer_total_allocations = 0;
     xcall->buffer_total_releases = 0;
diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
index 9c3aa432ef..8e6a208975 100644
--- a/tools/libs/call/private.h
+++ b/tools/libs/call/private.h
@@ -31,13 +31,15 @@ struct xencall_handle {
     Xentoolcore__Active_Handle tc_ah;
 
     /*
-     * A simple cache of unused, single page, hypercall buffers
+     * A simple cache of unused, small, hypercall buffers
+     * buffer_cache[i]'s size is (i+1) pages
      *
      * Protected by a global lock.
      */
 #define BUFFER_CACHE_SIZE 4
-    int buffer_cache_nr;
-    void *buffer_cache[BUFFER_CACHE_SIZE];
+#define BUFFER_CACHE_NRPAGES 4
+    int buffer_cache_nr[BUFFER_CACHE_NRPAGES];
+    void *buffer_cache[BUFFER_CACHE_NRPAGES][BUFFER_CACHE_SIZE];
 
     /*
      * Hypercall buffer statistics. All protected by the global
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388174.1629378 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlKQ-0004MA-EK; Tue, 11 Aug 2026 12:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388174.1629378; Tue, 11 Aug 2026 12: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 1wtlKQ-0004M3-BP; Tue, 11 Aug 2026 12:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1388174;
 Tue, 11 Aug 2026 12:11: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 1wtlKP-0004Lv-0f
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 12:11: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 1wtlKP-00GNWo-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlKO-007pni-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 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=CLv2qbySB9xfemMO12yfdhhEzLjnO5+y5A8cxAi5rgs=; b=H94km/yvirEch3lSGN+50fXEcM
	RJDmgLX1sJ+KFidJmsTxcXHlfnjFGSzk3T9PCE72ikcCr8fh+pHPAWg5QI0YZVd9i0yO5u0ZiP0tx
	lzVW+0aGB2FAGaq5uE+3OpSUODRLzVKeJz8vgdWyA46s7frIsXyf6ZJ1TobuHaDJRpik=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libs/guest: move batch_pfns into a separate structure
Message-Id: <E1wtlKO-007pni-2y@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:11:32 +0000

commit 9b0adb928c635f01a4a60ba031548a8c6712d3f1
Author:     Frediano Ziglio <frediano.ziglio@citrix.com>
AuthorDate: Mon Jul 13 21:48:00 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:08 2026 +0200

    libs/guest: move batch_pfns into a separate structure
    
    Preparation for a followup patch "libs/guest: allocate various migration
    arrays just once".
    
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/guest/xg_sr_common.h |  5 ++++-
 tools/libs/guest/xg_sr_save.c   | 28 ++++++++++++++--------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index f1573aefcb..7574c9f5b6 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -239,11 +239,14 @@ struct xc_sr_context
 
             struct precopy_stats stats;
 
-            xen_pfn_t *batch_pfns;
             unsigned int nr_batch_pfns;
             unsigned long *deferred_pages;
             unsigned long nr_deferred_pages;
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
+            struct xc_sr_context_save_buffers
+            {
+                xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+            } *buffers;
         } save;
 
         struct /* Restore data. */
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 84fdbe4140..22348db445 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 
 /*
  * Writes a batch of memory as a PAGE_DATA record into the stream.  The batch
- * is constructed in ctx->save.batch_pfns.
+ * is constructed in ctx->save.buffers->batch_pfns.
  *
  * This function:
  * - gets the types for each pfn in the batch.
@@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
     struct iovec *iov = NULL; int iovcnt = 0;
+    xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
         struct xc_sr_rec_page_data_header page_data;
@@ -110,6 +111,7 @@ static int write_batch(struct xc_sr_context *ctx)
     };
 
     assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
 
     /* Mfns of the batch pfns. */
     mfns = malloc(nr_pfns * sizeof(*mfns));
@@ -141,13 +143,12 @@ static int write_batch(struct xc_sr_context *ctx)
 
     for ( i = 0; i < nr_pfns; ++i )
     {
-        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
-                                                      ctx->save.batch_pfns[i]);
+        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx, batch_pfns[i]);
 
         /* Likely a ballooned page. */
         if ( mfns[i] == INVALID_MFN )
         {
-            set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+            set_bit(batch_pfns[i], ctx->save.deferred_pages);
             ++ctx->save.nr_deferred_pages;
         }
     }
@@ -193,7 +194,7 @@ static int write_batch(struct xc_sr_context *ctx)
             if ( errors[p] )
             {
                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
-                      ctx->save.batch_pfns[i], mfns[p], errors[p]);
+                      batch_pfns[i], mfns[p], errors[p]);
                 goto err;
             }
 
@@ -207,7 +208,7 @@ static int write_batch(struct xc_sr_context *ctx)
             {
                 if ( rc == -1 && errno == EAGAIN )
                 {
-                    set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+                    set_bit(batch_pfns[i], ctx->save.deferred_pages);
                     ++ctx->save.nr_deferred_pages;
                     types[i] = XEN_DOMCTL_PFINFO_XTAB;
                     --nr_pages;
@@ -235,7 +236,7 @@ static int write_batch(struct xc_sr_context *ctx)
     hdrs.rec.length += nr_pages * PAGE_SIZE;
 
     for ( i = 0; i < nr_pfns; ++i )
-        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
+        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | batch_pfns[i];
 
     if ( writev_exact(ctx->fd, iov, iovcnt) )
     {
@@ -274,9 +275,9 @@ static int flush_batch(struct xc_sr_context *ctx)
 
     if ( !rc )
     {
-        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.batch_pfns,
+        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.buffers->batch_pfns,
                                     MAX_BATCH_SIZE *
-                                    sizeof(*ctx->save.batch_pfns));
+                                    sizeof(*ctx->save.buffers->batch_pfns));
     }
 
     return rc;
@@ -293,7 +294,7 @@ static int add_to_batch(struct xc_sr_context *ctx, xen_pfn_t pfn)
         rc = flush_batch(ctx);
 
     if ( rc == 0 )
-        ctx->save.batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
+        ctx->save.buffers->batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
 
     return rc;
 }
@@ -784,11 +785,10 @@ static int setup(struct xc_sr_context *ctx)
 
     dirty_bitmap = xc_hypercall_buffer_alloc_pages(
         xch, dirty_bitmap, NRPAGES(bitmap_size(ctx->save.p2m_size)));
-    ctx->save.batch_pfns = malloc(MAX_BATCH_SIZE *
-                                  sizeof(*ctx->save.batch_pfns));
     ctx->save.deferred_pages = bitmap_alloc(ctx->save.p2m_size);
+    ctx->save.buffers = calloc(1, sizeof(*ctx->save.buffers));
 
-    if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
+    if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
         ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
               " deferred pages");
@@ -819,7 +819,7 @@ static void cleanup(struct xc_sr_context *ctx)
     xc_hypercall_buffer_free_pages(xch, dirty_bitmap,
                                    NRPAGES(bitmap_size(ctx->save.p2m_size)));
     free(ctx->save.deferred_pages);
-    free(ctx->save.batch_pfns);
+    free(ctx->save.buffers);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388175.1629382 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlKa-0004OF-GL; Tue, 11 Aug 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 1388175.1629382; Tue, 11 Aug 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 1wtlKa-0004O7-D3; Tue, 11 Aug 2026 12:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1388175;
 Tue, 11 Aug 2026 12:11: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 1wtlKZ-0004O1-5N
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 12:11: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 1wtlKZ-00GNXD-1G
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlKZ-007qvJ-0K
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11: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=tW+QXHN/yAsg+NqYm1V4yMktBxHhVJ62YeeFidktfpY=; b=MxbL11itRUYMT/OcVfKOubyoeh
	Lnqww/TO/zwTJ2G/QXF4ACWSSdqpbdl2xKr0F23S6QHVT3KHAi/gEGZdOCA2tC6F9BeT1d9UVkL49
	aV0faMO9hHvu4+3nJiQd6ng8ieF7PNJZ3Psb7i57MxRCd1u7QvbNIeMt3bJKbOGZlVrg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libs/guest: allocate various migration arrays just once
Message-Id: <E1wtlKZ-007qvJ-0K@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:11:43 +0000

commit 0f133c8c73752f572cc31e4e9908f4955ae59550
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Mon Jul 13 21:48:01 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    libs/guest: allocate various migration arrays just once
    
    Allocate these array just once at the start of migration,
    using the maximum batch size, and free them at the end.
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/guest/xg_sr_common.h |  6 ++++++
 tools/libs/guest/xg_sr_save.c   | 45 +++++++++++++++--------------------------
 2 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 7574c9f5b6..c07c6db59e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -246,6 +246,12 @@ struct xc_sr_context
             struct xc_sr_context_save_buffers
             {
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                xen_pfn_t mfns[MAX_BATCH_SIZE];
+                xen_pfn_t types[MAX_BATCH_SIZE];
+                void *local_pages[MAX_BATCH_SIZE];
+                struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                uint64_t rec_pfns[MAX_BATCH_SIZE];
+                int errors[MAX_BATCH_SIZE];
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 22348db445..6a77e33a47 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -86,15 +86,12 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 static int write_batch(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    xen_pfn_t *mfns = NULL, *types = NULL;
     void *guest_mapping = NULL;
-    void **local_pages = NULL;
-    int *errors = NULL, rc = -1;
+    int rc = -1;
     unsigned int i, p, nr_pages = 0, nr_pages_mapped = 0;
     unsigned int nr_pfns = ctx->save.nr_batch_pfns;
     void *page, *orig_page;
-    uint64_t *rec_pfns = NULL;
-    struct iovec *iov = NULL; int iovcnt = 0;
+    int iovcnt = 0;
     xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
@@ -110,28 +107,21 @@ static int write_batch(struct xc_sr_context *ctx)
         },
     };
 
-    assert(nr_pfns != 0);
-    assert(nr_pfns <= MAX_BATCH_SIZE);
-
     /* Mfns of the batch pfns. */
-    mfns = malloc(nr_pfns * sizeof(*mfns));
+    xen_pfn_t *const mfns = ctx->save.buffers->mfns;
     /* Types of the batch pfns. */
-    types = malloc(nr_pfns * sizeof(*types));
+    xen_pfn_t *const types = ctx->save.buffers->types;
     /* Errors from attempting to map the gfns. */
-    errors = malloc(nr_pfns * sizeof(*errors));
+    int *const errors = ctx->save.buffers->errors;
     /* Pointers to locally allocated pages.  Need freeing. */
-    local_pages = calloc(nr_pfns, sizeof(*local_pages));
+    void **const local_pages = ctx->save.buffers->local_pages;
     /* iovec[] for writev(). */
-    iov = malloc((nr_pfns + 2) * sizeof(*iov));
+    struct iovec *const iov = ctx->save.buffers->iov;
     /* page_data record PFNs list */
-    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
+    uint64_t *const rec_pfns = ctx->save.buffers->rec_pfns;
 
-    if ( !mfns || !types || !errors || !local_pages || !iov || !rec_pfns )
-    {
-        ERROR("Unable to allocate arrays for a batch of %u pages",
-              nr_pfns);
-        goto err;
-    }
+    assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
 
     iov[0].iov_base = &hdrs;
     iov[0].iov_len = sizeof(hdrs);
@@ -249,14 +239,11 @@ static int write_batch(struct xc_sr_context *ctx)
  err:
     if ( guest_mapping )
         xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
-    for ( i = 0; local_pages && i < nr_pfns; ++i )
+    for ( i = 0; i < nr_pfns; ++i )
+    {
         free(local_pages[i]);
-    free(rec_pfns);
-    free(iov);
-    free(local_pages);
-    free(errors);
-    free(types);
-    free(mfns);
+        local_pages[i] = NULL;
+    }
 
     return rc;
 }
@@ -790,8 +777,8 @@ static int setup(struct xc_sr_context *ctx)
 
     if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
-        ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
-              " deferred pages");
+        ERROR("Unable to allocate memory for dirty bitmaps, deferred pages"
+              " and various batch buffers");
         rc = -1;
         errno = ENOMEM;
         goto err;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388176.1629385 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlKk-0004Qt-JQ; Tue, 11 Aug 2026 12:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388176.1629385; Tue, 11 Aug 2026 12:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlKk-0004Ql-Gr; Tue, 11 Aug 2026 12:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1388176;
 Tue, 11 Aug 2026 12: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 1wtlKj-0004QY-8p
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 12:11:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlKj-00GNXK-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlKj-007raQ-0h
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:11: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=VBczkZi80RkgSZGg2daa2M/xZYcS9UiofWZ1Ihhc9as=; b=JLWaeUhr0JrWS7f4v9NbwRl7B6
	b+oTPn7YOemfqKkuXwmgQFkLAGfSyoTf1d8jIBJGUHMf767Ak51wd6EYdIeLnvVLGX2dGbljA20mQ
	CBS5RWLJbS06u1Ud0TQJrcQ1Cvux87JbG5I/LwNMrKacNP9ZDnrOdrgqkXCCqgNRwzg8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/scripts: import gen_compile_commands.py from Linux
Message-Id: <E1wtlKj-007raQ-0h@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:11:53 +0000

commit 359dae385290e7da959964ed1d652af2d106343d
Author:     George Dunlap <gwd@xenproject.org>
AuthorDate: Mon Aug 10 10:49:43 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    xen/scripts: import gen_compile_commands.py from Linux
    
    Xen's Kbuild-derived build system records the exact command line used
    to compile each object in .<target>.o.cmd files.  That is everything
    needed to produce a compile_commands.json compilation database, the
    format clangd and other tooling consume to provide accurate
    cross-referencing (go to definition, find references, call hierarchy)
    in LSP-capable editors.
    
    Import scripts/clang-tools/gen_compile_commands.py from the Linux
    kernel, unmodified, so that the provenance of the code is easy to
    verify (commit 90efe2b9119f, Linux v6.16).
    
    As-is the script produces an empty database on a Xen tree, since
    Xen's compile command lines differ slightly from Linux's; the
    following patch adapts it.
    
    Assisted-by: LLM
    Signed-off-by: George Dunlap <gwd@xenproject.org>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 xen/scripts/gen_compile_commands.py | 228 ++++++++++++++++++++++++++++++++++++
 1 file changed, 228 insertions(+)

diff --git a/xen/scripts/gen_compile_commands.py b/xen/scripts/gen_compile_commands.py
new file mode 100755
index 0000000000..96e6e46ad1
--- /dev/null
+++ b/xen/scripts/gen_compile_commands.py
@@ -0,0 +1,228 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) Google LLC, 2018
+#
+# Author: Tom Roeder <tmroeder@google.com>
+#
+"""A tool for generating compile_commands.json in the Linux kernel."""
+
+import argparse
+import json
+import logging
+import os
+import re
+import subprocess
+import sys
+
+_DEFAULT_OUTPUT = 'compile_commands.json'
+_DEFAULT_LOG_LEVEL = 'WARNING'
+
+_FILENAME_PATTERN = r'^\..*\.cmd$'
+_LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P<command_prefix>.* )(?P<file_path>[^ ]*\.[cS]) *(;|$)'
+_VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
+# The tools/ directory adopts a different build system, and produces .cmd
+# files in a different format. Do not support it.
+_EXCLUDE_DIRS = ['.git', 'Documentation', 'include', 'tools']
+
+def parse_arguments():
+    """Sets up and parses command-line arguments.
+
+    Returns:
+        log_level: A logging level to filter log output.
+        directory: The work directory where the objects were built.
+        ar: Command used for parsing .a archives.
+        output: Where to write the compile-commands JSON file.
+        paths: The list of files/directories to handle to find .cmd files.
+    """
+    usage = 'Creates a compile_commands.json database from kernel .cmd files'
+    parser = argparse.ArgumentParser(description=usage)
+
+    directory_help = ('specify the output directory used for the kernel build '
+                      '(defaults to the working directory)')
+    parser.add_argument('-d', '--directory', type=str, default='.',
+                        help=directory_help)
+
+    output_help = ('path to the output command database (defaults to ' +
+                   _DEFAULT_OUTPUT + ')')
+    parser.add_argument('-o', '--output', type=str, default=_DEFAULT_OUTPUT,
+                        help=output_help)
+
+    log_level_help = ('the level of log messages to produce (defaults to ' +
+                      _DEFAULT_LOG_LEVEL + ')')
+    parser.add_argument('--log_level', choices=_VALID_LOG_LEVELS,
+                        default=_DEFAULT_LOG_LEVEL, help=log_level_help)
+
+    ar_help = 'command used for parsing .a archives'
+    parser.add_argument('-a', '--ar', type=str, default='llvm-ar', help=ar_help)
+
+    paths_help = ('directories to search or files to parse '
+                  '(files should be *.o, *.a, or modules.order). '
+                  'If nothing is specified, the current directory is searched')
+    parser.add_argument('paths', type=str, nargs='*', help=paths_help)
+
+    args = parser.parse_args()
+
+    return (args.log_level,
+            os.path.realpath(args.directory),
+            args.output,
+            args.ar,
+            args.paths if len(args.paths) > 0 else [args.directory])
+
+
+def cmdfiles_in_dir(directory):
+    """Generate the iterator of .cmd files found under the directory.
+
+    Walk under the given directory, and yield every .cmd file found.
+
+    Args:
+        directory: The directory to search for .cmd files.
+
+    Yields:
+        The path to a .cmd file.
+    """
+
+    filename_matcher = re.compile(_FILENAME_PATTERN)
+    exclude_dirs = [ os.path.join(directory, d) for d in _EXCLUDE_DIRS ]
+
+    for dirpath, dirnames, filenames in os.walk(directory, topdown=True):
+        # Prune unwanted directories.
+        if dirpath in exclude_dirs:
+            dirnames[:] = []
+            continue
+
+        for filename in filenames:
+            if filename_matcher.match(filename):
+                yield os.path.join(dirpath, filename)
+
+
+def to_cmdfile(path):
+    """Return the path of .cmd file used for the given build artifact
+
+    Args:
+        Path: file path
+
+    Returns:
+        The path to .cmd file
+    """
+    dir, base = os.path.split(path)
+    return os.path.join(dir, '.' + base + '.cmd')
+
+
+def cmdfiles_for_a(archive, ar):
+    """Generate the iterator of .cmd files associated with the archive.
+
+    Parse the given archive, and yield every .cmd file used to build it.
+
+    Args:
+        archive: The archive to parse
+
+    Yields:
+        The path to every .cmd file found
+    """
+    for obj in subprocess.check_output([ar, '-t', archive]).decode().split():
+        yield to_cmdfile(obj)
+
+
+def cmdfiles_for_modorder(modorder):
+    """Generate the iterator of .cmd files associated with the modules.order.
+
+    Parse the given modules.order, and yield every .cmd file used to build the
+    contained modules.
+
+    Args:
+        modorder: The modules.order file to parse
+
+    Yields:
+        The path to every .cmd file found
+    """
+    with open(modorder) as f:
+        for line in f:
+            obj = line.rstrip()
+            base, ext = os.path.splitext(obj)
+            if ext != '.o':
+                sys.exit('{}: module path must end with .o'.format(obj))
+            mod = base + '.mod'
+            # Read from *.mod, to get a list of objects that compose the module.
+            with open(mod) as m:
+                for mod_line in m:
+                    yield to_cmdfile(mod_line.rstrip())
+
+
+def process_line(root_directory, command_prefix, file_path):
+    """Extracts information from a .cmd line and creates an entry from it.
+
+    Args:
+        root_directory: The directory that was searched for .cmd files. Usually
+            used directly in the "directory" entry in compile_commands.json.
+        command_prefix: The extracted command line, up to the last element.
+        file_path: The .c file from the end of the extracted command.
+            Usually relative to root_directory, but sometimes absolute.
+
+    Returns:
+        An entry to append to compile_commands.
+
+    Raises:
+        ValueError: Could not find the extracted file based on file_path and
+            root_directory or file_directory.
+    """
+    # The .cmd files are intended to be included directly by Make, so they
+    # escape the pound sign '#' as '$(pound)'. The compile_commands.json file
+    # is not interepreted by Make, so this code replaces the escaped version
+    # with '#'.
+    prefix = command_prefix.replace('$(pound)', '#')
+
+    # Return the canonical path, eliminating any symbolic links encountered in the path.
+    abs_path = os.path.realpath(os.path.join(root_directory, file_path))
+    if not os.path.exists(abs_path):
+        raise ValueError('File %s not found' % abs_path)
+    return {
+        'directory': root_directory,
+        'file': abs_path,
+        'command': prefix + file_path,
+    }
+
+
+def main():
+    """Walks through the directory and finds and parses .cmd files."""
+    log_level, directory, output, ar, paths = parse_arguments()
+
+    level = getattr(logging, log_level)
+    logging.basicConfig(format='%(levelname)s: %(message)s', level=level)
+
+    line_matcher = re.compile(_LINE_PATTERN)
+
+    compile_commands = []
+
+    for path in paths:
+        # If 'path' is a directory, handle all .cmd files under it.
+        # Otherwise, handle .cmd files associated with the file.
+        # built-in objects are linked via vmlinux.a
+        # Modules are listed in modules.order.
+        if os.path.isdir(path):
+            cmdfiles = cmdfiles_in_dir(path)
+        elif path.endswith('.a'):
+            cmdfiles = cmdfiles_for_a(path, ar)
+        elif path.endswith('modules.order'):
+            cmdfiles = cmdfiles_for_modorder(path)
+        else:
+            sys.exit('{}: unknown file type'.format(path))
+
+        for cmdfile in cmdfiles:
+            with open(cmdfile, 'rt') as f:
+                result = line_matcher.match(f.readline())
+                if result:
+                    try:
+                        entry = process_line(directory, result.group('command_prefix'),
+                                             result.group('file_path'))
+                        compile_commands.append(entry)
+                    except ValueError as err:
+                        logging.info('Could not add line from %s: %s',
+                                     cmdfile, err)
+
+    with open(output, 'wt') as f:
+        json.dump(sorted(compile_commands, key=lambda x: x["file"]), f, indent=2, sort_keys=True)
+
+
+if __name__ == '__main__':
+    main()
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:12:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388178.1629399 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlKt-0004ge-R1; Tue, 11 Aug 2026 12:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388178.1629399; Tue, 11 Aug 2026 12: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 1wtlKt-0004gX-O8; Tue, 11 Aug 2026 12:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1388178;
 Tue, 11 Aug 2026 12: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 1wtlKt-0004gQ-CE
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 12: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 1wtlKt-00GNXb-1x
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlKt-007sQ1-10
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:12:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gKcJub3v0HIaIFNTe0UtwJsggsz29dpCt4nQpekid5w=; b=AHwhi5s/2iz2sywM0V30pCO5PO
	5nwIWo9sre8rlNRGBFdSaZICJmg5R6oa/8TGAWRTHy5F4d2IXsB7Ihm+8R0SRcPHpYZneLigM5Tcs
	KDqW9ZmJhNBgBvnuIac0iADE5Gd+/7uhcLWiM8qw/NSbY2r4CMsPZoRATvkvBmjh7auw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/scripts: adapt gen_compile_commands.py to Xen
Message-Id: <E1wtlKt-007sQ1-10@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:12:03 +0000

commit 79ea30888d08f54bd9bfabf0dee8ab3c2d125ef2
Author:     George Dunlap <gwd@xenproject.org>
AuthorDate: Mon Aug 10 10:49:44 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    xen/scripts: adapt gen_compile_commands.py to Xen
    
    Two changes from the Linux original:
    
     - Linux's compiler invocations end with the source file
       ("... -c -o foo.o foo.c"), and the script's line pattern relies
       on that; Xen's cmd_cc_o_c places "-c $<" before "-o" and "-MQ",
       so on a Xen object tree the unmodified script matches nothing and
       produces an empty database.  Adjust _LINE_PATTERN to capture the
       command up to and including "-c" plus the source file, dropping
       the remainder, which database consumers do not need.
    
     - Reword the docstring and help text to refer to Xen.
    
    The support for reading object lists from archives and modules.order
    is unused in Xen but retained to minimise divergence from the
    original.
    
    Assisted-by: LLM
    Signed-off-by: George Dunlap <gwd@xenproject.org>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 xen/scripts/gen_compile_commands.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/scripts/gen_compile_commands.py b/xen/scripts/gen_compile_commands.py
index 96e6e46ad1..1c9b05e4dd 100755
--- a/xen/scripts/gen_compile_commands.py
+++ b/xen/scripts/gen_compile_commands.py
@@ -5,7 +5,7 @@
 #
 # Author: Tom Roeder <tmroeder@google.com>
 #
-"""A tool for generating compile_commands.json in the Linux kernel."""
+"""A tool for generating compile_commands.json for the Xen hypervisor."""
 
 import argparse
 import json
@@ -19,7 +19,11 @@ _DEFAULT_OUTPUT = 'compile_commands.json'
 _DEFAULT_LOG_LEVEL = 'WARNING'
 
 _FILENAME_PATTERN = r'^\..*\.cmd$'
-_LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P<command_prefix>.* )(?P<file_path>[^ ]*\.[cS]) *(;|$)'
+# Capture the command up to and including "-c" plus the source file, and
+# drop the remainder: all that follows the source file is the output
+# location and dependency-tracking arguments ("-o ...", "-MQ ..."), which
+# database consumers do not need.
+_LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P<command_prefix>.* -c )(?P<file_path>[^ ]*\.[cS])( .*)?$'
 _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
 # The tools/ directory adopts a different build system, and produces .cmd
 # files in a different format. Do not support it.
@@ -35,10 +39,10 @@ def parse_arguments():
         output: Where to write the compile-commands JSON file.
         paths: The list of files/directories to handle to find .cmd files.
     """
-    usage = 'Creates a compile_commands.json database from kernel .cmd files'
+    usage = 'Creates a compile_commands.json database from Xen .cmd files'
     parser = argparse.ArgumentParser(description=usage)
 
-    directory_help = ('specify the output directory used for the kernel build '
+    directory_help = ('specify the output directory used for the Xen build '
                       '(defaults to the working directory)')
     parser.add_argument('-d', '--directory', type=str, default='.',
                         help=directory_help)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 11 12:12:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Aug 2026 12:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388181.1629403 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlL4-0004mq-SE; Tue, 11 Aug 2026 12:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388181.1629403; Tue, 11 Aug 2026 12:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wtlL4-0004mi-Pg; Tue, 11 Aug 2026 12:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1388181;
 Tue, 11 Aug 2026 12: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 1wtlL3-0004mG-F2
 for xen-changelog@lists.xenproject.org; Tue, 11 Aug 2026 12: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 1wtlL3-00GNXf-2F
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wtlL3-007tEf-1J
 for xen-changelog@lists.xenproject.org;
 Tue, 11 Aug 2026 12: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=YjYPkyzJAyhPopYcYkqVtsXHoinv63MvnnWBDitUKG0=; b=JN5BCO9YcutykkQmCDDs7696NV
	NDAKW8N++L1yEsWg+N+36Y+27der79d/YQjuEyjgFPYBz7B5YXXg3bLUThWCOPjGupKCHP6COLTOt
	ose5V0Oue2mB9LGgoIGJP/xbjgANs2j5+FqPxnoc/8/0bHbVOmHUYFAIDgXPIfZ35yl0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: add compile_commands.json target
Message-Id: <E1wtlL3-007tEf-1J@xenbits.xenproject.org>
Date: Tue, 11 Aug 2026 12:12:13 +0000

commit ad82632486e72a05dce928434739f663da005f62
Author:     George Dunlap <gwd@xenproject.org>
AuthorDate: Mon Aug 10 10:49:45 2026 +0100
Commit:     Anthony PERARD <anthony.perard@vates.tech>
CommitDate: Tue Aug 11 11:07:16 2026 +0200

    build: add compile_commands.json target
    
    Add a convenience target generating the compilation database from a
    built object tree, alongside the other developer conveniences (tags,
    cscope, cloc -- the last of which already walks the same .cmd files):
    
        make -C xen compile_commands.json
    
    The output lands in the object tree root.  For an in-tree build,
    clangd and other consumers discover it there automatically when
    opening files; for an out-of-tree build, symlink it into the source
    tree root (consumers search the ancestors of the file being edited).
    
    Note the database records the compiler invocations actually used.
    With a clang build it is consumable by clangd as-is; for a gcc build,
    clang-based tools may need a small .clangd configuration
    (CompileFlags: Remove/Add) dropping gcc-only flags.
    
    Also add the generated file to .gitignore.
    
    Assisted-by: LLM
    Signed-off-by: George Dunlap <gwd@xenproject.org>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 .gitignore   | 1 +
 xen/Makefile | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/.gitignore b/.gitignore
index bfc7bdf043..0aa9b801de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -192,6 +192,7 @@ xen/arch/*/include/generated
 xen/build-dir-cppcheck/
 xen/common/config_data.S
 xen/common/config.gz
+xen/compile_commands.json
 xen/cppcheck-htmlreport/
 xen/cppcheck-report/
 xen/cppcheck-misra.*
diff --git a/xen/Makefile b/xen/Makefile
index d39bdfdd53..d10c29162f 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -685,6 +685,9 @@ cloc:
 	    done; \
 	done | cloc --list-file=-
 
+compile_commands.json: FORCE
+	$(PYTHON) $(srctree)/scripts/gen_compile_commands.py -d $(objtree)
+
 # Target used by xen-analysis.sh script to retrieve Xen build system variables
 export-variable-%:
 	$(info $*=$($*))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 09:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 09:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388952.1629910 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5fr-0008It-9i; Wed, 12 Aug 2026 09:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388952.1629910; Wed, 12 Aug 2026 09:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5fr-0008Im-7J; Wed, 12 Aug 2026 09:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1388952;
 Wed, 12 Aug 2026 09:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wu5fq-0008Ig-D7
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 2026 09:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5fq-000PAc-0m
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5fp-000DqE-2x
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=w7lelgmP8e9YH41wr/EQwGdiZrVgfNqc1dsMMtE+Zls=; b=0Mop28EjRkm4TvgePREU/P4aFi
	Cs4rTU3QtSyzmcOzwm7UY5kPXSqDTpFBvfgRBXs2RS6euQd4c1JsAfBTCrpLynUNMYn3sebZIg4MW
	Nh8IR6v2UeggxUav5OGo2mcBRrgE93n7AAZkoc3GgXOZfaHLpI/g/QFQqx9+8Nmu4BjI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/console: do not use XENCONS_RING_IDX in console_init_ring()
Message-Id: <E1wu5fp-000DqE-2x@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 09:55:01 +0000

commit ba911c5db27c28673a6d2b16a8709bc14d6ee43c
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:46:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:46:37 2026 +0200

    xen/console: do not use XENCONS_RING_IDX in console_init_ring()
    
    Replace XENCONS_RING_IDX with unsigned int for the console ring indices,
    as the console ring is not a Xen console (XENCONS) ring.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/console.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ea4e3ff341..37fdda93a4 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -463,7 +463,7 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
 void __init console_init_ring(void)
 {
     char *ring;
-    XENCONS_RING_IDX done, size, n;
+    unsigned int done, size, n;
     unsigned int order, memflags;
     unsigned long flags;
 
@@ -484,8 +484,8 @@ void __init console_init_ring(void)
     size = conringp - conringc;
     for ( done = 0; done < size; done += n )
     {
-        XENCONS_RING_IDX src = (conringc + done) & (conring_size - 1);
-        XENCONS_RING_IDX dst = (conringc + done) & (opt_conring_size - 1);
+        unsigned int src = (conringc + done) & (conring_size - 1);
+        unsigned int dst = (conringc + done) & (opt_conring_size - 1);
 
         n = min(opt_conring_size - dst, conring_size - src);
         n = min(size - done, n);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 09:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 09:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388953.1629916 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5g1-0008Kq-CB; Wed, 12 Aug 2026 09:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388953.1629916; Wed, 12 Aug 2026 09:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5g1-0008Ki-8e; Wed, 12 Aug 2026 09:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1388953;
 Wed, 12 Aug 2026 09:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wu5g0-0008KX-6v
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 2026 09:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5g0-000PAg-1P
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5g0-000ExI-0K
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GQpmgbqbAiKF6Nf8Zb3EDzKmDzC3K7AM0jil162ezuk=; b=uXrRfFb9RIdq14nIh+C5L2FFyt
	JXewLlaNUsVy0sEhO1nAzL8D4adYZdjkY38Fa0LpZpWu2GR9ItPJu4UdMeQac/AVnnr+2keS+Vqg7
	/Tf8gVmu4EUw2v1naG4r+pxMBghATmMnw+zbViwzggkbNtukeahD5cDqHQwSi0cYCO1c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/console: use 'unsigned int' in read_console_ring() and conring_flush()
Message-Id: <E1wu5g0-000ExI-0K@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 09:55:12 +0000

commit 476625c50d659cd74c4f12ee77721a06e5e57a9e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:47:03 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:47:03 2026 +0200

    xen/console: use 'unsigned int' in read_console_ring() and conring_flush()
    
    read_console_ring() and conring_flush() still use 'uint32_t' to access
    indices.
    
    Switch to 'unsigned int' to as required by CODING_STYLE.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 37fdda93a4..40355c1d14 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -375,7 +375,7 @@ static void conring_puts(const char *str, size_t len)
 long read_console_ring(struct xen_sysctl_readconsole *op)
 {
     XEN_GUEST_HANDLE_PARAM(char) str;
-    uint32_t idx, len, max, sofar, c, p;
+    unsigned int idx, len, max, sofar, c, p;
 
     str   = guest_handle_cast(op->buffer, char),
     max   = op->count;
@@ -421,7 +421,7 @@ long read_console_ring(struct xen_sysctl_readconsole *op)
  */
 static int conring_flush(unsigned int flags)
 {
-    uint32_t idx, len, sofar, c;
+    unsigned int idx, len, sofar, c;
     unsigned int order;
     char *buf;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 09:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 09:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388954.1629919 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5gB-0008Mp-Cx; Wed, 12 Aug 2026 09:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388954.1629919; Wed, 12 Aug 2026 09: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 1wu5gB-0008Mh-A3; Wed, 12 Aug 2026 09:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1388954;
 Wed, 12 Aug 2026 09: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 1wu5gA-0008MZ-DN
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 2026 09: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 1wu5gA-000PAn-24
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5gA-000G3N-12
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BOzW62wAXuGCHaSkgJpnw1cTXC3EgXXB4VUpEd51zf0=; b=0H7lrHfeX/w/6ovyZ6U8upFcje
	HM210LBJa12/+qciqoebzjBrId2vzfR8f/dXcYNLjsM7tgci/rK0sXVEyZZykoaK3hebLpTXaOeJA
	y2JNcWjJ9whrGefoh2j2Qm4timqTLBYiTujn4cLXXcA9NXt9SNu2bkrDhH6YJjMnga5U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/serial: switch txbuf runtime allocation to xvmalloc
Message-Id: <E1wu5gA-000G3N-12@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 09:55:22 +0000

commit b8625a9fdbaa036def27855ea3f9267bcc9d0f73
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:47:21 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:47:21 2026 +0200

    xen/serial: switch txbuf runtime allocation to xvmalloc
    
    Switch 'txbuf' allocation to xvmalloc_array() since there is no
    hard requirement to have buffer physically contiguous.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index e3c3564089..cf0abf1893 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -12,6 +12,7 @@
 #include <xen/param.h>
 #include <xen/sections.h>
 #include <xen/serial.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/processor.h>
 
@@ -524,8 +525,7 @@ void __init serial_async_transmit(struct serial_port *port)
         serial_txbufsz = PAGE_SIZE;
     while ( serial_txbufsz & (serial_txbufsz - 1) )
         serial_txbufsz &= serial_txbufsz - 1;
-    port->txbuf = alloc_xenheap_pages(
-        get_order_from_bytes(serial_txbufsz), 0);
+    port->txbuf = xvmalloc_array(char, serial_txbufsz);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 09:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 09:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388955.1629923 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5gL-0008PJ-FK; Wed, 12 Aug 2026 09:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388955.1629923; Wed, 12 Aug 2026 09: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 1wu5gL-0008PB-Ch; Wed, 12 Aug 2026 09:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1388955;
 Wed, 12 Aug 2026 09:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wu5gK-0008P5-GP
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 2026 09:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5gK-000PAr-2N
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5gK-000HCC-1Q
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09: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=JVONJvFnL7etoRD3EcCVwHt5BBQqBR5YeMmyqV292W4=; b=cw0GIAuHMuY8xqVLfZWlwkjZJq
	NIBLUh+sHDoljKwp9QVw76Janz6Nwp3Dh6joJ+ds7QjdpIpuTvZnsXhKPU7OV4LvGoFcBwNwEN35f
	4/K9DTBHTI9r7QyQ0hraHVy+oZnpZpDjh6Fu/Tta93JjGebUQ8c1Fq8PlUMNOBiqRSaQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] acpi: reboot: log reset parameters
Message-Id: <E1wu5gK-000HCC-1Q@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 09:55:32 +0000

commit d92587f0081b7e375715996aa78ebf0e35c71d71
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:47:40 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:47:40 2026 +0200

    acpi: reboot: log reset parameters
    
    Xen does not provide much details for system reset debugging in case
    system reset happens via ACPI subsystem.
    
    Log reset I/O address and reset value.
    
    While here, add the missing default case, add breaks between case
    statements and drop full stops in the loglines.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/acpi/reboot.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/acpi/reboot.c b/xen/drivers/acpi/reboot.c
index f6345be874..78456bca30 100644
--- a/xen/drivers/acpi/reboot.c
+++ b/xen/drivers/acpi/reboot.c
@@ -6,6 +6,7 @@ void acpi_reboot(void)
 {
 	struct acpi_generic_address *rr;
 	u8 reset_value;
+	pci_sbdf_t sbdf;
 
 	rr = &acpi_gbl_FADT.reset_register;
 
@@ -21,17 +22,27 @@ void acpi_reboot(void)
 	 * on a device on bus 0. */
 	switch (rr->space_id) {
 	case ACPI_ADR_SPACE_PCI_CONFIG:
-		printk("Resetting with ACPI PCI RESET_REG.\n");
+		sbdf = PCI_SBDF(0, 0, rr->address >> 32, rr->address >> 16);
+		printk("Resetting with ACPI PCI %pp RESET_REG at %#"PRIx64" (%#x)\n",
+		       &sbdf, rr->address & 0xff, reset_value);
 		/* Write the value that resets us. */
-		pci_conf_write8(PCI_SBDF(0, 0, rr->address >> 32,
-					 rr->address >> 16),
-				(rr->address & 255),
-				reset_value);
+		pci_conf_write8(sbdf, rr->address & 0xff, reset_value);
 		break;
+
 	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
+		printk("Resetting with ACPI MEMORY at %#"PRIx64" (%#x)\n",
+		       rr->address, reset_value);
+		acpi_hw_low_level_write(8, reset_value, rr);
+		break;
+
 	case ACPI_ADR_SPACE_SYSTEM_IO:
-		printk("Resetting with ACPI MEMORY or I/O RESET_REG.\n");
+		printk("Resetting with I/O RESET_REG at %#"PRIx64" (%#x)\n",
+		       rr->address, reset_value);
 		acpi_hw_low_level_write(8, reset_value, rr);
 		break;
+
+	default:
+		/* Fallback to alternative reboot methods */
+		break;
 	}
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 09:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 09:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388956.1629929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5gW-0008RS-HO; Wed, 12 Aug 2026 09:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388956.1629929; Wed, 12 Aug 2026 09:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5gW-0008RE-E3; Wed, 12 Aug 2026 09:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1388956;
 Wed, 12 Aug 2026 09: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 1wu5gU-0008R4-KL
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 2026 09: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 1wu5gU-000PAv-2l
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5gU-000I0N-1n
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09: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=s/tkLJdN0WYSXLUCOdEbVPz5AM5m7urrR55LvoxrU4E=; b=w2FynJTNstE3aR6SytnPUat0lJ
	qbuf678EorrUAQmCTVimZD4iaI4rM/AphHIrcrwC15VnJNye08+e13ImrD5ZhridsGiI+8/bBOKuC
	uqNlS7BRniwGrv+DIirjGM+2b6/jvRZvIr7P0vXSaCCr0d2EQef5Co1yyo7zO1V3hkDs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/domctl: Fix unitialized copyback in XEN_DOMCTL_PSR_GET_*
Message-Id: <E1wu5gU-000I0N-1n@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 09:55:42 +0000

commit 015aa2e11ffb3c4ebc78cbdb8ab0ce383d0f2a31
Author:     Johann Höpfner <hoepf@cit.tum.de>
AuthorDate: Wed Aug 12 10:48:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:48:01 2026 +0200

    x86/domctl: Fix unitialized copyback in XEN_DOMCTL_PSR_GET_*
    
    domctl_psr_get_val() copies unitialized stack space back if psr_get_val
    fails. Fix by zero-initializing v_.
    
    Fixes: 03f30dc193c8 ("x86: refactor psr: L3 CAT: implement get value flow.")
    Signed-off-by: Johann Höpfner <hoepf@cit.tum.de>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index f26990208d..6e42fa383c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1347,7 +1347,7 @@ long arch_do_domctl(
             break;
 
 #define domctl_psr_get_val(d, domctl, type, copyback) ({    \
-    uint32_t v_;                                            \
+    uint32_t v_ = 0;                                        \
     int r_ = psr_get_val((d), (domctl)->u.psr_alloc.target, \
                          &v_, (type));                      \
                                                             \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 09:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 09:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388957.1629930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu5gg-0008TD-Hx; Wed, 12 Aug 2026 09:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388957.1629930; Wed, 12 Aug 2026 09: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 1wu5gg-0008T6-FQ; Wed, 12 Aug 2026 09:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1388957;
 Wed, 12 Aug 2026 09:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wu5gf-0008Sz-3Q
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 2026 09:55:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5gf-000PAz-14
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu5ge-000JAM-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 09:55:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gNB1tAlbGBBjtcJ8B5eev7qiTv4ixlvOj4FkLE2aSQk=; b=6f2n/Nv8Zk8X+cqrcDQqOXJlR8
	u2DL6yI+khdjP5zdjH73IBBtvSarXpIcmYH+U6cS1rKIjK72rJpnSCx7tzEgCPMSHETIrH7EwSiAO
	Uz0Kzfb2tfuBmnh56v+l6vsl7vd1jD3SfsTlqLmqDcak7AJohBeDNzaEAk3cT8T2EKNk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/sched: split scheduler vtable from struct scheduler
Message-Id: <E1wu5ge-000JAM-3C@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 09:55:52 +0000

commit 58db743e3beb295acf7bb3f45601e7eb7b0fa70e
Author:     Furkan Caliskan <frn1furkan10@gmail.com>
AuthorDate: Wed Aug 12 10:48:21 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:48:21 2026 +0200

    xen/sched: split scheduler vtable from struct scheduler
    
    struct scheduler currently serves two purposes: it is the static
    vtable a scheduler backend defines (name, opt_name, sched_id, and
    all its function pointers), and it is also the per-cpupool runtime
    object scheduler_alloc() allocates. Being the same type forces
    scheduler_alloc() to memcpy() the whole vtable into a fresh
    allocation per cpupool, duplicating identical function pointers
    across every cpupool using the same scheduler.
    
    Split the vtable out into its own type, struct sched_ops, so it
    can be shared by every cpupool using a given scheduler instead of
    copied per cpupool. struct scheduler is left holding only what is
    actually per-instance: a pointer to the shared sched_ops, plus
    sched_data and cpupool. scheduler_alloc() now stores a pointer to
    the matching sched_ops instance instead of copying its fields and
    uses xzalloc() to zero-initialize the struct. Every accessor in
    private.h is updated from s->field to s->ops->field to match.
    
    Every in-tree scheduler backend (credit, credit2, rtds, arinc653,
    null) is converted from struct scheduler to struct sched_ops.
    Also drop the generic comment in arinc653.c.
    
    A handful of call sites elsewhere read a scheduler's name,
    opt_name or sched_id directly and are updated to go through
    ->ops as well.
    
    Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/common/sched/arinc653.c |  9 +----
 xen/common/sched/core.c     | 51 +++++++++++++----------
 xen/common/sched/cpupool.c  |  7 ++--
 xen/common/sched/credit.c   |  3 +-
 xen/common/sched/credit2.c  |  3 +-
 xen/common/sched/null.c     |  3 +-
 xen/common/sched/private.h  | 98 +++++++++++++++++++++++----------------------
 xen/common/sched/rt.c       |  3 +-
 8 files changed, 90 insertions(+), 87 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 32c596a23c..746963806e 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -702,17 +702,10 @@ a653sched_adjust_global(const struct scheduler *ops,
 }
 #endif /* CONFIG_SYSCTL */
 
-/**
- * This structure defines our scheduler for Xen.
- * The entries tell Xen where to find our scheduler-specific
- * callback functions.
- * The symbol must be visible to the rest of Xen at link time.
- */
-static const struct scheduler sched_arinc653_def = {
+static const struct sched_ops sched_arinc653_def = {
     .name           = "ARINC 653 Scheduler",
     .opt_name       = "arinc653",
     .sched_id       = XEN_SCHEDULER_ARINC653,
-    .sched_data     = NULL,
 
     .init           = a653sched_init,
     .deinit         = a653sched_deinit,
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 8afcefd939..d3a0a97e1d 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -87,7 +87,8 @@ DEFINE_PER_CPU(cpumask_t, cpumask_scratch);
 /* How many urgent vcpus. */
 DEFINE_PER_CPU(atomic_t, sched_urgent_count);
 
-extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_array[];
+extern const struct sched_ops *__start_schedulers_array[];
+extern const struct sched_ops *__end_schedulers_array[];
 #define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
 #define schedulers __start_schedulers_array
 
@@ -127,10 +128,9 @@ static void cf_check sched_idle_schedule(
     unit->next_task = sched_idle_unit(cpu);
 }
 
-static struct scheduler sched_idle_ops = {
+static struct sched_ops sched_idle_sched_ops = {
     .name           = "Idle Scheduler",
     .opt_name       = "idle",
-    .sched_data     = NULL,
 
     .pick_resource  = sched_idle_res_pick,
     .do_schedule    = sched_idle_schedule,
@@ -139,6 +139,11 @@ static struct scheduler sched_idle_ops = {
     .free_udata     = sched_idle_free_udata,
 };
 
+static struct scheduler sched_idle_ops = {
+    .ops        = &sched_idle_sched_ops,
+    .sched_data = NULL,
+};
+
 static inline struct vcpu *unit2vcpu_cpu(const struct sched_unit *unit,
                                          unsigned int cpu)
 {
@@ -2081,7 +2086,7 @@ long do_set_timer_op(s_time_t timeout)
 /* scheduler_id - fetch ID of current scheduler */
 int scheduler_id(void)
 {
-    return operations.sched_id;
+    return operations.ops->sched_id;
 }
 #endif
 
@@ -2090,7 +2095,7 @@ long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
 {
     long ret;
 
-    if ( op->sched_id != dom_scheduler(d)->sched_id )
+    if ( op->sched_id != dom_scheduler(d)->ops->sched_id )
         return -EINVAL;
 
     switch ( op->cmd )
@@ -2132,7 +2137,7 @@ long sched_adjust_global(struct xen_sysctl_scheduler_op *op)
 
     rcu_read_lock(&sched_res_rculock);
 
-    rc = ((op->sched_id == pool->sched->sched_id)
+    rc = ((op->sched_id == pool->sched->ops->sched_id)
           ? sched_adjust_cpupool(pool->sched, op) : -EINVAL);
 
     rcu_read_unlock(&sched_res_rculock);
@@ -2299,7 +2304,7 @@ static struct sched_unit *do_schedule(struct sched_unit *prev, s_time_t now,
     struct sched_unit *next;
 
     /* get policy-specific decision on scheduling... */
-    sched->do_schedule(sched, prev, now, sched_tasklet_check(cpu));
+    sched->ops->do_schedule(sched, prev, now, sched_tasklet_check(cpu));
 
     next = prev->next_task;
 
@@ -2989,7 +2994,7 @@ void scheduler_enable(void)
 }
 
 static inline
-const struct scheduler *__init sched_get_by_name(const char *sched_name)
+const struct sched_ops *__init sched_ops_get_by_name(const char *sched_name)
 {
     unsigned int i;
 
@@ -3002,16 +3007,16 @@ const struct scheduler *__init sched_get_by_name(const char *sched_name)
 
 int __init sched_get_id_by_name(const char *sched_name)
 {
-    const struct scheduler *scheduler = sched_get_by_name(sched_name);
+    const struct sched_ops *ops = sched_ops_get_by_name(sched_name);
 
-    return scheduler ? scheduler->sched_id : -1;
+    return ops ? ops->sched_id : -1;
 }
 
 /* Initialise the data structures. */
 void __init scheduler_init(void)
 {
     struct domain *idle_domain;
-    const struct scheduler *scheduler;
+    const struct sched_ops *ops;
     int i;
 
     scheduler_enable();
@@ -3044,21 +3049,23 @@ void __init scheduler_init(void)
         }
     }
 
-    scheduler = sched_get_by_name(opt_sched);
-    if ( !scheduler )
+    ops = sched_ops_get_by_name(opt_sched);
+    if ( !ops )
     {
         printk("Could not find scheduler: %s\n", opt_sched);
-        scheduler = sched_get_by_name(CONFIG_SCHED_DEFAULT);
-        BUG_ON(!scheduler);
-        printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_name);
+        ops = sched_ops_get_by_name(CONFIG_SCHED_DEFAULT);
+        BUG_ON(!ops);
+        printk("Using '%s' (%s)\n", ops->name, ops->opt_name);
     }
-    operations = *scheduler;
+
+    operations.ops = ops;
 
     if ( cpu_schedule_up(0) )
         BUG();
     register_cpu_notifier(&cpu_schedule_nfb);
 
-    printk("Using scheduler: %s (%s)\n", operations.name, operations.opt_name);
+    printk("Using scheduler: %s (%s)\n",
+           operations.ops->name, operations.ops->opt_name);
     if ( sched_init(&operations) )
         panic("scheduler returned error on init\n");
 
@@ -3411,12 +3418,14 @@ struct scheduler *scheduler_alloc(unsigned int sched_id)
     for ( i = 0; i < NUM_SCHEDULERS; i++ )
         if ( schedulers[i] && schedulers[i]->sched_id == sched_id )
             goto found;
+
     return ERR_PTR(-ENOENT);
 
  found:
-    if ( (sched = xmalloc(struct scheduler)) == NULL )
+    if ( (sched = xzalloc(struct scheduler)) == NULL )
         return ERR_PTR(-ENOMEM);
-    memcpy(sched, schedulers[i], sizeof(*sched));
+    sched->ops = schedulers[i];
+
     if ( (ret = sched_init(sched)) != 0 )
     {
         xfree(sched);
@@ -3447,7 +3456,7 @@ void schedule_dump(struct cpupool *c)
     {
         sched = c->sched;
         cpus = c->res_valid;
-        printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name);
+        printk("Scheduler: %s (%s)\n", sched->ops->name, sched->ops->opt_name);
         sched_dump_settings(sched);
     }
     else
diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index 081e1053eb..640578201f 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -338,7 +338,8 @@ static struct cpupool *cpupool_create(unsigned int poolid,
     spin_unlock(&cpupool_lock);
 
     debugtrace_printk("Created cpupool %u with scheduler %s (%s)\n",
-                      c->cpupool_id, c->sched->name, c->sched->opt_name);
+                      c->cpupool_id, c->sched->ops->name,
+                      c->sched->ops->opt_name);
 
     return c;
 
@@ -862,7 +863,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         if ( c == NULL )
             break;
         op->cpupool_id = c->cpupool_id;
-        op->sched_id = c->sched->sched_id;
+        op->sched_id = c->sched->ops->sched_id;
         op->n_dom = c->n_dom;
         ret = cpumask_to_xenctl_bitmap(&op->cpumap, c->cpu_valid);
         cpupool_put(c);
@@ -1294,7 +1295,7 @@ struct cpupool *__init cpupool_create_pool(unsigned int pool_id, int sched_id)
     struct cpupool *pool;
 
     if ( sched_id < 0 )
-        sched_id = scheduler_get_default()->sched_id;
+        sched_id = scheduler_get_default()->ops->sched_id;
 
     pool = cpupool_create(pool_id, sched_id);
 
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 4dde2ede12..8df746bf6b 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -2277,11 +2277,10 @@ csched_deinit(struct scheduler *ops)
     }
 }
 
-static const struct scheduler sched_credit_def = {
+static const struct sched_ops sched_credit_def = {
     .name           = "SMP Credit Scheduler",
     .opt_name       = "credit",
     .sched_id       = XEN_SCHEDULER_CREDIT,
-    .sched_data     = NULL,
 
     .global_init    = csched_global_init,
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..4949606881 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -4230,11 +4230,10 @@ csched2_deinit(struct scheduler *ops)
     xfree(prv);
 }
 
-static const struct scheduler sched_credit2_def = {
+static const struct sched_ops sched_credit2_def = {
     .name           = "SMP Credit Scheduler rev2",
     .opt_name       = "credit2",
     .sched_id       = XEN_SCHEDULER_CREDIT2,
-    .sched_data     = NULL,
 
     .global_init    = csched2_global_init,
 
diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 952bb47444..b3c6651fb1 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -1037,11 +1037,10 @@ static void cf_check null_dump(const struct scheduler *ops)
     spin_unlock_irqrestore(&prv->lock, flags);
 }
 
-static const struct scheduler sched_null_def = {
+static const struct sched_ops sched_null_def = {
     .name           = "null Scheduler",
     .opt_name       = "null",
     .sched_id       = XEN_SCHEDULER_NULL,
-    .sched_data     = NULL,
 
     .init           = null_init,
     .deinit         = null_deinit,
diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index d6884550cd..18ccab183e 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -294,12 +294,10 @@ static inline spinlock_t *pcpu_schedule_trylock(unsigned int cpu)
     return NULL;
 }
 
-struct scheduler {
-    const char *name;       /* full name for this scheduler      */
-    const char *opt_name;   /* option name for this scheduler    */
-    unsigned int sched_id;  /* ID for this scheduler             */
-    void *sched_data;       /* global data pointer               */
-    struct cpupool *cpupool;/* points to this scheduler's pool   */
+struct sched_ops {
+    const char *name;       /* full name for this sched_ops      */
+    const char *opt_name;   /* option name for this sched_ops    */
+    unsigned int sched_id;  /* ID for this sched_ops             */
 
     int          (*global_init)    (void);
 
@@ -366,127 +364,133 @@ struct scheduler {
                                     struct sched_resource *sr);
 };
 
+struct scheduler {
+    const struct sched_ops *ops; /* shared, read-only dispatch table   */
+    void *sched_data;            /* per-cpupool scheduler-private data */
+    struct cpupool *cpupool;     /* points to this scheduler's pool    */
+};
+
 static inline int sched_init(struct scheduler *s)
 {
-    return s->init(s);
+    return s->ops->init(s);
 }
 
 static inline void sched_deinit(struct scheduler *s)
 {
-    s->deinit(s);
+    s->ops->deinit(s);
 }
 
 static inline spinlock_t *sched_switch_sched(struct scheduler *s,
                                              unsigned int cpu,
                                              void *pdata, void *vdata)
 {
-    return s->switch_sched(s, cpu, pdata, vdata);
+    return s->ops->switch_sched(s, cpu, pdata, vdata);
 }
 
 static inline void sched_dump_settings(const struct scheduler *s)
 {
-    if ( s->dump_settings )
-        s->dump_settings(s);
+    if ( s->ops->dump_settings )
+        s->ops->dump_settings(s);
 }
 
 static inline void sched_dump_cpu_state(const struct scheduler *s, int cpu)
 {
-    if ( s->dump_cpu_state )
-        s->dump_cpu_state(s, cpu);
+    if ( s->ops->dump_cpu_state )
+        s->ops->dump_cpu_state(s, cpu);
 }
 
 static inline void *sched_alloc_domdata(const struct scheduler *s,
                                         struct domain *d)
 {
-    return s->alloc_domdata ? s->alloc_domdata(s, d) : NULL;
+    return s->ops->alloc_domdata ? s->ops->alloc_domdata(s, d) : NULL;
 }
 
 static inline void sched_free_domdata(const struct scheduler *s,
                                       void *data)
 {
-    ASSERT(s->free_domdata || !data);
-    if ( s->free_domdata )
-        s->free_domdata(s, data);
+    ASSERT(s->ops->free_domdata || !data);
+    if ( s->ops->free_domdata )
+        s->ops->free_domdata(s, data);
 }
 
 static inline void *sched_alloc_pdata(const struct scheduler *s, int cpu)
 {
-    return s->alloc_pdata ? s->alloc_pdata(s, cpu) : NULL;
+    return s->ops->alloc_pdata ? s->ops->alloc_pdata(s, cpu) : NULL;
 }
 
 static inline void sched_free_pdata(const struct scheduler *s, void *data,
                                     int cpu)
 {
-    ASSERT(s->free_pdata || !data);
-    if ( s->free_pdata )
-        s->free_pdata(s, data, cpu);
+    ASSERT(s->ops->free_pdata || !data);
+    if ( s->ops->free_pdata )
+        s->ops->free_pdata(s, data, cpu);
 }
 
 static inline void sched_deinit_pdata(const struct scheduler *s, void *data,
                                       int cpu)
 {
-    if ( s->deinit_pdata )
-        s->deinit_pdata(s, data, cpu);
+    if ( s->ops->deinit_pdata )
+        s->ops->deinit_pdata(s, data, cpu);
 }
 
 static inline void *sched_alloc_udata(const struct scheduler *s,
                                       struct sched_unit *unit, void *dom_data)
 {
-    return s->alloc_udata(s, unit, dom_data);
+    return s->ops->alloc_udata(s, unit, dom_data);
 }
 
 static inline void sched_free_udata(const struct scheduler *s, void *data)
 {
-    s->free_udata(s, data);
+    s->ops->free_udata(s, data);
 }
 
 static inline void sched_insert_unit(const struct scheduler *s,
                                      struct sched_unit *unit)
 {
-    if ( s->insert_unit )
-        s->insert_unit(s, unit);
+    if ( s->ops->insert_unit )
+        s->ops->insert_unit(s, unit);
 }
 
 static inline void sched_remove_unit(const struct scheduler *s,
                                      struct sched_unit *unit)
 {
-    if ( s->remove_unit )
-        s->remove_unit(s, unit);
+    if ( s->ops->remove_unit )
+        s->ops->remove_unit(s, unit);
 }
 
 static inline void sched_sleep(const struct scheduler *s,
                                struct sched_unit *unit)
 {
-    if ( s->sleep )
-        s->sleep(s, unit);
+    if ( s->ops->sleep )
+        s->ops->sleep(s, unit);
 }
 
 static inline void sched_wake(const struct scheduler *s,
                               struct sched_unit *unit)
 {
-    if ( s->wake )
-        s->wake(s, unit);
+    if ( s->ops->wake )
+        s->ops->wake(s, unit);
 }
 
 static inline void sched_yield(const struct scheduler *s,
                                struct sched_unit *unit)
 {
-    if ( s->yield )
-        s->yield(s, unit);
+    if ( s->ops->yield )
+        s->ops->yield(s, unit);
 }
 
 static inline void sched_context_saved(const struct scheduler *s,
                                        struct sched_unit *unit)
 {
-    if ( s->context_saved )
-        s->context_saved(s, unit);
+    if ( s->ops->context_saved )
+        s->ops->context_saved(s, unit);
 }
 
 static inline void sched_migrate(const struct scheduler *s,
                                  struct sched_unit *unit, unsigned int cpu)
 {
-    if ( s->migrate )
-        s->migrate(s, unit, cpu);
+    if ( s->ops->migrate )
+        s->ops->migrate(s, unit, cpu);
     else
         sched_set_res(unit, get_sched_res(cpu));
 }
@@ -494,7 +498,7 @@ static inline void sched_migrate(const struct scheduler *s,
 static inline struct sched_resource *sched_pick_resource(
     const struct scheduler *s, const struct sched_unit *unit)
 {
-    return s->pick_resource(s, unit);
+    return s->ops->pick_resource(s, unit);
 }
 
 static inline void sched_adjust_affinity(const struct scheduler *s,
@@ -502,29 +506,29 @@ static inline void sched_adjust_affinity(const struct scheduler *s,
                                          const cpumask_t *hard,
                                          const cpumask_t *soft)
 {
-    if ( s->adjust_affinity )
-        s->adjust_affinity(s, unit, hard, soft);
+    if ( s->ops->adjust_affinity )
+        s->ops->adjust_affinity(s, unit, hard, soft);
 }
 
 static inline int sched_adjust_dom(const struct scheduler *s, struct domain *d,
                                    struct xen_domctl_scheduler_op *op)
 {
-    return s->adjust ? s->adjust(s, d, op) : 0;
+    return s->ops->adjust ? s->ops->adjust(s, d, op) : 0;
 }
 
 #ifdef CONFIG_SYSCTL
 static inline int sched_adjust_cpupool(const struct scheduler *s,
                                        struct xen_sysctl_scheduler_op *op)
 {
-    return s->adjust_global ? s->adjust_global(s, op) : 0;
+    return s->ops->adjust_global ? s->ops->adjust_global(s, op) : 0;
 }
 #endif
 
 static inline void sched_move_timers(const struct scheduler *s,
                                      struct sched_resource *sr)
 {
-    if ( s->move_timers )
-        s->move_timers(s, sr);
+    if ( s->ops->move_timers )
+        s->ops->move_timers(s, sr);
 }
 
 static inline void sched_unit_pause_nosync(const struct sched_unit *unit)
@@ -543,7 +547,7 @@ static inline void sched_unit_unpause(const struct sched_unit *unit)
         vcpu_unpause(v);
 }
 
-#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
+#define REGISTER_SCHEDULER(x) static const struct sched_ops *x##_entry \
   __used_section(".data.schedulers") = &(x)
 
 struct cpupool
diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 744f214173..0e9f04ea72 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -1617,11 +1617,10 @@ static void cf_check repl_timer_handler(void *data)
     spin_unlock_irq(&prv->lock);
 }
 
-static const struct scheduler sched_rtds_def = {
+static const struct sched_ops sched_rtds_def = {
     .name           = "SMP RTDS Scheduler",
     .opt_name       = "rtds",
     .sched_id       = XEN_SCHEDULER_RTDS,
-    .sched_data     = NULL,
 
     .dump_cpu_state = rt_dump_pcpu,
     .dump_settings  = rt_dump,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 10:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 10:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388981.1629953 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu6RI-0008Hh-6D; Wed, 12 Aug 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 1388981.1629953; Wed, 12 Aug 2026 10: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 1wu6RI-0008HZ-3R; Wed, 12 Aug 2026 10:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1388981;
 Wed, 12 Aug 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 1wu6RG-0008HS-Ts
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 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 1wu6RG-000Q9H-21
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu6RG-0054r5-11
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 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=SG2tNfDBW+Cn+gmgN9YtupQYZObTV0HuRGfe1D/aS3I=; b=4uS7pFC/wDBJIaYUaAltHvnZVL
	fPZ/T9nFy05LWMaNO9MaK44aJL1IjIBL3sYKDqCPrxgseaat8lr3DFyg2b9++gXuK7nDP5W4dRbvH
	7NdQDtMZc94HUxCoCxs/o3j9ul5jjfHwkLA4do02c6vxXECNw/XqDf+ScqmYsNvlM+RI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/console: do not use XENCONS_RING_IDX in console_init_ring()
Message-Id: <E1wu6RG-0054r5-11@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 10:44:02 +0000

commit ba911c5db27c28673a6d2b16a8709bc14d6ee43c
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:46:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:46:37 2026 +0200

    xen/console: do not use XENCONS_RING_IDX in console_init_ring()
    
    Replace XENCONS_RING_IDX with unsigned int for the console ring indices,
    as the console ring is not a Xen console (XENCONS) ring.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/console.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ea4e3ff341..37fdda93a4 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -463,7 +463,7 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
 void __init console_init_ring(void)
 {
     char *ring;
-    XENCONS_RING_IDX done, size, n;
+    unsigned int done, size, n;
     unsigned int order, memflags;
     unsigned long flags;
 
@@ -484,8 +484,8 @@ void __init console_init_ring(void)
     size = conringp - conringc;
     for ( done = 0; done < size; done += n )
     {
-        XENCONS_RING_IDX src = (conringc + done) & (conring_size - 1);
-        XENCONS_RING_IDX dst = (conringc + done) & (opt_conring_size - 1);
+        unsigned int src = (conringc + done) & (conring_size - 1);
+        unsigned int dst = (conringc + done) & (opt_conring_size - 1);
 
         n = min(opt_conring_size - dst, conring_size - src);
         n = min(size - done, n);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 10:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388982.1629956 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu6RR-0008KB-8X; Wed, 12 Aug 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 1388982.1629956; Wed, 12 Aug 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 1wu6RR-0008K3-62; Wed, 12 Aug 2026 10:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1388982;
 Wed, 12 Aug 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 1wu6RQ-0008Jq-Ko
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 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 1wu6RQ-000Q9Q-2o
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 10:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu6RQ-0056A2-1h
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 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=kFOAywcMCp1KlBBYnUJOuDbiHn1TwWWDqFTtcqvWIko=; b=VNqqZCmxTbdtRxZgXp1N8j+LbP
	F8UqTwmTE91c7npeC693mGy1bDK9iJg9vujElJZ0eNcwlBepvU9VzCPwaNa2GtsONNjEH20zo8AlF
	NcwJKu5U0ZVzwTCwQ0ipKWPeSY3pTa4ySyTN/BjtHX+3GTFO1xL9X4N5ohO5ARxwL0uM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/console: use 'unsigned int' in read_console_ring() and conring_flush()
Message-Id: <E1wu6RQ-0056A2-1h@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 10:44:12 +0000

commit 476625c50d659cd74c4f12ee77721a06e5e57a9e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:47:03 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:47:03 2026 +0200

    xen/console: use 'unsigned int' in read_console_ring() and conring_flush()
    
    read_console_ring() and conring_flush() still use 'uint32_t' to access
    indices.
    
    Switch to 'unsigned int' to as required by CODING_STYLE.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 37fdda93a4..40355c1d14 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -375,7 +375,7 @@ static void conring_puts(const char *str, size_t len)
 long read_console_ring(struct xen_sysctl_readconsole *op)
 {
     XEN_GUEST_HANDLE_PARAM(char) str;
-    uint32_t idx, len, max, sofar, c, p;
+    unsigned int idx, len, max, sofar, c, p;
 
     str   = guest_handle_cast(op->buffer, char),
     max   = op->count;
@@ -421,7 +421,7 @@ long read_console_ring(struct xen_sysctl_readconsole *op)
  */
 static int conring_flush(unsigned int flags)
 {
-    uint32_t idx, len, sofar, c;
+    unsigned int idx, len, sofar, c;
     unsigned int order;
     char *buf;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 10:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 10:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388983.1629961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu6Rb-0008MH-AB; Wed, 12 Aug 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 1388983.1629961; Wed, 12 Aug 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 1wu6Rb-0008M9-7Q; Wed, 12 Aug 2026 10:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1388983;
 Wed, 12 Aug 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 1wu6Ra-0008M3-PD
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 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 1wu6Rb-000Q9U-01
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 10:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu6Ra-0057Co-2I
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 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=+MG+JSUC0/hHoWbwfaW0aWmSdo53ZJBT06wBXW5/ggY=; b=cPVLz3FeBDIMRJQBgdvKD6Sv2j
	UgwfCfjBeJUSBbp3PSHIoOWGAvIFjcyssffCZp5ZuJxU+9NCnN9gWUbH3DfEm5bkTLtSJmMTZ69Fv
	E0MM4l8f2w87XSyi6ukUP2nCJh1DAkfU+HcjbdBCttJwBaMKTDc4kdmnB4pF04Vd5rhk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/serial: switch txbuf runtime allocation to xvmalloc
Message-Id: <E1wu6Ra-0057Co-2I@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 10:44:22 +0000

commit b8625a9fdbaa036def27855ea3f9267bcc9d0f73
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:47:21 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:47:21 2026 +0200

    xen/serial: switch txbuf runtime allocation to xvmalloc
    
    Switch 'txbuf' allocation to xvmalloc_array() since there is no
    hard requirement to have buffer physically contiguous.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/drivers/char/serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index e3c3564089..cf0abf1893 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -12,6 +12,7 @@
 #include <xen/param.h>
 #include <xen/sections.h>
 #include <xen/serial.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/processor.h>
 
@@ -524,8 +525,7 @@ void __init serial_async_transmit(struct serial_port *port)
         serial_txbufsz = PAGE_SIZE;
     while ( serial_txbufsz & (serial_txbufsz - 1) )
         serial_txbufsz &= serial_txbufsz - 1;
-    port->txbuf = alloc_xenheap_pages(
-        get_order_from_bytes(serial_txbufsz), 0);
+    port->txbuf = xvmalloc_array(char, serial_txbufsz);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 10:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 10:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388984.1629965 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu6Rm-0008Pr-BX; Wed, 12 Aug 2026 10:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388984.1629965; Wed, 12 Aug 2026 10: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 1wu6Rm-0008Pj-8r; Wed, 12 Aug 2026 10:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1388984;
 Wed, 12 Aug 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 1wu6Rk-0008Pb-SX
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 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 1wu6Rl-000Q9Y-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 10:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu6Rk-0058XQ-2c
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 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=HLNJuo57r7/taZv39IhAEaeOgbF3JT6cCUxMVj4trnk=; b=ldNAlBysgfE7yXdIcnDBMbgkf3
	L7VSNt9t2kJ/njeTXSQteVhynfML3VJoeVU8dLul3/Lau23fqxVBjJTJmH71U0BUpsfmaAgw8kdwY
	2YlZsbI8ge7L03pp95Vw1CLS0vw4NfIX8ZA7ry1CNBWOPHfxqz0vSCg7AmwlTRLCD2/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] acpi: reboot: log reset parameters
Message-Id: <E1wu6Rk-0058XQ-2c@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 10:44:32 +0000

commit d92587f0081b7e375715996aa78ebf0e35c71d71
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Wed Aug 12 10:47:40 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:47:40 2026 +0200

    acpi: reboot: log reset parameters
    
    Xen does not provide much details for system reset debugging in case
    system reset happens via ACPI subsystem.
    
    Log reset I/O address and reset value.
    
    While here, add the missing default case, add breaks between case
    statements and drop full stops in the loglines.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/acpi/reboot.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/acpi/reboot.c b/xen/drivers/acpi/reboot.c
index f6345be874..78456bca30 100644
--- a/xen/drivers/acpi/reboot.c
+++ b/xen/drivers/acpi/reboot.c
@@ -6,6 +6,7 @@ void acpi_reboot(void)
 {
 	struct acpi_generic_address *rr;
 	u8 reset_value;
+	pci_sbdf_t sbdf;
 
 	rr = &acpi_gbl_FADT.reset_register;
 
@@ -21,17 +22,27 @@ void acpi_reboot(void)
 	 * on a device on bus 0. */
 	switch (rr->space_id) {
 	case ACPI_ADR_SPACE_PCI_CONFIG:
-		printk("Resetting with ACPI PCI RESET_REG.\n");
+		sbdf = PCI_SBDF(0, 0, rr->address >> 32, rr->address >> 16);
+		printk("Resetting with ACPI PCI %pp RESET_REG at %#"PRIx64" (%#x)\n",
+		       &sbdf, rr->address & 0xff, reset_value);
 		/* Write the value that resets us. */
-		pci_conf_write8(PCI_SBDF(0, 0, rr->address >> 32,
-					 rr->address >> 16),
-				(rr->address & 255),
-				reset_value);
+		pci_conf_write8(sbdf, rr->address & 0xff, reset_value);
 		break;
+
 	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
+		printk("Resetting with ACPI MEMORY at %#"PRIx64" (%#x)\n",
+		       rr->address, reset_value);
+		acpi_hw_low_level_write(8, reset_value, rr);
+		break;
+
 	case ACPI_ADR_SPACE_SYSTEM_IO:
-		printk("Resetting with ACPI MEMORY or I/O RESET_REG.\n");
+		printk("Resetting with I/O RESET_REG at %#"PRIx64" (%#x)\n",
+		       rr->address, reset_value);
 		acpi_hw_low_level_write(8, reset_value, rr);
 		break;
+
+	default:
+		/* Fallback to alternative reboot methods */
+		break;
 	}
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 10:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 10:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388985.1629969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu6Rw-0008Rt-D3; Wed, 12 Aug 2026 10:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388985.1629969; Wed, 12 Aug 2026 10: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 1wu6Rw-0008Rl-AS; Wed, 12 Aug 2026 10:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1388985;
 Wed, 12 Aug 2026 10:44:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wu6Ru-0008Rd-VZ
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 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 1wu6Rv-000Q9g-0e
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 10:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu6Ru-005A03-2x
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 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=G9irQ/QFuhc1ITjP4oLz5wFvjrp9KwL2uZCHBxsg2Yg=; b=Cs9kSZNaKmqCHckPl156ZMSJrV
	X8lphUsm6e6OEmNo7EfM6Pama+uyyID5DdV/yUb8vemY58lnKhHX1lGgvB1SG3NYRxpoPsCq7vd7O
	+Xs4TYYPppJgtOODSPHfRR9daTq2+t1ddape3ordQKyMUnOOCfbDWFmtOa1YFvBHx/e8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/domctl: Fix unitialized copyback in XEN_DOMCTL_PSR_GET_*
Message-Id: <E1wu6Ru-005A03-2x@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 10:44:42 +0000

commit 015aa2e11ffb3c4ebc78cbdb8ab0ce383d0f2a31
Author:     Johann Höpfner <hoepf@cit.tum.de>
AuthorDate: Wed Aug 12 10:48:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:48:01 2026 +0200

    x86/domctl: Fix unitialized copyback in XEN_DOMCTL_PSR_GET_*
    
    domctl_psr_get_val() copies unitialized stack space back if psr_get_val
    fails. Fix by zero-initializing v_.
    
    Fixes: 03f30dc193c8 ("x86: refactor psr: L3 CAT: implement get value flow.")
    Signed-off-by: Johann Höpfner <hoepf@cit.tum.de>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index f26990208d..6e42fa383c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1347,7 +1347,7 @@ long arch_do_domctl(
             break;
 
 #define domctl_psr_get_val(d, domctl, type, copyback) ({    \
-    uint32_t v_;                                            \
+    uint32_t v_ = 0;                                        \
     int r_ = psr_get_val((d), (domctl)->u.psr_alloc.target, \
                          &v_, (type));                      \
                                                             \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 12 10:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Aug 2026 10:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1388986.1629972 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wu6S6-0008Tn-EQ; Wed, 12 Aug 2026 10:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1388986.1629972; Wed, 12 Aug 2026 10: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 1wu6S6-0008Tf-Bs; Wed, 12 Aug 2026 10:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1388986;
 Wed, 12 Aug 2026 10:44:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wu6S5-0008TZ-38
 for xen-changelog@lists.xenproject.org; Wed, 12 Aug 2026 10:44:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu6S5-000Q9m-12
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 10:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wu6S5-005AiH-06
 for xen-changelog@lists.xenproject.org;
 Wed, 12 Aug 2026 10:44:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AM9u9p+ksP3IB/7sDqfj+ncuSYoZOkE/MNfKP6DjPes=; b=ij6DID4T/HMOEnK2T+aKA1/Xd7
	kP9l+ZoMZ79vawNKaJ9gBoNjZAiVDKOLuuGi3o8Rj5osuhO/H7CEVg2EqBVj1SEj7h2hb6w8H1C+k
	ShNBSHi3CvV4L2y18KwS9WwGfQasEWH1QuJkxPOAkz+0KZCNJrLeGWjCw7cl43ZbMaH8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: split scheduler vtable from struct scheduler
Message-Id: <E1wu6S5-005AiH-06@xenbits.xenproject.org>
Date: Wed, 12 Aug 2026 10:44:53 +0000

commit 58db743e3beb295acf7bb3f45601e7eb7b0fa70e
Author:     Furkan Caliskan <frn1furkan10@gmail.com>
AuthorDate: Wed Aug 12 10:48:21 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 12 10:48:21 2026 +0200

    xen/sched: split scheduler vtable from struct scheduler
    
    struct scheduler currently serves two purposes: it is the static
    vtable a scheduler backend defines (name, opt_name, sched_id, and
    all its function pointers), and it is also the per-cpupool runtime
    object scheduler_alloc() allocates. Being the same type forces
    scheduler_alloc() to memcpy() the whole vtable into a fresh
    allocation per cpupool, duplicating identical function pointers
    across every cpupool using the same scheduler.
    
    Split the vtable out into its own type, struct sched_ops, so it
    can be shared by every cpupool using a given scheduler instead of
    copied per cpupool. struct scheduler is left holding only what is
    actually per-instance: a pointer to the shared sched_ops, plus
    sched_data and cpupool. scheduler_alloc() now stores a pointer to
    the matching sched_ops instance instead of copying its fields and
    uses xzalloc() to zero-initialize the struct. Every accessor in
    private.h is updated from s->field to s->ops->field to match.
    
    Every in-tree scheduler backend (credit, credit2, rtds, arinc653,
    null) is converted from struct scheduler to struct sched_ops.
    Also drop the generic comment in arinc653.c.
    
    A handful of call sites elsewhere read a scheduler's name,
    opt_name or sched_id directly and are updated to go through
    ->ops as well.
    
    Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/common/sched/arinc653.c |  9 +----
 xen/common/sched/core.c     | 51 +++++++++++++----------
 xen/common/sched/cpupool.c  |  7 ++--
 xen/common/sched/credit.c   |  3 +-
 xen/common/sched/credit2.c  |  3 +-
 xen/common/sched/null.c     |  3 +-
 xen/common/sched/private.h  | 98 +++++++++++++++++++++++----------------------
 xen/common/sched/rt.c       |  3 +-
 8 files changed, 90 insertions(+), 87 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 32c596a23c..746963806e 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -702,17 +702,10 @@ a653sched_adjust_global(const struct scheduler *ops,
 }
 #endif /* CONFIG_SYSCTL */
 
-/**
- * This structure defines our scheduler for Xen.
- * The entries tell Xen where to find our scheduler-specific
- * callback functions.
- * The symbol must be visible to the rest of Xen at link time.
- */
-static const struct scheduler sched_arinc653_def = {
+static const struct sched_ops sched_arinc653_def = {
     .name           = "ARINC 653 Scheduler",
     .opt_name       = "arinc653",
     .sched_id       = XEN_SCHEDULER_ARINC653,
-    .sched_data     = NULL,
 
     .init           = a653sched_init,
     .deinit         = a653sched_deinit,
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 8afcefd939..d3a0a97e1d 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -87,7 +87,8 @@ DEFINE_PER_CPU(cpumask_t, cpumask_scratch);
 /* How many urgent vcpus. */
 DEFINE_PER_CPU(atomic_t, sched_urgent_count);
 
-extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_array[];
+extern const struct sched_ops *__start_schedulers_array[];
+extern const struct sched_ops *__end_schedulers_array[];
 #define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
 #define schedulers __start_schedulers_array
 
@@ -127,10 +128,9 @@ static void cf_check sched_idle_schedule(
     unit->next_task = sched_idle_unit(cpu);
 }
 
-static struct scheduler sched_idle_ops = {
+static struct sched_ops sched_idle_sched_ops = {
     .name           = "Idle Scheduler",
     .opt_name       = "idle",
-    .sched_data     = NULL,
 
     .pick_resource  = sched_idle_res_pick,
     .do_schedule    = sched_idle_schedule,
@@ -139,6 +139,11 @@ static struct scheduler sched_idle_ops = {
     .free_udata     = sched_idle_free_udata,
 };
 
+static struct scheduler sched_idle_ops = {
+    .ops        = &sched_idle_sched_ops,
+    .sched_data = NULL,
+};
+
 static inline struct vcpu *unit2vcpu_cpu(const struct sched_unit *unit,
                                          unsigned int cpu)
 {
@@ -2081,7 +2086,7 @@ long do_set_timer_op(s_time_t timeout)
 /* scheduler_id - fetch ID of current scheduler */
 int scheduler_id(void)
 {
-    return operations.sched_id;
+    return operations.ops->sched_id;
 }
 #endif
 
@@ -2090,7 +2095,7 @@ long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
 {
     long ret;
 
-    if ( op->sched_id != dom_scheduler(d)->sched_id )
+    if ( op->sched_id != dom_scheduler(d)->ops->sched_id )
         return -EINVAL;
 
     switch ( op->cmd )
@@ -2132,7 +2137,7 @@ long sched_adjust_global(struct xen_sysctl_scheduler_op *op)
 
     rcu_read_lock(&sched_res_rculock);
 
-    rc = ((op->sched_id == pool->sched->sched_id)
+    rc = ((op->sched_id == pool->sched->ops->sched_id)
           ? sched_adjust_cpupool(pool->sched, op) : -EINVAL);
 
     rcu_read_unlock(&sched_res_rculock);
@@ -2299,7 +2304,7 @@ static struct sched_unit *do_schedule(struct sched_unit *prev, s_time_t now,
     struct sched_unit *next;
 
     /* get policy-specific decision on scheduling... */
-    sched->do_schedule(sched, prev, now, sched_tasklet_check(cpu));
+    sched->ops->do_schedule(sched, prev, now, sched_tasklet_check(cpu));
 
     next = prev->next_task;
 
@@ -2989,7 +2994,7 @@ void scheduler_enable(void)
 }
 
 static inline
-const struct scheduler *__init sched_get_by_name(const char *sched_name)
+const struct sched_ops *__init sched_ops_get_by_name(const char *sched_name)
 {
     unsigned int i;
 
@@ -3002,16 +3007,16 @@ const struct scheduler *__init sched_get_by_name(const char *sched_name)
 
 int __init sched_get_id_by_name(const char *sched_name)
 {
-    const struct scheduler *scheduler = sched_get_by_name(sched_name);
+    const struct sched_ops *ops = sched_ops_get_by_name(sched_name);
 
-    return scheduler ? scheduler->sched_id : -1;
+    return ops ? ops->sched_id : -1;
 }
 
 /* Initialise the data structures. */
 void __init scheduler_init(void)
 {
     struct domain *idle_domain;
-    const struct scheduler *scheduler;
+    const struct sched_ops *ops;
     int i;
 
     scheduler_enable();
@@ -3044,21 +3049,23 @@ void __init scheduler_init(void)
         }
     }
 
-    scheduler = sched_get_by_name(opt_sched);
-    if ( !scheduler )
+    ops = sched_ops_get_by_name(opt_sched);
+    if ( !ops )
     {
         printk("Could not find scheduler: %s\n", opt_sched);
-        scheduler = sched_get_by_name(CONFIG_SCHED_DEFAULT);
-        BUG_ON(!scheduler);
-        printk("Using '%s' (%s)\n", scheduler->name, scheduler->opt_name);
+        ops = sched_ops_get_by_name(CONFIG_SCHED_DEFAULT);
+        BUG_ON(!ops);
+        printk("Using '%s' (%s)\n", ops->name, ops->opt_name);
     }
-    operations = *scheduler;
+
+    operations.ops = ops;
 
     if ( cpu_schedule_up(0) )
         BUG();
     register_cpu_notifier(&cpu_schedule_nfb);
 
-    printk("Using scheduler: %s (%s)\n", operations.name, operations.opt_name);
+    printk("Using scheduler: %s (%s)\n",
+           operations.ops->name, operations.ops->opt_name);
     if ( sched_init(&operations) )
         panic("scheduler returned error on init\n");
 
@@ -3411,12 +3418,14 @@ struct scheduler *scheduler_alloc(unsigned int sched_id)
     for ( i = 0; i < NUM_SCHEDULERS; i++ )
         if ( schedulers[i] && schedulers[i]->sched_id == sched_id )
             goto found;
+
     return ERR_PTR(-ENOENT);
 
  found:
-    if ( (sched = xmalloc(struct scheduler)) == NULL )
+    if ( (sched = xzalloc(struct scheduler)) == NULL )
         return ERR_PTR(-ENOMEM);
-    memcpy(sched, schedulers[i], sizeof(*sched));
+    sched->ops = schedulers[i];
+
     if ( (ret = sched_init(sched)) != 0 )
     {
         xfree(sched);
@@ -3447,7 +3456,7 @@ void schedule_dump(struct cpupool *c)
     {
         sched = c->sched;
         cpus = c->res_valid;
-        printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name);
+        printk("Scheduler: %s (%s)\n", sched->ops->name, sched->ops->opt_name);
         sched_dump_settings(sched);
     }
     else
diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index 081e1053eb..640578201f 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -338,7 +338,8 @@ static struct cpupool *cpupool_create(unsigned int poolid,
     spin_unlock(&cpupool_lock);
 
     debugtrace_printk("Created cpupool %u with scheduler %s (%s)\n",
-                      c->cpupool_id, c->sched->name, c->sched->opt_name);
+                      c->cpupool_id, c->sched->ops->name,
+                      c->sched->ops->opt_name);
 
     return c;
 
@@ -862,7 +863,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         if ( c == NULL )
             break;
         op->cpupool_id = c->cpupool_id;
-        op->sched_id = c->sched->sched_id;
+        op->sched_id = c->sched->ops->sched_id;
         op->n_dom = c->n_dom;
         ret = cpumask_to_xenctl_bitmap(&op->cpumap, c->cpu_valid);
         cpupool_put(c);
@@ -1294,7 +1295,7 @@ struct cpupool *__init cpupool_create_pool(unsigned int pool_id, int sched_id)
     struct cpupool *pool;
 
     if ( sched_id < 0 )
-        sched_id = scheduler_get_default()->sched_id;
+        sched_id = scheduler_get_default()->ops->sched_id;
 
     pool = cpupool_create(pool_id, sched_id);
 
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 4dde2ede12..8df746bf6b 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -2277,11 +2277,10 @@ csched_deinit(struct scheduler *ops)
     }
 }
 
-static const struct scheduler sched_credit_def = {
+static const struct sched_ops sched_credit_def = {
     .name           = "SMP Credit Scheduler",
     .opt_name       = "credit",
     .sched_id       = XEN_SCHEDULER_CREDIT,
-    .sched_data     = NULL,
 
     .global_init    = csched_global_init,
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..4949606881 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -4230,11 +4230,10 @@ csched2_deinit(struct scheduler *ops)
     xfree(prv);
 }
 
-static const struct scheduler sched_credit2_def = {
+static const struct sched_ops sched_credit2_def = {
     .name           = "SMP Credit Scheduler rev2",
     .opt_name       = "credit2",
     .sched_id       = XEN_SCHEDULER_CREDIT2,
-    .sched_data     = NULL,
 
     .global_init    = csched2_global_init,
 
diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index 952bb47444..b3c6651fb1 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -1037,11 +1037,10 @@ static void cf_check null_dump(const struct scheduler *ops)
     spin_unlock_irqrestore(&prv->lock, flags);
 }
 
-static const struct scheduler sched_null_def = {
+static const struct sched_ops sched_null_def = {
     .name           = "null Scheduler",
     .opt_name       = "null",
     .sched_id       = XEN_SCHEDULER_NULL,
-    .sched_data     = NULL,
 
     .init           = null_init,
     .deinit         = null_deinit,
diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index d6884550cd..18ccab183e 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -294,12 +294,10 @@ static inline spinlock_t *pcpu_schedule_trylock(unsigned int cpu)
     return NULL;
 }
 
-struct scheduler {
-    const char *name;       /* full name for this scheduler      */
-    const char *opt_name;   /* option name for this scheduler    */
-    unsigned int sched_id;  /* ID for this scheduler             */
-    void *sched_data;       /* global data pointer               */
-    struct cpupool *cpupool;/* points to this scheduler's pool   */
+struct sched_ops {
+    const char *name;       /* full name for this sched_ops      */
+    const char *opt_name;   /* option name for this sched_ops    */
+    unsigned int sched_id;  /* ID for this sched_ops             */
 
     int          (*global_init)    (void);
 
@@ -366,127 +364,133 @@ struct scheduler {
                                     struct sched_resource *sr);
 };
 
+struct scheduler {
+    const struct sched_ops *ops; /* shared, read-only dispatch table   */
+    void *sched_data;            /* per-cpupool scheduler-private data */
+    struct cpupool *cpupool;     /* points to this scheduler's pool    */
+};
+
 static inline int sched_init(struct scheduler *s)
 {
-    return s->init(s);
+    return s->ops->init(s);
 }
 
 static inline void sched_deinit(struct scheduler *s)
 {
-    s->deinit(s);
+    s->ops->deinit(s);
 }
 
 static inline spinlock_t *sched_switch_sched(struct scheduler *s,
                                              unsigned int cpu,
                                              void *pdata, void *vdata)
 {
-    return s->switch_sched(s, cpu, pdata, vdata);
+    return s->ops->switch_sched(s, cpu, pdata, vdata);
 }
 
 static inline void sched_dump_settings(const struct scheduler *s)
 {
-    if ( s->dump_settings )
-        s->dump_settings(s);
+    if ( s->ops->dump_settings )
+        s->ops->dump_settings(s);
 }
 
 static inline void sched_dump_cpu_state(const struct scheduler *s, int cpu)
 {
-    if ( s->dump_cpu_state )
-        s->dump_cpu_state(s, cpu);
+    if ( s->ops->dump_cpu_state )
+        s->ops->dump_cpu_state(s, cpu);
 }
 
 static inline void *sched_alloc_domdata(const struct scheduler *s,
                                         struct domain *d)
 {
-    return s->alloc_domdata ? s->alloc_domdata(s, d) : NULL;
+    return s->ops->alloc_domdata ? s->ops->alloc_domdata(s, d) : NULL;
 }
 
 static inline void sched_free_domdata(const struct scheduler *s,
                                       void *data)
 {
-    ASSERT(s->free_domdata || !data);
-    if ( s->free_domdata )
-        s->free_domdata(s, data);
+    ASSERT(s->ops->free_domdata || !data);
+    if ( s->ops->free_domdata )
+        s->ops->free_domdata(s, data);
 }
 
 static inline void *sched_alloc_pdata(const struct scheduler *s, int cpu)
 {
-    return s->alloc_pdata ? s->alloc_pdata(s, cpu) : NULL;
+    return s->ops->alloc_pdata ? s->ops->alloc_pdata(s, cpu) : NULL;
 }
 
 static inline void sched_free_pdata(const struct scheduler *s, void *data,
                                     int cpu)
 {
-    ASSERT(s->free_pdata || !data);
-    if ( s->free_pdata )
-        s->free_pdata(s, data, cpu);
+    ASSERT(s->ops->free_pdata || !data);
+    if ( s->ops->free_pdata )
+        s->ops->free_pdata(s, data, cpu);
 }
 
 static inline void sched_deinit_pdata(const struct scheduler *s, void *data,
                                       int cpu)
 {
-    if ( s->deinit_pdata )
-        s->deinit_pdata(s, data, cpu);
+    if ( s->ops->deinit_pdata )
+        s->ops->deinit_pdata(s, data, cpu);
 }
 
 static inline void *sched_alloc_udata(const struct scheduler *s,
                                       struct sched_unit *unit, void *dom_data)
 {
-    return s->alloc_udata(s, unit, dom_data);
+    return s->ops->alloc_udata(s, unit, dom_data);
 }
 
 static inline void sched_free_udata(const struct scheduler *s, void *data)
 {
-    s->free_udata(s, data);
+    s->ops->free_udata(s, data);
 }
 
 static inline void sched_insert_unit(const struct scheduler *s,
                                      struct sched_unit *unit)
 {
-    if ( s->insert_unit )
-        s->insert_unit(s, unit);
+    if ( s->ops->insert_unit )
+        s->ops->insert_unit(s, unit);
 }
 
 static inline void sched_remove_unit(const struct scheduler *s,
                                      struct sched_unit *unit)
 {
-    if ( s->remove_unit )
-        s->remove_unit(s, unit);
+    if ( s->ops->remove_unit )
+        s->ops->remove_unit(s, unit);
 }
 
 static inline void sched_sleep(const struct scheduler *s,
                                struct sched_unit *unit)
 {
-    if ( s->sleep )
-        s->sleep(s, unit);
+    if ( s->ops->sleep )
+        s->ops->sleep(s, unit);
 }
 
 static inline void sched_wake(const struct scheduler *s,
                               struct sched_unit *unit)
 {
-    if ( s->wake )
-        s->wake(s, unit);
+    if ( s->ops->wake )
+        s->ops->wake(s, unit);
 }
 
 static inline void sched_yield(const struct scheduler *s,
                                struct sched_unit *unit)
 {
-    if ( s->yield )
-        s->yield(s, unit);
+    if ( s->ops->yield )
+        s->ops->yield(s, unit);
 }
 
 static inline void sched_context_saved(const struct scheduler *s,
                                        struct sched_unit *unit)
 {
-    if ( s->context_saved )
-        s->context_saved(s, unit);
+    if ( s->ops->context_saved )
+        s->ops->context_saved(s, unit);
 }
 
 static inline void sched_migrate(const struct scheduler *s,
                                  struct sched_unit *unit, unsigned int cpu)
 {
-    if ( s->migrate )
-        s->migrate(s, unit, cpu);
+    if ( s->ops->migrate )
+        s->ops->migrate(s, unit, cpu);
     else
         sched_set_res(unit, get_sched_res(cpu));
 }
@@ -494,7 +498,7 @@ static inline void sched_migrate(const struct scheduler *s,
 static inline struct sched_resource *sched_pick_resource(
     const struct scheduler *s, const struct sched_unit *unit)
 {
-    return s->pick_resource(s, unit);
+    return s->ops->pick_resource(s, unit);
 }
 
 static inline void sched_adjust_affinity(const struct scheduler *s,
@@ -502,29 +506,29 @@ static inline void sched_adjust_affinity(const struct scheduler *s,
                                          const cpumask_t *hard,
                                          const cpumask_t *soft)
 {
-    if ( s->adjust_affinity )
-        s->adjust_affinity(s, unit, hard, soft);
+    if ( s->ops->adjust_affinity )
+        s->ops->adjust_affinity(s, unit, hard, soft);
 }
 
 static inline int sched_adjust_dom(const struct scheduler *s, struct domain *d,
                                    struct xen_domctl_scheduler_op *op)
 {
-    return s->adjust ? s->adjust(s, d, op) : 0;
+    return s->ops->adjust ? s->ops->adjust(s, d, op) : 0;
 }
 
 #ifdef CONFIG_SYSCTL
 static inline int sched_adjust_cpupool(const struct scheduler *s,
                                        struct xen_sysctl_scheduler_op *op)
 {
-    return s->adjust_global ? s->adjust_global(s, op) : 0;
+    return s->ops->adjust_global ? s->ops->adjust_global(s, op) : 0;
 }
 #endif
 
 static inline void sched_move_timers(const struct scheduler *s,
                                      struct sched_resource *sr)
 {
-    if ( s->move_timers )
-        s->move_timers(s, sr);
+    if ( s->ops->move_timers )
+        s->ops->move_timers(s, sr);
 }
 
 static inline void sched_unit_pause_nosync(const struct sched_unit *unit)
@@ -543,7 +547,7 @@ static inline void sched_unit_unpause(const struct sched_unit *unit)
         vcpu_unpause(v);
 }
 
-#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
+#define REGISTER_SCHEDULER(x) static const struct sched_ops *x##_entry \
   __used_section(".data.schedulers") = &(x)
 
 struct cpupool
diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 744f214173..0e9f04ea72 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -1617,11 +1617,10 @@ static void cf_check repl_timer_handler(void *data)
     spin_unlock_irq(&prv->lock);
 }
 
-static const struct scheduler sched_rtds_def = {
+static const struct sched_ops sched_rtds_def = {
     .name           = "SMP RTDS Scheduler",
     .opt_name       = "rtds",
     .sched_id       = XEN_SCHEDULER_RTDS,
-    .sched_data     = NULL,
 
     .dump_cpu_state = rt_dump_pcpu,
     .dump_settings  = rt_dump,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390087.1630623 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuW98-0005rZ-Sm; Thu, 13 Aug 2026 14:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390087.1630623; Thu, 13 Aug 2026 14: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 1wuW98-0005rS-Pz; Thu, 13 Aug 2026 14:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1390087;
 Thu, 13 Aug 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 1wuW97-0005rM-VQ
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 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 1wuW98-002A95-0I
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuW97-00GmCA-2U
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 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=BSsf1Xu68yMUi/MR5gJGmLuULellm3y7jsf4/NXEBpY=; b=VY6BHYNVa7v0XUx1lmZhUqN29k
	MwhArF6+9kVfg2XvqtaSi0Mv1lpB8u4O6dzjLBM4dsp+rVobFuLVhvvrWKH64QrAeoiudHx6If/X9
	4Rcg2JhTAcEKN2IT1Z4G1xqgsWBPtecBheK8O+zw6x3tDezvlV7K0OlPv/JwTbB35DK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] stubdom: remove support for grub-pv
Message-Id: <E1wuW97-00GmCA-2U@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:11:01 +0000

commit 0724c68d85b3e7db5345bcbe151577a498968aa1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:28 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:20 2026 +0200

    stubdom: remove support for grub-pv
    
    The Mini-OS based grub-pv is not being built by default since Xen 4.16.
    Additionally it can be replaced in most cases by the more modern pvgrub
    (part of grub upstream), while grub-pv is based on legacy grub 0.97.
    
    In case someone is really depending on grub-pv, an old build from a
    previous Xen version can be used without any problem, as only stable
    hypercall interfaces are used by it.
    
    Remove grub-pv from the build system.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 Makefile                                       |    6 -
 config/Stubdom.mk.in                           |    3 -
 stubdom/.gitignore                             |    1 -
 stubdom/Makefile                               |   54 -
 stubdom/configure                              |   65 -
 stubdom/configure.ac                           |    2 -
 stubdom/grub.patches/00cvs                     | 1022 -------
 stubdom/grub.patches/10graphics.diff           | 2297 ----------------
 stubdom/grub.patches/11graphics-keyboard.diff  |   13 -
 stubdom/grub.patches/20print_func.diff         |   52 -
 stubdom/grub.patches/30savedefault.diff        |  186 --
 stubdom/grub.patches/40ext3_256byte_inode.diff |  114 -
 stubdom/grub.patches/50fs_fulldisk.diff        |   72 -
 stubdom/grub.patches/60ext4.diff               |  474 ----
 stubdom/grub.patches/61btrfs.diff              | 3499 ------------------------
 stubdom/grub.patches/70compiler_warnings.diff  |   45 -
 stubdom/grub.patches/99minios                  | 1570 -----------
 stubdom/grub/Makefile                          |   88 -
 stubdom/grub/boot-x86_32.S                     |  112 -
 stubdom/grub/boot-x86_64.S                     |  108 -
 stubdom/grub/config.h                          |   12 -
 stubdom/grub/kexec.c                           |  434 ---
 stubdom/grub/mini-os.c                         |  771 ------
 stubdom/grub/mini-os.h                         |    7 -
 stubdom/grub/minios.cfg                        |    4 -
 stubdom/grub/osdep.h                           |   30 -
 26 files changed, 11041 deletions(-)

diff --git a/Makefile b/Makefile
index 67b71ac3d4..ea432e21b0 100644
--- a/Makefile
+++ b/Makefile
@@ -71,9 +71,6 @@ build-tools-oxenstored: build-tools-public-headers
 .PHONY: build-stubdom
 build-stubdom: mini-os-dir build-tools-public-headers
 	$(MAKE) -C stubdom build
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub-if-enabled
-endif
 
 define do-subtree
 $(1)/%: FORCE
@@ -149,9 +146,6 @@ install-tools: install-tools-public-headers
 .PHONY: install-stubdom
 install-stubdom: mini-os-dir install-tools-public-headers
 	$(MAKE) -C stubdom install
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub-if-enabled
-endif
 
 .PHONY: tools/firmware/seabios-dir-force-update
 tools/firmware/seabios-dir-force-update:
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index b399d77740..0d70d03941 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -23,9 +23,6 @@ NEWLIB_URL          := @NEWLIB_URL@
 LWIP_VERSION        := @LWIP_VERSION@
 LWIP_URL            := @LWIP_URL@
 
-GRUB_VERSION        := @GRUB_VERSION@
-GRUB_URL            := @GRUB_URL@
-
 GMP_VERSION         := @GMP_VERSION@
 GMP_URL             := @GMP_URL@
 
diff --git a/stubdom/.gitignore b/stubdom/.gitignore
index 1b69656d45..08f2e9b432 100644
--- a/stubdom/.gitignore
+++ b/stubdom/.gitignore
@@ -9,7 +9,6 @@
 /cross-root-*
 /gcc-*
 /gmp-*
-/grub-*
 /include
 /libs-*
 /libxencall-*
diff --git a/stubdom/Makefile b/stubdom/Makefile
index acd5e56f16..850e8544ca 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -361,32 +361,6 @@ vtpmmgr-minios-config.mk: $(CURDIR)/vtpmmgr/minios.cfg
 vtpmmgr: cross-polarssl vtpmmgr-minios-config.mk
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat vtpmmgr-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
-######
-# Grub
-######
-
-grub-$(GRUB_VERSION).tar.gz:
-	$(FETCHER) $@ $(GRUB_URL)/$@
-
-grub-upstream: grub-$(GRUB_VERSION).tar.gz
-	tar xzf $<
-	mv grub-$(GRUB_VERSION) $@
-	for i in grub.patches/* ; do \
-		patch -d $@ -p1 < $$i || exit 1; \
-	done
-
-grub/minios.gen.cfg: APP_LIBS = guest ctrl toollog
-grub/minios.gen.cfg: grub/minios.cfg Makefile
-	$(GEN_config) >$@
-
-grub-$(XEN_TARGET_ARCH)-minios-config.mk: grub/minios.gen.cfg
-	MINIOS_CONFIG="$(CURDIR)/$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
-
-.PHONY: grub
-grub: cross-polarssl grub-upstream $(CROSS_ROOT) grub-$(XEN_TARGET_ARCH)-minios-config.mk
-	mkdir -p grub-$(XEN_TARGET_ARCH)
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat grub-$(XEN_TARGET_ARCH)-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
-
 ##########
 # xenstore
 ##########
@@ -429,17 +403,6 @@ vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
 vtpmmgr-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm -lpolarssl"
 
-.PHONY: pv-grub
-pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxenguest grub
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.gen.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
-
-.PHONY: pv-grub-if-enabled
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-pv-grub-if-enabled: pv-grub
-else
-pv-grub-if-enabled:
-endif
-
 XENSTORE_DEPS := libxenevtchn libxengnttab libxenmanage
 
 .PHONY: xenstore-stubdom
@@ -460,16 +423,6 @@ else
 install:
 endif
 
-install-grub: pv-grub
-	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
-	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
-
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-install-grub-if-enabled: install-grub
-else
-install-grub-if-enabled:
-endif
-
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
@@ -500,9 +453,6 @@ else
 uninstall:
 endif
 
-uninstall-grub:
-	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz
-
 uninstall-xenstore:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz
 
@@ -523,14 +473,12 @@ uninstall-vtpmmgr:
 .PHONY: clean
 clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib))
 clean:
-	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) -C vtpm clean
 	$(MAKE) -C vtpmmgr clean
-	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f *-minios-config.mk
 	rm -f *.gen.cfg
 	rm -fr pkg-config
@@ -559,7 +507,6 @@ patchclean: crossclean
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
-	rm -fr grub-upstream
 
 # clean downloads
 .PHONY: downloadclean
@@ -569,7 +516,6 @@ downloadclean: patchclean
 	rm -f gmp-$(GMP_VERSION).tar.bz2
 	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
-	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
 
diff --git a/stubdom/configure b/stubdom/configure
index 8a0a798bd2..689ff4d6ed 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -630,8 +630,6 @@ POLARSSL_VERSION
 POLARSSL_URL
 GMP_VERSION
 GMP_URL
-GRUB_VERSION
-GRUB_URL
 LWIP_VERSION
 LWIP_URL
 NEWLIB_VERSION
@@ -660,7 +658,6 @@ extfiles
 debug
 xenstorepvh
 xenstore
-grub
 host_os
 host_vendor
 host_cpu
@@ -711,7 +708,6 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_pv_grub
 enable_xenstore_stubdom
 enable_xenstorepvh_stubdom
 enable_vtpm_stubdom
@@ -732,7 +728,6 @@ ZLIB_URL
 LIBPCI_URL
 NEWLIB_URL
 LWIP_URL
-GRUB_URL
 GMP_URL
 POLARSSL_URL
 TPMEMU_URL'
@@ -1358,7 +1353,6 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-pv-grub        Build and install pv-grub (default is DISABLED)
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
                           ENABLED)
@@ -1385,7 +1379,6 @@ Some influential environment variables:
   LIBPCI_URL  Download url for libpci
   NEWLIB_URL  Download url for newlib
   LWIP_URL    Download url for lwip
-  GRUB_URL    Download url for grub
   GMP_URL     Download url for libgmp
   POLARSSL_URL
               Download url for polarssl
@@ -2403,47 +2396,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 # Enable/disable stub domains
 
-# Check whether --enable-pv-grub was given.
-if test ${enable_pv_grub+y}
-then :
-  enableval=$enable_pv_grub;
-
-if test "x$enableval" = "xyes"
-then :
-
-
-grub=y
-STUBDOM_TARGETS="$STUBDOM_TARGETS grub"
-STUBDOM_BUILD="$STUBDOM_BUILD pv-grub"
-STUBDOM_INSTALL="$STUBDOM_INSTALL install-grub"
-STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-grub"
-
-
-else $as_nop
-
-if test "x$enableval" = "xno"
-then :
-
-
-grub=n
-
-
-fi
-
-fi
-
-
-else $as_nop
-
-
-grub=n
-
-
-fi
-
-
-
-
 # Check whether --enable-xenstore-stubdom was given.
 if test ${enable_xenstore_stubdom+y}
 then :
@@ -4137,23 +4089,6 @@ LWIP_VERSION="1.3.0"
 
 
 
-if test "x$GRUB_URL" = "x"
-then :
-
-	if test "x$extfiles" = "xy"
-then :
-  GRUB_URL=\$\(XEN_EXTFILES_URL\)
-else $as_nop
-  GRUB_URL="https://alpha.gnu.org/gnu/grub"
-fi
-
-fi
-GRUB_VERSION="0.97"
-
-
-
-
-
 if test "x$GMP_URL" = "x"
 then :
 
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 33f170144e..6ff3ab0ee9 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -18,7 +18,6 @@ m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
-AX_STUBDOM_DEFAULT_DISABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
 AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
 AX_STUBDOM_CONDITIONAL([vtpm-stubdom], [vtpm])
@@ -43,7 +42,6 @@ AX_STUBDOM_LIB([ZLIB], [zlib], [1.2.3])
 AX_STUBDOM_LIB([LIBPCI], [libpci], [2.2.9], [https://mirrors.edge.kernel.org/pub/software/utils/pciutils])
 AX_STUBDOM_LIB([NEWLIB], [newlib], [1.16.0], [https://sourceware.org/ftp/newlib])
 AX_STUBDOM_LIB([LWIP], [lwip], [1.3.0], [https://download.savannah.gnu.org/releases/lwip])
-AX_STUBDOM_LIB([GRUB], [grub], [0.97], [https://alpha.gnu.org/gnu/grub])
 AX_STUBDOM_LIB([GMP], [libgmp], [4.3.2], [https://gmplib.org/download/gmp/archive])
 AX_STUBDOM_LIB([POLARSSL], [polarssl], [1.1.4])
 AX_STUBDOM_LIB([TPMEMU], [berlios tpm emulator], [0.7.4])
diff --git a/stubdom/grub.patches/00cvs b/stubdom/grub.patches/00cvs
deleted file mode 100644
index 47d66f3a3b..0000000000
--- a/stubdom/grub.patches/00cvs
+++ /dev/null
@@ -1,1022 +0,0 @@
-diff -uprN grub-0.97/acinclude.m4 grub/acinclude.m4
---- grub-0.97/acinclude.m4	2004-04-27 21:48:06.000000000 +0100
-+++ grub/acinclude.m4	2007-11-05 01:29:46.000000000 +0000
-@@ -57,7 +57,7 @@ else
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-+  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-   else
-     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
-   fi
-diff -uprN grub-0.97/ChangeLog grub/ChangeLog
---- grub-0.97/ChangeLog	2005-05-08 03:47:02.000000000 +0100
-+++ grub/ChangeLog	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,127 @@
-+2008-05-20  Robert Millan  <rmh@aybabtu.com>
-+
-+	* netboot/cs89x0.c: Fix license violation.
-+	* netboot/cs89x0.h: Likewise.
-+
-+2008-04-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Always use "_cv_" in cache variables for
-+	compatibility with Autoconf 2.62.
-+
-+2008-03-28  Robert Millan  <rmh@aybabtu.com>
-+
-+	Surpass 1 TiB disk addressing limit.  Note: there are no plans to handle
-+	the 2 TiB disk limit in GRUB Legacy, since that would need considerable
-+	rework.  If you have >2TiB disks, use GRUB 2 instead.
-+
-+	* grub/asmstub.c (biosdisk): Add unsigned qualifier to `sector'.
-+	* stage2/bios.c (biosdisk): Likewise.
-+	* stage2/disk_io.c (rawread, devread, rawwrite, devwrite): Likewise.
-+	* stage2/shared.h (rawread, devread, rawwrite, devwrite): Likewise.
-+	* lib/device.c (get_drive_geometry): Replace BLKGETSIZE with
-+	BLKGETSIZE64.
-+
-+2007-10-29  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Test if '--build-id=none' is supported by the
-+	linker and add it to LDFLAGS if possible.  Build ID causes
-+	objcopy to generate huge binary files.
-+	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
-+	linking, so that build ID doesn't break the test.
-+	* stage1/Makefile.am: Preserve LDFLAGS, use stage1_exec_LDFLAGS.
-+
-+2007-02-22  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/iso9660.h: Remove unnecessary packed attributes.
-+
-+2007-02-22  Robert Millan  <rmh@aybabtu.com>
-+
-+	* util/mkbimage: Update my email address, and remove my name from
-+	some places where unnecessary credit is given.
-+
-+2006-09-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/natsemi.c: Fix compile error with gcc 4.1.1.  Cast
-+	cannot make a variable volatile - it should be declared as such.
-+	* netboot/sis900.c: Likewise.
-+
-+2006-09-08  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/etherboot.h: Remove incorrect extern declarations of
-+	the variables later declared static.  Move BOOTP_DATA_ADDR ...
-+	* netboot/main.c: ... here.  Eliminate end_of_rfc1533 - it's
-+	write-only.
-+
-+2006-06-24  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/grub.texi: Changed the license term to the GNU Free
-+	Documentation License 1.2.
-+
-+	* docs/multiboot.texi: Reformatted to show the license term
-+	and the version number explicitly.
-+	
-+	* docs/fdl.texi: New file.
-+	
-+	* docs/Makefile.am (grub_TEXINFOS): Added fdl.texi.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (write_to_partition): /dev/ataraid/ and /dev/rd/
-+	partitions have a "p" prefix.  Add it.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (get_i2o_disk_name): New function.
-+	(init_device_map) [__linux__]: Add support for I2O devices.
-+
-+2006-05-02  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/stage2.c (run_menu): Fix "savedefault" to save only top
-+	level menu positions.  Remember current position when calling a
-+	submenu.  Don't recalculate it when booting from a submenu.
-+
-+	* grub/main.c (main): Make sure the boot drive number doesn't
-+	exceed 255.
-+
-+2006-05-02  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+	* stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2
-+	to GRUB Legacy.  Problem reported by Gerardo Richarte.
-+
-+2006-04-23  Robert Millan  <robertmh@gnu.org>
-+
-+	* grub/asmstub.c (get_diskinfo): Optimize sysctl routine.
-+
-+2006-04-20  Robert Millan  <robertmh@gnu.org>
-+
-+	Fixes for kernel of FreeBSD:
-+	* grub/asmstub.c (get_diskinfo): Toggle "kern.geom.debugflags" sysctl
-+	before opening a device for writing.
-+	* util/grub-install.in: Devices don't have this "r" prefix anymore.
-+
-+2006-04-16  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Correct the offset of address
-+	fields. Reported by Jeroen Dekkers.
-+
-+2006-03-21  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/builtins.c (setup_func): Specify the size of DEVICE to
-+	grub_strncat instead of a strange number 256. Reported by Vitaly
-+	Fertman <vitaly@namesys.com>.
-+
-+2005-09-29  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Fix a bug in the byte order of
-+	boot_device. I hope this won't affect any OS image.
-+	Increased the version number to 0.6.94.
-+
-+2005-09-28  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/boot.c (load_image): Even if an OS image is an ELF
-+	object, use the a.out kludge if MULTIBOOT_AOUT_KLUDGE is
-+	specified.
-+
- 2005-05-08  Yoshinori K. Okuji  <okuji@enbug.org>
- 
- 	* configure.ac (AC_INIT): Upgraded to 0.97.
-diff -uprN grub-0.97/configure grub/configure
---- grub-0.97/configure	2005-05-08 03:48:12.000000000 +0100
-+++ grub/configure	2007-11-05 01:29:46.000000000 +0000
-@@ -3694,6 +3694,64 @@ if test "x$undef_flag" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+echo "$as_me:$LINENO: checking whether linker accepts \`--build-id=none'" >&5
-+echo $ECHO_N "checking whether linker accepts \`--build-id=none'... $ECHO_C" >&6
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"
-+			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  build_id_flag=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+build_id_flag=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $build_id_flag" >&5
-+echo "${ECHO_T}$build_id_flag" >&6
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
-   # Extract the first word of "objcopy", so it can be a program name with args.
- set dummy objcopy; ac_word=$2
-@@ -3892,7 +3950,7 @@ echo "$as_me: error: ${CC-cc} cannot com
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-+  if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-diff -uprN grub-0.97/configure.ac grub/configure.ac
---- grub-0.97/configure.ac	2005-05-08 03:36:03.000000000 +0100
-+++ grub/configure.ac	2008-04-10 23:26:50.000000000 +0100
-@@ -86,13 +86,13 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     fi
-     STAGE1_CFLAGS="-O2"
-     GRUB_CFLAGS="-O2"
--    AC_CACHE_CHECK([whether optimization for size works], size_flag, [
-+    AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-Os -g"
--      AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
-+      AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$size_flag" = xyes; then
-+    if test "x$grub_cv_cc_Os" = xyes; then
-       STAGE2_CFLAGS="-Os"
-     else
-       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
-@@ -100,16 +100,16 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     # OpenBSD has a GCC extension for protecting applications from
-     # stack smashing attacks, but GRUB doesn't want this feature.
-     AC_CACHE_CHECK([whether gcc has -fno-stack-protector],
--		   no_stack_protector_flag, [
-+		   grub_cv_cc_no_stack_protector, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-fno-stack-protector"
-       AC_TRY_COMPILE(,
- 		     ,
--		     no_stack_protector_flag=yes,
--		     no_stack_protector_flag=no)
-+		     grub_cv_cc_no_stack_protector=yes,
-+		     grub_cv_cc_no_stack_protector=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$no_stack_protector_flag" = xyes; then
-+    if test "x$grub_cv_cc_no_stack_protector" = xyes; then
-       STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
-     fi
-   fi
-@@ -123,33 +123,44 @@ AC_SUBST(GRUB_CFLAGS)
- CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
- CPPFLAGS="$CPPFLAGS -Wpointer-arith"
- 
--AC_CACHE_CHECK([whether -Wundef works], undef_flag, [
-+AC_CACHE_CHECK([whether -Wundef works], grub_cv_cc_Wundef, [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-Wundef"
--  AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no)
-+  AC_TRY_COMPILE(, , grub_cv_cc_Wundef=yes, grub_cv_cc_Wundef=no)
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # The options `-falign-*' are supported by gcc 3.0 or later.
- # Probably it is sufficient to only check for -falign-loops.
--AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
-+AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-falign-loops=1"
--  AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
-+  AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no])
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # Force no alignment to save space.
--if test "x$falign_loop_flag" = xyes; then
-+if test "x$grub_cv_cc_falign_loop" = xyes; then
-   CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
- else
-   CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
- fi
- 
--if test "x$undef_flag" = xyes; then
-+if test "x$grub_cv_cc_Wundef" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
-+AC_MSG_RESULT([$build_id_flag])
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
- dnl  AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-   AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-diff -uprN grub-0.97/grub/asmstub.c grub/grub/asmstub.c
---- grub-0.97/grub/asmstub.c	2005-02-16 20:45:14.000000000 +0000
-+++ grub/grub/asmstub.c	2008-03-28 13:22:28.000000000 +0000
-@@ -55,6 +55,10 @@ int grub_stage2 (void);
- # endif /* ! BLKFLSBUF */
- #endif /* __linux__ */
- 
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+# include <sys/sysctl.h>
-+#endif
-+
- /* We want to prevent any circularararity in our stubs, as well as
-    libc name clashes. */
- #define WITHOUT_LIBC_STUBS 1
-@@ -777,7 +781,39 @@ get_diskinfo (int drive, struct geometry
- 
-       /* Open read/write, or read-only if that failed. */
-       if (! read_only)
--	disks[drive].flags = open (devname, O_RDWR);
-+	{
-+/* By default, kernel of FreeBSD does not allow overwriting MBR */
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#define GEOM_SYSCTL	"kern.geom.debugflags"
-+	  int old_flags, flags;
-+	  size_t sizeof_int = sizeof (int);
-+
-+	  if (sysctlbyname (GEOM_SYSCTL, &old_flags, &sizeof_int, NULL, 0) != 0)
-+	    grub_printf ("failed to get " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+
-+	  if ((old_flags & 0x10) == 0)
-+	    {
-+	      /* "allow foot shooting", see geom(4) */
-+	      flags = old_flags | 0x10;
-+
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0)
-+		{
-+		  flags = old_flags;
-+		  grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+		}
-+	    }
-+	  else
-+	    flags = old_flags;
-+#endif
-+	  disks[drive].flags = open (devname, O_RDWR);
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+	  if (flags != old_flags)
-+	    {
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0)
-+	        grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+	    }
-+#endif
-+	}
- 
-       if (disks[drive].flags == -1)
- 	{
-@@ -926,7 +962,7 @@ hex_dump (void *buf, size_t size)
- 
- int
- biosdisk (int subfunc, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   char *buf;
-   int fd = geometry->flags;
-diff -uprN grub-0.97/grub/main.c grub/grub/main.c
---- grub-0.97/grub/main.c	2003-07-09 12:45:36.000000000 +0100
-+++ grub/grub/main.c	2006-05-05 22:43:46.000000000 +0100
-@@ -32,6 +32,7 @@ int grub_stage2 (void);
- #define WITHOUT_LIBC_STUBS 1
- #include <shared.h>
- #include <term.h>
-+#include <device.h>
- 
- char *program_name = 0;
- int use_config_file = 1;
-@@ -192,6 +193,12 @@ main (int argc, char **argv)
- 	      perror ("strtoul");
- 	      exit (1);
- 	    }
-+	  if (boot_drive >= NUM_DISKS)
-+	    {
-+	      fprintf (stderr, "boot_drive should be from 0 to %d\n",
-+		       NUM_DISKS - 1);
-+	      exit (1);
-+	    }
- 	  break;
- 
- 	case OPT_NO_CONFIG_FILE:
-diff -uprN grub-0.97/lib/device.c grub/lib/device.c
---- grub-0.97/lib/device.c	2005-03-28 00:14:25.000000000 +0100
-+++ grub/lib/device.c	2008-03-28 13:22:28.000000000 +0000
-@@ -69,9 +69,9 @@ struct hd_geometry
- # ifndef CDROM_GET_CAPABILITY
- #  define CDROM_GET_CAPABILITY	0x5331	/* get capabilities */
- # endif /* ! CDROM_GET_CAPABILITY */
--# ifndef BLKGETSIZE
--#  define BLKGETSIZE	_IO(0x12,96)	/* return device size */
--# endif /* ! BLKGETSIZE */
-+# ifndef BLKGETSIZE64
-+#  define BLKGETSIZE64	_IOR(0x12,114,size_t)	/* return device size */
-+# endif /* ! BLKGETSIZE64 */
- #endif /* __linux__ */
- 
- /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with
-@@ -152,19 +152,19 @@ get_drive_geometry (struct geometry *geo
-   /* Linux */
-   {
-     struct hd_geometry hdg;
--    unsigned long nr;
-+    unsigned long long nr;
-     
-     if (ioctl (fd, HDIO_GETGEO, &hdg))
-       goto fail;
- 
--    if (ioctl (fd, BLKGETSIZE, &nr))
-+    if (ioctl (fd, BLKGETSIZE64, &nr))
-       goto fail;
-     
-     /* Got the geometry, so save it. */
-     geom->cylinders = hdg.cylinders;
-     geom->heads = hdg.heads;
-     geom->sectors = hdg.sectors;
--    geom->total_sectors = nr;
-+    geom->total_sectors = nr / 512;
-     
-     goto success;
-   }
-@@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int u
- {
-   sprintf (name, "/dev/ataraid/d%c", unit + '0');
- }
-+
-+static void
-+get_i2o_disk_name (char *name, char unit)
-+{
-+  sprintf (name, "/dev/i2o/hd%c", unit);
-+}
- #endif
- 
- /* Check if DEVICE can be read. If an error occurs, return zero,
-@@ -801,6 +807,29 @@ init_device_map (char ***map, const char
- 	  }
-       }
-   }
-+    
-+  /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
-+  {
-+    int unit;
-+
-+    for (unit = 'a'; unit < 'f'; unit++)
-+      {
-+        char name[24];
-+    
-+        get_i2o_disk_name (name, unit);
-+        if (check_device (name))
-+          {
-+              (*map)[num_hd + 0x80] = strdup (name);
-+                  assert ((*map)[num_hd + 0x80]);
-+                  
-+	    /* If the device map file is opened, write the map.  */
-+               if (fp)
-+                     fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
-+                     
-+	    num_hd++;
-+          }
-+      }
-+  }
- #endif /* __linux__ */
-   
-   /* OK, close the device map file if opened.  */
-@@ -861,6 +890,12 @@ write_to_partition (char **map, int driv
-       if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
- 	strcpy (dev + strlen(dev) - 5, "/part");
-     }
-+  else
-+    {
-+      if ((strncmp (dev, "/dev/ataraid/", 13) == 0) ||
-+         (strncmp (dev, "/dev/rd/", 8) == 0))
-+        strcpy (dev + strlen(dev), "p");
-+    }
-   sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
-   
-   /* Open the partition.  */
-diff -uprN grub-0.97/netboot/3c509.c grub/netboot/3c509.c
---- grub-0.97/netboot/3c509.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/3c509.c	2002-01-02 21:56:40.000000000 +0000
-@@ -18,7 +18,7 @@ Author: Martin Renters.
- 
- 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su)
- 
--$Id: 3c509.c,v 1.4 2002/01/02 21:56:40 okuji Exp $
-+$Id: 3c509.c 609 2002-01-02 21:56:40Z okuji $
- 
- ***************************************************************************/
- 
-diff -uprN grub-0.97/netboot/cs89x0.c grub/netboot/cs89x0.c
---- grub-0.97/netboot/cs89x0.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.c	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /* cs89x0.c: A Crystal Semiconductor CS89[02]0 driver for etherboot. */
- /*
-   Permission is granted to distribute the enclosed cs89x0.[ch] driver
-diff -uprN grub-0.97/netboot/cs89x0.h grub/netboot/cs89x0.h
---- grub-0.97/netboot/cs89x0.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.h	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /*  Copyright, 1988-1992, Russell Nelson, Crynwr Software
- 
-    This program is free software; you can redistribute it and/or modify
-diff -uprN grub-0.97/netboot/etherboot.h grub/netboot/etherboot.h
---- grub-0.97/netboot/etherboot.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/etherboot.h	2006-09-08 13:56:22.000000000 +0100
-@@ -531,9 +531,6 @@ extern int ip_abort;
- extern int network_ready;
- extern struct rom_info rom;
- extern struct arptable_t arptable[MAX_ARP];
--extern struct bootpd_t bootp_data;
--#define	BOOTP_DATA_ADDR	(&bootp_data)
--extern unsigned char *end_of_rfc1533;
- 
- /* config.c */
- extern struct nic nic;
-diff -uprN grub-0.97/netboot/main.c grub/netboot/main.c
---- grub-0.97/netboot/main.c	2004-05-20 23:19:33.000000000 +0100
-+++ grub/netboot/main.c	2006-09-08 13:56:22.000000000 +0100
-@@ -56,7 +56,8 @@ static int vendorext_isvalid;
- static unsigned long netmask;
- static struct bootpd_t bootp_data;
- static unsigned long xid;
--static unsigned char *end_of_rfc1533 = NULL;
-+
-+#define	BOOTP_DATA_ADDR	(&bootp_data)
- 
- #ifndef	NO_DHCP_SUPPORT
- #endif /* NO_DHCP_SUPPORT */
-@@ -967,7 +968,6 @@ decode_rfc1533 (unsigned char *p, int bl
-   
-   if (block == 0)
-     {
--      end_of_rfc1533 = NULL;
-       vendorext_isvalid = 0;
-       
-       if (grub_memcmp (p, rfc1533_cookie, 4))
-@@ -1021,7 +1021,7 @@ decode_rfc1533 (unsigned char *p, int bl
- 	}
-       else if (c == RFC1533_END)
- 	{
--	  end_of_rfc1533 = endp = p;
-+	  endp = p;
- 	  continue;
- 	}
-       else if (c == RFC1533_NETMASK)
-diff -uprN grub-0.97/netboot/natsemi.c grub/netboot/natsemi.c
---- grub-0.97/netboot/natsemi.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/natsemi.c	2006-09-10 08:26:10.000000000 +0100
-@@ -608,7 +608,7 @@ natsemi_transmit(struct nic  *nic,
- 		 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxOff, ioaddr + ChipCmd);
-@@ -647,7 +647,7 @@ natsemi_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sis900.c grub/netboot/sis900.c
---- grub-0.97/netboot/sis900.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sis900.c	2006-09-10 08:26:10.000000000 +0100
-@@ -901,7 +901,7 @@ sis900_transmit(struct nic  *nic,
-                 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxDIS, ioaddr + cr);
-@@ -940,7 +940,7 @@ sis900_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sk_g16.c grub/netboot/sk_g16.c
---- grub-0.97/netboot/sk_g16.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.c	2002-01-02 21:56:40.000000000 +0000
-@@ -13,12 +13,12 @@ Changes to make it work with Etherboot b
-  *
-  * Module         : sk_g16.c
-  *
-- * Version        : $Revision: 1.4 $
-+ * Version        : $Revision: 609 $
-  *
-  * Author         : Patrick J.D. Weichmann
-  *
-  * Date Created   : 94/05/26
-- * Last Updated   : $Date: 2002/01/02 21:56:40 $
-+ * Last Updated   : $Date: 2002-01-02 21:56:40 +0000 (mer 02 jan 2002) $
-  *
-  * Description    : Schneider & Koch G16 Ethernet Device Driver for
-  *                  Linux Kernel >= 1.1.22
-diff -uprN grub-0.97/netboot/sk_g16.h grub/netboot/sk_g16.h
---- grub-0.97/netboot/sk_g16.h	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.h	2000-07-29 20:22:54.000000000 +0100
-@@ -4,7 +4,7 @@
-  * of the GNU Public License, incorporated herein by reference.
-  *
-  * Module         : sk_g16.h
-- * Version        : $Revision: 1.3 $
-+ * Version        : $Revision: 388 $
-  *
-  * Author         : M.Hipp (mhipp@student.uni-tuebingen.de)
-  * changes by     : Patrick J.D. Weichmann
-@@ -15,8 +15,8 @@
-  *                  the am7990 (LANCE) chip used for writing a
-  *                  network device driver which uses this chip
-  *
-- * $Log: sk_g16.h,v $
-- * Revision 1.3  2000/07/29 19:22:54  okuji
-+ * $Log$
-+ * Revision 1.3  2000-07-29 19:22:54  okuji
-  * update the network support to etherboot-4.6.4.
-  *
- -*/
-diff -uprN grub-0.97/stage1/Makefile.am grub/stage1/Makefile.am
---- grub-0.97/stage1/Makefile.am	2004-07-16 12:44:56.000000000 +0100
-+++ grub/stage1/Makefile.am	2007-11-05 01:29:46.000000000 +0000
-@@ -5,7 +5,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- 
- noinst_PROGRAMS = stage1.exec
- stage1_exec_SOURCES = stage1.S stage1.h
-diff -uprN grub-0.97/stage1/Makefile.in grub/stage1/Makefile.in
---- grub-0.97/stage1/Makefile.in	2005-05-08 03:42:36.000000000 +0100
-+++ grub/stage1/Makefile.in	2007-11-05 01:29:46.000000000 +0000
-@@ -110,7 +110,7 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LTLIBOBJS = @LTLIBOBJS@
-@@ -188,6 +188,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- stage1_exec_SOURCES = stage1.S stage1.h
- SUFFIXES = .exec
- all: all-am
-diff -uprN grub-0.97/stage2/bios.c grub/stage2/bios.c
---- grub-0.97/stage2/bios.c	2004-03-27 16:34:04.000000000 +0000
-+++ grub/stage2/bios.c	2008-03-28 13:22:28.000000000 +0000
-@@ -47,7 +47,7 @@ extern int get_diskinfo_floppy (int driv
-    return the error number. Otherwise, return 0.  */
- int
- biosdisk (int read, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   int err;
-   
-diff -uprN grub-0.97/stage2/boot.c grub/stage2/boot.c
---- grub-0.97/stage2/boot.c	2004-03-30 12:44:08.000000000 +0100
-+++ grub/stage2/boot.c	2005-09-28 22:47:55.000000000 +0100
-@@ -1,7 +1,7 @@
- /* boot.c - load and bootstrap a kernel */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -96,7 +96,7 @@ load_image (char *kernel, char *arg, ker
-   lh = (struct linux_kernel_header *) buffer;
-   
-   /* ELF loading supported if multiboot, FreeBSD and NetBSD.  */
--  if ((type == KERNEL_TYPE_MULTIBOOT
-+  if (((type == KERNEL_TYPE_MULTIBOOT && ! (flags & MULTIBOOT_AOUT_KLUDGE))
-        || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD
-        || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
-        || suggested_type == KERNEL_TYPE_NETBSD)
-diff -uprN grub-0.97/stage2/builtins.c grub/stage2/builtins.c
---- grub-0.97/stage2/builtins.c	2005-02-15 21:58:23.000000000 +0000
-+++ grub/stage2/builtins.c	2006-03-21 20:51:58.000000000 +0000
-@@ -3830,15 +3830,15 @@ setup_func (char *arg, int flags)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF);
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
-       if ((partition & 0x00FF00) != 0x00FF00)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF));
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
--      grub_strncat (device, ")", 256);
-+      grub_strncat (device, ")", sizeof (device));
-     }
-   
-   int embed_stage1_5 (char *stage1_5, int drive, int partition)
-diff -uprN grub-0.97/stage2/disk_io.c grub/stage2/disk_io.c
---- grub-0.97/stage2/disk_io.c	2004-05-23 17:35:24.000000000 +0100
-+++ grub/stage2/disk_io.c	2008-03-28 13:22:28.000000000 +0000
-@@ -137,7 +137,7 @@ log2 (unsigned long word)
- }
- 
- int
--rawread (int drive, int sector, int byte_offset, int byte_len, char *buf)
-+rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   int slen, sectors_per_vtrack;
-   int sector_size_bits = log2 (buf_geom.sector_size);
-@@ -261,7 +261,7 @@ rawread (int drive, int sector, int byte
-        */
-       if (disk_read_func)
- 	{
--	  int sector_num = sector;
-+	  unsigned int sector_num = sector;
- 	  int length = buf_geom.sector_size - byte_offset;
- 	  if (length > size)
- 	    length = size;
-@@ -291,7 +291,7 @@ rawread (int drive, int sector, int byte
- 
- 
- int
--devread (int sector, int byte_offset, int byte_len, char *buf)
-+devread (unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   /*
-    *  Check partition boundaries
-@@ -330,7 +330,7 @@ devread (int sector, int byte_offset, in
- 
- #ifndef STAGE1_5
- int
--rawwrite (int drive, int sector, char *buf)
-+rawwrite (int drive, unsigned int sector, char *buf)
- {
-   if (sector == 0)
-     {
-@@ -363,7 +363,7 @@ rawwrite (int drive, int sector, char *b
- }
- 
- int
--devwrite (int sector, int sector_count, char *buf)
-+devwrite (unsigned int sector, int sector_count, char *buf)
- {
- #if defined(GRUB_UTIL) && defined(__linux__)
-   if (current_partition != 0xFFFFFF
-diff -uprN grub-0.97/stage2/fsys_ffs.c grub/stage2/fsys_ffs.c
---- grub-0.97/stage2/fsys_ffs.c	2003-07-09 12:45:52.000000000 +0100
-+++ grub/stage2/fsys_ffs.c	2001-11-12 06:57:29.000000000 +0000
-@@ -50,7 +50,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ffs.c,v 1.10 2001/11/12 06:57:29 okuji Exp $
-+ *	$Id: fsys_ffs.c 594 2001-11-12 06:57:29Z okuji $
-  */
- 
- #ifdef FSYS_FFS
-diff -uprN grub-0.97/stage2/fsys_ufs2.c grub/stage2/fsys_ufs2.c
---- grub-0.97/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-+++ grub/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-@@ -51,7 +51,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $
-+ *	$Id: fsys_ufs2.c 841 2004-06-19 12:17:52Z okuji $
-  */
- 
- #ifdef FSYS_UFS2
-diff -uprN grub-0.97/stage2/imgact_aout.h grub/stage2/imgact_aout.h
---- grub-0.97/stage2/imgact_aout.h	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/imgact_aout.h	1999-06-24 01:03:29.000000000 +0100
-@@ -32,7 +32,7 @@
-  * SUCH DAMAGE.
-  *
-  *	from: @(#)exec.h	8.1 (Berkeley) 6/11/93
-- *	$Id: imgact_aout.h,v 1.1 1999/06/24 00:03:22 okuji Exp $
-+ *	$Id: imgact_aout.h 98 1999-06-24 00:03:29Z okuji $
-  */
- /*
-  *  11/23/95 - Kludge to get "ntohl" null macro added.  -- ESB
-diff -uprN grub-0.97/stage2/iso9660.h grub/stage2/iso9660.h
---- grub-0.97/stage2/iso9660.h	2004-03-27 16:02:38.000000000 +0000
-+++ grub/stage2/iso9660.h	2007-02-22 23:40:25.000000000 +0000
-@@ -73,11 +73,11 @@ typedef	union {
- 
- typedef	struct __iso_16bit {
-   u_int16_t l, b;
--} iso_16bit_t __attribute__ ((packed));
-+} iso_16bit_t;
- 
- typedef	struct __iso_32bit {
-   u_int32_t l, b;
--} iso_32bit_t __attribute__ ((packed));
-+} iso_32bit_t;
- 
- typedef u_int8_t		iso_date_t[7];
- 
-diff -uprN grub-0.97/stage2/shared.h grub/stage2/shared.h
---- grub-0.97/stage2/shared.h	2004-06-19 17:40:09.000000000 +0100
-+++ grub/stage2/shared.h	2008-03-28 13:22:28.000000000 +0000
-@@ -499,7 +499,11 @@ struct vbe_mode
-   unsigned char linear_reserved_field_position;
-   unsigned long max_pixel_clock;
- 
--  unsigned char reserved3[189];
-+  /* Reserved field to make structure to be 256 bytes long, VESA BIOS 
-+     Extension 3.0 Specification says to reserve 189 bytes here but 
-+     that doesn't make structure to be 256 bytes.  So additional one is 
-+     added here.  */
-+  unsigned char reserved3[189 + 1];
- } __attribute__ ((packed));
- 
- 
-@@ -807,7 +811,7 @@ int checkkey (void);
- /* Low-level disk I/O */
- int get_diskinfo (int drive, struct geometry *geometry);
- int biosdisk (int subfunc, int drive, struct geometry *geometry,
--	      int sector, int nsec, int segment);
-+	      unsigned int sector, int nsec, int segment);
- void stop_floppy (void);
- 
- /* Command-line interface functions. */
-@@ -920,10 +924,10 @@ int gunzip_test_header (void);
- int gunzip_read (char *buf, int len);
- #endif /* NO_DECOMPRESSION */
- 
--int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf);
--int devread (int sector, int byte_offset, int byte_len, char *buf);
--int rawwrite (int drive, int sector, char *buf);
--int devwrite (int sector, int sector_len, char *buf);
-+int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int devread (unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int rawwrite (int drive, unsigned int sector, char *buf);
-+int devwrite (unsigned int sector, int sector_len, char *buf);
- 
- /* Parse a device string and initialize the global parameters. */
- char *set_device (char *device);
-diff -uprN grub-0.97/stage2/stage2.c grub/stage2/stage2.c
---- grub-0.97/stage2/stage2.c	2005-03-19 17:51:57.000000000 +0000
-+++ grub/stage2/stage2.c	2006-05-05 23:06:31.000000000 +0100
-@@ -651,7 +651,10 @@ restart:
- 		  *(new_heap++) = 0;
- 
- 		  if (config_entries)
--		    run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    {
-+		      current_entryno = first_entry + entryno;
-+		      run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    }
- 		  else
- 		    {
- 		      cls ();
-@@ -727,7 +730,8 @@ restart:
- 	cur_entry = get_entry (config_entries, first_entry + entryno, 1);
- 
-       /* Set CURRENT_ENTRYNO for the command "savedefault".  */
--      current_entryno = first_entry + entryno;
-+      if (config_entries)
-+	current_entryno = first_entry + entryno;
-       
-       if (run_script (cur_entry, heap))
- 	{
-diff -uprN grub-0.97/stage2/tparm.c grub/stage2/tparm.c
---- grub-0.97/stage2/tparm.c	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/tparm.c	2002-11-29 20:39:24.000000000 +0000
-@@ -63,7 +63,7 @@ typedef char grub_bool;
- #define MAX_FORMAT_LEN 256
- #define max(a,b) ((a) > (b) ? (a) : (b))
- 
--//MODULE_ID("$Id: tparm.c,v 1.1 2002/11/29 20:39:24 okuji Exp $")
-+//MODULE_ID("$Id: tparm.c 708 2002-11-29 20:39:24Z okuji $")
- 
- /*
-  *	char *
-diff -uprN grub-0.97/stamp-h.in grub/stamp-h.in
---- grub-0.97/stamp-h.in	1970-01-01 01:00:00.000000000 +0100
-+++ grub/stamp-h.in	1999-09-13 14:32:31.000000000 +0100
-@@ -0,0 +1 @@
-+timestamp
-diff -uprN grub-0.97/THANKS grub/THANKS
---- grub-0.97/THANKS	2005-05-08 03:17:43.000000000 +0100
-+++ grub/THANKS	2006-03-21 20:51:58.000000000 +0000
-@@ -121,3 +121,4 @@ Vesa Jaaskelainen <jaaskela@tietomyrsky.
- Yedidyah Bar-David <didi@post.tau.ac.il>
- Yury V. Umanets <umka@namesys.com>
- Yuri Zaporogets <yuriz@ukr.net>
-+Vitaly Fertman <vitaly@namesys.com>
-diff -uprN grub-0.97/util/grub-install.in grub/util/grub-install.in
---- grub-0.97/util/grub-install.in	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/grub-install.in	2006-04-20 14:46:46.000000000 +0100
-@@ -112,8 +112,8 @@ convert () {
- 	tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
- 	tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
-     freebsd* | kfreebsd*-gnu)
--	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
--			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
-+	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \
-+			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'`
- 	tmp_part=`echo "$1" \
- 	    | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
-        	    | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
-diff -uprN grub-0.97/util/mkbimage grub/util/mkbimage
---- grub-0.97/util/mkbimage	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/mkbimage	2007-02-22 16:01:03.000000000 +0000
-@@ -1,7 +1,7 @@
- #!/bin/sh
- # MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode
- # C) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>
--# C) 2001,2002,2003 Robert Millan <robertmh@gnu.org>
-+# C) 2001,2002,2003 Robert Millan <rmh@aybabtu.com>
- 
- 
- # This program is free software; you can redistribute it and/or modify
-@@ -19,7 +19,7 @@
- # program's maintainer or write to: The Free Software Foundation,
- # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
- 
--# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $
-+# $Id: mkbimage 1233 2007-02-22 16:01:03Z robertmh $
- 
- # Global variables
- tarfile=
-@@ -58,7 +58,7 @@ stage2_os_name=
- 
- # Name by which this script was invoked.
- program=`echo "$0" | sed -e 's/[^\/]*\///g'`
--version_number='$Revision: 1.19 $'
-+version_number='$Revision: 1233 $'
- 
- usage="
- Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE
-@@ -94,15 +94,13 @@ Options:
- 	    display Version information and exit
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>. 
--Copyright (c) 2001,2002 Robert Millan <zeratul2@wanadoo.es>.
- GPLed."
- 
- version="mkbimage $version_number
- 
--Written by Thierry Laronde and Robert Millan.
-+Written by Thierry Laronde.
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>.
--Copyright (c) 2001,2002,2003 Robert Millan <zeratul2@wanadoo.es>.
- 
- This is free software under the GPL version 2 or later; see the source for 
- copying conditions.  There is NO warranty, not even for MERCHANTABILITY or 
diff --git a/stubdom/grub.patches/10graphics.diff b/stubdom/grub.patches/10graphics.diff
deleted file mode 100644
index 5ee2852fd7..0000000000
--- a/stubdom/grub.patches/10graphics.diff
+++ /dev/null
@@ -1,2297 +0,0 @@
-diff -Naur grub-0.97.orig/configure.ac grub-0.97/configure.ac
---- grub-0.97.orig/configure.ac	2005-05-07 23:36:03.000000000 -0300
-+++ grub-0.97/configure.ac	2005-06-12 20:56:49.000000000 -0300
-@@ -595,6 +595,11 @@
-   [  --enable-diskless       enable diskless support])
- AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
- 
-+dnl Graphical splashscreen support
-+AC_ARG_ENABLE(graphics,
-+  [  --disable-graphics      disable graphics terminal support])
-+AM_CONDITIONAL(GRAPHICS_SUPPORT, test "x$enable_graphics" != xno)
-+
- dnl Hercules terminal
- AC_ARG_ENABLE(hercules,
-   [  --disable-hercules      disable hercules terminal support])
-diff -Naur grub-0.97.orig/stage2/asm.S grub-0.97/stage2/asm.S
---- grub-0.97.orig/stage2/asm.S	2004-06-19 13:55:22.000000000 -0300
-+++ grub-0.97/stage2/asm.S	2005-06-13 14:05:31.000000000 -0300
-@@ -2216,7 +2216,304 @@
- 	pop	%ebx
- 	pop	%ebp
- 	ret
--		
-+
-+
-+/* graphics mode functions */
-+#ifdef SUPPORT_GRAPHICS
-+VARIABLE(cursorX)
-+.word	0
-+VARIABLE(cursorY)
-+.word	0
-+VARIABLE(cursorCount)
-+.word 0
-+VARIABLE(cursorBuf)
-+.byte	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-+
-+
-+/*
-+ * set_int1c_handler(void)
-+ */
-+ENTRY(set_int1c_handler)
-+	pushl   %edi
-+
-+	/* save the original int1c handler */
-+	movl    $0x70, %edi
-+	movw    (%edi), %ax
-+	movw    %ax, ABS(int1c_offset)
-+	movw    2(%edi), %ax
-+	movw    %ax, ABS(int1c_segment)
-+
-+	/* save the new int1c handler */
-+	movw    $ABS(int1c_handler), %ax
-+	movw    %ax, (%edi)
-+	xorw    %ax, %ax
-+	movw    %ax, 2(%edi)
-+
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * unset_int1c_handler(void)
-+ */
-+ENTRY(unset_int1c_handler)
-+	pushl   %edi
-+
-+	/* check if int1c_handler is set */
-+	movl    $0x70, %edi
-+	movw    $ABS(int1c_handler), %ax
-+	cmpw    %ax, (%edi)
-+	jne     int1c_1
-+	xorw    %ax, %ax
-+	cmpw    %ax, 2(%edi)
-+	jne     int1c_1
-+
-+	/* restore the original */
-+	movw    ABS(int1c_offset), %ax
-+	movw    %ax, (%edi)
-+	movw    ABS(int1c_segment), %ax
-+	movw    %ax, 2(%edi)
-+
-+int1c_1:
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * blinks graphics cursor
-+ */
-+	.code16
-+write_data:
-+	movw    $0, %ax
-+	movw    %ax, %ds
-+
-+	mov     $0xA000, %ax            /* video in es:di */
-+	mov     %ax, %es
-+	mov     $80, %ax
-+	movw    $ABS(cursorY), %si
-+	mov     %ds:(%si), %bx
-+	mul     %bx
-+	movw    $ABS(cursorX), %si
-+	mov     %ds:(%si), %bx
-+	shr     $3, %bx                 /* %bx /= 8 */
-+	add     %bx, %ax
-+	mov     %ax, %di
-+
-+	movw    $ABS(cursorBuf), %si    /* fontBuf in ds:si */
-+
-+	/* prepare for data moving */
-+	mov     $16, %dx                /* altura da fonte */
-+	mov     $80, %bx                /* bytes por linha */
-+
-+write_loop:
-+	movb    %ds:(%si), %al
-+	xorb    $0xff, %al
-+	movb    %al, %ds:(%si)          /* invert cursorBuf */
-+	movb    %al, %es:(%di)          /* write to video */
-+	add     %bx, %di
-+	inc     %si
-+	dec     %dx
-+	jg      write_loop
-+	ret
-+
-+int1c_handler:
-+	pusha
-+	mov     $0, %ax
-+	mov     %ax, %ds
-+	mov     $ABS(cursorCount), %si
-+	mov     %ds:(%si), %ax
-+	inc     %ax
-+	mov     %ax, %ds:(%si)
-+	cmp     $9, %ax
-+	jne     int1c_done
-+
-+	mov     $0, %ax
-+	mov     %ax, %ds:(%si)
-+	call    write_data
-+
-+int1c_done:
-+	popa
-+	iret
-+	/* call previous int1c handler */
-+	/* ljmp */
-+	.byte   0xea
-+int1c_offset:  .word   0
-+int1c_segment: .word   0
-+	.code32
-+
-+
-+/*
-+ * unsigned char set_videomode(unsigned char mode)
-+ * BIOS call "INT 10H Function 0h" to set video mode
-+ *	Call with	%ah = 0x0
-+ *			%al = video mode
-+ *  Returns old videomode.
-+ */
-+ENTRY(set_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	movb	8(%ebp), %cl
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xf, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %ch
-+	xorb	%ah, %ah
-+	movb	%cl, %al
-+	int	$0x10			/* Set Video mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%ch, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * int get_videomode()
-+ * BIOS call "INT 10H Function 0Fh" to get current video mode
-+ *	Call with	%al = 0x0
-+ *			%ah = 0xF
-+ *	Returns current videomode.
-+ */
-+ENTRY(get_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xF, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %cl	/* For now we only want display mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%cl, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * unsigned char * graphics_get_font()
-+ * BIOS call "INT 10H Function 11h" to set font
-+ *      Call with       %ah = 0x11
-+ */
-+ENTRY(graphics_get_font)
-+	push	%ebp
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movw	$0x1130, %ax
-+	movb	$6, %bh		/* font 8x16 */
-+	int	$0x10
-+	movw	%bp, %dx
-+	movw	%es, %cx
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movw	%cx, %ax
-+	shll	$4, %eax
-+	movw	%dx, %ax
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%ebp
-+	ret
-+
-+
-+/*
-+ * graphics_set_palette(index, red, green, blue)
-+ * BIOS call "INT 10H Function 10h" to set individual dac register
-+ *	Call with	%ah = 0x10
-+ *			%bx = register number
-+ *			%ch = new value for green (0-63)
-+ *			%cl = new value for blue (0-63)
-+ *			%dh = new value for red (0-63)
-+ */
-+
-+ENTRY(graphics_set_palette)
-+	push	%ebp
-+	push	%eax
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	movw	$0x3c8, %bx		/* address write mode register */
-+
-+	/* wait vertical retrace */
-+	movw	$0x3da, %dx
-+l1b:
-+	inb	%dx, %al	/* wait vertical active display */
-+	test	$8, %al
-+	jnz	l1b
-+
-+l2b:
-+	inb	%dx, %al	/* wait vertical retrace */
-+	test	$8, %al
-+	jnz	l2b
-+
-+	mov	%bx, %dx
-+	movb	0x18(%esp), %al		/* index */
-+	outb	%al, %dx
-+	inc	%dx
-+
-+	movb	0x1c(%esp), %al		/* red */
-+	outb	%al, %dx
-+
-+	movb	0x20(%esp), %al		/* green */
-+	outb	%al, %dx
-+
-+	movb	0x24(%esp), %al		/* blue */
-+	outb	%al, %dx
-+
-+	movw	0x18(%esp), %bx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movb	%bl, %bh
-+	movw	$0x1000, %ax
-+	int	$0x10
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%eax
-+	pop	%ebp
-+	ret
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
- /*
-  * getrtsecs()
-  *	if a seconds value can be read, read it and return it (BCD),
-diff -Naur grub-0.97.orig/stage2/builtins.c grub-0.97/stage2/builtins.c
---- grub-0.97.orig/stage2/builtins.c	2005-02-15 19:58:23.000000000 -0200
-+++ grub-0.97/stage2/builtins.c	2005-06-13 18:44:03.000000000 -0300
-@@ -28,6 +28,10 @@
- #include <filesys.h>
- #include <term.h>
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifdef SUPPORT_NETBOOT
- # define GRUB	1
- # include <etherboot.h>
-@@ -237,12 +241,22 @@
- static int
- boot_func (char *arg, int flags)
- {
-+  struct term_entry *prev_term = current_term;
-   /* Clear the int15 handler if we can boot the kernel successfully.
-      This assumes that the boot code never fails only if KERNEL_TYPE is
-      not KERNEL_TYPE_NONE. Is this assumption is bad?  */
-   if (kernel_type != KERNEL_TYPE_NONE)
-     unset_int15_handler ();
- 
-+  /* if our terminal needed initialization, we should shut it down
-+   * before booting the kernel, but we want to save what it was so
-+   * we can come back if needed */
-+  if (current_term->shutdown) 
-+    {
-+      current_term->shutdown();
-+      current_term = term_table; /* assumption: console is first */
-+    }
-+
- #ifdef SUPPORT_NETBOOT
-   /* Shut down the networking.  */
-   cleanup_net ();
-@@ -306,6 +320,13 @@
-       return 1;
-     }
- 
-+  /* if we get back here, we should go back to what our term was before */
-+  current_term = prev_term;
-+  if (current_term->startup)
-+      /* if our terminal fails to initialize, fall back to console since
-+       * it should always work */
-+      if (current_term->startup() == 0)
-+          current_term = term_table; /* we know that console is first */
-   return 0;
- }
- 
-@@ -852,6 +873,251 @@
- };
- #endif /* SUPPORT_NETBOOT */
- 
-+#ifdef SUPPORT_GRAPHICS
-+
-+static int splashimage_func(char *arg, int flags) {
-+  int i;
-+    
-+  /* filename can only be 256 characters due to our buffer size */
-+  if (grub_strlen(arg) > 256) {
-+    grub_printf("Splash image filename too large\n");
-+    grub_printf("Press any key to continue...");
-+    getkey();
-+    return 1;
-+  }
-+
-+  /* get rid of TERM_NEED_INIT from the graphics terminal. */
-+  for (i = 0; term_table[i].name; i++) {
-+    if (grub_strcmp (term_table[i].name, "graphics") == 0) {
-+      term_table[i].flags &= ~TERM_NEED_INIT;
-+      break;
-+    }
-+  }
-+
-+  graphics_set_splash(arg);
-+
-+  if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+    graphics_end();
-+    if (graphics_init() == 0) {
-+      /* Fallback to default term */
-+      current_term = term_table;
-+      max_lines = current_term->max_lines;
-+      if (current_term->cls)
-+        current_term->cls();
-+      grub_printf("Failed to set splash image and/or graphics mode\n");
-+      return 1;
-+    }
-+    graphics_cls();
-+  }
-+
-+  if (flags == BUILTIN_MENU)
-+    current_term = term_table + i;
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_splashimage =
-+{
-+  "splashimage",
-+  splashimage_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "splashimage FILE",
-+  "Load FILE as the background image when in graphics mode."
-+};
-+
-+
-+/* shade */
-+static int
-+shade_func(char *arg, int flags)
-+{
-+    int new_shade;
-+
-+    if (!arg || safe_parse_maxint(&arg, &new_shade) == 0)
-+       return (1);
-+
-+    if (shade != new_shade) {
-+       shade = new_shade;
-+       if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+           graphics_end();
-+           graphics_init();
-+           graphics_cls();
-+       }
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_shade =
-+{
-+  "shade",
-+  shade_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "shade INTEGER",
-+  "If set to 0, disables the use of shaded text, else enables it."
-+};
-+
-+
-+/* foreground */
-+static int
-+foreground_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	foreground = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(15, r, g, b);
-+
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_foreground =
-+{
-+  "foreground",
-+  foreground_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "foreground RRGGBB",
-+  "Sets the foreground color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* background */
-+static int
-+background_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	background = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(0, r, g, b);
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_background =
-+{
-+  "background",
-+  background_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "background RRGGBB",
-+  "Sets the background color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* border */
-+static int
-+border_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+       int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+       int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+       int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+       window_border = (r << 16) | (g << 8) | b;
-+       if (graphics_inited)
-+           graphics_set_palette(0x11, r, g, b);
-+
-+       return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_border =
-+{
-+  "border",
-+  border_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "border RRGGBB",
-+  "Sets the border video color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* viewport */
-+static int
-+viewport_func (char *arg, int flags)
-+{
-+    int i;
-+    int x0 = 0, y0 = 0, x1 = 80, y1 = 30;
-+    int *pos[4] = { &x0, &y0, &x1, &y1 };
-+
-+    if (!arg)
-+       return (1);
-+    for (i = 0; i < 4; i++) {
-+       if (!*arg)
-+           return (1);
-+    while (*arg && (*arg == ' ' || *arg == '\t'))
-+           ++arg;
-+       if (!safe_parse_maxint(&arg, pos[i]))
-+           return (1);
-+       while (*arg && (*arg != ' ' && *arg != '\t'))
-+           ++arg;
-+    }
-+
-+    /* minimum size is 65 colums and 16 rows */
-+    if (x0 > x1 - 66 || y0 > y1 - 16 || x0 < 0 || y0 < 0 || x1 > 80 || y1 > 30)
-+       return 1;
-+
-+    view_x0 = x0;
-+    view_y0 = y0;
-+    view_x1 = x1;
-+    view_y1 = y1;
-+
-+    if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+       graphics_end();
-+       graphics_init();
-+       graphics_cls();
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_viewport =
-+{
-+  "viewport",
-+  viewport_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "viewport x0 y0 x1 y1",
-+  "Changes grub internals to output text in the window defined by"
-+  " four parameters. The x and y parameters are 0 based. This option"
-+  " only works with the graphics interface."
-+};
-+
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
-+/* clear */
-+static int 
-+clear_func() 
-+{
-+  if (current_term->cls)
-+    current_term->cls();
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_clear =
-+{
-+  "clear",
-+  clear_func,
-+  BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
-+  "clear",
-+  "Clear the screen"
-+};
-+
- 
- /* displayapm */
- static int
-@@ -1454,14 +1720,20 @@
- 
- 
- /* help */
--#define MAX_SHORT_DOC_LEN	39
--#define MAX_LONG_DOC_LEN	66
--
- static int
- help_func (char *arg, int flags)
- {
--  int all = 0;
--  
-+  int all = 0, max_short_doc_len, max_long_doc_len;
-+  max_short_doc_len = 39;
-+  max_long_doc_len = 66;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      max_short_doc_len = (view_x1 - view_x0 + 1) / 2 - 1;
-+      max_long_doc_len = (view_x1 - view_x0) - 14;
-+    }
-+#endif
-+
-   if (grub_memcmp (arg, "--all", sizeof ("--all") - 1) == 0)
-     {
-       all = 1;
-@@ -1491,13 +1763,13 @@
- 
- 	  len = grub_strlen ((*builtin)->short_doc);
- 	  /* If the length of SHORT_DOC is too long, truncate it.  */
--	  if (len > MAX_SHORT_DOC_LEN - 1)
--	    len = MAX_SHORT_DOC_LEN - 1;
-+	  if (len > max_short_doc_len - 1)
-+	    len = max_short_doc_len - 1;
- 
- 	  for (i = 0; i < len; i++)
- 	    grub_putchar ((*builtin)->short_doc[i]);
- 
--	  for (; i < MAX_SHORT_DOC_LEN; i++)
-+	  for (; i < max_short_doc_len; i++)
- 	    grub_putchar (' ');
- 
- 	  if (! left)
-@@ -1546,10 +1818,10 @@
- 		      int i;
- 
- 		      /* If LEN is too long, fold DOC.  */
--		      if (len > MAX_LONG_DOC_LEN)
-+		      if (len > max_long_doc_len)
- 			{
- 			  /* Fold this line at the position of a space.  */
--			  for (len = MAX_LONG_DOC_LEN; len > 0; len--)
-+			  for (len = max_long_doc_len; len > 0; len--)
- 			    if (doc[len - 1] == ' ')
- 			      break;
- 			}
-@@ -4085,7 +4357,7 @@
- };
- 
- 
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
- /* terminal */
- static int
- terminal_func (char *arg, int flags)
-@@ -4244,17 +4516,29 @@
-  end:
-   current_term = term_table + default_term;
-   current_term->flags = term_flags;
--  
-+
-   if (lines)
-     max_lines = lines;
-   else
--    /* 24 would be a good default value.  */
--    max_lines = 24;
--  
-+    max_lines = current_term->max_lines;
-+
-   /* If the interface is currently the command-line,
-      restart it to repaint the screen.  */
--  if (current_term != prev_term && (flags & BUILTIN_CMDLINE))
-+  if ((current_term != prev_term) && (flags & BUILTIN_CMDLINE)){
-+    if (prev_term->shutdown)
-+      prev_term->shutdown();
-+    if (current_term->startup) {
-+      /* If startup fails, return to previous term */
-+      if (current_term->startup() == 0) {
-+        current_term = prev_term;
-+        max_lines = current_term->max_lines;
-+        if (current_term->cls) {
-+          current_term->cls();
-+        }
-+      }
-+    }
-     grub_longjmp (restart_cmdline_env, 0);
-+  }
-   
-   return 0;
- }
-@@ -4264,7 +4548,7 @@
-   "terminal",
-   terminal_func,
-   BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
--  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]",
-+  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]",
-   "Select a terminal. When multiple terminals are specified, wait until"
-   " you push any key to continue. If both console and serial are specified,"
-   " the terminal to which you input a key first will be selected. If no"
-@@ -4276,7 +4560,7 @@
-   " seconds. The option --lines specifies the maximum number of lines."
-   " The option --silent is used to suppress messages."
- };
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- 
- 
- #ifdef SUPPORT_SERIAL
-@@ -4795,13 +5079,20 @@
- /* The table of builtin commands. Sorted in dictionary order.  */
- struct builtin *builtin_table[] =
- {
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_background,
-+#endif
-   &builtin_blocklist,
-   &builtin_boot,
- #ifdef SUPPORT_NETBOOT
-   &builtin_bootp,
- #endif /* SUPPORT_NETBOOT */
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_border,
-+#endif
-   &builtin_cat,
-   &builtin_chainloader,
-+  &builtin_clear,
-   &builtin_cmp,
-   &builtin_color,
-   &builtin_configfile,
-@@ -4821,6 +5112,9 @@
-   &builtin_embed,
-   &builtin_fallback,
-   &builtin_find,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_foreground,
-+#endif
-   &builtin_fstest,
-   &builtin_geometry,
-   &builtin_halt,
-@@ -4864,9 +5158,13 @@
- #endif /* SUPPORT_SERIAL */
-   &builtin_setkey,
-   &builtin_setup,
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_shade,
-+  &builtin_splashimage,
-+#endif /* SUPPORT_GRAPHICS */
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
-   &builtin_terminal,
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- #ifdef SUPPORT_SERIAL
-   &builtin_terminfo,
- #endif /* SUPPORT_SERIAL */
-@@ -4880,5 +5178,8 @@
-   &builtin_unhide,
-   &builtin_uppermem,
-   &builtin_vbeprobe,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_viewport,
-+#endif
-   0
- };
-diff -Naur grub-0.97.orig/stage2/char_io.c grub-0.97/stage2/char_io.c
---- grub-0.97.orig/stage2/char_io.c	2005-02-01 18:51:23.000000000 -0200
-+++ grub-0.97/stage2/char_io.c	2005-06-12 20:56:49.000000000 -0300
-@@ -29,12 +29,17 @@
- # include <serial.h>
- #endif
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifndef STAGE1_5
- struct term_entry term_table[] =
-   {
-     {
-       "console",
-       0,
-+      24,
-       console_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -43,13 +48,16 @@
-       console_cls,
-       console_setcolorstate,
-       console_setcolor,
--      console_setcursor
-+      console_setcursor,
-+      0, 
-+      0
-     },
- #ifdef SUPPORT_SERIAL
-     {
-       "serial",
-       /* A serial device must be initialized.  */
-       TERM_NEED_INIT,
-+      24,
-       serial_putchar,
-       serial_checkkey,
-       serial_getkey,
-@@ -58,6 +66,8 @@
-       serial_cls,
-       serial_setcolorstate,
-       0,
-+      0,
-+      0, 
-       0
-     },
- #endif /* SUPPORT_SERIAL */
-@@ -65,6 +75,7 @@
-     {
-       "hercules",
-       0,
-+      24,
-       hercules_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -73,11 +84,30 @@
-       hercules_cls,
-       hercules_setcolorstate,
-       hercules_setcolor,
--      hercules_setcursor
-+      hercules_setcursor,
-+      0,
-+      0
-     },      
- #endif /* SUPPORT_HERCULES */
-+#ifdef SUPPORT_GRAPHICS
-+    { "graphics",
-+      TERM_NEED_INIT, /* flags */
-+      30, /* number of lines */
-+      graphics_putchar, /* putchar */
-+      console_checkkey, /* checkkey */
-+      console_getkey, /* getkey */
-+      graphics_getxy, /* getxy */
-+      graphics_gotoxy, /* gotoxy */
-+      graphics_cls, /* cls */
-+      graphics_setcolorstate, /* setcolorstate */
-+      graphics_setcolor, /* setcolor */
-+      graphics_setcursor, /* nocursor */
-+      graphics_init, /* initialize */
-+      graphics_end /* shutdown */
-+    },
-+#endif /* SUPPORT_GRAPHICS */
-     /* This must be the last entry.  */
--    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-+    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-   };
- 
- /* This must be console.  */
-@@ -305,9 +335,10 @@
- 
-   /* XXX: These should be defined in shared.h, but I leave these here,
-      until this code is freezed.  */
--#define CMDLINE_WIDTH	78
- #define CMDLINE_MARGIN	10
--  
-+
-+  /* command-line limits */
-+  int cmdline_width = 78, col_start = 0;
-   int xpos, lpos, c, section;
-   /* The length of PROMPT.  */
-   int plen;
-@@ -338,7 +369,7 @@
-       
-       /* If the cursor is in the first section, display the first section
- 	 instead of the second.  */
--      if (section == 1 && plen + lpos < CMDLINE_WIDTH)
-+      if (section == 1 && plen + lpos < cmdline_width)
- 	cl_refresh (1, 0);
-       else if (xpos - count < 1)
- 	cl_refresh (1, 0);
-@@ -354,7 +385,7 @@
- 		grub_putchar ('\b');
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -364,7 +395,7 @@
-       lpos += count;
- 
-       /* If the cursor goes outside, scroll the screen to the right.  */
--      if (xpos + count >= CMDLINE_WIDTH)
-+      if (xpos + count >= cmdline_width)
- 	cl_refresh (1, 0);
-       else
- 	{
-@@ -383,7 +414,7 @@
- 		}
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -398,14 +429,14 @@
-       if (full)
- 	{
- 	  /* Recompute the section number.  */
--	  if (lpos + plen < CMDLINE_WIDTH)
-+	  if (lpos + plen < cmdline_width)
- 	    section = 0;
- 	  else
--	    section = ((lpos + plen - CMDLINE_WIDTH)
--		       / (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) + 1);
-+	    section = ((lpos + plen - cmdline_width)
-+		       / (cmdline_width - 1 - CMDLINE_MARGIN) + 1);
- 
- 	  /* From the start to the end.  */
--	  len = CMDLINE_WIDTH;
-+	  len = cmdline_width;
- 	  pos = 0;
- 	  grub_putchar ('\r');
- 
-@@ -445,8 +476,8 @@
- 	  if (! full)
- 	    offset = xpos - 1;
- 	  
--	  start = ((section - 1) * (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN)
--		   + CMDLINE_WIDTH - plen - CMDLINE_MARGIN);
-+	  start = ((section - 1) * (cmdline_width - 1 - CMDLINE_MARGIN)
-+		   + cmdline_width - plen - CMDLINE_MARGIN);
- 	  xpos = lpos + 1 - start;
- 	  start += offset;
- 	}
-@@ -471,7 +502,7 @@
-       
-       /* If the cursor is at the last position, put `>' or a space,
- 	 depending on if there are more characters in BUF.  */
--      if (pos == CMDLINE_WIDTH)
-+      if (pos == cmdline_width)
- 	{
- 	  if (start + len < llen)
- 	    grub_putchar ('>');
-@@ -488,7 +519,7 @@
- 	    grub_putchar ('\b');
- 	}
-       else
--	gotoxy (xpos, getxy () & 0xFF);
-+	gotoxy (xpos + col_start, getxy () & 0xFF);
-     }
- 
-   /* Initialize the command-line.  */
-@@ -518,10 +549,10 @@
- 	  
- 	  llen += l;
- 	  lpos += l;
--	  if (xpos + l >= CMDLINE_WIDTH)
-+	  if (xpos + l >= cmdline_width)
- 	    cl_refresh (1, 0);
--	  else if (xpos + l + llen - lpos > CMDLINE_WIDTH)
--	    cl_refresh (0, CMDLINE_WIDTH - xpos);
-+	  else if (xpos + l + llen - lpos > cmdline_width)
-+	    cl_refresh (0, cmdline_width - xpos);
- 	  else
- 	    cl_refresh (0, l + llen - lpos);
- 	}
-@@ -533,12 +564,22 @@
-       grub_memmove (buf + lpos, buf + lpos + count, llen - count + 1);
-       llen -= count;
-       
--      if (xpos + llen + count - lpos > CMDLINE_WIDTH)
--	cl_refresh (0, CMDLINE_WIDTH - xpos);
-+      if (xpos + llen + count - lpos > cmdline_width)
-+	cl_refresh (0, cmdline_width - xpos);
-       else
- 	cl_refresh (0, llen + count - lpos);
-     }
- 
-+  max_lines = current_term->max_lines;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      cmdline_width = (view_x1 - view_x0) - 2;
-+      col_start = view_x0;
-+      max_lines = view_y1 - view_y0;
-+    }
-+#endif
-+
-   plen = grub_strlen (prompt);
-   llen = grub_strlen (cmdline);
- 
-@@ -1006,6 +1047,48 @@
- }
- #endif /* ! STAGE1_5 */
- 
-+#ifndef STAGE1_5
-+/* Internal pager.  */
-+int
-+do_more (void)
-+{
-+  if (count_lines >= 0)
-+    {
-+      count_lines++;
-+      if (count_lines >= max_lines - 2)
-+        {
-+          int tmp;
-+
-+          /* It's important to disable the feature temporarily, because
-+             the following grub_printf call will print newlines.  */
-+          count_lines = -1;
-+
-+          grub_printf("\n");
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
-+
-+          grub_printf ("[Hit return to continue]");
-+
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_NORMAL);
-+
-+
-+          do
-+            {
-+              tmp = ASCII_CHAR (getkey ());
-+            }
-+          while (tmp != '\n' && tmp != '\r');
-+          grub_printf ("\r                        \r");
-+
-+          /* Restart to count lines.  */
-+          count_lines = 0;
-+          return 1;
-+        }
-+    }
-+  return 0;
-+}
-+#endif
-+
- /* Display an ASCII character.  */
- void
- grub_putchar (int c)
-@@ -1034,38 +1117,11 @@
- 
-   if (c == '\n')
-     {
-+      int flag;
-       /* Internal `more'-like feature.  */
--      if (count_lines >= 0)
--	{
--	  count_lines++;
--	  if (count_lines >= max_lines - 2)
--	    {
--	      int tmp;
--	      
--	      /* It's important to disable the feature temporarily, because
--		 the following grub_printf call will print newlines.  */
--	      count_lines = -1;
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
--	      
--	      grub_printf ("\n[Hit return to continue]");
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_NORMAL);
--	      
--	      do
--		{
--		  tmp = ASCII_CHAR (getkey ());
--		}
--	      while (tmp != '\n' && tmp != '\r');
--	      grub_printf ("\r                        \r");
--	      
--	      /* Restart to count lines.  */
--	      count_lines = 0;
--	      return;
--	    }
--	}
-+      flag = do_more ();
-+      if (flag)
-+        return;
-     }
- 
-   current_term->putchar (c);
-@@ -1090,7 +1146,7 @@
- cls (void)
- {
-   /* If the terminal is dumb, there is no way to clean the terminal.  */
--  if (current_term->flags & TERM_DUMB)
-+  if (current_term->flags & TERM_DUMB) 
-     grub_putchar ('\n');
-   else
-     current_term->cls ();
-@@ -1217,6 +1273,16 @@
-   return ! errnum;
- }
- 
-+void
-+grub_memcpy(void *dest, const void *src, int len)
-+{
-+  int i;
-+  register char *d = (char*)dest, *s = (char*)src;
-+
-+  for (i = 0; i < len; i++)
-+    d[i] = s[i];
-+}
-+
- void *
- grub_memmove (void *to, const void *from, int len)
- {
-diff -Naur grub-0.97.orig/stage2/cmdline.c grub-0.97/stage2/cmdline.c
---- grub-0.97.orig/stage2/cmdline.c	2004-08-16 20:23:01.000000000 -0300
-+++ grub-0.97/stage2/cmdline.c	2005-06-12 20:56:49.000000000 -0300
-@@ -50,10 +50,11 @@
- void
- print_cmdline_message (int forever)
- {
--  printf (" [ Minimal BASH-like line editing is supported.  For the first word, TAB\n"
--	  "   lists possible command completions.  Anywhere else TAB lists the possible\n"
--	  "   completions of a device/filename.%s ]\n",
--	  (forever ? "" : "  ESC at any time exits."));
-+  grub_printf("       [ Minimal BASH-like line editing is supported.   For\n"
-+              "         the   first   word,  TAB  lists  possible  command\n"
-+              "         completions.  Anywhere else TAB lists the possible\n"
-+              "         completions of a device/filename.%s ]\n",
-+              (forever ? "" : "  ESC at any time\n         exits."));
- }
- 
- /* Find the builtin whose command name is COMMAND and return the
-diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
---- grub-0.97.orig/stage2/graphics.c	1969-12-31 21:00:00.000000000 -0300
-+++ grub-0.97/stage2/graphics.c	2005-06-13 19:13:31.000000000 -0300
-@@ -0,0 +1,584 @@
-+/*
-+ * graphics.c - graphics mode support for GRUB
-+ * Implemented as a terminal type by Jeremy Katz <katzj@redhat.com> based
-+ * on a patch by Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
-+ * Options and enhancements made by Herton Ronaldo Krzesinski
-+ * <herton@mandriva.com>
-+ *
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2001,2002  Red Hat, Inc.
-+ *  Portions copyright (C) 2000  Conectiva, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; If not, see <http://www.gnu.org/licenses/>
-+ */
-+
-+#ifdef SUPPORT_GRAPHICS
-+
-+#include <term.h>
-+#include <shared.h>
-+#include <graphics.h>
-+
-+int saved_videomode;
-+unsigned char *font8x16;
-+
-+int graphics_inited = 0;
-+static char splashimage[256];
-+
-+int shade = 1, no_cursor = 0;
-+
-+#define VSHADOW VSHADOW1
-+unsigned char VSHADOW1[38400];
-+unsigned char VSHADOW2[38400];
-+unsigned char VSHADOW4[38400];
-+unsigned char VSHADOW8[38400];
-+
-+/* define the default viewable area */
-+int view_x0 = 0;
-+int view_y0 = 0;
-+int view_x1 = 80;
-+int view_y1 = 30;
-+
-+/* text buffer has to be kept around so that we can write things as we
-+ * scroll and the like */
-+unsigned short text[80 * 30];
-+
-+/* graphics options */
-+int foreground = (63 << 16) | (63 << 8) | (63), background = 0, window_border = 0;
-+
-+/* current position */
-+static int fontx = 0;
-+static int fonty = 0;
-+
-+/* global state so that we don't try to recursively scroll or cursor */
-+static int no_scroll = 0;
-+
-+/* color state */
-+static int graphics_standard_color = A_NORMAL;
-+static int graphics_normal_color = A_NORMAL;
-+static int graphics_highlight_color = A_REVERSE;
-+static int graphics_current_color = A_NORMAL;
-+static color_state graphics_color_state = COLOR_STATE_STANDARD;
-+
-+static inline void outb(unsigned short port, unsigned char val)
-+{
-+    __asm __volatile ("outb %0,%1"::"a" (val), "d" (port));
-+}
-+
-+static void MapMask(int value) {
-+    outb(0x3c4, 2);
-+    outb(0x3c5, value);
-+}
-+
-+/* bit mask register */
-+static void BitMask(int value) {
-+    outb(0x3ce, 8);
-+    outb(0x3cf, value);
-+}
-+
-+/* move the graphics cursor location to col, row */
-+static void graphics_setxy(int col, int row) {
-+    if (col >= view_x0 && col < view_x1) {
-+        fontx = col;
-+        cursorX = col << 3;
-+    }
-+    if (row >= view_y0 && row < view_y1) {
-+        fonty = row;
-+        cursorY = row << 4;
-+    }
-+}
-+
-+/* scroll the screen */
-+static void graphics_scroll() {
-+    int i, j, k;
-+
-+    /* we don't want to scroll recursively... that would be bad */
-+    if (no_scroll)
-+        return;
-+    no_scroll = 1;
-+
-+    /* disable pager temporarily */
-+    k = count_lines;
-+    count_lines = -1;
-+    
-+    /* move everything up a line */
-+    for (j = view_y0 + 1; j < view_y1; j++) {
-+        graphics_gotoxy(view_x0, j - 1);
-+        for (i = view_x0; i < view_x1; i++) {
-+            graphics_putchar(text[j * 80 + i]);
-+        }
-+    }
-+
-+    /* last line should be blank */
-+    graphics_gotoxy(view_x0, view_y1 - 1);
-+    for (i = view_x0; i < view_x1; i++)
-+        graphics_putchar(' ');
-+    graphics_setxy(view_x0, view_y1 - 1);
-+
-+    count_lines = k;
-+
-+    no_scroll = 0;
-+}
-+
-+/* Set the splash image */
-+void graphics_set_splash(char *splashfile) {
-+    grub_strcpy(splashimage, splashfile);
-+}
-+
-+/* Get the current splash image */
-+char *graphics_get_splash(void) {
-+    return splashimage;
-+}
-+
-+/* 
-+ * Initialize a vga16 graphics display with the palette based off of
-+ * the image in splashimage.  If the image doesn't exist, leave graphics
-+ * mode. The mode initiated is 12h. From "Ralf Brown's Interrupt List":
-+ *      text/ text pixel   pixel   colors disply scrn  system
-+ *      grph resol  box  resolution       pages  addr
-+ * 12h   G   80x30  8x16  640x480  16/256K  .    A000  VGA,ATI VIP
-+ *       G   80x30  8x16  640x480  16/64    .    A000  ATI EGA Wonder
-+ *       G     .     .    640x480  16       .      .   UltraVision+256K EGA
-+ */
-+int graphics_init()
-+{
-+    if (!graphics_inited) {
-+        saved_videomode = set_videomode(0x12);
-+        if (get_videomode() != 0x12) {
-+            set_videomode(saved_videomode);
-+            return 0;
-+        }
-+        graphics_inited = 1;
-+    }
-+    else
-+        return 1;
-+
-+    font8x16 = (unsigned char*)graphics_get_font();
-+
-+    /* make sure that the highlight color is set correctly */
-+    graphics_highlight_color = ((graphics_normal_color >> 4) | 
-+                                ((graphics_normal_color & 0xf) << 4));
-+
-+    graphics_cls();
-+
-+    if (!read_image(splashimage)) {
-+        grub_printf("Failed to read splash image (%s)\n", splashimage);
-+        grub_printf("Press any key to continue...");
-+        getkey();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        return 0;
-+    }
-+
-+    set_int1c_handler();
-+
-+    return 1;
-+}
-+
-+/* Leave graphics mode */
-+void graphics_end(void)
-+{
-+    if (graphics_inited) {
-+        unset_int1c_handler();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        no_cursor = 0;
-+    }
-+}
-+
-+/* Print ch on the screen.  Handle any needed scrolling or the like */
-+void graphics_putchar(int ch) {
-+    ch &= 0xff;
-+
-+    graphics_cursor(0);
-+
-+    if (ch == '\n') {
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(fontx, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        return;
-+    } else if (ch == '\r') {
-+        graphics_setxy(view_x0, fonty);
-+        graphics_cursor(1);
-+        return;
-+    }
-+
-+    graphics_cursor(0);
-+
-+    text[fonty * 80 + fontx] = ch;
-+    text[fonty * 80 + fontx] &= 0x00ff;
-+    if (graphics_current_color & 0xf0)
-+        text[fonty * 80 + fontx] |= 0x100;
-+
-+    graphics_cursor(0);
-+
-+    if ((fontx + 1) >= view_x1) {
-+        graphics_setxy(view_x0, fonty);
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(view_x0, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        do_more ();
-+        graphics_cursor(0);
-+    } else {
-+        graphics_setxy(fontx + 1, fonty);
-+    }
-+
-+    graphics_cursor(1);
-+}
-+
-+/* get the current location of the cursor */
-+int graphics_getxy(void) {
-+    return (fontx << 8) | fonty;
-+}
-+
-+void graphics_gotoxy(int x, int y) {
-+    graphics_cursor(0);
-+
-+    graphics_setxy(x, y);
-+
-+    graphics_cursor(1);
-+}
-+
-+void graphics_cls(void) {
-+    int i;
-+    unsigned char *mem, *s1, *s2, *s4, *s8;
-+
-+    graphics_cursor(0);
-+    graphics_gotoxy(view_x0, view_y0);
-+
-+    mem = (unsigned char*)VIDEOMEM;
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 80 * 30; i++)
-+        text[i] = ' ';
-+    graphics_cursor(1);
-+
-+    BitMask(0xff);
-+
-+    /* plane 1 */
-+    MapMask(1);
-+    grub_memcpy(mem, s1, 38400);
-+
-+    /* plane 2 */
-+    MapMask(2);
-+    grub_memcpy(mem, s2, 38400);
-+
-+    /* plane 3 */
-+    MapMask(4);
-+    grub_memcpy(mem, s4, 38400);
-+
-+    /* plane 4 */
-+    MapMask(8);
-+    grub_memcpy(mem, s8, 38400);
-+
-+    MapMask(15);
-+
-+    if (no_cursor) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+    }
-+}
-+
-+void graphics_setcolorstate (color_state state) {
-+    switch (state) {
-+    case COLOR_STATE_STANDARD:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    case COLOR_STATE_NORMAL:
-+        graphics_current_color = graphics_normal_color;
-+        break;
-+    case COLOR_STATE_HIGHLIGHT:
-+        graphics_current_color = graphics_highlight_color;
-+        break;
-+    default:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    }
-+
-+    graphics_color_state = state;
-+}
-+
-+void graphics_setcolor (int normal_color, int highlight_color) {
-+    graphics_normal_color = normal_color;
-+    graphics_highlight_color = highlight_color;
-+
-+    graphics_setcolorstate (graphics_color_state);
-+}
-+
-+int graphics_setcursor (int on) {
-+    if (!no_cursor && !on) {
-+        no_cursor = 1;
-+        unset_int1c_handler();
-+        graphics_cursor(0);
-+    }
-+    else if(no_cursor && on) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+        graphics_cursor(1);
-+    }
-+    return 0;
-+}
-+
-+/* Read in the splashscreen image and set the palette up appropriately.
-+ * Format of splashscreen is an xpm (can be gzipped) with 16 colors and
-+ * 640x480. */
-+int read_image(char *s)
-+{
-+    char buf[32], pal[16], c;
-+    unsigned char base, mask, *s1, *s2, *s4, *s8;
-+    unsigned i, len, idx, colors, x, y, width, height;
-+
-+    if (!grub_open(s))
-+        return 0;
-+
-+    /* read header */
-+    if (!grub_read((char*)&buf, 10) || grub_memcmp(buf, "/* XPM */\n", 10)) {
-+        grub_close();
-+        return 0;
-+    }
-+    
-+    /* parse info */
-+    while (grub_read(&c, 1)) {
-+        if (c == '"')
-+            break;
-+    }
-+
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    i = 0;
-+    width = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            width = width * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    height = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            height = height * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    colors = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            colors = colors * 10 + c - '0';
-+        else
-+            break;
-+    }
-+
-+    base = 0;
-+    while (grub_read(&c, 1) && c != '"')
-+        ;
-+
-+    /* palette */
-+    for (i = 0, idx = 1; i < colors; i++) {
-+        len = 0;
-+
-+        while (grub_read(&c, 1) && c != '"')
-+            ;
-+        grub_read(&c, 1);       /* char */
-+        base = c;
-+        grub_read(buf, 4);      /* \t c # */
-+
-+        while (grub_read(&c, 1) && c != '"') {
-+            if (len < sizeof(buf))
-+                buf[len++] = c;
-+        }
-+
-+        if (len == 6 && idx < 15) {
-+            int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2;
-+            int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2;
-+            int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2;
-+
-+            pal[idx] = base;
-+            graphics_set_palette(idx, r, g, b);
-+            ++idx;
-+        }
-+    }
-+
-+    x = y = len = 0;
-+
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 38400; i++)
-+        s1[i] = s2[i] = s4[i] = s8[i] = 0;
-+
-+    /* parse xpm data */
-+    while (y < height) {


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390088.1630627 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuW9J-0005tl-0G; Thu, 13 Aug 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 1390088.1630627; Thu, 13 Aug 2026 14: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 1wuW9I-0005td-Tj; Thu, 13 Aug 2026 14:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1390088;
 Thu, 13 Aug 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 1wuW9I-0005tX-06
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 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 1wuW9I-002A99-0f
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuW9H-00GmF1-2t
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 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=k+xtFZ9nZWRnWUGIpHWqp1qjzwGROAUEdvBAGdUbneU=; b=pBKsNKwm6vAFore2H/1a5Ceh+E
	2l0zz1iurD8BiTqWk5LNfNLf7eO19/fIC62HxLUY90qj4k7I6rQrNatzFA4gMEmlcW1slnWGMnp5b
	LBAuTBMijIcPEqhGJB4LajFR21/F5ddY7AmYto96lT3/AGg34g6/8nnp+9dlYBdEo5Ws=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] stubdom: remove support for building in 32-bit mode
Message-Id: <E1wuW9H-00GmF1-2t@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:11:11 +0000

commit 56785d6ba6291b1371ec7c57fd5c4436b22ec2a6
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:26 2026 +0200

    stubdom: remove support for building in 32-bit mode
    
    With the removal of grub-pv there is no 32-bit stubdom left.
    
    Remove 32-bit support from the stubdom build system.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 850e8544ca..2698bddc9d 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,15 +31,7 @@ endef
 $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_deps,$(lib))))
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-GNU_TARGET_ARCH:=i686
-endif
 
-ifeq ($(GNU_TARGET_ARCH), i686)
-TARGET_CFLAGS=
-NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
-STUBDOM_SUPPORTED=1
-endif
 ifeq ($(GNU_TARGET_ARCH), x86_64)
 TARGET_CFLAGS=-mno-red-zone
 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
@@ -179,9 +171,6 @@ gmp-$(GMP_VERSION).tar.bz2:
 	$(FETCHER) $@ $(GMP_URL)/$@
 
 .PHONY: cross-gmp
-ifeq ($(XEN_TARGET_ARCH), x86_32)
-   GMPEXT=ABI=32
-endif
 gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
 	tar xjf $<
 	rm $@ -rf || :
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390089.1630632 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuW9T-0005vp-26; Thu, 13 Aug 2026 14:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390089.1630632; Thu, 13 Aug 2026 14: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 1wuW9S-0005vf-V5; Thu, 13 Aug 2026 14:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1390089;
 Thu, 13 Aug 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 1wuW9S-0005vX-2W
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 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 1wuW9S-002A9T-0y
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuW9S-00GmHS-01
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 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=u+PMt4+Vo6csVwGUwXaJyg70KtzTiwZK/8JU3UX4Emc=; b=O1QkE1Kq788GWCP/dCSXVWRLBQ
	BzCgJzAirv3bFO8Ewjmko+RnBgVQvsJfpqMGnG11TZHLxAWUjNabaxrH9r/3hwm/VDMAn/dIaPuYb
	zEjM4/JlqqOLw9UX5D4yyg/5Kz4zPNpOH2wjsh7kNnnsM60Ko6hyPFcLwtfg0ZT336Io=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] stubdom: remove building of libxenguest and libxenctrl
Message-Id: <E1wuW9S-00GmHS-01@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:11:22 +0000

commit 6a94eaa2bf3fa06b05ed2dad3dd9116060235326
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:30 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:31 2026 +0200

    stubdom: remove building of libxenguest and libxenctrl
    
    grub-pv was the last user of the stubdom variants of libxenguest and
    libxenctrl.
    
    Remove both libraries from the stubdom build system.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2698bddc9d..40b6ececf1 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -256,9 +256,7 @@ $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 # libraries under tools/libs
 #######
 
-STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl guest manage
-
-LIBDEP_guest := cross-zlib
+STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel manage
 
 #######
 # common handling
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390090.1630635 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuW9d-0005y2-3C; Thu, 13 Aug 2026 14:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390090.1630635; Thu, 13 Aug 2026 14: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 1wuW9d-0005xu-0D; Thu, 13 Aug 2026 14:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1390090;
 Thu, 13 Aug 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 1wuW9c-0005xo-6D
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 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 1wuW9c-002A9Y-1M
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuW9c-00GmJY-0N
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 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=iXBiigzFPEaSzUc+47oLxky8Ud9VLk2VZU/N8QkG6G0=; b=fTqDV2rA86lMOG9pMVHk/2KT+c
	aE+WC01qRh75VaBKsMYl0OQfXdpVkduCzvfoBxx/btwEWOv0TIlNMVTAt8Z+H5N60CU+dORSsIc8e
	OUtkm3dmkxSlmQPKzpVqVa9YIEBmAP7/qZZBKJ21VWWVO7IBH5NUS1yFkF8IlCmeDiPU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs: remove stale stubdom entries from stubdom.txt
Message-Id: <E1wuW9c-00GmJY-0N@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:11:32 +0000

commit b01e4c0c36d91e05b3610268fb2eb173b48913b5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:36 2026 +0200

    docs: remove stale stubdom entries from stubdom.txt
    
    There are several stubdoms mentioned in docs/misc/stubdom.txt which
    no longer exist. Remove them.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 docs/misc/stubdom.txt | 69 ---------------------------------------------------
 1 file changed, 69 deletions(-)

diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt
index cfcba4ba96..3ee96d5063 100644
--- a/docs/misc/stubdom.txt
+++ b/docs/misc/stubdom.txt
@@ -85,72 +85,3 @@ To change the CD-ROM medium, libxl will:
 
 The stubdom must internally add /dev/xvdc to an fdset in QEMU with opaque set
 to "stub-devid:$devid".  libxl will lookup the fdset with that string.
-
-                                   PV-GRUB
-                                   =======
-
-  This replaces pygrub to boot domU images safely: it runs the regular grub
-inside the created domain itself and uses regular domU facilities to read the
-disk / fetch files from network etc. ; it eventually loads the PV kernel and
-chain-boots it.
-  
-Configuration
-=============
-
-In your PV config,
-
-- use pv-grub.gz as kernel:
-
-kernel = "pv-grub.gz"
-
-- set the path to menu.lst, as seen from the domU, in extra:
-
-extra = "(hd0,0)/boot/grub/menu.lst"
-
-or you can provide the content of a menu.lst stored in dom0 by passing it as a
-ramdisk:
-
-ramdisk = "/boot/domU-1-menu.lst"
-
-or you can also use a tftp path (dhcp will be automatically performed):
-
-extra = "(nd)/somepath/menu.lst"
-
-or you can set it in option 150 of your dhcp server and leave extra and ramdisk
-empty (dhcp will be automatically performed)
-
-Limitations
-===========
-
-- You can not boot a 64bit kernel with a 32bit-compiled PV-GRUB and vice-versa.
-To cross-compile a 32bit PV-GRUB,
-
-export XEN_TARGET_ARCH=x86_32
-
-- bootsplash is supported, but the ioemu backend does not yet support restart
-for use by the booted kernel.
-
-- PV-GRUB doesn't support virtualized partitions. For instance:
-
-disk = [ 'phy:hda7,hda7,w' ]
-
-will be seen by PV-GRUB as (hd0), not (hd0,6), since GRUB will not see any
-partition table.
-
-
-                                Your own stubdom
-                                ================
-
-  By running
-
-cd stubdom/
-make c-stubdom
-
-  or
-
-cd stubdom/
-make caml-stubdom
-
-  you can compile examples of C or caml stub domain kernels.  You can use these
-and the relevant Makefile rules as basis to build your own stub domain kernel.
-Available libraries are libc, libxc, libxs, zlib and libpci.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390091.1630638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuW9n-000608-4H; Thu, 13 Aug 2026 14:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1390091.1630638; Thu, 13 Aug 2026 14: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 1wuW9n-000600-1c; Thu, 13 Aug 2026 14:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1390091;
 Thu, 13 Aug 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 1wuW9m-0005zq-Af
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 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 1wuW9m-002A9g-1n
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuW9m-00GmMK-0q
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 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=n+E7l9+d5nvhj0Wn8WPikKcB64ZplZgSS3iAdSj4qgY=; b=HoIeqTpKZHa2j98CeRWKBH/wSE
	OiAvYH7mDe8OzZyrIEG+FmGc27Hke9u89JrzLFKUGYy8HTqtDmw66BZk3CTn1EmmqR/puvN6A4clN
	eJn9vG/WbEwt0jEbTNaaI/G8dO30/FO0jBLG18agkpfXztTrdNdbqwLzT/eehapysfho=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: reduce dependencies on x86_emulate/x86_emulate.h
Message-Id: <E1wuW9m-00GmMK-0q@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:11:42 +0000

commit 0a249bcb0279a99b7ddad683fcc84a5e256c13f1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Aug 13 15:12:51 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:12:51 2026 +0200

    x86: reduce dependencies on x86_emulate/x86_emulate.h
    
    Split out struct x86_event to an entirely separate header, and move a few
    other items describing the architecture to a new x86-types.h. With a few
    forward decls of structures and with a fair number of new #include-s in
    .c files, the inclusion of x86_emulate.h (and hence
    x86_emulate/x86_emulate.h) can be dropped from all header files except
    hvm/emulate.h; it needs additionally adding to hvm/ioreq.h though.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/Makefile       |  2 +-
 tools/tests/x86_emulator/x86-emulate.h  |  2 +
 xen/arch/x86/emul-i8254.c               |  1 +
 xen/arch/x86/hvm/hpet.c                 |  2 +
 xen/arch/x86/hvm/mmio.c                 |  1 +
 xen/arch/x86/hvm/pmtimer.c              |  2 +
 xen/arch/x86/hvm/rtc.c                  |  9 ++--
 xen/arch/x86/hvm/stdvga.c               |  2 +
 xen/arch/x86/hvm/svm/nestedsvm.c        |  1 +
 xen/arch/x86/hvm/svm/vmcb.h             |  2 +-
 xen/arch/x86/hvm/vioapic.c              |  1 +
 xen/arch/x86/hvm/viridian/private.h     |  2 +
 xen/arch/x86/hvm/vmx/vvmx.c             |  1 +
 xen/arch/x86/hvm/vpic.c                 |  1 +
 xen/arch/x86/include/asm/domain.h       |  3 +-
 xen/arch/x86/include/asm/hvm/hvm.h      |  4 +-
 xen/arch/x86/include/asm/hvm/ioreq.h    |  2 +
 xen/arch/x86/include/asm/hvm/vcpu.h     |  2 +
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  2 +
 xen/arch/x86/include/asm/mce.h          |  1 +
 xen/arch/x86/include/asm/mm.h           |  1 -
 xen/arch/x86/include/asm/x86-event.h    | 31 ++++++++++++++
 xen/arch/x86/include/asm/x86-types.h    | 76 +++++++++++++++++++++++++++++++++
 xen/arch/x86/msr.c                      |  1 +
 xen/arch/x86/pv/misc-hypercalls.c       |  1 +
 xen/arch/x86/x86_emulate/x86_emulate.h  | 76 +++------------------------------
 xen/drivers/vpci/msix.c                 |  1 +
 27 files changed, 151 insertions(+), 79 deletions(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 8210e83345..ff85bc88b1 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -305,7 +305,7 @@ $(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-integrated-as)
 HOSTCFLAGS += $(CFLAGS_xeninclude) -I. $(HOSTCFLAGS-$(XEN_COMPILE_ARCH))
 
 x86.h := $(addprefix $(XEN_ROOT)/tools/include/xen/asm/,\
-                     x86-vendors.h x86-defns.h msr-index.h) \
+                     x86-vendors.h x86-defns.h x86-types.h x86-event.h msr-index.h) \
          $(addprefix $(XEN_ROOT)/tools/include/xen/lib/x86/, \
                      cpu-policy.h cpuid-autogen.h)
 x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h $(x86.h)
diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h
index 62ebd881c9..bcb012f155 100644
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -38,6 +38,8 @@
 
 #include <xen/asm/msr-index.h>
 #include <xen/asm/x86-defns.h>
+#include <xen/asm/x86-event.h>
+#include <xen/asm/x86-types.h>
 #include <xen/asm/x86-vendors.h>
 
 #include <xen-tools/common-macros.h>
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index ceb0ef721e..012a40fa75 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -37,6 +37,7 @@
 #include <asm/hvm/save.h>
 #include <asm/hvm/vpt.h>
 #include <asm/time.h>
+#include <asm/x86_emulate.h>
 
 #define domain_vpit(x) (&(x)->arch.vpit)
 #define vcpu_vpit(x)   (domain_vpit((x)->domain))
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index e317ec1f5f..bdd6fa334d 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -11,6 +11,8 @@
 #include <asm/current.h>
 #include <asm/hpet.h>
 #include <asm/mc146818rtc.h>
+#include <asm/x86_emulate.h>
+
 #include <xen/sched.h>
 #include <xen/event.h>
 #include <xen/trace.h>
diff --git a/xen/arch/x86/hvm/mmio.c b/xen/arch/x86/hvm/mmio.c
index 0fc492f854..0c98eb380e 100644
--- a/xen/arch/x86/hvm/mmio.c
+++ b/xen/arch/x86/hvm/mmio.c
@@ -9,6 +9,7 @@
 #include <xen/mm.h>
 
 #include <asm/p2m.h>
+#include <asm/x86_emulate.h>
 
 static int cf_check subpage_mmio_accept(struct vcpu *v, unsigned long addr)
 {
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 87a7a01c9f..7247043269 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -11,6 +11,8 @@
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
 #include <asm/acpi.h> /* for hvm_acpi_power_button prototype */
+#include <asm/x86_emulate.h>
+
 #include <public/hvm/params.h>
 
 /* Slightly more readable port I/O addresses for the registers we intercept */
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 9895dd570c..9a53188dac 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -23,12 +23,15 @@
  */
 
 #include <xen/sched.h>
-#include <asm/mc146818rtc.h>
-#include <asm/hvm/vpt.h>
+#include <xen/trace.h>
+
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
+#include <asm/hvm/vpt.h>
 #include <asm/iocap.h>
-#include <xen/trace.h>
+#include <asm/mc146818rtc.h>
+#include <asm/x86_emulate.h>
+
 #include <public/hvm/params.h>
 
 #define USEC_PER_SEC    1000000UL
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index c3c43f59ee..fa426ab8a6 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -34,6 +34,8 @@
 #include <xen/numa.h>
 #include <xen/paging.h>
 
+#include <asm/x86_emulate.h>
+
 #define VGA_MEM_BASE 0xa0000
 #define VGA_MEM_SIZE 0x20000
 
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index b06124c2c9..91c9060720 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -11,6 +11,7 @@
 #include <asm/paging.h> /* paging_mode_hap */
 #include <asm/event.h> /* for local_event_delivery_(en|dis)able */
 #include <asm/p2m.h> /* p2m_get_pagetable, p2m_get_nestedp2m */
+#include <asm/x86_emulate.h>
 
 #include "nestedhvm.h"
 #include "svm.h"
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 13ccfd3ff9..3760f71a86 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -4,7 +4,7 @@
 
 #include <xen/types.h>
 
-#include <asm/x86_emulate.h>
+#include <asm/x86-types.h>
 
 struct vcpu;
 
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 7c725f9e47..222e59e2c2 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -38,6 +38,7 @@
 #include <asm/current.h>
 #include <asm/event.h>
 #include <asm/io_apic.h>
+#include <asm/x86_emulate.h>
 
 /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */
 #define IRQ0_SPECIAL_ROUTING 1
diff --git a/xen/arch/x86/hvm/viridian/private.h b/xen/arch/x86/hvm/viridian/private.h
index 1bf65c761c..8060ce0677 100644
--- a/xen/arch/x86/hvm/viridian/private.h
+++ b/xen/arch/x86/hvm/viridian/private.h
@@ -5,6 +5,8 @@
 
 #include <asm/hvm/save.h>
 #include <asm/hvm/viridian.h>
+#include <asm/x86_emulate.h>
+
 #include <public/hvm/params.h>
 
 int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val);
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e4cdfe55c1..a5aa5eb163 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -18,6 +18,7 @@
 #include <asm/msr.h>
 #include <asm/mtrr.h>
 #include <asm/p2m.h>
+#include <asm/x86_emulate.h>
 
 static DEFINE_PER_CPU(u64 *, vvmcs_buf);
 
diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 30ce367c08..97698da768 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -33,6 +33,7 @@
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
+#include <asm/x86_emulate.h>
 
 #define vpic_domain(v) (container_of((v), struct domain, \
                                      arch.hvm.vpic[!(v)->is_master]))
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index e0ce8b4c39..50c048adb5 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -8,7 +8,8 @@
 #include <asm/e820.h>
 #include <asm/mce.h>
 #include <asm/vpmu.h>
-#include <asm/x86_emulate.h>
+#include <asm/x86-types.h>
+
 #include <public/vcpu.h>
 #include <public/hvm/hvm_info_table.h>
 
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index e7c1364802..0ce7d5d783 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -16,11 +16,13 @@
 #include <asm/current.h>
 #include <asm/hvm/asid.h>
 #include <asm/msr-index.h>
-#include <asm/x86_emulate.h>
+#include <asm/x86-event.h>
+#include <asm/x86-types.h>
 
 struct pirq; /* needed by pi_update_irte */
 struct hvm_hw_cpu;
 struct xen_domctl_createdomain;
+struct x86_event;
 
 #ifdef CONFIG_HVM_FEP
 /* Permit use of the Forced Emulation Prefix in HVM guests */
diff --git a/xen/arch/x86/include/asm/hvm/ioreq.h b/xen/arch/x86/include/asm/hvm/ioreq.h
index 84be14fd08..9f418c86e1 100644
--- a/xen/arch/x86/include/asm/hvm/ioreq.h
+++ b/xen/arch/x86/include/asm/hvm/ioreq.h
@@ -8,6 +8,8 @@
 #ifndef __ASM_X86_HVM_IOREQ_H__
 #define __ASM_X86_HVM_IOREQ_H__
 
+#include <asm/x86_emulate.h>
+
 /* This correlation must not be altered */
 #define IOREQ_STATUS_HANDLED     X86EMUL_OKAY
 #define IOREQ_STATUS_UNHANDLED   X86EMUL_UNHANDLEABLE
diff --git a/xen/arch/x86/include/asm/hvm/vcpu.h b/xen/arch/x86/include/asm/hvm/vcpu.h
index 2a14fa0a63..60d1c8f188 100644
--- a/xen/arch/x86/include/asm/hvm/vcpu.h
+++ b/xen/arch/x86/include/asm/hvm/vcpu.h
@@ -14,6 +14,8 @@
 #include <asm/hvm/vmx/vvmx.h>
 #include <asm/hvm/svm-types.h>
 #include <asm/mtrr.h>
+#include <asm/x86-event.h>
+
 #include <public/hvm/ioreq.h>
 
 struct hvm_vcpu_asid {
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index 88bded5190..f85a8c8bba 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -9,6 +9,8 @@
 
 #include <xen/mm.h>
 
+#include <asm/x86-types.h>
+
 extern void vmcs_dump_vcpu(struct vcpu *v);
 extern int vmx_vmcs_init(void);
 int cf_check vmx_cpu_up_prepare(unsigned int cpu);
diff --git a/xen/arch/x86/include/asm/mce.h b/xen/arch/x86/include/asm/mce.h
index 2ec47a71ae..65d8a27eca 100644
--- a/xen/arch/x86/include/asm/mce.h
+++ b/xen/arch/x86/include/asm/mce.h
@@ -35,6 +35,7 @@ struct vmce {
 
 struct domain;
 struct vcpu;
+struct hvm_vmce_vcpu;
 
 /* Guest vMCE MSRs virtualization */
 extern void vmce_init_vcpu(struct vcpu *v);
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 06c20ab8de..2254a7e3fe 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -8,7 +8,6 @@
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/uaccess.h>
-#include <asm/x86_emulate.h>
 
 /*
  * Per-page-frame information.
diff --git a/xen/arch/x86/include/asm/x86-event.h b/xen/arch/x86/include/asm/x86-event.h
new file mode 100644
index 0000000000..a8823c7cfc
--- /dev/null
+++ b/xen/arch/x86/include/asm/x86-event.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * x86-event.h
+ *
+ * Helper definitions for event handling, which aren't prescribed by the
+ * architecture itself.
+ */
+
+#ifndef X86_X86_EVENT_H
+#define X86_X86_EVENT_H
+
+#ifdef __XEN__
+# include <xen/types.h>
+#else
+# include <stdint.h>
+#endif
+
+#define X86_EVENT_NO_EC (-1)        /* No error code. */
+
+struct x86_event {
+    int16_t       vector;
+    uint8_t       type;         /* X86_ET_* */
+    uint8_t       insn_len;     /* Instruction length */
+    int32_t       error_code;   /* X86_EVENT_NO_EC if n/a */
+    union {
+        unsigned long cr2;         /* #PF */
+        unsigned long pending_dbg; /* #DB (new DR6 bits, positive polarity) */
+    };
+};
+
+#endif /* X86_X86_EVENT_H */
diff --git a/xen/arch/x86/include/asm/x86-types.h b/xen/arch/x86/include/asm/x86-types.h
new file mode 100644
index 0000000000..1c43421885
--- /dev/null
+++ b/xen/arch/x86/include/asm/x86-types.h
@@ -0,0 +1,76 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * x86-types.h
+ *
+ * Type definitions and basic helpers which are more or less directly
+ * describing aspects of the architecture.
+ */
+
+#ifndef X86_X86_TYPES_H
+#define X86_X86_TYPES_H
+
+#ifdef __XEN__
+# include <xen/types.h>
+#else
+# include <stdint.h>
+#endif
+
+/*
+ * Comprehensive enumeration of x86 segment registers.  Various bits of code
+ * rely on this order (general purpose before system, tr at the beginning of
+ * system).
+ */
+enum x86_segment {
+    /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
+    x86_seg_es,
+    x86_seg_cs,
+    x86_seg_ss,
+    x86_seg_ds,
+    x86_seg_fs,
+    x86_seg_gs,
+    /* System: Valid to use for implicit table references. */
+    x86_seg_tr,
+    x86_seg_ldtr,
+    x86_seg_gdtr,
+    x86_seg_idtr,
+    /* No Segment: For (system/normal) accesses which are already linear. */
+    x86_seg_sys,
+    x86_seg_none
+};
+
+static inline bool is_x86_user_segment(enum x86_segment seg)
+{
+    unsigned int idx = seg;
+
+    return idx <= x86_seg_gs;
+}
+static inline bool is_x86_system_segment(enum x86_segment seg)
+{
+    return seg >= x86_seg_tr && seg < x86_seg_none;
+}
+
+/*
+ * Full state of a segment register (visible and hidden portions).
+ * Chosen to match the format of an AMD SVM VMCB.
+ */
+struct segment_register {
+    uint16_t   sel;
+    union {
+        uint16_t attr;
+        struct {
+            uint16_t type:4;
+            uint16_t s:   1;
+            uint16_t dpl: 2;
+            uint16_t p:   1;
+            uint16_t avl: 1;
+            uint16_t l:   1;
+            uint16_t db:  1;
+            uint16_t g:   1;
+            uint16_t pad: 4;
+        };
+    };
+    uint32_t   limit;
+    uint64_t   base;
+};
+
+#endif	/* X86_X86_TYPES_H */
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index d10891dcfc..e9fa02a03f 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -22,6 +22,7 @@
 #include <asm/p2m.h>
 #include <asm/pv/domain.h>
 #include <asm/setup.h>
+#include <asm/x86_emulate.h>
 #include <asm/xstate.h>
 
 #include <public/hvm/params.h>
diff --git a/xen/arch/x86/pv/misc-hypercalls.c b/xen/arch/x86/pv/misc-hypercalls.c
index 34a0717540..b1fa9685f4 100644
--- a/xen/arch/x86/pv/misc-hypercalls.c
+++ b/xen/arch/x86/pv/misc-hypercalls.c
@@ -12,6 +12,7 @@
 #include <asm/debugreg.h>
 #include <asm/fsgsbase.h>
 #include <asm/traps.h>
+#include <asm/x86_emulate.h>
 
 long do_set_debugreg(int reg, unsigned long value)
 {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 0fd20747dc..534b1c46fa 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -13,6 +13,11 @@
 
 #include <xen/lib/x86/cpu-policy.h>
 
+#ifdef __XEN__
+# include <asm/x86-event.h>
+# include <asm/x86-types.h>
+#endif
+
 #define MAX_INST_LEN 15
 
 #if defined(__i386__)
@@ -25,77 +30,6 @@
 
 struct x86_emulate_ctxt;
 
-/*
- * Comprehensive enumeration of x86 segment registers.  Various bits of code
- * rely on this order (general purpose before system, tr at the beginning of
- * system).
- */
-enum x86_segment {
-    /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
-    x86_seg_es,
-    x86_seg_cs,
-    x86_seg_ss,
-    x86_seg_ds,
-    x86_seg_fs,
-    x86_seg_gs,
-    /* System: Valid to use for implicit table references. */
-    x86_seg_tr,
-    x86_seg_ldtr,
-    x86_seg_gdtr,
-    x86_seg_idtr,
-    /* No Segment: For (system/normal) accesses which are already linear. */
-    x86_seg_sys,
-    x86_seg_none
-};
-
-static inline bool is_x86_user_segment(enum x86_segment seg)
-{
-    unsigned int idx = seg;
-
-    return idx <= x86_seg_gs;
-}
-static inline bool is_x86_system_segment(enum x86_segment seg)
-{
-    return seg >= x86_seg_tr && seg < x86_seg_none;
-}
-
-#define X86_EVENT_NO_EC (-1)        /* No error code. */
-
-struct x86_event {
-    int16_t       vector;
-    uint8_t       type;         /* X86_ET_* */
-    uint8_t       insn_len;     /* Instruction length */
-    int32_t       error_code;   /* X86_EVENT_NO_EC if n/a */
-    union {
-        unsigned long cr2;         /* #PF */
-        unsigned long pending_dbg; /* #DB (new DR6 bits, positive polarity) */
-    };
-};
-
-/*
- * Full state of a segment register (visible and hidden portions).
- * Chosen to match the format of an AMD SVM VMCB.
- */
-struct segment_register {
-    uint16_t   sel;
-    union {
-        uint16_t attr;
-        struct {
-            uint16_t type:4;
-            uint16_t s:   1;
-            uint16_t dpl: 2;
-            uint16_t p:   1;
-            uint16_t avl: 1;
-            uint16_t l:   1;
-            uint16_t db:  1;
-            uint16_t g:   1;
-            uint16_t pad: 4;
-        };
-    };
-    uint32_t   limit;
-    uint64_t   base;
-};
-
 struct x86_emul_fpu_aux {
     unsigned long ip, dp;
     uint16_t cs, ds;
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index bbe4f213ac..1f93a862da 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -25,6 +25,7 @@
 
 #include <asm/msi.h>
 #include <asm/p2m.h>
+#include <asm/x86_emulate.h>
 
 #define VMSIX_ADDR_IN_RANGE(addr, vpci, nr)                               \
     ((addr) >= vmsix_table_addr(vpci, nr) &&                              \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390147.1630683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuWpj-0006xR-2X; Thu, 13 Aug 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 1390147.1630683; Thu, 13 Aug 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 1wuWpi-0006xK-VT; Thu, 13 Aug 2026 14:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1390147;
 Thu, 13 Aug 2026 14:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wuWpi-0006x3-2d
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 2026 14:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuWpi-002B3H-0j
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuWph-00Gywc-2y
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 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=BSsf1Xu68yMUi/MR5gJGmLuULellm3y7jsf4/NXEBpY=; b=qClj8bNtvHNN49hMJwn3Q/V/GC
	WS47mePQ7GBoiZCg54ErlsNFFKRvlx7+fP2KLg/t6f9LarQ/OBtxz8Oukdc1sz5v7KtVbxnIUJyDd
	9KEFS3u0NGL6jTQzBPcjC4AmeOkKrxMzrDnXDN7yZuWQ2Gogj/XCb3IeAbqN2KQyasZk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] stubdom: remove support for grub-pv
Message-Id: <E1wuWph-00Gywc-2y@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:55:01 +0000

commit 0724c68d85b3e7db5345bcbe151577a498968aa1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:28 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:20 2026 +0200

    stubdom: remove support for grub-pv
    
    The Mini-OS based grub-pv is not being built by default since Xen 4.16.
    Additionally it can be replaced in most cases by the more modern pvgrub
    (part of grub upstream), while grub-pv is based on legacy grub 0.97.
    
    In case someone is really depending on grub-pv, an old build from a
    previous Xen version can be used without any problem, as only stable
    hypercall interfaces are used by it.
    
    Remove grub-pv from the build system.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 Makefile                                       |    6 -
 config/Stubdom.mk.in                           |    3 -
 stubdom/.gitignore                             |    1 -
 stubdom/Makefile                               |   54 -
 stubdom/configure                              |   65 -
 stubdom/configure.ac                           |    2 -
 stubdom/grub.patches/00cvs                     | 1022 -------
 stubdom/grub.patches/10graphics.diff           | 2297 ----------------
 stubdom/grub.patches/11graphics-keyboard.diff  |   13 -
 stubdom/grub.patches/20print_func.diff         |   52 -
 stubdom/grub.patches/30savedefault.diff        |  186 --
 stubdom/grub.patches/40ext3_256byte_inode.diff |  114 -
 stubdom/grub.patches/50fs_fulldisk.diff        |   72 -
 stubdom/grub.patches/60ext4.diff               |  474 ----
 stubdom/grub.patches/61btrfs.diff              | 3499 ------------------------
 stubdom/grub.patches/70compiler_warnings.diff  |   45 -
 stubdom/grub.patches/99minios                  | 1570 -----------
 stubdom/grub/Makefile                          |   88 -
 stubdom/grub/boot-x86_32.S                     |  112 -
 stubdom/grub/boot-x86_64.S                     |  108 -
 stubdom/grub/config.h                          |   12 -
 stubdom/grub/kexec.c                           |  434 ---
 stubdom/grub/mini-os.c                         |  771 ------
 stubdom/grub/mini-os.h                         |    7 -
 stubdom/grub/minios.cfg                        |    4 -
 stubdom/grub/osdep.h                           |   30 -
 26 files changed, 11041 deletions(-)

diff --git a/Makefile b/Makefile
index 67b71ac3d4..ea432e21b0 100644
--- a/Makefile
+++ b/Makefile
@@ -71,9 +71,6 @@ build-tools-oxenstored: build-tools-public-headers
 .PHONY: build-stubdom
 build-stubdom: mini-os-dir build-tools-public-headers
 	$(MAKE) -C stubdom build
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub-if-enabled
-endif
 
 define do-subtree
 $(1)/%: FORCE
@@ -149,9 +146,6 @@ install-tools: install-tools-public-headers
 .PHONY: install-stubdom
 install-stubdom: mini-os-dir install-tools-public-headers
 	$(MAKE) -C stubdom install
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub-if-enabled
-endif
 
 .PHONY: tools/firmware/seabios-dir-force-update
 tools/firmware/seabios-dir-force-update:
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index b399d77740..0d70d03941 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -23,9 +23,6 @@ NEWLIB_URL          := @NEWLIB_URL@
 LWIP_VERSION        := @LWIP_VERSION@
 LWIP_URL            := @LWIP_URL@
 
-GRUB_VERSION        := @GRUB_VERSION@
-GRUB_URL            := @GRUB_URL@
-
 GMP_VERSION         := @GMP_VERSION@
 GMP_URL             := @GMP_URL@
 
diff --git a/stubdom/.gitignore b/stubdom/.gitignore
index 1b69656d45..08f2e9b432 100644
--- a/stubdom/.gitignore
+++ b/stubdom/.gitignore
@@ -9,7 +9,6 @@
 /cross-root-*
 /gcc-*
 /gmp-*
-/grub-*
 /include
 /libs-*
 /libxencall-*
diff --git a/stubdom/Makefile b/stubdom/Makefile
index acd5e56f16..850e8544ca 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -361,32 +361,6 @@ vtpmmgr-minios-config.mk: $(CURDIR)/vtpmmgr/minios.cfg
 vtpmmgr: cross-polarssl vtpmmgr-minios-config.mk
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat vtpmmgr-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
-######
-# Grub
-######
-
-grub-$(GRUB_VERSION).tar.gz:
-	$(FETCHER) $@ $(GRUB_URL)/$@
-
-grub-upstream: grub-$(GRUB_VERSION).tar.gz
-	tar xzf $<
-	mv grub-$(GRUB_VERSION) $@
-	for i in grub.patches/* ; do \
-		patch -d $@ -p1 < $$i || exit 1; \
-	done
-
-grub/minios.gen.cfg: APP_LIBS = guest ctrl toollog
-grub/minios.gen.cfg: grub/minios.cfg Makefile
-	$(GEN_config) >$@
-
-grub-$(XEN_TARGET_ARCH)-minios-config.mk: grub/minios.gen.cfg
-	MINIOS_CONFIG="$(CURDIR)/$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
-
-.PHONY: grub
-grub: cross-polarssl grub-upstream $(CROSS_ROOT) grub-$(XEN_TARGET_ARCH)-minios-config.mk
-	mkdir -p grub-$(XEN_TARGET_ARCH)
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat grub-$(XEN_TARGET_ARCH)-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
-
 ##########
 # xenstore
 ##########
@@ -429,17 +403,6 @@ vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
 vtpmmgr-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm -lpolarssl"
 
-.PHONY: pv-grub
-pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxenguest grub
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.gen.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
-
-.PHONY: pv-grub-if-enabled
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-pv-grub-if-enabled: pv-grub
-else
-pv-grub-if-enabled:
-endif
-
 XENSTORE_DEPS := libxenevtchn libxengnttab libxenmanage
 
 .PHONY: xenstore-stubdom
@@ -460,16 +423,6 @@ else
 install:
 endif
 
-install-grub: pv-grub
-	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
-	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
-
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-install-grub-if-enabled: install-grub
-else
-install-grub-if-enabled:
-endif
-
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
@@ -500,9 +453,6 @@ else
 uninstall:
 endif
 
-uninstall-grub:
-	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz
-
 uninstall-xenstore:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz
 
@@ -523,14 +473,12 @@ uninstall-vtpmmgr:
 .PHONY: clean
 clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib))
 clean:
-	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) -C vtpm clean
 	$(MAKE) -C vtpmmgr clean
-	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f *-minios-config.mk
 	rm -f *.gen.cfg
 	rm -fr pkg-config
@@ -559,7 +507,6 @@ patchclean: crossclean
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
-	rm -fr grub-upstream
 
 # clean downloads
 .PHONY: downloadclean
@@ -569,7 +516,6 @@ downloadclean: patchclean
 	rm -f gmp-$(GMP_VERSION).tar.bz2
 	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
-	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
 
diff --git a/stubdom/configure b/stubdom/configure
index 8a0a798bd2..689ff4d6ed 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -630,8 +630,6 @@ POLARSSL_VERSION
 POLARSSL_URL
 GMP_VERSION
 GMP_URL
-GRUB_VERSION
-GRUB_URL
 LWIP_VERSION
 LWIP_URL
 NEWLIB_VERSION
@@ -660,7 +658,6 @@ extfiles
 debug
 xenstorepvh
 xenstore
-grub
 host_os
 host_vendor
 host_cpu
@@ -711,7 +708,6 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_pv_grub
 enable_xenstore_stubdom
 enable_xenstorepvh_stubdom
 enable_vtpm_stubdom
@@ -732,7 +728,6 @@ ZLIB_URL
 LIBPCI_URL
 NEWLIB_URL
 LWIP_URL
-GRUB_URL
 GMP_URL
 POLARSSL_URL
 TPMEMU_URL'
@@ -1358,7 +1353,6 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-pv-grub        Build and install pv-grub (default is DISABLED)
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
                           ENABLED)
@@ -1385,7 +1379,6 @@ Some influential environment variables:
   LIBPCI_URL  Download url for libpci
   NEWLIB_URL  Download url for newlib
   LWIP_URL    Download url for lwip
-  GRUB_URL    Download url for grub
   GMP_URL     Download url for libgmp
   POLARSSL_URL
               Download url for polarssl
@@ -2403,47 +2396,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 # Enable/disable stub domains
 
-# Check whether --enable-pv-grub was given.
-if test ${enable_pv_grub+y}
-then :
-  enableval=$enable_pv_grub;
-
-if test "x$enableval" = "xyes"
-then :
-
-
-grub=y
-STUBDOM_TARGETS="$STUBDOM_TARGETS grub"
-STUBDOM_BUILD="$STUBDOM_BUILD pv-grub"
-STUBDOM_INSTALL="$STUBDOM_INSTALL install-grub"
-STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-grub"
-
-
-else $as_nop
-
-if test "x$enableval" = "xno"
-then :
-
-
-grub=n
-
-
-fi
-
-fi
-
-
-else $as_nop
-
-
-grub=n
-
-
-fi
-
-
-
-
 # Check whether --enable-xenstore-stubdom was given.
 if test ${enable_xenstore_stubdom+y}
 then :
@@ -4137,23 +4089,6 @@ LWIP_VERSION="1.3.0"
 
 
 
-if test "x$GRUB_URL" = "x"
-then :
-
-	if test "x$extfiles" = "xy"
-then :
-  GRUB_URL=\$\(XEN_EXTFILES_URL\)
-else $as_nop
-  GRUB_URL="https://alpha.gnu.org/gnu/grub"
-fi
-
-fi
-GRUB_VERSION="0.97"
-
-
-
-
-
 if test "x$GMP_URL" = "x"
 then :
 
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 33f170144e..6ff3ab0ee9 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -18,7 +18,6 @@ m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
-AX_STUBDOM_DEFAULT_DISABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
 AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
 AX_STUBDOM_CONDITIONAL([vtpm-stubdom], [vtpm])
@@ -43,7 +42,6 @@ AX_STUBDOM_LIB([ZLIB], [zlib], [1.2.3])
 AX_STUBDOM_LIB([LIBPCI], [libpci], [2.2.9], [https://mirrors.edge.kernel.org/pub/software/utils/pciutils])
 AX_STUBDOM_LIB([NEWLIB], [newlib], [1.16.0], [https://sourceware.org/ftp/newlib])
 AX_STUBDOM_LIB([LWIP], [lwip], [1.3.0], [https://download.savannah.gnu.org/releases/lwip])
-AX_STUBDOM_LIB([GRUB], [grub], [0.97], [https://alpha.gnu.org/gnu/grub])
 AX_STUBDOM_LIB([GMP], [libgmp], [4.3.2], [https://gmplib.org/download/gmp/archive])
 AX_STUBDOM_LIB([POLARSSL], [polarssl], [1.1.4])
 AX_STUBDOM_LIB([TPMEMU], [berlios tpm emulator], [0.7.4])
diff --git a/stubdom/grub.patches/00cvs b/stubdom/grub.patches/00cvs
deleted file mode 100644
index 47d66f3a3b..0000000000
--- a/stubdom/grub.patches/00cvs
+++ /dev/null
@@ -1,1022 +0,0 @@
-diff -uprN grub-0.97/acinclude.m4 grub/acinclude.m4
---- grub-0.97/acinclude.m4	2004-04-27 21:48:06.000000000 +0100
-+++ grub/acinclude.m4	2007-11-05 01:29:46.000000000 +0000
-@@ -57,7 +57,7 @@ else
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-+  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-   else
-     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
-   fi
-diff -uprN grub-0.97/ChangeLog grub/ChangeLog
---- grub-0.97/ChangeLog	2005-05-08 03:47:02.000000000 +0100
-+++ grub/ChangeLog	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,127 @@
-+2008-05-20  Robert Millan  <rmh@aybabtu.com>
-+
-+	* netboot/cs89x0.c: Fix license violation.
-+	* netboot/cs89x0.h: Likewise.
-+
-+2008-04-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Always use "_cv_" in cache variables for
-+	compatibility with Autoconf 2.62.
-+
-+2008-03-28  Robert Millan  <rmh@aybabtu.com>
-+
-+	Surpass 1 TiB disk addressing limit.  Note: there are no plans to handle
-+	the 2 TiB disk limit in GRUB Legacy, since that would need considerable
-+	rework.  If you have >2TiB disks, use GRUB 2 instead.
-+
-+	* grub/asmstub.c (biosdisk): Add unsigned qualifier to `sector'.
-+	* stage2/bios.c (biosdisk): Likewise.
-+	* stage2/disk_io.c (rawread, devread, rawwrite, devwrite): Likewise.
-+	* stage2/shared.h (rawread, devread, rawwrite, devwrite): Likewise.
-+	* lib/device.c (get_drive_geometry): Replace BLKGETSIZE with
-+	BLKGETSIZE64.
-+
-+2007-10-29  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Test if '--build-id=none' is supported by the
-+	linker and add it to LDFLAGS if possible.  Build ID causes
-+	objcopy to generate huge binary files.
-+	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
-+	linking, so that build ID doesn't break the test.
-+	* stage1/Makefile.am: Preserve LDFLAGS, use stage1_exec_LDFLAGS.
-+
-+2007-02-22  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/iso9660.h: Remove unnecessary packed attributes.
-+
-+2007-02-22  Robert Millan  <rmh@aybabtu.com>
-+
-+	* util/mkbimage: Update my email address, and remove my name from
-+	some places where unnecessary credit is given.
-+
-+2006-09-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/natsemi.c: Fix compile error with gcc 4.1.1.  Cast
-+	cannot make a variable volatile - it should be declared as such.
-+	* netboot/sis900.c: Likewise.
-+
-+2006-09-08  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/etherboot.h: Remove incorrect extern declarations of
-+	the variables later declared static.  Move BOOTP_DATA_ADDR ...
-+	* netboot/main.c: ... here.  Eliminate end_of_rfc1533 - it's
-+	write-only.
-+
-+2006-06-24  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/grub.texi: Changed the license term to the GNU Free
-+	Documentation License 1.2.
-+
-+	* docs/multiboot.texi: Reformatted to show the license term
-+	and the version number explicitly.
-+	
-+	* docs/fdl.texi: New file.
-+	
-+	* docs/Makefile.am (grub_TEXINFOS): Added fdl.texi.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (write_to_partition): /dev/ataraid/ and /dev/rd/
-+	partitions have a "p" prefix.  Add it.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (get_i2o_disk_name): New function.
-+	(init_device_map) [__linux__]: Add support for I2O devices.
-+
-+2006-05-02  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/stage2.c (run_menu): Fix "savedefault" to save only top
-+	level menu positions.  Remember current position when calling a
-+	submenu.  Don't recalculate it when booting from a submenu.
-+
-+	* grub/main.c (main): Make sure the boot drive number doesn't
-+	exceed 255.
-+
-+2006-05-02  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+	* stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2
-+	to GRUB Legacy.  Problem reported by Gerardo Richarte.
-+
-+2006-04-23  Robert Millan  <robertmh@gnu.org>
-+
-+	* grub/asmstub.c (get_diskinfo): Optimize sysctl routine.
-+
-+2006-04-20  Robert Millan  <robertmh@gnu.org>
-+
-+	Fixes for kernel of FreeBSD:
-+	* grub/asmstub.c (get_diskinfo): Toggle "kern.geom.debugflags" sysctl
-+	before opening a device for writing.
-+	* util/grub-install.in: Devices don't have this "r" prefix anymore.
-+
-+2006-04-16  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Correct the offset of address
-+	fields. Reported by Jeroen Dekkers.
-+
-+2006-03-21  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/builtins.c (setup_func): Specify the size of DEVICE to
-+	grub_strncat instead of a strange number 256. Reported by Vitaly
-+	Fertman <vitaly@namesys.com>.
-+
-+2005-09-29  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Fix a bug in the byte order of
-+	boot_device. I hope this won't affect any OS image.
-+	Increased the version number to 0.6.94.
-+
-+2005-09-28  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/boot.c (load_image): Even if an OS image is an ELF
-+	object, use the a.out kludge if MULTIBOOT_AOUT_KLUDGE is
-+	specified.
-+
- 2005-05-08  Yoshinori K. Okuji  <okuji@enbug.org>
- 
- 	* configure.ac (AC_INIT): Upgraded to 0.97.
-diff -uprN grub-0.97/configure grub/configure
---- grub-0.97/configure	2005-05-08 03:48:12.000000000 +0100
-+++ grub/configure	2007-11-05 01:29:46.000000000 +0000
-@@ -3694,6 +3694,64 @@ if test "x$undef_flag" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+echo "$as_me:$LINENO: checking whether linker accepts \`--build-id=none'" >&5
-+echo $ECHO_N "checking whether linker accepts \`--build-id=none'... $ECHO_C" >&6
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"
-+			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  build_id_flag=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+build_id_flag=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $build_id_flag" >&5
-+echo "${ECHO_T}$build_id_flag" >&6
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
-   # Extract the first word of "objcopy", so it can be a program name with args.
- set dummy objcopy; ac_word=$2
-@@ -3892,7 +3950,7 @@ echo "$as_me: error: ${CC-cc} cannot com
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-+  if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-diff -uprN grub-0.97/configure.ac grub/configure.ac
---- grub-0.97/configure.ac	2005-05-08 03:36:03.000000000 +0100
-+++ grub/configure.ac	2008-04-10 23:26:50.000000000 +0100
-@@ -86,13 +86,13 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     fi
-     STAGE1_CFLAGS="-O2"
-     GRUB_CFLAGS="-O2"
--    AC_CACHE_CHECK([whether optimization for size works], size_flag, [
-+    AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-Os -g"
--      AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
-+      AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$size_flag" = xyes; then
-+    if test "x$grub_cv_cc_Os" = xyes; then
-       STAGE2_CFLAGS="-Os"
-     else
-       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
-@@ -100,16 +100,16 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     # OpenBSD has a GCC extension for protecting applications from
-     # stack smashing attacks, but GRUB doesn't want this feature.
-     AC_CACHE_CHECK([whether gcc has -fno-stack-protector],
--		   no_stack_protector_flag, [
-+		   grub_cv_cc_no_stack_protector, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-fno-stack-protector"
-       AC_TRY_COMPILE(,
- 		     ,
--		     no_stack_protector_flag=yes,
--		     no_stack_protector_flag=no)
-+		     grub_cv_cc_no_stack_protector=yes,
-+		     grub_cv_cc_no_stack_protector=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$no_stack_protector_flag" = xyes; then
-+    if test "x$grub_cv_cc_no_stack_protector" = xyes; then
-       STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
-     fi
-   fi
-@@ -123,33 +123,44 @@ AC_SUBST(GRUB_CFLAGS)
- CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
- CPPFLAGS="$CPPFLAGS -Wpointer-arith"
- 
--AC_CACHE_CHECK([whether -Wundef works], undef_flag, [
-+AC_CACHE_CHECK([whether -Wundef works], grub_cv_cc_Wundef, [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-Wundef"
--  AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no)
-+  AC_TRY_COMPILE(, , grub_cv_cc_Wundef=yes, grub_cv_cc_Wundef=no)
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # The options `-falign-*' are supported by gcc 3.0 or later.
- # Probably it is sufficient to only check for -falign-loops.
--AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
-+AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-falign-loops=1"
--  AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
-+  AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no])
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # Force no alignment to save space.
--if test "x$falign_loop_flag" = xyes; then
-+if test "x$grub_cv_cc_falign_loop" = xyes; then
-   CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
- else
-   CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
- fi
- 
--if test "x$undef_flag" = xyes; then
-+if test "x$grub_cv_cc_Wundef" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
-+AC_MSG_RESULT([$build_id_flag])
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
- dnl  AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-   AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-diff -uprN grub-0.97/grub/asmstub.c grub/grub/asmstub.c
---- grub-0.97/grub/asmstub.c	2005-02-16 20:45:14.000000000 +0000
-+++ grub/grub/asmstub.c	2008-03-28 13:22:28.000000000 +0000
-@@ -55,6 +55,10 @@ int grub_stage2 (void);
- # endif /* ! BLKFLSBUF */
- #endif /* __linux__ */
- 
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+# include <sys/sysctl.h>
-+#endif
-+
- /* We want to prevent any circularararity in our stubs, as well as
-    libc name clashes. */
- #define WITHOUT_LIBC_STUBS 1
-@@ -777,7 +781,39 @@ get_diskinfo (int drive, struct geometry
- 
-       /* Open read/write, or read-only if that failed. */
-       if (! read_only)
--	disks[drive].flags = open (devname, O_RDWR);
-+	{
-+/* By default, kernel of FreeBSD does not allow overwriting MBR */
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#define GEOM_SYSCTL	"kern.geom.debugflags"
-+	  int old_flags, flags;
-+	  size_t sizeof_int = sizeof (int);
-+
-+	  if (sysctlbyname (GEOM_SYSCTL, &old_flags, &sizeof_int, NULL, 0) != 0)
-+	    grub_printf ("failed to get " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+
-+	  if ((old_flags & 0x10) == 0)
-+	    {
-+	      /* "allow foot shooting", see geom(4) */
-+	      flags = old_flags | 0x10;
-+
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0)
-+		{
-+		  flags = old_flags;
-+		  grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+		}
-+	    }
-+	  else
-+	    flags = old_flags;
-+#endif
-+	  disks[drive].flags = open (devname, O_RDWR);
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+	  if (flags != old_flags)
-+	    {
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0)
-+	        grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+	    }
-+#endif
-+	}
- 
-       if (disks[drive].flags == -1)
- 	{
-@@ -926,7 +962,7 @@ hex_dump (void *buf, size_t size)
- 
- int
- biosdisk (int subfunc, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   char *buf;
-   int fd = geometry->flags;
-diff -uprN grub-0.97/grub/main.c grub/grub/main.c
---- grub-0.97/grub/main.c	2003-07-09 12:45:36.000000000 +0100
-+++ grub/grub/main.c	2006-05-05 22:43:46.000000000 +0100
-@@ -32,6 +32,7 @@ int grub_stage2 (void);
- #define WITHOUT_LIBC_STUBS 1
- #include <shared.h>
- #include <term.h>
-+#include <device.h>
- 
- char *program_name = 0;
- int use_config_file = 1;
-@@ -192,6 +193,12 @@ main (int argc, char **argv)
- 	      perror ("strtoul");
- 	      exit (1);
- 	    }
-+	  if (boot_drive >= NUM_DISKS)
-+	    {
-+	      fprintf (stderr, "boot_drive should be from 0 to %d\n",
-+		       NUM_DISKS - 1);
-+	      exit (1);
-+	    }
- 	  break;
- 
- 	case OPT_NO_CONFIG_FILE:
-diff -uprN grub-0.97/lib/device.c grub/lib/device.c
---- grub-0.97/lib/device.c	2005-03-28 00:14:25.000000000 +0100
-+++ grub/lib/device.c	2008-03-28 13:22:28.000000000 +0000
-@@ -69,9 +69,9 @@ struct hd_geometry
- # ifndef CDROM_GET_CAPABILITY
- #  define CDROM_GET_CAPABILITY	0x5331	/* get capabilities */
- # endif /* ! CDROM_GET_CAPABILITY */
--# ifndef BLKGETSIZE
--#  define BLKGETSIZE	_IO(0x12,96)	/* return device size */
--# endif /* ! BLKGETSIZE */
-+# ifndef BLKGETSIZE64
-+#  define BLKGETSIZE64	_IOR(0x12,114,size_t)	/* return device size */
-+# endif /* ! BLKGETSIZE64 */
- #endif /* __linux__ */
- 
- /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with
-@@ -152,19 +152,19 @@ get_drive_geometry (struct geometry *geo
-   /* Linux */
-   {
-     struct hd_geometry hdg;
--    unsigned long nr;
-+    unsigned long long nr;
-     
-     if (ioctl (fd, HDIO_GETGEO, &hdg))
-       goto fail;
- 
--    if (ioctl (fd, BLKGETSIZE, &nr))
-+    if (ioctl (fd, BLKGETSIZE64, &nr))
-       goto fail;
-     
-     /* Got the geometry, so save it. */
-     geom->cylinders = hdg.cylinders;
-     geom->heads = hdg.heads;
-     geom->sectors = hdg.sectors;
--    geom->total_sectors = nr;
-+    geom->total_sectors = nr / 512;
-     
-     goto success;
-   }
-@@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int u
- {
-   sprintf (name, "/dev/ataraid/d%c", unit + '0');
- }
-+
-+static void
-+get_i2o_disk_name (char *name, char unit)
-+{
-+  sprintf (name, "/dev/i2o/hd%c", unit);
-+}
- #endif
- 
- /* Check if DEVICE can be read. If an error occurs, return zero,
-@@ -801,6 +807,29 @@ init_device_map (char ***map, const char
- 	  }
-       }
-   }
-+    
-+  /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
-+  {
-+    int unit;
-+
-+    for (unit = 'a'; unit < 'f'; unit++)
-+      {
-+        char name[24];
-+    
-+        get_i2o_disk_name (name, unit);
-+        if (check_device (name))
-+          {
-+              (*map)[num_hd + 0x80] = strdup (name);
-+                  assert ((*map)[num_hd + 0x80]);
-+                  
-+	    /* If the device map file is opened, write the map.  */
-+               if (fp)
-+                     fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
-+                     
-+	    num_hd++;
-+          }
-+      }
-+  }
- #endif /* __linux__ */
-   
-   /* OK, close the device map file if opened.  */
-@@ -861,6 +890,12 @@ write_to_partition (char **map, int driv
-       if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
- 	strcpy (dev + strlen(dev) - 5, "/part");
-     }
-+  else
-+    {
-+      if ((strncmp (dev, "/dev/ataraid/", 13) == 0) ||
-+         (strncmp (dev, "/dev/rd/", 8) == 0))
-+        strcpy (dev + strlen(dev), "p");
-+    }
-   sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
-   
-   /* Open the partition.  */
-diff -uprN grub-0.97/netboot/3c509.c grub/netboot/3c509.c
---- grub-0.97/netboot/3c509.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/3c509.c	2002-01-02 21:56:40.000000000 +0000
-@@ -18,7 +18,7 @@ Author: Martin Renters.
- 
- 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su)
- 
--$Id: 3c509.c,v 1.4 2002/01/02 21:56:40 okuji Exp $
-+$Id: 3c509.c 609 2002-01-02 21:56:40Z okuji $
- 
- ***************************************************************************/
- 
-diff -uprN grub-0.97/netboot/cs89x0.c grub/netboot/cs89x0.c
---- grub-0.97/netboot/cs89x0.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.c	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /* cs89x0.c: A Crystal Semiconductor CS89[02]0 driver for etherboot. */
- /*
-   Permission is granted to distribute the enclosed cs89x0.[ch] driver
-diff -uprN grub-0.97/netboot/cs89x0.h grub/netboot/cs89x0.h
---- grub-0.97/netboot/cs89x0.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.h	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /*  Copyright, 1988-1992, Russell Nelson, Crynwr Software
- 
-    This program is free software; you can redistribute it and/or modify
-diff -uprN grub-0.97/netboot/etherboot.h grub/netboot/etherboot.h
---- grub-0.97/netboot/etherboot.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/etherboot.h	2006-09-08 13:56:22.000000000 +0100
-@@ -531,9 +531,6 @@ extern int ip_abort;
- extern int network_ready;
- extern struct rom_info rom;
- extern struct arptable_t arptable[MAX_ARP];
--extern struct bootpd_t bootp_data;
--#define	BOOTP_DATA_ADDR	(&bootp_data)
--extern unsigned char *end_of_rfc1533;
- 
- /* config.c */
- extern struct nic nic;
-diff -uprN grub-0.97/netboot/main.c grub/netboot/main.c
---- grub-0.97/netboot/main.c	2004-05-20 23:19:33.000000000 +0100
-+++ grub/netboot/main.c	2006-09-08 13:56:22.000000000 +0100
-@@ -56,7 +56,8 @@ static int vendorext_isvalid;
- static unsigned long netmask;
- static struct bootpd_t bootp_data;
- static unsigned long xid;
--static unsigned char *end_of_rfc1533 = NULL;
-+
-+#define	BOOTP_DATA_ADDR	(&bootp_data)
- 
- #ifndef	NO_DHCP_SUPPORT
- #endif /* NO_DHCP_SUPPORT */
-@@ -967,7 +968,6 @@ decode_rfc1533 (unsigned char *p, int bl
-   
-   if (block == 0)
-     {
--      end_of_rfc1533 = NULL;
-       vendorext_isvalid = 0;
-       
-       if (grub_memcmp (p, rfc1533_cookie, 4))
-@@ -1021,7 +1021,7 @@ decode_rfc1533 (unsigned char *p, int bl
- 	}
-       else if (c == RFC1533_END)
- 	{
--	  end_of_rfc1533 = endp = p;
-+	  endp = p;
- 	  continue;
- 	}
-       else if (c == RFC1533_NETMASK)
-diff -uprN grub-0.97/netboot/natsemi.c grub/netboot/natsemi.c
---- grub-0.97/netboot/natsemi.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/natsemi.c	2006-09-10 08:26:10.000000000 +0100
-@@ -608,7 +608,7 @@ natsemi_transmit(struct nic  *nic,
- 		 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxOff, ioaddr + ChipCmd);
-@@ -647,7 +647,7 @@ natsemi_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sis900.c grub/netboot/sis900.c
---- grub-0.97/netboot/sis900.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sis900.c	2006-09-10 08:26:10.000000000 +0100
-@@ -901,7 +901,7 @@ sis900_transmit(struct nic  *nic,
-                 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxDIS, ioaddr + cr);
-@@ -940,7 +940,7 @@ sis900_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sk_g16.c grub/netboot/sk_g16.c
---- grub-0.97/netboot/sk_g16.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.c	2002-01-02 21:56:40.000000000 +0000
-@@ -13,12 +13,12 @@ Changes to make it work with Etherboot b
-  *
-  * Module         : sk_g16.c
-  *
-- * Version        : $Revision: 1.4 $
-+ * Version        : $Revision: 609 $
-  *
-  * Author         : Patrick J.D. Weichmann
-  *
-  * Date Created   : 94/05/26
-- * Last Updated   : $Date: 2002/01/02 21:56:40 $
-+ * Last Updated   : $Date: 2002-01-02 21:56:40 +0000 (mer 02 jan 2002) $
-  *
-  * Description    : Schneider & Koch G16 Ethernet Device Driver for
-  *                  Linux Kernel >= 1.1.22
-diff -uprN grub-0.97/netboot/sk_g16.h grub/netboot/sk_g16.h
---- grub-0.97/netboot/sk_g16.h	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.h	2000-07-29 20:22:54.000000000 +0100
-@@ -4,7 +4,7 @@
-  * of the GNU Public License, incorporated herein by reference.
-  *
-  * Module         : sk_g16.h
-- * Version        : $Revision: 1.3 $
-+ * Version        : $Revision: 388 $
-  *
-  * Author         : M.Hipp (mhipp@student.uni-tuebingen.de)
-  * changes by     : Patrick J.D. Weichmann
-@@ -15,8 +15,8 @@
-  *                  the am7990 (LANCE) chip used for writing a
-  *                  network device driver which uses this chip
-  *
-- * $Log: sk_g16.h,v $
-- * Revision 1.3  2000/07/29 19:22:54  okuji
-+ * $Log$
-+ * Revision 1.3  2000-07-29 19:22:54  okuji
-  * update the network support to etherboot-4.6.4.
-  *
- -*/
-diff -uprN grub-0.97/stage1/Makefile.am grub/stage1/Makefile.am
---- grub-0.97/stage1/Makefile.am	2004-07-16 12:44:56.000000000 +0100
-+++ grub/stage1/Makefile.am	2007-11-05 01:29:46.000000000 +0000
-@@ -5,7 +5,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- 
- noinst_PROGRAMS = stage1.exec
- stage1_exec_SOURCES = stage1.S stage1.h
-diff -uprN grub-0.97/stage1/Makefile.in grub/stage1/Makefile.in
---- grub-0.97/stage1/Makefile.in	2005-05-08 03:42:36.000000000 +0100
-+++ grub/stage1/Makefile.in	2007-11-05 01:29:46.000000000 +0000
-@@ -110,7 +110,7 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LTLIBOBJS = @LTLIBOBJS@
-@@ -188,6 +188,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- stage1_exec_SOURCES = stage1.S stage1.h
- SUFFIXES = .exec
- all: all-am
-diff -uprN grub-0.97/stage2/bios.c grub/stage2/bios.c
---- grub-0.97/stage2/bios.c	2004-03-27 16:34:04.000000000 +0000
-+++ grub/stage2/bios.c	2008-03-28 13:22:28.000000000 +0000
-@@ -47,7 +47,7 @@ extern int get_diskinfo_floppy (int driv
-    return the error number. Otherwise, return 0.  */
- int
- biosdisk (int read, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   int err;
-   
-diff -uprN grub-0.97/stage2/boot.c grub/stage2/boot.c
---- grub-0.97/stage2/boot.c	2004-03-30 12:44:08.000000000 +0100
-+++ grub/stage2/boot.c	2005-09-28 22:47:55.000000000 +0100
-@@ -1,7 +1,7 @@
- /* boot.c - load and bootstrap a kernel */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -96,7 +96,7 @@ load_image (char *kernel, char *arg, ker
-   lh = (struct linux_kernel_header *) buffer;
-   
-   /* ELF loading supported if multiboot, FreeBSD and NetBSD.  */
--  if ((type == KERNEL_TYPE_MULTIBOOT
-+  if (((type == KERNEL_TYPE_MULTIBOOT && ! (flags & MULTIBOOT_AOUT_KLUDGE))
-        || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD
-        || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
-        || suggested_type == KERNEL_TYPE_NETBSD)
-diff -uprN grub-0.97/stage2/builtins.c grub/stage2/builtins.c
---- grub-0.97/stage2/builtins.c	2005-02-15 21:58:23.000000000 +0000
-+++ grub/stage2/builtins.c	2006-03-21 20:51:58.000000000 +0000
-@@ -3830,15 +3830,15 @@ setup_func (char *arg, int flags)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF);
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
-       if ((partition & 0x00FF00) != 0x00FF00)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF));
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
--      grub_strncat (device, ")", 256);
-+      grub_strncat (device, ")", sizeof (device));
-     }
-   
-   int embed_stage1_5 (char *stage1_5, int drive, int partition)
-diff -uprN grub-0.97/stage2/disk_io.c grub/stage2/disk_io.c
---- grub-0.97/stage2/disk_io.c	2004-05-23 17:35:24.000000000 +0100
-+++ grub/stage2/disk_io.c	2008-03-28 13:22:28.000000000 +0000
-@@ -137,7 +137,7 @@ log2 (unsigned long word)
- }
- 
- int
--rawread (int drive, int sector, int byte_offset, int byte_len, char *buf)
-+rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   int slen, sectors_per_vtrack;
-   int sector_size_bits = log2 (buf_geom.sector_size);
-@@ -261,7 +261,7 @@ rawread (int drive, int sector, int byte
-        */
-       if (disk_read_func)
- 	{
--	  int sector_num = sector;
-+	  unsigned int sector_num = sector;
- 	  int length = buf_geom.sector_size - byte_offset;
- 	  if (length > size)
- 	    length = size;
-@@ -291,7 +291,7 @@ rawread (int drive, int sector, int byte
- 
- 
- int
--devread (int sector, int byte_offset, int byte_len, char *buf)
-+devread (unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   /*
-    *  Check partition boundaries
-@@ -330,7 +330,7 @@ devread (int sector, int byte_offset, in
- 
- #ifndef STAGE1_5
- int
--rawwrite (int drive, int sector, char *buf)
-+rawwrite (int drive, unsigned int sector, char *buf)
- {
-   if (sector == 0)
-     {
-@@ -363,7 +363,7 @@ rawwrite (int drive, int sector, char *b
- }
- 
- int
--devwrite (int sector, int sector_count, char *buf)
-+devwrite (unsigned int sector, int sector_count, char *buf)
- {
- #if defined(GRUB_UTIL) && defined(__linux__)
-   if (current_partition != 0xFFFFFF
-diff -uprN grub-0.97/stage2/fsys_ffs.c grub/stage2/fsys_ffs.c
---- grub-0.97/stage2/fsys_ffs.c	2003-07-09 12:45:52.000000000 +0100
-+++ grub/stage2/fsys_ffs.c	2001-11-12 06:57:29.000000000 +0000
-@@ -50,7 +50,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ffs.c,v 1.10 2001/11/12 06:57:29 okuji Exp $
-+ *	$Id: fsys_ffs.c 594 2001-11-12 06:57:29Z okuji $
-  */
- 
- #ifdef FSYS_FFS
-diff -uprN grub-0.97/stage2/fsys_ufs2.c grub/stage2/fsys_ufs2.c
---- grub-0.97/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-+++ grub/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-@@ -51,7 +51,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $
-+ *	$Id: fsys_ufs2.c 841 2004-06-19 12:17:52Z okuji $
-  */
- 
- #ifdef FSYS_UFS2
-diff -uprN grub-0.97/stage2/imgact_aout.h grub/stage2/imgact_aout.h
---- grub-0.97/stage2/imgact_aout.h	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/imgact_aout.h	1999-06-24 01:03:29.000000000 +0100
-@@ -32,7 +32,7 @@
-  * SUCH DAMAGE.
-  *
-  *	from: @(#)exec.h	8.1 (Berkeley) 6/11/93
-- *	$Id: imgact_aout.h,v 1.1 1999/06/24 00:03:22 okuji Exp $
-+ *	$Id: imgact_aout.h 98 1999-06-24 00:03:29Z okuji $
-  */
- /*
-  *  11/23/95 - Kludge to get "ntohl" null macro added.  -- ESB
-diff -uprN grub-0.97/stage2/iso9660.h grub/stage2/iso9660.h
---- grub-0.97/stage2/iso9660.h	2004-03-27 16:02:38.000000000 +0000
-+++ grub/stage2/iso9660.h	2007-02-22 23:40:25.000000000 +0000
-@@ -73,11 +73,11 @@ typedef	union {
- 
- typedef	struct __iso_16bit {
-   u_int16_t l, b;
--} iso_16bit_t __attribute__ ((packed));
-+} iso_16bit_t;
- 
- typedef	struct __iso_32bit {
-   u_int32_t l, b;
--} iso_32bit_t __attribute__ ((packed));
-+} iso_32bit_t;
- 
- typedef u_int8_t		iso_date_t[7];
- 
-diff -uprN grub-0.97/stage2/shared.h grub/stage2/shared.h
---- grub-0.97/stage2/shared.h	2004-06-19 17:40:09.000000000 +0100
-+++ grub/stage2/shared.h	2008-03-28 13:22:28.000000000 +0000
-@@ -499,7 +499,11 @@ struct vbe_mode
-   unsigned char linear_reserved_field_position;
-   unsigned long max_pixel_clock;
- 
--  unsigned char reserved3[189];
-+  /* Reserved field to make structure to be 256 bytes long, VESA BIOS 
-+     Extension 3.0 Specification says to reserve 189 bytes here but 
-+     that doesn't make structure to be 256 bytes.  So additional one is 
-+     added here.  */
-+  unsigned char reserved3[189 + 1];
- } __attribute__ ((packed));
- 
- 
-@@ -807,7 +811,7 @@ int checkkey (void);
- /* Low-level disk I/O */
- int get_diskinfo (int drive, struct geometry *geometry);
- int biosdisk (int subfunc, int drive, struct geometry *geometry,
--	      int sector, int nsec, int segment);
-+	      unsigned int sector, int nsec, int segment);
- void stop_floppy (void);
- 
- /* Command-line interface functions. */
-@@ -920,10 +924,10 @@ int gunzip_test_header (void);
- int gunzip_read (char *buf, int len);
- #endif /* NO_DECOMPRESSION */
- 
--int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf);
--int devread (int sector, int byte_offset, int byte_len, char *buf);
--int rawwrite (int drive, int sector, char *buf);
--int devwrite (int sector, int sector_len, char *buf);
-+int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int devread (unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int rawwrite (int drive, unsigned int sector, char *buf);
-+int devwrite (unsigned int sector, int sector_len, char *buf);
- 
- /* Parse a device string and initialize the global parameters. */
- char *set_device (char *device);
-diff -uprN grub-0.97/stage2/stage2.c grub/stage2/stage2.c
---- grub-0.97/stage2/stage2.c	2005-03-19 17:51:57.000000000 +0000
-+++ grub/stage2/stage2.c	2006-05-05 23:06:31.000000000 +0100
-@@ -651,7 +651,10 @@ restart:
- 		  *(new_heap++) = 0;
- 
- 		  if (config_entries)
--		    run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    {
-+		      current_entryno = first_entry + entryno;
-+		      run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    }
- 		  else
- 		    {
- 		      cls ();
-@@ -727,7 +730,8 @@ restart:
- 	cur_entry = get_entry (config_entries, first_entry + entryno, 1);
- 
-       /* Set CURRENT_ENTRYNO for the command "savedefault".  */
--      current_entryno = first_entry + entryno;
-+      if (config_entries)
-+	current_entryno = first_entry + entryno;
-       
-       if (run_script (cur_entry, heap))
- 	{
-diff -uprN grub-0.97/stage2/tparm.c grub/stage2/tparm.c
---- grub-0.97/stage2/tparm.c	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/tparm.c	2002-11-29 20:39:24.000000000 +0000
-@@ -63,7 +63,7 @@ typedef char grub_bool;
- #define MAX_FORMAT_LEN 256
- #define max(a,b) ((a) > (b) ? (a) : (b))
- 
--//MODULE_ID("$Id: tparm.c,v 1.1 2002/11/29 20:39:24 okuji Exp $")
-+//MODULE_ID("$Id: tparm.c 708 2002-11-29 20:39:24Z okuji $")
- 
- /*
-  *	char *
-diff -uprN grub-0.97/stamp-h.in grub/stamp-h.in
---- grub-0.97/stamp-h.in	1970-01-01 01:00:00.000000000 +0100
-+++ grub/stamp-h.in	1999-09-13 14:32:31.000000000 +0100
-@@ -0,0 +1 @@
-+timestamp
-diff -uprN grub-0.97/THANKS grub/THANKS
---- grub-0.97/THANKS	2005-05-08 03:17:43.000000000 +0100
-+++ grub/THANKS	2006-03-21 20:51:58.000000000 +0000
-@@ -121,3 +121,4 @@ Vesa Jaaskelainen <jaaskela@tietomyrsky.
- Yedidyah Bar-David <didi@post.tau.ac.il>
- Yury V. Umanets <umka@namesys.com>
- Yuri Zaporogets <yuriz@ukr.net>
-+Vitaly Fertman <vitaly@namesys.com>
-diff -uprN grub-0.97/util/grub-install.in grub/util/grub-install.in
---- grub-0.97/util/grub-install.in	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/grub-install.in	2006-04-20 14:46:46.000000000 +0100
-@@ -112,8 +112,8 @@ convert () {
- 	tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
- 	tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
-     freebsd* | kfreebsd*-gnu)
--	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
--			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
-+	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \
-+			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'`
- 	tmp_part=`echo "$1" \
- 	    | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
-        	    | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
-diff -uprN grub-0.97/util/mkbimage grub/util/mkbimage
---- grub-0.97/util/mkbimage	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/mkbimage	2007-02-22 16:01:03.000000000 +0000
-@@ -1,7 +1,7 @@
- #!/bin/sh
- # MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode
- # C) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>
--# C) 2001,2002,2003 Robert Millan <robertmh@gnu.org>
-+# C) 2001,2002,2003 Robert Millan <rmh@aybabtu.com>
- 
- 
- # This program is free software; you can redistribute it and/or modify
-@@ -19,7 +19,7 @@
- # program's maintainer or write to: The Free Software Foundation,
- # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
- 
--# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $
-+# $Id: mkbimage 1233 2007-02-22 16:01:03Z robertmh $
- 
- # Global variables
- tarfile=
-@@ -58,7 +58,7 @@ stage2_os_name=
- 
- # Name by which this script was invoked.
- program=`echo "$0" | sed -e 's/[^\/]*\///g'`
--version_number='$Revision: 1.19 $'
-+version_number='$Revision: 1233 $'
- 
- usage="
- Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE
-@@ -94,15 +94,13 @@ Options:
- 	    display Version information and exit
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>. 
--Copyright (c) 2001,2002 Robert Millan <zeratul2@wanadoo.es>.
- GPLed."
- 
- version="mkbimage $version_number
- 
--Written by Thierry Laronde and Robert Millan.
-+Written by Thierry Laronde.
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>.
--Copyright (c) 2001,2002,2003 Robert Millan <zeratul2@wanadoo.es>.
- 
- This is free software under the GPL version 2 or later; see the source for 
- copying conditions.  There is NO warranty, not even for MERCHANTABILITY or 
diff --git a/stubdom/grub.patches/10graphics.diff b/stubdom/grub.patches/10graphics.diff
deleted file mode 100644
index 5ee2852fd7..0000000000
--- a/stubdom/grub.patches/10graphics.diff
+++ /dev/null
@@ -1,2297 +0,0 @@
-diff -Naur grub-0.97.orig/configure.ac grub-0.97/configure.ac
---- grub-0.97.orig/configure.ac	2005-05-07 23:36:03.000000000 -0300
-+++ grub-0.97/configure.ac	2005-06-12 20:56:49.000000000 -0300
-@@ -595,6 +595,11 @@
-   [  --enable-diskless       enable diskless support])
- AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
- 
-+dnl Graphical splashscreen support
-+AC_ARG_ENABLE(graphics,
-+  [  --disable-graphics      disable graphics terminal support])
-+AM_CONDITIONAL(GRAPHICS_SUPPORT, test "x$enable_graphics" != xno)
-+
- dnl Hercules terminal
- AC_ARG_ENABLE(hercules,
-   [  --disable-hercules      disable hercules terminal support])
-diff -Naur grub-0.97.orig/stage2/asm.S grub-0.97/stage2/asm.S
---- grub-0.97.orig/stage2/asm.S	2004-06-19 13:55:22.000000000 -0300
-+++ grub-0.97/stage2/asm.S	2005-06-13 14:05:31.000000000 -0300
-@@ -2216,7 +2216,304 @@
- 	pop	%ebx
- 	pop	%ebp
- 	ret
--		
-+
-+
-+/* graphics mode functions */
-+#ifdef SUPPORT_GRAPHICS
-+VARIABLE(cursorX)
-+.word	0
-+VARIABLE(cursorY)
-+.word	0
-+VARIABLE(cursorCount)
-+.word 0
-+VARIABLE(cursorBuf)
-+.byte	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-+
-+
-+/*
-+ * set_int1c_handler(void)
-+ */
-+ENTRY(set_int1c_handler)
-+	pushl   %edi
-+
-+	/* save the original int1c handler */
-+	movl    $0x70, %edi
-+	movw    (%edi), %ax
-+	movw    %ax, ABS(int1c_offset)
-+	movw    2(%edi), %ax
-+	movw    %ax, ABS(int1c_segment)
-+
-+	/* save the new int1c handler */
-+	movw    $ABS(int1c_handler), %ax
-+	movw    %ax, (%edi)
-+	xorw    %ax, %ax
-+	movw    %ax, 2(%edi)
-+
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * unset_int1c_handler(void)
-+ */
-+ENTRY(unset_int1c_handler)
-+	pushl   %edi
-+
-+	/* check if int1c_handler is set */
-+	movl    $0x70, %edi
-+	movw    $ABS(int1c_handler), %ax
-+	cmpw    %ax, (%edi)
-+	jne     int1c_1
-+	xorw    %ax, %ax
-+	cmpw    %ax, 2(%edi)
-+	jne     int1c_1
-+
-+	/* restore the original */
-+	movw    ABS(int1c_offset), %ax
-+	movw    %ax, (%edi)
-+	movw    ABS(int1c_segment), %ax
-+	movw    %ax, 2(%edi)
-+
-+int1c_1:
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * blinks graphics cursor
-+ */
-+	.code16
-+write_data:
-+	movw    $0, %ax
-+	movw    %ax, %ds
-+
-+	mov     $0xA000, %ax            /* video in es:di */
-+	mov     %ax, %es
-+	mov     $80, %ax
-+	movw    $ABS(cursorY), %si
-+	mov     %ds:(%si), %bx
-+	mul     %bx
-+	movw    $ABS(cursorX), %si
-+	mov     %ds:(%si), %bx
-+	shr     $3, %bx                 /* %bx /= 8 */
-+	add     %bx, %ax
-+	mov     %ax, %di
-+
-+	movw    $ABS(cursorBuf), %si    /* fontBuf in ds:si */
-+
-+	/* prepare for data moving */
-+	mov     $16, %dx                /* altura da fonte */
-+	mov     $80, %bx                /* bytes por linha */
-+
-+write_loop:
-+	movb    %ds:(%si), %al
-+	xorb    $0xff, %al
-+	movb    %al, %ds:(%si)          /* invert cursorBuf */
-+	movb    %al, %es:(%di)          /* write to video */
-+	add     %bx, %di
-+	inc     %si
-+	dec     %dx
-+	jg      write_loop
-+	ret
-+
-+int1c_handler:
-+	pusha
-+	mov     $0, %ax
-+	mov     %ax, %ds
-+	mov     $ABS(cursorCount), %si
-+	mov     %ds:(%si), %ax
-+	inc     %ax
-+	mov     %ax, %ds:(%si)
-+	cmp     $9, %ax
-+	jne     int1c_done
-+
-+	mov     $0, %ax
-+	mov     %ax, %ds:(%si)
-+	call    write_data
-+
-+int1c_done:
-+	popa
-+	iret
-+	/* call previous int1c handler */
-+	/* ljmp */
-+	.byte   0xea
-+int1c_offset:  .word   0
-+int1c_segment: .word   0
-+	.code32
-+
-+
-+/*
-+ * unsigned char set_videomode(unsigned char mode)
-+ * BIOS call "INT 10H Function 0h" to set video mode
-+ *	Call with	%ah = 0x0
-+ *			%al = video mode
-+ *  Returns old videomode.
-+ */
-+ENTRY(set_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	movb	8(%ebp), %cl
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xf, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %ch
-+	xorb	%ah, %ah
-+	movb	%cl, %al
-+	int	$0x10			/* Set Video mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%ch, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * int get_videomode()
-+ * BIOS call "INT 10H Function 0Fh" to get current video mode
-+ *	Call with	%al = 0x0
-+ *			%ah = 0xF
-+ *	Returns current videomode.
-+ */
-+ENTRY(get_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xF, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %cl	/* For now we only want display mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%cl, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * unsigned char * graphics_get_font()
-+ * BIOS call "INT 10H Function 11h" to set font
-+ *      Call with       %ah = 0x11
-+ */
-+ENTRY(graphics_get_font)
-+	push	%ebp
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movw	$0x1130, %ax
-+	movb	$6, %bh		/* font 8x16 */
-+	int	$0x10
-+	movw	%bp, %dx
-+	movw	%es, %cx
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movw	%cx, %ax
-+	shll	$4, %eax
-+	movw	%dx, %ax
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%ebp
-+	ret
-+
-+
-+/*
-+ * graphics_set_palette(index, red, green, blue)
-+ * BIOS call "INT 10H Function 10h" to set individual dac register
-+ *	Call with	%ah = 0x10
-+ *			%bx = register number
-+ *			%ch = new value for green (0-63)
-+ *			%cl = new value for blue (0-63)
-+ *			%dh = new value for red (0-63)
-+ */
-+
-+ENTRY(graphics_set_palette)
-+	push	%ebp
-+	push	%eax
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	movw	$0x3c8, %bx		/* address write mode register */
-+
-+	/* wait vertical retrace */
-+	movw	$0x3da, %dx
-+l1b:
-+	inb	%dx, %al	/* wait vertical active display */
-+	test	$8, %al
-+	jnz	l1b
-+
-+l2b:
-+	inb	%dx, %al	/* wait vertical retrace */
-+	test	$8, %al
-+	jnz	l2b
-+
-+	mov	%bx, %dx
-+	movb	0x18(%esp), %al		/* index */
-+	outb	%al, %dx
-+	inc	%dx
-+
-+	movb	0x1c(%esp), %al		/* red */
-+	outb	%al, %dx
-+
-+	movb	0x20(%esp), %al		/* green */
-+	outb	%al, %dx
-+
-+	movb	0x24(%esp), %al		/* blue */
-+	outb	%al, %dx
-+
-+	movw	0x18(%esp), %bx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movb	%bl, %bh
-+	movw	$0x1000, %ax
-+	int	$0x10
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%eax
-+	pop	%ebp
-+	ret
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
- /*
-  * getrtsecs()
-  *	if a seconds value can be read, read it and return it (BCD),
-diff -Naur grub-0.97.orig/stage2/builtins.c grub-0.97/stage2/builtins.c
---- grub-0.97.orig/stage2/builtins.c	2005-02-15 19:58:23.000000000 -0200
-+++ grub-0.97/stage2/builtins.c	2005-06-13 18:44:03.000000000 -0300
-@@ -28,6 +28,10 @@
- #include <filesys.h>
- #include <term.h>
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifdef SUPPORT_NETBOOT
- # define GRUB	1
- # include <etherboot.h>
-@@ -237,12 +241,22 @@
- static int
- boot_func (char *arg, int flags)
- {
-+  struct term_entry *prev_term = current_term;
-   /* Clear the int15 handler if we can boot the kernel successfully.
-      This assumes that the boot code never fails only if KERNEL_TYPE is
-      not KERNEL_TYPE_NONE. Is this assumption is bad?  */
-   if (kernel_type != KERNEL_TYPE_NONE)
-     unset_int15_handler ();
- 
-+  /* if our terminal needed initialization, we should shut it down
-+   * before booting the kernel, but we want to save what it was so
-+   * we can come back if needed */
-+  if (current_term->shutdown) 
-+    {
-+      current_term->shutdown();
-+      current_term = term_table; /* assumption: console is first */
-+    }
-+
- #ifdef SUPPORT_NETBOOT
-   /* Shut down the networking.  */
-   cleanup_net ();
-@@ -306,6 +320,13 @@
-       return 1;
-     }
- 
-+  /* if we get back here, we should go back to what our term was before */
-+  current_term = prev_term;
-+  if (current_term->startup)
-+      /* if our terminal fails to initialize, fall back to console since
-+       * it should always work */
-+      if (current_term->startup() == 0)
-+          current_term = term_table; /* we know that console is first */
-   return 0;
- }
- 
-@@ -852,6 +873,251 @@
- };
- #endif /* SUPPORT_NETBOOT */
- 
-+#ifdef SUPPORT_GRAPHICS
-+
-+static int splashimage_func(char *arg, int flags) {
-+  int i;
-+    
-+  /* filename can only be 256 characters due to our buffer size */
-+  if (grub_strlen(arg) > 256) {
-+    grub_printf("Splash image filename too large\n");
-+    grub_printf("Press any key to continue...");
-+    getkey();
-+    return 1;
-+  }
-+
-+  /* get rid of TERM_NEED_INIT from the graphics terminal. */
-+  for (i = 0; term_table[i].name; i++) {
-+    if (grub_strcmp (term_table[i].name, "graphics") == 0) {
-+      term_table[i].flags &= ~TERM_NEED_INIT;
-+      break;
-+    }
-+  }
-+
-+  graphics_set_splash(arg);
-+
-+  if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+    graphics_end();
-+    if (graphics_init() == 0) {
-+      /* Fallback to default term */
-+      current_term = term_table;
-+      max_lines = current_term->max_lines;
-+      if (current_term->cls)
-+        current_term->cls();
-+      grub_printf("Failed to set splash image and/or graphics mode\n");
-+      return 1;
-+    }
-+    graphics_cls();
-+  }
-+
-+  if (flags == BUILTIN_MENU)
-+    current_term = term_table + i;
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_splashimage =
-+{
-+  "splashimage",
-+  splashimage_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "splashimage FILE",
-+  "Load FILE as the background image when in graphics mode."
-+};
-+
-+
-+/* shade */
-+static int
-+shade_func(char *arg, int flags)
-+{
-+    int new_shade;
-+
-+    if (!arg || safe_parse_maxint(&arg, &new_shade) == 0)
-+       return (1);
-+
-+    if (shade != new_shade) {
-+       shade = new_shade;
-+       if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+           graphics_end();
-+           graphics_init();
-+           graphics_cls();
-+       }
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_shade =
-+{
-+  "shade",
-+  shade_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "shade INTEGER",
-+  "If set to 0, disables the use of shaded text, else enables it."
-+};
-+
-+
-+/* foreground */
-+static int
-+foreground_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	foreground = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(15, r, g, b);
-+
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_foreground =
-+{
-+  "foreground",
-+  foreground_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "foreground RRGGBB",
-+  "Sets the foreground color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* background */
-+static int
-+background_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	background = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(0, r, g, b);
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_background =
-+{
-+  "background",
-+  background_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "background RRGGBB",
-+  "Sets the background color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* border */
-+static int
-+border_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+       int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+       int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+       int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+       window_border = (r << 16) | (g << 8) | b;
-+       if (graphics_inited)
-+           graphics_set_palette(0x11, r, g, b);
-+
-+       return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_border =
-+{
-+  "border",
-+  border_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "border RRGGBB",
-+  "Sets the border video color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* viewport */
-+static int
-+viewport_func (char *arg, int flags)
-+{
-+    int i;
-+    int x0 = 0, y0 = 0, x1 = 80, y1 = 30;
-+    int *pos[4] = { &x0, &y0, &x1, &y1 };
-+
-+    if (!arg)
-+       return (1);
-+    for (i = 0; i < 4; i++) {
-+       if (!*arg)
-+           return (1);
-+    while (*arg && (*arg == ' ' || *arg == '\t'))
-+           ++arg;
-+       if (!safe_parse_maxint(&arg, pos[i]))
-+           return (1);
-+       while (*arg && (*arg != ' ' && *arg != '\t'))
-+           ++arg;
-+    }
-+
-+    /* minimum size is 65 colums and 16 rows */
-+    if (x0 > x1 - 66 || y0 > y1 - 16 || x0 < 0 || y0 < 0 || x1 > 80 || y1 > 30)
-+       return 1;
-+
-+    view_x0 = x0;
-+    view_y0 = y0;
-+    view_x1 = x1;
-+    view_y1 = y1;
-+
-+    if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+       graphics_end();
-+       graphics_init();
-+       graphics_cls();
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_viewport =
-+{
-+  "viewport",
-+  viewport_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "viewport x0 y0 x1 y1",
-+  "Changes grub internals to output text in the window defined by"
-+  " four parameters. The x and y parameters are 0 based. This option"
-+  " only works with the graphics interface."
-+};
-+
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
-+/* clear */
-+static int 
-+clear_func() 
-+{
-+  if (current_term->cls)
-+    current_term->cls();
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_clear =
-+{
-+  "clear",
-+  clear_func,
-+  BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
-+  "clear",
-+  "Clear the screen"
-+};
-+
- 
- /* displayapm */
- static int
-@@ -1454,14 +1720,20 @@
- 
- 
- /* help */
--#define MAX_SHORT_DOC_LEN	39
--#define MAX_LONG_DOC_LEN	66
--
- static int
- help_func (char *arg, int flags)
- {
--  int all = 0;
--  
-+  int all = 0, max_short_doc_len, max_long_doc_len;
-+  max_short_doc_len = 39;
-+  max_long_doc_len = 66;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      max_short_doc_len = (view_x1 - view_x0 + 1) / 2 - 1;
-+      max_long_doc_len = (view_x1 - view_x0) - 14;
-+    }
-+#endif
-+
-   if (grub_memcmp (arg, "--all", sizeof ("--all") - 1) == 0)
-     {
-       all = 1;
-@@ -1491,13 +1763,13 @@
- 
- 	  len = grub_strlen ((*builtin)->short_doc);
- 	  /* If the length of SHORT_DOC is too long, truncate it.  */
--	  if (len > MAX_SHORT_DOC_LEN - 1)
--	    len = MAX_SHORT_DOC_LEN - 1;
-+	  if (len > max_short_doc_len - 1)
-+	    len = max_short_doc_len - 1;
- 
- 	  for (i = 0; i < len; i++)
- 	    grub_putchar ((*builtin)->short_doc[i]);
- 
--	  for (; i < MAX_SHORT_DOC_LEN; i++)
-+	  for (; i < max_short_doc_len; i++)
- 	    grub_putchar (' ');
- 
- 	  if (! left)
-@@ -1546,10 +1818,10 @@
- 		      int i;
- 
- 		      /* If LEN is too long, fold DOC.  */
--		      if (len > MAX_LONG_DOC_LEN)
-+		      if (len > max_long_doc_len)
- 			{
- 			  /* Fold this line at the position of a space.  */
--			  for (len = MAX_LONG_DOC_LEN; len > 0; len--)
-+			  for (len = max_long_doc_len; len > 0; len--)
- 			    if (doc[len - 1] == ' ')
- 			      break;
- 			}
-@@ -4085,7 +4357,7 @@
- };
- 
- 
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
- /* terminal */
- static int
- terminal_func (char *arg, int flags)
-@@ -4244,17 +4516,29 @@
-  end:
-   current_term = term_table + default_term;
-   current_term->flags = term_flags;
--  
-+
-   if (lines)
-     max_lines = lines;
-   else
--    /* 24 would be a good default value.  */
--    max_lines = 24;
--  
-+    max_lines = current_term->max_lines;
-+
-   /* If the interface is currently the command-line,
-      restart it to repaint the screen.  */
--  if (current_term != prev_term && (flags & BUILTIN_CMDLINE))
-+  if ((current_term != prev_term) && (flags & BUILTIN_CMDLINE)){
-+    if (prev_term->shutdown)
-+      prev_term->shutdown();
-+    if (current_term->startup) {
-+      /* If startup fails, return to previous term */
-+      if (current_term->startup() == 0) {
-+        current_term = prev_term;
-+        max_lines = current_term->max_lines;
-+        if (current_term->cls) {
-+          current_term->cls();
-+        }
-+      }
-+    }
-     grub_longjmp (restart_cmdline_env, 0);
-+  }
-   
-   return 0;
- }
-@@ -4264,7 +4548,7 @@
-   "terminal",
-   terminal_func,
-   BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
--  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]",
-+  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]",
-   "Select a terminal. When multiple terminals are specified, wait until"
-   " you push any key to continue. If both console and serial are specified,"
-   " the terminal to which you input a key first will be selected. If no"
-@@ -4276,7 +4560,7 @@
-   " seconds. The option --lines specifies the maximum number of lines."
-   " The option --silent is used to suppress messages."
- };
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- 
- 
- #ifdef SUPPORT_SERIAL
-@@ -4795,13 +5079,20 @@
- /* The table of builtin commands. Sorted in dictionary order.  */
- struct builtin *builtin_table[] =
- {
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_background,
-+#endif
-   &builtin_blocklist,
-   &builtin_boot,
- #ifdef SUPPORT_NETBOOT
-   &builtin_bootp,
- #endif /* SUPPORT_NETBOOT */
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_border,
-+#endif
-   &builtin_cat,
-   &builtin_chainloader,
-+  &builtin_clear,
-   &builtin_cmp,
-   &builtin_color,
-   &builtin_configfile,
-@@ -4821,6 +5112,9 @@
-   &builtin_embed,
-   &builtin_fallback,
-   &builtin_find,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_foreground,
-+#endif
-   &builtin_fstest,
-   &builtin_geometry,
-   &builtin_halt,
-@@ -4864,9 +5158,13 @@
- #endif /* SUPPORT_SERIAL */
-   &builtin_setkey,
-   &builtin_setup,
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_shade,
-+  &builtin_splashimage,
-+#endif /* SUPPORT_GRAPHICS */
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
-   &builtin_terminal,
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- #ifdef SUPPORT_SERIAL
-   &builtin_terminfo,
- #endif /* SUPPORT_SERIAL */
-@@ -4880,5 +5178,8 @@
-   &builtin_unhide,
-   &builtin_uppermem,
-   &builtin_vbeprobe,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_viewport,
-+#endif
-   0
- };
-diff -Naur grub-0.97.orig/stage2/char_io.c grub-0.97/stage2/char_io.c
---- grub-0.97.orig/stage2/char_io.c	2005-02-01 18:51:23.000000000 -0200
-+++ grub-0.97/stage2/char_io.c	2005-06-12 20:56:49.000000000 -0300
-@@ -29,12 +29,17 @@
- # include <serial.h>
- #endif
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifndef STAGE1_5
- struct term_entry term_table[] =
-   {
-     {
-       "console",
-       0,
-+      24,
-       console_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -43,13 +48,16 @@
-       console_cls,
-       console_setcolorstate,
-       console_setcolor,
--      console_setcursor
-+      console_setcursor,
-+      0, 
-+      0
-     },
- #ifdef SUPPORT_SERIAL
-     {
-       "serial",
-       /* A serial device must be initialized.  */
-       TERM_NEED_INIT,
-+      24,
-       serial_putchar,
-       serial_checkkey,
-       serial_getkey,
-@@ -58,6 +66,8 @@
-       serial_cls,
-       serial_setcolorstate,
-       0,
-+      0,
-+      0, 
-       0
-     },
- #endif /* SUPPORT_SERIAL */
-@@ -65,6 +75,7 @@
-     {
-       "hercules",
-       0,
-+      24,
-       hercules_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -73,11 +84,30 @@
-       hercules_cls,
-       hercules_setcolorstate,
-       hercules_setcolor,
--      hercules_setcursor
-+      hercules_setcursor,
-+      0,
-+      0
-     },      
- #endif /* SUPPORT_HERCULES */
-+#ifdef SUPPORT_GRAPHICS
-+    { "graphics",
-+      TERM_NEED_INIT, /* flags */
-+      30, /* number of lines */
-+      graphics_putchar, /* putchar */
-+      console_checkkey, /* checkkey */
-+      console_getkey, /* getkey */
-+      graphics_getxy, /* getxy */
-+      graphics_gotoxy, /* gotoxy */
-+      graphics_cls, /* cls */
-+      graphics_setcolorstate, /* setcolorstate */
-+      graphics_setcolor, /* setcolor */
-+      graphics_setcursor, /* nocursor */
-+      graphics_init, /* initialize */
-+      graphics_end /* shutdown */
-+    },
-+#endif /* SUPPORT_GRAPHICS */
-     /* This must be the last entry.  */
--    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-+    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-   };
- 
- /* This must be console.  */
-@@ -305,9 +335,10 @@
- 
-   /* XXX: These should be defined in shared.h, but I leave these here,
-      until this code is freezed.  */
--#define CMDLINE_WIDTH	78
- #define CMDLINE_MARGIN	10
--  
-+
-+  /* command-line limits */
-+  int cmdline_width = 78, col_start = 0;
-   int xpos, lpos, c, section;
-   /* The length of PROMPT.  */
-   int plen;
-@@ -338,7 +369,7 @@
-       
-       /* If the cursor is in the first section, display the first section
- 	 instead of the second.  */
--      if (section == 1 && plen + lpos < CMDLINE_WIDTH)
-+      if (section == 1 && plen + lpos < cmdline_width)
- 	cl_refresh (1, 0);
-       else if (xpos - count < 1)
- 	cl_refresh (1, 0);
-@@ -354,7 +385,7 @@
- 		grub_putchar ('\b');
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -364,7 +395,7 @@
-       lpos += count;
- 
-       /* If the cursor goes outside, scroll the screen to the right.  */
--      if (xpos + count >= CMDLINE_WIDTH)
-+      if (xpos + count >= cmdline_width)
- 	cl_refresh (1, 0);
-       else
- 	{
-@@ -383,7 +414,7 @@
- 		}
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -398,14 +429,14 @@
-       if (full)
- 	{
- 	  /* Recompute the section number.  */
--	  if (lpos + plen < CMDLINE_WIDTH)
-+	  if (lpos + plen < cmdline_width)
- 	    section = 0;
- 	  else
--	    section = ((lpos + plen - CMDLINE_WIDTH)
--		       / (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) + 1);
-+	    section = ((lpos + plen - cmdline_width)
-+		       / (cmdline_width - 1 - CMDLINE_MARGIN) + 1);
- 
- 	  /* From the start to the end.  */
--	  len = CMDLINE_WIDTH;
-+	  len = cmdline_width;
- 	  pos = 0;
- 	  grub_putchar ('\r');
- 
-@@ -445,8 +476,8 @@
- 	  if (! full)
- 	    offset = xpos - 1;
- 	  
--	  start = ((section - 1) * (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN)
--		   + CMDLINE_WIDTH - plen - CMDLINE_MARGIN);
-+	  start = ((section - 1) * (cmdline_width - 1 - CMDLINE_MARGIN)
-+		   + cmdline_width - plen - CMDLINE_MARGIN);
- 	  xpos = lpos + 1 - start;
- 	  start += offset;
- 	}
-@@ -471,7 +502,7 @@
-       
-       /* If the cursor is at the last position, put `>' or a space,
- 	 depending on if there are more characters in BUF.  */
--      if (pos == CMDLINE_WIDTH)
-+      if (pos == cmdline_width)
- 	{
- 	  if (start + len < llen)
- 	    grub_putchar ('>');
-@@ -488,7 +519,7 @@
- 	    grub_putchar ('\b');
- 	}
-       else
--	gotoxy (xpos, getxy () & 0xFF);
-+	gotoxy (xpos + col_start, getxy () & 0xFF);
-     }
- 
-   /* Initialize the command-line.  */
-@@ -518,10 +549,10 @@
- 	  
- 	  llen += l;
- 	  lpos += l;
--	  if (xpos + l >= CMDLINE_WIDTH)
-+	  if (xpos + l >= cmdline_width)
- 	    cl_refresh (1, 0);
--	  else if (xpos + l + llen - lpos > CMDLINE_WIDTH)
--	    cl_refresh (0, CMDLINE_WIDTH - xpos);
-+	  else if (xpos + l + llen - lpos > cmdline_width)
-+	    cl_refresh (0, cmdline_width - xpos);
- 	  else
- 	    cl_refresh (0, l + llen - lpos);
- 	}
-@@ -533,12 +564,22 @@
-       grub_memmove (buf + lpos, buf + lpos + count, llen - count + 1);
-       llen -= count;
-       
--      if (xpos + llen + count - lpos > CMDLINE_WIDTH)
--	cl_refresh (0, CMDLINE_WIDTH - xpos);
-+      if (xpos + llen + count - lpos > cmdline_width)
-+	cl_refresh (0, cmdline_width - xpos);
-       else
- 	cl_refresh (0, llen + count - lpos);
-     }
- 
-+  max_lines = current_term->max_lines;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      cmdline_width = (view_x1 - view_x0) - 2;
-+      col_start = view_x0;
-+      max_lines = view_y1 - view_y0;
-+    }
-+#endif
-+
-   plen = grub_strlen (prompt);
-   llen = grub_strlen (cmdline);
- 
-@@ -1006,6 +1047,48 @@
- }
- #endif /* ! STAGE1_5 */
- 
-+#ifndef STAGE1_5
-+/* Internal pager.  */
-+int
-+do_more (void)
-+{
-+  if (count_lines >= 0)
-+    {
-+      count_lines++;
-+      if (count_lines >= max_lines - 2)
-+        {
-+          int tmp;
-+
-+          /* It's important to disable the feature temporarily, because
-+             the following grub_printf call will print newlines.  */
-+          count_lines = -1;
-+
-+          grub_printf("\n");
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
-+
-+          grub_printf ("[Hit return to continue]");
-+
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_NORMAL);
-+
-+
-+          do
-+            {
-+              tmp = ASCII_CHAR (getkey ());
-+            }
-+          while (tmp != '\n' && tmp != '\r');
-+          grub_printf ("\r                        \r");
-+
-+          /* Restart to count lines.  */
-+          count_lines = 0;
-+          return 1;
-+        }
-+    }
-+  return 0;
-+}
-+#endif
-+
- /* Display an ASCII character.  */
- void
- grub_putchar (int c)
-@@ -1034,38 +1117,11 @@
- 
-   if (c == '\n')
-     {
-+      int flag;
-       /* Internal `more'-like feature.  */
--      if (count_lines >= 0)
--	{
--	  count_lines++;
--	  if (count_lines >= max_lines - 2)
--	    {
--	      int tmp;
--	      
--	      /* It's important to disable the feature temporarily, because
--		 the following grub_printf call will print newlines.  */
--	      count_lines = -1;
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
--	      
--	      grub_printf ("\n[Hit return to continue]");
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_NORMAL);
--	      
--	      do
--		{
--		  tmp = ASCII_CHAR (getkey ());
--		}
--	      while (tmp != '\n' && tmp != '\r');
--	      grub_printf ("\r                        \r");
--	      
--	      /* Restart to count lines.  */
--	      count_lines = 0;
--	      return;
--	    }
--	}
-+      flag = do_more ();
-+      if (flag)
-+        return;
-     }
- 
-   current_term->putchar (c);
-@@ -1090,7 +1146,7 @@
- cls (void)
- {
-   /* If the terminal is dumb, there is no way to clean the terminal.  */
--  if (current_term->flags & TERM_DUMB)
-+  if (current_term->flags & TERM_DUMB) 
-     grub_putchar ('\n');
-   else
-     current_term->cls ();
-@@ -1217,6 +1273,16 @@
-   return ! errnum;
- }
- 
-+void
-+grub_memcpy(void *dest, const void *src, int len)
-+{
-+  int i;
-+  register char *d = (char*)dest, *s = (char*)src;
-+
-+  for (i = 0; i < len; i++)
-+    d[i] = s[i];
-+}
-+
- void *
- grub_memmove (void *to, const void *from, int len)
- {
-diff -Naur grub-0.97.orig/stage2/cmdline.c grub-0.97/stage2/cmdline.c
---- grub-0.97.orig/stage2/cmdline.c	2004-08-16 20:23:01.000000000 -0300
-+++ grub-0.97/stage2/cmdline.c	2005-06-12 20:56:49.000000000 -0300
-@@ -50,10 +50,11 @@
- void
- print_cmdline_message (int forever)
- {
--  printf (" [ Minimal BASH-like line editing is supported.  For the first word, TAB\n"
--	  "   lists possible command completions.  Anywhere else TAB lists the possible\n"
--	  "   completions of a device/filename.%s ]\n",
--	  (forever ? "" : "  ESC at any time exits."));
-+  grub_printf("       [ Minimal BASH-like line editing is supported.   For\n"
-+              "         the   first   word,  TAB  lists  possible  command\n"
-+              "         completions.  Anywhere else TAB lists the possible\n"
-+              "         completions of a device/filename.%s ]\n",
-+              (forever ? "" : "  ESC at any time\n         exits."));
- }
- 
- /* Find the builtin whose command name is COMMAND and return the
-diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
---- grub-0.97.orig/stage2/graphics.c	1969-12-31 21:00:00.000000000 -0300
-+++ grub-0.97/stage2/graphics.c	2005-06-13 19:13:31.000000000 -0300
-@@ -0,0 +1,584 @@
-+/*
-+ * graphics.c - graphics mode support for GRUB
-+ * Implemented as a terminal type by Jeremy Katz <katzj@redhat.com> based
-+ * on a patch by Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
-+ * Options and enhancements made by Herton Ronaldo Krzesinski
-+ * <herton@mandriva.com>
-+ *
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2001,2002  Red Hat, Inc.
-+ *  Portions copyright (C) 2000  Conectiva, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; If not, see <http://www.gnu.org/licenses/>
-+ */
-+
-+#ifdef SUPPORT_GRAPHICS
-+
-+#include <term.h>
-+#include <shared.h>
-+#include <graphics.h>
-+
-+int saved_videomode;
-+unsigned char *font8x16;
-+
-+int graphics_inited = 0;
-+static char splashimage[256];
-+
-+int shade = 1, no_cursor = 0;
-+
-+#define VSHADOW VSHADOW1
-+unsigned char VSHADOW1[38400];
-+unsigned char VSHADOW2[38400];
-+unsigned char VSHADOW4[38400];
-+unsigned char VSHADOW8[38400];
-+
-+/* define the default viewable area */
-+int view_x0 = 0;
-+int view_y0 = 0;
-+int view_x1 = 80;
-+int view_y1 = 30;
-+
-+/* text buffer has to be kept around so that we can write things as we
-+ * scroll and the like */
-+unsigned short text[80 * 30];
-+
-+/* graphics options */
-+int foreground = (63 << 16) | (63 << 8) | (63), background = 0, window_border = 0;
-+
-+/* current position */
-+static int fontx = 0;
-+static int fonty = 0;
-+
-+/* global state so that we don't try to recursively scroll or cursor */
-+static int no_scroll = 0;
-+
-+/* color state */
-+static int graphics_standard_color = A_NORMAL;
-+static int graphics_normal_color = A_NORMAL;
-+static int graphics_highlight_color = A_REVERSE;
-+static int graphics_current_color = A_NORMAL;
-+static color_state graphics_color_state = COLOR_STATE_STANDARD;
-+
-+static inline void outb(unsigned short port, unsigned char val)
-+{
-+    __asm __volatile ("outb %0,%1"::"a" (val), "d" (port));
-+}
-+
-+static void MapMask(int value) {
-+    outb(0x3c4, 2);
-+    outb(0x3c5, value);
-+}
-+
-+/* bit mask register */
-+static void BitMask(int value) {
-+    outb(0x3ce, 8);
-+    outb(0x3cf, value);
-+}
-+
-+/* move the graphics cursor location to col, row */
-+static void graphics_setxy(int col, int row) {
-+    if (col >= view_x0 && col < view_x1) {
-+        fontx = col;
-+        cursorX = col << 3;
-+    }
-+    if (row >= view_y0 && row < view_y1) {
-+        fonty = row;
-+        cursorY = row << 4;
-+    }
-+}
-+
-+/* scroll the screen */
-+static void graphics_scroll() {
-+    int i, j, k;
-+
-+    /* we don't want to scroll recursively... that would be bad */
-+    if (no_scroll)
-+        return;
-+    no_scroll = 1;
-+
-+    /* disable pager temporarily */
-+    k = count_lines;
-+    count_lines = -1;
-+    
-+    /* move everything up a line */
-+    for (j = view_y0 + 1; j < view_y1; j++) {
-+        graphics_gotoxy(view_x0, j - 1);
-+        for (i = view_x0; i < view_x1; i++) {
-+            graphics_putchar(text[j * 80 + i]);
-+        }
-+    }
-+
-+    /* last line should be blank */
-+    graphics_gotoxy(view_x0, view_y1 - 1);
-+    for (i = view_x0; i < view_x1; i++)
-+        graphics_putchar(' ');
-+    graphics_setxy(view_x0, view_y1 - 1);
-+
-+    count_lines = k;
-+
-+    no_scroll = 0;
-+}
-+
-+/* Set the splash image */
-+void graphics_set_splash(char *splashfile) {
-+    grub_strcpy(splashimage, splashfile);
-+}
-+
-+/* Get the current splash image */
-+char *graphics_get_splash(void) {
-+    return splashimage;
-+}
-+
-+/* 
-+ * Initialize a vga16 graphics display with the palette based off of
-+ * the image in splashimage.  If the image doesn't exist, leave graphics
-+ * mode. The mode initiated is 12h. From "Ralf Brown's Interrupt List":
-+ *      text/ text pixel   pixel   colors disply scrn  system
-+ *      grph resol  box  resolution       pages  addr
-+ * 12h   G   80x30  8x16  640x480  16/256K  .    A000  VGA,ATI VIP
-+ *       G   80x30  8x16  640x480  16/64    .    A000  ATI EGA Wonder
-+ *       G     .     .    640x480  16       .      .   UltraVision+256K EGA
-+ */
-+int graphics_init()
-+{
-+    if (!graphics_inited) {
-+        saved_videomode = set_videomode(0x12);
-+        if (get_videomode() != 0x12) {
-+            set_videomode(saved_videomode);
-+            return 0;
-+        }
-+        graphics_inited = 1;
-+    }
-+    else
-+        return 1;
-+
-+    font8x16 = (unsigned char*)graphics_get_font();
-+
-+    /* make sure that the highlight color is set correctly */
-+    graphics_highlight_color = ((graphics_normal_color >> 4) | 
-+                                ((graphics_normal_color & 0xf) << 4));
-+
-+    graphics_cls();
-+
-+    if (!read_image(splashimage)) {
-+        grub_printf("Failed to read splash image (%s)\n", splashimage);
-+        grub_printf("Press any key to continue...");
-+        getkey();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        return 0;
-+    }
-+
-+    set_int1c_handler();
-+
-+    return 1;
-+}
-+
-+/* Leave graphics mode */
-+void graphics_end(void)
-+{
-+    if (graphics_inited) {
-+        unset_int1c_handler();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        no_cursor = 0;
-+    }
-+}
-+
-+/* Print ch on the screen.  Handle any needed scrolling or the like */
-+void graphics_putchar(int ch) {
-+    ch &= 0xff;
-+
-+    graphics_cursor(0);
-+
-+    if (ch == '\n') {
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(fontx, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        return;
-+    } else if (ch == '\r') {
-+        graphics_setxy(view_x0, fonty);
-+        graphics_cursor(1);
-+        return;
-+    }
-+
-+    graphics_cursor(0);
-+
-+    text[fonty * 80 + fontx] = ch;
-+    text[fonty * 80 + fontx] &= 0x00ff;
-+    if (graphics_current_color & 0xf0)
-+        text[fonty * 80 + fontx] |= 0x100;
-+
-+    graphics_cursor(0);
-+
-+    if ((fontx + 1) >= view_x1) {
-+        graphics_setxy(view_x0, fonty);
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(view_x0, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        do_more ();
-+        graphics_cursor(0);
-+    } else {
-+        graphics_setxy(fontx + 1, fonty);
-+    }
-+
-+    graphics_cursor(1);
-+}
-+
-+/* get the current location of the cursor */
-+int graphics_getxy(void) {
-+    return (fontx << 8) | fonty;
-+}
-+
-+void graphics_gotoxy(int x, int y) {
-+    graphics_cursor(0);
-+
-+    graphics_setxy(x, y);
-+
-+    graphics_cursor(1);
-+}
-+
-+void graphics_cls(void) {
-+    int i;
-+    unsigned char *mem, *s1, *s2, *s4, *s8;
-+
-+    graphics_cursor(0);
-+    graphics_gotoxy(view_x0, view_y0);
-+
-+    mem = (unsigned char*)VIDEOMEM;
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 80 * 30; i++)
-+        text[i] = ' ';
-+    graphics_cursor(1);
-+
-+    BitMask(0xff);
-+
-+    /* plane 1 */
-+    MapMask(1);
-+    grub_memcpy(mem, s1, 38400);
-+
-+    /* plane 2 */
-+    MapMask(2);
-+    grub_memcpy(mem, s2, 38400);
-+
-+    /* plane 3 */
-+    MapMask(4);
-+    grub_memcpy(mem, s4, 38400);
-+
-+    /* plane 4 */
-+    MapMask(8);
-+    grub_memcpy(mem, s8, 38400);
-+
-+    MapMask(15);
-+
-+    if (no_cursor) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+    }
-+}
-+
-+void graphics_setcolorstate (color_state state) {
-+    switch (state) {
-+    case COLOR_STATE_STANDARD:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    case COLOR_STATE_NORMAL:
-+        graphics_current_color = graphics_normal_color;
-+        break;
-+    case COLOR_STATE_HIGHLIGHT:
-+        graphics_current_color = graphics_highlight_color;
-+        break;
-+    default:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    }
-+
-+    graphics_color_state = state;
-+}
-+
-+void graphics_setcolor (int normal_color, int highlight_color) {
-+    graphics_normal_color = normal_color;
-+    graphics_highlight_color = highlight_color;
-+
-+    graphics_setcolorstate (graphics_color_state);
-+}
-+
-+int graphics_setcursor (int on) {
-+    if (!no_cursor && !on) {
-+        no_cursor = 1;
-+        unset_int1c_handler();
-+        graphics_cursor(0);
-+    }
-+    else if(no_cursor && on) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+        graphics_cursor(1);
-+    }
-+    return 0;
-+}
-+
-+/* Read in the splashscreen image and set the palette up appropriately.
-+ * Format of splashscreen is an xpm (can be gzipped) with 16 colors and
-+ * 640x480. */
-+int read_image(char *s)
-+{
-+    char buf[32], pal[16], c;
-+    unsigned char base, mask, *s1, *s2, *s4, *s8;
-+    unsigned i, len, idx, colors, x, y, width, height;
-+
-+    if (!grub_open(s))
-+        return 0;
-+
-+    /* read header */
-+    if (!grub_read((char*)&buf, 10) || grub_memcmp(buf, "/* XPM */\n", 10)) {
-+        grub_close();
-+        return 0;
-+    }
-+    
-+    /* parse info */
-+    while (grub_read(&c, 1)) {
-+        if (c == '"')
-+            break;
-+    }
-+
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    i = 0;
-+    width = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            width = width * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    height = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            height = height * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    colors = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            colors = colors * 10 + c - '0';
-+        else
-+            break;
-+    }
-+
-+    base = 0;
-+    while (grub_read(&c, 1) && c != '"')
-+        ;
-+
-+    /* palette */
-+    for (i = 0, idx = 1; i < colors; i++) {
-+        len = 0;
-+
-+        while (grub_read(&c, 1) && c != '"')
-+            ;
-+        grub_read(&c, 1);       /* char */
-+        base = c;
-+        grub_read(buf, 4);      /* \t c # */
-+
-+        while (grub_read(&c, 1) && c != '"') {
-+            if (len < sizeof(buf))
-+                buf[len++] = c;
-+        }
-+
-+        if (len == 6 && idx < 15) {
-+            int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2;
-+            int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2;
-+            int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2;
-+
-+            pal[idx] = base;
-+            graphics_set_palette(idx, r, g, b);
-+            ++idx;
-+        }
-+    }
-+
-+    x = y = len = 0;
-+
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 38400; i++)
-+        s1[i] = s2[i] = s4[i] = s8[i] = 0;
-+
-+    /* parse xpm data */
-+    while (y < height) {


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390150.1630687 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuWpt-00070p-60; Thu, 13 Aug 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 1390150.1630687; Thu, 13 Aug 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 1wuWpt-00070i-32; Thu, 13 Aug 2026 14:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1390150;
 Thu, 13 Aug 2026 14:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wuWps-00070X-2y
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 2026 14:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuWps-002B3Q-11
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuWps-00GyyD-05
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fgyjfTA4aIWAIZVMSQydLfbZ4giAERUFqy2GNet3fiQ=; b=AxPwURKDEjanLGNjLESYy0y5VA
	3o8Jxsy8e8IBviCiRcOiH5syXaHukIBKpG4GeDwnvfnEsVHPLO9WXlBokMX99D+wZl5vI6DB6jWmj
	EyQwkrxxZAjh9udOBUMzEo7Yy+cs6QgZJii13wc5laDSHU/r/xB309Xc8T22vpvRhU0c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] stubdom: remove support for building in 32-bit mode
Message-Id: <E1wuWps-00GyyD-05@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:55:12 +0000

commit 56785d6ba6291b1371ec7c57fd5c4436b22ec2a6
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:26 2026 +0200

    stubdom: remove support for building in 32-bit mode
    
    With the removal of grub-pv there is no 32-bit stubdom left.
    
    Remove 32-bit support from the stubdom build system.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 850e8544ca..2698bddc9d 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,15 +31,7 @@ endef
 $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_deps,$(lib))))
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-GNU_TARGET_ARCH:=i686
-endif
 
-ifeq ($(GNU_TARGET_ARCH), i686)
-TARGET_CFLAGS=
-NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
-STUBDOM_SUPPORTED=1
-endif
 ifeq ($(GNU_TARGET_ARCH), x86_64)
 TARGET_CFLAGS=-mno-red-zone
 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
@@ -179,9 +171,6 @@ gmp-$(GMP_VERSION).tar.bz2:
 	$(FETCHER) $@ $(GMP_URL)/$@
 
 .PHONY: cross-gmp
-ifeq ($(XEN_TARGET_ARCH), x86_32)
-   GMPEXT=ABI=32
-endif
 gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
 	tar xjf $<
 	rm $@ -rf || :
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390152.1630691 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuWq3-00074Q-78; Thu, 13 Aug 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 1390152.1630691; Thu, 13 Aug 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 1wuWq3-00074I-4Q; Thu, 13 Aug 2026 14:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1390152;
 Thu, 13 Aug 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 1wuWq2-000748-5h
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 2026 14: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 1wuWq2-002B3u-1I
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuWq2-00Gyz5-0M
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VVG07vag18VVaIhf4unEsWcKlgDhTXvlw+cbpaF/24I=; b=pixLwRPPL605fc1xZ+EgqvY6hF
	gddmCHqQE0jxMjQeivHtFH+SFoO4R9km45p7qLVBPEOCpM/CKseBW9wUMZXC0z0ckM1+9wtG/9rKm
	M+OSRKgbBZ9D0uomhcrV8s7HHiTBt6HZTa4tojUTQb5anP/KGUAUcGRV/un/UdAL9fU4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] stubdom: remove building of libxenguest and libxenctrl
Message-Id: <E1wuWq2-00Gyz5-0M@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:55:22 +0000

commit 6a94eaa2bf3fa06b05ed2dad3dd9116060235326
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:30 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:31 2026 +0200

    stubdom: remove building of libxenguest and libxenctrl
    
    grub-pv was the last user of the stubdom variants of libxenguest and
    libxenctrl.
    
    Remove both libraries from the stubdom build system.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2698bddc9d..40b6ececf1 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -256,9 +256,7 @@ $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 # libraries under tools/libs
 #######
 
-STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl guest manage
-
-LIBDEP_guest := cross-zlib
+STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel manage
 
 #######
 # common handling
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390153.1630695 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuWqD-000773-8M; Thu, 13 Aug 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 1390153.1630695; Thu, 13 Aug 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 1wuWqD-00076u-5l; Thu, 13 Aug 2026 14:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1390153;
 Thu, 13 Aug 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 1wuWqC-00076k-8a
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 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 1wuWqC-002B42-1Z
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuWqC-00Gz1T-0d
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mqj17pFdGVeInSQWxJhoCp37JjP75JnHol4I5/ZFIqM=; b=dq0bYDJVrwct3Xf6OyeqpgtkXD
	Nug5SrAtw/pAJ20PFn0OUIo1bRHEQp+wp1GPWaotzLlOkdB4hpbguAOzO/+nWQs4RmCG7M2wfU1Pr
	abcjFZsrc4HyDskpT215IHTQI/ha4f1PuTOqBQg3e3aihkqIkTsTn8h9tGdIrMY4BmHE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs: remove stale stubdom entries from stubdom.txt
Message-Id: <E1wuWqC-00Gz1T-0d@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:55:32 +0000

commit b01e4c0c36d91e05b3610268fb2eb173b48913b5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jul 20 10:18:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:11:36 2026 +0200

    docs: remove stale stubdom entries from stubdom.txt
    
    There are several stubdoms mentioned in docs/misc/stubdom.txt which
    no longer exist. Remove them.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 docs/misc/stubdom.txt | 69 ---------------------------------------------------
 1 file changed, 69 deletions(-)

diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt
index cfcba4ba96..3ee96d5063 100644
--- a/docs/misc/stubdom.txt
+++ b/docs/misc/stubdom.txt
@@ -85,72 +85,3 @@ To change the CD-ROM medium, libxl will:
 
 The stubdom must internally add /dev/xvdc to an fdset in QEMU with opaque set
 to "stub-devid:$devid".  libxl will lookup the fdset with that string.
-
-                                   PV-GRUB
-                                   =======
-
-  This replaces pygrub to boot domU images safely: it runs the regular grub
-inside the created domain itself and uses regular domU facilities to read the
-disk / fetch files from network etc. ; it eventually loads the PV kernel and
-chain-boots it.
-  
-Configuration
-=============
-
-In your PV config,
-
-- use pv-grub.gz as kernel:
-
-kernel = "pv-grub.gz"
-
-- set the path to menu.lst, as seen from the domU, in extra:
-
-extra = "(hd0,0)/boot/grub/menu.lst"
-
-or you can provide the content of a menu.lst stored in dom0 by passing it as a
-ramdisk:
-
-ramdisk = "/boot/domU-1-menu.lst"
-
-or you can also use a tftp path (dhcp will be automatically performed):
-
-extra = "(nd)/somepath/menu.lst"
-
-or you can set it in option 150 of your dhcp server and leave extra and ramdisk
-empty (dhcp will be automatically performed)
-
-Limitations
-===========
-
-- You can not boot a 64bit kernel with a 32bit-compiled PV-GRUB and vice-versa.
-To cross-compile a 32bit PV-GRUB,
-
-export XEN_TARGET_ARCH=x86_32
-
-- bootsplash is supported, but the ioemu backend does not yet support restart
-for use by the booted kernel.
-
-- PV-GRUB doesn't support virtualized partitions. For instance:
-
-disk = [ 'phy:hda7,hda7,w' ]
-
-will be seen by PV-GRUB as (hd0), not (hd0,6), since GRUB will not see any
-partition table.
-
-
-                                Your own stubdom
-                                ================
-
-  By running
-
-cd stubdom/
-make c-stubdom
-
-  or
-
-cd stubdom/
-make caml-stubdom
-
-  you can compile examples of C or caml stub domain kernels.  You can use these
-and the relevant Makefile rules as basis to build your own stub domain kernel.
-Available libraries are libc, libxc, libxs, zlib and libpci.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 13 14:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Aug 2026 14:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1390154.1630698 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wuWqN-0007Gm-Ax; Thu, 13 Aug 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 1390154.1630698; Thu, 13 Aug 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 1wuWqN-0007Ge-7A; Thu, 13 Aug 2026 14:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1390154;
 Thu, 13 Aug 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 1wuWqM-0007GW-CH
 for xen-changelog@lists.xenproject.org; Thu, 13 Aug 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 1wuWqM-002B4D-1v
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 2026 14:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wuWqM-00Gz2Z-10
 for xen-changelog@lists.xenproject.org;
 Thu, 13 Aug 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=sNSomF2g8bfgFvXEuye905BTveD+WwrCIfdD+KlBXEs=; b=HNZJOQ4FXXUAsRW5+MlGeSH/vm
	U7nGDSA12rEMG5L6owZzGQv2rprvJe1QQ8buNO3SKE6zPnQhf46cCvkfBHEChL4sLQHqUN/7hcjDh
	50v9Q8SdcrsEk0mW1pw3B0AT0Ax2fFwV8c04jrsEhUruGbm3YyGB1uc7m8a2j1ll8AcI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: reduce dependencies on x86_emulate/x86_emulate.h
Message-Id: <E1wuWqM-00Gz2Z-10@xenbits.xenproject.org>
Date: Thu, 13 Aug 2026 14:55:42 +0000

commit 0a249bcb0279a99b7ddad683fcc84a5e256c13f1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Aug 13 15:12:51 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 13 15:12:51 2026 +0200

    x86: reduce dependencies on x86_emulate/x86_emulate.h
    
    Split out struct x86_event to an entirely separate header, and move a few
    other items describing the architecture to a new x86-types.h. With a few
    forward decls of structures and with a fair number of new #include-s in
    .c files, the inclusion of x86_emulate.h (and hence
    x86_emulate/x86_emulate.h) can be dropped from all header files except
    hvm/emulate.h; it needs additionally adding to hvm/ioreq.h though.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/Makefile       |  2 +-
 tools/tests/x86_emulator/x86-emulate.h  |  2 +
 xen/arch/x86/emul-i8254.c               |  1 +
 xen/arch/x86/hvm/hpet.c                 |  2 +
 xen/arch/x86/hvm/mmio.c                 |  1 +
 xen/arch/x86/hvm/pmtimer.c              |  2 +
 xen/arch/x86/hvm/rtc.c                  |  9 ++--
 xen/arch/x86/hvm/stdvga.c               |  2 +
 xen/arch/x86/hvm/svm/nestedsvm.c        |  1 +
 xen/arch/x86/hvm/svm/vmcb.h             |  2 +-
 xen/arch/x86/hvm/vioapic.c              |  1 +
 xen/arch/x86/hvm/viridian/private.h     |  2 +
 xen/arch/x86/hvm/vmx/vvmx.c             |  1 +
 xen/arch/x86/hvm/vpic.c                 |  1 +
 xen/arch/x86/include/asm/domain.h       |  3 +-
 xen/arch/x86/include/asm/hvm/hvm.h      |  4 +-
 xen/arch/x86/include/asm/hvm/ioreq.h    |  2 +
 xen/arch/x86/include/asm/hvm/vcpu.h     |  2 +
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  2 +
 xen/arch/x86/include/asm/mce.h          |  1 +
 xen/arch/x86/include/asm/mm.h           |  1 -
 xen/arch/x86/include/asm/x86-event.h    | 31 ++++++++++++++
 xen/arch/x86/include/asm/x86-types.h    | 76 +++++++++++++++++++++++++++++++++
 xen/arch/x86/msr.c                      |  1 +
 xen/arch/x86/pv/misc-hypercalls.c       |  1 +
 xen/arch/x86/x86_emulate/x86_emulate.h  | 76 +++------------------------------
 xen/drivers/vpci/msix.c                 |  1 +
 27 files changed, 151 insertions(+), 79 deletions(-)

diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 8210e83345..ff85bc88b1 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -305,7 +305,7 @@ $(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-integrated-as)
 HOSTCFLAGS += $(CFLAGS_xeninclude) -I. $(HOSTCFLAGS-$(XEN_COMPILE_ARCH))
 
 x86.h := $(addprefix $(XEN_ROOT)/tools/include/xen/asm/,\
-                     x86-vendors.h x86-defns.h msr-index.h) \
+                     x86-vendors.h x86-defns.h x86-types.h x86-event.h msr-index.h) \
          $(addprefix $(XEN_ROOT)/tools/include/xen/lib/x86/, \
                      cpu-policy.h cpuid-autogen.h)
 x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h $(x86.h)
diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h
index 62ebd881c9..bcb012f155 100644
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -38,6 +38,8 @@
 
 #include <xen/asm/msr-index.h>
 #include <xen/asm/x86-defns.h>
+#include <xen/asm/x86-event.h>
+#include <xen/asm/x86-types.h>
 #include <xen/asm/x86-vendors.h>
 
 #include <xen-tools/common-macros.h>
diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index ceb0ef721e..012a40fa75 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -37,6 +37,7 @@
 #include <asm/hvm/save.h>
 #include <asm/hvm/vpt.h>
 #include <asm/time.h>
+#include <asm/x86_emulate.h>
 
 #define domain_vpit(x) (&(x)->arch.vpit)
 #define vcpu_vpit(x)   (domain_vpit((x)->domain))
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index e317ec1f5f..bdd6fa334d 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -11,6 +11,8 @@
 #include <asm/current.h>
 #include <asm/hpet.h>
 #include <asm/mc146818rtc.h>
+#include <asm/x86_emulate.h>
+
 #include <xen/sched.h>
 #include <xen/event.h>
 #include <xen/trace.h>
diff --git a/xen/arch/x86/hvm/mmio.c b/xen/arch/x86/hvm/mmio.c
index 0fc492f854..0c98eb380e 100644
--- a/xen/arch/x86/hvm/mmio.c
+++ b/xen/arch/x86/hvm/mmio.c
@@ -9,6 +9,7 @@
 #include <xen/mm.h>
 
 #include <asm/p2m.h>
+#include <asm/x86_emulate.h>
 
 static int cf_check subpage_mmio_accept(struct vcpu *v, unsigned long addr)
 {
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 87a7a01c9f..7247043269 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -11,6 +11,8 @@
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
 #include <asm/acpi.h> /* for hvm_acpi_power_button prototype */
+#include <asm/x86_emulate.h>
+
 #include <public/hvm/params.h>
 
 /* Slightly more readable port I/O addresses for the registers we intercept */
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 9895dd570c..9a53188dac 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -23,12 +23,15 @@
  */
 
 #include <xen/sched.h>
-#include <asm/mc146818rtc.h>
-#include <asm/hvm/vpt.h>
+#include <xen/trace.h>
+
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
+#include <asm/hvm/vpt.h>
 #include <asm/iocap.h>
-#include <xen/trace.h>
+#include <asm/mc146818rtc.h>
+#include <asm/x86_emulate.h>
+
 #include <public/hvm/params.h>
 
 #define USEC_PER_SEC    1000000UL
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index c3c43f59ee..fa426ab8a6 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -34,6 +34,8 @@
 #include <xen/numa.h>
 #include <xen/paging.h>
 
+#include <asm/x86_emulate.h>
+
 #define VGA_MEM_BASE 0xa0000
 #define VGA_MEM_SIZE 0x20000
 
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index b06124c2c9..91c9060720 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -11,6 +11,7 @@
 #include <asm/paging.h> /* paging_mode_hap */
 #include <asm/event.h> /* for local_event_delivery_(en|dis)able */
 #include <asm/p2m.h> /* p2m_get_pagetable, p2m_get_nestedp2m */
+#include <asm/x86_emulate.h>
 
 #include "nestedhvm.h"
 #include "svm.h"
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 13ccfd3ff9..3760f71a86 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -4,7 +4,7 @@
 
 #include <xen/types.h>
 
-#include <asm/x86_emulate.h>
+#include <asm/x86-types.h>
 
 struct vcpu;
 
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 7c725f9e47..222e59e2c2 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -38,6 +38,7 @@
 #include <asm/current.h>
 #include <asm/event.h>
 #include <asm/io_apic.h>
+#include <asm/x86_emulate.h>
 
 /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */
 #define IRQ0_SPECIAL_ROUTING 1
diff --git a/xen/arch/x86/hvm/viridian/private.h b/xen/arch/x86/hvm/viridian/private.h
index 1bf65c761c..8060ce0677 100644
--- a/xen/arch/x86/hvm/viridian/private.h
+++ b/xen/arch/x86/hvm/viridian/private.h
@@ -5,6 +5,8 @@
 
 #include <asm/hvm/save.h>
 #include <asm/hvm/viridian.h>
+#include <asm/x86_emulate.h>
+
 #include <public/hvm/params.h>
 
 int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val);
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e4cdfe55c1..a5aa5eb163 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -18,6 +18,7 @@
 #include <asm/msr.h>
 #include <asm/mtrr.h>
 #include <asm/p2m.h>
+#include <asm/x86_emulate.h>
 
 static DEFINE_PER_CPU(u64 *, vvmcs_buf);
 
diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 30ce367c08..97698da768 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -33,6 +33,7 @@
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/save.h>
+#include <asm/x86_emulate.h>
 
 #define vpic_domain(v) (container_of((v), struct domain, \
                                      arch.hvm.vpic[!(v)->is_master]))
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index e0ce8b4c39..50c048adb5 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -8,7 +8,8 @@
 #include <asm/e820.h>
 #include <asm/mce.h>
 #include <asm/vpmu.h>
-#include <asm/x86_emulate.h>
+#include <asm/x86-types.h>
+
 #include <public/vcpu.h>
 #include <public/hvm/hvm_info_table.h>
 
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index e7c1364802..0ce7d5d783 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -16,11 +16,13 @@
 #include <asm/current.h>
 #include <asm/hvm/asid.h>
 #include <asm/msr-index.h>
-#include <asm/x86_emulate.h>
+#include <asm/x86-event.h>
+#include <asm/x86-types.h>
 
 struct pirq; /* needed by pi_update_irte */
 struct hvm_hw_cpu;
 struct xen_domctl_createdomain;
+struct x86_event;
 
 #ifdef CONFIG_HVM_FEP
 /* Permit use of the Forced Emulation Prefix in HVM guests */
diff --git a/xen/arch/x86/include/asm/hvm/ioreq.h b/xen/arch/x86/include/asm/hvm/ioreq.h
index 84be14fd08..9f418c86e1 100644
--- a/xen/arch/x86/include/asm/hvm/ioreq.h
+++ b/xen/arch/x86/include/asm/hvm/ioreq.h
@@ -8,6 +8,8 @@
 #ifndef __ASM_X86_HVM_IOREQ_H__
 #define __ASM_X86_HVM_IOREQ_H__
 
+#include <asm/x86_emulate.h>
+
 /* This correlation must not be altered */
 #define IOREQ_STATUS_HANDLED     X86EMUL_OKAY
 #define IOREQ_STATUS_UNHANDLED   X86EMUL_UNHANDLEABLE
diff --git a/xen/arch/x86/include/asm/hvm/vcpu.h b/xen/arch/x86/include/asm/hvm/vcpu.h
index 2a14fa0a63..60d1c8f188 100644
--- a/xen/arch/x86/include/asm/hvm/vcpu.h
+++ b/xen/arch/x86/include/asm/hvm/vcpu.h
@@ -14,6 +14,8 @@
 #include <asm/hvm/vmx/vvmx.h>
 #include <asm/hvm/svm-types.h>
 #include <asm/mtrr.h>
+#include <asm/x86-event.h>
+
 #include <public/hvm/ioreq.h>
 
 struct hvm_vcpu_asid {
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index 88bded5190..f85a8c8bba 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -9,6 +9,8 @@
 
 #include <xen/mm.h>
 
+#include <asm/x86-types.h>
+
 extern void vmcs_dump_vcpu(struct vcpu *v);
 extern int vmx_vmcs_init(void);
 int cf_check vmx_cpu_up_prepare(unsigned int cpu);
diff --git a/xen/arch/x86/include/asm/mce.h b/xen/arch/x86/include/asm/mce.h
index 2ec47a71ae..65d8a27eca 100644
--- a/xen/arch/x86/include/asm/mce.h
+++ b/xen/arch/x86/include/asm/mce.h
@@ -35,6 +35,7 @@ struct vmce {
 
 struct domain;
 struct vcpu;
+struct hvm_vmce_vcpu;
 
 /* Guest vMCE MSRs virtualization */
 extern void vmce_init_vcpu(struct vcpu *v);
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 06c20ab8de..2254a7e3fe 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -8,7 +8,6 @@
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/uaccess.h>
-#include <asm/x86_emulate.h>
 
 /*
  * Per-page-frame information.
diff --git a/xen/arch/x86/include/asm/x86-event.h b/xen/arch/x86/include/asm/x86-event.h
new file mode 100644
index 0000000000..a8823c7cfc
--- /dev/null
+++ b/xen/arch/x86/include/asm/x86-event.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * x86-event.h
+ *
+ * Helper definitions for event handling, which aren't prescribed by the
+ * architecture itself.
+ */
+
+#ifndef X86_X86_EVENT_H
+#define X86_X86_EVENT_H
+
+#ifdef __XEN__
+# include <xen/types.h>
+#else
+# include <stdint.h>
+#endif
+
+#define X86_EVENT_NO_EC (-1)        /* No error code. */
+
+struct x86_event {
+    int16_t       vector;
+    uint8_t       type;         /* X86_ET_* */
+    uint8_t       insn_len;     /* Instruction length */
+    int32_t       error_code;   /* X86_EVENT_NO_EC if n/a */
+    union {
+        unsigned long cr2;         /* #PF */
+        unsigned long pending_dbg; /* #DB (new DR6 bits, positive polarity) */
+    };
+};
+
+#endif /* X86_X86_EVENT_H */
diff --git a/xen/arch/x86/include/asm/x86-types.h b/xen/arch/x86/include/asm/x86-types.h
new file mode 100644
index 0000000000..1c43421885
--- /dev/null
+++ b/xen/arch/x86/include/asm/x86-types.h
@@ -0,0 +1,76 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * x86-types.h
+ *
+ * Type definitions and basic helpers which are more or less directly
+ * describing aspects of the architecture.
+ */
+
+#ifndef X86_X86_TYPES_H
+#define X86_X86_TYPES_H
+
+#ifdef __XEN__
+# include <xen/types.h>
+#else
+# include <stdint.h>
+#endif
+
+/*
+ * Comprehensive enumeration of x86 segment registers.  Various bits of code
+ * rely on this order (general purpose before system, tr at the beginning of
+ * system).
+ */
+enum x86_segment {
+    /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
+    x86_seg_es,
+    x86_seg_cs,
+    x86_seg_ss,
+    x86_seg_ds,
+    x86_seg_fs,
+    x86_seg_gs,
+    /* System: Valid to use for implicit table references. */
+    x86_seg_tr,
+    x86_seg_ldtr,
+    x86_seg_gdtr,
+    x86_seg_idtr,
+    /* No Segment: For (system/normal) accesses which are already linear. */
+    x86_seg_sys,
+    x86_seg_none
+};
+
+static inline bool is_x86_user_segment(enum x86_segment seg)
+{
+    unsigned int idx = seg;
+
+    return idx <= x86_seg_gs;
+}
+static inline bool is_x86_system_segment(enum x86_segment seg)
+{
+    return seg >= x86_seg_tr && seg < x86_seg_none;
+}
+
+/*
+ * Full state of a segment register (visible and hidden portions).
+ * Chosen to match the format of an AMD SVM VMCB.
+ */
+struct segment_register {
+    uint16_t   sel;
+    union {
+        uint16_t attr;
+        struct {
+            uint16_t type:4;
+            uint16_t s:   1;
+            uint16_t dpl: 2;
+            uint16_t p:   1;
+            uint16_t avl: 1;
+            uint16_t l:   1;
+            uint16_t db:  1;
+            uint16_t g:   1;
+            uint16_t pad: 4;
+        };
+    };
+    uint32_t   limit;
+    uint64_t   base;
+};
+
+#endif	/* X86_X86_TYPES_H */
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index d10891dcfc..e9fa02a03f 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -22,6 +22,7 @@
 #include <asm/p2m.h>
 #include <asm/pv/domain.h>
 #include <asm/setup.h>
+#include <asm/x86_emulate.h>
 #include <asm/xstate.h>
 
 #include <public/hvm/params.h>
diff --git a/xen/arch/x86/pv/misc-hypercalls.c b/xen/arch/x86/pv/misc-hypercalls.c
index 34a0717540..b1fa9685f4 100644
--- a/xen/arch/x86/pv/misc-hypercalls.c
+++ b/xen/arch/x86/pv/misc-hypercalls.c
@@ -12,6 +12,7 @@
 #include <asm/debugreg.h>
 #include <asm/fsgsbase.h>
 #include <asm/traps.h>
+#include <asm/x86_emulate.h>
 
 long do_set_debugreg(int reg, unsigned long value)
 {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 0fd20747dc..534b1c46fa 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -13,6 +13,11 @@
 
 #include <xen/lib/x86/cpu-policy.h>
 
+#ifdef __XEN__
+# include <asm/x86-event.h>
+# include <asm/x86-types.h>
+#endif
+
 #define MAX_INST_LEN 15
 
 #if defined(__i386__)
@@ -25,77 +30,6 @@
 
 struct x86_emulate_ctxt;
 
-/*
- * Comprehensive enumeration of x86 segment registers.  Various bits of code
- * rely on this order (general purpose before system, tr at the beginning of
- * system).
- */
-enum x86_segment {
-    /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
-    x86_seg_es,
-    x86_seg_cs,
-    x86_seg_ss,
-    x86_seg_ds,
-    x86_seg_fs,
-    x86_seg_gs,
-    /* System: Valid to use for implicit table references. */
-    x86_seg_tr,
-    x86_seg_ldtr,
-    x86_seg_gdtr,
-    x86_seg_idtr,
-    /* No Segment: For (system/normal) accesses which are already linear. */
-    x86_seg_sys,
-    x86_seg_none
-};
-
-static inline bool is_x86_user_segment(enum x86_segment seg)
-{
-    unsigned int idx = seg;
-
-    return idx <= x86_seg_gs;
-}
-static inline bool is_x86_system_segment(enum x86_segment seg)
-{
-    return seg >= x86_seg_tr && seg < x86_seg_none;
-}
-
-#define X86_EVENT_NO_EC (-1)        /* No error code. */
-
-struct x86_event {
-    int16_t       vector;
-    uint8_t       type;         /* X86_ET_* */
-    uint8_t       insn_len;     /* Instruction length */
-    int32_t       error_code;   /* X86_EVENT_NO_EC if n/a */
-    union {
-        unsigned long cr2;         /* #PF */
-        unsigned long pending_dbg; /* #DB (new DR6 bits, positive polarity) */
-    };
-};
-
-/*
- * Full state of a segment register (visible and hidden portions).
- * Chosen to match the format of an AMD SVM VMCB.
- */
-struct segment_register {
-    uint16_t   sel;
-    union {
-        uint16_t attr;
-        struct {
-            uint16_t type:4;
-            uint16_t s:   1;
-            uint16_t dpl: 2;
-            uint16_t p:   1;
-            uint16_t avl: 1;
-            uint16_t l:   1;
-            uint16_t db:  1;
-            uint16_t g:   1;
-            uint16_t pad: 4;
-        };
-    };
-    uint32_t   limit;
-    uint64_t   base;
-};
-
 struct x86_emul_fpu_aux {
     unsigned long ip, dp;
     uint16_t cs, ds;
diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index bbe4f213ac..1f93a862da 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -25,6 +25,7 @@
 
 #include <asm/msi.h>
 #include <asm/p2m.h>
+#include <asm/x86_emulate.h>
 
 #define VMSIX_ADDR_IN_RANGE(addr, vpci, nr)                               \
     ((addr) >= vmsix_table_addr(vpci, nr) &&                              \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 06:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 06:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392483.1631430 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvqu6-0007VJ-Um; Mon, 17 Aug 2026 06:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392483.1631430; Mon, 17 Aug 2026 06:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvqu6-0007VA-Ro; Mon, 17 Aug 2026 06:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1392483;
 Mon, 17 Aug 2026 06: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 1wvqu6-0007V2-KU
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 06: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 1wvqu6-008mQM-1o
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 06:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvqu6-00BoT2-0i
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 06:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FUlsRqlva3jtL/OUZRHlAB9eARLYJajOA4uCz79BWGM=; b=Sob+tQGXy/TalxEji4/GL4AmTh
	tFXS/xAw4LHLpKMR+xTCyA/hGxgNLpUnkv8/utQ/F7tmhKppNQcvPbee8Td8mU4y9vGKY2JWBEZpZ
	FuQ7fxZqAxA2qBlFZLjRqDZOOZKmMKWFfpsjUx7g/lHnp3r3SyKl1t1oiHn/5fMMLnbQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] build: don't add -lm -lpci -lz to APP_LDLIBS
Message-Id: <E1wvqu6-00BoT2-0i@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 06:33:02 +0000

commit 26ceb2daf95dd9e7fed9c83d36be3aaf1a0fa8a1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 17 08:29:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 08:29:52 2026 +0200

    build: don't add -lm -lpci -lz to APP_LDLIBS
    
    libm, libpci and libz are not always needed, so don't add them to
    APP_LDLIBS just because libc is selected.
    
    In case they will be needed by someone, they should be added via a
    dedicated CONFIG option.
    
    Note that none of the currently supported Xen stubdoms is using them.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 Makefile | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Makefile b/Makefile
index a64913a..7510d5d 100644
--- a/Makefile
+++ b/Makefile
@@ -164,9 +164,6 @@ ifeq ($(CONFIG_LIBXENMANAGE),y)
 APP_LDLIBS += -L$(MANAGE_PATH) -whole-archive -lxenmanage -no-whole-archive
 LIBS += $(MANAGE_PATH)/libxenmanage.a
 endif
-APP_LDLIBS += -lpci
-APP_LDLIBS += -lz
-APP_LDLIBS += -lm
 LDLIBS += -lc
 endif
 
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 07:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 07:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392492.1631442 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvrUt-0004cB-O9; Mon, 17 Aug 2026 07:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392492.1631442; Mon, 17 Aug 2026 07: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 1wvrUt-0004c3-Lb; Mon, 17 Aug 2026 07:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1392492;
 Mon, 17 Aug 2026 07: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 1wvrUs-0004bx-Na
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 07: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 1wvrUs-008n8c-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 07:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvrUs-00CvhE-0u
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 07: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=lkrI2fYmdN9+JKZlot/ZN6JMihWflszsNSOkHG5vy5I=; b=fk56m/b49pHI7Axc+kktOe+eG4
	qbu1aRczc+hbhk6Tp0b1AfYYbBi41LCg8Ttm4JoMbkhPb9kgQe4seMZBlN4zydzXDLxi46DVPZFri
	A2AdXR8q1XMJaTFs8BMlNgioYGyzo6JTYDwLhH2eqVsVMofFmr9dnhE7BIYwrQgM3QhU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: drop unreachable EL0 check when emulating ACTLR
Message-Id: <E1wvrUs-00CvhE-0u@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 07:11:02 +0000

commit ddd5011e6266e768afd14c0fe66a122a000eee54
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 11 15:08:17 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 17 08:29:57 2026 +0200

    xen/arm: drop unreachable EL0 check when emulating ACTLR
    
    do_sysreg() and do_cp15_32() inject an undefined exception when the
    trapped access to ACTLR_EL1 (resp. ACTLR) originates from EL0. That
    branch cannot be taken. ACTLR_EL1 can be accessed by EL1 and above, and no
    enable makes them accessible at EL0. The only trap covering them,
    HCR_EL2.TACR (HCR.TAC on AArch32), applies to accesses from EL1 only.
    
    Refer Arm ARM (DDI 0487M.b) D1.4.5.6 "Prioritization of Synchronous
    exceptions": "attempting to execute an instruction that is defined to
    never be accessible at the current Exception level and Security state,
    regardless of any enables or traps" is priority 18, whereas an exception
    taken to EL2 as the result of a configuration control in HCR_EL2 is
    priority 24. The former wins, so an access from EL0 is UNDEFINED and the
    TACR trap is not taken.
    
    An EL0 access therefore never reaches EL2: it is taken to EL1, as Xen
    never sets HCR_EL2.TGE for guests, and it is reported with EC=0x00
    (Unknown reason) rather than EC=0x18/0x03.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/vsysreg.c | 2 --
 xen/arch/arm/vcpreg.c        | 2 --
 2 files changed, 4 deletions(-)

diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index d14258290f..d55a538ec4 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -94,8 +94,6 @@ void do_sysreg(struct cpu_user_regs *regs,
      * ARMv8 (DDI 0487A.d): D7.2.1
      */
     case HSR_SYSREG_ACTLR_EL1:
-        if ( regs_mode_is_user(regs) )
-            return inject_undef_exception(regs);
         if ( hsr.sysreg.read )
             set_user_reg(regs, regidx, v->arch.actlr);
         break;
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index e7c484f2c1..59a2b89a0e 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -216,8 +216,6 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
      * ARMv8 (DDI 0487A.d): G6.2.1
      */
     case HSR_CPREG32(ACTLR):
-        if ( regs_mode_is_user(regs) )
-            return inject_undef_exception(regs);
         if ( cp32.read )
             set_user_reg(regs, regidx, v->arch.actlr);
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 07:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 07:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392493.1631447 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvrV3-0004dz-PV; Mon, 17 Aug 2026 07:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392493.1631447; Mon, 17 Aug 2026 07: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 1wvrV3-0004dp-Mw; Mon, 17 Aug 2026 07:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1392493;
 Mon, 17 Aug 2026 07: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 1wvrV2-0004dh-GG
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 07: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 1wvrV2-008n8g-2L
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 07:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvrV2-00Cvqh-1M
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 07: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=ARkyhx1zlpXmjnxQg82UgX7NstN3oWBDaAA2VdeUeeg=; b=5W8WKL885eesJ/wY1DLNSMr8xK
	GK69f8uNn8jbu9O6mR6rAcaXg0iEqAfpjZdwL7k2egm39Vd5eKu7FufQG4w0WtRVwwD5M5tauOP5y
	zVsSzD5uLL98vKcCJD6ZEdBaKSEiNEacRsMU3O7Ys1GfSgc2ucKO66JopHd/uXGpJY/Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: drop incorrect EL0 accessibility comments for PMINTEN{SET,CLR}
Message-Id: <E1wvrV2-00Cvqh-1M@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 07:11:12 +0000

commit 87a8a5728e5936f088c94bd7960c70f9b1cef36e
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 11 15:08:18 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 17 08:30:11 2026 +0200

    xen/arm: drop incorrect EL0 accessibility comments for PMINTEN{SET,CLR}
    
    The comments on the PMINTENSET/PMINTENCLR cases claim that an EL0 access
    may be trapped to EL2 when MDCR_EL2.TPM is set, and that such a case is
    handled. Both are inaccurate. PMINTENSET_EL1/PMINTENCLR_EL1 are accessible
    at EL1 and above only, with no enable making them accessible at EL0.
    
    Arm ARM (DDI 0487M.b) D1.4.5.6 "Prioritization of Synchronous
    exceptions" orders the two exceptions. An access that is never
    accessible at the current Exception level regardless of any enables or
    traps is priority 18, whereas an exception taken to EL2 as the result of
    a configuration control in MDCR_EL2 is priority 24. An EL0 access is
    therefore UNDEFINED and taken to EL1.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/vsysreg.c | 4 ----
 xen/arch/arm/vcpreg.c        | 1 -
 2 files changed, 5 deletions(-)

diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index d55a538ec4..d9e3619dfb 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -227,10 +227,6 @@ void do_sysreg(struct cpu_user_regs *regs,
      */
     case HSR_SYSREG_PMINTENSET_EL1:
     case HSR_SYSREG_PMINTENCLR_EL1:
-        /*
-         * Accessible from EL1 only, but if EL0 trap happens handle as
-         * undef.
-         */
         return handle_raz_wi(regs, regidx, hsr.sysreg.read, hsr, 1);
     case HSR_SYSREG_PMUSERENR_EL0:
         /* RO at EL0. RAZ/WI at EL1 */
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index 59a2b89a0e..3205c7df46 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -292,7 +292,6 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
             return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMINTENSET):
     case HSR_CPREG32(PMINTENCLR):
-        /* EL1 only, however MDCR_EL2.TPM==1 means EL0 may trap here also. */
         return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMCR):
     case HSR_CPREG32(PMCNTENSET):
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 08:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 08:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392579.1631531 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvsQz-0000uH-Dr; Mon, 17 Aug 2026 08:11:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392579.1631531; Mon, 17 Aug 2026 08:11: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 1wvsQz-0000u9-BB; Mon, 17 Aug 2026 08:11:05 +0000
Received: by outflank-mailman (input) for mailman id 1392579;
 Mon, 17 Aug 2026 08:11: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 1wvsQx-0000ty-Pm
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 08:11: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 1wvsQx-008okO-1u
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:11:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvsQx-00EbHd-0f
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:11: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=H7ZF6J4AB5MXQx4dAX6qoJitvglIv27k0ZIcV2c/GMU=; b=HvQVYmr6MjAeIZoOOpBYR67vA8
	2VDWMcuHLdoMRd0kla9lzVS0uDAp4gsY3PXwSE9Gn0He+1n29mWH9diVOLtlsKzQTzKxRn4+8NoHT
	5MwUj34+Zkepx5wSNx7yOoDXDt5x/FsS7XTYu1mK5asDW4TFv+1dwIVLpcH10x4nH0tI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: drop unreachable EL0 check when emulating ACTLR
Message-Id: <E1wvsQx-00EbHd-0f@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 08:11:03 +0000

commit ddd5011e6266e768afd14c0fe66a122a000eee54
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 11 15:08:17 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 17 08:29:57 2026 +0200

    xen/arm: drop unreachable EL0 check when emulating ACTLR
    
    do_sysreg() and do_cp15_32() inject an undefined exception when the
    trapped access to ACTLR_EL1 (resp. ACTLR) originates from EL0. That
    branch cannot be taken. ACTLR_EL1 can be accessed by EL1 and above, and no
    enable makes them accessible at EL0. The only trap covering them,
    HCR_EL2.TACR (HCR.TAC on AArch32), applies to accesses from EL1 only.
    
    Refer Arm ARM (DDI 0487M.b) D1.4.5.6 "Prioritization of Synchronous
    exceptions": "attempting to execute an instruction that is defined to
    never be accessible at the current Exception level and Security state,
    regardless of any enables or traps" is priority 18, whereas an exception
    taken to EL2 as the result of a configuration control in HCR_EL2 is
    priority 24. The former wins, so an access from EL0 is UNDEFINED and the
    TACR trap is not taken.
    
    An EL0 access therefore never reaches EL2: it is taken to EL1, as Xen
    never sets HCR_EL2.TGE for guests, and it is reported with EC=0x00
    (Unknown reason) rather than EC=0x18/0x03.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/vsysreg.c | 2 --
 xen/arch/arm/vcpreg.c        | 2 --
 2 files changed, 4 deletions(-)

diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index d14258290f..d55a538ec4 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -94,8 +94,6 @@ void do_sysreg(struct cpu_user_regs *regs,
      * ARMv8 (DDI 0487A.d): D7.2.1
      */
     case HSR_SYSREG_ACTLR_EL1:
-        if ( regs_mode_is_user(regs) )
-            return inject_undef_exception(regs);
         if ( hsr.sysreg.read )
             set_user_reg(regs, regidx, v->arch.actlr);
         break;
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index e7c484f2c1..59a2b89a0e 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -216,8 +216,6 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
      * ARMv8 (DDI 0487A.d): G6.2.1
      */
     case HSR_CPREG32(ACTLR):
-        if ( regs_mode_is_user(regs) )
-            return inject_undef_exception(regs);
         if ( cp32.read )
             set_user_reg(regs, regidx, v->arch.actlr);
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 08:11:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 08:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392580.1631536 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvsR9-0000w2-FB; Mon, 17 Aug 2026 08:11:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392580.1631536; Mon, 17 Aug 2026 08:11: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 1wvsR9-0000vu-Cd; Mon, 17 Aug 2026 08:11:15 +0000
Received: by outflank-mailman (input) for mailman id 1392580;
 Mon, 17 Aug 2026 08:11: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 1wvsR7-0000vk-Ki
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 08:11: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 1wvsR7-008okS-2j
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:11:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvsR7-00Ebc0-1i
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:11: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=Yk8EH/jy2kvMwIj3fpvfvyM5tj0vDIm6EiD2dKIj7HA=; b=Aa/UIlDmSuhPCYE9rwLp89eKSM
	kDtveOEv0JbUHPRKh/6Im5EVIzkQ57FmUNKYYxl0x61vEtEIBwoUkgOnksolGEFCQuyhDIQijgQuN
	OHtniUiHJSYCf23UvZrjpOUtoED4qfGFcF17Itlb9GCtUNY6LdVxJUos7OUTyBxwAHYQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: drop incorrect EL0 accessibility comments for PMINTEN{SET,CLR}
Message-Id: <E1wvsR7-00Ebc0-1i@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 08:11:13 +0000

commit 87a8a5728e5936f088c94bd7960c70f9b1cef36e
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 11 15:08:18 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 17 08:30:11 2026 +0200

    xen/arm: drop incorrect EL0 accessibility comments for PMINTEN{SET,CLR}
    
    The comments on the PMINTENSET/PMINTENCLR cases claim that an EL0 access
    may be trapped to EL2 when MDCR_EL2.TPM is set, and that such a case is
    handled. Both are inaccurate. PMINTENSET_EL1/PMINTENCLR_EL1 are accessible
    at EL1 and above only, with no enable making them accessible at EL0.
    
    Arm ARM (DDI 0487M.b) D1.4.5.6 "Prioritization of Synchronous
    exceptions" orders the two exceptions. An access that is never
    accessible at the current Exception level regardless of any enables or
    traps is priority 18, whereas an exception taken to EL2 as the result of
    a configuration control in MDCR_EL2 is priority 24. An EL0 access is
    therefore UNDEFINED and taken to EL1.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm64/vsysreg.c | 4 ----
 xen/arch/arm/vcpreg.c        | 1 -
 2 files changed, 5 deletions(-)

diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index d55a538ec4..d9e3619dfb 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -227,10 +227,6 @@ void do_sysreg(struct cpu_user_regs *regs,
      */
     case HSR_SYSREG_PMINTENSET_EL1:
     case HSR_SYSREG_PMINTENCLR_EL1:
-        /*
-         * Accessible from EL1 only, but if EL0 trap happens handle as
-         * undef.
-         */
         return handle_raz_wi(regs, regidx, hsr.sysreg.read, hsr, 1);
     case HSR_SYSREG_PMUSERENR_EL0:
         /* RO at EL0. RAZ/WI at EL1 */
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index 59a2b89a0e..3205c7df46 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -292,7 +292,6 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
             return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMINTENSET):
     case HSR_CPREG32(PMINTENCLR):
-        /* EL1 only, however MDCR_EL2.TPM==1 means EL0 may trap here also. */
         return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMCR):
     case HSR_CPREG32(PMCNTENSET):
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 08:55:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 08:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392693.1631675 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvt7a-0004w9-10; Mon, 17 Aug 2026 08:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392693.1631675; Mon, 17 Aug 2026 08:55: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 1wvt7Z-0004vz-UG; Mon, 17 Aug 2026 08:55:05 +0000
Received: by outflank-mailman (input) for mailman id 1392693;
 Mon, 17 Aug 2026 08:55: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 1wvt7Y-0004t2-F1
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 08:55: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 1wvt7Y-008poo-10
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvt7X-00Fmtc-36
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55: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=t1vOtwJ9XYxPRTvDEBaerEO6fmjleQOauWo9v5SnFas=; b=SHRwyLLNz3VkwbsApPnes/0T0R
	id/JyIB192BZknXa15GFGpDePR0MxoXjvGkYwqi1Sl8m/JPvL47iP/rZDAv/h95SFbe/cF4HK8UyD
	KzVNf+k+g0K/2kjDPS6rB1KG2Q0jsyPcZlYMBSqvx38r7s4VCv1Dr3mJxWZEGkbJzP5I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM/dummy: fold cf_check into XSM_INLINE
Message-Id: <E1wvt7X-00Fmtc-36@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 08:55:03 +0000

commit 2824c819c6d83e4515e209dbc04d845ee21ba102
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:22:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:22:24 2026 +0200

    XSM/dummy: fold cf_check into XSM_INLINE
    
    Use of cf_check together with always_inline is pretty pointless, and with
    XSM=n none of the dummy handlers are supposed to have their address taken.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 176 ++++++++++++++++++++++++------------------------
 1 file changed, 88 insertions(+), 88 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 131631cb27..f554a9e380 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -54,7 +54,7 @@ void __xsm_action_mismatch_detected(void);
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
  */
-#define XSM_INLINE __maybe_unused
+#define XSM_INLINE __maybe_unused cf_check
 
 #define XSM_DEFAULT_ARG /* */
 #define XSM_DEFAULT_VOID void
@@ -104,7 +104,7 @@ static always_inline int xsm_default_action(
     }
 }
 
-static XSM_INLINE int cf_check xsm_set_system_active(void)
+static XSM_INLINE int xsm_set_system_active(void)
 {
     struct domain *d = current->domain;
 
@@ -121,34 +121,34 @@ static XSM_INLINE int cf_check xsm_set_system_active(void)
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_security_domaininfo(
+static XSM_INLINE void xsm_security_domaininfo(
     struct domain *d, struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int cf_check xsm_domain_create(
+static XSM_INLINE int xsm_domain_create(
     XSM_DEFAULT_ARG struct domain *d, uint32_t ssidref)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_getdomaininfo(
+static XSM_INLINE int xsm_getdomaininfo(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_XS_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_set_target(
+static XSM_INLINE int xsm_set_target(
     XSM_DEFAULT_ARG struct domain *d, struct domain *e)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_domctl(
+static XSM_INLINE int xsm_domctl(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl *op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -174,61 +174,61 @@ static XSM_INLINE int cf_check xsm_domctl(
     }
 }
 
-static XSM_INLINE int cf_check xsm_sysctl(
+static XSM_INLINE int xsm_sysctl(
     XSM_DEFAULT_ARG const struct xen_sysctl *op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_alloc_security_domain(struct domain *d)
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_free_security_domain(struct domain *d)
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
 {
     return;
 }
 
 #ifdef CONFIG_GRANT_TABLE
 
-static XSM_INLINE int cf_check xsm_grant_mapref(
+static XSM_INLINE int xsm_grant_mapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_unmapref(
+static XSM_INLINE int xsm_grant_unmapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_setup(
+static XSM_INLINE int xsm_grant_setup(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_transfer(
+static XSM_INLINE int xsm_grant_transfer(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_copy(
+static XSM_INLINE int xsm_grant_copy(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_query_size(
+static XSM_INLINE int xsm_grant_query_size(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -237,28 +237,28 @@ static XSM_INLINE int cf_check xsm_grant_query_size(
 
 #endif /* CONFIG_GRANT_TABLE */
 
-static XSM_INLINE int cf_check xsm_memory_exchange(
+static XSM_INLINE int xsm_memory_exchange(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_memory_adjust_reservation(
+static XSM_INLINE int xsm_memory_adjust_reservation(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_memory_stat_reservation(
+static XSM_INLINE int xsm_memory_stat_reservation(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_console_io(
+static XSM_INLINE int xsm_console_io(
     XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -272,21 +272,21 @@ static XSM_INLINE int cf_check xsm_console_io(
 }
 
 #ifdef CONFIG_KEXEC
-static XSM_INLINE int cf_check xsm_kexec(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_kexec(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 #endif
 
-static XSM_INLINE int cf_check xsm_schedop_shutdown(
+static XSM_INLINE int xsm_schedop_shutdown(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_memory_pin_page(
+static XSM_INLINE int xsm_memory_pin_page(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
     struct page_info *page)
 {
@@ -294,20 +294,20 @@ static XSM_INLINE int cf_check xsm_memory_pin_page(
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_unbound(
+static XSM_INLINE int xsm_evtchn_unbound(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn, domid_t id2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_interdomain(
+static XSM_INLINE int xsm_evtchn_interdomain(
     XSM_DEFAULT_ARG struct domain *d1, struct evtchn *chan1, struct domain *d2,
     struct evtchn *chan2)
 {
@@ -315,72 +315,72 @@ static XSM_INLINE int cf_check xsm_evtchn_interdomain(
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE void cf_check xsm_evtchn_close_post(struct evtchn *chn)
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_send(
+static XSM_INLINE int xsm_evtchn_send(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_status(
+static XSM_INLINE int xsm_evtchn_status(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_reset(
+static XSM_INLINE int xsm_evtchn_reset(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_alloc_security_evtchns(
+static XSM_INLINE int xsm_alloc_security_evtchns(
     struct evtchn chn[], unsigned int nr)
 {
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_free_security_evtchns(
+static XSM_INLINE void xsm_free_security_evtchns(
     struct evtchn chn[], unsigned int nr)
 {
     return;
 }
 
-static XSM_INLINE char *cf_check xsm_show_security_evtchn(
+static XSM_INLINE char *xsm_show_security_evtchn(
     struct domain *d, const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_INLINE int cf_check xsm_init_hardware_domain(
+static XSM_INLINE int xsm_init_hardware_domain(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_get_pod_target(
+static XSM_INLINE int xsm_get_pod_target(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_set_pod_target(
+static XSM_INLINE int xsm_set_pod_target(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_get_vnumainfo(
+static XSM_INLINE int xsm_get_vnumainfo(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -388,7 +388,7 @@ static XSM_INLINE int cf_check xsm_get_vnumainfo(
 }
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-static XSM_INLINE int cf_check xsm_get_device_group(
+static XSM_INLINE int xsm_get_device_group(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -398,14 +398,14 @@ static XSM_INLINE int cf_check xsm_get_device_group(
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
 
-static XSM_INLINE int cf_check xsm_resource_plug_pci(
+static XSM_INLINE int xsm_resource_plug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_resource_unplug_pci(
+static XSM_INLINE int xsm_resource_unplug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -416,14 +416,14 @@ static XSM_INLINE int cf_check xsm_resource_unplug_pci(
 
 #ifdef CONFIG_HAS_PCI
 
-static XSM_INLINE int cf_check xsm_resource_setup_pci(
+static XSM_INLINE int xsm_resource_setup_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
@@ -431,47 +431,47 @@ static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
 
 #endif /* CONFIG_HAS_PCI */
 
-static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
 #ifdef CONFIG_HYPFS
-static XSM_INLINE int cf_check xsm_hypfs_op(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 #endif
 
-static XSM_INLINE long cf_check xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
 
 #ifdef CONFIG_COMPAT
-static XSM_INLINE int cf_check xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
 #endif
 
-static XSM_INLINE char *cf_check xsm_show_irq_sid(int irq)
+static XSM_INLINE char *xsm_show_irq_sid(int irq)
 {
     return NULL;
 }
 
 #ifdef CONFIG_HAS_PIRQ
 
-static XSM_INLINE int cf_check xsm_map_domain_pirq(
+static XSM_INLINE int xsm_map_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
+static XSM_INLINE int xsm_unmap_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
@@ -480,49 +480,49 @@ static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
 
 #endif /* CONFIG_HAS_PIRQ */
 
-static XSM_INLINE int cf_check xsm_map_domain_irq(
+static XSM_INLINE int xsm_map_domain_irq(
     XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_bind_pt_irq(
+static XSM_INLINE int xsm_bind_pt_irq(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unbind_pt_irq(
+static XSM_INLINE int xsm_unbind_pt_irq(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_irq(
+static XSM_INLINE int xsm_unmap_domain_irq(
     XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_irq_permission(
+static XSM_INLINE int xsm_irq_permission(
     XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_iomem_permission(
+static XSM_INLINE int xsm_iomem_permission(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_iomem_mapping(
+static XSM_INLINE int xsm_iomem_mapping(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
@@ -530,7 +530,7 @@ static XSM_INLINE int cf_check xsm_iomem_mapping(
 }
 
 #ifdef CONFIG_HAS_VPCI
-static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
+static XSM_INLINE int xsm_iomem_mapping_vpci(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
@@ -539,7 +539,7 @@ static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
 #endif
 
 #ifdef CONFIG_HAS_PCI
-static XSM_INLINE int cf_check xsm_pci_config_permission(
+static XSM_INLINE int xsm_pci_config_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf, uint16_t start,
     uint16_t end, uint8_t access)
 {
@@ -548,21 +548,21 @@ static XSM_INLINE int cf_check xsm_pci_config_permission(
 }
 #endif /* CONFIG_HAS_PCI */
 
-static XSM_INLINE int cf_check xsm_add_to_physmap(
+static XSM_INLINE int xsm_add_to_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_remove_from_physmap(
+static XSM_INLINE int xsm_remove_from_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_map_gmfn_foreign(
+static XSM_INLINE int xsm_map_gmfn_foreign(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -571,14 +571,14 @@ static XSM_INLINE int cf_check xsm_map_gmfn_foreign(
 
 #ifdef CONFIG_HVM
 
-static XSM_INLINE int cf_check xsm_hvm_param(
+static XSM_INLINE int xsm_hvm_param(
     XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
+static XSM_INLINE int xsm_hvm_param_altp2mhvm(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -588,7 +588,7 @@ static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
 #endif /* CONFIG_HVM */
 
 #ifdef CONFIG_ALTP2M
-static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
+static XSM_INLINE int xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -610,7 +610,7 @@ static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
 #endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
-static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -618,7 +618,7 @@ static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_MEM_PAGING
-static XSM_INLINE int cf_check xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -626,14 +626,14 @@ static XSM_INLINE int cf_check xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_MEM_SHARING
-static XSM_INLINE int cf_check xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 #endif
 
-static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
+static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
@@ -641,27 +641,27 @@ static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 
 #ifdef CONFIG_X86
 
-static XSM_INLINE int cf_check xsm_mem_sharing_op(
+static XSM_INLINE int xsm_mem_sharing_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, cd);
 }
 
-static XSM_INLINE int cf_check xsm_apic(
+static XSM_INLINE int xsm_apic(
     XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_machine_memory_map(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_domain_memory_map(
+static XSM_INLINE int xsm_domain_memory_map(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -670,13 +670,13 @@ static XSM_INLINE int cf_check xsm_domain_memory_map(
 
 #ifdef CONFIG_PV
 
-static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_mmu_update(
+static XSM_INLINE int xsm_mmu_update(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t, struct domain *f,
     uint32_t flags)
 {
@@ -689,14 +689,14 @@ static XSM_INLINE int cf_check xsm_mmu_update(
     return rc;
 }
 
-static XSM_INLINE int cf_check xsm_mmuext_op(
+static XSM_INLINE int xsm_mmuext_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *f)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int cf_check xsm_update_va_mapping(
+static XSM_INLINE int xsm_update_va_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *f, l1_pgentry_t pte)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -705,28 +705,28 @@ static XSM_INLINE int cf_check xsm_update_va_mapping(
 
 #endif /* CONFIG_PV */
 
-static XSM_INLINE int cf_check xsm_priv_mapping(
+static XSM_INLINE int xsm_priv_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, t);
 }
 
-static XSM_INLINE int cf_check xsm_ioport_permission(
+static XSM_INLINE int xsm_ioport_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_ioport_mapping(
+static XSM_INLINE int xsm_ioport_mapping(
     XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_pmu_op(
+static XSM_INLINE int xsm_pmu_op(
     XSM_DEFAULT_ARG struct domain *d, unsigned int op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -745,7 +745,7 @@ static XSM_INLINE int cf_check xsm_pmu_op(
 #endif /* CONFIG_X86 */
 
 #ifdef CONFIG_IOREQ_SERVER
-static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -753,24 +753,24 @@ static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_ARGO
-static XSM_INLINE int cf_check xsm_argo_enable(const struct domain *d)
+static XSM_INLINE int xsm_argo_enable(const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_register_single_source(
+static XSM_INLINE int xsm_argo_register_single_source(
     const struct domain *d, const struct domain *t)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_register_any_source(
+static XSM_INLINE int xsm_argo_register_any_source(
     const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_send(
+static XSM_INLINE int xsm_argo_send(
     const struct domain *d, const struct domain *t)
 {
     return 0;
@@ -778,7 +778,7 @@ static XSM_INLINE int cf_check xsm_argo_send(
 
 #endif /* CONFIG_ARGO */
 
-static XSM_INLINE int cf_check xsm_get_domain_state(
+static XSM_INLINE int xsm_get_domain_state(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_XS_PRIV);
@@ -786,7 +786,7 @@ static XSM_INLINE int cf_check xsm_get_domain_state(
 }
 
 #include <public/version.h>
-static XSM_INLINE int cf_check xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
+static XSM_INLINE int xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( op )
@@ -813,7 +813,7 @@ static XSM_INLINE int cf_check xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
     }
 }
 
-static XSM_INLINE int cf_check xsm_domain_resource_map(
+static XSM_INLINE int xsm_domain_resource_map(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 08:55:16 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 08:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392699.1631680 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvt7k-00056H-45; Mon, 17 Aug 2026 08:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392699.1631680; Mon, 17 Aug 2026 08:55: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 1wvt7k-000569-0s; Mon, 17 Aug 2026 08:55:16 +0000
Received: by outflank-mailman (input) for mailman id 1392699;
 Mon, 17 Aug 2026 08:55: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 1wvt7i-00053o-7y
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 08:55: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 1wvt7i-008pos-1X
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvt7i-00FnAR-0X
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55: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=Cnl1JZmvCCLERqeZtMIgoA1PFB/l+Ap8jU7pUoW6m2Y=; b=B1xzcb7+aXYc3W1F/jo40+47Xn
	4RHuR72hjpx+l6xHZE1MryDhAi5Fq0gPHuevECQ7z0XA8Tkp30xNsfe5+z4QnAI/ZDuy5I83iSf6p
	OEkRfL2mewupkvdrccrFdDyy0aNrRHvNywpxL3OtevTDpB0U6SnyV541DFpCqXJSGf+s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM/dummy: drop redundant return statements
Message-Id: <E1wvt7i-00FnAR-0X@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 08:55:14 +0000

commit 60a90fd5b6c6e8cfe76727b6c24fb7b11c4c1713
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:22:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:22:53 2026 +0200

    XSM/dummy: drop redundant return statements
    
    They're meaningless when no value is returned.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f554a9e380..50bf962e72 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -123,9 +123,7 @@ static XSM_INLINE int xsm_set_system_active(void)
 
 static XSM_INLINE void xsm_security_domaininfo(
     struct domain *d, struct xen_domctl_getdomaininfo *info)
-{
-    return;
-}
+{}
 
 static XSM_INLINE int xsm_domain_create(
     XSM_DEFAULT_ARG struct domain *d, uint32_t ssidref)
@@ -187,9 +185,7 @@ static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 }
 
 static XSM_INLINE void xsm_free_security_domain(struct domain *d)
-{
-    return;
-}
+{}
 
 #ifdef CONFIG_GRANT_TABLE
 
@@ -316,9 +312,7 @@ static XSM_INLINE int xsm_evtchn_interdomain(
 }
 
 static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
-{
-    return;
-}
+{}
 
 static XSM_INLINE int xsm_evtchn_send(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
@@ -349,9 +343,7 @@ static XSM_INLINE int xsm_alloc_security_evtchns(
 
 static XSM_INLINE void xsm_free_security_evtchns(
     struct evtchn chn[], unsigned int nr)
-{
-    return;
-}
+{}
 
 static XSM_INLINE char *xsm_show_security_evtchn(
     struct domain *d, const struct evtchn *chn)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 08:55:26 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 08:55:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392702.1631683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvt7u-00058t-4w; Mon, 17 Aug 2026 08:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392702.1631683; Mon, 17 Aug 2026 08:55: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 1wvt7u-00058l-2G; Mon, 17 Aug 2026 08:55:26 +0000
Received: by outflank-mailman (input) for mailman id 1392702;
 Mon, 17 Aug 2026 08:55: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 1wvt7s-00058Y-BD
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 08:55: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 1wvt7s-008poz-1r
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvt7s-00FnHk-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55: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=wu+Y+nukM6QOf8IIRod9IrY6bbpc9OvG9yn1b4BG16w=; b=ANUAYl9FG51cxKQTcNnaFTcJSC
	t77n75PRkf4CIZ1q7qMh5XgAPyMjJkginrsjiVEYiFdKcWJNGiUY6blZ/mjiMVz/A86fGkwx7yUUM
	nTF29FjhlsRqW93cndJ+KuXiIgpg7gW7IPW6MVls05zlH4YGk9tmrNtkiLwcgJSCRobw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: suppress hypercall when XSM=n
Message-Id: <E1wvt7s-00FnHk-0t@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 08:55:24 +0000

commit 7f659ae00ac5a235d21fcee7816ed5958512dbd2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:23:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:23:18 2026 +0200

    XSM: suppress hypercall when XSM=n
    
    This can be easily done in hypercall-defs.c, thus avoiding the need to
    dive into xsm/ when building Xen, just to add code which does what is done
    for an absent hypercall handler anyway (returning -ENOSYS).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolution.com>
---
 xen/Makefile                 | 2 +-
 xen/include/hypercall-defs.c | 4 ++++
 xen/include/xsm/dummy.h      | 4 ++++
 xen/xsm/Makefile             | 4 ++--
 xen/xsm/xsm_core.c           | 4 ----
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index d10c29162f..8c56295493 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -458,7 +458,7 @@ CFLAGS += -I$(objtree)/arch/$(SRCARCH)/include/generated
 ALL_OBJS-y                := common/built_in.o
 ALL_OBJS-y                += drivers/built_in.o
 ALL_OBJS-y                += lib/built_in.o
-ALL_OBJS-y                += xsm/built_in.o
+ALL_OBJS-$(CONFIG_XSM)    += xsm/built_in.o
 ALL_OBJS-y                += arch/$(SRCARCH)/built_in.o
 ALL_OBJS-$(CONFIG_CRYPTO) += crypto/built_in.o
 
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index a625d634b6..48290b51e4 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -119,7 +119,9 @@ prefix: do PREFIX_compat
 xen_version(int cmd, void *arg)
 vcpu_op(int cmd, unsigned int vcpuid, void *arg)
 sched_op(int cmd, void *arg)
+#ifdef CONFIG_XSM
 xsm_op(void *op)
+#endif
 callback_op(int cmd, const void *arg)
 #ifdef CONFIG_ARGO
 argo_op(unsigned int cmd, void *arg1, void *arg2, unsigned long arg3, unsigned long arg4)
@@ -264,7 +266,9 @@ set_segment_base                   do:2     do:2     -        -        -
 #ifdef CONFIG_PV
 mmuext_op                          compat:2 do:2     compat   do       -
 #endif
+#ifdef CONFIG_XSM
 xsm_op                             compat   do       compat   do       do
+#endif
 nmi_op                             compat   do       -        -        -
 sched_op                           compat   do       compat   do       do
 callback_op                        compat   do       -        -        -
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 50bf962e72..59d35466e5 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -437,6 +437,8 @@ static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
 }
 #endif
 
+#ifdef CONFIG_XSM
+
 static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
@@ -449,6 +451,8 @@ static XSM_INLINE int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
 }
 #endif
 
+#endif /* CONFIG_XSM */
+
 static XSM_INLINE char *xsm_show_irq_sid(int irq)
 {
     return NULL;
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index cf0a728f1c..0059794dd5 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,6 +1,6 @@
 obj-y += xsm_core.o
-obj-$(CONFIG_XSM) += xsm_policy.o
-obj-$(CONFIG_XSM) += dummy.o
+obj-y += xsm_policy.o
+obj-y += dummy.o
 obj-$(CONFIG_XSM_SILO) += silo.o
 
 obj-$(CONFIG_XSM_FLASK) += flask/
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index b7e864a874..b7638d2bc1 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -18,8 +18,6 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef CONFIG_XSM
-
 #ifdef CONFIG_MULTIBOOT
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -216,8 +214,6 @@ bool __init has_xsm_magic(paddr_t start)
 }
 #endif
 
-#endif
-
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return xsm_do_xsm_op(op);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 08:55:36 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 08:55:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392703.1631687 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvt84-0005Bt-6j; Mon, 17 Aug 2026 08:55:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392703.1631687; Mon, 17 Aug 2026 08:55: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 1wvt84-0005Bl-3d; Mon, 17 Aug 2026 08:55:36 +0000
Received: by outflank-mailman (input) for mailman id 1392703;
 Mon, 17 Aug 2026 08:55: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 1wvt82-0005BJ-K5
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 08:55: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 1wvt82-008pp6-2k
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvt82-00Fnpq-1d
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 08:55: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=jN+x91FQbHgo3UXhdgAbNr/L4eZmF3p6LHhxc8hwkBA=; b=N8P7aYrar+r3ZRdSCV3q5Iwvxl
	eEFLEthcH5ftgYZEZjBjc9QTYVYiQ23rob0s8NZVPzhFG0idRuB3n3YUqCx1NXPgF8cF/bQy0zBaZ
	u99bl2wIAehedv0zDujvdFIf1f9UbxP7B6wURNoy5KgBpWyqjrHX5Ytzbmlpg+mSqwfA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] XSM: make XSM hooks well-formed ones
Message-Id: <E1wvt82-00Fnpq-1d@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 08:55:34 +0000

commit 5e2bbb53f5107fbbf319787f3961b5e8a4bcdc3a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:23:57 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:23:57 2026 +0200

    XSM: make XSM hooks well-formed ones
    
    For whatever reason they didn't have an xsm_default_t first argument (to
    cope with XSM=n mode), making it impossible to (easily) cover them in
    xsm/hooks.h.
    
    flask_do_xsm_op() is also changed to return int, as all the function ever
    returns is an int. This way no new machinery needs adding to xsm/hooks.h.
    Instead one piece of compat machinery can then be dropped from
    xsm/flask/flask_op.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h  |  2 +-
 xen/include/xsm/hooks.h  |  5 +++++
 xen/include/xsm/xsm.h    | 17 -----------------
 xen/xsm/dummy.c          |  5 -----
 xen/xsm/flask/flask_op.c |  7 ++-----
 xen/xsm/flask/hooks.c    |  6 ------
 xen/xsm/flask/private.h  |  4 ++--
 xen/xsm/xsm_core.c       |  4 ++--
 8 files changed, 12 insertions(+), 38 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 59d35466e5..7af5cbdfb7 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -439,7 +439,7 @@ static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
 
 #ifdef CONFIG_XSM
 
-static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE int xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 5bdb23f26d..1e558bf710 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -154,6 +154,11 @@ XSM_HOOK(int, dm_op, struct domain *)
 XSM_HOOK(int, xen_version, uint32_t)
 XSM_HOOK(int, domain_resource_map, struct domain *)
 
+XSM_HOOK(int, do_xsm_op, XEN_GUEST_HANDLE_PARAM(void))
+#ifdef CONFIG_COMPAT
+XSM_HOOK(int, do_compat_op, XEN_GUEST_HANDLE_PARAM(void))
+#endif
+
 #undef XSM_HOOK0
 #undef XSM_HOOK1
 #undef XSM_HOOK2
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 53c722f868..b94f0cd0fd 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -86,11 +86,6 @@ struct xsm_ops {
 
     char *(*show_irq_sid)(int irq);
 
-    long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
-#ifdef CONFIG_COMPAT
-    int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
-#endif
-
 #ifdef CONFIG_ARGO
     int (*argo_enable)(const struct domain *d);
     int (*argo_register_single_source)(const struct domain *d,
@@ -201,18 +196,6 @@ static inline char *xsm_show_irq_sid(int irq)
     return alternative_call(xsm_ops.show_irq_sid, irq);
 }
 
-static inline long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
-{
-    return alternative_call(xsm_ops.do_xsm_op, op);
-}
-
-#ifdef CONFIG_COMPAT
-static inline int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
-{
-    return alternative_call(xsm_ops.do_compat_op, op);
-}
-#endif
-
 #ifdef CONFIG_ARGO
 static inline int xsm_argo_enable(const struct domain *d)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index dfe1cf41c7..046c0cb59e 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -36,11 +36,6 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
 
     .show_irq_sid                  = xsm_show_irq_sid,
 
-    .do_xsm_op                     = xsm_do_xsm_op,
-#ifdef CONFIG_COMPAT
-    .do_compat_op                  = xsm_do_compat_op,
-#endif
-
 #ifdef CONFIG_ARGO
     .argo_enable                   = xsm_argo_enable,
     .argo_register_single_source   = xsm_argo_register_single_source,
diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index ea7dd10dc8..d2f04ca5ef 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -23,7 +23,6 @@
 #include <conditional.h>
 #include "private.h"
 
-#define ret_t long
 #define _copy_to_guest copy_to_guest
 #define _copy_from_guest copy_from_guest
 
@@ -606,7 +605,7 @@ static int flask_relabel_domain(const struct xen_flask_relabel *arg)
 
 #endif /* !COMPAT */
 
-ret_t cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
+int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
 {
     xen_flask_op_t op;
     int rv;
@@ -772,9 +771,7 @@ CHECK_flask_transition;
 #define flask_devicetree_label compat_devicetree_label
 
 #define xen_flask_op_t compat_flask_op_t
-#undef ret_t
-#define ret_t int
-#define do_flask_op compat_flask_op
+#define flask_do_xsm_op flask_do_compat_op
 
 #include "flask_op.c"
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 3cfdf6bf08..11a77f0e28 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1969,12 +1969,6 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = {
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .do_xsm_op = do_flask_op,
-
-#ifdef CONFIG_COMPAT
-    .do_compat_op = compat_flask_op,
-#endif
-
 #ifdef CONFIG_ARGO
     .argo_enable = flask_argo_enable,
     .argo_register_single_source = flask_argo_register_single_source,
diff --git a/xen/xsm/flask/private.h b/xen/xsm/flask/private.h
index 429f213cce..e443ad54aa 100644
--- a/xen/xsm/flask/private.h
+++ b/xen/xsm/flask/private.h
@@ -3,7 +3,7 @@
 
 #include <public/xen.h>
 
-long cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
-int cf_check compat_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+int cf_check flask_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
 
 #endif /* XSM_FLASK_PRIVATE */
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index b7638d2bc1..6a91940c4e 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -216,12 +216,12 @@ bool __init has_xsm_magic(paddr_t start)
 
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
-    return xsm_do_xsm_op(op);
+    return xsm_do_xsm_op(XSM_HOOK, op);
 }
 
 #ifdef CONFIG_COMPAT
 int compat_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
-    return xsm_do_compat_op(op);
+    return xsm_do_compat_op(XSM_HOOK, op);
 }
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 09:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 09:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392793.1631781 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtiJ-0000He-Vd; Mon, 17 Aug 2026 09:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392793.1631781; Mon, 17 Aug 2026 09:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtiJ-0000HX-Sk; Mon, 17 Aug 2026 09:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1392793;
 Mon, 17 Aug 2026 09:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wvtiI-0000GJ-Jh
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 09:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtiI-008qXp-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtiI-00GsMe-0y
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ewxbyhayqllR98F3FcZJOYvwooqUkJHEEnQoIuZmpbg=; b=z/pQIm3pxaNizrR3sDmYoaLfds
	FkCmdlDigQGR952a4wp2yfAcoGS7L/v00XXfKHva74SRbLP3dyitHbOikkkStPQKleiZg41hzIw+O
	TIMruvePInGInfaajM3CKZ61xNf0JSlyUCf5uQaE8Y9Iu1LHl5KA6GnfpgFiKnrSDYSY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM/dummy: fold cf_check into XSM_INLINE
Message-Id: <E1wvtiI-00GsMe-0y@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 09:33:02 +0000

commit 2824c819c6d83e4515e209dbc04d845ee21ba102
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:22:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:22:24 2026 +0200

    XSM/dummy: fold cf_check into XSM_INLINE
    
    Use of cf_check together with always_inline is pretty pointless, and with
    XSM=n none of the dummy handlers are supposed to have their address taken.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 176 ++++++++++++++++++++++++------------------------
 1 file changed, 88 insertions(+), 88 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 131631cb27..f554a9e380 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -54,7 +54,7 @@ void __xsm_action_mismatch_detected(void);
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
  */
-#define XSM_INLINE __maybe_unused
+#define XSM_INLINE __maybe_unused cf_check
 
 #define XSM_DEFAULT_ARG /* */
 #define XSM_DEFAULT_VOID void
@@ -104,7 +104,7 @@ static always_inline int xsm_default_action(
     }
 }
 
-static XSM_INLINE int cf_check xsm_set_system_active(void)
+static XSM_INLINE int xsm_set_system_active(void)
 {
     struct domain *d = current->domain;
 
@@ -121,34 +121,34 @@ static XSM_INLINE int cf_check xsm_set_system_active(void)
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_security_domaininfo(
+static XSM_INLINE void xsm_security_domaininfo(
     struct domain *d, struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int cf_check xsm_domain_create(
+static XSM_INLINE int xsm_domain_create(
     XSM_DEFAULT_ARG struct domain *d, uint32_t ssidref)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_getdomaininfo(
+static XSM_INLINE int xsm_getdomaininfo(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_XS_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_set_target(
+static XSM_INLINE int xsm_set_target(
     XSM_DEFAULT_ARG struct domain *d, struct domain *e)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_domctl(
+static XSM_INLINE int xsm_domctl(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl *op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -174,61 +174,61 @@ static XSM_INLINE int cf_check xsm_domctl(
     }
 }
 
-static XSM_INLINE int cf_check xsm_sysctl(
+static XSM_INLINE int xsm_sysctl(
     XSM_DEFAULT_ARG const struct xen_sysctl *op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_alloc_security_domain(struct domain *d)
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_free_security_domain(struct domain *d)
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
 {
     return;
 }
 
 #ifdef CONFIG_GRANT_TABLE
 
-static XSM_INLINE int cf_check xsm_grant_mapref(
+static XSM_INLINE int xsm_grant_mapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_unmapref(
+static XSM_INLINE int xsm_grant_unmapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_setup(
+static XSM_INLINE int xsm_grant_setup(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_transfer(
+static XSM_INLINE int xsm_grant_transfer(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_copy(
+static XSM_INLINE int xsm_grant_copy(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_query_size(
+static XSM_INLINE int xsm_grant_query_size(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -237,28 +237,28 @@ static XSM_INLINE int cf_check xsm_grant_query_size(
 
 #endif /* CONFIG_GRANT_TABLE */
 
-static XSM_INLINE int cf_check xsm_memory_exchange(
+static XSM_INLINE int xsm_memory_exchange(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_memory_adjust_reservation(
+static XSM_INLINE int xsm_memory_adjust_reservation(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_memory_stat_reservation(
+static XSM_INLINE int xsm_memory_stat_reservation(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_console_io(
+static XSM_INLINE int xsm_console_io(
     XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -272,21 +272,21 @@ static XSM_INLINE int cf_check xsm_console_io(
 }
 
 #ifdef CONFIG_KEXEC
-static XSM_INLINE int cf_check xsm_kexec(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_kexec(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 #endif
 
-static XSM_INLINE int cf_check xsm_schedop_shutdown(
+static XSM_INLINE int xsm_schedop_shutdown(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_memory_pin_page(
+static XSM_INLINE int xsm_memory_pin_page(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
     struct page_info *page)
 {
@@ -294,20 +294,20 @@ static XSM_INLINE int cf_check xsm_memory_pin_page(
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_unbound(
+static XSM_INLINE int xsm_evtchn_unbound(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn, domid_t id2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_interdomain(
+static XSM_INLINE int xsm_evtchn_interdomain(
     XSM_DEFAULT_ARG struct domain *d1, struct evtchn *chan1, struct domain *d2,
     struct evtchn *chan2)
 {
@@ -315,72 +315,72 @@ static XSM_INLINE int cf_check xsm_evtchn_interdomain(
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE void cf_check xsm_evtchn_close_post(struct evtchn *chn)
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_send(
+static XSM_INLINE int xsm_evtchn_send(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_status(
+static XSM_INLINE int xsm_evtchn_status(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_reset(
+static XSM_INLINE int xsm_evtchn_reset(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_alloc_security_evtchns(
+static XSM_INLINE int xsm_alloc_security_evtchns(
     struct evtchn chn[], unsigned int nr)
 {
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_free_security_evtchns(
+static XSM_INLINE void xsm_free_security_evtchns(
     struct evtchn chn[], unsigned int nr)
 {
     return;
 }
 
-static XSM_INLINE char *cf_check xsm_show_security_evtchn(
+static XSM_INLINE char *xsm_show_security_evtchn(
     struct domain *d, const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_INLINE int cf_check xsm_init_hardware_domain(
+static XSM_INLINE int xsm_init_hardware_domain(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_get_pod_target(
+static XSM_INLINE int xsm_get_pod_target(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_set_pod_target(
+static XSM_INLINE int xsm_set_pod_target(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_get_vnumainfo(
+static XSM_INLINE int xsm_get_vnumainfo(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -388,7 +388,7 @@ static XSM_INLINE int cf_check xsm_get_vnumainfo(
 }
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-static XSM_INLINE int cf_check xsm_get_device_group(
+static XSM_INLINE int xsm_get_device_group(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -398,14 +398,14 @@ static XSM_INLINE int cf_check xsm_get_device_group(
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
 
-static XSM_INLINE int cf_check xsm_resource_plug_pci(
+static XSM_INLINE int xsm_resource_plug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_resource_unplug_pci(
+static XSM_INLINE int xsm_resource_unplug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -416,14 +416,14 @@ static XSM_INLINE int cf_check xsm_resource_unplug_pci(
 
 #ifdef CONFIG_HAS_PCI
 
-static XSM_INLINE int cf_check xsm_resource_setup_pci(
+static XSM_INLINE int xsm_resource_setup_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
@@ -431,47 +431,47 @@ static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
 
 #endif /* CONFIG_HAS_PCI */
 
-static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
 #ifdef CONFIG_HYPFS
-static XSM_INLINE int cf_check xsm_hypfs_op(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 #endif
 
-static XSM_INLINE long cf_check xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
 
 #ifdef CONFIG_COMPAT
-static XSM_INLINE int cf_check xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
 #endif
 
-static XSM_INLINE char *cf_check xsm_show_irq_sid(int irq)
+static XSM_INLINE char *xsm_show_irq_sid(int irq)
 {
     return NULL;
 }
 
 #ifdef CONFIG_HAS_PIRQ
 
-static XSM_INLINE int cf_check xsm_map_domain_pirq(
+static XSM_INLINE int xsm_map_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
+static XSM_INLINE int xsm_unmap_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
@@ -480,49 +480,49 @@ static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
 
 #endif /* CONFIG_HAS_PIRQ */
 
-static XSM_INLINE int cf_check xsm_map_domain_irq(
+static XSM_INLINE int xsm_map_domain_irq(
     XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_bind_pt_irq(
+static XSM_INLINE int xsm_bind_pt_irq(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unbind_pt_irq(
+static XSM_INLINE int xsm_unbind_pt_irq(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_irq(
+static XSM_INLINE int xsm_unmap_domain_irq(
     XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_irq_permission(
+static XSM_INLINE int xsm_irq_permission(
     XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_iomem_permission(
+static XSM_INLINE int xsm_iomem_permission(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_iomem_mapping(
+static XSM_INLINE int xsm_iomem_mapping(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
@@ -530,7 +530,7 @@ static XSM_INLINE int cf_check xsm_iomem_mapping(
 }
 
 #ifdef CONFIG_HAS_VPCI
-static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
+static XSM_INLINE int xsm_iomem_mapping_vpci(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
@@ -539,7 +539,7 @@ static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
 #endif
 
 #ifdef CONFIG_HAS_PCI
-static XSM_INLINE int cf_check xsm_pci_config_permission(
+static XSM_INLINE int xsm_pci_config_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf, uint16_t start,
     uint16_t end, uint8_t access)
 {
@@ -548,21 +548,21 @@ static XSM_INLINE int cf_check xsm_pci_config_permission(
 }
 #endif /* CONFIG_HAS_PCI */
 
-static XSM_INLINE int cf_check xsm_add_to_physmap(
+static XSM_INLINE int xsm_add_to_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_remove_from_physmap(
+static XSM_INLINE int xsm_remove_from_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_map_gmfn_foreign(
+static XSM_INLINE int xsm_map_gmfn_foreign(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -571,14 +571,14 @@ static XSM_INLINE int cf_check xsm_map_gmfn_foreign(
 
 #ifdef CONFIG_HVM
 
-static XSM_INLINE int cf_check xsm_hvm_param(
+static XSM_INLINE int xsm_hvm_param(
     XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
+static XSM_INLINE int xsm_hvm_param_altp2mhvm(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -588,7 +588,7 @@ static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
 #endif /* CONFIG_HVM */
 
 #ifdef CONFIG_ALTP2M
-static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
+static XSM_INLINE int xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -610,7 +610,7 @@ static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
 #endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
-static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -618,7 +618,7 @@ static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_MEM_PAGING
-static XSM_INLINE int cf_check xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -626,14 +626,14 @@ static XSM_INLINE int cf_check xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_MEM_SHARING
-static XSM_INLINE int cf_check xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 #endif
 
-static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
+static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
@@ -641,27 +641,27 @@ static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 
 #ifdef CONFIG_X86
 
-static XSM_INLINE int cf_check xsm_mem_sharing_op(
+static XSM_INLINE int xsm_mem_sharing_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, cd);
 }
 
-static XSM_INLINE int cf_check xsm_apic(
+static XSM_INLINE int xsm_apic(
     XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_machine_memory_map(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_domain_memory_map(
+static XSM_INLINE int xsm_domain_memory_map(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -670,13 +670,13 @@ static XSM_INLINE int cf_check xsm_domain_memory_map(
 
 #ifdef CONFIG_PV
 
-static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_mmu_update(
+static XSM_INLINE int xsm_mmu_update(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t, struct domain *f,
     uint32_t flags)
 {
@@ -689,14 +689,14 @@ static XSM_INLINE int cf_check xsm_mmu_update(
     return rc;
 }
 
-static XSM_INLINE int cf_check xsm_mmuext_op(
+static XSM_INLINE int xsm_mmuext_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *f)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int cf_check xsm_update_va_mapping(
+static XSM_INLINE int xsm_update_va_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *f, l1_pgentry_t pte)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -705,28 +705,28 @@ static XSM_INLINE int cf_check xsm_update_va_mapping(
 
 #endif /* CONFIG_PV */
 
-static XSM_INLINE int cf_check xsm_priv_mapping(
+static XSM_INLINE int xsm_priv_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, t);
 }
 
-static XSM_INLINE int cf_check xsm_ioport_permission(
+static XSM_INLINE int xsm_ioport_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_ioport_mapping(
+static XSM_INLINE int xsm_ioport_mapping(
     XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_pmu_op(
+static XSM_INLINE int xsm_pmu_op(
     XSM_DEFAULT_ARG struct domain *d, unsigned int op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -745,7 +745,7 @@ static XSM_INLINE int cf_check xsm_pmu_op(
 #endif /* CONFIG_X86 */
 
 #ifdef CONFIG_IOREQ_SERVER
-static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -753,24 +753,24 @@ static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 #endif
 
 #ifdef CONFIG_ARGO
-static XSM_INLINE int cf_check xsm_argo_enable(const struct domain *d)
+static XSM_INLINE int xsm_argo_enable(const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_register_single_source(
+static XSM_INLINE int xsm_argo_register_single_source(
     const struct domain *d, const struct domain *t)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_register_any_source(
+static XSM_INLINE int xsm_argo_register_any_source(
     const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_send(
+static XSM_INLINE int xsm_argo_send(
     const struct domain *d, const struct domain *t)
 {
     return 0;
@@ -778,7 +778,7 @@ static XSM_INLINE int cf_check xsm_argo_send(
 
 #endif /* CONFIG_ARGO */
 
-static XSM_INLINE int cf_check xsm_get_domain_state(
+static XSM_INLINE int xsm_get_domain_state(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_XS_PRIV);
@@ -786,7 +786,7 @@ static XSM_INLINE int cf_check xsm_get_domain_state(
 }
 
 #include <public/version.h>
-static XSM_INLINE int cf_check xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
+static XSM_INLINE int xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( op )
@@ -813,7 +813,7 @@ static XSM_INLINE int cf_check xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
     }
 }
 
-static XSM_INLINE int cf_check xsm_domain_resource_map(
+static XSM_INLINE int xsm_domain_resource_map(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 09:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 09:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392798.1631785 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtiU-0000PR-2Y; Mon, 17 Aug 2026 09:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392798.1631785; Mon, 17 Aug 2026 09:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtiT-0000PJ-WC; Mon, 17 Aug 2026 09:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1392798;
 Mon, 17 Aug 2026 09:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wvtiS-0000P7-FG
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 09:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtiS-008qZb-2D
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtiS-00GsN0-1I
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qQj6KIeY5qbXeYhyTD4FO0qqkRpZpblGlKkVGOk7/rU=; b=a1IDo5xnBX8CUgddg/W1ayGX8E
	KZqrs6DAv4+SjqeK+UCwQudPO5L5O2wW7itYpqQuTizK9vOWi4dG0l+MXi8DbR0GHAwZjY7CZ0X4y
	yvToAJ1NY83vN2O22xx87hAZKrxobjg5vZvkZ0meAl76U0OrQn/5Np1iA2MBwDvcbDnY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM/dummy: drop redundant return statements
Message-Id: <E1wvtiS-00GsN0-1I@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 09:33:12 +0000

commit 60a90fd5b6c6e8cfe76727b6c24fb7b11c4c1713
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:22:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:22:53 2026 +0200

    XSM/dummy: drop redundant return statements
    
    They're meaningless when no value is returned.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index f554a9e380..50bf962e72 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -123,9 +123,7 @@ static XSM_INLINE int xsm_set_system_active(void)
 
 static XSM_INLINE void xsm_security_domaininfo(
     struct domain *d, struct xen_domctl_getdomaininfo *info)
-{
-    return;
-}
+{}
 
 static XSM_INLINE int xsm_domain_create(
     XSM_DEFAULT_ARG struct domain *d, uint32_t ssidref)
@@ -187,9 +185,7 @@ static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 }
 
 static XSM_INLINE void xsm_free_security_domain(struct domain *d)
-{
-    return;
-}
+{}
 
 #ifdef CONFIG_GRANT_TABLE
 
@@ -316,9 +312,7 @@ static XSM_INLINE int xsm_evtchn_interdomain(
 }
 
 static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
-{
-    return;
-}
+{}
 
 static XSM_INLINE int xsm_evtchn_send(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
@@ -349,9 +343,7 @@ static XSM_INLINE int xsm_alloc_security_evtchns(
 
 static XSM_INLINE void xsm_free_security_evtchns(
     struct evtchn chn[], unsigned int nr)
-{
-    return;
-}
+{}
 
 static XSM_INLINE char *xsm_show_security_evtchn(
     struct domain *d, const struct evtchn *chn)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 09:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 09:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392799.1631789 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtie-0000RV-48; Mon, 17 Aug 2026 09:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392799.1631789; Mon, 17 Aug 2026 09:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtie-0000RL-1J; Mon, 17 Aug 2026 09:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1392799;
 Mon, 17 Aug 2026 09:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wvtic-0000RA-Kn
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 09:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtic-008qZf-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtic-00GsYS-1b
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UUsI9I79UUc6TUEkMfJ1PhrJd1bGmF8X2iJ30tH+y3k=; b=joNMMfct0AHOyK0DbrnXx9xJ6p
	+d7uZxD6hS8H8LN5LAMhEJ9wAn00/MZ9mk9oohsOqdZUtP2K8vPShiZv8wglMbVvZCCAI31uSxFKF
	tmY4ccSh2rRNCYAaGWAX50VfSLq1yWhxq9i3cXCd5xgo5cfb59F6GN+yHSd75edvUaOg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: suppress hypercall when XSM=n
Message-Id: <E1wvtic-00GsYS-1b@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 09:33:22 +0000

commit 7f659ae00ac5a235d21fcee7816ed5958512dbd2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:23:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:23:18 2026 +0200

    XSM: suppress hypercall when XSM=n
    
    This can be easily done in hypercall-defs.c, thus avoiding the need to
    dive into xsm/ when building Xen, just to add code which does what is done
    for an absent hypercall handler anyway (returning -ENOSYS).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolution.com>
---
 xen/Makefile                 | 2 +-
 xen/include/hypercall-defs.c | 4 ++++
 xen/include/xsm/dummy.h      | 4 ++++
 xen/xsm/Makefile             | 4 ++--
 xen/xsm/xsm_core.c           | 4 ----
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index d10c29162f..8c56295493 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -458,7 +458,7 @@ CFLAGS += -I$(objtree)/arch/$(SRCARCH)/include/generated
 ALL_OBJS-y                := common/built_in.o
 ALL_OBJS-y                += drivers/built_in.o
 ALL_OBJS-y                += lib/built_in.o
-ALL_OBJS-y                += xsm/built_in.o
+ALL_OBJS-$(CONFIG_XSM)    += xsm/built_in.o
 ALL_OBJS-y                += arch/$(SRCARCH)/built_in.o
 ALL_OBJS-$(CONFIG_CRYPTO) += crypto/built_in.o
 
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index a625d634b6..48290b51e4 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -119,7 +119,9 @@ prefix: do PREFIX_compat
 xen_version(int cmd, void *arg)
 vcpu_op(int cmd, unsigned int vcpuid, void *arg)
 sched_op(int cmd, void *arg)
+#ifdef CONFIG_XSM
 xsm_op(void *op)
+#endif
 callback_op(int cmd, const void *arg)
 #ifdef CONFIG_ARGO
 argo_op(unsigned int cmd, void *arg1, void *arg2, unsigned long arg3, unsigned long arg4)
@@ -264,7 +266,9 @@ set_segment_base                   do:2     do:2     -        -        -
 #ifdef CONFIG_PV
 mmuext_op                          compat:2 do:2     compat   do       -
 #endif
+#ifdef CONFIG_XSM
 xsm_op                             compat   do       compat   do       do
+#endif
 nmi_op                             compat   do       -        -        -
 sched_op                           compat   do       compat   do       do
 callback_op                        compat   do       -        -        -
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 50bf962e72..59d35466e5 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -437,6 +437,8 @@ static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
 }
 #endif
 
+#ifdef CONFIG_XSM
+
 static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
@@ -449,6 +451,8 @@ static XSM_INLINE int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
 }
 #endif
 
+#endif /* CONFIG_XSM */
+
 static XSM_INLINE char *xsm_show_irq_sid(int irq)
 {
     return NULL;
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index cf0a728f1c..0059794dd5 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,6 +1,6 @@
 obj-y += xsm_core.o
-obj-$(CONFIG_XSM) += xsm_policy.o
-obj-$(CONFIG_XSM) += dummy.o
+obj-y += xsm_policy.o
+obj-y += dummy.o
 obj-$(CONFIG_XSM_SILO) += silo.o
 
 obj-$(CONFIG_XSM_FLASK) += flask/
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index b7e864a874..b7638d2bc1 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -18,8 +18,6 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef CONFIG_XSM
-
 #ifdef CONFIG_MULTIBOOT
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -216,8 +214,6 @@ bool __init has_xsm_magic(paddr_t start)
 }
 #endif
 
-#endif
-
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return xsm_do_xsm_op(op);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 09:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 09:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392800.1631793 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtio-0000Tk-5Q; Mon, 17 Aug 2026 09:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392800.1631793; Mon, 17 Aug 2026 09:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvtio-0000Ta-2f; Mon, 17 Aug 2026 09:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1392800;
 Mon, 17 Aug 2026 09:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wvtim-0000TQ-OL
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 09:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtim-008qZl-39
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvtim-00Gsd9-2C
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 09:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IpfjI2oYdPTY0n5NGGNEVYIY+2NiL+vSr5izWZMx7Zw=; b=JV/0Q5L3/xjg6jceRpFZsAiMF0
	fm7vgwcRsyE4ljdEOb/orCkUZPAAWLFYz0jXrs/H1ePdtHLlv9NoqlteWPR5FUTx0fgJwzJAtQV3W
	B1USEHkjX1C/+Gaeu2xXr4EeROd0toWHc4p/31JPMCbZxjWHj1BDtvRG3RJ3wWX6mv34=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] XSM: make XSM hooks well-formed ones
Message-Id: <E1wvtim-00Gsd9-2C@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 09:33:32 +0000

commit 5e2bbb53f5107fbbf319787f3961b5e8a4bcdc3a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 17 09:23:57 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 17 09:23:57 2026 +0200

    XSM: make XSM hooks well-formed ones
    
    For whatever reason they didn't have an xsm_default_t first argument (to
    cope with XSM=n mode), making it impossible to (easily) cover them in
    xsm/hooks.h.
    
    flask_do_xsm_op() is also changed to return int, as all the function ever
    returns is an int. This way no new machinery needs adding to xsm/hooks.h.
    Instead one piece of compat machinery can then be dropped from
    xsm/flask/flask_op.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/include/xsm/dummy.h  |  2 +-
 xen/include/xsm/hooks.h  |  5 +++++
 xen/include/xsm/xsm.h    | 17 -----------------
 xen/xsm/dummy.c          |  5 -----
 xen/xsm/flask/flask_op.c |  7 ++-----
 xen/xsm/flask/hooks.c    |  6 ------
 xen/xsm/flask/private.h  |  4 ++--
 xen/xsm/xsm_core.c       |  4 ++--
 8 files changed, 12 insertions(+), 38 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 59d35466e5..7af5cbdfb7 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -439,7 +439,7 @@ static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
 
 #ifdef CONFIG_XSM
 
-static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE int xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
diff --git a/xen/include/xsm/hooks.h b/xen/include/xsm/hooks.h
index 5bdb23f26d..1e558bf710 100644
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -154,6 +154,11 @@ XSM_HOOK(int, dm_op, struct domain *)
 XSM_HOOK(int, xen_version, uint32_t)
 XSM_HOOK(int, domain_resource_map, struct domain *)
 
+XSM_HOOK(int, do_xsm_op, XEN_GUEST_HANDLE_PARAM(void))
+#ifdef CONFIG_COMPAT
+XSM_HOOK(int, do_compat_op, XEN_GUEST_HANDLE_PARAM(void))
+#endif
+
 #undef XSM_HOOK0
 #undef XSM_HOOK1
 #undef XSM_HOOK2
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 53c722f868..b94f0cd0fd 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -86,11 +86,6 @@ struct xsm_ops {
 
     char *(*show_irq_sid)(int irq);
 
-    long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
-#ifdef CONFIG_COMPAT
-    int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
-#endif
-
 #ifdef CONFIG_ARGO
     int (*argo_enable)(const struct domain *d);
     int (*argo_register_single_source)(const struct domain *d,
@@ -201,18 +196,6 @@ static inline char *xsm_show_irq_sid(int irq)
     return alternative_call(xsm_ops.show_irq_sid, irq);
 }
 
-static inline long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
-{
-    return alternative_call(xsm_ops.do_xsm_op, op);
-}
-
-#ifdef CONFIG_COMPAT
-static inline int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
-{
-    return alternative_call(xsm_ops.do_compat_op, op);
-}
-#endif
-
 #ifdef CONFIG_ARGO
 static inline int xsm_argo_enable(const struct domain *d)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index dfe1cf41c7..046c0cb59e 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -36,11 +36,6 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
 
     .show_irq_sid                  = xsm_show_irq_sid,
 
-    .do_xsm_op                     = xsm_do_xsm_op,
-#ifdef CONFIG_COMPAT
-    .do_compat_op                  = xsm_do_compat_op,
-#endif
-
 #ifdef CONFIG_ARGO
     .argo_enable                   = xsm_argo_enable,
     .argo_register_single_source   = xsm_argo_register_single_source,
diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index ea7dd10dc8..d2f04ca5ef 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -23,7 +23,6 @@
 #include <conditional.h>
 #include "private.h"
 
-#define ret_t long
 #define _copy_to_guest copy_to_guest
 #define _copy_from_guest copy_from_guest
 
@@ -606,7 +605,7 @@ static int flask_relabel_domain(const struct xen_flask_relabel *arg)
 
 #endif /* !COMPAT */
 
-ret_t cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
+int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
 {
     xen_flask_op_t op;
     int rv;
@@ -772,9 +771,7 @@ CHECK_flask_transition;
 #define flask_devicetree_label compat_devicetree_label
 
 #define xen_flask_op_t compat_flask_op_t
-#undef ret_t
-#define ret_t int
-#define do_flask_op compat_flask_op
+#define flask_do_xsm_op flask_do_compat_op
 
 #include "flask_op.c"
 #endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 3cfdf6bf08..11a77f0e28 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1969,12 +1969,6 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = {
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .do_xsm_op = do_flask_op,
-
-#ifdef CONFIG_COMPAT
-    .do_compat_op = compat_flask_op,
-#endif
-
 #ifdef CONFIG_ARGO
     .argo_enable = flask_argo_enable,
     .argo_register_single_source = flask_argo_register_single_source,
diff --git a/xen/xsm/flask/private.h b/xen/xsm/flask/private.h
index 429f213cce..e443ad54aa 100644
--- a/xen/xsm/flask/private.h
+++ b/xen/xsm/flask/private.h
@@ -3,7 +3,7 @@
 
 #include <public/xen.h>
 
-long cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
-int cf_check compat_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+int cf_check flask_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
 
 #endif /* XSM_FLASK_PRIVATE */
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index b7638d2bc1..6a91940c4e 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -216,12 +216,12 @@ bool __init has_xsm_magic(paddr_t start)
 
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
-    return xsm_do_xsm_op(op);
+    return xsm_do_xsm_op(XSM_HOOK, op);
 }
 
 #ifdef CONFIG_COMPAT
 int compat_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
-    return xsm_do_compat_op(op);
+    return xsm_do_compat_op(XSM_HOOK, op);
 }
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 11:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 11:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392878.1631842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvvvi-0003xC-Sw; Mon, 17 Aug 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 1392878.1631842; Mon, 17 Aug 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 1wvvvi-0003x4-QH; Mon, 17 Aug 2026 11:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1392878;
 Mon, 17 Aug 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 1wvvvi-0003wy-FA
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 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 1wvvvi-008tit-1X
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvvvi-003DEH-0U
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 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=25EhtzrWs2czsO7f/XndnT/E4BG18KO0TG+e+hvXHe4=; b=el2QeYH8LdnVlo6y9Uwl1dgIU7
	vIryF35sjKPBEk/uRqIqgCcl8MC2AtnUW+1tR/LzeT+lvfnMER106MiuWB0XXbVwEHAT0SIv9C/G+
	WiFbmjtiV++fRS/QBI0uktyw7aGa56/wqOBfiTPEtfEUJQhCYHc9KTUCdoZe5YI1bJws=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: propagate secondary GIC initialization failures
Message-Id: <E1wvvvi-003DEH-0U@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 11:55:02 +0000

commit 0102b592f46ff3f0784e693efa0b812551345271
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon Aug 10 22:41:46 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 17 13:23:40 2026 +0200

    xen/arm: propagate secondary GIC initialization failures
    
    The GICv3 secondary_init() callback can fail while discovering or
    waking a Redistributor, enabling LPIs, or setting up an ITS collection.
    gic_init_secondary_cpu() currently discards that status. start_secondary()
    then marks the CPU online even though its per-CPU GIC interface may be
    unusable.
    
    Return the callback status through the common GIC layer. Have
    start_secondary() report the failure and stop the affected CPU before it
    updates system features or is added to cpu_online_map.
    
    Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic.c             | 10 ++++++++--
 xen/arch/arm/include/asm/gic.h |  2 +-
 xen/arch/arm/smpboot.c         | 11 +++++++++--
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ee75258fc3..078049e741 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -282,11 +282,17 @@ void smp_send_state_dump(unsigned int cpu)
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
-void gic_init_secondary_cpu(void)
+int gic_init_secondary_cpu(void)
 {
-    gic_hw_ops->secondary_init();
+    int rc = gic_hw_ops->secondary_init();
+
+    if ( rc )
+        return rc;
+
     /* Clear LR mask for secondary cpus */
     clear_cpu_lr_mask();
+
+    return 0;
 }
 
 /* Shut down the per-CPU GIC interface */
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index ff22dea40d..ee2c26adb4 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -291,7 +291,7 @@ extern void gic_preinit(void);
 /* Bring up the interrupt controller, and report # cpus attached */
 extern void gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
-extern void gic_init_secondary_cpu(void);
+extern int gic_init_secondary_cpu(void);
 /* Take down a CPU's per-CPU GIC interface */
 extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..1806c47a08 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -319,6 +319,7 @@ smp_prepare_cpus(void)
 void asmlinkage noreturn start_secondary(void)
 {
     unsigned int cpuid = init_data.cpuid;
+    int rc;
 
     memset(get_cpu_info(), 0, sizeof (struct cpu_info));
 
@@ -366,6 +367,14 @@ void asmlinkage noreturn start_secondary(void)
         stop_cpu();
     }
 
+    rc = gic_init_secondary_cpu();
+    if ( rc )
+    {
+        printk(XENLOG_ERR "CPU%u: Failed to initialize the GIC: %d\n",
+               smp_processor_id(), rc);
+        stop_cpu();
+    }
+
     /*
      * system features must be updated only if we do not stop the core or
      * we might disable features due to a non used core (for example when
@@ -373,8 +382,6 @@ void asmlinkage noreturn start_secondary(void)
      */
     update_system_features(&current_cpu_data);
 
-    gic_init_secondary_cpu();
-
     set_current(idle_vcpu[cpuid]);
 
     /* Run local notifiers */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 12:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 12:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1392990.1631918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wvwh8-0004jk-Rg; Mon, 17 Aug 2026 12:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1392990.1631918; Mon, 17 Aug 2026 12: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 1wvwh8-0004jc-P6; Mon, 17 Aug 2026 12:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1392990;
 Mon, 17 Aug 2026 12:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wvwh7-0004jW-TK
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 12:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvwh7-008unz-2o
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 12:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wvwh7-004KmR-1j
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 12:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jVAnyvDiOe2NMVOg0tOwZwJKHZNx8IpqFdH/QFpTwlc=; b=l6xX2ZpzNkJuX12kUCchqctyYc
	GKM7N5fVmYzk4QJvDfYrQ1jcrxwOo7dxn+7ZbZQO1f8mfG0Rmx9P6J3+t7pc5Svx9pbk7hiUIiYj4
	hmRqPwYoZTxklchLFdQhKFgbKqB2M3a3HDuU76f9aJMdijAbaYV8vJD2+0oPSvA8LAKU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: propagate secondary GIC initialization failures
Message-Id: <E1wvwh7-004KmR-1j@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 12:44:01 +0000

commit 0102b592f46ff3f0784e693efa0b812551345271
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon Aug 10 22:41:46 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 17 13:23:40 2026 +0200

    xen/arm: propagate secondary GIC initialization failures
    
    The GICv3 secondary_init() callback can fail while discovering or
    waking a Redistributor, enabling LPIs, or setting up an ITS collection.
    gic_init_secondary_cpu() currently discards that status. start_secondary()
    then marks the CPU online even though its per-CPU GIC interface may be
    unusable.
    
    Return the callback status through the common GIC layer. Have
    start_secondary() report the failure and stop the affected CPU before it
    updates system features or is added to cpu_online_map.
    
    Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic.c             | 10 ++++++++--
 xen/arch/arm/include/asm/gic.h |  2 +-
 xen/arch/arm/smpboot.c         | 11 +++++++++--
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ee75258fc3..078049e741 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -282,11 +282,17 @@ void smp_send_state_dump(unsigned int cpu)
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
-void gic_init_secondary_cpu(void)
+int gic_init_secondary_cpu(void)
 {
-    gic_hw_ops->secondary_init();
+    int rc = gic_hw_ops->secondary_init();
+
+    if ( rc )
+        return rc;
+
     /* Clear LR mask for secondary cpus */
     clear_cpu_lr_mask();
+
+    return 0;
 }
 
 /* Shut down the per-CPU GIC interface */
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index ff22dea40d..ee2c26adb4 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -291,7 +291,7 @@ extern void gic_preinit(void);
 /* Bring up the interrupt controller, and report # cpus attached */
 extern void gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
-extern void gic_init_secondary_cpu(void);
+extern int gic_init_secondary_cpu(void);
 /* Take down a CPU's per-CPU GIC interface */
 extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..1806c47a08 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -319,6 +319,7 @@ smp_prepare_cpus(void)
 void asmlinkage noreturn start_secondary(void)
 {
     unsigned int cpuid = init_data.cpuid;
+    int rc;
 
     memset(get_cpu_info(), 0, sizeof (struct cpu_info));
 
@@ -366,6 +367,14 @@ void asmlinkage noreturn start_secondary(void)
         stop_cpu();
     }
 
+    rc = gic_init_secondary_cpu();
+    if ( rc )
+    {
+        printk(XENLOG_ERR "CPU%u: Failed to initialize the GIC: %d\n",
+               smp_processor_id(), rc);
+        stop_cpu();
+    }
+
     /*
      * system features must be updated only if we do not stop the core or
      * we might disable features due to a non used core (for example when
@@ -373,8 +382,6 @@ void asmlinkage noreturn start_secondary(void)
      */
     update_system_features(&current_cpu_data);
 
-    gic_init_secondary_cpu();
-
     set_current(idle_vcpu[cpuid]);
 
     /* Run local notifiers */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 19:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 19:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393264.1632081 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1ww2jf-0003IZ-A5; Mon, 17 Aug 2026 19:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393264.1632081; Mon, 17 Aug 2026 19: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 1ww2jf-0003IR-7Q; Mon, 17 Aug 2026 19:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1393264;
 Mon, 17 Aug 2026 19:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1ww2jd-0003IL-U2
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 19:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww2je-00933H-0H
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww2jd-0070Zk-2Y
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q8zCqLopUx4DP5kTnkll56f0cJMMWUSfwqjI2ZBHGVg=; b=sn6tyrXPm8jaTVF2wEmZ5kNv72
	MPdD1RAUhGrj5C+H70+1qEvUtDID070AGZWznHUPsAOCQFA73AjGOY8hpBjxOpWpgTn3AgKDjY9Fe
	6o7WFsvl0uZGtBKZ0ZRwJ4LqZMZS4ZC7Mk2vBb8FbCCcooi4oAdrReGea2HHp4OtYeKU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nmi: Fix mis-classification of watchdog NMIs
Message-Id: <E1ww2jd-0070Zk-2Y@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 19:11:01 +0000

commit dc5a77c6c4951e8ad75c884b3b6b87a1ba46c488
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Aug 13 16:18:59 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Aug 17 18:46:08 2026 +0100

    x86/nmi: Fix mis-classification of watchdog NMIs
    
    It used to be the case that cpu_data[] inherited the BSP's cpuid_level until
    the AP had calculated it itself.  Following the rework, cpuid_level has a
    placeholder 1 until it is calculated properly.
    
    setup_apic_nmi_watchdog() happens to be called on the BSP after SMP bring-up,
    meaning that the first call is on CPU1.  It is also positioned in the window
    where cpu_data[] is wrong.
    
    As a result, setup_p6_watchdog()'s one-time calculation of the performance
    counter width falls back into Pentium compatibility mode assuming 32bit
    counters.  This causes a watchdog NMI which is delayed a little (e.g. from an
    SMI), to appear as if it hadn't overflowed, and therefore be considered as not
    a watchdog NMI.  On systems where unknown NMIs are treated as fatal, this
    results in a spurious crash.
    
    Switch setup_p6_watchdog() to use boot_cpu_data.cpuid_level, which is how this
    is checked almost everywhere else.
    
    core2_vpmu_init() used the same pattern to look at leaf 0xa.  Despite being
    init code and only running on the BSP, {boot,current}_cpu_data are different
    objects, so switch it over to checking boot_cpu_data.cpuid_level too.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/vpmu_intel.c | 2 +-
 xen/arch/x86/nmi.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index ed9f62b936..2326caee58 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -896,7 +896,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     unsigned int version = 0;
     unsigned int i;
 
-    if ( current_cpu_data.cpuid_level >= 0xa )
+    if ( boot_cpu_data.cpuid_level >= 0xa )
         version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
 
     switch ( version )
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 91f95fe6d0..ec85516609 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -321,7 +321,7 @@ static void setup_p6_watchdog(unsigned counter)
 {
     unsigned int evntsel;
 
-    if ( !nmi_p6_event_width && current_cpu_data.cpuid_level >= 0xa )
+    if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
         nmi_p6_event_width = P6_EVENT_WIDTH_MIN;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 19:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 19:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393265.1632085 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1ww2jp-0003K6-BL; Mon, 17 Aug 2026 19:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393265.1632085; Mon, 17 Aug 2026 19:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1ww2jp-0003Jy-8j; Mon, 17 Aug 2026 19:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1393265;
 Mon, 17 Aug 2026 19: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 1ww2jn-0003Je-Ug
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 19:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww2jo-00933L-0Z
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww2jn-0070bW-2q
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+3IfDxgPXvc/FBN/A/4podth1nTyI2qDVIThWh/OH9Q=; b=PgrP2SOV1JjNDSeotGMRbB7aLp
	7+Xmbcw9HB9eterbEuzR282iNPINY+pp75zRgXPAQGB65twKmAIEJRFV0RpoqnZUpb9i1pb3FxN20
	qqk9hc+q9gu8ssFehxh55yeOqjrTgvgtGLmaEUZtV28genXqnhqet5XvXiZEn0gUewgA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nmi: Drop {reserve,release}_lapic_nmi()
Message-Id: <E1ww2jn-0070bW-2q@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 19:11:11 +0000

commit 74d16381e047c75c5873b19b6065af01433681f0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 10:27:34 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Aug 17 18:46:08 2026 +0100

    x86/nmi: Drop {reserve,release}_lapic_nmi()
    
    With Oprofile support dropped, there are no more users of these.  Drop them.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/apic.h |  2 --
 xen/arch/x86/nmi.c              | 50 -----------------------------------------
 2 files changed, 52 deletions(-)

diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index 918f1cee35..f30d57ad22 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -174,8 +174,6 @@ extern void setup_boot_APIC_clock (void);
 extern void setup_secondary_APIC_clock (void);
 extern void setup_apic_nmi_watchdog (void);
 extern void disable_lapic_nmi_watchdog(void);
-extern int reserve_lapic_nmi(void);
-extern void release_lapic_nmi(void);
 extern void self_nmi(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index ec85516609..2ec567c114 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -89,20 +89,6 @@ static int __init cf_check parse_watchdog_timeout(const char *s)
 }
 custom_param("watchdog_timeout", parse_watchdog_timeout);
 
-/*
- * lapic_nmi_owner tracks the ownership of the lapic NMI hardware:
- * - it may be reserved by some other driver, or not
- * - when not reserved by some other driver, it may be used for
- *   the NMI watchdog, or not
- *
- * This is maintained separately from nmi_active because the NMI
- * watchdog may also be driven from the I/O APIC timer.
- */
-static DEFINE_SPINLOCK(lapic_nmi_owner_lock);
-static unsigned int lapic_nmi_owner;
-#define LAPIC_NMI_WATCHDOG	(1<<0)
-#define LAPIC_NMI_RESERVED	(1<<1)
-
 /* nmi_active:
  * +1: the lapic NMI watchdog is active, but can be disabled
  *  0: the lapic NMI watchdog has not been set up, and cannot
@@ -239,41 +225,6 @@ void disable_lapic_nmi_watchdog(void)
     nmi_watchdog = NMI_NONE;
 }
 
-static void enable_lapic_nmi_watchdog(void)
-{
-    if (nmi_active < 0) {
-        nmi_watchdog = NMI_LOCAL_APIC;
-        setup_apic_nmi_watchdog();
-    }
-}
-
-int reserve_lapic_nmi(void)
-{
-    unsigned int old_owner;
-
-    spin_lock(&lapic_nmi_owner_lock);
-    old_owner = lapic_nmi_owner;
-    lapic_nmi_owner |= LAPIC_NMI_RESERVED;
-    spin_unlock(&lapic_nmi_owner_lock);
-    if (old_owner & LAPIC_NMI_RESERVED)
-        return -EBUSY;
-    if (old_owner & LAPIC_NMI_WATCHDOG)
-        disable_lapic_nmi_watchdog();
-    return 0;
-}
-
-void release_lapic_nmi(void)
-{
-    unsigned int new_owner;
-
-    spin_lock(&lapic_nmi_owner_lock);
-    new_owner = lapic_nmi_owner & ~LAPIC_NMI_RESERVED;
-    lapic_nmi_owner = new_owner;
-    spin_unlock(&lapic_nmi_owner_lock);
-    if (new_owner & LAPIC_NMI_WATCHDOG)
-        enable_lapic_nmi_watchdog();
-}
-
 /*
  * Activate the NMI watchdog via the local APIC.
  * Original code written by Keith Owens.
@@ -417,7 +368,6 @@ void setup_apic_nmi_watchdog(void)
         return;
     }
 
-    lapic_nmi_owner = LAPIC_NMI_WATCHDOG;
     nmi_active = 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 19:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 19:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393266.1632089 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1ww2jz-0003MI-CY; Mon, 17 Aug 2026 19:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393266.1632089; Mon, 17 Aug 2026 19: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 1ww2jz-0003MA-A3; Mon, 17 Aug 2026 19:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1393266;
 Mon, 17 Aug 2026 19: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 1ww2jy-0003Lz-15
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 19: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 1ww2jy-00933T-0q
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww2jx-0070cx-38
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19: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=3d1McyAJd39bqOB5pnhqI7bQBtwxzNBfAwJ+5jr9SA8=; b=03ANgnHAUHwi6mCoWjofp4BYYV
	UsMHFKQDnAQ11L8gAWmkDrMLF+iQE6Z8kRdSEXdG/zsiUajPd81LzB03AkBjdPq9AuhXtQJRIIqHq
	xnuZeaVcQD+xghgUHbWnVqreFsJQy2DsosV1/CffW1Fv55AjCVWu7VP6dKvYXbuRNUQA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nmi: Drop K7_NMI_EVENT
Message-Id: <E1ww2jx-0070cx-38@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 19:11:21 +0000

commit ebc00c30c65023bd1498ae20dc511c4e39f6c0f7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 10:50:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Aug 17 18:46:08 2026 +0100

    x86/nmi: Drop K7_NMI_EVENT
    
    This name is misleading.
    
    It's not possible to configure NMI or not from the event select register; that
    comes from the APIC configuration for performance events.
    
    This name is "the thing we want to count for the NMI watchdog", but that's
    clearer to follow when it simply names the event.  Drop the indirection.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 2ec567c114..b71bf43635 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -102,7 +102,6 @@ static int nmi_active;
 #define K7_EVNTSEL_OS		(1 << 17)
 #define K7_EVNTSEL_USR		(1 << 16)
 #define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING	0x76
-#define K7_NMI_EVENT		K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING
 #define K7_EVENT_WIDTH          32
 
 #define P6_EVNTSEL0_ENABLE	(1 << 22)
@@ -259,7 +258,7 @@ static void setup_k7_watchdog(void)
     evntsel = K7_EVNTSEL_INT
         | K7_EVNTSEL_OS
         | K7_EVNTSEL_USR
-        | K7_NMI_EVENT;
+        | K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING;
 
     wrmsrns(MSR_K7_EVNTSEL0, evntsel);
     write_watchdog_counter("K7_PERFCTR0");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 19:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 19:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393279.1632093 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1ww3QG-0008Mm-6p; Mon, 17 Aug 2026 19:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393279.1632093; Mon, 17 Aug 2026 19: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 1ww3QG-0008Me-4B; Mon, 17 Aug 2026 19:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1393279;
 Mon, 17 Aug 2026 19: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 1ww3QE-0008MY-Fx
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 19: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 1ww3QE-0093ux-1N
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww3QE-007CKs-0M
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19: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=LXcSd+Tb2ZdER6hcXGSDApB0biZie4uQ0FEvo8JOCaI=; b=MaNYdJdSqs4qJpR+QaVOmjXbVO
	E6FZom1YQYYOdmSa5LF44Gax7a9oudUX6N5lcDvjgwaB0qfD+CEEGkxJfAzXDed7PMWqNdCRHj63f
	2i00vcBLvRfZ6ST9QR+zOLZj5QTsxWJ/3l9Lccyfmb9bgxXxufdxTBgrvtBM+MGmujR4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nmi: Fix mis-classification of watchdog NMIs
Message-Id: <E1ww3QE-007CKs-0M@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 19:55:02 +0000

commit dc5a77c6c4951e8ad75c884b3b6b87a1ba46c488
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Aug 13 16:18:59 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Aug 17 18:46:08 2026 +0100

    x86/nmi: Fix mis-classification of watchdog NMIs
    
    It used to be the case that cpu_data[] inherited the BSP's cpuid_level until
    the AP had calculated it itself.  Following the rework, cpuid_level has a
    placeholder 1 until it is calculated properly.
    
    setup_apic_nmi_watchdog() happens to be called on the BSP after SMP bring-up,
    meaning that the first call is on CPU1.  It is also positioned in the window
    where cpu_data[] is wrong.
    
    As a result, setup_p6_watchdog()'s one-time calculation of the performance
    counter width falls back into Pentium compatibility mode assuming 32bit
    counters.  This causes a watchdog NMI which is delayed a little (e.g. from an
    SMI), to appear as if it hadn't overflowed, and therefore be considered as not
    a watchdog NMI.  On systems where unknown NMIs are treated as fatal, this
    results in a spurious crash.
    
    Switch setup_p6_watchdog() to use boot_cpu_data.cpuid_level, which is how this
    is checked almost everywhere else.
    
    core2_vpmu_init() used the same pattern to look at leaf 0xa.  Despite being
    init code and only running on the BSP, {boot,current}_cpu_data are different
    objects, so switch it over to checking boot_cpu_data.cpuid_level too.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/vpmu_intel.c | 2 +-
 xen/arch/x86/nmi.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index ed9f62b936..2326caee58 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -896,7 +896,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     unsigned int version = 0;
     unsigned int i;
 
-    if ( current_cpu_data.cpuid_level >= 0xa )
+    if ( boot_cpu_data.cpuid_level >= 0xa )
         version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
 
     switch ( version )
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 91f95fe6d0..ec85516609 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -321,7 +321,7 @@ static void setup_p6_watchdog(unsigned counter)
 {
     unsigned int evntsel;
 
-    if ( !nmi_p6_event_width && current_cpu_data.cpuid_level >= 0xa )
+    if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
         nmi_p6_event_width = P6_EVENT_WIDTH_MIN;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 19:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 19:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393280.1632097 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1ww3QQ-0008OU-8L; Mon, 17 Aug 2026 19:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393280.1632097; Mon, 17 Aug 2026 19: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 1ww3QQ-0008OL-5V; Mon, 17 Aug 2026 19:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1393280;
 Mon, 17 Aug 2026 19: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 1ww3QO-0008OA-AI
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 19: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 1ww3QO-0093v1-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww3QO-007CNJ-0k
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19: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=olo2oTnnuX2KoV+JSdcbL7PLYy2jTP6Vl5IigrwBz2g=; b=StduGMPPg18Uw71IU1JiyPkk3p
	Cg31x4gJyFUEv/KkxyJMtsoNvl3lZXQrj60yBowzrbscGnt8UQOPZdgSXg8ZBNsy6NsDiAIcYacUv
	hW4kLSZtif3wdk0fgTlvkcF8bTA5WXS/jzy6DA+QGOauyVNdEMCZgoOpdlCF50v+YHOA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nmi: Drop {reserve,release}_lapic_nmi()
Message-Id: <E1ww3QO-007CNJ-0k@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 19:55:12 +0000

commit 74d16381e047c75c5873b19b6065af01433681f0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 10:27:34 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Aug 17 18:46:08 2026 +0100

    x86/nmi: Drop {reserve,release}_lapic_nmi()
    
    With Oprofile support dropped, there are no more users of these.  Drop them.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/apic.h |  2 --
 xen/arch/x86/nmi.c              | 50 -----------------------------------------
 2 files changed, 52 deletions(-)

diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index 918f1cee35..f30d57ad22 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -174,8 +174,6 @@ extern void setup_boot_APIC_clock (void);
 extern void setup_secondary_APIC_clock (void);
 extern void setup_apic_nmi_watchdog (void);
 extern void disable_lapic_nmi_watchdog(void);
-extern int reserve_lapic_nmi(void);
-extern void release_lapic_nmi(void);
 extern void self_nmi(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index ec85516609..2ec567c114 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -89,20 +89,6 @@ static int __init cf_check parse_watchdog_timeout(const char *s)
 }
 custom_param("watchdog_timeout", parse_watchdog_timeout);
 
-/*
- * lapic_nmi_owner tracks the ownership of the lapic NMI hardware:
- * - it may be reserved by some other driver, or not
- * - when not reserved by some other driver, it may be used for
- *   the NMI watchdog, or not
- *
- * This is maintained separately from nmi_active because the NMI
- * watchdog may also be driven from the I/O APIC timer.
- */
-static DEFINE_SPINLOCK(lapic_nmi_owner_lock);
-static unsigned int lapic_nmi_owner;
-#define LAPIC_NMI_WATCHDOG	(1<<0)
-#define LAPIC_NMI_RESERVED	(1<<1)
-
 /* nmi_active:
  * +1: the lapic NMI watchdog is active, but can be disabled
  *  0: the lapic NMI watchdog has not been set up, and cannot
@@ -239,41 +225,6 @@ void disable_lapic_nmi_watchdog(void)
     nmi_watchdog = NMI_NONE;
 }
 
-static void enable_lapic_nmi_watchdog(void)
-{
-    if (nmi_active < 0) {
-        nmi_watchdog = NMI_LOCAL_APIC;
-        setup_apic_nmi_watchdog();
-    }
-}
-
-int reserve_lapic_nmi(void)
-{
-    unsigned int old_owner;
-
-    spin_lock(&lapic_nmi_owner_lock);
-    old_owner = lapic_nmi_owner;
-    lapic_nmi_owner |= LAPIC_NMI_RESERVED;
-    spin_unlock(&lapic_nmi_owner_lock);
-    if (old_owner & LAPIC_NMI_RESERVED)
-        return -EBUSY;
-    if (old_owner & LAPIC_NMI_WATCHDOG)
-        disable_lapic_nmi_watchdog();
-    return 0;
-}
-
-void release_lapic_nmi(void)
-{
-    unsigned int new_owner;
-
-    spin_lock(&lapic_nmi_owner_lock);
-    new_owner = lapic_nmi_owner & ~LAPIC_NMI_RESERVED;
-    lapic_nmi_owner = new_owner;
-    spin_unlock(&lapic_nmi_owner_lock);
-    if (new_owner & LAPIC_NMI_WATCHDOG)
-        enable_lapic_nmi_watchdog();
-}
-
 /*
  * Activate the NMI watchdog via the local APIC.
  * Original code written by Keith Owens.
@@ -417,7 +368,6 @@ void setup_apic_nmi_watchdog(void)
         return;
     }
 
-    lapic_nmi_owner = LAPIC_NMI_WATCHDOG;
     nmi_active = 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 17 19:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Aug 2026 19:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393281.1632102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1ww3Qa-0008QQ-AG; Mon, 17 Aug 2026 19:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393281.1632102; Mon, 17 Aug 2026 19: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 1ww3Qa-0008QI-6o; Mon, 17 Aug 2026 19:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1393281;
 Mon, 17 Aug 2026 19: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 1ww3QY-0008QC-DD
 for xen-changelog@lists.xenproject.org; Mon, 17 Aug 2026 19: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 1ww3QY-0093v8-23
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1ww3QY-007Ccp-16
 for xen-changelog@lists.xenproject.org;
 Mon, 17 Aug 2026 19: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=LUuC/a2sYieWYBt6UgDm1zAPEx+K6kNj27UXXkFiBYM=; b=NeOECd3TWn3tUGHQ11lSQEyRxW
	0NRmkREXmD9o981JPusHCJT27K7l1ZpwSD9p1XHQSj1Xq/VsJ9BJ+wbXI6P8GYXxK6ZZTyhqTyAUd
	rGn2cbLeOClAbGwp6KiE7tNdlIkDs73qeDT2oVrVkjw8/KGqb/EwTqQ1Cm8JB5uKESXQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nmi: Drop K7_NMI_EVENT
Message-Id: <E1ww3QY-007Ccp-16@xenbits.xenproject.org>
Date: Mon, 17 Aug 2026 19:55:22 +0000

commit ebc00c30c65023bd1498ae20dc511c4e39f6c0f7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 10:50:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Aug 17 18:46:08 2026 +0100

    x86/nmi: Drop K7_NMI_EVENT
    
    This name is misleading.
    
    It's not possible to configure NMI or not from the event select register; that
    comes from the APIC configuration for performance events.
    
    This name is "the thing we want to count for the NMI watchdog", but that's
    clearer to follow when it simply names the event.  Drop the indirection.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 2ec567c114..b71bf43635 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -102,7 +102,6 @@ static int nmi_active;
 #define K7_EVNTSEL_OS		(1 << 17)
 #define K7_EVNTSEL_USR		(1 << 16)
 #define K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING	0x76
-#define K7_NMI_EVENT		K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING
 #define K7_EVENT_WIDTH          32
 
 #define P6_EVNTSEL0_ENABLE	(1 << 22)
@@ -259,7 +258,7 @@ static void setup_k7_watchdog(void)
     evntsel = K7_EVNTSEL_INT
         | K7_EVNTSEL_OS
         | K7_EVNTSEL_USR
-        | K7_NMI_EVENT;
+        | K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING;
 
     wrmsrns(MSR_K7_EVNTSEL0, evntsel);
     write_watchdog_counter("K7_PERFCTR0");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 11:00:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 11:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393971.1632775 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwHY4-0000ir-Dx; Tue, 18 Aug 2026 11:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393971.1632775; Tue, 18 Aug 2026 11:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwHY4-0000iM-Ag; Tue, 18 Aug 2026 11:00:04 +0000
Received: by outflank-mailman (input) for mailman id 1393971;
 Tue, 18 Aug 2026 11:00:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwHY3-0000MK-6G
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 2026 11:00:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwHY2-00AZSv-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwHY2-004Dha-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l4/YkRRzluD+VHzjxNP6RZK1lZMvpQXVkCJERK45RmU=; b=bVmnjr0kBlVWHwu9SvBi8j8L6I
	vmwSBaUncwayMSovdgcKxom48bMce+gxqDAxDRHqhF/cAhFkNPYZ8P2LT3je9UVYXd4eNhyyvoCdq
	knc0PAnXu59+AtlbUmSAZiwxdRIZx+GXQIxAkDaQ1gSsDm4WAcFCpKfgjnOrV9Cx41qg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: add keyhandler to show Xen command line
Message-Id: <E1wwHY2-004Dha-1S@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 11:00:02 +0000

commit 0edf0ada32324352df4e4055011f36204d1dc879
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Aug 18 11:35:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Aug 18 11:35:18 2026 +0200

    xen/common: add keyhandler to show Xen command line
    
    Currently there's no way to print Xen command line on the emergency
    console for debugging purposes when 'xl' is unavailable.
    
    Add new print_cmdline() function to print both built-in and run-time
    command lines on the console.
    
    To allow built-in command printout, drop __initconst in
    'opt_builtin_cmdline' declaration.
    
    Add new keyhander '?' to show command line printout.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/kernel.c     | 20 +++++++++++++++++++-
 xen/common/keyhandler.c | 10 +++++++++-
 xen/include/xen/lib.h   |  1 +
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index d1bef9ac2b..f4bbd8818f 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -35,7 +35,7 @@ boolean_param("dit", opt_dit);
 #endif
 
 static xen_commandline_t __ro_after_init saved_cmdline;
-static const char __initconst opt_builtin_cmdline[] = CONFIG_CMDLINE;
+static const char opt_builtin_cmdline[] = CONFIG_CMDLINE;
 char __ro_after_init xen_cap_info[128];
 
 static int assign_integer_param(const struct kernel_param *param, uint64_t val)
@@ -758,6 +758,24 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     return -ENOSYS;
 }
 
+void print_cmdline(void)
+{
+    const char *cmdline;
+
+    if ( opt_builtin_cmdline[0] )
+        printk("Built-in command line: %s\n", opt_builtin_cmdline);
+
+    if ( IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) )
+        cmdline = "<ignored> (CONFIG_CMDLINE_OVERRIDE=y)";
+    else if ( saved_cmdline[0] )
+        cmdline = saved_cmdline;
+    else
+        cmdline = NULL;
+
+    if ( cmdline )
+        printk("Command line: %s\n", cmdline);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index cb6df2823b..c54700e011 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -28,7 +28,7 @@ static unsigned char keypress_key;
 static bool alt_key_handling;
 
 static keyhandler_fn_t cf_check show_handlers, cf_check dump_hwdom_registers,
-    cf_check dump_domains, cf_check read_clocks;
+    cf_check dump_domains, cf_check read_clocks, cf_check show_system_info;
 static irq_keyhandler_fn_t cf_check do_toggle_alt_key, cf_check dump_registers,
     cf_check reboot_machine, cf_check run_all_keyhandlers;
 
@@ -57,6 +57,7 @@ static struct keyhandler {
     IRQ_KEYHANDLER('R', reboot_machine, "reboot machine", 0),
         KEYHANDLER('t', read_clocks, "display multi-cpu clock info", 1),
         KEYHANDLER('0', dump_hwdom_registers, "dump Dom0 registers", 1),
+        KEYHANDLER('?', show_system_info, "show system information", false),
     IRQ_KEYHANDLER('*', run_all_keyhandlers, "print all diagnostics", 0),
 
 #ifdef CONFIG_PERF_COUNTERS
@@ -138,6 +139,13 @@ static void cf_check show_handlers(unsigned char key)
                    isprint(i) ? i : ' ', i, key_table[i].desc);
 }
 
+static void cf_check show_system_info(unsigned char key)
+{
+    printk("'%c' pressed -> showing system information\n", key);
+
+    print_cmdline();
+}
+
 static cpumask_t dump_execstate_mask;
 
 void cf_check dump_execstate(const struct cpu_user_regs *regs)
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 3c545ff33c..618e37b920 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -48,6 +48,7 @@ int parse_signed_integer(const char *name, const char *s, const char *e,
 int cmdline_strcmp(const char *frag, const char *name);
 
 void print_version(void);
+void print_cmdline(void);
 
 #ifdef CONFIG_DEBUG_TRACE
 extern void debugtrace_dump(void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 11:00:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 11:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393972.1632777 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwHYD-0001Gc-Eh; Tue, 18 Aug 2026 11:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393972.1632777; Tue, 18 Aug 2026 11: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 1wwHYD-0001GU-Bz; Tue, 18 Aug 2026 11:00:13 +0000
Received: by outflank-mailman (input) for mailman id 1393972;
 Tue, 18 Aug 2026 11:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwHYC-0001GO-M6
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 2026 11:00:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwHYC-00AZSz-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwHYC-004Dll-1w
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JSxqqcTNbziev4oxVE8nCvmdgZ6AXsIhCr2V8EivI38=; b=Gb+MO7CzEZmYy8jgrlfiyW7Jh0
	Zy0jCLzk+B1GVQzcm/GpKPgYXrIuqbXpGByUSJx3sKliFTLu6MApzmpew15yCkXZ94rKdKKvxqbMq
	l1XzeXctpMPni8N+2rvCyJZ2XjIFWsBZxK/vC74YvNiWV8LjOIqEZOSMJ9I6c3g7mF2M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: move version printout under '?' keyhandler
Message-Id: <E1wwHYC-004Dll-1w@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 11:00:12 +0000

commit 0a76fa1b9e83817d924d31f3008a8e347522bc38
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Aug 18 11:35:38 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Aug 18 11:35:38 2026 +0200

    xen/common: move version printout under '?' keyhandler
    
    Move Xen version printout from 'h' keyhandler to the new dedicated
    handler '?'.
    
    Suggested-by: Roger Pau Monné <roger@xenproject.org>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/keyhandler.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index c54700e011..7103bf20a7 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -131,8 +131,6 @@ static void cf_check show_handlers(unsigned char key)
 
     printk("'%c' pressed -> showing installed handlers\n", key);
 
-    print_version();
-
     for ( i = 0; i < ARRAY_SIZE(key_table); i++ )
         if ( key_table[i].fn )
             printk(" key '%c' (ascii '%02x') => %s\n",
@@ -143,6 +141,8 @@ static void cf_check show_system_info(unsigned char key)
 {
     printk("'%c' pressed -> showing system information\n", key);
 
+    print_version();
+
     print_cmdline();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 11:00:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 11:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1393973.1632782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwHYN-0001Ie-GF; Tue, 18 Aug 2026 11:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1393973.1632782; Tue, 18 Aug 2026 11: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 1wwHYN-0001IW-DO; Tue, 18 Aug 2026 11:00:23 +0000
Received: by outflank-mailman (input) for mailman id 1393973;
 Tue, 18 Aug 2026 11: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 1wwHYM-0001IQ-P7
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 2026 11: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 1wwHYN-00AZT6-02
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwHYM-004Dnj-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11: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=jyFAGMyIecjcnhO3VRd8aPMVI9paH90HcWQYPbALQRs=; b=EHTI/1IIdjHEitoDo/nOxIAg2y
	8+nPzQJhaeZ4W6zlTzQygjjCq/v/gD+57dKwFDALhtB/esLjBTVEDRy/0emDTHt7eYjEYrzLauzT2
	QtAEmTTWmI43fkxSVkLL6QFrgJv48PRKb0Ulg0H4sRJ3EBWm1WxnlEMJAR+PSC+JI86o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Config: update Mini-OS commit id
Message-Id: <E1wwHYM-004Dnj-2I@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 11:00:22 +0000

commit e720df6b5a0be87aa7101c07ffc3d3ae29791ff5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Aug 18 11:35:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Aug 18 11:35:56 2026 +0200

    Config: update Mini-OS commit id
    
    Use the newest Mini-OS.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index b3d48e49c7..b2dcc729f3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -217,7 +217,7 @@ QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
 QEMU_UPSTREAM_REVISION ?= master
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
-MINIOS_UPSTREAM_REVISION ?= b6f79f5f44cf69044079c042b88fe9d75367642e
+MINIOS_UPSTREAM_REVISION ?= 26ceb2daf95dd9e7fed9c83d36be3aaf1a0fa8a1
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
 SEABIOS_UPSTREAM_REVISION ?= rel-1.17.0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 11:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 11:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394059.1632867 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwIPH-0004MR-Ln; Tue, 18 Aug 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 1394059.1632867; Tue, 18 Aug 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 1wwIPH-0004MJ-JC; Tue, 18 Aug 2026 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1394059;
 Tue, 18 Aug 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 1wwIPG-0004MD-Ln
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 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 1wwIPG-00AaUo-2L
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwIPG-004XwA-1J
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 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=fuVD1ETQzG0SQlPIqCb3X7CM3Prp0ukfrXaXH7y1GvY=; b=aqJ+rUZnetyO+y5T6Ab0T4GUzC
	km2TnD5mbbTG+Blk1G6F1RrEkL/P+M/dL2OwD+DSw4asYL6upbSg5FS1eVK5xtSySZvtPcT+5RxXv
	GpN7jtdFDNlLZtxza5dMFxpR3J9QcITFHUHBEdylk0nLbHW5GxDVB/NMH161fVyfw9aU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: add keyhandler to show Xen command line
Message-Id: <E1wwIPG-004XwA-1J@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 11:55:02 +0000

commit 0edf0ada32324352df4e4055011f36204d1dc879
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Aug 18 11:35:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Aug 18 11:35:18 2026 +0200

    xen/common: add keyhandler to show Xen command line
    
    Currently there's no way to print Xen command line on the emergency
    console for debugging purposes when 'xl' is unavailable.
    
    Add new print_cmdline() function to print both built-in and run-time
    command lines on the console.
    
    To allow built-in command printout, drop __initconst in
    'opt_builtin_cmdline' declaration.
    
    Add new keyhander '?' to show command line printout.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/kernel.c     | 20 +++++++++++++++++++-
 xen/common/keyhandler.c | 10 +++++++++-
 xen/include/xen/lib.h   |  1 +
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index d1bef9ac2b..f4bbd8818f 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -35,7 +35,7 @@ boolean_param("dit", opt_dit);
 #endif
 
 static xen_commandline_t __ro_after_init saved_cmdline;
-static const char __initconst opt_builtin_cmdline[] = CONFIG_CMDLINE;
+static const char opt_builtin_cmdline[] = CONFIG_CMDLINE;
 char __ro_after_init xen_cap_info[128];
 
 static int assign_integer_param(const struct kernel_param *param, uint64_t val)
@@ -758,6 +758,24 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     return -ENOSYS;
 }
 
+void print_cmdline(void)
+{
+    const char *cmdline;
+
+    if ( opt_builtin_cmdline[0] )
+        printk("Built-in command line: %s\n", opt_builtin_cmdline);
+
+    if ( IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) )
+        cmdline = "<ignored> (CONFIG_CMDLINE_OVERRIDE=y)";
+    else if ( saved_cmdline[0] )
+        cmdline = saved_cmdline;
+    else
+        cmdline = NULL;
+
+    if ( cmdline )
+        printk("Command line: %s\n", cmdline);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index cb6df2823b..c54700e011 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -28,7 +28,7 @@ static unsigned char keypress_key;
 static bool alt_key_handling;
 
 static keyhandler_fn_t cf_check show_handlers, cf_check dump_hwdom_registers,
-    cf_check dump_domains, cf_check read_clocks;
+    cf_check dump_domains, cf_check read_clocks, cf_check show_system_info;
 static irq_keyhandler_fn_t cf_check do_toggle_alt_key, cf_check dump_registers,
     cf_check reboot_machine, cf_check run_all_keyhandlers;
 
@@ -57,6 +57,7 @@ static struct keyhandler {
     IRQ_KEYHANDLER('R', reboot_machine, "reboot machine", 0),
         KEYHANDLER('t', read_clocks, "display multi-cpu clock info", 1),
         KEYHANDLER('0', dump_hwdom_registers, "dump Dom0 registers", 1),
+        KEYHANDLER('?', show_system_info, "show system information", false),
     IRQ_KEYHANDLER('*', run_all_keyhandlers, "print all diagnostics", 0),
 
 #ifdef CONFIG_PERF_COUNTERS
@@ -138,6 +139,13 @@ static void cf_check show_handlers(unsigned char key)
                    isprint(i) ? i : ' ', i, key_table[i].desc);
 }
 
+static void cf_check show_system_info(unsigned char key)
+{
+    printk("'%c' pressed -> showing system information\n", key);
+
+    print_cmdline();
+}
+
 static cpumask_t dump_execstate_mask;
 
 void cf_check dump_execstate(const struct cpu_user_regs *regs)
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 3c545ff33c..618e37b920 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -48,6 +48,7 @@ int parse_signed_integer(const char *name, const char *s, const char *e,
 int cmdline_strcmp(const char *frag, const char *name);
 
 void print_version(void);
+void print_cmdline(void);
 
 #ifdef CONFIG_DEBUG_TRACE
 extern void debugtrace_dump(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 11:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 11:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394060.1632871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwIPR-0004OA-NK; Tue, 18 Aug 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 1394060.1632871; Tue, 18 Aug 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 1wwIPR-0004O2-KT; Tue, 18 Aug 2026 11:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1394060;
 Tue, 18 Aug 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 1wwIPQ-0004Nu-Ji
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 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 1wwIPQ-00AaUu-2h
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwIPQ-004Y2Z-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 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=nBm5gfdYh2oLH0wueocUWRKAUSRwNoLJU4ogU1Dha8w=; b=L1fXP3jylziJPA9JfskaoKCtZ2
	zJ9Dn9QRDbAy5SXoWY9dDP1JlunJc/5jCdkHqwI4Usv21m88bcWs1YV60TbGRLNoCR8syTLg45eeg
	jAkLZ7/e2vbwX04ATnP3xNlD62MdsRXM1MjotQGmX76lP4M+EOe6J5gLDWPvkGk7WgS4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: move version printout under '?' keyhandler
Message-Id: <E1wwIPQ-004Y2Z-1j@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 11:55:12 +0000

commit 0a76fa1b9e83817d924d31f3008a8e347522bc38
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Aug 18 11:35:38 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Aug 18 11:35:38 2026 +0200

    xen/common: move version printout under '?' keyhandler
    
    Move Xen version printout from 'h' keyhandler to the new dedicated
    handler '?'.
    
    Suggested-by: Roger Pau Monné <roger@xenproject.org>
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/keyhandler.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index c54700e011..7103bf20a7 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -131,8 +131,6 @@ static void cf_check show_handlers(unsigned char key)
 
     printk("'%c' pressed -> showing installed handlers\n", key);
 
-    print_version();
-
     for ( i = 0; i < ARRAY_SIZE(key_table); i++ )
         if ( key_table[i].fn )
             printk(" key '%c' (ascii '%02x') => %s\n",
@@ -143,6 +141,8 @@ static void cf_check show_system_info(unsigned char key)
 {
     printk("'%c' pressed -> showing system information\n", key);
 
+    print_version();
+
     print_cmdline();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 11:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 11:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394061.1632875 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwIPb-0004QI-OL; Tue, 18 Aug 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 1394061.1632875; Tue, 18 Aug 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 1wwIPb-0004Q8-Lj; Tue, 18 Aug 2026 11:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1394061;
 Tue, 18 Aug 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 1wwIPa-0004Pt-Nb
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 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 1wwIPa-00AaV2-35
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 11:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwIPa-004Y5x-27
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 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=SA9PrPTqGG7HLRHKThCF/dss50Koeaftv65hbtR+CSc=; b=dHycinlz36qAPKS2eZv7S2Io/y
	QQrGV+XHusddKqfYYYkRXDM19SuvzDzlpeVvmymY8HftZAhj5DzG5HL284ZsAVs0Dxfz6Y2fPf7jy
	cXVhvN8BMM2IzOZF/iZWILyVtk0YADyDtnnVr4jWxuYS4/pKoHsAQyqCjxcIIHdK0/+s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Config: update Mini-OS commit id
Message-Id: <E1wwIPa-004Y5x-27@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 11:55:22 +0000

commit e720df6b5a0be87aa7101c07ffc3d3ae29791ff5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Aug 18 11:35:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Aug 18 11:35:56 2026 +0200

    Config: update Mini-OS commit id
    
    Use the newest Mini-OS.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index b3d48e49c7..b2dcc729f3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -217,7 +217,7 @@ QEMU_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/qemu-xen.git
 QEMU_UPSTREAM_REVISION ?= master
 
 MINIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/mini-os.git
-MINIOS_UPSTREAM_REVISION ?= b6f79f5f44cf69044079c042b88fe9d75367642e
+MINIOS_UPSTREAM_REVISION ?= 26ceb2daf95dd9e7fed9c83d36be3aaf1a0fa8a1
 
 SEABIOS_UPSTREAM_URL ?= https://xenbits.xen.org/git-http/seabios.git
 SEABIOS_UPSTREAM_REVISION ?= rel-1.17.0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 12:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 12:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394138.1632951 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwJLL-00009P-Mh; Tue, 18 Aug 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 1394138.1632951; Tue, 18 Aug 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 1wwJLL-00009H-K3; Tue, 18 Aug 2026 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1394138;
 Tue, 18 Aug 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 1wwJLK-00009B-PP
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 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 1wwJLK-00Abdm-2L
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJLK-004tfK-1G
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 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=W2EFD1yKUMK67hgiixPdS0mKUzi3dgj0z7hThYD7QfY=; b=ahlLmAOU8EfhISf0c/okRKrKgR
	WUvTD5a4AdsYFrsneDoGLHs8WSJnETLLxHfCo8xd8Nl9YIY0PKO+60Ut95lV/kJzw975qlXskpypB
	k9WYysIK3sfSwrbfD/BBm8jyZiMBEaoEPOMGI47IhmQmdHqrZXDabQjOMIJG83Ks8BoQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/emul: Adjust comments in x86-types.h
Message-Id: <E1wwJLK-004tfK-1G@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 12:55:02 +0000

commit fddeb0fd64dee822d91f94d0f6e43920541e1947
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 14 16:56:57 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:11 2026 +0100

    x86/emul: Adjust comments in x86-types.h
    
    x86_segment enumerates segments, not segment registers.  Adjust the comment to
    make this clearer.
    
    Fix a stray tab with the closing #endif.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/x86-types.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/x86-types.h b/xen/arch/x86/include/asm/x86-types.h
index 1c43421885..69a9732713 100644
--- a/xen/arch/x86/include/asm/x86-types.h
+++ b/xen/arch/x86/include/asm/x86-types.h
@@ -16,9 +16,10 @@
 #endif
 
 /*
- * Comprehensive enumeration of x86 segment registers.  Various bits of code
- * rely on this order (general purpose before system, tr at the beginning of
- * system).
+ * x86 Segments.
+ *
+ * Various areas of code rely on this order (general purpose before system,
+ * tr at the beginning of system).
  */
 enum x86_segment {
     /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
@@ -73,4 +74,4 @@ struct segment_register {
     uint64_t   base;
 };
 
-#endif	/* X86_X86_TYPES_H */
+#endif /* X86_X86_TYPES_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 12:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394139.1632955 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwJLV-0000BJ-O6; Tue, 18 Aug 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 1394139.1632955; Tue, 18 Aug 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 1wwJLV-0000BA-LT; Tue, 18 Aug 2026 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1394139;
 Tue, 18 Aug 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 1wwJLU-0000Ax-LF
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 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 1wwJLU-00Abdv-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJLU-004tjF-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 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=mybKRz8fkZMAdUROlOXq0eI5fngJ+X9zjRpi1Qcjsac=; b=aLPHYM5M0ICW38y0oYYyVKI8g3
	ytux7btiRzLmoQ1a5W7SrJDs6cjxyZi/fDiXZMfspAh1TjOHapUgvTMSsNBNBM74Ib+WrHtCro/RV
	ISUHie+AUFcVVSuqhKhNv9e/n6oj9h9jNdgKAZfV0QYMrhg50NnEQQDgAlA9nqTP5DQw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/emul: Rename the x86_seg_* system segments
Message-Id: <E1wwJLU-004tjF-1s@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 12:55:12 +0000

commit 72b05c267e9d1479cb1914535dd885ae9c95e2af
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 14 17:04:31 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:11 2026 +0100

    x86/emul: Rename the x86_seg_* system segments
    
    These refer to the segments themsevles, not to the registers, even if there is
    a tight coupling between the two.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/fuzz/x86_instruction_emulator/fuzz-emul.c |  4 +-
 tools/tests/x86_emulator/test_x86_emulator.c    |  4 +-
 xen/arch/x86/hvm/domain.c                       | 15 ++++---
 xen/arch/x86/hvm/hvm.c                          | 56 ++++++++++++-------------
 xen/arch/x86/hvm/svm/svm.c                      | 28 ++++++-------
 xen/arch/x86/hvm/vmx/realmode.c                 |  2 +-
 xen/arch/x86/hvm/vmx/vmx.c                      | 44 +++++++++----------
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h         |  2 +-
 xen/arch/x86/include/asm/processor.h            |  2 +-
 xen/arch/x86/include/asm/x86-types.h            | 12 +++---
 xen/arch/x86/pv/emul-priv-op.c                  |  2 +-
 xen/arch/x86/vm_event.c                         |  4 +-
 xen/arch/x86/x86_emulate/0f01.c                 |  2 +-
 xen/arch/x86/x86_emulate/x86_emulate.c          | 16 +++----
 xen/arch/x86/x86_emulate/x86_emulate.h          |  2 +-
 15 files changed, 99 insertions(+), 96 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
index 2b9b72df35..a797d17fe5 100644
--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
+++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
@@ -173,7 +173,7 @@ static int fuzz_read(
     /* Reads expected for all user and system segments. */
     if ( is_x86_user_segment(seg) )
         assert(ctxt->addr_size == 64 || !(offset >> 32));
-    else if ( seg == x86_seg_tr )
+    else if ( seg == x86_seg_tss )
         /*
          * The TSS is special in that accesses below the segment base are
          * possible, as the Interrupt Redirection Bitmap starts 32 bytes
@@ -362,7 +362,7 @@ static int fuzz_cmpxchg(
     if ( is_x86_user_segment(seg) )
         assert(ctxt->addr_size == 64 || !(offset >> 32));
     else
-        assert((seg == x86_seg_gdtr || seg == x86_seg_ldtr) && !(offset >> 16));
+        assert((seg == x86_seg_gdt || seg == x86_seg_ldt) && !(offset >> 16));
 
     return maybe_fail(ctxt, "cmpxchg", true);
 }
diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 31391f1bf7..61b2840ee0 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -559,7 +559,7 @@ static int read(
     {
         uint64_t value;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         /* Fake system segment type matching table index. */
         if ( (offset & 7) || (bytes > 8) )
             return X86EMUL_UNHANDLEABLE;
@@ -579,7 +579,7 @@ static int read(
         memcpy(p_data, &value, bytes);
         return X86EMUL_OKAY;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         /* Fake user segment type matching table index. */
         if ( (offset & 7) || (bytes > 8) )
             return X86EMUL_UNHANDLEABLE;
diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index a0e811ea47..978d8b2222 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -34,7 +34,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
         return 0;
     }
 
-    if ( seg == x86_seg_tr )
+    if ( seg == x86_seg_tss )
     {
         if ( reg->s )
         {
@@ -88,7 +88,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
         }
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         break;
 
     default:
@@ -131,18 +131,21 @@ int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
 #define SEG(s, r) ({                                                        \
     s = (struct segment_register)                                           \
         { 0, { (r)->s ## _ar }, (r)->s ## _limit, (r)->s ## _base };        \
-    /* Set accessed / busy bit for present segments. */                     \
+    /* Set accessed bit for present segments. */                            \
     if ( (s).p )                                                            \
-        (s).type |= (x86_seg_ ## s != x86_seg_tr ? 1 : 2);                  \
+        (s).type |= 1;                                                      \
     check_segment(&(s), x86_seg_ ## s); })
 
         rc = SEG(cs, regs);
         rc |= SEG(ds, regs);
         rc |= SEG(ss, regs);
         rc |= SEG(es, regs);
-        rc |= SEG(tr, regs);
 #undef SEG
 
+        tr = (struct segment_register){
+            0, { regs->tr_ar | 2 /* Busy */ }, regs->tr_limit, regs->tr_base };
+        rc |= check_segment(&tr, x86_seg_tss);
+
         if ( rc != 0 )
             return rc;
 
@@ -307,7 +310,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
     hvm_set_segment_register(v, x86_seg_ds, &ds);
     hvm_set_segment_register(v, x86_seg_ss, &ss);
     hvm_set_segment_register(v, x86_seg_es, &es);
-    hvm_set_segment_register(v, x86_seg_tr, &tr);
+    hvm_set_segment_register(v, x86_seg_tss, &tr);
 
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a75ccb57bf..5cb4c348ec 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -879,11 +879,11 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
     /* Architecture-specific vmcs/vmcb bits */
     alternative_vcall(hvm_funcs.save_cpu_ctxt, v, &ctxt);
 
-    hvm_get_segment_register(v, x86_seg_idtr, &seg);
+    hvm_get_segment_register(v, x86_seg_idt, &seg);
     ctxt.idtr_limit = seg.limit;
     ctxt.idtr_base = seg.base;
 
-    hvm_get_segment_register(v, x86_seg_gdtr, &seg);
+    hvm_get_segment_register(v, x86_seg_gdt, &seg);
     ctxt.gdtr_limit = seg.limit;
     ctxt.gdtr_base = seg.base;
 
@@ -923,13 +923,13 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
     ctxt.gs_base = seg.base;
     ctxt.gs_arbytes = seg.attr;
 
-    hvm_get_segment_register(v, x86_seg_tr, &seg);
+    hvm_get_segment_register(v, x86_seg_tss, &seg);
     ctxt.tr_sel = seg.sel;
     ctxt.tr_limit = seg.limit;
     ctxt.tr_base = seg.base;
     ctxt.tr_arbytes = seg.attr;
 
-    hvm_get_segment_register(v, x86_seg_ldtr, &seg);
+    hvm_get_segment_register(v, x86_seg_ldt, &seg);
     ctxt.ldtr_sel = seg.sel;
     ctxt.ldtr_limit = seg.limit;
     ctxt.ldtr_base = seg.base;
@@ -1129,11 +1129,11 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 
     seg.limit = ctxt.idtr_limit;
     seg.base = ctxt.idtr_base;
-    hvm_set_segment_register(v, x86_seg_idtr, &seg);
+    hvm_set_segment_register(v, x86_seg_idt, &seg);
 
     seg.limit = ctxt.gdtr_limit;
     seg.base = ctxt.gdtr_base;
-    hvm_set_segment_register(v, x86_seg_gdtr, &seg);
+    hvm_set_segment_register(v, x86_seg_gdt, &seg);
 
     seg.sel = ctxt.cs_sel;
     seg.limit = ctxt.cs_limit;
@@ -1175,13 +1175,13 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     seg.limit = ctxt.tr_limit;
     seg.base = ctxt.tr_base;
     seg.attr = ctxt.tr_arbytes;
-    hvm_set_segment_register(v, x86_seg_tr, &seg);
+    hvm_set_segment_register(v, x86_seg_tss, &seg);
 
     seg.sel = ctxt.ldtr_sel;
     seg.limit = ctxt.ldtr_limit;
     seg.base = ctxt.ldtr_base;
     seg.attr = ctxt.ldtr_arbytes;
-    hvm_set_segment_register(v, x86_seg_ldtr, &seg);
+    hvm_set_segment_register(v, x86_seg_ldt, &seg);
 
     if ( ctxt.flags & XEN_X86_FPU_INITIALISED )
         vcpu_setup_fpu(v, &ctxt.fpu_regs);
@@ -2875,11 +2875,11 @@ static int task_switch_load_seg(
     }
 
     /* LDT descriptor must be in the GDT. */
-    if ( (seg == x86_seg_ldtr) && (sel & 4) )
+    if ( (seg == x86_seg_ldt) && (sel & 4) )
         goto fault;
 
     hvm_get_segment_register(
-        v, (sel & 4) ? x86_seg_ldtr : x86_seg_gdtr, &desctab);
+        v, (sel & 4) ? x86_seg_ldt : x86_seg_gdt, &desctab);
 
     /* Segment not valid for use (cooked meaning of .p)? */
     if ( !desctab.p )
@@ -2897,7 +2897,7 @@ static int task_switch_load_seg(
         desc = *pdesc;
 
         /* LDT descriptor is a system segment. All others are code/data. */
-        if ( (desc.b & (1u<<12)) == ((seg == x86_seg_ldtr) << 12) )
+        if ( (desc.b & (1 << 12)) == ((seg == x86_seg_ldt) << 12) )
             goto fault;
 
         dpl = (desc.b >> 13) & 3;
@@ -2920,7 +2920,7 @@ static int task_switch_load_seg(
             if ( (dpl != cpl) || (dpl != rpl) )
                 goto fault;
             break;
-        case x86_seg_ldtr:
+        case x86_seg_ldt:
             /* LDT system segment? */
             if ( (desc.b & _SEGMENT_TYPE) != (2u<<8) )
                 goto fault;
@@ -3035,8 +3035,8 @@ void hvm_task_switch(
     unsigned int token = hvmemul_cache_disable(v);
     struct tss32 tss;
 
-    hvm_get_segment_register(v, x86_seg_gdtr, &gdt);
-    hvm_get_segment_register(v, x86_seg_tr, &prev_tr);
+    hvm_get_segment_register(v, x86_seg_gdt, &gdt);
+    hvm_get_segment_register(v, x86_seg_tss, &prev_tr);
 
     if ( ((tss_sel & 0xfff8) + 7) > gdt.limit )
     {
@@ -3120,7 +3120,7 @@ void hvm_task_switch(
     tss.fs = segr.sel;
     hvm_get_segment_register(v, x86_seg_gs, &segr);
     tss.gs = segr.sel;
-    hvm_get_segment_register(v, x86_seg_ldtr, &segr);
+    hvm_get_segment_register(v, x86_seg_ldt, &segr);
     tss.ldt = segr.sel;
 
     rc = hvm_copy_to_guest_linear(prev_tr.base + offsetof(typeof(tss), eip),
@@ -3146,7 +3146,7 @@ void hvm_task_switch(
 
     new_cpl = tss.eflags & X86_EFLAGS_VM ? 3 : tss.cs & 3;
 
-    if ( task_switch_load_seg(x86_seg_ldtr, tss.ldt, new_cpl, 0) )
+    if ( task_switch_load_seg(x86_seg_ldt, tss.ldt, new_cpl, 0) )
         goto out;
 
     rc = hvm_set_cr3(tss.cr3, false, true);
@@ -3193,7 +3193,7 @@ void hvm_task_switch(
     }
 
     tr.type = 0xb; /* busy 32-bit tss */
-    hvm_set_segment_register(v, x86_seg_tr, &tr);
+    hvm_set_segment_register(v, x86_seg_tss, &tr);
 
     v->arch.hvm.guest_cr[0] |= X86_CR0_TS;
     hvm_update_guest_cr(v, 0);
@@ -4011,14 +4011,14 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     hvm_set_segment_register(v, x86_seg_ss, &reg);
 
     reg.attr = 0x82; /* LDT */
-    hvm_set_segment_register(v, x86_seg_ldtr, &reg);
+    hvm_set_segment_register(v, x86_seg_ldt, &reg);
 
     reg.attr = 0x8b; /* 32-bit TSS (busy) */
-    hvm_set_segment_register(v, x86_seg_tr, &reg);
+    hvm_set_segment_register(v, x86_seg_tss, &reg);
 
     reg.attr = 0;
-    hvm_set_segment_register(v, x86_seg_gdtr, &reg);
-    hvm_set_segment_register(v, x86_seg_idtr, &reg);
+    hvm_set_segment_register(v, x86_seg_gdt, &reg);
+    hvm_set_segment_register(v, x86_seg_idt, &reg);
 
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
@@ -5278,7 +5278,7 @@ void hvm_get_segment_register(struct vcpu *v, enum x86_segment seg,
             reg->db = 0;
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         /*
          * SVM doesn't track %tr.B. Architecturally, a loaded TSS segment will
          * always be busy.
@@ -5294,8 +5294,8 @@ void hvm_get_segment_register(struct vcpu *v, enum x86_segment seg,
         reg->p = 1;
         break;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         /*
          * Treat GDTR/IDTR as being present system segments.  This avoids them
          * needing special casing for segmentation checks.
@@ -5382,7 +5382,7 @@ void hvm_set_segment_register(struct vcpu *v, enum x86_segment seg,
         }
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         ASSERT(reg->p);                              /* Usable. */
         ASSERT(!reg->s);                             /* System segment. */
         ASSERT(!(reg->sel & 0x4));                   /* !TI. */
@@ -5394,7 +5394,7 @@ void hvm_set_segment_register(struct vcpu *v, enum x86_segment seg,
             ASSERT(!"%tr typecheck failure");
         break;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         if ( reg->p )
         {
             ASSERT(!reg->s);                         /* System segment. */
@@ -5404,8 +5404,8 @@ void hvm_set_segment_register(struct vcpu *v, enum x86_segment seg,
         }
         break;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         ASSERT(is_canonical_address(reg->base));
         ASSERT((reg->limit >> 16) == 0);             /* Upper bits clear. */
         break;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 38c61db1d7..fb9ddf70dc 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -622,20 +622,20 @@ static void cf_check svm_get_segment_register(
             reg->dpl = vmcb_get_cpl(vmcb);
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         svm_sync_vmcb(v, vmcb_in_sync);
         *reg = vmcb->tr;
         break;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         *reg = vmcb->gdtr;
         break;
 
-    case x86_seg_idtr:
+    case x86_seg_idt:
         *reg = vmcb->idtr;
         break;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         svm_sync_vmcb(v, vmcb_in_sync);
         *reg = vmcb->ldtr;
         break;
@@ -664,15 +664,15 @@ static void cf_check svm_set_segment_register(
         vmcb->cleanbits.seg = false;
         break;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         vmcb->cleanbits.dt = false;
         break;
 
     case x86_seg_fs:
     case x86_seg_gs:
-    case x86_seg_tr:
-    case x86_seg_ldtr:
+    case x86_seg_tss:
+    case x86_seg_ldt:
         if ( v == current )
             svm_sync_vmcb(v, vmcb_needs_vmload);
         break;
@@ -694,21 +694,21 @@ static void cf_check svm_set_segment_register(
         vmcb->sreg[seg] = *reg;
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         vmcb->tr = *reg;
         break;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         vmcb->gdtr.base = reg->base;
         vmcb->gdtr.limit = reg->limit;
         break;
 
-    case x86_seg_idtr:
+    case x86_seg_idt:
         vmcb->idtr.base = reg->base;
         vmcb->idtr.limit = reg->limit;
         break;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         vmcb->ldtr = *reg;
         break;
 
@@ -1163,8 +1163,8 @@ static void svm_emul_swint_injection(struct x86_event *event)
      * this entry, even though we don't look at all the words read.
      */
     hvm_get_segment_register(curr, x86_seg_cs, &cs);
-    hvm_get_segment_register(curr, x86_seg_idtr, &idtr);
-    if ( !hvm_virtual_to_linear_addr(x86_seg_idtr, &idtr, idte_offset,
+    hvm_get_segment_register(curr, x86_seg_idt, &idtr);
+    if ( !hvm_virtual_to_linear_addr(x86_seg_idt, &idtr, idte_offset,
                                      idte_size, hvm_access_read,
                                      &cs, &idte_linear_addr) )
         goto raise_exception;
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index ff44ddcfa6..9787a7bdcf 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -34,7 +34,7 @@ static void realmode_deliver_exception(
     uint16_t frame[3];
     unsigned int last_byte;
 
-    idtr = hvmemul_get_seg_reg(x86_seg_idtr, hvmemul_ctxt);
+    idtr = hvmemul_get_seg_reg(x86_seg_idt,  hvmemul_ctxt);
     csr  = hvmemul_get_seg_reg(x86_seg_cs,   hvmemul_ctxt);
     __set_bit(x86_seg_cs, &hvmemul_ctxt->seg_reg_dirty);
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 269ca56433..c2a76d691e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1227,20 +1227,20 @@ static void cf_check vmx_get_segment_register(
     }
 
     /*
-     * Xen's x86_seg_* enumeration *almost* matches the VMCS encoding order.
+     * Xen's x86_segment encoding *almost* matches the VMCS encoding order.
      *
-     * tr and ldtr are reversed, and other areas of code rely on this, so we
+     * TSS and LDT are reversed, and other areas of code rely on this, so we
      * can't just re-enumerate.
      */
-    BUILD_BUG_ON(x86_seg_tr   != 6);
-    BUILD_BUG_ON(x86_seg_ldtr != 7);
-    BUILD_BUG_ON(x86_seg_gdtr != 8);
-    BUILD_BUG_ON(x86_seg_idtr != 9);
+    BUILD_BUG_ON(x86_seg_tss != 6);
+    BUILD_BUG_ON(x86_seg_ldt != 7);
+    BUILD_BUG_ON(x86_seg_gdt != 8);
+    BUILD_BUG_ON(x86_seg_idt != 9);
     switch ( tmp_seg = seg )
     {
-    case x86_seg_tr:
-    case x86_seg_ldtr:
-        tmp_seg ^= 1; /* Flip tr and ldtr so GUEST_SEG_*() works. */
+    case x86_seg_tss:
+    case x86_seg_ldt:
+        tmp_seg ^= 1; /* Flip TSS and LDT so GUEST_SEG_*() works. */
         fallthrough;
 
     case x86_seg_es ... x86_seg_gs:
@@ -1248,8 +1248,8 @@ static void cf_check vmx_get_segment_register(
         __vmread(GUEST_SEG_AR_BYTES(tmp_seg), &attr);
         fallthrough;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         __vmread(GUEST_SEG_LIMIT(tmp_seg),    &limit);
         __vmread(GUEST_SEG_BASE(tmp_seg),     &reg->base);
         break;
@@ -1272,11 +1272,11 @@ static void cf_check vmx_get_segment_register(
         (!(attr & (1u << 16)) << 7) | (attr & 0x7f) | ((attr >> 4) & 0xf00);
 
     /* Adjust for virtual 8086 mode */
-    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tr
+    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tss
          && !(v->arch.hvm.vmx.vm86_segment_mask & (1u << seg)) )
     {
         struct segment_register *sreg = &v->arch.hvm.vmx.vm86_saved_seg[seg];
-        if ( seg == x86_seg_tr ) 
+        if ( seg == x86_seg_tss )
             *reg = *sreg;
         else if ( reg->base != sreg->base || seg == x86_seg_ss )
         {
@@ -1312,12 +1312,12 @@ static void cf_check vmx_set_segment_register(
     base = reg->base;
 
     /* Adjust CS/SS/DS/ES/FS/GS/TR for virtual 8086 mode */
-    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tr )
+    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tss )
     {
         /* Remember the proper contents */
         v->arch.hvm.vmx.vm86_saved_seg[seg] = *reg;
         
-        if ( seg == x86_seg_tr ) 
+        if ( seg == x86_seg_tss )
         {
             const struct domain *d = v->domain;
             uint64_t val = d->arch.hvm.params[HVM_PARAM_VM86_TSS_SIZED];
@@ -1367,9 +1367,9 @@ static void cf_check vmx_set_segment_register(
 
     switch ( seg )
     {
-    case x86_seg_tr:
-    case x86_seg_ldtr:
-        seg ^= 1; /* Flip tr and ldtr so GUEST_SEG_*() works. */
+    case x86_seg_tss:
+    case x86_seg_ldt:
+        seg ^= 1; /* Flip TSS and LDT so GUEST_SEG_*() works. */
         fallthrough;
 
     case x86_seg_es ... x86_seg_gs:
@@ -1377,8 +1377,8 @@ static void cf_check vmx_set_segment_register(
         __vmwrite(GUEST_SEG_AR_BYTES(seg), attr);
         fallthrough;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         __vmwrite(GUEST_SEG_LIMIT(seg),    limit);
         __vmwrite(GUEST_SEG_BASE(seg),     base);
         break;
@@ -1738,9 +1738,9 @@ static void cf_check vmx_update_guest_cr(
              (realmode != v->arch.hvm.vmx.vmx_realmode) )
         {
             enum x86_segment s;
-            struct segment_register reg[x86_seg_tr + 1];
+            struct segment_register reg[x86_seg_tss + 1];
 
-            BUILD_BUG_ON(x86_seg_tr != x86_seg_gs + 1);
+            BUILD_BUG_ON(x86_seg_tss != x86_seg_gs + 1);
 
             /* Entering or leaving real mode: adjust the segment registers.
              * Need to read them all either way, as realmode reads can update
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index f85a8c8bba..d0716e97d2 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -174,7 +174,7 @@ struct vmx_vcpu {
     /* Bitmask of segments that we can't safely use in virtual 8086 mode */
     uint16_t             vm86_segment_mask;
     /* Shadow CS, SS, DS, ES, FS, GS, TR while in virtual 8086 mode */
-    struct segment_register vm86_saved_seg[x86_seg_tr + 1];
+    struct segment_register vm86_saved_seg[x86_seg_tss + 1];
     /* Remember EFLAGS while in virtual 8086 mode */
     uint32_t             vm86_saved_eflags;
     int                  hostenv_migrated;
diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..4b200428be 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -43,7 +43,7 @@
 /* Internally used only flags. */
 #define PFEC_page_paged     (1U<<16)
 #define PFEC_page_shared    (1U<<17)
-#define PFEC_implicit       (1U<<18) /* Pagewalk input for ldt/gdt/idt/tr accesses. */
+#define PFEC_implicit       (1U<<18) /* Pagewalk input for ldt/gdt/idt/tss accesses. */
 #define PFEC_synth_mask     (~PFEC_arch_mask) /* Synthetic PFEC values. */
 
 /* Other exception error code values. */
diff --git a/xen/arch/x86/include/asm/x86-types.h b/xen/arch/x86/include/asm/x86-types.h
index 69a9732713..fcb476d362 100644
--- a/xen/arch/x86/include/asm/x86-types.h
+++ b/xen/arch/x86/include/asm/x86-types.h
@@ -19,7 +19,7 @@
  * x86 Segments.
  *
  * Various areas of code rely on this order (general purpose before system,
- * tr at the beginning of system).
+ * tss at the beginning of system).
  */
 enum x86_segment {
     /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
@@ -30,10 +30,10 @@ enum x86_segment {
     x86_seg_fs,
     x86_seg_gs,
     /* System: Valid to use for implicit table references. */
-    x86_seg_tr,
-    x86_seg_ldtr,
-    x86_seg_gdtr,
-    x86_seg_idtr,
+    x86_seg_tss,
+    x86_seg_ldt,
+    x86_seg_gdt,
+    x86_seg_idt,
     /* No Segment: For (system/normal) accesses which are already linear. */
     x86_seg_sys,
     x86_seg_none
@@ -47,7 +47,7 @@ static inline bool is_x86_user_segment(enum x86_segment seg)
 }
 static inline bool is_x86_system_segment(enum x86_segment seg)
 {
-    return seg >= x86_seg_tr && seg < x86_seg_none;
+    return seg >= x86_seg_tss && seg < x86_seg_none;
 }
 
 /*
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 1a3e3012e2..7bebd2ccdc 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -504,7 +504,7 @@ static int cf_check read_segment(
     struct x86_emulate_ctxt *ctxt)
 {
     /* Check if this is an attempt to access the I/O bitmap. */
-    if ( seg == x86_seg_tr )
+    if ( seg == x86_seg_tss )
     {
         switch ( ctxt->opcode )
         {
diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index 112d2ef66d..efafb4e4bc 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -183,7 +183,7 @@ static void vm_event_pack_segment_register(enum x86_segment segment,
         reg->es_sel = seg.sel;
         break;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         reg->gdtr_base = seg.base;
         reg->gdtr_limit = seg.limit;
         break;
@@ -248,7 +248,7 @@ void vm_event_fill_regs(vm_event_request_t *req)
     vm_event_pack_segment_register(x86_seg_ss, &req->data.regs.x86);
     vm_event_pack_segment_register(x86_seg_ds, &req->data.regs.x86);
     vm_event_pack_segment_register(x86_seg_es, &req->data.regs.x86);
-    vm_event_pack_segment_register(x86_seg_gdtr, &req->data.regs.x86);
+    vm_event_pack_segment_register(x86_seg_gdt, &req->data.regs.x86);
 
     req->data.regs.x86.shadow_gs = ctxt.shadow_gs;
     req->data.regs.x86.dr6 = ctxt.dr6;
diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index d2a106557d..ff39aefd03 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -22,7 +22,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
                  struct x86_emulate_ctxt *ctxt,
                  const struct x86_emulate_ops *ops)
 {
-    enum x86_segment seg = (s->modrm_reg & 1) ? x86_seg_idtr : x86_seg_gdtr;
+    enum x86_segment seg = (s->modrm_reg & 1) ? x86_seg_idt : x86_seg_gdt;
     int rc;
 
     switch ( s->modrm )
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index e15ab37758..7de6460836 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -814,13 +814,13 @@ static int ioport_access_check(
      * X86EMUL_DONE coming back here may be used to defer the port
      * permission check to the respective ioport hook.
      */
-    if ( (rc = ops->read_segment(x86_seg_tr, &tr, ctxt)) != 0 )
+    if ( (rc = ops->read_segment(x86_seg_tss, &tr, ctxt)) != 0 )
         return rc == X86EMUL_DONE ? X86EMUL_OKAY : rc;
 
     /* Ensure the TSS has an io-bitmap-offset field. */
     generate_exception_if(tr.type != 0xb, X86_EXC_GP, 0);
 
-    switch ( rc = read_ulong(x86_seg_tr, 0x66, &iobmp, 2, ctxt, ops) )
+    switch ( rc = read_ulong(x86_seg_tss, 0x66, &iobmp, 2, ctxt, ops) )
     {
     case X86EMUL_OKAY:
         break;
@@ -834,7 +834,7 @@ static int ioport_access_check(
     }
 
     /* Read two bytes including byte containing first port. */
-    switch ( rc = read_ulong(x86_seg_tr, iobmp + first_port / 8,
+    switch ( rc = read_ulong(x86_seg_tss, iobmp + first_port / 8,
                              &iobmp, 2, ctxt, ops) )
     {
     case X86EMUL_OKAY:
@@ -891,7 +891,7 @@ protmode_load_seg(
     const struct x86_emulate_ops *ops)
 {
     const struct cpu_policy *cp = ctxt->cpu_policy;
-    enum x86_segment sel_seg = (sel & 4) ? x86_seg_ldtr : x86_seg_gdtr;
+    enum x86_segment sel_seg = (sel & 4) ? x86_seg_ldt : x86_seg_gdt;
     struct { uint32_t a, b; } desc, desc_hi = {};
     uint8_t dpl, rpl;
     int cpl = x86emul_get_cpl(ctxt, ops);
@@ -912,7 +912,7 @@ protmode_load_seg(
                 break;
             /* fall through */
         case x86_seg_cs:
-        case x86_seg_tr:
+        case x86_seg_tss:
             goto raise_exn;
         }
         if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
@@ -992,13 +992,13 @@ protmode_load_seg(
         if ( (dpl != cpl) || (dpl != rpl) )
             goto raise_exn;
         break;
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         /* LDT system segment? */
         if ( (desc.b & (15u<<8)) != (2u<<8) )
             goto raise_exn;
         a_flag = 0;
         break;
-    case x86_seg_tr:
+    case x86_seg_tss:
         /* Available TSS system segment? */
         if ( (desc.b & (15u<<8)) != (9u<<8) )
             goto raise_exn;
@@ -2914,7 +2914,7 @@ x86_emulate(
         break;
 
     case X86EMUL_OPC(0x0f, 0x00): /* Grp6 */
-        seg = (modrm_reg & 1) ? x86_seg_tr : x86_seg_ldtr;
+        seg = (modrm_reg & 1) ? x86_seg_tss : x86_seg_ldt;
         generate_exception_if(!in_protmode(ctxt, ops), X86_EXC_UD);
         switch ( modrm_reg & 6 )
         {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 534b1c46fa..d86ed7b3e0 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -51,7 +51,7 @@ struct x86_emul_fpu_aux {
  /*
   * Operation fully done by one of the hooks:
   * - validate(): operation completed (except common insn retire logic)
-  * - read_segment(x86_seg_tr, ...): bypass I/O bitmap access
+  * - read_segment(x86_seg_tss, ...): bypass I/O bitmap access
   * - read_io() / write_io(): bypass GPR update (non-string insns only)
   * Undefined behavior when used anywhere else.
   */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 12:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 12:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394141.1632959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwJLf-0000Dt-Qo; Tue, 18 Aug 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 1394141.1632959; Tue, 18 Aug 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 1wwJLf-0000Dl-OJ; Tue, 18 Aug 2026 12:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1394141;
 Tue, 18 Aug 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 1wwJLe-0000Dd-U4
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 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 1wwJLf-00Abe6-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJLe-004tlR-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 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=WmIQCW4dzReA600a37v3khEDq2hvep0wp18SfhVVtUA=; b=0Pwc/0zebPnvVdAk+Y3EMdrQgE
	DEcnkuPUestXZ9oMU1Q3VhRy8tCHI3+OiIIo9MSMOAJqzKGHZzrhd3R+uy43VT3I80sWYhEd/EFDY
	KALac702AXisiwT0Gm95aBTYRJqubDHPRrMKjItMWu6MhbT4moFh+tQCZx1jW6kY9QtQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/emul: Drop the union in x86_event had have a single data field
Message-Id: <E1wwJLe-004tlR-2i@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 12:55:22 +0000

commit e1060c760d2be08c09353e20d90699bc07ad02a7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 14 17:17:06 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:11 2026 +0100

    x86/emul: Drop the union in x86_event had have a single data field
    
    FRED has formalised the event_data field.  It already has more uses than
    given (e.g. the NMI Source Bitmap), and further uses are expected in the
    future.
    
    Collapse the union into a single field called 'data' as the struct has event
    in it's name, as well as 'event' being the common name for the variable.
    Refer to the FRED spec rather than keeping an out-of-date list of uses.
    
    Adjust all users of the old names.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/dm.c                  |  2 +-
 xen/arch/x86/hvm/hvm.c                 |  4 ++--
 xen/arch/x86/hvm/svm/nestedsvm.c       |  2 +-
 xen/arch/x86/hvm/svm/svm.c             |  8 ++++----
 xen/arch/x86/hvm/vmx/vmx.c             |  2 +-
 xen/arch/x86/include/asm/domain.h      |  6 ++----
 xen/arch/x86/include/asm/hvm/hvm.h     |  3 +--
 xen/arch/x86/include/asm/x86-event.h   | 14 ++++++++++----
 xen/arch/x86/pv/traps.c                | 10 +++++-----
 xen/arch/x86/x86_emulate/x86_emulate.h |  2 +-
 10 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 1f44fff12a..91f6ca669b 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -315,7 +315,7 @@ static int inject_event(struct domain *d,
     v->arch.hvm.inject_event.type = data->type;
     v->arch.hvm.inject_event.insn_len = data->insn_len;
     v->arch.hvm.inject_event.error_code = data->error_code;
-    v->arch.hvm.inject_event.cr2 = data->cr2;
+    v->arch.hvm.inject_event.data = data->cr2;
     smp_wmb();
     v->arch.hvm.inject_event.vector = data->vector;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5cb4c348ec..955fc062a5 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -513,7 +513,7 @@ void hvm_migrate_pirqs(struct vcpu *v)
 
 static bool hvm_get_pending_event(struct vcpu *v, struct x86_event *info)
 {
-    info->cr2 = v->arch.hvm.guest_cr[2];
+    info->data = v->arch.hvm.guest_cr[2];
 
     return alternative_call(hvm_funcs.get_pending_event, v, info);
 }
@@ -555,7 +555,7 @@ void hvm_do_resume(struct vcpu *v)
         if ( hvm_get_pending_event(v, &info) )
         {
             hvm_monitor_interrupt(info.vector, info.type, info.error_code,
-                                  info.cr2);
+                                  info.data);
             v->arch.monitor.next_interrupt_enabled = false;
         }
     }
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 91c9060720..0845e9f778 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -775,7 +775,7 @@ int cf_check nsvm_vcpu_vmexit_event(
     ASSERT(vcpu_nestedhvm(v).nv_vvmcx != NULL);
 
     nestedsvm_vmexit_defer(v, VMEXIT_EXCEPTION_DE + event->vector,
-                           event->error_code, event->cr2);
+                           event->error_code, event->data);
     return NESTEDHVM_VMEXIT_DONE;
 }
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index fb9ddf70dc..5f5d903d87 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1177,7 +1177,7 @@ static void svm_emul_swint_injection(struct x86_event *event)
         {
             fault = X86_EXC_PF;
             ec = pfinfo.ec;
-            event->cr2 = pfinfo.linear;
+            event->data = pfinfo.linear;
         }
 
         goto raise_exception;
@@ -1270,8 +1270,8 @@ static void cf_check svm_inject_event(const struct x86_event *event)
 
     case X86_EXC_PF:
         ASSERT(_event.type == X86_ET_HW_EXC);
-        curr->arch.hvm.guest_cr[2] = _event.cr2;
-        vmcb_set_cr2(vmcb, _event.cr2);
+        curr->arch.hvm.guest_cr[2] = _event.data;
+        vmcb_set_cr2(vmcb, _event.data);
         break;
     }
 
@@ -1354,7 +1354,7 @@ static void cf_check svm_inject_event(const struct x86_event *event)
 
     if ( _event.vector == X86_EXC_PF && _event.type == X86_ET_HW_EXC )
         TRACE(TRC_HVM_PF_INJECT64, _event.error_code,
-              _event.cr2, _event.cr2 >> 32);
+              _event.data, _event.data >> 32);
     else
         TRACE(TRC_HVM_INJ_EXC, _event.vector, _event.error_code);
 }
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index c2a76d691e..e55c90ce7f 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2106,7 +2106,7 @@ static void cf_check vmx_inject_event(const struct x86_event *event)
 
     case X86_EXC_PF:
         ASSERT(_event.type == X86_ET_HW_EXC);
-        curr->arch.hvm.guest_cr[2] = _event.cr2;
+        curr->arch.hvm.guest_cr[2] = _event.data;
         break;
     }
 
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 50c048adb5..2d0a915410 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -747,10 +747,9 @@ static inline void pv_inject_DB(unsigned long pending_dbg)
         .vector      = X86_EXC_DB,
         .type        = X86_ET_HW_EXC,
         .error_code  = X86_EVENT_NO_EC,
+        .data        = pending_dbg,
     };
 
-    event.pending_dbg = pending_dbg;
-
     pv_inject_event(&event);
 }
 
@@ -760,10 +759,9 @@ static inline void pv_inject_page_fault(int errcode, unsigned long cr2)
         .vector = X86_EXC_PF,
         .type = X86_ET_HW_EXC,
         .error_code = errcode,
+        .data = cr2,
     };
 
-    event.cr2 = cr2;
-
     pv_inject_event(&event);
 }
 
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 0ce7d5d783..16383e1084 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -569,10 +569,9 @@ static inline void hvm_inject_page_fault(int errcode, unsigned long cr2)
         .vector = X86_EXC_PF,
         .type = X86_ET_HW_EXC,
         .error_code = errcode,
+        .data = cr2,
     };
 
-    event.cr2 = cr2;
-
     hvm_inject_event(&event);
 }
 
diff --git a/xen/arch/x86/include/asm/x86-event.h b/xen/arch/x86/include/asm/x86-event.h
index a8823c7cfc..8560770c4a 100644
--- a/xen/arch/x86/include/asm/x86-event.h
+++ b/xen/arch/x86/include/asm/x86-event.h
@@ -22,10 +22,16 @@ struct x86_event {
     uint8_t       type;         /* X86_ET_* */
     uint8_t       insn_len;     /* Instruction length */
     int32_t       error_code;   /* X86_EVENT_NO_EC if n/a */
-    union {
-        unsigned long cr2;         /* #PF */
-        unsigned long pending_dbg; /* #DB (new DR6 bits, positive polarity) */
-    };
+
+    /*
+     * As per the FRED spec.
+     *
+     * A subset of uses occur in IDT mode as well:
+     * - #PF: CR2
+     * - #DB: PENDING_DBG (new DR6 bits with positive polarity)
+     * - #NM: XFD_ERR (AMX)
+     */
+    unsigned long data;
 };
 
 #endif /* X86_X86_EVENT_H */
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index c863ab9d37..21a1f4b717 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -58,20 +58,20 @@ void pv_inject_event(const struct x86_event *event)
     switch ( vector | -(event->type == X86_ET_SW_INT) )
     {
     case X86_EXC_PF:
-        curr->arch.pv.ctrlreg[2] = event->cr2;
-        arch_set_cr2(curr, event->cr2);
+        curr->arch.pv.ctrlreg[2] = event->data;
+        arch_set_cr2(curr, event->data);
 
         /* Re-set error_code.user flag appropriately for the guest. */
         error_code &= ~PFEC_user_mode;
         if ( !guest_kernel_mode(curr, regs) )
             error_code |= PFEC_user_mode;
 
-        trace_pv_page_fault(event->cr2, error_code);
+        trace_pv_page_fault(event->data, error_code);
         break;
 
     case X86_EXC_DB:
         curr->arch.dr6 = x86_merge_dr6(curr->domain->arch.cpu_policy,
-                                       curr->arch.dr6, event->pending_dbg);
+                                       curr->arch.dr6, event->data);
         fallthrough;
     default:
         trace_pv_trap(vector, regs->rip, use_error_code, error_code);
@@ -94,7 +94,7 @@ void pv_inject_event(const struct x86_event *event)
                 vector, vector_name(vector), error_code);
 
         if ( vector == X86_EXC_PF )
-            show_page_walk(event->cr2);
+            show_page_walk(event->data);
     }
 }
 
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index d86ed7b3e0..4539b14c15 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -758,7 +758,7 @@ static inline void x86_emul_pagefault(
     ctxt->event.vector = X86_EXC_PF;
     ctxt->event.type = X86_ET_HW_EXC;
     ctxt->event.error_code = error_code;
-    ctxt->event.cr2 = cr2;
+    ctxt->event.data = cr2;
 
     ctxt->event_pending = true;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 12:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 12:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394142.1632962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwJLp-0000GB-SB; Tue, 18 Aug 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 1394142.1632962; Tue, 18 Aug 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 1wwJLp-0000G3-Pj; Tue, 18 Aug 2026 12:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1394142;
 Tue, 18 Aug 2026 12:55: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 1wwJLp-0000Fx-0r
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 2026 12:55: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 1wwJLp-00AbeC-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJLo-004tn9-34
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 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=givqbTRq+9ecTeoYr63u/EFjWgZe3BTuCC76Z/DA7aQ=; b=fgEOWoc6VOCHVMnW4+jBgR7tBv
	zpJE62fyQ/FsYtyF/b2cWgDsG5JpEOR6GEvKyesOhtm1cz/FkIW7TLqDi/5wvjQ/mk8wN6SpETcQt
	Y0hw4p5XXrOEV6TYCmq5JWyLgamYinuxG67FhRKgfNjKLtqo7X+g2M3kXj/3WqA6FKYU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nmi: Remove logic for pre-64bit Pentium 4 CPUs
Message-Id: <E1wwJLo-004tn9-34@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 12:55:32 +0000

commit 0555ad51db069d544e51b645147ad4bc737406e4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 17 17:19:53 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:29 2026 +0100

    x86/nmi: Remove logic for pre-64bit Pentium 4 CPUs
    
    Model 3 was the first 64bit-capable P4.  Xen won't be booting on anything
    older, so remove the condition.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index b71bf43635..d614641386 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -314,13 +314,9 @@ static void setup_p4_watchdog(void)
         clear_msr_range(0x3F1, 2);
     /* MSR 0x3F0 seems to have a default value of 0xFC00, but current
        docs doesn't fully define it, so leave it alone for now. */
-    if (boot_cpu_data.model >= 0x3) {
-        /* MSR_P4_IQ_ESCR0/1 (0x3ba/0x3bb) removed */
-        clear_msr_range(0x3A0, 26);
-        clear_msr_range(0x3BC, 3);
-    } else {
-        clear_msr_range(0x3A0, 31);
-    }
+    /* MSR_P4_IQ_ESCR0/1 (0x3ba/0x3bb) removed */
+    clear_msr_range(0x3A0, 26);
+    clear_msr_range(0x3BC, 3);
     clear_msr_range(0x3C0, 6);
     clear_msr_range(0x3C8, 6);
     clear_msr_range(0x3E0, 2);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 12:55:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 12:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394143.1632967 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwJLz-0000IJ-To; Tue, 18 Aug 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 1394143.1632967; Tue, 18 Aug 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 1wwJLz-0000I6-R0; Tue, 18 Aug 2026 12:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1394143;
 Tue, 18 Aug 2026 12:55:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwJLz-0000Hx-4s
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 2026 12:55:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJLz-00AbeG-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJLz-004tov-0B
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j8HZwh75jHbe3Sbgly7crlT/Izeg02nUBl+oLvalCic=; b=0M01xg2vReY+Eb7VJr2tcWo27Q
	yJHuUZaBwI6KFemdR7ZhQWOEEyD3JuZ7LcaNMzL3JmbBcJiAldlj08teYECSVkKIZJ3KOKUp0LnHR
	ppfhcL55CUopXQivoWaUlzFsJml5exRcQ/peyhRGCYpBX5/2xaF5J7LaXKRSHQvQAqiQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nmi: Misc style fixes
Message-Id: <E1wwJLz-004tov-0B@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 12:55:43 +0000

commit a7a8c5a373bfebacdde2b930d3993370185ef667
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 11:19:43 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:48 2026 +0100

    x86/nmi: Misc style fixes
    
     * Drop trailing whitespace
     * Sort includes, dropping asm/mc146818rtc.h and asm/div64.h as unused
     * Brace position, and types
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 47 +++++++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index d614641386..029e1ea600 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -13,26 +13,25 @@
  *  Mikael Pettersson : PM converted to driver model. Disable/enable API.
  */
 
+#include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/keyhandler.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/param.h>
-#include <xen/irq.h>
-#include <xen/delay.h>
-#include <xen/time.h>
 #include <xen/sched.h>
-#include <xen/console.h>
 #include <xen/smp.h>
-#include <xen/keyhandler.h>
+#include <xen/time.h>
 #include <xen/watchdog.h>
-#include <xen/cpu.h>
+
+#include <asm/apic.h>
 #include <asm/current.h>
-#include <asm/mc146818rtc.h>
-#include <asm/msr.h>
 #include <asm/mpspec.h>
+#include <asm/msr.h>
 #include <asm/nmi.h>
-#include <asm/div64.h>
-#include <asm/apic.h>
 
 unsigned int nmi_watchdog = NMI_NONE;
 static unsigned int nmi_hz = HZ;
@@ -124,10 +123,10 @@ static int nmi_active;
 #define P4_CCCR_REQUIRED	(3<<16)
 #define P4_CCCR_ESCR_SELECT(N)	((N)<<13)
 #define P4_CCCR_ENABLE		(1<<12)
-/* 
+/*
  * Set up IQ_PERFCTR0 to behave like a clock, by having IQ_CCCR0 filter
  * CRU_ESCR0 (with any non-null event selector) through a complemented
- * max threshold. [IA32-Vol3, Section 14.9.9] 
+ * max threshold. [IA32-Vol3, Section 14.9.9]
  */
 #define P4_NMI_CRU_ESCR0	P4_ESCR_EVENT_SELECT(0x3F)
 #define P4_NMI_IQ_CCCR0	\
@@ -182,7 +181,7 @@ void __init check_nmi_watchdog(void)
      * There's a limit to how slow we can go because writing the perfctr
      * MSRs only sets the low 32 bits, with the top 8 bits sign-extended
      * from those, so it's not possible to set up a delay larger than
-     * 2^31 cycles and smaller than (2^40 - 2^31) cycles. 
+     * 2^31 cycles and smaller than (2^40 - 2^31) cycles.
      * (Intel SDM, section 18.22.2)
      */
     if ( nmi_watchdog == NMI_LOCAL_APIC )
@@ -199,8 +198,9 @@ static void cf_check nmi_timer_fn(void *unused)
 
 void disable_lapic_nmi_watchdog(void)
 {
-    if (nmi_active <= 0)
+    if ( nmi_active <= 0 )
         return;
+
     switch ( boot_cpu_data.vendor )
     {
     case X86_VENDOR_AMD:
@@ -231,9 +231,7 @@ void disable_lapic_nmi_watchdog(void)
 
 static void clear_msr_range(unsigned int base, unsigned int n)
 {
-    unsigned int i;
-
-    for (i = 0; i < n; i++)
+    for ( unsigned int i = 0; i < n; i++ )
         wrmsrns(base + i, 0);
 }
 
@@ -302,7 +300,7 @@ static void setup_p4_watchdog(void)
     uint64_t misc_enable;
 
     rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
+    if ( !(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
         return;
 
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
@@ -310,7 +308,7 @@ static void setup_p4_watchdog(void)
     if ( boot_cpu_data.x86_num_siblings == 2 )
         nmi_p4_cccr_val |= P4_CCCR_OVF_PMI1;
 
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL))
+    if ( !(misc_enable & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL) )
         clear_msr_range(0x3F1, 2);
     /* MSR 0x3F0 seems to have a default value of 0xFC00, but current
        docs doesn't fully define it, so leave it alone for now. */
@@ -389,7 +387,7 @@ static int cf_check cpu_nmi_callback(
 }
 
 static struct notifier_block cpu_nmi_nfb = {
-    .notifier_call = cpu_nmi_callback
+    .notifier_call = cpu_nmi_callback,
 };
 
 static DEFINE_PER_CPU(unsigned int, last_irq_sums);
@@ -440,15 +438,15 @@ bool nmi_watchdog_tick(const struct cpu_user_regs *regs)
          * before doing the oops ...
          */
         this_cpu(alert_counter)++;
-        if ( this_cpu(alert_counter) == opt_watchdog_timeout*nmi_hz )
+        if ( this_cpu(alert_counter) == opt_watchdog_timeout * nmi_hz )
         {
             console_force_unlock();
             printk("Watchdog timer detects that CPU%d is stuck!\n",
                    smp_processor_id());
             fatal_trap(regs, 1);
         }
-    } 
-    else 
+    }
+    else
     {
         this_cpu(last_irq_sums) = sum;
         this_cpu(alert_counter) = 0;
@@ -508,7 +506,8 @@ bool nmi_watchdog_tick(const struct cpu_user_regs *regs)
 void self_nmi(void)
 {
     unsigned long flags;
-    u32 id = get_apic_id();
+    uint32_t id = get_apic_id();
+
     local_irq_save(flags);
     apic_wait_icr_idle();
     apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 12:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 12:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394144.1632971 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwJMA-0000KW-Uw; Tue, 18 Aug 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 1394144.1632971; Tue, 18 Aug 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 1wwJMA-0000KM-SN; Tue, 18 Aug 2026 12:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1394144;
 Tue, 18 Aug 2026 12:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwJM9-0000KE-7x
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 2026 12:55:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJM9-00AbeM-1W
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJM9-004ts6-0a
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:55:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N+jR26rlylL3FhIBHShJFXCCsWFnr8bTsxyWnyh4te4=; b=OsN8xQOv7YSwpSpbcS+ZKfmJ+g
	vg2NApNoVByFcAsS7adchTbA1UBeSAu+Y40cJMgz7UaSJ+G+5FVsQnroqsJS/Lv9mxEikzz6PP0Qk
	QbaWKSnCm/R9r/2NofeqA/eUgpuQ+1u8P5fTGmRl09BAwDg5AVjEsndRBE9ZgVMmoeBo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wwJM9-004ts6-0a@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 12:55:53 +0000

commit dfb428cb1142a5a468531410e0461fb2a9f2a4ea
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 20:59:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:51:08 2026 +0100

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 029e1ea600..f7603ce369 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -295,14 +295,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if ( !(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -330,6 +324,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -340,6 +336,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        misc = rdmsr(MSR_IA32_MISC_ENABLE);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch ( boot_cpu_data.family )
         {
         case 6:
@@ -348,7 +352,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Aug 18 12:56:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Aug 2026 12:56:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394145.1632975 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwJML-0000MW-0C; Tue, 18 Aug 2026 12:56:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394145.1632975; Tue, 18 Aug 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 1wwJMK-0000MN-Ti; Tue, 18 Aug 2026 12:56:04 +0000
Received: by outflank-mailman (input) for mailman id 1394145;
 Tue, 18 Aug 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 1wwJMJ-0000MA-Bk
 for xen-changelog@lists.xenproject.org; Tue, 18 Aug 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 1wwJMJ-00Abew-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwJMJ-004tun-0v
 for xen-changelog@lists.xenproject.org;
 Tue, 18 Aug 2026 12:56:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kB8gskx9CGmIsGXhF7wf3lC/6xn6MwSr7TyzvvmyUVI=; b=qFyID2f3e1scjicRpUvYiS63+4
	IH6OUF5BRstPHeMc1WFeOTFgtT8SKLlo0pbvy3dsQPQCQ3kVDMpw6JEEEOfbujhwVbDWAKDtqbsEu
	LudxgLfnkSTDA61OfPsztK7Y3vCJLAb3KN4ylPrclgzoZKyK3r7rwYHaS6ZY4brUGoOU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nmi: Don't configure EvtSel repeatedly
Message-Id: <E1wwJMJ-004tun-0v@xenbits.xenproject.org>
Date: Tue, 18 Aug 2026 12:56:03 +0000

commit 669f8c502aeaa538f8407013ba04461e71361ed4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 22:45:53 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:51:59 2026 +0100

    x86/nmi: Don't configure EvtSel repeatedly
    
    In both setup_{k7,p6}_watchdog(), EvtSel0 is first zeroed, then written with
    everything but the enable bit, then written with the enable bit.
    
    setup_p4_watchdog() is slightly more complicated, owing to what
    appears to be a bug introduced by commit 2a2bd8de16b6 ("Clean up NMI
    watchdog handler."), which causes a second bit to be temporarily
    different too.
    
    The middle of the three writes is useless in all cases.  Drop it.
    
    While doing this, rename the 'counter' parameter for
    setup_p6_watchdog().  It is the event which is passed in; the counter
    is always counter 0.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index f7603ce369..b3d18270b1 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -246,29 +246,20 @@ static inline void write_watchdog_counter(const char *descr)
 
 static void setup_k7_watchdog(void)
 {
-    unsigned int evntsel;
-
     nmi_perfctr_msr = MSR_K7_PERFCTR0;
 
     clear_msr_range(MSR_K7_EVNTSEL0, 4);
     clear_msr_range(MSR_K7_PERFCTR0, 4);
 
-    evntsel = K7_EVNTSEL_INT
-        | K7_EVNTSEL_OS
-        | K7_EVNTSEL_USR
-        | K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING;
-
-    wrmsrns(MSR_K7_EVNTSEL0, evntsel);
     write_watchdog_counter("K7_PERFCTR0");
     apic_write(APIC_LVTPC, APIC_DM_NMI);
-    evntsel |= K7_EVNTSEL_ENABLE;
-    wrmsrns(MSR_K7_EVNTSEL0, evntsel);
+    wrmsrns(MSR_K7_EVNTSEL0,
+            K7_EVNTSEL_ENABLE | K7_EVNTSEL_INT | K7_EVNTSEL_OS |
+            K7_EVNTSEL_USR | K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING);
 }
 
-static void setup_p6_watchdog(unsigned counter)
+static void setup_p6_watchdog(unsigned int event)
 {
-    unsigned int evntsel;
-
     if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
@@ -283,16 +274,11 @@ static void setup_p6_watchdog(unsigned counter)
     clear_msr_range(MSR_P6_EVNTSEL(0), 2);
     clear_msr_range(MSR_P6_PERFCTR(0), 2);
 
-    evntsel = P6_EVNTSEL_INT
-        | P6_EVNTSEL_OS
-        | P6_EVNTSEL_USR
-        | counter;
-
-    wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
     write_watchdog_counter("P6_PERFCTR0");
     apic_write(APIC_LVTPC, APIC_DM_NMI);
-    evntsel |= P6_EVNTSEL0_ENABLE;
-    wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
+    wrmsrns(MSR_P6_EVNTSEL(0),
+            P6_EVNTSEL0_ENABLE | P6_EVNTSEL_INT | P6_EVNTSEL_OS |
+            P6_EVNTSEL_USR | event);
 }
 
 static void setup_p4_watchdog(uint64_t misc_enable)
@@ -316,7 +302,6 @@ static void setup_p4_watchdog(uint64_t misc_enable)
     clear_msr_range(MSR_P4_BPU_PERFCTR0, 18);
 
     wrmsrl(MSR_P4_CRU_ESCR0, P4_NMI_CRU_ESCR0);
-    wrmsrl(MSR_P4_IQ_CCCR0, P4_NMI_IQ_CCCR0 & ~P4_CCCR_ENABLE);
     write_watchdog_counter("P4_IQ_COUNTER0");
     apic_write(APIC_LVTPC, APIC_DM_NMI);
     wrmsrl(MSR_P4_IQ_CCCR0, nmi_p4_cccr_val);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 08:44:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 08:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394905.1633504 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwbtz-00083U-8G; Wed, 19 Aug 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 1394905.1633504; Wed, 19 Aug 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 1wwbtz-00083M-5g; Wed, 19 Aug 2026 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1394905;
 Wed, 19 Aug 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 1wwbty-00083F-9O
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwbty-00CBfg-1P
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwbty-004mGf-0J
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08: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=82L6MA48R00mwQOHNqKB9DIuGCsEjRsuzy0uQt1TRp8=; b=hVZFVE/QGaX9Fg6yepys3aLYR1
	aGjRMA//1O4XwvpCVE5LDwUFxW7LWSDmI/mm6LPxGPFk4Fkf+h71kQGTI61+ugK9J8hygWsb+FBq7
	Bfyb4DtA5160pXk3lwEXj2TnTOIx4A8Q7KNkMF5PAn/G29ADiucoM6ZkGcK3S4cmp2CM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/emul: Adjust comments in x86-types.h
Message-Id: <E1wwbty-004mGf-0J@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 08:44:02 +0000

commit fddeb0fd64dee822d91f94d0f6e43920541e1947
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 14 16:56:57 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:11 2026 +0100

    x86/emul: Adjust comments in x86-types.h
    
    x86_segment enumerates segments, not segment registers.  Adjust the comment to
    make this clearer.
    
    Fix a stray tab with the closing #endif.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/x86-types.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/x86-types.h b/xen/arch/x86/include/asm/x86-types.h
index 1c43421885..69a9732713 100644
--- a/xen/arch/x86/include/asm/x86-types.h
+++ b/xen/arch/x86/include/asm/x86-types.h
@@ -16,9 +16,10 @@
 #endif
 
 /*
- * Comprehensive enumeration of x86 segment registers.  Various bits of code
- * rely on this order (general purpose before system, tr at the beginning of
- * system).
+ * x86 Segments.
+ *
+ * Various areas of code rely on this order (general purpose before system,
+ * tr at the beginning of system).
  */
 enum x86_segment {
     /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
@@ -73,4 +74,4 @@ struct segment_register {
     uint64_t   base;
 };
 
-#endif	/* X86_X86_TYPES_H */
+#endif /* X86_X86_TYPES_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 08:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394907.1633507 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwbu9-00085F-A6; Wed, 19 Aug 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 1394907.1633507; Wed, 19 Aug 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 1wwbu9-000857-6z; Wed, 19 Aug 2026 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1394907;
 Wed, 19 Aug 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 1wwbu8-00084x-D5
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwbu8-00CBfp-22
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwbu8-004n2G-10
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08: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=CyAyOl0eH9qPGfhWqM2/N10j8YCITIY21UTP0S5OgQo=; b=r8giGsNvvmdrfK2K6ajihpzU99
	Ry4xd/TV4lV8PvW/n+YQHrDcgNkM9ABFBoyJlXoHukffZCnbPam9DbH7TKSc8GIT7DA7oMJvGSkZj
	WN0G6i2rpiFto0+OzktA5HPMxBpYD96zdv3nhcSNlhL+MKTnKtaVtc9wfAxcyYP5/x10=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/emul: Rename the x86_seg_* system segments
Message-Id: <E1wwbu8-004n2G-10@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 08:44:12 +0000

commit 72b05c267e9d1479cb1914535dd885ae9c95e2af
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 14 17:04:31 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:11 2026 +0100

    x86/emul: Rename the x86_seg_* system segments
    
    These refer to the segments themsevles, not to the registers, even if there is
    a tight coupling between the two.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/fuzz/x86_instruction_emulator/fuzz-emul.c |  4 +-
 tools/tests/x86_emulator/test_x86_emulator.c    |  4 +-
 xen/arch/x86/hvm/domain.c                       | 15 ++++---
 xen/arch/x86/hvm/hvm.c                          | 56 ++++++++++++-------------
 xen/arch/x86/hvm/svm/svm.c                      | 28 ++++++-------
 xen/arch/x86/hvm/vmx/realmode.c                 |  2 +-
 xen/arch/x86/hvm/vmx/vmx.c                      | 44 +++++++++----------
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h         |  2 +-
 xen/arch/x86/include/asm/processor.h            |  2 +-
 xen/arch/x86/include/asm/x86-types.h            | 12 +++---
 xen/arch/x86/pv/emul-priv-op.c                  |  2 +-
 xen/arch/x86/vm_event.c                         |  4 +-
 xen/arch/x86/x86_emulate/0f01.c                 |  2 +-
 xen/arch/x86/x86_emulate/x86_emulate.c          | 16 +++----
 xen/arch/x86/x86_emulate/x86_emulate.h          |  2 +-
 15 files changed, 99 insertions(+), 96 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
index 2b9b72df35..a797d17fe5 100644
--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
+++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
@@ -173,7 +173,7 @@ static int fuzz_read(
     /* Reads expected for all user and system segments. */
     if ( is_x86_user_segment(seg) )
         assert(ctxt->addr_size == 64 || !(offset >> 32));
-    else if ( seg == x86_seg_tr )
+    else if ( seg == x86_seg_tss )
         /*
          * The TSS is special in that accesses below the segment base are
          * possible, as the Interrupt Redirection Bitmap starts 32 bytes
@@ -362,7 +362,7 @@ static int fuzz_cmpxchg(
     if ( is_x86_user_segment(seg) )
         assert(ctxt->addr_size == 64 || !(offset >> 32));
     else
-        assert((seg == x86_seg_gdtr || seg == x86_seg_ldtr) && !(offset >> 16));
+        assert((seg == x86_seg_gdt || seg == x86_seg_ldt) && !(offset >> 16));
 
     return maybe_fail(ctxt, "cmpxchg", true);
 }
diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 31391f1bf7..61b2840ee0 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -559,7 +559,7 @@ static int read(
     {
         uint64_t value;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         /* Fake system segment type matching table index. */
         if ( (offset & 7) || (bytes > 8) )
             return X86EMUL_UNHANDLEABLE;
@@ -579,7 +579,7 @@ static int read(
         memcpy(p_data, &value, bytes);
         return X86EMUL_OKAY;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         /* Fake user segment type matching table index. */
         if ( (offset & 7) || (bytes > 8) )
             return X86EMUL_UNHANDLEABLE;
diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index a0e811ea47..978d8b2222 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -34,7 +34,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
         return 0;
     }
 
-    if ( seg == x86_seg_tr )
+    if ( seg == x86_seg_tss )
     {
         if ( reg->s )
         {
@@ -88,7 +88,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
         }
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         break;
 
     default:
@@ -131,18 +131,21 @@ int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
 #define SEG(s, r) ({                                                        \
     s = (struct segment_register)                                           \
         { 0, { (r)->s ## _ar }, (r)->s ## _limit, (r)->s ## _base };        \
-    /* Set accessed / busy bit for present segments. */                     \
+    /* Set accessed bit for present segments. */                            \
     if ( (s).p )                                                            \
-        (s).type |= (x86_seg_ ## s != x86_seg_tr ? 1 : 2);                  \
+        (s).type |= 1;                                                      \
     check_segment(&(s), x86_seg_ ## s); })
 
         rc = SEG(cs, regs);
         rc |= SEG(ds, regs);
         rc |= SEG(ss, regs);
         rc |= SEG(es, regs);
-        rc |= SEG(tr, regs);
 #undef SEG
 
+        tr = (struct segment_register){
+            0, { regs->tr_ar | 2 /* Busy */ }, regs->tr_limit, regs->tr_base };
+        rc |= check_segment(&tr, x86_seg_tss);
+
         if ( rc != 0 )
             return rc;
 
@@ -307,7 +310,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const struct vcpu_hvm_context *ctx)
     hvm_set_segment_register(v, x86_seg_ds, &ds);
     hvm_set_segment_register(v, x86_seg_ss, &ss);
     hvm_set_segment_register(v, x86_seg_es, &es);
-    hvm_set_segment_register(v, x86_seg_tr, &tr);
+    hvm_set_segment_register(v, x86_seg_tss, &tr);
 
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a75ccb57bf..5cb4c348ec 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -879,11 +879,11 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
     /* Architecture-specific vmcs/vmcb bits */
     alternative_vcall(hvm_funcs.save_cpu_ctxt, v, &ctxt);
 
-    hvm_get_segment_register(v, x86_seg_idtr, &seg);
+    hvm_get_segment_register(v, x86_seg_idt, &seg);
     ctxt.idtr_limit = seg.limit;
     ctxt.idtr_base = seg.base;
 
-    hvm_get_segment_register(v, x86_seg_gdtr, &seg);
+    hvm_get_segment_register(v, x86_seg_gdt, &seg);
     ctxt.gdtr_limit = seg.limit;
     ctxt.gdtr_base = seg.base;
 
@@ -923,13 +923,13 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
     ctxt.gs_base = seg.base;
     ctxt.gs_arbytes = seg.attr;
 
-    hvm_get_segment_register(v, x86_seg_tr, &seg);
+    hvm_get_segment_register(v, x86_seg_tss, &seg);
     ctxt.tr_sel = seg.sel;
     ctxt.tr_limit = seg.limit;
     ctxt.tr_base = seg.base;
     ctxt.tr_arbytes = seg.attr;
 
-    hvm_get_segment_register(v, x86_seg_ldtr, &seg);
+    hvm_get_segment_register(v, x86_seg_ldt, &seg);
     ctxt.ldtr_sel = seg.sel;
     ctxt.ldtr_limit = seg.limit;
     ctxt.ldtr_base = seg.base;
@@ -1129,11 +1129,11 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 
     seg.limit = ctxt.idtr_limit;
     seg.base = ctxt.idtr_base;
-    hvm_set_segment_register(v, x86_seg_idtr, &seg);
+    hvm_set_segment_register(v, x86_seg_idt, &seg);
 
     seg.limit = ctxt.gdtr_limit;
     seg.base = ctxt.gdtr_base;
-    hvm_set_segment_register(v, x86_seg_gdtr, &seg);
+    hvm_set_segment_register(v, x86_seg_gdt, &seg);
 
     seg.sel = ctxt.cs_sel;
     seg.limit = ctxt.cs_limit;
@@ -1175,13 +1175,13 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     seg.limit = ctxt.tr_limit;
     seg.base = ctxt.tr_base;
     seg.attr = ctxt.tr_arbytes;
-    hvm_set_segment_register(v, x86_seg_tr, &seg);
+    hvm_set_segment_register(v, x86_seg_tss, &seg);
 
     seg.sel = ctxt.ldtr_sel;
     seg.limit = ctxt.ldtr_limit;
     seg.base = ctxt.ldtr_base;
     seg.attr = ctxt.ldtr_arbytes;
-    hvm_set_segment_register(v, x86_seg_ldtr, &seg);
+    hvm_set_segment_register(v, x86_seg_ldt, &seg);
 
     if ( ctxt.flags & XEN_X86_FPU_INITIALISED )
         vcpu_setup_fpu(v, &ctxt.fpu_regs);
@@ -2875,11 +2875,11 @@ static int task_switch_load_seg(
     }
 
     /* LDT descriptor must be in the GDT. */
-    if ( (seg == x86_seg_ldtr) && (sel & 4) )
+    if ( (seg == x86_seg_ldt) && (sel & 4) )
         goto fault;
 
     hvm_get_segment_register(
-        v, (sel & 4) ? x86_seg_ldtr : x86_seg_gdtr, &desctab);
+        v, (sel & 4) ? x86_seg_ldt : x86_seg_gdt, &desctab);
 
     /* Segment not valid for use (cooked meaning of .p)? */
     if ( !desctab.p )
@@ -2897,7 +2897,7 @@ static int task_switch_load_seg(
         desc = *pdesc;
 
         /* LDT descriptor is a system segment. All others are code/data. */
-        if ( (desc.b & (1u<<12)) == ((seg == x86_seg_ldtr) << 12) )
+        if ( (desc.b & (1 << 12)) == ((seg == x86_seg_ldt) << 12) )
             goto fault;
 
         dpl = (desc.b >> 13) & 3;
@@ -2920,7 +2920,7 @@ static int task_switch_load_seg(
             if ( (dpl != cpl) || (dpl != rpl) )
                 goto fault;
             break;
-        case x86_seg_ldtr:
+        case x86_seg_ldt:
             /* LDT system segment? */
             if ( (desc.b & _SEGMENT_TYPE) != (2u<<8) )
                 goto fault;
@@ -3035,8 +3035,8 @@ void hvm_task_switch(
     unsigned int token = hvmemul_cache_disable(v);
     struct tss32 tss;
 
-    hvm_get_segment_register(v, x86_seg_gdtr, &gdt);
-    hvm_get_segment_register(v, x86_seg_tr, &prev_tr);
+    hvm_get_segment_register(v, x86_seg_gdt, &gdt);
+    hvm_get_segment_register(v, x86_seg_tss, &prev_tr);
 
     if ( ((tss_sel & 0xfff8) + 7) > gdt.limit )
     {
@@ -3120,7 +3120,7 @@ void hvm_task_switch(
     tss.fs = segr.sel;
     hvm_get_segment_register(v, x86_seg_gs, &segr);
     tss.gs = segr.sel;
-    hvm_get_segment_register(v, x86_seg_ldtr, &segr);
+    hvm_get_segment_register(v, x86_seg_ldt, &segr);
     tss.ldt = segr.sel;
 
     rc = hvm_copy_to_guest_linear(prev_tr.base + offsetof(typeof(tss), eip),
@@ -3146,7 +3146,7 @@ void hvm_task_switch(
 
     new_cpl = tss.eflags & X86_EFLAGS_VM ? 3 : tss.cs & 3;
 
-    if ( task_switch_load_seg(x86_seg_ldtr, tss.ldt, new_cpl, 0) )
+    if ( task_switch_load_seg(x86_seg_ldt, tss.ldt, new_cpl, 0) )
         goto out;
 
     rc = hvm_set_cr3(tss.cr3, false, true);
@@ -3193,7 +3193,7 @@ void hvm_task_switch(
     }
 
     tr.type = 0xb; /* busy 32-bit tss */
-    hvm_set_segment_register(v, x86_seg_tr, &tr);
+    hvm_set_segment_register(v, x86_seg_tss, &tr);
 
     v->arch.hvm.guest_cr[0] |= X86_CR0_TS;
     hvm_update_guest_cr(v, 0);
@@ -4011,14 +4011,14 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     hvm_set_segment_register(v, x86_seg_ss, &reg);
 
     reg.attr = 0x82; /* LDT */
-    hvm_set_segment_register(v, x86_seg_ldtr, &reg);
+    hvm_set_segment_register(v, x86_seg_ldt, &reg);
 
     reg.attr = 0x8b; /* 32-bit TSS (busy) */
-    hvm_set_segment_register(v, x86_seg_tr, &reg);
+    hvm_set_segment_register(v, x86_seg_tss, &reg);
 
     reg.attr = 0;
-    hvm_set_segment_register(v, x86_seg_gdtr, &reg);
-    hvm_set_segment_register(v, x86_seg_idtr, &reg);
+    hvm_set_segment_register(v, x86_seg_gdt, &reg);
+    hvm_set_segment_register(v, x86_seg_idt, &reg);
 
     /* Sync AP's TSC with BSP's. */
     v->arch.hvm.cache_tsc_offset =
@@ -5278,7 +5278,7 @@ void hvm_get_segment_register(struct vcpu *v, enum x86_segment seg,
             reg->db = 0;
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         /*
          * SVM doesn't track %tr.B. Architecturally, a loaded TSS segment will
          * always be busy.
@@ -5294,8 +5294,8 @@ void hvm_get_segment_register(struct vcpu *v, enum x86_segment seg,
         reg->p = 1;
         break;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         /*
          * Treat GDTR/IDTR as being present system segments.  This avoids them
          * needing special casing for segmentation checks.
@@ -5382,7 +5382,7 @@ void hvm_set_segment_register(struct vcpu *v, enum x86_segment seg,
         }
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         ASSERT(reg->p);                              /* Usable. */
         ASSERT(!reg->s);                             /* System segment. */
         ASSERT(!(reg->sel & 0x4));                   /* !TI. */
@@ -5394,7 +5394,7 @@ void hvm_set_segment_register(struct vcpu *v, enum x86_segment seg,
             ASSERT(!"%tr typecheck failure");
         break;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         if ( reg->p )
         {
             ASSERT(!reg->s);                         /* System segment. */
@@ -5404,8 +5404,8 @@ void hvm_set_segment_register(struct vcpu *v, enum x86_segment seg,
         }
         break;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         ASSERT(is_canonical_address(reg->base));
         ASSERT((reg->limit >> 16) == 0);             /* Upper bits clear. */
         break;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 38c61db1d7..fb9ddf70dc 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -622,20 +622,20 @@ static void cf_check svm_get_segment_register(
             reg->dpl = vmcb_get_cpl(vmcb);
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         svm_sync_vmcb(v, vmcb_in_sync);
         *reg = vmcb->tr;
         break;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         *reg = vmcb->gdtr;
         break;
 
-    case x86_seg_idtr:
+    case x86_seg_idt:
         *reg = vmcb->idtr;
         break;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         svm_sync_vmcb(v, vmcb_in_sync);
         *reg = vmcb->ldtr;
         break;
@@ -664,15 +664,15 @@ static void cf_check svm_set_segment_register(
         vmcb->cleanbits.seg = false;
         break;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         vmcb->cleanbits.dt = false;
         break;
 
     case x86_seg_fs:
     case x86_seg_gs:
-    case x86_seg_tr:
-    case x86_seg_ldtr:
+    case x86_seg_tss:
+    case x86_seg_ldt:
         if ( v == current )
             svm_sync_vmcb(v, vmcb_needs_vmload);
         break;
@@ -694,21 +694,21 @@ static void cf_check svm_set_segment_register(
         vmcb->sreg[seg] = *reg;
         break;
 
-    case x86_seg_tr:
+    case x86_seg_tss:
         vmcb->tr = *reg;
         break;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         vmcb->gdtr.base = reg->base;
         vmcb->gdtr.limit = reg->limit;
         break;
 
-    case x86_seg_idtr:
+    case x86_seg_idt:
         vmcb->idtr.base = reg->base;
         vmcb->idtr.limit = reg->limit;
         break;
 
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         vmcb->ldtr = *reg;
         break;
 
@@ -1163,8 +1163,8 @@ static void svm_emul_swint_injection(struct x86_event *event)
      * this entry, even though we don't look at all the words read.
      */
     hvm_get_segment_register(curr, x86_seg_cs, &cs);
-    hvm_get_segment_register(curr, x86_seg_idtr, &idtr);
-    if ( !hvm_virtual_to_linear_addr(x86_seg_idtr, &idtr, idte_offset,
+    hvm_get_segment_register(curr, x86_seg_idt, &idtr);
+    if ( !hvm_virtual_to_linear_addr(x86_seg_idt, &idtr, idte_offset,
                                      idte_size, hvm_access_read,
                                      &cs, &idte_linear_addr) )
         goto raise_exception;
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index ff44ddcfa6..9787a7bdcf 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -34,7 +34,7 @@ static void realmode_deliver_exception(
     uint16_t frame[3];
     unsigned int last_byte;
 
-    idtr = hvmemul_get_seg_reg(x86_seg_idtr, hvmemul_ctxt);
+    idtr = hvmemul_get_seg_reg(x86_seg_idt,  hvmemul_ctxt);
     csr  = hvmemul_get_seg_reg(x86_seg_cs,   hvmemul_ctxt);
     __set_bit(x86_seg_cs, &hvmemul_ctxt->seg_reg_dirty);
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 269ca56433..c2a76d691e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1227,20 +1227,20 @@ static void cf_check vmx_get_segment_register(
     }
 
     /*
-     * Xen's x86_seg_* enumeration *almost* matches the VMCS encoding order.
+     * Xen's x86_segment encoding *almost* matches the VMCS encoding order.
      *
-     * tr and ldtr are reversed, and other areas of code rely on this, so we
+     * TSS and LDT are reversed, and other areas of code rely on this, so we
      * can't just re-enumerate.
      */
-    BUILD_BUG_ON(x86_seg_tr   != 6);
-    BUILD_BUG_ON(x86_seg_ldtr != 7);
-    BUILD_BUG_ON(x86_seg_gdtr != 8);
-    BUILD_BUG_ON(x86_seg_idtr != 9);
+    BUILD_BUG_ON(x86_seg_tss != 6);
+    BUILD_BUG_ON(x86_seg_ldt != 7);
+    BUILD_BUG_ON(x86_seg_gdt != 8);
+    BUILD_BUG_ON(x86_seg_idt != 9);
     switch ( tmp_seg = seg )
     {
-    case x86_seg_tr:
-    case x86_seg_ldtr:
-        tmp_seg ^= 1; /* Flip tr and ldtr so GUEST_SEG_*() works. */
+    case x86_seg_tss:
+    case x86_seg_ldt:
+        tmp_seg ^= 1; /* Flip TSS and LDT so GUEST_SEG_*() works. */
         fallthrough;
 
     case x86_seg_es ... x86_seg_gs:
@@ -1248,8 +1248,8 @@ static void cf_check vmx_get_segment_register(
         __vmread(GUEST_SEG_AR_BYTES(tmp_seg), &attr);
         fallthrough;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         __vmread(GUEST_SEG_LIMIT(tmp_seg),    &limit);
         __vmread(GUEST_SEG_BASE(tmp_seg),     &reg->base);
         break;
@@ -1272,11 +1272,11 @@ static void cf_check vmx_get_segment_register(
         (!(attr & (1u << 16)) << 7) | (attr & 0x7f) | ((attr >> 4) & 0xf00);
 
     /* Adjust for virtual 8086 mode */
-    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tr
+    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tss
          && !(v->arch.hvm.vmx.vm86_segment_mask & (1u << seg)) )
     {
         struct segment_register *sreg = &v->arch.hvm.vmx.vm86_saved_seg[seg];
-        if ( seg == x86_seg_tr ) 
+        if ( seg == x86_seg_tss )
             *reg = *sreg;
         else if ( reg->base != sreg->base || seg == x86_seg_ss )
         {
@@ -1312,12 +1312,12 @@ static void cf_check vmx_set_segment_register(
     base = reg->base;
 
     /* Adjust CS/SS/DS/ES/FS/GS/TR for virtual 8086 mode */
-    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tr )
+    if ( v->arch.hvm.vmx.vmx_realmode && seg <= x86_seg_tss )
     {
         /* Remember the proper contents */
         v->arch.hvm.vmx.vm86_saved_seg[seg] = *reg;
         
-        if ( seg == x86_seg_tr ) 
+        if ( seg == x86_seg_tss )
         {
             const struct domain *d = v->domain;
             uint64_t val = d->arch.hvm.params[HVM_PARAM_VM86_TSS_SIZED];
@@ -1367,9 +1367,9 @@ static void cf_check vmx_set_segment_register(
 
     switch ( seg )
     {
-    case x86_seg_tr:
-    case x86_seg_ldtr:
-        seg ^= 1; /* Flip tr and ldtr so GUEST_SEG_*() works. */
+    case x86_seg_tss:
+    case x86_seg_ldt:
+        seg ^= 1; /* Flip TSS and LDT so GUEST_SEG_*() works. */
         fallthrough;
 
     case x86_seg_es ... x86_seg_gs:
@@ -1377,8 +1377,8 @@ static void cf_check vmx_set_segment_register(
         __vmwrite(GUEST_SEG_AR_BYTES(seg), attr);
         fallthrough;
 
-    case x86_seg_gdtr:
-    case x86_seg_idtr:
+    case x86_seg_gdt:
+    case x86_seg_idt:
         __vmwrite(GUEST_SEG_LIMIT(seg),    limit);
         __vmwrite(GUEST_SEG_BASE(seg),     base);
         break;
@@ -1738,9 +1738,9 @@ static void cf_check vmx_update_guest_cr(
              (realmode != v->arch.hvm.vmx.vmx_realmode) )
         {
             enum x86_segment s;
-            struct segment_register reg[x86_seg_tr + 1];
+            struct segment_register reg[x86_seg_tss + 1];
 
-            BUILD_BUG_ON(x86_seg_tr != x86_seg_gs + 1);
+            BUILD_BUG_ON(x86_seg_tss != x86_seg_gs + 1);
 
             /* Entering or leaving real mode: adjust the segment registers.
              * Need to read them all either way, as realmode reads can update
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index f85a8c8bba..d0716e97d2 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -174,7 +174,7 @@ struct vmx_vcpu {
     /* Bitmask of segments that we can't safely use in virtual 8086 mode */
     uint16_t             vm86_segment_mask;
     /* Shadow CS, SS, DS, ES, FS, GS, TR while in virtual 8086 mode */
-    struct segment_register vm86_saved_seg[x86_seg_tr + 1];
+    struct segment_register vm86_saved_seg[x86_seg_tss + 1];
     /* Remember EFLAGS while in virtual 8086 mode */
     uint32_t             vm86_saved_eflags;
     int                  hostenv_migrated;
diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..4b200428be 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -43,7 +43,7 @@
 /* Internally used only flags. */
 #define PFEC_page_paged     (1U<<16)
 #define PFEC_page_shared    (1U<<17)
-#define PFEC_implicit       (1U<<18) /* Pagewalk input for ldt/gdt/idt/tr accesses. */
+#define PFEC_implicit       (1U<<18) /* Pagewalk input for ldt/gdt/idt/tss accesses. */
 #define PFEC_synth_mask     (~PFEC_arch_mask) /* Synthetic PFEC values. */
 
 /* Other exception error code values. */
diff --git a/xen/arch/x86/include/asm/x86-types.h b/xen/arch/x86/include/asm/x86-types.h
index 69a9732713..fcb476d362 100644
--- a/xen/arch/x86/include/asm/x86-types.h
+++ b/xen/arch/x86/include/asm/x86-types.h
@@ -19,7 +19,7 @@
  * x86 Segments.
  *
  * Various areas of code rely on this order (general purpose before system,
- * tr at the beginning of system).
+ * tss at the beginning of system).
  */
 enum x86_segment {
     /* General purpose.  Matches the SReg3 encoding in opcode/ModRM bytes. */
@@ -30,10 +30,10 @@ enum x86_segment {
     x86_seg_fs,
     x86_seg_gs,
     /* System: Valid to use for implicit table references. */
-    x86_seg_tr,
-    x86_seg_ldtr,
-    x86_seg_gdtr,
-    x86_seg_idtr,
+    x86_seg_tss,
+    x86_seg_ldt,
+    x86_seg_gdt,
+    x86_seg_idt,
     /* No Segment: For (system/normal) accesses which are already linear. */
     x86_seg_sys,
     x86_seg_none
@@ -47,7 +47,7 @@ static inline bool is_x86_user_segment(enum x86_segment seg)
 }
 static inline bool is_x86_system_segment(enum x86_segment seg)
 {
-    return seg >= x86_seg_tr && seg < x86_seg_none;
+    return seg >= x86_seg_tss && seg < x86_seg_none;
 }
 
 /*
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 1a3e3012e2..7bebd2ccdc 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -504,7 +504,7 @@ static int cf_check read_segment(
     struct x86_emulate_ctxt *ctxt)
 {
     /* Check if this is an attempt to access the I/O bitmap. */
-    if ( seg == x86_seg_tr )
+    if ( seg == x86_seg_tss )
     {
         switch ( ctxt->opcode )
         {
diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index 112d2ef66d..efafb4e4bc 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -183,7 +183,7 @@ static void vm_event_pack_segment_register(enum x86_segment segment,
         reg->es_sel = seg.sel;
         break;
 
-    case x86_seg_gdtr:
+    case x86_seg_gdt:
         reg->gdtr_base = seg.base;
         reg->gdtr_limit = seg.limit;
         break;
@@ -248,7 +248,7 @@ void vm_event_fill_regs(vm_event_request_t *req)
     vm_event_pack_segment_register(x86_seg_ss, &req->data.regs.x86);
     vm_event_pack_segment_register(x86_seg_ds, &req->data.regs.x86);
     vm_event_pack_segment_register(x86_seg_es, &req->data.regs.x86);
-    vm_event_pack_segment_register(x86_seg_gdtr, &req->data.regs.x86);
+    vm_event_pack_segment_register(x86_seg_gdt, &req->data.regs.x86);
 
     req->data.regs.x86.shadow_gs = ctxt.shadow_gs;
     req->data.regs.x86.dr6 = ctxt.dr6;
diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index d2a106557d..ff39aefd03 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -22,7 +22,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
                  struct x86_emulate_ctxt *ctxt,
                  const struct x86_emulate_ops *ops)
 {
-    enum x86_segment seg = (s->modrm_reg & 1) ? x86_seg_idtr : x86_seg_gdtr;
+    enum x86_segment seg = (s->modrm_reg & 1) ? x86_seg_idt : x86_seg_gdt;
     int rc;
 
     switch ( s->modrm )
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index e15ab37758..7de6460836 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -814,13 +814,13 @@ static int ioport_access_check(
      * X86EMUL_DONE coming back here may be used to defer the port
      * permission check to the respective ioport hook.
      */
-    if ( (rc = ops->read_segment(x86_seg_tr, &tr, ctxt)) != 0 )
+    if ( (rc = ops->read_segment(x86_seg_tss, &tr, ctxt)) != 0 )
         return rc == X86EMUL_DONE ? X86EMUL_OKAY : rc;
 
     /* Ensure the TSS has an io-bitmap-offset field. */
     generate_exception_if(tr.type != 0xb, X86_EXC_GP, 0);
 
-    switch ( rc = read_ulong(x86_seg_tr, 0x66, &iobmp, 2, ctxt, ops) )
+    switch ( rc = read_ulong(x86_seg_tss, 0x66, &iobmp, 2, ctxt, ops) )
     {
     case X86EMUL_OKAY:
         break;
@@ -834,7 +834,7 @@ static int ioport_access_check(
     }
 
     /* Read two bytes including byte containing first port. */
-    switch ( rc = read_ulong(x86_seg_tr, iobmp + first_port / 8,
+    switch ( rc = read_ulong(x86_seg_tss, iobmp + first_port / 8,
                              &iobmp, 2, ctxt, ops) )
     {
     case X86EMUL_OKAY:
@@ -891,7 +891,7 @@ protmode_load_seg(
     const struct x86_emulate_ops *ops)
 {
     const struct cpu_policy *cp = ctxt->cpu_policy;
-    enum x86_segment sel_seg = (sel & 4) ? x86_seg_ldtr : x86_seg_gdtr;
+    enum x86_segment sel_seg = (sel & 4) ? x86_seg_ldt : x86_seg_gdt;
     struct { uint32_t a, b; } desc, desc_hi = {};
     uint8_t dpl, rpl;
     int cpl = x86emul_get_cpl(ctxt, ops);
@@ -912,7 +912,7 @@ protmode_load_seg(
                 break;
             /* fall through */
         case x86_seg_cs:
-        case x86_seg_tr:
+        case x86_seg_tss:
             goto raise_exn;
         }
         if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
@@ -992,13 +992,13 @@ protmode_load_seg(
         if ( (dpl != cpl) || (dpl != rpl) )
             goto raise_exn;
         break;
-    case x86_seg_ldtr:
+    case x86_seg_ldt:
         /* LDT system segment? */
         if ( (desc.b & (15u<<8)) != (2u<<8) )
             goto raise_exn;
         a_flag = 0;
         break;
-    case x86_seg_tr:
+    case x86_seg_tss:
         /* Available TSS system segment? */
         if ( (desc.b & (15u<<8)) != (9u<<8) )
             goto raise_exn;
@@ -2914,7 +2914,7 @@ x86_emulate(
         break;
 
     case X86EMUL_OPC(0x0f, 0x00): /* Grp6 */
-        seg = (modrm_reg & 1) ? x86_seg_tr : x86_seg_ldtr;
+        seg = (modrm_reg & 1) ? x86_seg_tss : x86_seg_ldt;
         generate_exception_if(!in_protmode(ctxt, ops), X86_EXC_UD);
         switch ( modrm_reg & 6 )
         {
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 534b1c46fa..d86ed7b3e0 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -51,7 +51,7 @@ struct x86_emul_fpu_aux {
  /*
   * Operation fully done by one of the hooks:
   * - validate(): operation completed (except common insn retire logic)
-  * - read_segment(x86_seg_tr, ...): bypass I/O bitmap access
+  * - read_segment(x86_seg_tss, ...): bypass I/O bitmap access
   * - read_io() / write_io(): bypass GPR update (non-string insns only)
   * Undefined behavior when used anywhere else.
   */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 08:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394908.1633512 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwbuJ-00087h-CZ; Wed, 19 Aug 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 1394908.1633512; Wed, 19 Aug 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 1wwbuJ-00087Z-A1; Wed, 19 Aug 2026 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1394908;
 Wed, 19 Aug 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 1wwbuI-00087T-Hd
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwbuI-00CBgC-2V
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwbuI-004nuO-1W
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=afcUasWEKr6cIOML1yfaSgJNLWTwEnjQLoPz3+SNM7U=; b=wpKbYR3YVwz2ZRobFHNUozJgpz
	V64LpxJ1mlLPzrmtq2ILOEY/DFmXsXZ/x0yavqQVUNUzxk0OE80tO5tLkejcthtNm6m5rS4tPReJS
	6pIBNEOXx1OQg9vHrLcQScQZaZ2VBwusOnoYVaFyK2fDyUFovudZMLN+xAaSR3n2lCYw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/emul: Drop the union in x86_event had have a single data field
Message-Id: <E1wwbuI-004nuO-1W@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 08:44:22 +0000

commit e1060c760d2be08c09353e20d90699bc07ad02a7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 14 17:17:06 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:11 2026 +0100

    x86/emul: Drop the union in x86_event had have a single data field
    
    FRED has formalised the event_data field.  It already has more uses than
    given (e.g. the NMI Source Bitmap), and further uses are expected in the
    future.
    
    Collapse the union into a single field called 'data' as the struct has event
    in it's name, as well as 'event' being the common name for the variable.
    Refer to the FRED spec rather than keeping an out-of-date list of uses.
    
    Adjust all users of the old names.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/dm.c                  |  2 +-
 xen/arch/x86/hvm/hvm.c                 |  4 ++--
 xen/arch/x86/hvm/svm/nestedsvm.c       |  2 +-
 xen/arch/x86/hvm/svm/svm.c             |  8 ++++----
 xen/arch/x86/hvm/vmx/vmx.c             |  2 +-
 xen/arch/x86/include/asm/domain.h      |  6 ++----
 xen/arch/x86/include/asm/hvm/hvm.h     |  3 +--
 xen/arch/x86/include/asm/x86-event.h   | 14 ++++++++++----
 xen/arch/x86/pv/traps.c                | 10 +++++-----
 xen/arch/x86/x86_emulate/x86_emulate.h |  2 +-
 10 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 1f44fff12a..91f6ca669b 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -315,7 +315,7 @@ static int inject_event(struct domain *d,
     v->arch.hvm.inject_event.type = data->type;
     v->arch.hvm.inject_event.insn_len = data->insn_len;
     v->arch.hvm.inject_event.error_code = data->error_code;
-    v->arch.hvm.inject_event.cr2 = data->cr2;
+    v->arch.hvm.inject_event.data = data->cr2;
     smp_wmb();
     v->arch.hvm.inject_event.vector = data->vector;
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5cb4c348ec..955fc062a5 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -513,7 +513,7 @@ void hvm_migrate_pirqs(struct vcpu *v)
 
 static bool hvm_get_pending_event(struct vcpu *v, struct x86_event *info)
 {
-    info->cr2 = v->arch.hvm.guest_cr[2];
+    info->data = v->arch.hvm.guest_cr[2];
 
     return alternative_call(hvm_funcs.get_pending_event, v, info);
 }
@@ -555,7 +555,7 @@ void hvm_do_resume(struct vcpu *v)
         if ( hvm_get_pending_event(v, &info) )
         {
             hvm_monitor_interrupt(info.vector, info.type, info.error_code,
-                                  info.cr2);
+                                  info.data);
             v->arch.monitor.next_interrupt_enabled = false;
         }
     }
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 91c9060720..0845e9f778 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -775,7 +775,7 @@ int cf_check nsvm_vcpu_vmexit_event(
     ASSERT(vcpu_nestedhvm(v).nv_vvmcx != NULL);
 
     nestedsvm_vmexit_defer(v, VMEXIT_EXCEPTION_DE + event->vector,
-                           event->error_code, event->cr2);
+                           event->error_code, event->data);
     return NESTEDHVM_VMEXIT_DONE;
 }
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index fb9ddf70dc..5f5d903d87 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1177,7 +1177,7 @@ static void svm_emul_swint_injection(struct x86_event *event)
         {
             fault = X86_EXC_PF;
             ec = pfinfo.ec;
-            event->cr2 = pfinfo.linear;
+            event->data = pfinfo.linear;
         }
 
         goto raise_exception;
@@ -1270,8 +1270,8 @@ static void cf_check svm_inject_event(const struct x86_event *event)
 
     case X86_EXC_PF:
         ASSERT(_event.type == X86_ET_HW_EXC);
-        curr->arch.hvm.guest_cr[2] = _event.cr2;
-        vmcb_set_cr2(vmcb, _event.cr2);
+        curr->arch.hvm.guest_cr[2] = _event.data;
+        vmcb_set_cr2(vmcb, _event.data);
         break;
     }
 
@@ -1354,7 +1354,7 @@ static void cf_check svm_inject_event(const struct x86_event *event)
 
     if ( _event.vector == X86_EXC_PF && _event.type == X86_ET_HW_EXC )
         TRACE(TRC_HVM_PF_INJECT64, _event.error_code,
-              _event.cr2, _event.cr2 >> 32);
+              _event.data, _event.data >> 32);
     else
         TRACE(TRC_HVM_INJ_EXC, _event.vector, _event.error_code);
 }
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index c2a76d691e..e55c90ce7f 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2106,7 +2106,7 @@ static void cf_check vmx_inject_event(const struct x86_event *event)
 
     case X86_EXC_PF:
         ASSERT(_event.type == X86_ET_HW_EXC);
-        curr->arch.hvm.guest_cr[2] = _event.cr2;
+        curr->arch.hvm.guest_cr[2] = _event.data;
         break;
     }
 
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 50c048adb5..2d0a915410 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -747,10 +747,9 @@ static inline void pv_inject_DB(unsigned long pending_dbg)
         .vector      = X86_EXC_DB,
         .type        = X86_ET_HW_EXC,
         .error_code  = X86_EVENT_NO_EC,
+        .data        = pending_dbg,
     };
 
-    event.pending_dbg = pending_dbg;
-
     pv_inject_event(&event);
 }
 
@@ -760,10 +759,9 @@ static inline void pv_inject_page_fault(int errcode, unsigned long cr2)
         .vector = X86_EXC_PF,
         .type = X86_ET_HW_EXC,
         .error_code = errcode,
+        .data = cr2,
     };
 
-    event.cr2 = cr2;
-
     pv_inject_event(&event);
 }
 
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 0ce7d5d783..16383e1084 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -569,10 +569,9 @@ static inline void hvm_inject_page_fault(int errcode, unsigned long cr2)
         .vector = X86_EXC_PF,
         .type = X86_ET_HW_EXC,
         .error_code = errcode,
+        .data = cr2,
     };
 
-    event.cr2 = cr2;
-
     hvm_inject_event(&event);
 }
 
diff --git a/xen/arch/x86/include/asm/x86-event.h b/xen/arch/x86/include/asm/x86-event.h
index a8823c7cfc..8560770c4a 100644
--- a/xen/arch/x86/include/asm/x86-event.h
+++ b/xen/arch/x86/include/asm/x86-event.h
@@ -22,10 +22,16 @@ struct x86_event {
     uint8_t       type;         /* X86_ET_* */
     uint8_t       insn_len;     /* Instruction length */
     int32_t       error_code;   /* X86_EVENT_NO_EC if n/a */
-    union {
-        unsigned long cr2;         /* #PF */
-        unsigned long pending_dbg; /* #DB (new DR6 bits, positive polarity) */
-    };
+
+    /*
+     * As per the FRED spec.
+     *
+     * A subset of uses occur in IDT mode as well:
+     * - #PF: CR2
+     * - #DB: PENDING_DBG (new DR6 bits with positive polarity)
+     * - #NM: XFD_ERR (AMX)
+     */
+    unsigned long data;
 };
 
 #endif /* X86_X86_EVENT_H */
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index c863ab9d37..21a1f4b717 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -58,20 +58,20 @@ void pv_inject_event(const struct x86_event *event)
     switch ( vector | -(event->type == X86_ET_SW_INT) )
     {
     case X86_EXC_PF:
-        curr->arch.pv.ctrlreg[2] = event->cr2;
-        arch_set_cr2(curr, event->cr2);
+        curr->arch.pv.ctrlreg[2] = event->data;
+        arch_set_cr2(curr, event->data);
 
         /* Re-set error_code.user flag appropriately for the guest. */
         error_code &= ~PFEC_user_mode;
         if ( !guest_kernel_mode(curr, regs) )
             error_code |= PFEC_user_mode;
 
-        trace_pv_page_fault(event->cr2, error_code);
+        trace_pv_page_fault(event->data, error_code);
         break;
 
     case X86_EXC_DB:
         curr->arch.dr6 = x86_merge_dr6(curr->domain->arch.cpu_policy,
-                                       curr->arch.dr6, event->pending_dbg);
+                                       curr->arch.dr6, event->data);
         fallthrough;
     default:
         trace_pv_trap(vector, regs->rip, use_error_code, error_code);
@@ -94,7 +94,7 @@ void pv_inject_event(const struct x86_event *event)
                 vector, vector_name(vector), error_code);
 
         if ( vector == X86_EXC_PF )
-            show_page_walk(event->cr2);
+            show_page_walk(event->data);
     }
 }
 
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index d86ed7b3e0..4539b14c15 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -758,7 +758,7 @@ static inline void x86_emul_pagefault(
     ctxt->event.vector = X86_EXC_PF;
     ctxt->event.type = X86_ET_HW_EXC;
     ctxt->event.error_code = error_code;
-    ctxt->event.cr2 = cr2;
+    ctxt->event.data = cr2;
 
     ctxt->event_pending = true;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 08:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 08:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394909.1633516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwbuT-0008BI-EB; Wed, 19 Aug 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 1394909.1633516; Wed, 19 Aug 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 1wwbuT-0008BA-BJ; Wed, 19 Aug 2026 08:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1394909;
 Wed, 19 Aug 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 1wwbuS-0008B2-Li
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwbuS-00CBgG-2t
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwbuS-004ogu-1s
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=LlO2d6oM73aR9hcCbGbl6MQh47ppG/ElkcV3G6bbLjc=; b=CSgarCqSHfmDkpQ/dVeCxFM/hW
	E1gOvwfLkn2hAlZRjGUX/rCCoegYaGewN2JrlzK8r5WDTtUDDBCX715Rk6PtUEqKf8ZR2FdyhvfLG
	gNxVzlKoijOUVBWxpapVHwlrq+EYmFTeXq2qD6GkpJuiH/9T4zmWBIb5xdLi+JUyziN4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nmi: Remove logic for pre-64bit Pentium 4 CPUs
Message-Id: <E1wwbuS-004ogu-1s@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 08:44:32 +0000

commit 0555ad51db069d544e51b645147ad4bc737406e4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 17 17:19:53 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:29 2026 +0100

    x86/nmi: Remove logic for pre-64bit Pentium 4 CPUs
    
    Model 3 was the first 64bit-capable P4.  Xen won't be booting on anything
    older, so remove the condition.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index b71bf43635..d614641386 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -314,13 +314,9 @@ static void setup_p4_watchdog(void)
         clear_msr_range(0x3F1, 2);
     /* MSR 0x3F0 seems to have a default value of 0xFC00, but current
        docs doesn't fully define it, so leave it alone for now. */
-    if (boot_cpu_data.model >= 0x3) {
-        /* MSR_P4_IQ_ESCR0/1 (0x3ba/0x3bb) removed */
-        clear_msr_range(0x3A0, 26);
-        clear_msr_range(0x3BC, 3);
-    } else {
-        clear_msr_range(0x3A0, 31);
-    }
+    /* MSR_P4_IQ_ESCR0/1 (0x3ba/0x3bb) removed */
+    clear_msr_range(0x3A0, 26);
+    clear_msr_range(0x3BC, 3);
     clear_msr_range(0x3C0, 6);
     clear_msr_range(0x3C8, 6);
     clear_msr_range(0x3E0, 2);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 08:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 08:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394910.1633519 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwbue-0008DL-FB; Wed, 19 Aug 2026 08:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394910.1633519; Wed, 19 Aug 2026 08: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 1wwbue-0008DD-Cm; Wed, 19 Aug 2026 08:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1394910;
 Wed, 19 Aug 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 1wwbuc-0008D5-Oz
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwbud-00CBgK-00
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwbuc-004pXI-2I
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=zqtNhF7yhfVGiibnVp4bnFsdrqz9MSLgCDUxMVPrS+w=; b=ycyN6AVmGPPV2VIfSdAwDKGSRL
	e6ytbtBhpZKBvSV6xpgJGm9tLExgMpaqPVT89RkowYBVetuLQIydm4+tdp4E8mECXcO4ZlfvXm8xk
	ITIqhza3TTuIJ78YkAcdv3WoZYw4PzRUypYBh/kJHN1HJJLykOyyRhdjvQKmvyFRHFQs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nmi: Misc style fixes
Message-Id: <E1wwbuc-004pXI-2I@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 08:44:42 +0000

commit a7a8c5a373bfebacdde2b930d3993370185ef667
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 11:19:43 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:50:48 2026 +0100

    x86/nmi: Misc style fixes
    
     * Drop trailing whitespace
     * Sort includes, dropping asm/mc146818rtc.h and asm/div64.h as unused
     * Brace position, and types
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 47 +++++++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index d614641386..029e1ea600 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -13,26 +13,25 @@
  *  Mikael Pettersson : PM converted to driver model. Disable/enable API.
  */
 
+#include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/keyhandler.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/param.h>
-#include <xen/irq.h>
-#include <xen/delay.h>
-#include <xen/time.h>
 #include <xen/sched.h>
-#include <xen/console.h>
 #include <xen/smp.h>
-#include <xen/keyhandler.h>
+#include <xen/time.h>
 #include <xen/watchdog.h>
-#include <xen/cpu.h>
+
+#include <asm/apic.h>
 #include <asm/current.h>
-#include <asm/mc146818rtc.h>
-#include <asm/msr.h>
 #include <asm/mpspec.h>
+#include <asm/msr.h>
 #include <asm/nmi.h>
-#include <asm/div64.h>
-#include <asm/apic.h>
 
 unsigned int nmi_watchdog = NMI_NONE;
 static unsigned int nmi_hz = HZ;
@@ -124,10 +123,10 @@ static int nmi_active;
 #define P4_CCCR_REQUIRED	(3<<16)
 #define P4_CCCR_ESCR_SELECT(N)	((N)<<13)
 #define P4_CCCR_ENABLE		(1<<12)
-/* 
+/*
  * Set up IQ_PERFCTR0 to behave like a clock, by having IQ_CCCR0 filter
  * CRU_ESCR0 (with any non-null event selector) through a complemented
- * max threshold. [IA32-Vol3, Section 14.9.9] 
+ * max threshold. [IA32-Vol3, Section 14.9.9]
  */
 #define P4_NMI_CRU_ESCR0	P4_ESCR_EVENT_SELECT(0x3F)
 #define P4_NMI_IQ_CCCR0	\
@@ -182,7 +181,7 @@ void __init check_nmi_watchdog(void)
      * There's a limit to how slow we can go because writing the perfctr
      * MSRs only sets the low 32 bits, with the top 8 bits sign-extended
      * from those, so it's not possible to set up a delay larger than
-     * 2^31 cycles and smaller than (2^40 - 2^31) cycles. 
+     * 2^31 cycles and smaller than (2^40 - 2^31) cycles.
      * (Intel SDM, section 18.22.2)
      */
     if ( nmi_watchdog == NMI_LOCAL_APIC )
@@ -199,8 +198,9 @@ static void cf_check nmi_timer_fn(void *unused)
 
 void disable_lapic_nmi_watchdog(void)
 {
-    if (nmi_active <= 0)
+    if ( nmi_active <= 0 )
         return;
+
     switch ( boot_cpu_data.vendor )
     {
     case X86_VENDOR_AMD:
@@ -231,9 +231,7 @@ void disable_lapic_nmi_watchdog(void)
 
 static void clear_msr_range(unsigned int base, unsigned int n)
 {
-    unsigned int i;
-
-    for (i = 0; i < n; i++)
+    for ( unsigned int i = 0; i < n; i++ )
         wrmsrns(base + i, 0);
 }
 
@@ -302,7 +300,7 @@ static void setup_p4_watchdog(void)
     uint64_t misc_enable;
 
     rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
+    if ( !(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
         return;
 
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
@@ -310,7 +308,7 @@ static void setup_p4_watchdog(void)
     if ( boot_cpu_data.x86_num_siblings == 2 )
         nmi_p4_cccr_val |= P4_CCCR_OVF_PMI1;
 
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL))
+    if ( !(misc_enable & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL) )
         clear_msr_range(0x3F1, 2);
     /* MSR 0x3F0 seems to have a default value of 0xFC00, but current
        docs doesn't fully define it, so leave it alone for now. */
@@ -389,7 +387,7 @@ static int cf_check cpu_nmi_callback(
 }
 
 static struct notifier_block cpu_nmi_nfb = {
-    .notifier_call = cpu_nmi_callback
+    .notifier_call = cpu_nmi_callback,
 };
 
 static DEFINE_PER_CPU(unsigned int, last_irq_sums);
@@ -440,15 +438,15 @@ bool nmi_watchdog_tick(const struct cpu_user_regs *regs)
          * before doing the oops ...
          */
         this_cpu(alert_counter)++;
-        if ( this_cpu(alert_counter) == opt_watchdog_timeout*nmi_hz )
+        if ( this_cpu(alert_counter) == opt_watchdog_timeout * nmi_hz )
         {
             console_force_unlock();
             printk("Watchdog timer detects that CPU%d is stuck!\n",
                    smp_processor_id());
             fatal_trap(regs, 1);
         }
-    } 
-    else 
+    }
+    else
     {
         this_cpu(last_irq_sums) = sum;
         this_cpu(alert_counter) = 0;
@@ -508,7 +506,8 @@ bool nmi_watchdog_tick(const struct cpu_user_regs *regs)
 void self_nmi(void)
 {
     unsigned long flags;
-    u32 id = get_apic_id();
+    uint32_t id = get_apic_id();
+
     local_irq_save(flags);
     apic_wait_icr_idle();
     apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 08:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 08:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394911.1633524 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwbuo-0008FI-Gi; Wed, 19 Aug 2026 08:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1394911.1633524; Wed, 19 Aug 2026 08: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 1wwbuo-0008FA-E6; Wed, 19 Aug 2026 08:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1394911;
 Wed, 19 Aug 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 1wwbum-0008F2-SN
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwbun-00CBgU-0K
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwbum-004qOZ-2c
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=+16GzOiszEuYEjIH1LslwB7T6lPgd9RKd+1VlnfpxUg=; b=lhwvKM/bHqiQ9UAVWpcMGCF/aj
	lExMW8kh8mknRWPlPu75+ja1ukQMhCEHhNKQUmcCkwdDTF29nX81troLR6xfTh7+9M/6/ZXwrbJju
	BwUg5ps8rA38eZO28r3QNGqW7NI2L/nuwpWum0cD3NOwncn9bYX30r3o4xtfsTpd7SEk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wwbum-004qOZ-2c@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 08:44:52 +0000

commit dfb428cb1142a5a468531410e0461fb2a9f2a4ea
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 20:59:11 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:51:08 2026 +0100

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 029e1ea600..f7603ce369 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -295,14 +295,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if ( !(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -330,6 +324,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -340,6 +336,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        misc = rdmsr(MSR_IA32_MISC_ENABLE);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch ( boot_cpu_data.family )
         {
         case 6:
@@ -348,7 +352,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 08:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 08:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1394912.1633527 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwbuy-0008HS-I4; Wed, 19 Aug 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 1394912.1633527; Wed, 19 Aug 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 1wwbuy-0008HK-FY; Wed, 19 Aug 2026 08:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1394912;
 Wed, 19 Aug 2026 08:45:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwbuw-0008HE-V7
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwbux-00CBgv-0c
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 08:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwbuw-004rAX-2w
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=aRenhQZSnsQETN+MMv0Qj+MCNErPUHyPgM+b5XMzX+0=; b=fSpuBtlyFc0g4OmTy6Iyfin8As
	2aC7LL9g76ddMBFl/ikZc6cexmKUOa+8Ug6q4pwNUhgwKuFQTH5/sDzzIUxpFqXrtr9X2jIHhams8
	d4yRrKQFXJ6cBwiVcZDFEAjvkEp+FwuQqg7iu8th+CpBEk373b6ntDAWsCM6iMQq9vMY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nmi: Don't configure EvtSel repeatedly
Message-Id: <E1wwbuw-004rAX-2w@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 08:45:02 +0000

commit 669f8c502aeaa538f8407013ba04461e71361ed4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 4 22:45:53 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Aug 18 12:51:59 2026 +0100

    x86/nmi: Don't configure EvtSel repeatedly
    
    In both setup_{k7,p6}_watchdog(), EvtSel0 is first zeroed, then written with
    everything but the enable bit, then written with the enable bit.
    
    setup_p4_watchdog() is slightly more complicated, owing to what
    appears to be a bug introduced by commit 2a2bd8de16b6 ("Clean up NMI
    watchdog handler."), which causes a second bit to be temporarily
    different too.
    
    The middle of the three writes is useless in all cases.  Drop it.
    
    While doing this, rename the 'counter' parameter for
    setup_p6_watchdog().  It is the event which is passed in; the counter
    is always counter 0.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/nmi.c | 29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index f7603ce369..b3d18270b1 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -246,29 +246,20 @@ static inline void write_watchdog_counter(const char *descr)
 
 static void setup_k7_watchdog(void)
 {
-    unsigned int evntsel;
-
     nmi_perfctr_msr = MSR_K7_PERFCTR0;
 
     clear_msr_range(MSR_K7_EVNTSEL0, 4);
     clear_msr_range(MSR_K7_PERFCTR0, 4);
 
-    evntsel = K7_EVNTSEL_INT
-        | K7_EVNTSEL_OS
-        | K7_EVNTSEL_USR
-        | K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING;
-
-    wrmsrns(MSR_K7_EVNTSEL0, evntsel);
     write_watchdog_counter("K7_PERFCTR0");
     apic_write(APIC_LVTPC, APIC_DM_NMI);
-    evntsel |= K7_EVNTSEL_ENABLE;
-    wrmsrns(MSR_K7_EVNTSEL0, evntsel);
+    wrmsrns(MSR_K7_EVNTSEL0,
+            K7_EVNTSEL_ENABLE | K7_EVNTSEL_INT | K7_EVNTSEL_OS |
+            K7_EVNTSEL_USR | K7_EVENT_CYCLES_PROCESSOR_IS_RUNNING);
 }
 
-static void setup_p6_watchdog(unsigned counter)
+static void setup_p6_watchdog(unsigned int event)
 {
-    unsigned int evntsel;
-
     if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
@@ -283,16 +274,11 @@ static void setup_p6_watchdog(unsigned counter)
     clear_msr_range(MSR_P6_EVNTSEL(0), 2);
     clear_msr_range(MSR_P6_PERFCTR(0), 2);
 
-    evntsel = P6_EVNTSEL_INT
-        | P6_EVNTSEL_OS
-        | P6_EVNTSEL_USR
-        | counter;
-
-    wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
     write_watchdog_counter("P6_PERFCTR0");
     apic_write(APIC_LVTPC, APIC_DM_NMI);
-    evntsel |= P6_EVNTSEL0_ENABLE;
-    wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
+    wrmsrns(MSR_P6_EVNTSEL(0),
+            P6_EVNTSEL0_ENABLE | P6_EVNTSEL_INT | P6_EVNTSEL_OS |
+            P6_EVNTSEL_USR | event);
 }
 
 static void setup_p4_watchdog(uint64_t misc_enable)
@@ -316,7 +302,6 @@ static void setup_p4_watchdog(uint64_t misc_enable)
     clear_msr_range(MSR_P4_BPU_PERFCTR0, 18);
 
     wrmsrl(MSR_P4_CRU_ESCR0, P4_NMI_CRU_ESCR0);
-    wrmsrl(MSR_P4_IQ_CCCR0, P4_NMI_IQ_CCCR0 & ~P4_CCCR_ENABLE);
     write_watchdog_counter("P4_IQ_COUNTER0");
     apic_write(APIC_LVTPC, APIC_DM_NMI);
     wrmsrl(MSR_P4_IQ_CCCR0, nmi_p4_cccr_val);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 10:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 10:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1395165.1633658 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwdwm-0006tl-F1; Wed, 19 Aug 2026 10:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1395165.1633658; Wed, 19 Aug 2026 10: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 1wwdwm-0006td-CP; Wed, 19 Aug 2026 10:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1395165;
 Wed, 19 Aug 2026 10:55: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 1wwdwk-0006tX-VM
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwdwk-00CEAT-33
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 10:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwdwk-00E3ls-1w
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=tuNcyc6A4iLA1jZ7UcFvoFMM9euJSX4JTcxbv6c7MDE=; b=uaqL+1tlG3r6B03K7hlpGr4jut
	SqDixj4IyjoDEp9hMv3TtAhuLKERWWMOb9jKeG5EyOHqxXsgGCSVsBnWy9Zh9/nVgmWpsjV0e1gjq
	THYzv8A9WqzIgbvX5ZmgHNKE/HgSsam0kQI6VCpISJWhc38Wh9jjqIIRNFFJdLCn05QQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] time: add "NOW() good" indicator
Message-Id: <E1wwdwk-00E3ls-1w@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 10:55:02 +0000

commit 6e3102caaca3a0316ab1cfabbb1865a826e4cd4e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 19 11:55:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 19 11:55:58 2026 +0200

    time: add "NOW() good" indicator
    
    printk_start_of_line() checks for a value of 0 right now. In order to be
    able to have NOW() return at least monotonically increasing values, that
    needs replacing by an explicit indicator.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger@xenproject.org>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/time.c        | 2 ++
 xen/arch/riscv/time.c      | 2 ++
 xen/arch/x86/time.c        | 2 ++
 xen/common/time.c          | 2 ++
 xen/drivers/char/console.c | 8 ++++----
 xen/include/xen/time.h     | 6 ++++++
 6 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 6955b2788f..be54b87438 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -145,6 +145,8 @@ void __init preinit_xen_time(void)
         panic("Timer: Cannot initialize platform timer\n");
 
     boot_count = get_cycles();
+    smp_wmb();
+    NOW_good = true;
 }
 
 static void __init init_dt_xen_time(void)
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 10b7e35f13..602c029641 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -87,6 +87,8 @@ void __init preinit_xen_time(void)
         panic("%s: ACPI isn't supported\n", __func__);
 
     boot_clock_cycles = get_cycles();
+    smp_wmb();
+    NOW_good = true;
 
     /* set_xen_timer must have been set by sbi_init() already */
     ASSERT(set_xen_timer);
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bc76e20777..bc0161f7c2 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2660,6 +2660,8 @@ void __init early_time_init(void)
 
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
+    barrier();
+    NOW_good = true;
 
     init_percpu_time();
 
diff --git a/xen/common/time.c b/xen/common/time.c
index 04a65f00b3..2b8c98e2de 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -22,6 +22,8 @@
 #include <asm/div64.h>
 #include <asm/domain.h>
 
+bool __ro_after_init NOW_good;
+
 /* Nonzero if YEAR is a leap year (every 4 years,
    except every 100th isn't, and every 400th is).  */
 #define __isleap(year) \
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 40355c1d14..fcacf37c52 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -987,11 +987,11 @@ static void printk_start_of_line(const char *prefix)
         }
         /* fall through */
     case TSM_BOOT:
-        sec = NOW();
-        nsec = do_div(sec, 1000000000);
-
-        if ( sec | nsec )
+        if ( NOW_good )
         {
+            smp_rmb();
+            sec = NOW();
+            nsec = do_div(sec, 1000000000);
             snprintf(tstr, sizeof(tstr), "[%5"PRIu64".%06"PRIu64"] ",
                      sec, nsec / 1000);
             break;
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index e9c0822e6f..4db24617a9 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -62,6 +62,12 @@ struct tm wallclock_time(uint64_t *ns);
 /* Chosen so (NOW() + delta) wont overflow without an uptime of 200 years */
 #define STIME_DELTA_MAX ((s_time_t)((uint64_t)~0ULL>>2))
 
+/*
+ * Indicator that the value returned by NOW() is good (earlier invocations may
+ * return zero or very small, merely monotonically increasing values).
+ */
+extern bool NOW_good;
+
 /* Explicitly OR with 1 just in case version number gets out of sync. */
 #define version_update_begin(v) (((v) + 1) | 1)
 #define version_update_end(v)   ((v) + 1)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 10:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 10:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1395166.1633662 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwdwv-0006vL-GO; Wed, 19 Aug 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 1395166.1633662; Wed, 19 Aug 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 1wwdwv-0006vA-Di; Wed, 19 Aug 2026 10:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1395166;
 Wed, 19 Aug 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 1wwdwu-0006v3-RN
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwdwv-00CEAY-0F
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 10:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwdwu-00E4l8-2T
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=raAxTik+YacrXQpMosRuTGEClpXum7F3LqQjHfc+HlM=; b=b9N1m36QZbG8QDUscvmz9uW5IT
	+9xih7gYCCe9OQIcCz5rJs3AzWHQ8A7/odHMWkj2h3fxbEdTe/FTiy24LqvOQaSd7nbDa07pjQ/kU
	Zp8lAEKI+H1hP8OAxYxH1U8HL8atLYWUlxZrkOZJuYarc2rdLyVDYsqZVHDK1vaWJvsA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/Intel: split model-specific freq calculation off of intel_log_freq()
Message-Id: <E1wwdwu-00E4l8-2T@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 10:55:12 +0000

commit 45bc5330a3c3ec2f0b0e0e3123bc4060c1efe3c4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 19 11:56:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 19 11:56:53 2026 +0200

    x86/Intel: split model-specific freq calculation off of intel_log_freq()
    
    ..., for that logic to become reusable. While doing so undo the open-
    coding of DIV_ROUND_UP(). Also switch to the new struct cpuinfo_x86 field
    names.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger@xenproject.org>
---
 xen/arch/x86/cpu/intel.c | 104 +++++++++++++++++++++++++++--------------------
 1 file changed, 59 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 90c9d36186..5c07140695 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -476,51 +476,14 @@ static int num_cpu_cores(struct cpuinfo_x86 *c)
 		return 1;
 }
 
-static void intel_log_freq(const struct cpuinfo_x86 *c)
+static void intel_process_freq(const struct cpuinfo_x86 *c,
+                               unsigned int *min_mhz, unsigned int *max_mhz)
 {
-    unsigned int eax, ebx, ecx, edx, factor;
     uint64_t msrval;
     uint8_t max_ratio, min_ratio;
+    unsigned int factor;
 
-    if ( c->cpuid_level >= 0x15 )
-    {
-        cpuid(0x15, &eax, &ebx, &ecx, &edx);
-        if ( ecx && ebx && eax )
-        {
-            unsigned long long val = ecx;
-
-            val *= ebx;
-            printk("CPU%u: TSC: %u Hz * %u / %u = %Lu Hz\n",
-                   smp_processor_id(), ecx, ebx, eax, val / eax);
-        }
-        else if ( ecx | eax | ebx )
-        {
-            printk("CPU%u: TSC:", smp_processor_id());
-            if ( ecx )
-                printk(" core: %u Hz", ecx);
-            if ( ebx && eax )
-                printk(" ratio: %u / %u", ebx, eax);
-            printk("\n");
-        }
-    }
-
-    if ( c->cpuid_level >= 0x16 )
-    {
-        cpuid(0x16, &eax, &ebx, &ecx, &edx);
-        if ( ecx | eax | ebx )
-        {
-            printk("CPU%u:", smp_processor_id());
-            if ( ecx )
-                printk(" bus: %u MHz", ecx);
-            if ( eax )
-                printk(" base: %u MHz", eax);
-            if ( ebx )
-                printk(" max: %u MHz", ebx);
-            printk("\n");
-        }
-    }
-
-    switch ( c->x86 )
+    switch ( c->family )
     {
         static const unsigned short core_factors[] =
             { 26667, 13333, 20000, 16667, 33333, 10000, 40000 };
@@ -533,7 +496,7 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
         if ( !max_ratio )
             return;
 
-        switch ( c->x86_model )
+        switch ( c->model )
         {
         case 0x0e: /* Core */
         case 0x0f: case 0x16: case 0x17: case 0x1d: /* Core2 */
@@ -578,10 +541,61 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
         return;
     }
 
+    if ( min_mhz )
+        *min_mhz = DIV_ROUND_UP(factor * min_ratio, 100);
+    *max_mhz = DIV_ROUND_UP(factor * max_ratio, 100);
+}
+
+static void intel_log_freq(const struct cpuinfo_x86 *c)
+{
+    unsigned int eax, ebx, ecx, edx, min_mhz = 0, max_mhz = 0;
+
+    if ( c->cpuid_level >= 0x15 )
+    {
+        cpuid(0x15, &eax, &ebx, &ecx, &edx);
+        if ( ecx && ebx && eax )
+        {
+            unsigned long long val = ecx;
+
+            val *= ebx;
+            printk("CPU%u: TSC: %u Hz * %u / %u = %Lu Hz\n",
+                   smp_processor_id(), ecx, ebx, eax, val / eax);
+        }
+        else if ( ecx | eax | ebx )
+        {
+            printk("CPU%u: TSC:", smp_processor_id());
+            if ( ecx )
+                printk(" core: %u Hz", ecx);
+            if ( ebx && eax )
+                printk(" ratio: %u / %u", ebx, eax);
+            printk("\n");
+        }
+    }
+
+    if ( c->cpuid_level >= 0x16 )
+    {
+        cpuid(0x16, &eax, &ebx, &ecx, &edx);
+        if ( ecx | eax | ebx )
+        {
+            printk("CPU%u:", smp_processor_id());
+            if ( ecx )
+                printk(" bus: %u MHz", ecx);
+            if ( eax )
+                printk(" base: %u MHz", eax);
+            if ( ebx )
+                printk(" max: %u MHz", ebx);
+            printk("\n");
+        }
+    }
+
+    intel_process_freq(c, &min_mhz, &max_mhz);
+    if ( !max_mhz )
+        return;
+
     printk("CPU%u: ", smp_processor_id());
-    if ( min_ratio )
-        printk("%u ... ", (factor * min_ratio + 50) / 100);
-    printk("%u MHz\n", (factor * max_ratio + 50) / 100);
+    if ( min_mhz )
+        printk("%u ... ", min_mhz);
+    printk("%u MHz\n", max_mhz);
 }
 
 static void init_intel_perf(struct cpuinfo_x86 *c)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 10:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 10:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1395167.1633666 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwdx6-0006xS-I0; Wed, 19 Aug 2026 10:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1395167.1633666; Wed, 19 Aug 2026 10: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 1wwdx6-0006xK-F9; Wed, 19 Aug 2026 10:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1395167;
 Wed, 19 Aug 2026 10:55: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 1wwdx4-0006xA-Vu
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 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 1wwdx5-00CEAv-0g
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 10:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwdx4-00E5kM-2s
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=Sjk27+byy98U7/HhJMX7pB4Ee+9t592q3Jb3+xHdL5A=; b=CEdqHJlfFm9ZD1GDCt22mWpdl2
	//n0srnD4Xm8I9GM6D3ATZxmZDFwBbMPqvVKG1bcHEBRoErUgugsvQvUN6vh1STYHJmQTLRnj01RC
	44QV8sA6tjdcyvU5axv878r42w7p5sdFlTp1KBuh2DJCx4iUn3C28HElqP/1NxX1zcCQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nSVM: Validate the L1 IOPM physical address range
Message-Id: <E1wwdx4-00E5kM-2s@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 10:55:22 +0000

commit 8c36d5a500da81c15d088f7349286307537ca8b1
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Wed Aug 19 11:57:26 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 19 11:57:26 2026 +0200

    x86/nSVM: Validate the L1 IOPM physical address range
    
    The Xen nested virtualization code does not validate that the physical address
    range assigned by the L1 guest, for IOPM, resides within the valid guest
    physical memory. Add a sanity check to properly validate the IOPM is in the
    valid L1 guest address range. This check also makes the behaviour compliant
    with the hardware handling of the assigned address. The hardware is expected to
    trigger VMEXIT_INVALID if the address of the last byte in the IOPM is greater
    than or equal to the maximum supported physical address, see the APM
    volume #2 (40332—Rev. 4.40—July 2026).
    
    While at it, clean up the code. Remove the unused bool viopm and the
    svm_vcpu::ns_oiomap_pa. Change nsvm_vmrun_permissionmap return error from
    literal 1 to NSVM_ERROR_VVMCB.
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c         | 18 ++++++++++++++----
 xen/arch/x86/include/asm/hvm/svm-types.h |  2 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 0845e9f778..3d0e77f5eb 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -283,7 +283,7 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
     return 0;
 }
 
-static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
+static int nsvm_vmrun_permissionmap(struct vcpu *v)
 {
     struct svm_vcpu *arch_svm = &v->arch.hvm.svm;
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -295,6 +295,17 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     enum hvm_translation_result ret;
     unsigned long *ns_viomap;
     bool ioport_80 = true, ioport_ed = true;
+    /* IOPM is structured as a linear array of 64K+3 bits. */
+    gfn_t ns_iopm_end =
+        gfn_add(gaddr_to_gfn(ns_vmcb->_iopm_base_pa),
+                PFN_DOWN((0x10000 + 3) / 8));
+
+    if ( !gfn_valid(v->domain, ns_iopm_end) )
+    {
+        gdprintk(XENLOG_ERR, "%s invalid _iopm_base_pa address (%#"PRIx64")\n",
+                 __func__, ns_vmcb->_iopm_base_pa);
+        return NSVM_ERROR_VVMCB;
+    }
 
     ns_msrpm_ptr = (unsigned long *)svm->ns_cached_msrpm;
 
@@ -303,13 +314,12 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     if ( ret != HVMTRANS_okay )
     {
         gdprintk(XENLOG_ERR, "hvm_copy_from_guest_phys msrpm %u\n", ret);
-        return 1;
+        return NSVM_ERROR_VVMCB;
     }
 
     /* Check l1 guest io permission map and get a shadow one based on
      * if l1 guest intercepts io ports 0x80 and/or 0xED.
      */
-    svm->ns_oiomap_pa = svm->ns_iomap_pa;
     svm->ns_iomap_pa = ns_vmcb->_iopm_base_pa;
 
     ns_viomap = hvm_map_guest_frame_ro(svm->ns_iomap_pa >> PAGE_SHIFT, 0);
@@ -419,7 +429,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     n2vmcb->_tsc_offset = n1vmcb->_tsc_offset + ns_vmcb->_tsc_offset;
 
     /* Nested IO permission bitmaps */
-    rc = nsvm_vmrun_permissionmap(v, clean.iopm);
+    rc = nsvm_vmrun_permissionmap(v);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index 8acadb9dcc..beab9a3af2 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -51,7 +51,7 @@ struct nestedsvm {
     unsigned long *ns_merged_msrpm;
 
     /* guest physical address of virtual io permission map */
-    paddr_t ns_iomap_pa, ns_oiomap_pa;
+    paddr_t ns_iomap_pa;
     /* Shadow io permission map */
     unsigned long *ns_iomap;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 11:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 11:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1395218.1633692 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wweiC-0005uZ-EN; Wed, 19 Aug 2026 11:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1395218.1633692; Wed, 19 Aug 2026 11: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 1wweiC-0005uR-Bk; Wed, 19 Aug 2026 11:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1395218;
 Wed, 19 Aug 2026 11:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wweiA-0005uL-8c
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 2026 11:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wweiA-00CF9z-0k
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwei9-000JMF-2x
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 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=VYL3ghv0grbZCDEPO0eT64miHpCt2CDSdS4gcR5sejA=; b=w0sfcUZ4RuNtLKMpJYipWf3Jl8
	JAmyVSr/vXxx/hyGUuCjeHjAa8h7SRE0wN0O7clnxPY5KJezZmPR9QM2zOci2BhiSdpHhbcO9sxuk
	rO8DiDrgpyMVF3iXqvYtokIUIJfFI5C+8TvA5RmryDHtOJvT7u1fpqMEdCF4j8RNfL5c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] time: add "NOW() good" indicator
Message-Id: <E1wwei9-000JMF-2x@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 11:44:01 +0000

commit 6e3102caaca3a0316ab1cfabbb1865a826e4cd4e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 19 11:55:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 19 11:55:58 2026 +0200

    time: add "NOW() good" indicator
    
    printk_start_of_line() checks for a value of 0 right now. In order to be
    able to have NOW() return at least monotonically increasing values, that
    needs replacing by an explicit indicator.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger@xenproject.org>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/time.c        | 2 ++
 xen/arch/riscv/time.c      | 2 ++
 xen/arch/x86/time.c        | 2 ++
 xen/common/time.c          | 2 ++
 xen/drivers/char/console.c | 8 ++++----
 xen/include/xen/time.h     | 6 ++++++
 6 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 6955b2788f..be54b87438 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -145,6 +145,8 @@ void __init preinit_xen_time(void)
         panic("Timer: Cannot initialize platform timer\n");
 
     boot_count = get_cycles();
+    smp_wmb();
+    NOW_good = true;
 }
 
 static void __init init_dt_xen_time(void)
diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 10b7e35f13..602c029641 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -87,6 +87,8 @@ void __init preinit_xen_time(void)
         panic("%s: ACPI isn't supported\n", __func__);
 
     boot_clock_cycles = get_cycles();
+    smp_wmb();
+    NOW_good = true;
 
     /* set_xen_timer must have been set by sbi_init() already */
     ASSERT(set_xen_timer);
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bc76e20777..bc0161f7c2 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2660,6 +2660,8 @@ void __init early_time_init(void)
 
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
+    barrier();
+    NOW_good = true;
 
     init_percpu_time();
 
diff --git a/xen/common/time.c b/xen/common/time.c
index 04a65f00b3..2b8c98e2de 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -22,6 +22,8 @@
 #include <asm/div64.h>
 #include <asm/domain.h>
 
+bool __ro_after_init NOW_good;
+
 /* Nonzero if YEAR is a leap year (every 4 years,
    except every 100th isn't, and every 400th is).  */
 #define __isleap(year) \
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 40355c1d14..fcacf37c52 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -987,11 +987,11 @@ static void printk_start_of_line(const char *prefix)
         }
         /* fall through */
     case TSM_BOOT:
-        sec = NOW();
-        nsec = do_div(sec, 1000000000);
-
-        if ( sec | nsec )
+        if ( NOW_good )
         {
+            smp_rmb();
+            sec = NOW();
+            nsec = do_div(sec, 1000000000);
             snprintf(tstr, sizeof(tstr), "[%5"PRIu64".%06"PRIu64"] ",
                      sec, nsec / 1000);
             break;
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index e9c0822e6f..4db24617a9 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -62,6 +62,12 @@ struct tm wallclock_time(uint64_t *ns);
 /* Chosen so (NOW() + delta) wont overflow without an uptime of 200 years */
 #define STIME_DELTA_MAX ((s_time_t)((uint64_t)~0ULL>>2))
 
+/*
+ * Indicator that the value returned by NOW() is good (earlier invocations may
+ * return zero or very small, merely monotonically increasing values).
+ */
+extern bool NOW_good;
+
 /* Explicitly OR with 1 just in case version number gets out of sync. */
 #define version_update_begin(v) (((v) + 1) | 1)
 #define version_update_end(v)   ((v) + 1)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 11:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1395220.1633695 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wweiL-0005wC-Ft; Wed, 19 Aug 2026 11:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1395220.1633695; Wed, 19 Aug 2026 11:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wweiL-0005w4-DA; Wed, 19 Aug 2026 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1395220;
 Wed, 19 Aug 2026 11:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wweiK-0005vq-3y
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 2026 11:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wweiK-00CFA9-17
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wweiK-000KXc-07
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 11:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LOuX74T6XyGBfwsmMaYPBuF7abnmd8hGb6rJMCrsBUk=; b=Hzke/T5l2rv6VJ9x1uYutJMA2Q
	anWk3b1CrZIZK8IMV3DN0Wnz8q5f8oGtEAVWhrStxMwrRpIN9sDux4PAV4kIw60mbNmola3+oCbHo
	oUtE9aJDMD8JF7sKAmu15ltFUN6R808P/13nRBRCx3ZIb5HSKPRf0pSvvjkfLXrtP1i0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/Intel: split model-specific freq calculation off of intel_log_freq()
Message-Id: <E1wweiK-000KXc-07@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 11:44:12 +0000

commit 45bc5330a3c3ec2f0b0e0e3123bc4060c1efe3c4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 19 11:56:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 19 11:56:53 2026 +0200

    x86/Intel: split model-specific freq calculation off of intel_log_freq()
    
    ..., for that logic to become reusable. While doing so undo the open-
    coding of DIV_ROUND_UP(). Also switch to the new struct cpuinfo_x86 field
    names.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger@xenproject.org>
---
 xen/arch/x86/cpu/intel.c | 104 +++++++++++++++++++++++++++--------------------
 1 file changed, 59 insertions(+), 45 deletions(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 90c9d36186..5c07140695 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -476,51 +476,14 @@ static int num_cpu_cores(struct cpuinfo_x86 *c)
 		return 1;
 }
 
-static void intel_log_freq(const struct cpuinfo_x86 *c)
+static void intel_process_freq(const struct cpuinfo_x86 *c,
+                               unsigned int *min_mhz, unsigned int *max_mhz)
 {
-    unsigned int eax, ebx, ecx, edx, factor;
     uint64_t msrval;
     uint8_t max_ratio, min_ratio;
+    unsigned int factor;
 
-    if ( c->cpuid_level >= 0x15 )
-    {
-        cpuid(0x15, &eax, &ebx, &ecx, &edx);
-        if ( ecx && ebx && eax )
-        {
-            unsigned long long val = ecx;
-
-            val *= ebx;
-            printk("CPU%u: TSC: %u Hz * %u / %u = %Lu Hz\n",
-                   smp_processor_id(), ecx, ebx, eax, val / eax);
-        }
-        else if ( ecx | eax | ebx )
-        {
-            printk("CPU%u: TSC:", smp_processor_id());
-            if ( ecx )
-                printk(" core: %u Hz", ecx);
-            if ( ebx && eax )
-                printk(" ratio: %u / %u", ebx, eax);
-            printk("\n");
-        }
-    }
-
-    if ( c->cpuid_level >= 0x16 )
-    {
-        cpuid(0x16, &eax, &ebx, &ecx, &edx);
-        if ( ecx | eax | ebx )
-        {
-            printk("CPU%u:", smp_processor_id());
-            if ( ecx )
-                printk(" bus: %u MHz", ecx);
-            if ( eax )
-                printk(" base: %u MHz", eax);
-            if ( ebx )
-                printk(" max: %u MHz", ebx);
-            printk("\n");
-        }
-    }
-
-    switch ( c->x86 )
+    switch ( c->family )
     {
         static const unsigned short core_factors[] =
             { 26667, 13333, 20000, 16667, 33333, 10000, 40000 };
@@ -533,7 +496,7 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
         if ( !max_ratio )
             return;
 
-        switch ( c->x86_model )
+        switch ( c->model )
         {
         case 0x0e: /* Core */
         case 0x0f: case 0x16: case 0x17: case 0x1d: /* Core2 */
@@ -578,10 +541,61 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
         return;
     }
 
+    if ( min_mhz )
+        *min_mhz = DIV_ROUND_UP(factor * min_ratio, 100);
+    *max_mhz = DIV_ROUND_UP(factor * max_ratio, 100);
+}
+
+static void intel_log_freq(const struct cpuinfo_x86 *c)
+{
+    unsigned int eax, ebx, ecx, edx, min_mhz = 0, max_mhz = 0;
+
+    if ( c->cpuid_level >= 0x15 )
+    {
+        cpuid(0x15, &eax, &ebx, &ecx, &edx);
+        if ( ecx && ebx && eax )
+        {
+            unsigned long long val = ecx;
+
+            val *= ebx;
+            printk("CPU%u: TSC: %u Hz * %u / %u = %Lu Hz\n",
+                   smp_processor_id(), ecx, ebx, eax, val / eax);
+        }
+        else if ( ecx | eax | ebx )
+        {
+            printk("CPU%u: TSC:", smp_processor_id());
+            if ( ecx )
+                printk(" core: %u Hz", ecx);
+            if ( ebx && eax )
+                printk(" ratio: %u / %u", ebx, eax);
+            printk("\n");
+        }
+    }
+
+    if ( c->cpuid_level >= 0x16 )
+    {
+        cpuid(0x16, &eax, &ebx, &ecx, &edx);
+        if ( ecx | eax | ebx )
+        {
+            printk("CPU%u:", smp_processor_id());
+            if ( ecx )
+                printk(" bus: %u MHz", ecx);
+            if ( eax )
+                printk(" base: %u MHz", eax);
+            if ( ebx )
+                printk(" max: %u MHz", ebx);
+            printk("\n");
+        }
+    }
+
+    intel_process_freq(c, &min_mhz, &max_mhz);
+    if ( !max_mhz )
+        return;
+
     printk("CPU%u: ", smp_processor_id());
-    if ( min_ratio )
-        printk("%u ... ", (factor * min_ratio + 50) / 100);
-    printk("%u MHz\n", (factor * max_ratio + 50) / 100);
+    if ( min_mhz )
+        printk("%u ... ", min_mhz);
+    printk("%u MHz\n", max_mhz);
 }
 
 static void init_intel_perf(struct cpuinfo_x86 *c)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 19 11:44:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Aug 2026 11:44:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1395221.1633699 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wweiU-0005yh-IP; Wed, 19 Aug 2026 11:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1395221.1633699; Wed, 19 Aug 2026 11:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wweiU-0005yZ-Fv; Wed, 19 Aug 2026 11:44:22 +0000
Received: by outflank-mailman (input) for mailman id 1395221;
 Wed, 19 Aug 2026 11:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wweiU-0005yS-7n
 for xen-changelog@lists.xenproject.org; Wed, 19 Aug 2026 11:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wweiU-00CFAY-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wweiU-000Ldu-0Y
 for xen-changelog@lists.xenproject.org;
 Wed, 19 Aug 2026 11:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tn1zrN9vN5TWYO1smWEY9AjrN4+k63X2Fnu/WyJmU0E=; b=hXajgRmXfwPSM6MpE2GdmZLOxE
	4sVX9+BUsO+GEV0mXFqOraF07kiWB+cTHraozD2O0rJeTv9DGPB86lONxs5b8mvtWQgBPWCqdWiKW
	vIGds9AUGufUyTB+N04yD68kBxomNcgk3MxMY6/1/btbqQ/wW2RbA4aqh7zWguUofYHc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nSVM: Validate the L1 IOPM physical address range
Message-Id: <E1wweiU-000Ldu-0Y@xenbits.xenproject.org>
Date: Wed, 19 Aug 2026 11:44:22 +0000

commit 8c36d5a500da81c15d088f7349286307537ca8b1
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Wed Aug 19 11:57:26 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 19 11:57:26 2026 +0200

    x86/nSVM: Validate the L1 IOPM physical address range
    
    The Xen nested virtualization code does not validate that the physical address
    range assigned by the L1 guest, for IOPM, resides within the valid guest
    physical memory. Add a sanity check to properly validate the IOPM is in the
    valid L1 guest address range. This check also makes the behaviour compliant
    with the hardware handling of the assigned address. The hardware is expected to
    trigger VMEXIT_INVALID if the address of the last byte in the IOPM is greater
    than or equal to the maximum supported physical address, see the APM
    volume #2 (40332—Rev. 4.40—July 2026).
    
    While at it, clean up the code. Remove the unused bool viopm and the
    svm_vcpu::ns_oiomap_pa. Change nsvm_vmrun_permissionmap return error from
    literal 1 to NSVM_ERROR_VVMCB.
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c         | 18 ++++++++++++++----
 xen/arch/x86/include/asm/hvm/svm-types.h |  2 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 0845e9f778..3d0e77f5eb 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -283,7 +283,7 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
     return 0;
 }
 
-static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
+static int nsvm_vmrun_permissionmap(struct vcpu *v)
 {
     struct svm_vcpu *arch_svm = &v->arch.hvm.svm;
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -295,6 +295,17 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     enum hvm_translation_result ret;
     unsigned long *ns_viomap;
     bool ioport_80 = true, ioport_ed = true;
+    /* IOPM is structured as a linear array of 64K+3 bits. */
+    gfn_t ns_iopm_end =
+        gfn_add(gaddr_to_gfn(ns_vmcb->_iopm_base_pa),
+                PFN_DOWN((0x10000 + 3) / 8));
+
+    if ( !gfn_valid(v->domain, ns_iopm_end) )
+    {
+        gdprintk(XENLOG_ERR, "%s invalid _iopm_base_pa address (%#"PRIx64")\n",
+                 __func__, ns_vmcb->_iopm_base_pa);
+        return NSVM_ERROR_VVMCB;
+    }
 
     ns_msrpm_ptr = (unsigned long *)svm->ns_cached_msrpm;
 
@@ -303,13 +314,12 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     if ( ret != HVMTRANS_okay )
     {
         gdprintk(XENLOG_ERR, "hvm_copy_from_guest_phys msrpm %u\n", ret);
-        return 1;
+        return NSVM_ERROR_VVMCB;
     }
 
     /* Check l1 guest io permission map and get a shadow one based on
      * if l1 guest intercepts io ports 0x80 and/or 0xED.
      */
-    svm->ns_oiomap_pa = svm->ns_iomap_pa;
     svm->ns_iomap_pa = ns_vmcb->_iopm_base_pa;
 
     ns_viomap = hvm_map_guest_frame_ro(svm->ns_iomap_pa >> PAGE_SHIFT, 0);
@@ -419,7 +429,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     n2vmcb->_tsc_offset = n1vmcb->_tsc_offset + ns_vmcb->_tsc_offset;
 
     /* Nested IO permission bitmaps */
-    rc = nsvm_vmrun_permissionmap(v, clean.iopm);
+    rc = nsvm_vmrun_permissionmap(v);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index 8acadb9dcc..beab9a3af2 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -51,7 +51,7 @@ struct nestedsvm {
     unsigned long *ns_merged_msrpm;
 
     /* guest physical address of virtual io permission map */
-    paddr_t ns_iomap_pa, ns_oiomap_pa;
+    paddr_t ns_iomap_pa;
     /* Shadow io permission map */
     unsigned long *ns_iomap;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 07:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 07:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396005.1634082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwxRU-0007ml-FJ; Thu, 20 Aug 2026 07:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396005.1634082; Thu, 20 Aug 2026 07: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 1wwxRU-0007me-Cd; Thu, 20 Aug 2026 07:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1396005;
 Thu, 20 Aug 2026 07: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 1wwxRS-0007mY-It
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 07: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 1wwxRS-00Doz8-1m
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwxRS-001oqn-0o
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07: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=5fuWfLXVIAxEBtwqoVcWzBCjr6rxpatdEzCI5bbc/MU=; b=R9qNY+cqEs9HRL0hcapDcvxSO2
	0PrLyhN95aYv9xbZwjz0vvJGnhCbnCDESiF8TkevPhOx8Gcv3+LuwhVyBavEm7uU8LMg8xT0BmXTr
	c3Uw9iJGYhuK6vfeqH5vmR6DbY8E94VpOU/azFMuC+lXz1HQF9qX96tv88MR27c/zH+c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/char: add classic i.MX UART driver
Message-Id: <E1wwxRS-001oqn-0o@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 07:44:02 +0000

commit ee53a871ed97b1ba5187683bd4a4df44fdc64322
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:18 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 08:57:21 2026 +0200

    xen/char: add classic i.MX UART driver
    
    Add a console driver for the classic i.MX UART IP ("fsl,imx6q-uart"
    compatible), used as the console UART on the i.MX8M family.  Baudrate
    and pin configuration are inherited from the bootloader; the driver
    only enables the transmitter/receiver and wires up the RX/TX
    interrupts, mirroring the existing imx-lpuart driver.
    
    The i.MX8M family's UART IP differs from the LPUART used on
    i.MX8QM/8QXP, so a separate driver is needed.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 MAINTAINERS                         |   1 +
 xen/arch/arm/include/asm/imx-uart.h |  57 +++++++++
 xen/drivers/char/Kconfig            |   8 ++
 xen/drivers/char/Makefile           |   1 +
 xen/drivers/char/imx-uart.c         | 233 ++++++++++++++++++++++++++++++++++++
 5 files changed, 300 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ed0ffa608f..4dd97ffcad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -269,6 +269,7 @@ F:	xen/arch/arm/
 F:	xen/drivers/char/cadence-uart.c
 F:	xen/drivers/char/exynos4210-uart.c
 F:	xen/drivers/char/imx-lpuart.c
+F:	xen/drivers/char/imx-uart.c
 F:	xen/drivers/char/meson-uart.c
 F:	xen/drivers/char/mvebu-uart.c
 F:	xen/drivers/char/omap-uart.c
diff --git a/xen/arch/arm/include/asm/imx-uart.h b/xen/arch/arm/include/asm/imx-uart.h
new file mode 100644
index 0000000000..a3892020e6
--- /dev/null
+++ b/xen/arch/arm/include/asm/imx-uart.h
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Register definitions for the classic i.MX UART IP
+ * ("fsl,imx6q-uart" compatible), used as the console UART on the
+ * i.MX8M family.
+ *
+ * Register layout taken from Linux drivers/tty/serial/imx.c.
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#ifndef ASM_IMX_UART_H
+#define ASM_IMX_UART_H
+
+#include <xen/const.h>
+
+#define URXD0           0x00   /* Receiver Register */
+#define URTX0           0x40   /* Transmitter Register */
+#define UCR1            0x80   /* Control Register 1 */
+#define UCR2            0x84   /* Control Register 2 */
+#define USR1            0x94   /* Status Register 1 */
+#define USR2            0x98   /* Status Register 2 */
+#define UTS             0xb4   /* Test Register */
+
+#define URXD_RX_DATA    0xff
+
+#define UCR1_UARTEN     BIT(0, U)   /* UART enable */
+#define UCR1_ATDMAEN    BIT(2, U)   /* Aging DMA timer enable */
+#define UCR1_TXDMAEN    BIT(3, U)   /* Transmitter ready DMA enable */
+#define UCR1_TXMPTYEN   BIT(6, U)   /* Transmitter empty interrupt enable */
+#define UCR1_RXDMAEN    BIT(8, U)   /* Receiver ready DMA enable */
+#define UCR1_RRDYEN     BIT(9, U)   /* Receiver ready interrupt enable */
+#define UCR1_TRDYEN     BIT(13, U)  /* Transmitter ready interrupt enable */
+
+#define UCR2_SRST       BIT(0, U)   /* 0 = issue software reset */
+#define UCR2_RXEN       BIT(1, U)   /* Receiver enable */
+#define UCR2_TXEN       BIT(2, U)   /* Transmitter enable */
+
+#define USR1_TRDY       BIT(13, U)  /* Transmitter ready */
+
+#define USR2_RDR        BIT(0, U)   /* Receive data ready */
+#define USR2_ORE        BIT(1, U)   /* Overrun error */
+
+#define UTS_TXFULL      BIT(4, U)   /* TX FIFO full */
+#define UTS_RXEMPTY     BIT(5, U)   /* RX FIFO empty */
+#define UTS_TXEMPTY     BIT(6, U)   /* TX FIFO empty */
+
+#endif /* ASM_IMX_UART_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index 8e49a52c73..f237c0220d 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -30,6 +30,14 @@ config HAS_IMX_LPUART
 	help
 	  This selects the i.MX LPUART. If you have i.MX8QM based board, say Y.
 
+config HAS_IMX_UART
+	bool "i.MX UART driver"
+	default y
+	depends on ARM_64
+	help
+	  This selects the classic i.MX UART. If you have an i.MX8M family
+	  based board, say Y.
+
 config HAS_MVEBU
 	bool "Marvell MVEBU UART driver"
 	default y
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index 8cbbffdca8..039f566926 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_HAS_SCIF) += scif-uart.o
 obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_XHCI) += xhci-dbc.o
 obj-$(CONFIG_HAS_IMX_LPUART) += imx-lpuart.o
+obj-$(CONFIG_HAS_IMX_UART) += imx-uart.o
 obj-$(CONFIG_HAS_LINFLEX) += linflex-uart.o
 obj-$(CONFIG_GENERIC_UART_INIT) += uart-init.o
 obj-y += serial.o
diff --git a/xen/drivers/char/imx-uart.c b/xen/drivers/char/imx-uart.c
new file mode 100644
index 0000000000..2dc531a84e
--- /dev/null
+++ b/xen/drivers/char/imx-uart.c
@@ -0,0 +1,233 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Driver for the classic i.MX UART IP ("fsl,imx6q-uart"), used as the
+ * console UART on the i.MX8M family (e.g. i.MX8MP).
+ *
+ * Baudrate and pin configuration are inherited from the bootloader.
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/mm.h>
+#include <xen/serial.h>
+#include <asm/device.h>
+#include <asm/imx-uart.h>
+#include <asm/io.h>
+
+#define imx_uart_read(uart, off)       readl((uart)->regs + (off))
+#define imx_uart_write(uart, off, val) writel((val), (uart)->regs + (off))
+
+static struct imx_uart {
+    uint32_t irq;
+    char __iomem *regs;
+    struct irqaction irqaction;
+    struct vuart_info vuart;
+} imx8m_com;
+
+static void imx_uart_interrupt(int irq, void *data)
+{
+    struct serial_port *port = data;
+    struct imx_uart *uart = port->uart;
+
+    if ( imx_uart_read(uart, USR2) & USR2_RDR )
+        serial_rx_interrupt(port);
+
+    /*
+     * USR1_TRDY is a raw status bit, set whenever the transmitter has
+     * room regardless of whether the TX interrupt is enabled.  Only treat
+     * it as a TX interrupt when TRDYEN is set, otherwise an RX-only
+     * interrupt would spuriously enter serial_tx_interrupt().
+     */
+    if ( (imx_uart_read(uart, USR1) & USR1_TRDY) &&
+         (imx_uart_read(uart, UCR1) & UCR1_TRDYEN) )
+        serial_tx_interrupt(port);
+}
+
+static void __init imx_uart_init_preirq(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1, ucr2;
+
+    /*
+     * Reuse the bootloader settings; only enable the UART and both
+     * directions.  The console uses UCR1 interrupts (RRDYEN/TRDYEN)
+     * exclusively, so just clear UCR1's interrupt and DMA enables.
+     */
+    ucr1 = imx_uart_read(uart, UCR1);
+    ucr1 &= ~(UCR1_RRDYEN | UCR1_TRDYEN | UCR1_TXMPTYEN | UCR1_RXDMAEN |
+              UCR1_TXDMAEN | UCR1_ATDMAEN);
+    ucr1 |= UCR1_UARTEN;
+    imx_uart_write(uart, UCR1, ucr1);
+
+    ucr2 = imx_uart_read(uart, UCR2);
+    ucr2 |= UCR2_SRST | UCR2_RXEN | UCR2_TXEN;
+    imx_uart_write(uart, UCR2, ucr2);
+}
+
+static void __init imx_uart_init_postirq(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1;
+
+    uart->irqaction.handler = imx_uart_interrupt;
+    uart->irqaction.name = "imx_uart";
+    uart->irqaction.dev_id = port;
+
+    if ( setup_irq(uart->irq, 0, &uart->irqaction) != 0 )
+    {
+        dprintk(XENLOG_ERR, "Failed to allocate imx_uart IRQ %u\n", uart->irq);
+        return;
+    }
+
+    /* Enable the receiver ready interrupt */
+    ucr1 = imx_uart_read(uart, UCR1);
+    ucr1 |= UCR1_RRDYEN;
+    imx_uart_write(uart, UCR1, ucr1);
+}
+
+static int imx_uart_tx_ready(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+
+    return !(imx_uart_read(uart, UTS) & UTS_TXFULL);
+}
+
+static void imx_uart_putc(struct serial_port *port, char c)
+{
+    struct imx_uart *uart = port->uart;
+
+    while ( imx_uart_read(uart, UTS) & UTS_TXFULL )
+        cpu_relax();
+
+    imx_uart_write(uart, URTX0, c);
+}
+
+static int imx_uart_getc(struct serial_port *port, char *pc)
+{
+    struct imx_uart *uart = port->uart;
+
+    if ( !(imx_uart_read(uart, USR2) & USR2_RDR) )
+        return 0;
+
+    *pc = imx_uart_read(uart, URXD0) & URXD_RX_DATA;
+
+    if ( imx_uart_read(uart, USR2) & USR2_ORE )
+        imx_uart_write(uart, USR2, USR2_ORE);
+
+    return 1;
+}
+
+static int __init imx_uart_irq(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+
+    return ((uart->irq > 0) ? uart->irq : -1);
+}
+
+static const struct vuart_info *imx_uart_vuart_info(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+
+    return &uart->vuart;
+}
+
+static void imx_uart_start_tx(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1;
+
+    ucr1 = imx_uart_read(uart, UCR1);
+    imx_uart_write(uart, UCR1, ucr1 | UCR1_TRDYEN);
+}
+
+static void imx_uart_stop_tx(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1;
+
+    ucr1 = imx_uart_read(uart, UCR1);
+    imx_uart_write(uart, UCR1, ucr1 & ~UCR1_TRDYEN);
+}
+
+static struct uart_driver __read_mostly imx_uart_driver = {
+    .init_preirq = imx_uart_init_preirq,
+    .init_postirq = imx_uart_init_postirq,
+    .tx_ready = imx_uart_tx_ready,
+    .putc = imx_uart_putc,
+    .getc = imx_uart_getc,
+    .irq = imx_uart_irq,
+    .start_tx = imx_uart_start_tx,
+    .stop_tx = imx_uart_stop_tx,
+    .vuart_info = imx_uart_vuart_info,
+};
+
+static int __init imx_uart_init(struct dt_device_node *dev, const void *data)
+{
+    const char *config = data;
+    struct imx_uart *uart;
+    int res;
+    paddr_t addr, size;
+
+    if ( strcmp(config, "") )
+        printk("WARNING: UART configuration is not supported\n");
+
+    uart = &imx8m_com;
+
+    res = dt_device_get_paddr(dev, 0, &addr, &size);
+    if ( res )
+    {
+        printk("imx-uart: Unable to retrieve the base address of the UART\n");
+        return res;
+    }
+
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
+    {
+        printk("imx-uart: Unable to retrieve the IRQ\n");
+        return -EINVAL;
+    }
+    uart->irq = res;
+
+    uart->regs = ioremap_nocache(addr, size);
+    if ( !uart->regs )
+    {
+        printk("imx-uart: Unable to map the UART memory\n");
+        return -ENOMEM;
+    }
+
+    uart->vuart.base_addr = addr;
+    uart->vuart.size = size;
+    uart->vuart.data_off = URTX0;
+    uart->vuart.status_off = UTS;
+    uart->vuart.status = UTS_TXEMPTY | UTS_RXEMPTY;
+
+    /* Register with generic serial driver */
+    serial_register_uart(SERHND_DTUART, &imx_uart_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
+}
+
+static const struct dt_device_match imx_uart_dt_compat[] __initconst =
+{
+    DT_MATCH_COMPATIBLE("fsl,imx6q-uart"),
+    { /* sentinel */ },
+};
+
+DT_DEVICE_START(imx_uart, "i.MX UART", DEVICE_SERIAL)
+    .dt_match = imx_uart_dt_compat,
+    .init = imx_uart_init,
+DT_DEVICE_END
+
+/*
+ * 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 Thu Aug 20 07:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 07:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396006.1634086 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwxRd-0007oX-Gl; Thu, 20 Aug 2026 07:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396006.1634086; Thu, 20 Aug 2026 07: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 1wwxRd-0007oP-E7; Thu, 20 Aug 2026 07:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1396006;
 Thu, 20 Aug 2026 07: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 1wwxRc-0007oH-ET
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 07: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 1wwxRc-00DozI-2B
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwxRc-001ped-19
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07: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=I/O11r9/HwArxGCjOCswJR2eCC9JZrM9MnfJf4mMLHw=; b=nmdFvgRbluCJY2IND1MvLMAPID
	/vJbRM3iyx/uFIlSr2vC9aOzDJVWxqL8/96xsnZb0XAZmjXZWe/CUyWaVayn6sPg517ACtvfXkk4L
	1lKRCa1WzhQtsrGUDOyiPJ0rHHxJuuebB0ykh0OW/5YVJkee+A3UFhREdoPvZOkDCeSM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm64: add early printk for the classic i.MX UART
Message-Id: <E1wwxRc-001ped-19@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 07:44:12 +0000

commit 57b872a5b8cf7b9e17a2b317e349eaf239835190
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:19 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 08:57:21 2026 +0200

    xen/arm64: add early printk for the classic i.MX UART
    
    Add an early printk implementation for the classic i.MX UART IP,
    selectable via EARLY_UART_CHOICE_IMX_UART.  The UART is expected to be
    fully initialized by the bootloader.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig.debug            | 12 ++++++++++++
 xen/arch/arm/arm64/debug-imx-uart.inc | 37 +++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/xen/arch/arm/Kconfig.debug b/xen/arch/arm/Kconfig.debug
index 5a03b220ac..63a34b813a 100644
--- a/xen/arch/arm/Kconfig.debug
+++ b/xen/arch/arm/Kconfig.debug
@@ -44,6 +44,14 @@ choice
 		  Say Y here if you wish the early printk to direct their
 		  output to a i.MX LPUART.
 
+	config EARLY_UART_CHOICE_IMX_UART
+		select EARLY_UART_IMX_UART
+		depends on ARM_64
+		bool "Early printk via i.MX UART"
+		help
+		  Say Y here if you wish the early printk to direct their
+		  output to the classic i.MX UART (i.MX8M family).
+
 	config EARLY_UART_CHOICE_LINFLEX
 		select EARLY_UART_LINFLEX
 		depends on ARM_64
@@ -97,6 +105,9 @@ config EARLY_UART_EXYNOS4210
 config EARLY_UART_IMX_LPUART
 	select EARLY_PRINTK
 	bool
+config EARLY_UART_IMX_UART
+	select EARLY_PRINTK
+	bool
 config EARLY_UART_LINFLEX
 	select EARLY_PRINTK
 	bool
@@ -185,6 +196,7 @@ config EARLY_PRINTK_INC
 	default "debug-cadence.inc" if EARLY_UART_CADENCE
 	default "debug-exynos4210.inc" if EARLY_UART_EXYNOS4210
 	default "debug-imx-lpuart.inc" if EARLY_UART_IMX_LPUART
+	default "debug-imx-uart.inc" if EARLY_UART_IMX_UART
 	default "debug-linflex.inc" if EARLY_UART_LINFLEX
 	default "debug-meson.inc" if EARLY_UART_MESON
 	default "debug-mvebu.inc" if EARLY_UART_MVEBU
diff --git a/xen/arch/arm/arm64/debug-imx-uart.inc b/xen/arch/arm/arm64/debug-imx-uart.inc
new file mode 100644
index 0000000000..19b1679020
--- /dev/null
+++ b/xen/arch/arm/arm64/debug-imx-uart.inc
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Early printk for the classic i.MX UART IP (i.MX8M family).
+ * The UART is expected to be fully initialized by the bootloader.
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <asm/imx-uart.h>
+
+/*
+ * Wait for the UART to be ready to transmit
+ * xb: register which contains the UART base address
+ * c: scratch register
+ */
+.macro early_uart_ready xb, c
+1:
+        ldr   w\c, [\xb, #UTS]        /* <- Test register */
+        tst   w\c, #UTS_TXFULL        /* Check TX FIFO full bit */
+        b.ne  1b                      /* Wait until there is room */
+.endm
+
+/*
+ * UART transmit character
+ * xb: register which contains the UART base address
+ * wt: register which contains the character to transmit
+ */
+.macro early_uart_transmit xb, wt
+        str   \wt, [\xb, #URTX0]      /* -> Transmitter register */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 07:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 07:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396007.1634090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwxRo-0007qh-IB; Thu, 20 Aug 2026 07:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396007.1634090; Thu, 20 Aug 2026 07: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 1wwxRo-0007qZ-FW; Thu, 20 Aug 2026 07:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1396007;
 Thu, 20 Aug 2026 07: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 1wwxRm-0007qK-IH
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 07: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 1wwxRm-00DozM-2Z
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwxRm-001qYy-1X
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07: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=Gt5sJ2BQYFjbQR+ib2lSMAppeHxz0B53UGT1QlzKlKg=; b=ujSwvwlZDd5OQX2dA2Xdg0lRf8
	XBJQfUTw8r6ragteFGOPuc+KQceq3itiQnueq7EZKLG1V8wTZYdA2Ds505p/2RllXj/m1DZf5Vd9Q
	73J6d2bLXMOGbSuG1PE4P85koLVgnRROjc8JBrRymo1/WTxlSC+5OdPfqzG12muvhNqU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: add i.MX8M platform support
Message-Id: <E1wwxRm-001qYy-1X@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 07:44:22 +0000

commit 6febf12df5a1a4721e03af71af0b15e6d2187aa8
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:20 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 08:57:21 2026 +0200

    xen/arm: add i.MX8M platform support
    
    Add platform glue for the NXP i.MX8M family (i.MX8MP/MQ/MM/MN).
    
    When Linux is used as dom0 a number of drivers make SiP SMC calls into
    TF-A to manage hardware: GPC power domains, SRC (M-core remoteproc),
    SoC info and NoC QoS.  There is no public specification for these
    calls; the function IDs and their subfunctions are taken from the
    vendor kernel call sites.
    
    Forward only the specific subfunctions the hardware domain issues,
    following the whitelist model of the i.MX8QM platform.  Each service
    with a fixed set of subfunctions (GPC, SRC, NoC) filters them with an
    explicit switch on the subfunction id, and the SoC info call is a
    read-only query.  CPU and DRAM frequency scaling are denied because
    the hardware domain cannot make an informed decision about resources
    shared with the other domains, and any unknown function ID is
    rejected.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/platforms/Makefile |   1 +
 xen/arch/arm/platforms/imx8m.c  | 161 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 162 insertions(+)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index bec6e55d1f..cdf936c50d 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
 obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o
 obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o
+obj-$(CONFIG_ALL64_PLAT) += imx8m.o
 obj-$(CONFIG_ALL64_PLAT) += imx8qm.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp-eemi.o
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
new file mode 100644
index 0000000000..ad76935f5d
--- /dev/null
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -0,0 +1,161 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * i.MX 8M family setup
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <xen/sched.h>
+#include <asm/platform.h>
+#include <asm/regs.h>
+#include <asm/smccc.h>
+
+static const char * const imx8m_dt_compat[] __initconst =
+{
+    "fsl,imx8mp",
+    "fsl,imx8mq",
+    "fsl,imx8mm",
+    "fsl,imx8mn",
+    NULL
+};
+
+#define IMX_SIP_FID(fid) \
+    ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
+                       ARM_SMCCC_CONV_64, \
+                       ARM_SMCCC_OWNER_SIP, \
+                       (fid))
+
+/*
+ * SiP SMC function IDs used by the i.MX8M Linux drivers.  There is no
+ * public specification for these; the IDs and their subfunctions are
+ * extracted from the vendor kernel call sites (see drivers/soc/imx,
+ * drivers/devfreq, drivers/remoteproc).
+ */
+#define IMX_SIP_F_GPC       0x0   /* GPC power-domain control */
+#define IMX_SIP_F_CPUFREQ   0x1   /* CPU frequency scaling */
+#define IMX_SIP_F_DDR_DVFS  0x4   /* DRAM frequency scaling */
+#define IMX_SIP_F_SRC       0x5   /* SRC: M-core remoteproc start/stop */
+#define IMX_SIP_F_SOC_INFO  0x6   /* read-only SoC info query */
+#define IMX_SIP_F_NOC       0x8   /* NoC QoS priority setup */
+
+#define IMX_SIP_GPC_SF_PM_DOMAIN    0x03
+
+#define IMX_SIP_SRC_SF_M4_START     0x00
+#define IMX_SIP_SRC_SF_M4_STARTED   0x01
+#define IMX_SIP_SRC_SF_M4_STOP      0x02
+
+#define IMX_SIP_NOC_SF_PRIORITY     0x01
+
+static bool imx8m_smc(struct cpu_user_regs *regs)
+{
+    uint32_t function_id = get_user_reg(regs, 0);
+    uint32_t subfunction_id = get_user_reg(regs, 1);
+    struct arm_smccc_res res;
+
+    if ( !cpus_have_const_cap(ARM_SMCCC_1_1) )
+    {
+        printk_once(XENLOG_WARNING
+                    "imx8m: smc: no SMCCC 1.1 support. Disabling firmware calls\n");
+
+        return false;
+    }
+
+    /* Only the hardware domain may use the SiP calls */
+    if ( !is_hardware_domain(current->domain) )
+    {
+        gprintk(XENLOG_WARNING, "imx8m: smc: No access\n");
+        return false;
+    }
+
+    /*
+     * Forward only the subfunctions the dom0 kernel actually issues.  All
+     * of these manage hardware that belongs to the hardware domain (power
+     * domains, M-core, NoC) or are read-only queries.
+     */
+    switch ( function_id )
+    {
+    case IMX_SIP_FID(IMX_SIP_F_GPC):
+        if ( subfunction_id != IMX_SIP_GPC_SF_PM_DOMAIN )
+            return false;
+        break;
+
+    /*
+     * CPU and DRAM frequency scaling: the hardware domain does not see the
+     * whole system and cannot make an informed decision about resources
+     * shared with the other domains, so deny both (CPU frequency scaling
+     * is denied on the i.MX8QM platform for the same reason).
+     */
+    case IMX_SIP_FID(IMX_SIP_F_CPUFREQ):
+    case IMX_SIP_FID(IMX_SIP_F_DDR_DVFS):
+        return false;
+
+    case IMX_SIP_FID(IMX_SIP_F_SRC):
+        /* SRC: M-core remoteproc start, poll-started and stop. */
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_SRC_SF_M4_START:
+        case IMX_SIP_SRC_SF_M4_STARTED:
+        case IMX_SIP_SRC_SF_M4_STOP:
+            break;
+
+        default:
+            return false;
+        }
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_SOC_INFO):
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_NOC):
+        /*
+         * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
+         * i.MX8MP issues no NoC call, but the platform covers both.
+         */
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_NOC_SF_PRIORITY:
+            break;
+
+        default:
+            return false;
+        }
+        break;
+
+    default:
+        gprintk(XENLOG_WARNING,
+                "imx8m: smc: Unknown function id %x subfunction id %x\n",
+                function_id, subfunction_id);
+        return false;
+    }
+
+    arm_smccc_1_1_smc(function_id,
+                      subfunction_id,
+                      get_user_reg(regs, 2),
+                      get_user_reg(regs, 3),
+                      get_user_reg(regs, 4),
+                      get_user_reg(regs, 5),
+                      get_user_reg(regs, 6),
+                      get_user_reg(regs, 7),
+                      &res);
+
+    set_user_reg(regs, 0, res.a0);
+    set_user_reg(regs, 1, res.a1);
+    set_user_reg(regs, 2, res.a2);
+    set_user_reg(regs, 3, res.a3);
+
+    return true;
+}
+
+PLATFORM_START(imx8m, "i.MX 8M")
+    .compatible = imx8m_dt_compat,
+    .smc = imx8m_smc,
+PLATFORM_END
+
+/*
+ * 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 Thu Aug 20 07:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396008.1634094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwxRy-0007uQ-JZ; Thu, 20 Aug 2026 07:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396008.1634094; Thu, 20 Aug 2026 07: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 1wwxRy-0007uG-Gq; Thu, 20 Aug 2026 07:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1396008;
 Thu, 20 Aug 2026 07: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 1wwxRw-0007u6-M0
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 07: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 1wwxRw-00DozS-2v
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwxRw-001rYL-1y
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07: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=0HGaNhHR1nfqX6uGe4uyIHrUDRMT5xsO6vR/HD3J5FQ=; b=6GBWZ4y7FqSHJTtBmT8nOkKYfL
	BDh81BbOvslrKh3Y+UYeAigp/zlmq+N2B8wPdlckt0SIZPMYUfYphSPvjlMsh04MP/j3LA9su2CPx
	1cEcx4lhGVZ8QCzrgyX5UzbcQUoQYgf2fyZL5aTXfODCc8L3ZgjTlEmQK+VRSLINDc7I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: add myself as reviewer of i.MX8M related patches
Message-Id: <E1wwxRw-001rYL-1y@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 07:44:32 +0000

commit 420193f87cc70751aec0712cded82b44c66328d1
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:21 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 09:02:17 2026 +0200

    MAINTAINERS: add myself as reviewer of i.MX8M related patches
    
    I wrote the i.MX8M platform and UART support and can help review
    patches touching these areas.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 MAINTAINERS                    | 7 +++++++
 xen/arch/arm/platforms/imx8m.c | 8 +-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4dd97ffcad..c60afc93a5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -365,6 +365,13 @@ F:	tools/misc/xenhypfs.c
 F:	xen/common/hypfs.c
 F:	xen/include/xen/hypfs.h
 
+IMX8M SUPPORT
+R:	Wig Cheng <onlywig@gmail.com>
+F:	xen/arch/arm/arm64/debug-imx-uart.inc
+F:	xen/arch/arm/include/asm/imx-uart.h
+F:	xen/arch/arm/platforms/imx8m.c
+F:	xen/drivers/char/imx-uart.c
+
 IMX8QM/QXP SUPPORT
 R:	John Ernberg <john.ernberg@actia.se>
 F:	xen/arch/arm/platforms/imx8qm.c
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
index ad76935f5d..669dd517e0 100644
--- a/xen/arch/arm/platforms/imx8m.c
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -111,14 +111,8 @@ static bool imx8m_smc(struct cpu_user_regs *regs)
          * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
          * i.MX8MP issues no NoC call, but the platform covers both.
          */
-        switch ( subfunction_id )
-        {
-        case IMX_SIP_NOC_SF_PRIORITY:
-            break;
-
-        default:
+        if ( subfunction_id != IMX_SIP_NOC_SF_PRIORITY )
             return false;
-        }
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 07:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 07:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396009.1634099 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwxS8-0007wu-Me; Thu, 20 Aug 2026 07:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396009.1634099; Thu, 20 Aug 2026 07: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 1wwxS8-0007wm-JV; Thu, 20 Aug 2026 07:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1396009;
 Thu, 20 Aug 2026 07: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 1wwxS6-0007wY-P0
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 07: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 1wwxS7-00Dozp-00
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwxS6-001sZ4-2J
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 07: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=GCdqniCgdoG2iV9eRZ+CfcRIm7y9MkQV6xdYrKnvsHg=; b=0PaFcm4JnRXiow2ijBaOFZmg7M
	zTBBrXR504dyHcEyT7+xVvaPM9X1YsR3y8YttZ9ihjJtqvxLpwN7iKORfaGO8JQXAVMg2XgDLkhT7
	KNUWlDzuNVrb4wIsEO6GTMYe6HJby+3WWN+iMsvXOu5gGliCgZlkr+JYM4hhk1FHHkbs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Harden SEND2 against invented loads
Message-Id: <E1wwxS6-001sZ4-2J@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 07:44:42 +0000

commit c447b7308b1330ec6dcfef37220736c28f41daa0
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Aug 18 14:16:32 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 09:15:07 2026 +0200

    xen/arm: ffa: Harden SEND2 against invented loads
    
    Research into compiler-invented loads has flagged FFA_MSG_SEND2 as a
    possible vulnerability.
    
    ffa_handle_msg_send2() copies the message header from the guest-writable
    TX buffer before validating and using its fields. A plain structure copy
    does not prevent the compiler from re-deriving later field accesses from
    the live TX mapping.
    
    For VM-to-VM messages, msg_offset and msg_size are validated against the
    source and destination buffers, then used to copy the payload. If a
    sibling vCPU changes the header and the compiler reloads either field,
    the checked and used values can differ. This can cause an out-of-bounds
    read from the sender's TX buffer or an out-of-bounds write into the
    receiver's RX buffer.
    
    The cross-VM path is gated by CONFIG_FFA_VM_TO_VM, which is disabled by
    default. The audit ranks the likelihood of such a reload as low, but the
    C semantics do not guarantee that later accesses use the stack copy.
    
    Add a compiler barrier immediately after copying the header so that
    validation and use consume the same snapshot.
    
    Link: https://github.com/xoreaxeaxeax/schrodingers-toctou/blob/main/observer-effect/audits/audit-xen-tee-mediator-RELEASE-4.21.1.md#tm-2--ff-a-txrx-buffers-ffa_shmc-ffa_msgc
    Fixes: 98af565b1e61 ("xen/arm: ffa: Add indirect message between VM")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/tee/ffa_msg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 1eadc62870..ff12f6bdde 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -258,6 +258,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     /* create a copy of the message header */
     memcpy(&src_msg, tx_buf, sizeof(src_msg));
 
+    /* Ensure validation and use of the message header use the same snapshot */
+    barrier();
+
     src_id = src_msg.send_recv_id >> 16;
     dst_id = src_msg.send_recv_id & GENMASK(15,0);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 08:33:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 08:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396087.1634129 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyCs-0007YL-UL; Thu, 20 Aug 2026 08:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396087.1634129; Thu, 20 Aug 2026 08:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyCs-0007YC-RZ; Thu, 20 Aug 2026 08:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1396087;
 Thu, 20 Aug 2026 08:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwyCs-0007Y6-34
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 08:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyCs-00DqVX-0o
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyCr-006DZJ-2r
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6d1eDlGPIrlrA36O0HoS1yOrTlnmUG1k6sT5MB2z8tI=; b=ubU/5nxQeD52uBnE3hdHiNelBQ
	IJOXAMzQQqaqxAttLaMaczDd3VRzOkCgcdF1Han2q1Zvcc75gX1DDJQtsSFziM6yNU/BjtprSz+MO
	/Ew22Am8r8G2i4w66SH1z8AcbA2s7BQDa9HqOIjwO5w5GeDHChYFMKcwOwkxlXvrlnSE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/char: add classic i.MX UART driver
Message-Id: <E1wwyCr-006DZJ-2r@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 08:33:01 +0000

commit ee53a871ed97b1ba5187683bd4a4df44fdc64322
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:18 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 08:57:21 2026 +0200

    xen/char: add classic i.MX UART driver
    
    Add a console driver for the classic i.MX UART IP ("fsl,imx6q-uart"
    compatible), used as the console UART on the i.MX8M family.  Baudrate
    and pin configuration are inherited from the bootloader; the driver
    only enables the transmitter/receiver and wires up the RX/TX
    interrupts, mirroring the existing imx-lpuart driver.
    
    The i.MX8M family's UART IP differs from the LPUART used on
    i.MX8QM/8QXP, so a separate driver is needed.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 MAINTAINERS                         |   1 +
 xen/arch/arm/include/asm/imx-uart.h |  57 +++++++++
 xen/drivers/char/Kconfig            |   8 ++
 xen/drivers/char/Makefile           |   1 +
 xen/drivers/char/imx-uart.c         | 233 ++++++++++++++++++++++++++++++++++++
 5 files changed, 300 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index ed0ffa608f..4dd97ffcad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -269,6 +269,7 @@ F:	xen/arch/arm/
 F:	xen/drivers/char/cadence-uart.c
 F:	xen/drivers/char/exynos4210-uart.c
 F:	xen/drivers/char/imx-lpuart.c
+F:	xen/drivers/char/imx-uart.c
 F:	xen/drivers/char/meson-uart.c
 F:	xen/drivers/char/mvebu-uart.c
 F:	xen/drivers/char/omap-uart.c
diff --git a/xen/arch/arm/include/asm/imx-uart.h b/xen/arch/arm/include/asm/imx-uart.h
new file mode 100644
index 0000000000..a3892020e6
--- /dev/null
+++ b/xen/arch/arm/include/asm/imx-uart.h
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Register definitions for the classic i.MX UART IP
+ * ("fsl,imx6q-uart" compatible), used as the console UART on the
+ * i.MX8M family.
+ *
+ * Register layout taken from Linux drivers/tty/serial/imx.c.
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#ifndef ASM_IMX_UART_H
+#define ASM_IMX_UART_H
+
+#include <xen/const.h>
+
+#define URXD0           0x00   /* Receiver Register */
+#define URTX0           0x40   /* Transmitter Register */
+#define UCR1            0x80   /* Control Register 1 */
+#define UCR2            0x84   /* Control Register 2 */
+#define USR1            0x94   /* Status Register 1 */
+#define USR2            0x98   /* Status Register 2 */
+#define UTS             0xb4   /* Test Register */
+
+#define URXD_RX_DATA    0xff
+
+#define UCR1_UARTEN     BIT(0, U)   /* UART enable */
+#define UCR1_ATDMAEN    BIT(2, U)   /* Aging DMA timer enable */
+#define UCR1_TXDMAEN    BIT(3, U)   /* Transmitter ready DMA enable */
+#define UCR1_TXMPTYEN   BIT(6, U)   /* Transmitter empty interrupt enable */
+#define UCR1_RXDMAEN    BIT(8, U)   /* Receiver ready DMA enable */
+#define UCR1_RRDYEN     BIT(9, U)   /* Receiver ready interrupt enable */
+#define UCR1_TRDYEN     BIT(13, U)  /* Transmitter ready interrupt enable */
+
+#define UCR2_SRST       BIT(0, U)   /* 0 = issue software reset */
+#define UCR2_RXEN       BIT(1, U)   /* Receiver enable */
+#define UCR2_TXEN       BIT(2, U)   /* Transmitter enable */
+
+#define USR1_TRDY       BIT(13, U)  /* Transmitter ready */
+
+#define USR2_RDR        BIT(0, U)   /* Receive data ready */
+#define USR2_ORE        BIT(1, U)   /* Overrun error */
+
+#define UTS_TXFULL      BIT(4, U)   /* TX FIFO full */
+#define UTS_RXEMPTY     BIT(5, U)   /* RX FIFO empty */
+#define UTS_TXEMPTY     BIT(6, U)   /* TX FIFO empty */
+
+#endif /* ASM_IMX_UART_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index 8e49a52c73..f237c0220d 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -30,6 +30,14 @@ config HAS_IMX_LPUART
 	help
 	  This selects the i.MX LPUART. If you have i.MX8QM based board, say Y.
 
+config HAS_IMX_UART
+	bool "i.MX UART driver"
+	default y
+	depends on ARM_64
+	help
+	  This selects the classic i.MX UART. If you have an i.MX8M family
+	  based board, say Y.
+
 config HAS_MVEBU
 	bool "Marvell MVEBU UART driver"
 	default y
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index 8cbbffdca8..039f566926 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_HAS_SCIF) += scif-uart.o
 obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_XHCI) += xhci-dbc.o
 obj-$(CONFIG_HAS_IMX_LPUART) += imx-lpuart.o
+obj-$(CONFIG_HAS_IMX_UART) += imx-uart.o
 obj-$(CONFIG_HAS_LINFLEX) += linflex-uart.o
 obj-$(CONFIG_GENERIC_UART_INIT) += uart-init.o
 obj-y += serial.o
diff --git a/xen/drivers/char/imx-uart.c b/xen/drivers/char/imx-uart.c
new file mode 100644
index 0000000000..2dc531a84e
--- /dev/null
+++ b/xen/drivers/char/imx-uart.c
@@ -0,0 +1,233 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Driver for the classic i.MX UART IP ("fsl,imx6q-uart"), used as the
+ * console UART on the i.MX8M family (e.g. i.MX8MP).
+ *
+ * Baudrate and pin configuration are inherited from the bootloader.
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/irq.h>
+#include <xen/mm.h>
+#include <xen/serial.h>
+#include <asm/device.h>
+#include <asm/imx-uart.h>
+#include <asm/io.h>
+
+#define imx_uart_read(uart, off)       readl((uart)->regs + (off))
+#define imx_uart_write(uart, off, val) writel((val), (uart)->regs + (off))
+
+static struct imx_uart {
+    uint32_t irq;
+    char __iomem *regs;
+    struct irqaction irqaction;
+    struct vuart_info vuart;
+} imx8m_com;
+
+static void imx_uart_interrupt(int irq, void *data)
+{
+    struct serial_port *port = data;
+    struct imx_uart *uart = port->uart;
+
+    if ( imx_uart_read(uart, USR2) & USR2_RDR )
+        serial_rx_interrupt(port);
+
+    /*
+     * USR1_TRDY is a raw status bit, set whenever the transmitter has
+     * room regardless of whether the TX interrupt is enabled.  Only treat
+     * it as a TX interrupt when TRDYEN is set, otherwise an RX-only
+     * interrupt would spuriously enter serial_tx_interrupt().
+     */
+    if ( (imx_uart_read(uart, USR1) & USR1_TRDY) &&
+         (imx_uart_read(uart, UCR1) & UCR1_TRDYEN) )
+        serial_tx_interrupt(port);
+}
+
+static void __init imx_uart_init_preirq(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1, ucr2;
+
+    /*
+     * Reuse the bootloader settings; only enable the UART and both
+     * directions.  The console uses UCR1 interrupts (RRDYEN/TRDYEN)
+     * exclusively, so just clear UCR1's interrupt and DMA enables.
+     */
+    ucr1 = imx_uart_read(uart, UCR1);
+    ucr1 &= ~(UCR1_RRDYEN | UCR1_TRDYEN | UCR1_TXMPTYEN | UCR1_RXDMAEN |
+              UCR1_TXDMAEN | UCR1_ATDMAEN);
+    ucr1 |= UCR1_UARTEN;
+    imx_uart_write(uart, UCR1, ucr1);
+
+    ucr2 = imx_uart_read(uart, UCR2);
+    ucr2 |= UCR2_SRST | UCR2_RXEN | UCR2_TXEN;
+    imx_uart_write(uart, UCR2, ucr2);
+}
+
+static void __init imx_uart_init_postirq(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1;
+
+    uart->irqaction.handler = imx_uart_interrupt;
+    uart->irqaction.name = "imx_uart";
+    uart->irqaction.dev_id = port;
+
+    if ( setup_irq(uart->irq, 0, &uart->irqaction) != 0 )
+    {
+        dprintk(XENLOG_ERR, "Failed to allocate imx_uart IRQ %u\n", uart->irq);
+        return;
+    }
+
+    /* Enable the receiver ready interrupt */
+    ucr1 = imx_uart_read(uart, UCR1);
+    ucr1 |= UCR1_RRDYEN;
+    imx_uart_write(uart, UCR1, ucr1);
+}
+
+static int imx_uart_tx_ready(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+
+    return !(imx_uart_read(uart, UTS) & UTS_TXFULL);
+}
+
+static void imx_uart_putc(struct serial_port *port, char c)
+{
+    struct imx_uart *uart = port->uart;
+
+    while ( imx_uart_read(uart, UTS) & UTS_TXFULL )
+        cpu_relax();
+
+    imx_uart_write(uart, URTX0, c);
+}
+
+static int imx_uart_getc(struct serial_port *port, char *pc)
+{
+    struct imx_uart *uart = port->uart;
+
+    if ( !(imx_uart_read(uart, USR2) & USR2_RDR) )
+        return 0;
+
+    *pc = imx_uart_read(uart, URXD0) & URXD_RX_DATA;
+
+    if ( imx_uart_read(uart, USR2) & USR2_ORE )
+        imx_uart_write(uart, USR2, USR2_ORE);
+
+    return 1;
+}
+
+static int __init imx_uart_irq(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+
+    return ((uart->irq > 0) ? uart->irq : -1);
+}
+
+static const struct vuart_info *imx_uart_vuart_info(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+
+    return &uart->vuart;
+}
+
+static void imx_uart_start_tx(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1;
+
+    ucr1 = imx_uart_read(uart, UCR1);
+    imx_uart_write(uart, UCR1, ucr1 | UCR1_TRDYEN);
+}
+
+static void imx_uart_stop_tx(struct serial_port *port)
+{
+    struct imx_uart *uart = port->uart;
+    uint32_t ucr1;
+
+    ucr1 = imx_uart_read(uart, UCR1);
+    imx_uart_write(uart, UCR1, ucr1 & ~UCR1_TRDYEN);
+}
+
+static struct uart_driver __read_mostly imx_uart_driver = {
+    .init_preirq = imx_uart_init_preirq,
+    .init_postirq = imx_uart_init_postirq,
+    .tx_ready = imx_uart_tx_ready,
+    .putc = imx_uart_putc,
+    .getc = imx_uart_getc,
+    .irq = imx_uart_irq,
+    .start_tx = imx_uart_start_tx,
+    .stop_tx = imx_uart_stop_tx,
+    .vuart_info = imx_uart_vuart_info,
+};
+
+static int __init imx_uart_init(struct dt_device_node *dev, const void *data)
+{
+    const char *config = data;
+    struct imx_uart *uart;
+    int res;
+    paddr_t addr, size;
+
+    if ( strcmp(config, "") )
+        printk("WARNING: UART configuration is not supported\n");
+
+    uart = &imx8m_com;
+
+    res = dt_device_get_paddr(dev, 0, &addr, &size);
+    if ( res )
+    {
+        printk("imx-uart: Unable to retrieve the base address of the UART\n");
+        return res;
+    }
+
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
+    {
+        printk("imx-uart: Unable to retrieve the IRQ\n");
+        return -EINVAL;
+    }
+    uart->irq = res;
+
+    uart->regs = ioremap_nocache(addr, size);
+    if ( !uart->regs )
+    {
+        printk("imx-uart: Unable to map the UART memory\n");
+        return -ENOMEM;
+    }
+
+    uart->vuart.base_addr = addr;
+    uart->vuart.size = size;
+    uart->vuart.data_off = URTX0;
+    uart->vuart.status_off = UTS;
+    uart->vuart.status = UTS_TXEMPTY | UTS_RXEMPTY;
+
+    /* Register with generic serial driver */
+    serial_register_uart(SERHND_DTUART, &imx_uart_driver, uart);
+
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    return 0;
+}
+
+static const struct dt_device_match imx_uart_dt_compat[] __initconst =
+{
+    DT_MATCH_COMPATIBLE("fsl,imx6q-uart"),
+    { /* sentinel */ },
+};
+
+DT_DEVICE_START(imx_uart, "i.MX UART", DEVICE_SERIAL)
+    .dt_match = imx_uart_dt_compat,
+    .init = imx_uart_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 08:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 08:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396088.1634133 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyD2-0007Zy-W2; Thu, 20 Aug 2026 08:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396088.1634133; Thu, 20 Aug 2026 08: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 1wwyD2-0007Zr-Sx; Thu, 20 Aug 2026 08:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1396088;
 Thu, 20 Aug 2026 08:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwyD2-0007Zi-5U
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 08:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyD2-00DqXH-1C
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyD2-006Er0-0B
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XELCG8uNPxWaH/qg/FSV+H4ftwaekTBuEkrHb/PAS7w=; b=GEZaXajqjEJt87Vepsx0YlM92N
	2I9OoM5xhcqmhJGmmoYs81OkdOUDIFDjKAdMVqT+v7Dr1DsR7jeLqVKrno9XiSndrNOQQou0ZnyRG
	qgCyLphgugQ/S7M0lxQpjN8lKBLo6fQB/QrwAxebiak5NGsfwv5bfzUWVxKO419eG16M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm64: add early printk for the classic i.MX UART
Message-Id: <E1wwyD2-006Er0-0B@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 08:33:12 +0000

commit 57b872a5b8cf7b9e17a2b317e349eaf239835190
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:19 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 08:57:21 2026 +0200

    xen/arm64: add early printk for the classic i.MX UART
    
    Add an early printk implementation for the classic i.MX UART IP,
    selectable via EARLY_UART_CHOICE_IMX_UART.  The UART is expected to be
    fully initialized by the bootloader.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Kconfig.debug            | 12 ++++++++++++
 xen/arch/arm/arm64/debug-imx-uart.inc | 37 +++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/xen/arch/arm/Kconfig.debug b/xen/arch/arm/Kconfig.debug
index 5a03b220ac..63a34b813a 100644
--- a/xen/arch/arm/Kconfig.debug
+++ b/xen/arch/arm/Kconfig.debug
@@ -44,6 +44,14 @@ choice
 		  Say Y here if you wish the early printk to direct their
 		  output to a i.MX LPUART.
 
+	config EARLY_UART_CHOICE_IMX_UART
+		select EARLY_UART_IMX_UART
+		depends on ARM_64
+		bool "Early printk via i.MX UART"
+		help
+		  Say Y here if you wish the early printk to direct their
+		  output to the classic i.MX UART (i.MX8M family).
+
 	config EARLY_UART_CHOICE_LINFLEX
 		select EARLY_UART_LINFLEX
 		depends on ARM_64
@@ -97,6 +105,9 @@ config EARLY_UART_EXYNOS4210
 config EARLY_UART_IMX_LPUART
 	select EARLY_PRINTK
 	bool
+config EARLY_UART_IMX_UART
+	select EARLY_PRINTK
+	bool
 config EARLY_UART_LINFLEX
 	select EARLY_PRINTK
 	bool
@@ -185,6 +196,7 @@ config EARLY_PRINTK_INC
 	default "debug-cadence.inc" if EARLY_UART_CADENCE
 	default "debug-exynos4210.inc" if EARLY_UART_EXYNOS4210
 	default "debug-imx-lpuart.inc" if EARLY_UART_IMX_LPUART
+	default "debug-imx-uart.inc" if EARLY_UART_IMX_UART
 	default "debug-linflex.inc" if EARLY_UART_LINFLEX
 	default "debug-meson.inc" if EARLY_UART_MESON
 	default "debug-mvebu.inc" if EARLY_UART_MVEBU
diff --git a/xen/arch/arm/arm64/debug-imx-uart.inc b/xen/arch/arm/arm64/debug-imx-uart.inc
new file mode 100644
index 0000000000..19b1679020
--- /dev/null
+++ b/xen/arch/arm/arm64/debug-imx-uart.inc
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Early printk for the classic i.MX UART IP (i.MX8M family).
+ * The UART is expected to be fully initialized by the bootloader.
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <asm/imx-uart.h>
+
+/*
+ * Wait for the UART to be ready to transmit
+ * xb: register which contains the UART base address
+ * c: scratch register
+ */
+.macro early_uart_ready xb, c
+1:
+        ldr   w\c, [\xb, #UTS]        /* <- Test register */
+        tst   w\c, #UTS_TXFULL        /* Check TX FIFO full bit */
+        b.ne  1b                      /* Wait until there is room */
+.endm
+
+/*
+ * UART transmit character
+ * xb: register which contains the UART base address
+ * wt: register which contains the character to transmit
+ */
+.macro early_uart_transmit xb, wt
+        str   \wt, [\xb, #URTX0]      /* -> Transmitter register */
+.endm
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 08:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 08:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396089.1634137 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyDD-0007cG-11; Thu, 20 Aug 2026 08:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396089.1634137; Thu, 20 Aug 2026 08:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyDC-0007c8-UZ; Thu, 20 Aug 2026 08:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1396089;
 Thu, 20 Aug 2026 08:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwyDC-0007c0-8J
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 08:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyDC-00DqXN-1Y
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyDC-006Fpu-0Z
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m7sQvTV6G8fZdrRBi615qmJfoAkTP9ZVIPd8OcWPWbg=; b=3SKecW760emXa6yd8aJ0JvHNDT
	TjD6llpid2vb9Dg9Ghp2LN8nAiZu14WI3LXJzr65aHbPzyH4UIqHJnGiqYC9WFgCX2/pY5WUzJ9xB
	eQi4BOQhQdkkun3NIn+PFGt3+98RjSGLW6m2RM3iaeT/yg0ban8VAHowXHfRv7uM99nw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: add i.MX8M platform support
Message-Id: <E1wwyDC-006Fpu-0Z@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 08:33:22 +0000

commit 6febf12df5a1a4721e03af71af0b15e6d2187aa8
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:20 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 08:57:21 2026 +0200

    xen/arm: add i.MX8M platform support
    
    Add platform glue for the NXP i.MX8M family (i.MX8MP/MQ/MM/MN).
    
    When Linux is used as dom0 a number of drivers make SiP SMC calls into
    TF-A to manage hardware: GPC power domains, SRC (M-core remoteproc),
    SoC info and NoC QoS.  There is no public specification for these
    calls; the function IDs and their subfunctions are taken from the
    vendor kernel call sites.
    
    Forward only the specific subfunctions the hardware domain issues,
    following the whitelist model of the i.MX8QM platform.  Each service
    with a fixed set of subfunctions (GPC, SRC, NoC) filters them with an
    explicit switch on the subfunction id, and the SoC info call is a
    read-only query.  CPU and DRAM frequency scaling are denied because
    the hardware domain cannot make an informed decision about resources
    shared with the other domains, and any unknown function ID is
    rejected.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/platforms/Makefile |   1 +
 xen/arch/arm/platforms/imx8m.c  | 161 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 162 insertions(+)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index bec6e55d1f..cdf936c50d 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
 obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o
 obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o
+obj-$(CONFIG_ALL64_PLAT) += imx8m.o
 obj-$(CONFIG_ALL64_PLAT) += imx8qm.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp-eemi.o
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
new file mode 100644
index 0000000000..ad76935f5d
--- /dev/null
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -0,0 +1,161 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * i.MX 8M family setup
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <xen/sched.h>
+#include <asm/platform.h>
+#include <asm/regs.h>
+#include <asm/smccc.h>
+
+static const char * const imx8m_dt_compat[] __initconst =
+{
+    "fsl,imx8mp",
+    "fsl,imx8mq",
+    "fsl,imx8mm",
+    "fsl,imx8mn",
+    NULL
+};
+
+#define IMX_SIP_FID(fid) \
+    ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
+                       ARM_SMCCC_CONV_64, \
+                       ARM_SMCCC_OWNER_SIP, \
+                       (fid))
+
+/*
+ * SiP SMC function IDs used by the i.MX8M Linux drivers.  There is no
+ * public specification for these; the IDs and their subfunctions are
+ * extracted from the vendor kernel call sites (see drivers/soc/imx,
+ * drivers/devfreq, drivers/remoteproc).
+ */
+#define IMX_SIP_F_GPC       0x0   /* GPC power-domain control */
+#define IMX_SIP_F_CPUFREQ   0x1   /* CPU frequency scaling */
+#define IMX_SIP_F_DDR_DVFS  0x4   /* DRAM frequency scaling */
+#define IMX_SIP_F_SRC       0x5   /* SRC: M-core remoteproc start/stop */
+#define IMX_SIP_F_SOC_INFO  0x6   /* read-only SoC info query */
+#define IMX_SIP_F_NOC       0x8   /* NoC QoS priority setup */
+
+#define IMX_SIP_GPC_SF_PM_DOMAIN    0x03
+
+#define IMX_SIP_SRC_SF_M4_START     0x00
+#define IMX_SIP_SRC_SF_M4_STARTED   0x01
+#define IMX_SIP_SRC_SF_M4_STOP      0x02
+
+#define IMX_SIP_NOC_SF_PRIORITY     0x01
+
+static bool imx8m_smc(struct cpu_user_regs *regs)
+{
+    uint32_t function_id = get_user_reg(regs, 0);
+    uint32_t subfunction_id = get_user_reg(regs, 1);
+    struct arm_smccc_res res;
+
+    if ( !cpus_have_const_cap(ARM_SMCCC_1_1) )
+    {
+        printk_once(XENLOG_WARNING
+                    "imx8m: smc: no SMCCC 1.1 support. Disabling firmware calls\n");
+
+        return false;
+    }
+
+    /* Only the hardware domain may use the SiP calls */
+    if ( !is_hardware_domain(current->domain) )
+    {
+        gprintk(XENLOG_WARNING, "imx8m: smc: No access\n");
+        return false;
+    }
+
+    /*
+     * Forward only the subfunctions the dom0 kernel actually issues.  All
+     * of these manage hardware that belongs to the hardware domain (power
+     * domains, M-core, NoC) or are read-only queries.
+     */
+    switch ( function_id )
+    {
+    case IMX_SIP_FID(IMX_SIP_F_GPC):
+        if ( subfunction_id != IMX_SIP_GPC_SF_PM_DOMAIN )
+            return false;
+        break;
+
+    /*
+     * CPU and DRAM frequency scaling: the hardware domain does not see the
+     * whole system and cannot make an informed decision about resources
+     * shared with the other domains, so deny both (CPU frequency scaling
+     * is denied on the i.MX8QM platform for the same reason).
+     */
+    case IMX_SIP_FID(IMX_SIP_F_CPUFREQ):
+    case IMX_SIP_FID(IMX_SIP_F_DDR_DVFS):
+        return false;
+
+    case IMX_SIP_FID(IMX_SIP_F_SRC):
+        /* SRC: M-core remoteproc start, poll-started and stop. */
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_SRC_SF_M4_START:
+        case IMX_SIP_SRC_SF_M4_STARTED:
+        case IMX_SIP_SRC_SF_M4_STOP:
+            break;
+
+        default:
+            return false;
+        }
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_SOC_INFO):
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_NOC):
+        /*
+         * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
+         * i.MX8MP issues no NoC call, but the platform covers both.
+         */
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_NOC_SF_PRIORITY:
+            break;
+
+        default:
+            return false;
+        }
+        break;
+
+    default:
+        gprintk(XENLOG_WARNING,
+                "imx8m: smc: Unknown function id %x subfunction id %x\n",
+                function_id, subfunction_id);
+        return false;
+    }
+
+    arm_smccc_1_1_smc(function_id,
+                      subfunction_id,
+                      get_user_reg(regs, 2),
+                      get_user_reg(regs, 3),
+                      get_user_reg(regs, 4),
+                      get_user_reg(regs, 5),
+                      get_user_reg(regs, 6),
+                      get_user_reg(regs, 7),
+                      &res);
+
+    set_user_reg(regs, 0, res.a0);
+    set_user_reg(regs, 1, res.a1);
+    set_user_reg(regs, 2, res.a2);
+    set_user_reg(regs, 3, res.a3);
+
+    return true;
+}
+
+PLATFORM_START(imx8m, "i.MX 8M")
+    .compatible = imx8m_dt_compat,
+    .smc = imx8m_smc,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 08:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 08:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396090.1634140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyDN-0007en-3g; Thu, 20 Aug 2026 08:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396090.1634140; Thu, 20 Aug 2026 08:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyDN-0007eg-18; Thu, 20 Aug 2026 08:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1396090;
 Thu, 20 Aug 2026 08:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwyDM-0007ea-Bn
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 08:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyDM-00DqXT-1u
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyDM-006GoB-0v
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KF120quu5Bl2qLsOej0X2x9dkDuEINPvUBbck3hQTYQ=; b=cM467o5YkL6MFUQOf0T+aZLD7q
	oI0MPE1zOU62csmSK6oNXfNsWRw75N3P7/g4fMWpVZtJvsnBGvYhIlAgVnU20CP3A9nzX3UFbBFvz
	Xqk9BTYl/yi8p4YeOPY8LoDFdqdZHl0CK2OxtszmVW+kkF+O7IlJfV+sITgNH7MOB/x8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: add myself as reviewer of i.MX8M related patches
Message-Id: <E1wwyDM-006GoB-0v@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 08:33:32 +0000

commit 420193f87cc70751aec0712cded82b44c66328d1
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:21 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 09:02:17 2026 +0200

    MAINTAINERS: add myself as reviewer of i.MX8M related patches
    
    I wrote the i.MX8M platform and UART support and can help review
    patches touching these areas.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 MAINTAINERS                    | 7 +++++++
 xen/arch/arm/platforms/imx8m.c | 8 +-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4dd97ffcad..c60afc93a5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -365,6 +365,13 @@ F:	tools/misc/xenhypfs.c
 F:	xen/common/hypfs.c
 F:	xen/include/xen/hypfs.h
 
+IMX8M SUPPORT
+R:	Wig Cheng <onlywig@gmail.com>
+F:	xen/arch/arm/arm64/debug-imx-uart.inc
+F:	xen/arch/arm/include/asm/imx-uart.h
+F:	xen/arch/arm/platforms/imx8m.c
+F:	xen/drivers/char/imx-uart.c
+
 IMX8QM/QXP SUPPORT
 R:	John Ernberg <john.ernberg@actia.se>
 F:	xen/arch/arm/platforms/imx8qm.c
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
index ad76935f5d..669dd517e0 100644
--- a/xen/arch/arm/platforms/imx8m.c
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -111,14 +111,8 @@ static bool imx8m_smc(struct cpu_user_regs *regs)
          * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
          * i.MX8MP issues no NoC call, but the platform covers both.
          */
-        switch ( subfunction_id )
-        {
-        case IMX_SIP_NOC_SF_PRIORITY:
-            break;
-
-        default:
+        if ( subfunction_id != IMX_SIP_NOC_SF_PRIORITY )
             return false;
-        }
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 20 08:33:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Aug 2026 08:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1396091.1634145 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyDX-0007gj-5K; Thu, 20 Aug 2026 08:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1396091.1634145; Thu, 20 Aug 2026 08:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wwyDX-0007gb-2d; Thu, 20 Aug 2026 08:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1396091;
 Thu, 20 Aug 2026 08:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wwyDW-0007gV-FH
 for xen-changelog@lists.xenproject.org; Thu, 20 Aug 2026 08:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyDW-00DqXn-2F
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wwyDW-006Hhx-1H
 for xen-changelog@lists.xenproject.org;
 Thu, 20 Aug 2026 08:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=W+D0UMspGn8+lU4UWTFkeIkdo5NNL2aJzC7QHF9/JMQ=; b=cAdkDRdLd6ov3Lp+N4BbfauZF3
	R4dv0YhVMBMoBZxNXF71d97okJGDJuwftehZhRrkiSi1os66OhT9hDoHUmnYczlyoq9d/m26hhphI
	xcJhpNt/YRKW8m4egDWeYTw4amTaiwn7it//DaugSfXaLTD3ERhmcUscQrR0zYkdQSw4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Harden SEND2 against invented loads
Message-Id: <E1wwyDW-006Hhx-1H@xenbits.xenproject.org>
Date: Thu, 20 Aug 2026 08:33:42 +0000

commit c447b7308b1330ec6dcfef37220736c28f41daa0
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Aug 18 14:16:32 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 20 09:15:07 2026 +0200

    xen/arm: ffa: Harden SEND2 against invented loads
    
    Research into compiler-invented loads has flagged FFA_MSG_SEND2 as a
    possible vulnerability.
    
    ffa_handle_msg_send2() copies the message header from the guest-writable
    TX buffer before validating and using its fields. A plain structure copy
    does not prevent the compiler from re-deriving later field accesses from
    the live TX mapping.
    
    For VM-to-VM messages, msg_offset and msg_size are validated against the
    source and destination buffers, then used to copy the payload. If a
    sibling vCPU changes the header and the compiler reloads either field,
    the checked and used values can differ. This can cause an out-of-bounds
    read from the sender's TX buffer or an out-of-bounds write into the
    receiver's RX buffer.
    
    The cross-VM path is gated by CONFIG_FFA_VM_TO_VM, which is disabled by
    default. The audit ranks the likelihood of such a reload as low, but the
    C semantics do not guarantee that later accesses use the stack copy.
    
    Add a compiler barrier immediately after copying the header so that
    validation and use consume the same snapshot.
    
    Link: https://github.com/xoreaxeaxeax/schrodingers-toctou/blob/main/observer-effect/audits/audit-xen-tee-mediator-RELEASE-4.21.1.md#tm-2--ff-a-txrx-buffers-ffa_shmc-ffa_msgc
    Fixes: 98af565b1e61 ("xen/arm: ffa: Add indirect message between VM")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/tee/ffa_msg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 1eadc62870..ff12f6bdde 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -258,6 +258,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     /* create a copy of the message header */
     memcpy(&src_msg, tx_buf, sizeof(src_msg));
 
+    /* Ensure validation and use of the message header use the same snapshot */
+    barrier();
+
     src_id = src_msg.send_recv_id >> 16;
     dst_id = src_msg.send_recv_id & GENMASK(15,0);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:00:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398767.1634900 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTI-0002p9-R7; Mon, 24 Aug 2026 10:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398767.1634900; Mon, 24 Aug 2026 10:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTI-0002oe-Na; Mon, 24 Aug 2026 10:00:04 +0000
Received: by outflank-mailman (input) for mailman id 1398767;
 Mon, 24 Aug 2026 10:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyRTG-0002R6-UH
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRTG-003CwW-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRTG-00ByDA-1p
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y06SrVRxMr6nrcHTBmElRXN3ASrOt3QrMykO5pLx4zw=; b=VFLPyWZLZ1hgAoKcoqAj38wuvI
	1io60i/obx5wjBnc9wUhGSu3rehBexGrSxT89leHBw07ufQ2SMTwI7RJkIl8KjETW2mUJYF0P5evm
	0U8mXZm2rH9k4puViSLk/35o7EKXgMJq6QFDMd9PAk9/nSVk7Z6Z5cTswluVUnXQbP0I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] update Xen version to 4.22.1-pre
Message-Id: <E1wyRTG-00ByDA-1p@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:00:02 +0000

commit 34a4bac0177f17fe96997efa7132ff00e319825a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:45:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:45:07 2026 +0200

    update Xen version to 4.22.1-pre
---
 MAINTAINERS  | 106 +++++------------------------------------------------------
 xen/Makefile |   2 +-
 2 files changed, 10 insertions(+), 98 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 81bd0dfeec..e61f0ee659 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -54,6 +54,15 @@ list. Remember to copy the appropriate stable branch maintainer who
 will be listed in this section of the MAINTAINERS file in the
 appropriate branch.
 
+The maintainer for this branch is:
+
+	Jan Beulich <jbeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+       Anthony Perard <anthony.perard@vates.tech>
+
+
 	Unstable Subsystem Maintainers
 	==============================
 
@@ -104,103 +113,6 @@ Descriptions of section entries:
 	   xen-maintainers-<version format number of this file>
 
 
-	Check-in policy
-	===============
-
-In order for a patch to be checked in, in general, several conditions
-must be met:
-
-1. In order to get a change to a given file committed, it must have
-   the approval of at least one maintainer of that file.
-
-   A patch of course needs Acks from the maintainers of each file that
-   it changes; so a patch which changes xen/arch/x86/traps.c,
-   xen/arch/x86/mm/p2m.c, and xen/arch/x86/mm/shadow/multi.c would
-   require an Ack from each of the three sets of maintainers.
-
-   See below for rules on nested maintainership.
-
-2. Each change must have appropriate approval from someone other than
-   the person who wrote it.  This can be either:
-
-  a. An Acked-by from a maintainer of the code being touched (a
-     co-maintainer if available, or a more general level maintainer if
-     not available; see the secton on nested maintainership)
-
-  b. A Reviewed-by by anyone of suitable stature in the community
-
-3. Sufficient time must have been given for anyone to respond.  This
-   depends in large part upon the urgency and nature of the patch.
-   For a straightforward uncontroversial patch, a day or two may be
-   sufficient; for a controversial patch, a week or two may be better.
-
-4. There must be no "open" objections.
-
-In a case where one person submits a patch and a maintainer gives an
-Ack, the Ack stands in for both the approval requirement (#1) and the
-Acked-by-non-submitter requirement (#2).
-
-In a case where a maintainer themselves submits a patch, the
-Signed-off-by meets the approval requirement (#1); so a Review
-from anyone in the community suffices for requirement #2.
-
-Before a maintainer checks in their own patch with another community
-member's R-b but no co-maintainer Ack, it is especially important to
-give their co-maintainer opportunity to give feedback, perhaps
-declaring their intention to check it in without their co-maintainers
-ack a day before doing so.
-
-In the case where two people collaborate on a patch, at least one of
-whom is a maintainer -- typically where one maintainer will do an
-early version of the patch, and another maintainer will pick it up and
-revise it -- there should be two Signed-off-by's and one Acked-by or
-Reviewed-by; with the maintainer who did the most recent change
-sending the patch, and an Acked-by or Reviewed-by coming from the
-maintainer who did not most recently edit the patch.  This satisfies
-the requirement #2 because a) the Signed-off-by of the sender approves
-the final version of the patch; including all parts of the patch that
-the sender did not write b) the Reviewed-by approves the final version
-of the patch, including all patches that the reviewer did not write.
-Thus all code in the patch has been approved by someone who did not
-write it.
-
-Maintainers may choose to override non-maintainer objections in the
-case that consensus can't be reached.
-
-As always, no policy can cover all possible situations.  In
-exceptional circumstances, committers may commit a patch in absence of
-one or more of the above requirements, if they are reasonably
-confident that the other maintainers will approve of their decision in
-retrospect.
-
-       The meaning of nesting
-       ======================
-
-Many maintainership areas are "nested": for example, there are entries
-for xen/arch/x86 as well as xen/arch/x86/mm, and even
-xen/arch/x86/mm/shadow; and there is a section at the end called "THE
-REST" which lists all committers.  The meaning of nesting is that:
-
-1. Under normal circumstances, the Ack of the most specific maintainer
-is both necessary and sufficient to get a change to a given file
-committed.  So a change to xen/arch/x86/mm/shadow/multi.c requires the
-the Ack of the xen/arch/x86/mm/shadow maintainer for that part of the
-patch, but would not require the Ack of the xen/arch/x86 maintainer or
-the xen/arch/x86/mm maintainer.
-
-2. In unusual circumstances, a more general maintainer's Ack can stand
-in for or even overrule a specific maintainer's Ack.  Unusual
-circumstances might include:
- - The patch is fixing a high-priority issue causing immediate pain,
- and the more specific maintainer is not available.
- - The more specific maintainer has not responded either to the
- original patch, nor to "pings", within a reasonable amount of time.
- - The more general maintainer wants to overrule the more specific
- maintainer on some issue. (This should be exceptional.)
- - In the case of a disagreement between maintainers, THE REST can
- settle the matter by majority vote.  (This should be very exceptional
- indeed.)
-
 
 Maintainers List (try to look for most precise areas first)
 
diff --git a/xen/Makefile b/xen/Makefile
index 725f220ee6..7ab965c401 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    = 22
-export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:00:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398768.1634902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTS-0003B2-Ri; Mon, 24 Aug 2026 10:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398768.1634902; Mon, 24 Aug 2026 10:00:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTS-0003Au-PC; Mon, 24 Aug 2026 10:00:14 +0000
Received: by outflank-mailman (input) for mailman id 1398768;
 Mon, 24 Aug 2026 10: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 1wyRTQ-0003Aa-Qe
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10: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 1wyRTR-003Cwc-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRTQ-00BzDE-2N
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10: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=nzJbxviM/bil7HdfwLEyGPxQntLiUNbskmptniumwO0=; b=XplTv0de/GBBgML+Ahj6gkIO1I
	+S8bXU4+wUvSECb85/UKOPWynGD8vnQJZk402vEIUxPmA7bEqxVg3aAHg//Pkc3O5oCtgrDxu6J5k
	fy9rPK1mrSFFIm/Uu7Ld53F+ZZ3vm9/qEz+kAwAD9qzFKfVydNGrUyDZThjZQ+xaU5Wg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] nestedsvm: Allow destroying the domain fully
Message-Id: <E1wyRTQ-00BzDE-2N@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:00:12 +0000

commit 76bc053ba179ca8606127cebf153efe6a4fec679
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Aug 24 11:46:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:46:08 2026 +0200

    nestedsvm: Allow destroying the domain fully
    
    Unmapping the virtual VMCB is performed near the end of the domain
    destroy procedure but the mapped guest frame prevents domain destroy
    from getting to that point. This means guests that call VMRUN cannot
    be fully destroyed.
    
    Move the unmap of the virtual VMCB earlier to fix the issue.
    
    Fixes: bcf557675d85 ("x86: properly use map_domain_page() in nested HVM code")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4d069a84ee0e29b182482b3ae04b243d2ef25ed4
    master date: 2026-06-30 09:41:35 +0200
---
 xen/arch/x86/hvm/svm/nestedhvm.h |  1 +
 xen/arch/x86/hvm/svm/nestedsvm.c | 15 +++++++++++++--
 xen/arch/x86/hvm/svm/svm.c       |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h
index 9bfed5ffd7..9bb04a0434 100644
--- a/xen/arch/x86/hvm/svm/nestedhvm.h
+++ b/xen/arch/x86/hvm/svm/nestedhvm.h
@@ -48,6 +48,7 @@ bool cf_check nsvm_vmcb_guest_intercepts_event(
     struct vcpu *v, unsigned int vector, int errcode);
 bool cf_check nsvm_vmcb_hap_enabled(struct vcpu *v);
 enum hvm_intblk cf_check nsvm_intr_blocked(struct vcpu *v);
+void cf_check nsvm_domain_relinquish_resources(struct domain *d);
 
 /* Interrupts, vGIF */
 void svm_vmexit_do_clgi(struct cpu_user_regs *regs, struct vcpu *v);
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 9899cb2147..b06124c2c9 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -110,8 +110,6 @@ void cf_check nsvm_vcpu_destroy(struct vcpu *v)
         svm->ns_merged_msrpm = NULL;
     }
 
-    hvm_unmap_guest_frame(nv->nv_vvmcx, 1);
-    nv->nv_vvmcx = NULL;
     if ( nv->nv_n2vmcx )
     {
         free_vmcb(nv->nv_n2vmcx);
@@ -122,6 +120,19 @@ void cf_check nsvm_vcpu_destroy(struct vcpu *v)
     svm->ns_iomap = NULL;
 }
 
+void cf_check nsvm_domain_relinquish_resources(struct domain *d)
+{
+    struct vcpu *v;
+    struct nestedvcpu *nv;
+
+    for_each_vcpu ( d, v )
+    {
+        nv = &vcpu_nestedhvm(v);
+        hvm_unmap_guest_frame(nv->nv_vvmcx, 1);
+        nv->nv_vvmcx = NULL;
+    }
+}
+
 int cf_check nsvm_vcpu_reset(struct vcpu *v)
 {
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 49fcdd906c..38c61db1d7 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2420,6 +2420,7 @@ static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
     .nhvm_vmcx_hap_enabled = nsvm_vmcb_hap_enabled,
     .nhvm_intr_blocked = nsvm_intr_blocked,
     .nhvm_hap_walk_L1_p2m = nsvm_hap_walk_L1_p2m,
+    .nhvm_domain_relinquish_resources = nsvm_domain_relinquish_resources,
 
     .get_reg = svm_get_reg,
     .set_reg = svm_set_reg,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:00:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:00:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398770.1634905 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTc-0003DK-TB; Mon, 24 Aug 2026 10:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398770.1634905; Mon, 24 Aug 2026 10:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTc-0003DC-Qg; Mon, 24 Aug 2026 10:00:24 +0000
Received: by outflank-mailman (input) for mailman id 1398770;
 Mon, 24 Aug 2026 10:00: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 1wyRTa-0003D3-Uo
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10: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 1wyRTb-003Cwj-0a
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRTa-00C0IF-2o
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10: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=3FqKOlp8919vmAmSvWkmVKePlnTQZx7HS+8iE+dymLY=; b=navILCiuZ7cNAB+1Sp432I+ok+
	v3LYqPikw0W85/JIZclaxN8FiCrKZsuenlRqfSFFllRqStuaoWzhSJmI/ZHv2ga9yANsFfAybLKQQ
	lUd9znVjgDxY9Og68VSDp+qwsLhqqGz5lRPlP1ZmiLLYn6tR4nfMsMrBMR2G6rOSMQ1E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] x86/emul: Adjust handling of CR8_LEGACY
Message-Id: <E1wyRTa-00C0IF-2o@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:00:22 +0000

commit 739dd1b8242c008e5c82cf17b11701312cd89755
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:46:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:46:32 2026 +0200

    x86/emul: Adjust handling of CR8_LEGACY
    
    The APM description of the AltMovCR8 feature bit is:
    
      "LOCK MOV CR0 means MOV CR8"
    
    Adjust the decode logic to behave like this.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    master commit: 7d48ef45b6df0cf8985b84305e02b7440de8f50f
    master date: 2026-07-10 19:35:49 +0100
---
 xen/arch/x86/x86_emulate/decode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 2c13356c4d..57f6baffb0 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
         break;
 
     case 0x20: case 0x22: /* mov to/from cr */
-        if ( s->lock_prefix && vcpu_has_cr8_legacy() )
+        if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg == 0 )
         {
-            s->modrm_reg += 8;
+            s->modrm_reg = 8;
             s->lock_prefix = false;
         }
-        /* fall through */
+        fallthrough;
     case 0x21: case 0x23: /* mov to/from dr */
         ASSERT(s->ea.type == OP_REG); /* Early operand adjustment ensures this. */
         generate_exception_if(s->lock_prefix, X86_EXC_UD);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:00:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398771.1634909 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTm-0003FK-UV; Mon, 24 Aug 2026 10:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398771.1634909; Mon, 24 Aug 2026 10:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTm-0003FC-S0; Mon, 24 Aug 2026 10:00:34 +0000
Received: by outflank-mailman (input) for mailman id 1398771;
 Mon, 24 Aug 2026 10:00: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 1wyRTl-0003F4-3O
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:00: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 1wyRTl-003Cwo-14
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRTl-00C1KE-06
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00: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=z26oLlA6gxCWiOFR1MMZqsZDvJwl+XOgyeDwhhXEwd8=; b=RslgMe0UeoVFc9sn2sfU4S7Jw8
	EU8Y2llMGllDW//jTytCypgYsGLH6+3XwP9j7SHNBnUAQVZYUQK2JIGRLfeLGh1ps+Dq66ey+pVy3
	APzz7oJbjkcS4QtPCLLpQW8ykf06PHA7A7yDgCuMUg69Zz0+dz7Mtn5uYxLOVydAjciQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger assertion
Message-Id: <E1wyRTl-00C1KE-06@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:00:33 +0000

commit c7c6381e7e26bb940b6e3e3b0c4bb88c15aa6e95
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:46:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:46:53 2026 +0200

    x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger assertion
    
    AFL has pointed out that the op_bytes-is-not-0 assertion in common SIMD
    handling can trigger for these insns. Indeed when the (relevant part of)
    the controlling mask register is 0, no memory is accessed at all. Leave
    op_bytes unaltered in this case, to engage the short-circuiting in common
    SIMD handling when fault_suppression is true and op_bytes is 0.
    
    While there also correct a related typo in the test harness.
    
    Fixes: 65f82d4ce1ea ("x86emul: support AVX512{F,_VBMI2} compress/expand insns")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cf90c8a48af2694d0653f754996a41672a153de4
    master date: 2026-07-20 09:50:00 +0200
---
 tools/tests/x86_emulator/predicates.c  | 2 +-
 xen/arch/x86/x86_emulate/x86_emulate.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index 8ff2653895..84717d3ebe 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -1946,7 +1946,7 @@ static const struct evex {
     { { 0x83 }, 2, T, R, pfx_66, W1, Ln }, /* vpmultishiftqb */
     { { 0x88 }, 2, T, R, pfx_66, Wn, Ln }, /* vpexpandp{s,d} */
     { { 0x89 }, 2, T, R, pfx_66, Wn, Ln }, /* vpexpand{d,q} */
-    { { 0x8a }, 2, T, W, pfx_66, Wn, Ln }, /* vpcompressp{s,d} */
+    { { 0x8a }, 2, T, W, pfx_66, Wn, Ln }, /* vcompressp{s,d} */
     { { 0x8b }, 2, T, W, pfx_66, Wn, Ln }, /* vpcompress{d,q} */
     { { 0x8d }, 2, F, R, pfx_66, Wn, Ln }, /* vperm{b,w} */
     { { 0x8f }, 2, F, R, pfx_66, W0, Ln }, /* vpshufbitqmb */
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 364e6c092d..bc51283854 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6186,9 +6186,11 @@ x86_emulate(
             ASSERT(op_bytes == n * elem_bytes);
             op_mask &= ~0ULL >> (64 - n);
             n = hweight64(op_mask);
-            op_bytes = n * elem_bytes;
             if ( n )
+            {
+                op_bytes = n * elem_bytes;
                 op_mask = ~0ULL >> (64 - n);
+            }
         }
         goto simd_zmm;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:00:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:00:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398772.1634913 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTw-0003HH-Vt; Mon, 24 Aug 2026 10:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398772.1634913; Mon, 24 Aug 2026 10:00:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRTw-0003H9-TL; Mon, 24 Aug 2026 10:00:44 +0000
Received: by outflank-mailman (input) for mailman id 1398772;
 Mon, 24 Aug 2026 10:00: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 1wyRTv-0003H0-7B
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:00: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 1wyRTv-003Cwu-1S
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRTv-00C2HI-0U
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00: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=CBzXIMoIuiKJ4h3ByJri/9Qpo+iJVJxJQw5x/T0tfJc=; b=0OBujbBjpt94i160tqVNkftlGH
	D0FwWz9Sb8pRgOKvgv6MnVqMa/BbcOnQQ2AdRbxAp+EQ/M/c9RnZznXUc604Cs0sTC339foIP8yCg
	VQoZEF7iSMBaZLtjAvTSqJ8hVXySFXjmuBMWH7SUbqD8USJ4Ger0LqjpMFZ/SRcusWvU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
Message-Id: <E1wyRTv-00C2HI-0U@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:00:43 +0000

commit 75c4992c384f001b42717098375541aead66795e
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Mon Aug 24 11:47:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:47:12 2026 +0200

    xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
    
    schedule_cpu_rm() clears the cpupool pointer of the scheduling
    resource before calling sched_deinit_pdata():
    
        sr->cpupool = NULL;
        ...
        sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);
    
    For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
    replenishment timer lives on the cpu being removed, and
    move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
    without checking it for NULL. Removing a pCPU owning the timer from
    an RTDS cpupool therefore dereferences NULL + 0x10 (the res_valid
    member) and panics:
    
        (XEN) Data Abort Trap. Syndrome=0x1c28005
        (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
        (XEN) Xen call trace:
        (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
        (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
        (XEN)
        (XEN) Panic on CPU 0:
        (XEN) CPU0: Unexpected Trap: Data Abort
    
    Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
    (observed on arm64, but the path is common code):
    
        xl cpupool-create name="test" sched="rtds"
        xl cpupool-cpu-remove Pool-0 1
        xl cpupool-cpu-add test 1
        xl cpupool-cpu-remove test 1
    
    The last command moves the RTDS replenishment timer to cpu1 (first
    and only cpu of the pool) and then removes cpu1, hitting the NULL
    dereference in the sched_deinit_pdata() callback.
    
    Use the cpupool back-pointer of the scheduler instead of the one of
    the scheduling resource. It is set by cpupool_create() before any
    pCPU can be assigned to the pool and stays valid for the whole
    lifetime of the scheduler, so it is still available when
    rt_deinit_pdata() runs. Other schedulers already rely on it the same
    way, e.g. credit2 in cpu_add_to_runqueue().
    
    Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: f294e3abe40cda37618d9fbad8cde86bbae0d1c6
    master date: 2026-07-21 09:47:36 +0200
---
 xen/common/sched/rt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 0fe045e591..1fccbf94d9 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -763,10 +763,16 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     return &prv->lock;
 }
 
-static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
+static void move_repl_timer(const struct scheduler *ops, unsigned int old_cpu)
 {
-    cpumask_t *online = get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu = cpumask_cycle(old_cpu, online);
+    struct rt_private *prv = rt_priv(ops);
+    /*
+     * Use the cpupool of the scheduler: the one of the scheduling resource
+     * is already cleared when this is called from rt_deinit_pdata().
+     */
+    const struct cpupool *c = ops->cpupool;
+    unsigned int new_cpu = c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
 
     /*
      * Make sure the timer run on one of the cpus that are still available
@@ -793,7 +799,7 @@ rt_deinit_pdata(const struct scheduler *ops, void *pcpu, int cpu)
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( prv->repl_timer.cpu == cpu )
-        move_repl_timer(prv, cpu);
+        move_repl_timer(ops, cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
@@ -811,7 +817,7 @@ rt_move_timers(const struct scheduler *ops, struct sched_resource *sr)
     if ( prv->repl_timer.status != TIMER_STATUS_invalid &&
          prv->repl_timer.status != TIMER_STATUS_killed &&
          !cpumask_test_cpu(old_cpu, sr->cpupool->res_valid) )
-        move_repl_timer(prv, old_cpu);
+        move_repl_timer(ops, old_cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:00:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:00:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398773.1634918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRU7-0003JE-1K; Mon, 24 Aug 2026 10:00:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398773.1634918; Mon, 24 Aug 2026 10:00: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 1wyRU6-0003J6-Uk; Mon, 24 Aug 2026 10:00:54 +0000
Received: by outflank-mailman (input) for mailman id 1398773;
 Mon, 24 Aug 2026 10:00: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 1wyRU5-0003Iy-BA
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:00: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 1wyRU5-003Cwz-1q
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRU5-00C3Bx-0s
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:00: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=cdMbAq0dKKA3DMyuIwYYeaJIcxabKMunGdtUvNKJdm8=; b=B5N6zZtz6AmBJaKUX1eVQJDRRO
	llbRS5v5oM05pkMoPYa1l0AYrF+alaSz/RClLX+Q9hyrmQQEn63EvUz7JoAWL12QebrKf+Ha/D/ur
	6TW6KYGOZ8y27EOhpIT+VeC9fpdxTPslpyTS1P6T8tFw0VmUtqdrSYvln4g18rqJP19M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] xen/sched: fix schedule_dump() handling of free cpus
Message-Id: <E1wyRU5-00C3Bx-0s@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:00:53 +0000

commit fe13e27783e57ebacdff1315630675afc5493608
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:47:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:47:36 2026 +0200

    xen/sched: fix schedule_dump() handling of free cpus
    
    With the introduction of core scheduling, cpus not used by any cpupool
    have been switched to use the very simple idle scheduler instead of the
    default scheduler.
    
    Trying to obtain diagnostic scheduling data via the "r" debug key is
    scanning through all cpupools using the per-cpupool scheduler to print
    the related data. Unfortunately the switch to use the idle scheduler
    for free cpus wasn't reflected in schedule_dump(), causing the default
    scheduler's dump_cpu_state callback to be used for free cpus.
    
    This causes NULL dereferences in case the default scheduler is one of
    credit or null.
    
    Fix that by using the idle scheduler instead of the default scheduler
    for free cpus. Note that it is fine for a scheduler to have no
    dump_cpu_state callback.
    
    Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 55b71301cf..9ccf5811bf 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3452,7 +3452,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:01:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398774.1634922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRUG-0003Ld-4H; Mon, 24 Aug 2026 10:01:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398774.1634922; Mon, 24 Aug 2026 10:01:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRUG-0003LW-1h; Mon, 24 Aug 2026 10:01:04 +0000
Received: by outflank-mailman (input) for mailman id 1398774;
 Mon, 24 Aug 2026 10:01: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 1wyRUF-0003LQ-FC
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:01: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 1wyRUF-003CxZ-2D
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRUF-00C44l-1E
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QdEAI0fwhbLf66/kaoQnyeuh42TgvZ0FdXlSG5UjUCc=; b=B5Hlj7ha9RG25sELBv7Pm9tKr+
	j9WTEUQ+W+CCTddls5i+JIXe/wRmtRv1LXRiqBvyMFPuNkDK0qiKK4sanNo95hJrAraUFNTEvdeiw
	DEmFVBwp6db8e/QUZVy+9wkTtpuOnsY/owOIYgI9ivd5n6HeY6j8pwo+5ULeaWYg3Q+Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wyRUF-00C44l-1E@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:01:03 +0000

commit d2785c41059195f13bdb5ac710558374f73920a2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:47:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:47:53 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
    master date: 2026-08-03 09:50:07 +0200
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:01:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:01:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398775.1634926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRUQ-0003Nh-5n; Mon, 24 Aug 2026 10:01:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398775.1634926; Mon, 24 Aug 2026 10:01: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 1wyRUQ-0003NZ-3G; Mon, 24 Aug 2026 10:01:14 +0000
Received: by outflank-mailman (input) for mailman id 1398775;
 Mon, 24 Aug 2026 10:01: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 1wyRUP-0003NT-Ih
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:01: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 1wyRUP-003Cxe-2b
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRUP-00C4wL-1e
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01: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=7prqZJx1572ySdl4VVCiKFJ1P5R75DAfBPbUXsZRgEg=; b=mGiYAdTMNSmqyWKx+neIvcpNfk
	HP4TBBI9uGjODGugKOXuj3cUVx7C27tx5eN1E671Ac8O/jazTj3mSve9pROFap0OPod0pXdSDHbzX
	CDNPZIjxfjx13l3J+K8GbLM++mOrb6pfx0if5crwypiskh58uXuJo3eIUkp8GsmE+Tng=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wyRUP-00C4wL-1e@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:01:13 +0000

commit 50e6dea12c36f3dc8cf262981a4543811d963eca
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:48:11 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:48:11 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1077a93425d2dcca894883cf8565ee9ecf1672cc
    master date: 2026-08-05 12:00:17 +0200
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index ca610d36fc..bc1e8d0c04 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -80,7 +74,16 @@ static void radix_tree_node_free(struct radix_tree_node *node)
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -705,27 +708,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:01:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:01:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398776.1634930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRUa-0003Pw-7K; Mon, 24 Aug 2026 10:01:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398776.1634930; Mon, 24 Aug 2026 10:01:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRUa-0003Po-4a; Mon, 24 Aug 2026 10:01:24 +0000
Received: by outflank-mailman (input) for mailman id 1398776;
 Mon, 24 Aug 2026 10:01: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 1wyRUZ-0003Ph-Lc
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:01: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 1wyRUZ-003Cxi-2u
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRUZ-00C5mF-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01: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=ASJs6G8zzs385sX2eLGL/rhklshZgVq7hAyYtGSovOQ=; b=VzwvMXgLnEiNYmv1Jz+uEEWKJM
	0njutiNzjZ3de12tjzoJGkj+JKuLSLfbYk7l6ZuJg//r9uN1AM6517QIy9gwEtt2/eUGXwJk+kumb
	MoX1Dlvt7/3dDgfqXo0W+IOv1pr3Q4kZN/FHiqK5WieTc1NP23snkMmaO9b9o21CH6mQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] x86/nmi: Fix mis-classification of watchdog NMIs
Message-Id: <E1wyRUZ-00C5mF-1y@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:01:23 +0000

commit aa4c4909b4267f6947de5b9a492fd382ea372085
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:48:33 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:48:33 2026 +0200

    x86/nmi: Fix mis-classification of watchdog NMIs
    
    It used to be the case that cpu_data[] inherited the BSP's cpuid_level until
    the AP had calculated it itself.  Following the rework, cpuid_level has a
    placeholder 1 until it is calculated properly.
    
    setup_apic_nmi_watchdog() happens to be called on the BSP after SMP bring-up,
    meaning that the first call is on CPU1.  It is also positioned in the window
    where cpu_data[] is wrong.
    
    As a result, setup_p6_watchdog()'s one-time calculation of the performance
    counter width falls back into Pentium compatibility mode assuming 32bit
    counters.  This causes a watchdog NMI which is delayed a little (e.g. from an
    SMI), to appear as if it hadn't overflowed, and therefore be considered as not
    a watchdog NMI.  On systems where unknown NMIs are treated as fatal, this
    results in a spurious crash.
    
    Switch setup_p6_watchdog() to use boot_cpu_data.cpuid_level, which is how this
    is checked almost everywhere else.
    
    core2_vpmu_init() used the same pattern to look at leaf 0xa.  Despite being
    init code and only running on the BSP, {boot,current}_cpu_data are different
    objects, so switch it over to checking boot_cpu_data.cpuid_level too.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dc5a77c6c4951e8ad75c884b3b6b87a1ba46c488
    master date: 2026-08-17 18:46:08 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c | 2 +-
 xen/arch/x86/nmi.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index ed9f62b936..2326caee58 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -896,7 +896,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     unsigned int version = 0;
     unsigned int i;
 
-    if ( current_cpu_data.cpuid_level >= 0xa )
+    if ( boot_cpu_data.cpuid_level >= 0xa )
         version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
 
     switch ( version )
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 91f95fe6d0..ec85516609 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -321,7 +321,7 @@ static void setup_p6_watchdog(unsigned counter)
 {
     unsigned int evntsel;
 
-    if ( !nmi_p6_event_width && current_cpu_data.cpuid_level >= 0xa )
+    if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
         nmi_p6_event_width = P6_EVENT_WIDTH_MIN;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:01:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:01:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398777.1634934 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRUk-0003Rt-8X; Mon, 24 Aug 2026 10:01:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398777.1634934; Mon, 24 Aug 2026 10:01:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRUk-0003Rk-5w; Mon, 24 Aug 2026 10:01:34 +0000
Received: by outflank-mailman (input) for mailman id 1398777;
 Mon, 24 Aug 2026 10:01: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 1wyRUj-0003Re-Oq
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:01: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 1wyRUj-003Cxn-3D
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRUj-00C6f7-2H
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:01: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=ZBaDQtFBsSrdxNQb1O2NN2nxx/bfEvISHlQVEtoRup0=; b=bAZAEbYt2atqASUalDpDlv+ZA9
	rXSKttHIOMtg45JwfXEAIZhvT+ndSC888mb60Zqrbp6L9a8dz3X1yVrJbuRFlHqtEANhip+mLJ9wY
	EEFo9W1fsYp803D7qf42dcN8Il8+mUVeFbr6q5eYBk2dvklHfeudsXtqUNbOe42SpIug=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wyRUj-00C6f7-2H@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:01:33 +0000

commit f98206e8a1b7e1182a0a7efcc21217b1f37e75ea
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:49:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:49:08 2026 +0200

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dfb428cb1142a5a468531410e0461fb2a9f2a4ea
    master date: 2026-08-18 12:51:08 +0100
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index ec85516609..802d085d2f 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -347,14 +347,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -386,6 +380,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -396,6 +392,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        misc = rdmsr(MSR_IA32_MISC_ENABLE);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch ( boot_cpu_data.family )
         {
         case 6:
@@ -404,7 +408,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398784.1634947 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRdw-0005N1-4Z; Mon, 24 Aug 2026 10:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398784.1634947; Mon, 24 Aug 2026 10: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 1wyRdw-0005Mt-1x; Mon, 24 Aug 2026 10:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1398784;
 Mon, 24 Aug 2026 10:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyRdu-0005Mn-T4
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRdu-003D9e-2y
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRdu-00Cwe1-20
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10: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=UQkRxCrsYfoaY8IppVS0BwRM1r3gWQBeHekbS1q5ot8=; b=oPSbIiRhrkW0+bOdVi/EFE//AX
	IQ7Gs1i9Bg+dvjdIYVp9sX7eSiLxHniQ35cvK376zERAhVfpL0SzXxGQweLe9nb9GGnJKG1tbe53O
	VmsQdpIk03rThDyG5ds2NbhBJOzmjemUlFCqPT3WvcoPDA9NrBhWpYk4Q4dSKT4JrcdU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] update Xen version to 4.21.3-pre
Message-Id: <E1wyRdu-00Cwe1-20@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:11:02 +0000

commit 911331555d65abc2d42c4cf86965fc9447f04f4a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:49:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:49:53 2026 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index 1d7c07d1fb..bdf9a4f3a1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 21
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398785.1634951 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRe6-0005Pu-6D; Mon, 24 Aug 2026 10:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398785.1634951; Mon, 24 Aug 2026 10: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 1wyRe6-0005Pn-3M; Mon, 24 Aug 2026 10:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1398785;
 Mon, 24 Aug 2026 10:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyRe4-0005Ph-QS
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRe5-003D9k-08
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRe4-00Cxa3-2M
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SoaHHhlgJDLgH52MalYx3SLaOY989LCf6Pp6e6Ez+/8=; b=4vT5BWJPXepp3HnUddrq4P9pCF
	eyp9648X0/Y1tP2riD81R54WxiUQ4b6jibN2j4TsFGseSmw0VVKISlBA5L9QhRNGKjRJGZyDvVpaO
	hOGrg6bcd6rLRpP1XnGrU4wHCxHnuHAhOi7OUBGmUSJtISoiFFbW5nmXlLaQhDd3eVZo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
Message-Id: <E1wyRe4-00Cxa3-2M@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:11:12 +0000

commit 9dccd424b99dd09b457e0d739a26d4d699227b99
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Mon Aug 24 11:50:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:50:32 2026 +0200

    xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
    
    schedule_cpu_rm() clears the cpupool pointer of the scheduling
    resource before calling sched_deinit_pdata():
    
        sr->cpupool = NULL;
        ...
        sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);
    
    For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
    replenishment timer lives on the cpu being removed, and
    move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
    without checking it for NULL. Removing a pCPU owning the timer from
    an RTDS cpupool therefore dereferences NULL + 0x10 (the res_valid
    member) and panics:
    
        (XEN) Data Abort Trap. Syndrome=0x1c28005
        (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
        (XEN) Xen call trace:
        (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
        (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
        (XEN)
        (XEN) Panic on CPU 0:
        (XEN) CPU0: Unexpected Trap: Data Abort
    
    Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
    (observed on arm64, but the path is common code):
    
        xl cpupool-create name="test" sched="rtds"
        xl cpupool-cpu-remove Pool-0 1
        xl cpupool-cpu-add test 1
        xl cpupool-cpu-remove test 1
    
    The last command moves the RTDS replenishment timer to cpu1 (first
    and only cpu of the pool) and then removes cpu1, hitting the NULL
    dereference in the sched_deinit_pdata() callback.
    
    Use the cpupool back-pointer of the scheduler instead of the one of
    the scheduling resource. It is set by cpupool_create() before any
    pCPU can be assigned to the pool and stays valid for the whole
    lifetime of the scheduler, so it is still available when
    rt_deinit_pdata() runs. Other schedulers already rely on it the same
    way, e.g. credit2 in cpu_add_to_runqueue().
    
    Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: f294e3abe40cda37618d9fbad8cde86bbae0d1c6
    master date: 2026-07-21 09:47:36 +0200
---
 xen/common/sched/rt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 5c9c41e63b..a9141d22b4 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -750,10 +750,16 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     return &prv->lock;
 }
 
-static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
+static void move_repl_timer(const struct scheduler *ops, unsigned int old_cpu)
 {
-    cpumask_t *online = get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu = cpumask_cycle(old_cpu, online);
+    struct rt_private *prv = rt_priv(ops);
+    /*
+     * Use the cpupool of the scheduler: the one of the scheduling resource
+     * is already cleared when this is called from rt_deinit_pdata().
+     */
+    const struct cpupool *c = ops->cpupool;
+    unsigned int new_cpu = c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
 
     /*
      * Make sure the timer run on one of the cpus that are still available
@@ -780,7 +786,7 @@ rt_deinit_pdata(const struct scheduler *ops, void *pcpu, int cpu)
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( prv->repl_timer.cpu == cpu )
-        move_repl_timer(prv, cpu);
+        move_repl_timer(ops, cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
@@ -798,7 +804,7 @@ rt_move_timers(const struct scheduler *ops, struct sched_resource *sr)
     if ( prv->repl_timer.status != TIMER_STATUS_invalid &&
          prv->repl_timer.status != TIMER_STATUS_killed &&
          !cpumask_test_cpu(old_cpu, sr->cpupool->res_valid) )
-        move_repl_timer(prv, old_cpu);
+        move_repl_timer(ops, old_cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398786.1634956 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyReG-0005TF-7v; Mon, 24 Aug 2026 10:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398786.1634956; Mon, 24 Aug 2026 10: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 1wyReG-0005T7-4t; Mon, 24 Aug 2026 10:11:24 +0000
Received: by outflank-mailman (input) for mailman id 1398786;
 Mon, 24 Aug 2026 10: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 1wyReE-0005Sz-Ub
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10: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 1wyReF-003D9o-0Y
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyReE-00CyS4-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10: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=33743nbcJ0hYJxGGyObp9BuETcKWBI7gGiZP0itAybM=; b=7IY4ROAV0jM/fcqwEzk0oK0ej1
	wqpBcjFTicLWjCDO5Lj7JkflOLYB9TTD17NIDuGMdzabYyp0ZDIrkvxLYwgbRnT3KMMHxsfbRBKCP
	C7zVb6LGPVZonbuutJp4kITcl1nXQ4EJHN/JcZmGuWB/QGzKaSpDJG133miTkl8n9ESc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/credit: fix race with schedule_cpu_rm() in csched_timer()
Message-Id: <E1wyReE-00CyS4-2l@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:11:22 +0000

commit 1129f837d07e5443b98f33aa5ab05b97cf8f1963
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:50:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:50:56 2026 +0200

    xen/credit: fix race with schedule_cpu_rm() in csched_timer()
    
    When removing a CPU from a cpupool running the credit scheduler, a
    race might happen between schedule_cpu_rm() and csched_timer(),
    resulting in a NULL dereference.
    
    The timer associated with csched_timer() is killed only in
    csched_deinit_pdata(), which is called by schedule_cpu_rm() after
    setting the scheduler's per-cpu data to NULL AND after enabling
    interrupts again. This can result in the timer firing before being
    killed, so csched_timer() needs to test the per-cpu data being set
    before accessing it.
    
    Fixes: 78be3dbbfefa ("cpupools [1/6]: hypervisor changes")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ea1d785a5f660ec52ec70454a0410c2f7fb2930a
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/credit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 6dcf6b2c8b..485e52bd7c 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1589,6 +1589,10 @@ static void cf_check csched_tick(void *_cpu)
     struct csched_pcpu *spc = CSCHED_PCPU(cpu);
     struct csched_private *prv = CSCHED_PRIV(sr->scheduler);
 
+    /* Handle race of timer disabling vs. firing when switching scheduler. */
+    if ( !spc )
+        return;
+
     spc->tick++;
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398787.1634959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyReQ-0005Vi-AD; Mon, 24 Aug 2026 10:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398787.1634959; Mon, 24 Aug 2026 10: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 1wyReQ-0005Va-7Q; Mon, 24 Aug 2026 10:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1398787;
 Mon, 24 Aug 2026 10:11: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 1wyReP-0005VS-1v
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:11: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 1wyReP-003D9v-0v
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyReO-00CzLH-3C
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10: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=9AzQyUWekvqYzVsKwLT5gwcQ6cbr3MlDG6WebLXbGUk=; b=QfoDb0PYdlVpqklrxdK20W/Rqw
	MS6BVI/i2/9Sxx4rHdy8EqlmIbVi50oVRQ3HfSZ4xQtyj8L9yw54FZQl9pD/93T9eIDVlmB5gel3X
	esS//weM+rTnmmrL0DUZpvrIORyBKprqFGtXGUo8WzERWIl/97Y9jZRK08gOpdP41nWg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/sched: fix schedule_dump() handling of free cpus
Message-Id: <E1wyReO-00CzLH-3C@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:11:32 +0000

commit 6a78d0e734fc0d31550b4dee7c3e7d480092a559
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:51:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:51:12 2026 +0200

    xen/sched: fix schedule_dump() handling of free cpus
    
    With the introduction of core scheduling, cpus not used by any cpupool
    have been switched to use the very simple idle scheduler instead of the
    default scheduler.
    
    Trying to obtain diagnostic scheduling data via the "r" debug key is
    scanning through all cpupools using the per-cpupool scheduler to print
    the related data. Unfortunately the switch to use the idle scheduler
    for free cpus wasn't reflected in schedule_dump(), causing the default
    scheduler's dump_cpu_state callback to be used for free cpus.
    
    This causes NULL dereferences in case the default scheduler is one of
    credit or null.
    
    Fix that by using the idle scheduler instead of the default scheduler
    for free cpus. Note that it is fine for a scheduler to have no
    dump_cpu_state callback.
    
    Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 2488243c74..a374e59a84 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3432,7 +3432,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398788.1634962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRea-0005Xo-BE; Mon, 24 Aug 2026 10:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398788.1634962; Mon, 24 Aug 2026 10: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 1wyRea-0005Xg-8r; Mon, 24 Aug 2026 10:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1398788;
 Mon, 24 Aug 2026 10:11: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 1wyReZ-0005Xa-57
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:11: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 1wyReZ-003DA1-1F
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyReZ-00D0K3-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11: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=+hzTQnp3mdiMsLKV4tOgCv3MoyUS5JwN0Kj+CCudTgc=; b=UsQE9Rk5csvAJwd3VUZU3JAd+i
	N5R8PF7CpykMNgWEX+coTn7Hf4ywBHFeiAGGWLXA7QhGXnA3R3tDIS27WBFDAvhSQlerN1q5vQ/3k
	Jr0/dS0gqEsF1Bi5Ch4QE+McxupRXhSSByPsyzHiek46/OAbIsntlMNKu0jsv6dN/ETk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wyReZ-00D0K3-0J@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:11:43 +0000

commit fc203d45b67c9b68c764b5b65a0bc10ce6369e21
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:51:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:51:31 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
    master date: 2026-08-03 09:50:07 +0200
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398790.1634966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRek-0005Zs-Cq; Mon, 24 Aug 2026 10:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398790.1634966; Mon, 24 Aug 2026 10: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 1wyRek-0005Zk-AI; Mon, 24 Aug 2026 10:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1398790;
 Mon, 24 Aug 2026 10: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 1wyRej-0005Zc-9A
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:11:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRej-003DA8-1d
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRej-00D1Ev-0f
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:11: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=ueofGC4s+kFhEzlVdGqQsUzvsxqVWji+MvAloN2KYWY=; b=Tc+1PQRRV5KvAOrqcdBccbm3wv
	oaydpq9LQOmWYyjMuSXVl4yEH1mJe1WfxxmNu5QgFuJwRT1F06wVX4qWFt+vsEVkeauAKTxvZ9aC0
	2UoSt+p3BLpnfMva7bIc+Nu3clT9YdHrWXv6C1jKyKEtnH9Kh2bb7OQOyvz2+EmSZqsk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wyRej-00D1Ev-0f@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:11:53 +0000

commit cd91b44b57870de2b39714c47d0c492b74773c35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:51:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:51:45 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1077a93425d2dcca894883cf8565ee9ecf1672cc
    master date: 2026-08-05 12:00:17 +0200
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index ca610d36fc..bc1e8d0c04 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -80,7 +74,16 @@ static void radix_tree_node_free(struct radix_tree_node *node)
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -705,27 +708,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:12:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398791.1634970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyReu-0005cv-EK; Mon, 24 Aug 2026 10:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398791.1634970; Mon, 24 Aug 2026 10: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 1wyReu-0005cn-Bh; Mon, 24 Aug 2026 10:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1398791;
 Mon, 24 Aug 2026 10: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 1wyRet-0005ch-Cq
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10: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 1wyRet-003DAi-21
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRet-00D29V-15
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QhOgCAD/whsqNU2LOIJPPYMo69/bEUd2W4Ki8jiaaDE=; b=cLJAcRdvUtP2pDDRwetmgeV8Oc
	sgHpmcL1ovm9VV/bE1hrt74ZsZkRAJYWCI8t+CjjhMzBoUo56SO2X5DIWtrRTZjnfrXYEdSF63hJP
	XG5IUCVp3nopgAqN8CCEb/iZrqjD7NiLTK7eQUV1F8m/GA2K4Ew2R0TqCcBCwMXl+89A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/nmi: Fix mis-classification of watchdog NMIs
Message-Id: <E1wyRet-00D29V-15@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:12:03 +0000

commit 21ef12591a8d513aed7cfdfe2aa927aaf76f69e8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:52:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:52:01 2026 +0200

    x86/nmi: Fix mis-classification of watchdog NMIs
    
    It used to be the case that cpu_data[] inherited the BSP's cpuid_level until
    the AP had calculated it itself.  Following the rework, cpuid_level has a
    placeholder 1 until it is calculated properly.
    
    setup_apic_nmi_watchdog() happens to be called on the BSP after SMP bring-up,
    meaning that the first call is on CPU1.  It is also positioned in the window
    where cpu_data[] is wrong.
    
    As a result, setup_p6_watchdog()'s one-time calculation of the performance
    counter width falls back into Pentium compatibility mode assuming 32bit
    counters.  This causes a watchdog NMI which is delayed a little (e.g. from an
    SMI), to appear as if it hadn't overflowed, and therefore be considered as not
    a watchdog NMI.  On systems where unknown NMIs are treated as fatal, this
    results in a spurious crash.
    
    Switch setup_p6_watchdog() to use boot_cpu_data.cpuid_level, which is how this
    is checked almost everywhere else.
    
    core2_vpmu_init() used the same pattern to look at leaf 0xa.  Despite being
    init code and only running on the BSP, {boot,current}_cpu_data are different
    objects, so switch it over to checking boot_cpu_data.cpuid_level too.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dc5a77c6c4951e8ad75c884b3b6b87a1ba46c488
    master date: 2026-08-17 18:46:08 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c | 2 +-
 xen/arch/x86/nmi.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 7ce98ee42e..c6644d0c42 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -902,7 +902,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     unsigned int version = 0;
     unsigned int i;
 
-    if ( current_cpu_data.cpuid_level >= 0xa )
+    if ( boot_cpu_data.cpuid_level >= 0xa )
         version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
 
     switch ( version )
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index a0c9194ff0..e3e653d345 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -319,7 +319,7 @@ static void setup_p6_watchdog(unsigned counter)
 {
     unsigned int evntsel;
 
-    if ( !nmi_p6_event_width && current_cpu_data.cpuid_level >= 0xa )
+    if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
         nmi_p6_event_width = P6_EVENT_WIDTH_MIN;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:12:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398792.1634975 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRf4-0005g1-Fj; Mon, 24 Aug 2026 10:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398792.1634975; Mon, 24 Aug 2026 10:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRf4-0005fs-D0; Mon, 24 Aug 2026 10:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1398792;
 Mon, 24 Aug 2026 10: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 1wyRf3-0005fk-GG
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10: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 1wyRf3-003DAo-2M
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRf3-00D38L-1Q
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10: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=pEIKNIPAOiQCpGwtiW2ekm0G6XCf/lLGfCwdm3MlPH8=; b=f1DB5PDjaTpXjx2VsoA0s9LCCH
	owQRJ3y6cBc7F+Wv3HPfX5cXv7UV/QUUuVaGhpaOapehJzh5m2FG/KltSGCDlRrYOtrBoqRPbsao+
	3+2KADJzORgM7r6XVQJP08zzy5C6kg1YQHVniMyjYqbFmZB29vvojJBCt2q+wrnzSdzc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wyRf3-00D38L-1Q@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:12:13 +0000

commit 1cefa774195b99032c7d086437634304bfd13dd5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:52:15 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:52:15 2026 +0200

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dfb428cb1142a5a468531410e0461fb2a9f2a4ea
    master date: 2026-08-18 12:51:08 +0100
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index e3e653d345..12bea11e8b 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -345,14 +345,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -384,6 +378,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -394,6 +390,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        misc = rdmsr(MSR_IA32_MISC_ENABLE);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch (boot_cpu_data.x86) {
         case 6:
             setup_p6_watchdog((boot_cpu_data.x86_model < 14) 
@@ -401,7 +405,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:12:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:12:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398793.1634978 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRfF-0005iD-Gy; Mon, 24 Aug 2026 10:12:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398793.1634978; Mon, 24 Aug 2026 10: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 1wyRfF-0005i5-EP; Mon, 24 Aug 2026 10:12:25 +0000
Received: by outflank-mailman (input) for mailman id 1398793;
 Mon, 24 Aug 2026 10:12: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 1wyRfE-0005hx-3L
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:12: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 1wyRfE-003DAs-14
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRfE-00D47u-09
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12: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=wLBWtB/tOWFiEftrNx8S1CI7nnwDMWU0sbfYhTFpS78=; b=j69jgR7Ecsl4LtYVr0Rzq4/IDw
	Wfr+joXi6gpwt/FHqKqj+Pi6/in6nKxqfg3SXuPi0FWLVyTMEkgUAojBHz0o+6WuMwm0TBTseMEn6
	Dqp497DQCaXgVib5WFnlfpp+8PUEgZD2BtWB74UpQMZiaCBlmKfGegIRAQM2xUZhCTa8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] update Xen version to 4.20.5-pre
Message-Id: <E1wyRfE-00D47u-09@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:12:24 +0000

commit 2862edcacdbdc1cfa2f34c4fa324e065af2082b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:53:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:53:22 2026 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index d9df42b1bb..acbc8a4974 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 20
-export XEN_EXTRAVERSION ?= .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.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:12:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398794.1634984 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRfP-0005k9-JJ; Mon, 24 Aug 2026 10:12:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398794.1634984; Mon, 24 Aug 2026 10: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 1wyRfP-0005k1-Fk; Mon, 24 Aug 2026 10:12:35 +0000
Received: by outflank-mailman (input) for mailman id 1398794;
 Mon, 24 Aug 2026 10:12: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 1wyRfO-0005jt-6Q
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:12: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 1wyRfO-003DAy-1O
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRfO-00D55B-0R
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12: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=I7pqs4sbl4MmAssT5Dw7va7WCfF985q+sx6xnkzHxUU=; b=QaoX088xEn16A0U9zOmOolqSxG
	4rlXEq3BcVuqvH1IRmPRidW37aAkagMllFvMyV7LWNYt5/pM899xu4AYKhEIsypiUZUziBjw6YwjK
	iMwVBzcgHN2IPz6Jgou7yhq+zYRXgYkkHzrhUaoze+Jr3ZRfnTLZLkZA6O3brl/8DAjI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
Message-Id: <E1wyRfO-00D55B-0R@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:12:34 +0000

commit 934897ea5e8ead513f8b31d3588e43de76b66092
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Mon Aug 24 11:53:49 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:53:49 2026 +0200

    xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
    
    schedule_cpu_rm() clears the cpupool pointer of the scheduling
    resource before calling sched_deinit_pdata():
    
        sr->cpupool = NULL;
        ...
        sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);
    
    For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
    replenishment timer lives on the cpu being removed, and
    move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
    without checking it for NULL. Removing a pCPU owning the timer from
    an RTDS cpupool therefore dereferences NULL + 0x10 (the res_valid
    member) and panics:
    
        (XEN) Data Abort Trap. Syndrome=0x1c28005
        (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
        (XEN) Xen call trace:
        (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
        (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
        (XEN)
        (XEN) Panic on CPU 0:
        (XEN) CPU0: Unexpected Trap: Data Abort
    
    Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
    (observed on arm64, but the path is common code):
    
        xl cpupool-create name="test" sched="rtds"
        xl cpupool-cpu-remove Pool-0 1
        xl cpupool-cpu-add test 1
        xl cpupool-cpu-remove test 1
    
    The last command moves the RTDS replenishment timer to cpu1 (first
    and only cpu of the pool) and then removes cpu1, hitting the NULL
    dereference in the sched_deinit_pdata() callback.
    
    Use the cpupool back-pointer of the scheduler instead of the one of
    the scheduling resource. It is set by cpupool_create() before any
    pCPU can be assigned to the pool and stays valid for the whole
    lifetime of the scheduler, so it is still available when
    rt_deinit_pdata() runs. Other schedulers already rely on it the same
    way, e.g. credit2 in cpu_add_to_runqueue().
    
    Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: f294e3abe40cda37618d9fbad8cde86bbae0d1c6
    master date: 2026-07-21 09:47:36 +0200
---
 xen/common/sched/rt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 102225e606..a938a6146d 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -750,10 +750,16 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     return &prv->lock;
 }
 
-static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
+static void move_repl_timer(const struct scheduler *ops, unsigned int old_cpu)
 {
-    cpumask_t *online = get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu = cpumask_cycle(old_cpu, online);
+    struct rt_private *prv = rt_priv(ops);
+    /*
+     * Use the cpupool of the scheduler: the one of the scheduling resource
+     * is already cleared when this is called from rt_deinit_pdata().
+     */
+    const struct cpupool *c = ops->cpupool;
+    unsigned int new_cpu = c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
 
     /*
      * Make sure the timer run on one of the cpus that are still available
@@ -780,7 +786,7 @@ rt_deinit_pdata(const struct scheduler *ops, void *pcpu, int cpu)
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( prv->repl_timer.cpu == cpu )
-        move_repl_timer(prv, cpu);
+        move_repl_timer(ops, cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
@@ -798,7 +804,7 @@ rt_move_timers(const struct scheduler *ops, struct sched_resource *sr)
     if ( prv->repl_timer.status != TIMER_STATUS_invalid &&
          prv->repl_timer.status != TIMER_STATUS_killed &&
          !cpumask_test_cpu(old_cpu, sr->cpupool->res_valid) )
-        move_repl_timer(prv, old_cpu);
+        move_repl_timer(ops, old_cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:12:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:12:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398795.1634987 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRfZ-0005mY-LC; Mon, 24 Aug 2026 10:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398795.1634987; Mon, 24 Aug 2026 10: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 1wyRfZ-0005mQ-Ih; Mon, 24 Aug 2026 10:12:45 +0000
Received: by outflank-mailman (input) for mailman id 1398795;
 Mon, 24 Aug 2026 10:12: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 1wyRfY-0005mK-9V
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:12: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 1wyRfY-003DB2-1g
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRfY-00D60P-0k
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12: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=XTlTNHvHA76Hw5HJk/Uj2unO5gPR/8CyIE3v7R6JsDQ=; b=g0WLPrX56uK0pszraNn8ZUjFPd
	9jijfc5TS9x+3SW4BjzxGMtjepsotu8Zw+oPXdYQdoPfFVcG5GjCZnw85JbWAqCZgLnzNsT07UQvl
	oInTuZ9rqVp9GSgNJLecGsTBEsX3A9KEaBmDCd9DI5bpA7DVRDNGPgtYPoNQ0OlMFdyc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/credit: fix race with schedule_cpu_rm() in csched_timer()
Message-Id: <E1wyRfY-00D60P-0k@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:12:44 +0000

commit da5a2144bbc1f26103bf2eb3bda8cf095acd9cb4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:54:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:05 2026 +0200

    xen/credit: fix race with schedule_cpu_rm() in csched_timer()
    
    When removing a CPU from a cpupool running the credit scheduler, a
    race might happen between schedule_cpu_rm() and csched_timer(),
    resulting in a NULL dereference.
    
    The timer associated with csched_timer() is killed only in
    csched_deinit_pdata(), which is called by schedule_cpu_rm() after
    setting the scheduler's per-cpu data to NULL AND after enabling
    interrupts again. This can result in the timer firing before being
    killed, so csched_timer() needs to test the per-cpu data being set
    before accessing it.
    
    Fixes: 78be3dbbfefa ("cpupools [1/6]: hypervisor changes")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ea1d785a5f660ec52ec70454a0410c2f7fb2930a
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/credit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index a6bb321e7d..2adab171a2 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1587,6 +1587,10 @@ static void cf_check csched_tick(void *_cpu)
     struct csched_pcpu *spc = CSCHED_PCPU(cpu);
     struct csched_private *prv = CSCHED_PRIV(sr->scheduler);
 
+    /* Handle race of timer disabling vs. firing when switching scheduler. */
+    if ( !spc )
+        return;
+
     spc->tick++;
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:12:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398796.1634990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRfj-0005oa-MZ; Mon, 24 Aug 2026 10:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398796.1634990; Mon, 24 Aug 2026 10: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 1wyRfj-0005oS-K1; Mon, 24 Aug 2026 10:12:55 +0000
Received: by outflank-mailman (input) for mailman id 1398796;
 Mon, 24 Aug 2026 10:12: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 1wyRfi-0005oK-CF
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:12: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 1wyRfi-003DBC-1x
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRfi-00D6rj-13
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:12: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=05QhwASfkChShSccP4KMeaeXXFW/D7y6TSRBTFh/JEY=; b=GUzXd5VH7EZD8vZNqa6Bb7hefx
	smSI2E+RkRYBKlp3FT0xrFwx+7w+1ZvUiVPwUK8CV25dAlLUHDh7vfLUY+b0i/5XoxPE+AGLXSWLK
	80jlvjZGglJDD4QGsnwWhWIafB65IsFWyUTb9Wu9n7Td2YQigiGQbeFft6rquhoL7M44=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/sched: fix schedule_dump() handling of free cpus
Message-Id: <E1wyRfi-00D6rj-13@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:12:54 +0000

commit ee3befc2cdaad0d35992c3b157383b17b5e7b9d2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:54:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:22 2026 +0200

    xen/sched: fix schedule_dump() handling of free cpus
    
    With the introduction of core scheduling, cpus not used by any cpupool
    have been switched to use the very simple idle scheduler instead of the
    default scheduler.
    
    Trying to obtain diagnostic scheduling data via the "r" debug key is
    scanning through all cpupools using the per-cpupool scheduler to print
    the related data. Unfortunately the switch to use the idle scheduler
    for free cpus wasn't reflected in schedule_dump(), causing the default
    scheduler's dump_cpu_state callback to be used for free cpus.
    
    This causes NULL dereferences in case the default scheduler is one of
    credit or null.
    
    Fix that by using the idle scheduler instead of the default scheduler
    for free cpus. Note that it is fine for a scheduler to have no
    dump_cpu_state callback.
    
    Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 2e97a5494c..e1fea666f4 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3412,7 +3412,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:13:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:13:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398797.1634995 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRft-0005qZ-Np; Mon, 24 Aug 2026 10:13:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398797.1634995; Mon, 24 Aug 2026 10:13:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRft-0005qR-LJ; Mon, 24 Aug 2026 10:13:05 +0000
Received: by outflank-mailman (input) for mailman id 1398797;
 Mon, 24 Aug 2026 10:13:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyRfs-0005qI-Ez
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:13: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 1wyRfs-003DE4-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:13:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRfs-00D7hF-1J
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:13: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=oDhimJc9SRYbIKhXwuW23Gco1Ix+KI7CZZlGRBoWR6U=; b=0mUnOXry4lRo3i3en5t7FSOf0P
	7YU0w/qJWsJ6Xi2hQQKEcppwE76OAz3oGwYcwKBux4tkxpllop7eX7RDI6CXAv9LtqChRPVKcM+Vn
	ds80g4EX28GAOw4g5xsdGnSJ9TprbE/qkOTwbBEmVGKuHSg0ZqliJxhmlfbVkh0SHBa4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wyRfs-00D7hF-1J@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:13:04 +0000

commit d3eddf948fb8ae616c08056c16893ad9cc1885de
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:54:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:36 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
    master date: 2026-08-03 09:50:07 +0200
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:13:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:13:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398798.1634999 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRg3-0005sW-PE; Mon, 24 Aug 2026 10:13:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398798.1634999; Mon, 24 Aug 2026 10:13:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRg3-0005sO-Mh; Mon, 24 Aug 2026 10:13:15 +0000
Received: by outflank-mailman (input) for mailman id 1398798;
 Mon, 24 Aug 2026 10:13:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyRg2-0005sG-Hu
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:13:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRg2-003DEB-2W
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:13:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRg2-00D8Ve-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:13:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jI6m/8guwPwvVUK8w8+L2/e2kOh+BQXc8062wG7/bZc=; b=iEfYu/WS2KoStgCbwsMxnaIMnc
	0vUPwJ9v4e3cCuOIqaa1/r26/8Wz0xJymvsrORxpeA2oz1Bc1XFkUbbbW9aIIBk1zEjOPWqrHHJcc
	mR8j0H7j6+zijArPRS3u0khXtj05W8oCGtFN5Dr3hJS9g1nSkN3TGA5jX0thqTGAKDjM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wyRg2-00D8Ve-1a@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:13:14 +0000

commit 88c2d7324b26d979d85c102ef25afa7d77a82ff1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:54:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:59 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1077a93425d2dcca894883cf8565ee9ecf1672cc
    master date: 2026-08-05 12:00:17 +0200
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index a623a9ff66..490e73c13e 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -82,7 +76,16 @@ static void radix_tree_node_free(
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -707,27 +710,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 10:13:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 10:13:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398799.1635003 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRgD-0005un-QZ; Mon, 24 Aug 2026 10:13:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398799.1635003; Mon, 24 Aug 2026 10:13:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyRgD-0005uf-Nz; Mon, 24 Aug 2026 10:13:25 +0000
Received: by outflank-mailman (input) for mailman id 1398799;
 Mon, 24 Aug 2026 10:13:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyRgC-0005uZ-Kt
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 10:13:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRgC-003DEJ-2p
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:13:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyRgC-00D9MZ-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 10:13:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8lvNcwMBE4LQ4qo5b29OL6Yt0nf2Dt3Jb/R4YJww/TQ=; b=NX/H1McPyGOeu3p8AuVX5b2Dfj
	kTmtd1frP4ysC/V6nosXdfWSMDk5QqDuroZJ6wECtE6Xkh1694qvuy5boOFNcVdF7gQhTOkeWeDFj
	CHarBXoRE2+rQxNl1RKl301sfE3Tz3u7pMokc3zC9HG69lGfNwBcZ9qoknp0aHl4q7PI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wyRgC-00D9MZ-1v@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 10:13:24 +0000

commit 7b7f5be456027e4273165f577a1bbfd5ee95503a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:55:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:55:13 2026 +0200

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dfb428cb1142a5a468531410e0461fb2a9f2a4ea
    master date: 2026-08-18 12:51:08 +0100
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 9793fa2316..12e31c2005 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -345,14 +345,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsr(MSR_P6_EVNTSEL(0), evntsel, 0);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -384,6 +378,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -394,6 +390,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        rdmsrl(MSR_IA32_MISC_ENABLE, misc);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch (boot_cpu_data.x86) {
         case 6:
             setup_p6_watchdog((boot_cpu_data.x86_model < 14) 
@@ -401,7 +405,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398816.1635016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU1z-0007B1-Vk; Mon, 24 Aug 2026 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398816.1635016; Mon, 24 Aug 2026 12:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU1z-0007At-Sq; Mon, 24 Aug 2026 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1398816;
 Mon, 24 Aug 2026 12:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU1y-0007An-8x
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU1y-003G2q-0o
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU1x-00Av1t-33
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f/JoF3/8YE2pPMYY1q+o3Qf/em1jegT0yPRT5FoeghE=; b=Jb2SQqb6ZXZMpSbzwoRJG1Vf7J
	oxwhG1ejw7daQWfMU1X5+ocq5mkhxOEFhfjfKQpE54wgqOeQBj4ggED2Br/1PuCR0yy+ggyuPQ9ck
	o/eflcv2tY7UZiu/xt3CaUw1Ed6Xyx56XTmHlxRdiOvn9PlTlOmB6e0bnhgV7YjYrjgI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] update Xen version to 4.21.3-pre
Message-Id: <E1wyU1x-00Av1t-33@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:44:01 +0000

commit 911331555d65abc2d42c4cf86965fc9447f04f4a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:49:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:49:53 2026 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index 1d7c07d1fb..bdf9a4f3a1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 21
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398817.1635020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2A-0007Cl-0q; Mon, 24 Aug 2026 12:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398817.1635020; Mon, 24 Aug 2026 12:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU29-0007Cd-UK; Mon, 24 Aug 2026 12:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1398817;
 Mon, 24 Aug 2026 12:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU28-0007CQ-5T
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU28-003G31-1H
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU28-00AwPY-0G
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AcWgCGd04FwEQL4UYw5mA2yMIdkG/rKoIa1YpLWgYJ4=; b=eCmtaXdur2vjPjBw23SFfMUc8j
	AK7K4HMxpoJ8pTIS7IkrquTjCq8BG9mOw24oDAz/t6CDjJC5wjmC0GxwQPzk+mHKndiATGiyPNm+D
	4WTRL9eTSeu+KQJRqmVps2DdDwOxo48l91fOuiwd8zimbKjLkIzChdop3thTJqhU1il8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
Message-Id: <E1wyU28-00AwPY-0G@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:44:12 +0000

commit 9dccd424b99dd09b457e0d739a26d4d699227b99
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Mon Aug 24 11:50:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:50:32 2026 +0200

    xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
    
    schedule_cpu_rm() clears the cpupool pointer of the scheduling
    resource before calling sched_deinit_pdata():
    
        sr->cpupool = NULL;
        ...
        sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);
    
    For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
    replenishment timer lives on the cpu being removed, and
    move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
    without checking it for NULL. Removing a pCPU owning the timer from
    an RTDS cpupool therefore dereferences NULL + 0x10 (the res_valid
    member) and panics:
    
        (XEN) Data Abort Trap. Syndrome=0x1c28005
        (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
        (XEN) Xen call trace:
        (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
        (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
        (XEN)
        (XEN) Panic on CPU 0:
        (XEN) CPU0: Unexpected Trap: Data Abort
    
    Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
    (observed on arm64, but the path is common code):
    
        xl cpupool-create name="test" sched="rtds"
        xl cpupool-cpu-remove Pool-0 1
        xl cpupool-cpu-add test 1
        xl cpupool-cpu-remove test 1
    
    The last command moves the RTDS replenishment timer to cpu1 (first
    and only cpu of the pool) and then removes cpu1, hitting the NULL
    dereference in the sched_deinit_pdata() callback.
    
    Use the cpupool back-pointer of the scheduler instead of the one of
    the scheduling resource. It is set by cpupool_create() before any
    pCPU can be assigned to the pool and stays valid for the whole
    lifetime of the scheduler, so it is still available when
    rt_deinit_pdata() runs. Other schedulers already rely on it the same
    way, e.g. credit2 in cpu_add_to_runqueue().
    
    Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: f294e3abe40cda37618d9fbad8cde86bbae0d1c6
    master date: 2026-07-21 09:47:36 +0200
---
 xen/common/sched/rt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 5c9c41e63b..a9141d22b4 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -750,10 +750,16 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     return &prv->lock;
 }
 
-static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
+static void move_repl_timer(const struct scheduler *ops, unsigned int old_cpu)
 {
-    cpumask_t *online = get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu = cpumask_cycle(old_cpu, online);
+    struct rt_private *prv = rt_priv(ops);
+    /*
+     * Use the cpupool of the scheduler: the one of the scheduling resource
+     * is already cleared when this is called from rt_deinit_pdata().
+     */
+    const struct cpupool *c = ops->cpupool;
+    unsigned int new_cpu = c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
 
     /*
      * Make sure the timer run on one of the cpus that are still available
@@ -780,7 +786,7 @@ rt_deinit_pdata(const struct scheduler *ops, void *pcpu, int cpu)
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( prv->repl_timer.cpu == cpu )
-        move_repl_timer(prv, cpu);
+        move_repl_timer(ops, cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
@@ -798,7 +804,7 @@ rt_move_timers(const struct scheduler *ops, struct sched_resource *sr)
     if ( prv->repl_timer.status != TIMER_STATUS_invalid &&
          prv->repl_timer.status != TIMER_STATUS_killed &&
          !cpumask_test_cpu(old_cpu, sr->cpupool->res_valid) )
-        move_repl_timer(prv, old_cpu);
+        move_repl_timer(ops, old_cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398818.1635023 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2K-0007Ev-20; Mon, 24 Aug 2026 12:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398818.1635023; Mon, 24 Aug 2026 12:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2J-0007En-Vk; Mon, 24 Aug 2026 12:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1398818;
 Mon, 24 Aug 2026 12:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU2I-0007Ef-9D
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2I-003G35-1e
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2I-00AxnB-0g
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+kJqTvsHXmeC+N0djL9M40gcUX22rWcVEQ7pR8c0+Ac=; b=cLh1VwnGydg+JYgz89Ib5iLvvr
	5x7pTNe9+4WRAJ8Xdg3UDkLEl5AOpYjup4KtRIbwURkQaXu8s7X5GyU5FHxM52ht+caOz59QuENIf
	dEEMz2KhTA2eUrw7Vdhdh37pqhpBGJvV6vDg38/X+UUhmh538N57g2lvd8E1GY1kuWXs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/credit: fix race with schedule_cpu_rm() in csched_timer()
Message-Id: <E1wyU2I-00AxnB-0g@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:44:22 +0000

commit 1129f837d07e5443b98f33aa5ab05b97cf8f1963
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:50:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:50:56 2026 +0200

    xen/credit: fix race with schedule_cpu_rm() in csched_timer()
    
    When removing a CPU from a cpupool running the credit scheduler, a
    race might happen between schedule_cpu_rm() and csched_timer(),
    resulting in a NULL dereference.
    
    The timer associated with csched_timer() is killed only in
    csched_deinit_pdata(), which is called by schedule_cpu_rm() after
    setting the scheduler's per-cpu data to NULL AND after enabling
    interrupts again. This can result in the timer firing before being
    killed, so csched_timer() needs to test the per-cpu data being set
    before accessing it.
    
    Fixes: 78be3dbbfefa ("cpupools [1/6]: hypervisor changes")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ea1d785a5f660ec52ec70454a0410c2f7fb2930a
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/credit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 6dcf6b2c8b..485e52bd7c 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1589,6 +1589,10 @@ static void cf_check csched_tick(void *_cpu)
     struct csched_pcpu *spc = CSCHED_PCPU(cpu);
     struct csched_private *prv = CSCHED_PRIV(sr->scheduler);
 
+    /* Handle race of timer disabling vs. firing when switching scheduler. */
+    if ( !spc )
+        return;
+
     spc->tick++;
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398819.1635028 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2U-0007IY-3Y; Mon, 24 Aug 2026 12:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398819.1635028; Mon, 24 Aug 2026 12:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2U-0007IP-0q; Mon, 24 Aug 2026 12:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1398819;
 Mon, 24 Aug 2026 12:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU2S-0007IF-Cs
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2S-003G3B-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2S-00Az65-12
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N2fYhTp4K7+4RJbrf3ItyI4IrrTjcjxalWwm6inrCfs=; b=w36WOIpRvxYA8iq9lxmcR274Ty
	/CO2M3eQWrEWRmGBGcVp9l7SwuQ/TI7L15V3tUgvLrsFbSZfF7Abx1lGvn4dnmZgA5ZeLU7hsiitt
	mP476rXplcOqZayYm52fHyXO5G9iaGF0pmrX9LErOEJs9w9pwL9sDWxpi23r1YySPxIE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/sched: fix schedule_dump() handling of free cpus
Message-Id: <E1wyU2S-00Az65-12@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:44:32 +0000

commit 6a78d0e734fc0d31550b4dee7c3e7d480092a559
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:51:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:51:12 2026 +0200

    xen/sched: fix schedule_dump() handling of free cpus
    
    With the introduction of core scheduling, cpus not used by any cpupool
    have been switched to use the very simple idle scheduler instead of the
    default scheduler.
    
    Trying to obtain diagnostic scheduling data via the "r" debug key is
    scanning through all cpupools using the per-cpupool scheduler to print
    the related data. Unfortunately the switch to use the idle scheduler
    for free cpus wasn't reflected in schedule_dump(), causing the default
    scheduler's dump_cpu_state callback to be used for free cpus.
    
    This causes NULL dereferences in case the default scheduler is one of
    credit or null.
    
    Fix that by using the idle scheduler instead of the default scheduler
    for free cpus. Note that it is fine for a scheduler to have no
    dump_cpu_state callback.
    
    Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 2488243c74..a374e59a84 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3432,7 +3432,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398820.1635032 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2e-0007KW-4u; Mon, 24 Aug 2026 12:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398820.1635032; Mon, 24 Aug 2026 12:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2e-0007KP-2A; Mon, 24 Aug 2026 12:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1398820;
 Mon, 24 Aug 2026 12:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU2c-0007KJ-Gc
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2c-003G3F-2O
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2c-00B0RY-1P
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M0vAUPa7zb4Gn3W2gux5EC7+87M0bZ9EAeGr+UxSOAM=; b=HUOgvrfE5ajOs1T0bvdS0+rTgT
	wj3IIsKT3OqI6RWdmrVJk0ivfo6YuJbZqyIZr5Q0rU48ytld535x97Bo/EoKCYjusmYcyeUeQMdsv
	t4c9XUgLz6cZj9P67DPSSAALQ2vb2bnG+GWtLjNCQ9RDmnhffp2v3XL1svhSMAqr8e/k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wyU2c-00B0RY-1P@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:44:42 +0000

commit fc203d45b67c9b68c764b5b65a0bc10ce6369e21
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:51:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:51:31 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
    master date: 2026-08-03 09:50:07 +0200
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:44:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398821.1635036 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2n-0007MU-6i; Mon, 24 Aug 2026 12:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398821.1635036; Mon, 24 Aug 2026 12:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2n-0007ML-3j; Mon, 24 Aug 2026 12:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1398821;
 Mon, 24 Aug 2026 12:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU2m-0007ME-LN
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2m-003G3P-2h
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2m-00B1rY-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QMEqdjR1YXIbvUzE/eDl+XX4IDiCs+AoXz2GtF8f8vk=; b=l/cLsP7WT50ves/hYe4ujhEb6S
	TwAtXuqj4ahg5pS+PAoqb6dyGlOIkuX73EhWd6l1R/NVB94cZlhwdapTgYsoQFIwmlJAiy/fI+a77
	ry59CrcxAYp1xAh5SRTlyhXEM+Ai2DV7Syusg+obl8TFy+j2ChUMvHk2vYZ1abGuKb48=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wyU2m-00B1rY-1l@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:44:52 +0000

commit cd91b44b57870de2b39714c47d0c492b74773c35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:51:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:51:45 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1077a93425d2dcca894883cf8565ee9ecf1672cc
    master date: 2026-08-05 12:00:17 +0200
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index ca610d36fc..bc1e8d0c04 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -80,7 +74,16 @@ static void radix_tree_node_free(struct radix_tree_node *node)
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -705,27 +708,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:45:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398822.1635040 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2x-0007OP-7k; Mon, 24 Aug 2026 12:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398822.1635040; Mon, 24 Aug 2026 12:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU2x-0007OH-56; Mon, 24 Aug 2026 12:45:03 +0000
Received: by outflank-mailman (input) for mailman id 1398822;
 Mon, 24 Aug 2026 12:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU2w-0007OB-OH
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2w-003G46-39
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU2w-00B3G9-29
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C0+5uaCCVbJo0a46nEVlL+rFiiFgb/AVvgydc3Bfk7M=; b=VXOwg4MmbwonpfiGNOmSfggH9B
	q4roN7zePJEccOl5stUcuTZmraIgszs5qqMaWuBVHw1C7wLrrso75cJOszN7HKAYty0dQFuRtE9Ob
	9QhZLWGhkNF5hwwOO+eA50Uj9JSPzvIOR4Jb6weNQvDxfjgK+6I7TddrlHcUy3A3NyhQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/nmi: Fix mis-classification of watchdog NMIs
Message-Id: <E1wyU2w-00B3G9-29@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:45:02 +0000

commit 21ef12591a8d513aed7cfdfe2aa927aaf76f69e8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:52:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:52:01 2026 +0200

    x86/nmi: Fix mis-classification of watchdog NMIs
    
    It used to be the case that cpu_data[] inherited the BSP's cpuid_level until
    the AP had calculated it itself.  Following the rework, cpuid_level has a
    placeholder 1 until it is calculated properly.
    
    setup_apic_nmi_watchdog() happens to be called on the BSP after SMP bring-up,
    meaning that the first call is on CPU1.  It is also positioned in the window
    where cpu_data[] is wrong.
    
    As a result, setup_p6_watchdog()'s one-time calculation of the performance
    counter width falls back into Pentium compatibility mode assuming 32bit
    counters.  This causes a watchdog NMI which is delayed a little (e.g. from an
    SMI), to appear as if it hadn't overflowed, and therefore be considered as not
    a watchdog NMI.  On systems where unknown NMIs are treated as fatal, this
    results in a spurious crash.
    
    Switch setup_p6_watchdog() to use boot_cpu_data.cpuid_level, which is how this
    is checked almost everywhere else.
    
    core2_vpmu_init() used the same pattern to look at leaf 0xa.  Despite being
    init code and only running on the BSP, {boot,current}_cpu_data are different
    objects, so switch it over to checking boot_cpu_data.cpuid_level too.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dc5a77c6c4951e8ad75c884b3b6b87a1ba46c488
    master date: 2026-08-17 18:46:08 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c | 2 +-
 xen/arch/x86/nmi.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 7ce98ee42e..c6644d0c42 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -902,7 +902,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     unsigned int version = 0;
     unsigned int i;
 
-    if ( current_cpu_data.cpuid_level >= 0xa )
+    if ( boot_cpu_data.cpuid_level >= 0xa )
         version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
 
     switch ( version )
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index a0c9194ff0..e3e653d345 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -319,7 +319,7 @@ static void setup_p6_watchdog(unsigned counter)
 {
     unsigned int evntsel;
 
-    if ( !nmi_p6_event_width && current_cpu_data.cpuid_level >= 0xa )
+    if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
         nmi_p6_event_width = P6_EVENT_WIDTH_MIN;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:45:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398823.1635043 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU37-0007Qs-AI; Mon, 24 Aug 2026 12:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398823.1635043; Mon, 24 Aug 2026 12:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU37-0007Qk-7g; Mon, 24 Aug 2026 12:45:13 +0000
Received: by outflank-mailman (input) for mailman id 1398823;
 Mon, 24 Aug 2026 12:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU36-0007Qe-Rs
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU37-003G4O-0H
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU36-00B4dZ-2Y
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XE36h/KXNJKcwq7FS9LvQtp+geT+VmJD7Gd2ZltOL14=; b=s9LZ3Jiyl9eTNHsUdvuWpGLkhT
	wRCroLs86cVOGW+M93uL/Q8dm1kAY9p7Yo0HhFnQfUFE5DjM/Uzd7bw5rfyp9hkw88PmVregZL+DY
	XkgOSwHOWKMdm0ez1P2PrN0Wv04tE5wSX3iEGefbm4Yl4F8q0XZ85GgUBkpJMw3On8ME=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wyU36-00B4dZ-2Y@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:45:12 +0000

commit 1cefa774195b99032c7d086437634304bfd13dd5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:52:15 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:52:15 2026 +0200

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dfb428cb1142a5a468531410e0461fb2a9f2a4ea
    master date: 2026-08-18 12:51:08 +0100
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index e3e653d345..12bea11e8b 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -345,14 +345,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -384,6 +378,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -394,6 +390,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        misc = rdmsr(MSR_IA32_MISC_ENABLE);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch (boot_cpu_data.x86) {
         case 6:
             setup_p6_watchdog((boot_cpu_data.x86_model < 14) 
@@ -401,7 +405,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398824.1635047 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3I-0007TD-Bt; Mon, 24 Aug 2026 12:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398824.1635047; Mon, 24 Aug 2026 12:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3I-0007T4-97; Mon, 24 Aug 2026 12:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1398824;
 Mon, 24 Aug 2026 12:45:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU3H-0007Sx-FV
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:45:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3H-003G4V-2I
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3H-00B5zJ-1H
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=W3Jyr74h/Y9bE1mNjSk9wBkXBRD0DyCnZQr/AjSbvUQ=; b=up+zKNArM98BcfrGVNSOak07sC
	IKqqLgXAuE1P4+V5HqdGl2KSs7bqKSDr1s5R6bY2aNOEcj8mmD2ZxWVPMCITutqvo30R6CCb2Dgfe
	ZCnKHkjEAAP0ytbvv4h2Ly7qmvqzv3N0OX3w+eWCr0CZ0uKYdYYt7APFNjBHJlK/TeDk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] update Xen version to 4.20.5-pre
Message-Id: <E1wyU3H-00B5zJ-1H@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:45:23 +0000

commit 2862edcacdbdc1cfa2f34c4fa324e065af2082b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:53:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:53:22 2026 +0200

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

diff --git a/xen/Makefile b/xen/Makefile
index d9df42b1bb..acbc8a4974 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,7 +6,7 @@ this-makefile := $(call lastword,$(MAKEFILE_LIST))
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 20
-export XEN_EXTRAVERSION ?= .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.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:45:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398826.1635061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3S-0007ju-Kb; Mon, 24 Aug 2026 12:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398826.1635061; Mon, 24 Aug 2026 12:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3S-0007jk-HZ; Mon, 24 Aug 2026 12:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1398826;
 Mon, 24 Aug 2026 12:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU3R-0007j5-JB
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:45:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3R-003G4h-2e
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3R-00B7KM-1h
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TSCdORydmMshXitzePG04gdLTHXe8YXoV9LEXDLHol0=; b=HmyfBvMnQTB+/psBwF76A8HXTB
	D6xbZJKwCn1GGu45Ripdz6MS/cBbYO255p2Bj+wUSeZpf/LHMh7dEYkRODaPOPjSYiMnryZJgHPVS
	gxGxumUDlHyNmNGocPSNCcCsobz/xXzokcgS7PvyLHgJRi4xkVvWzDuz63Dfqgh1ezTc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
Message-Id: <E1wyU3R-00B7KM-1h@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:45:33 +0000

commit 934897ea5e8ead513f8b31d3588e43de76b66092
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Mon Aug 24 11:53:49 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:53:49 2026 +0200

    xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
    
    schedule_cpu_rm() clears the cpupool pointer of the scheduling
    resource before calling sched_deinit_pdata():
    
        sr->cpupool = NULL;
        ...
        sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);
    
    For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
    replenishment timer lives on the cpu being removed, and
    move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
    without checking it for NULL. Removing a pCPU owning the timer from
    an RTDS cpupool therefore dereferences NULL + 0x10 (the res_valid
    member) and panics:
    
        (XEN) Data Abort Trap. Syndrome=0x1c28005
        (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
        (XEN) Xen call trace:
        (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
        (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
        (XEN)
        (XEN) Panic on CPU 0:
        (XEN) CPU0: Unexpected Trap: Data Abort
    
    Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
    (observed on arm64, but the path is common code):
    
        xl cpupool-create name="test" sched="rtds"
        xl cpupool-cpu-remove Pool-0 1
        xl cpupool-cpu-add test 1
        xl cpupool-cpu-remove test 1
    
    The last command moves the RTDS replenishment timer to cpu1 (first
    and only cpu of the pool) and then removes cpu1, hitting the NULL
    dereference in the sched_deinit_pdata() callback.
    
    Use the cpupool back-pointer of the scheduler instead of the one of
    the scheduling resource. It is set by cpupool_create() before any
    pCPU can be assigned to the pool and stays valid for the whole
    lifetime of the scheduler, so it is still available when
    rt_deinit_pdata() runs. Other schedulers already rely on it the same
    way, e.g. credit2 in cpu_add_to_runqueue().
    
    Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: f294e3abe40cda37618d9fbad8cde86bbae0d1c6
    master date: 2026-07-21 09:47:36 +0200
---
 xen/common/sched/rt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 102225e606..a938a6146d 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -750,10 +750,16 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     return &prv->lock;
 }
 
-static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
+static void move_repl_timer(const struct scheduler *ops, unsigned int old_cpu)
 {
-    cpumask_t *online = get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu = cpumask_cycle(old_cpu, online);
+    struct rt_private *prv = rt_priv(ops);
+    /*
+     * Use the cpupool of the scheduler: the one of the scheduling resource
+     * is already cleared when this is called from rt_deinit_pdata().
+     */
+    const struct cpupool *c = ops->cpupool;
+    unsigned int new_cpu = c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
 
     /*
      * Make sure the timer run on one of the cpus that are still available
@@ -780,7 +786,7 @@ rt_deinit_pdata(const struct scheduler *ops, void *pcpu, int cpu)
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( prv->repl_timer.cpu == cpu )
-        move_repl_timer(prv, cpu);
+        move_repl_timer(ops, cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
@@ -798,7 +804,7 @@ rt_move_timers(const struct scheduler *ops, struct sched_resource *sr)
     if ( prv->repl_timer.status != TIMER_STATUS_invalid &&
          prv->repl_timer.status != TIMER_STATUS_killed &&
          !cpumask_test_cpu(old_cpu, sr->cpupool->res_valid) )
-        move_repl_timer(prv, old_cpu);
+        move_repl_timer(ops, old_cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:45:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398828.1635064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3c-0007oI-Lz; Mon, 24 Aug 2026 12:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398828.1635064; Mon, 24 Aug 2026 12:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3c-0007oA-Is; Mon, 24 Aug 2026 12:45:44 +0000
Received: by outflank-mailman (input) for mailman id 1398828;
 Mon, 24 Aug 2026 12:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU3b-0007nr-Mb
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3b-003G4n-2z
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3b-00B8hS-22
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PsYxqe8FeOg8ktTqbNl1CthqlfWJ1/J2OSSZcXe8+RQ=; b=AHsQtxUb00t6wUnUkB1EkpOoys
	qEXliuvrAzQnZ8JNZy/A31Az8yyI3QfNSzy7hCbfu9d+hea1QbfWUUHjkdcD3yRTwhBDUneqVNTqs
	gNhSqKckakCCopCh65m+UufUo49uL2IvaILsGvaLttMsufasVYpVOwXgYGc4f1Inir1g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/credit: fix race with schedule_cpu_rm() in csched_timer()
Message-Id: <E1wyU3b-00B8hS-22@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:45:43 +0000

commit da5a2144bbc1f26103bf2eb3bda8cf095acd9cb4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:54:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:05 2026 +0200

    xen/credit: fix race with schedule_cpu_rm() in csched_timer()
    
    When removing a CPU from a cpupool running the credit scheduler, a
    race might happen between schedule_cpu_rm() and csched_timer(),
    resulting in a NULL dereference.
    
    The timer associated with csched_timer() is killed only in
    csched_deinit_pdata(), which is called by schedule_cpu_rm() after
    setting the scheduler's per-cpu data to NULL AND after enabling
    interrupts again. This can result in the timer firing before being
    killed, so csched_timer() needs to test the per-cpu data being set
    before accessing it.
    
    Fixes: 78be3dbbfefa ("cpupools [1/6]: hypervisor changes")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ea1d785a5f660ec52ec70454a0410c2f7fb2930a
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/credit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index a6bb321e7d..2adab171a2 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1587,6 +1587,10 @@ static void cf_check csched_tick(void *_cpu)
     struct csched_pcpu *spc = CSCHED_PCPU(cpu);
     struct csched_private *prv = CSCHED_PRIV(sr->scheduler);
 
+    /* Handle race of timer disabling vs. firing when switching scheduler. */
+    if ( !spc )
+        return;
+
     spc->tick++;
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:45:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398830.1635068 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3m-0007w7-Mj; Mon, 24 Aug 2026 12:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398830.1635068; Mon, 24 Aug 2026 12:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3m-0007vz-KE; Mon, 24 Aug 2026 12:45:54 +0000
Received: by outflank-mailman (input) for mailman id 1398830;
 Mon, 24 Aug 2026 12:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU3l-0007vn-Q1
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3m-003G4r-06
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3l-00BA2P-2M
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:45:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GLa0RzY7IhNkEVxjJ2H9nLkXK9dngQlbBflpII1oT2I=; b=uC/oGWnEnnEfYOkeJdosFER/YH
	BZYy8W2ncv9I4LaK+uOcz4ZRaZNl4Yi2CkEwu7Xyr+2vxl0DaUB0EnW2aMf7fiVxlYr2qCoCXeS49
	t71J/m/Z7m5Nud2Q4mxxsbHFXOd8eeOGSJLG4vO+264BtJkggAdrIGjJarFBh7Y/TG8A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/sched: fix schedule_dump() handling of free cpus
Message-Id: <E1wyU3l-00BA2P-2M@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:45:53 +0000

commit ee3befc2cdaad0d35992c3b157383b17b5e7b9d2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:54:22 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:22 2026 +0200

    xen/sched: fix schedule_dump() handling of free cpus
    
    With the introduction of core scheduling, cpus not used by any cpupool
    have been switched to use the very simple idle scheduler instead of the
    default scheduler.
    
    Trying to obtain diagnostic scheduling data via the "r" debug key is
    scanning through all cpupools using the per-cpupool scheduler to print
    the related data. Unfortunately the switch to use the idle scheduler
    for free cpus wasn't reflected in schedule_dump(), causing the default
    scheduler's dump_cpu_state callback to be used for free cpus.
    
    This causes NULL dereferences in case the default scheduler is one of
    credit or null.
    
    Fix that by using the idle scheduler instead of the default scheduler
    for free cpus. Note that it is fine for a scheduler to have no
    dump_cpu_state callback.
    
    Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 2e97a5494c..e1fea666f4 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3412,7 +3412,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:46:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398833.1635073 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3w-000812-OH; Mon, 24 Aug 2026 12:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398833.1635073; Mon, 24 Aug 2026 12:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU3w-00080u-LW; Mon, 24 Aug 2026 12:46:04 +0000
Received: by outflank-mailman (input) for mailman id 1398833;
 Mon, 24 Aug 2026 12:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyU3v-00080o-So
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3w-003G5T-0O
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU3v-00BBRH-2g
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:46:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x8F0I0uEkkiPaYJQ0zUv/H/4wQbhvYvYnAuK44NJ9Qs=; b=EgC3IJESFoTyeXSKgmiwYYniDk
	LInSAbb4rN8bS5/jedFhRk3k4KVaMh3/FfbIwSUkIbLTDKQu7EakBZvH16ywYPsaF9MGd45RFqGZs
	24ibfcQvAidHb5O5qZv7nOYIJCJWLd863Jzxy3yVwQ9SurgUWJwFrA71qJ491/ed4XFE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wyU3v-00BBRH-2g@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:46:03 +0000

commit d3eddf948fb8ae616c08056c16893ad9cc1885de
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:54:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:36 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
    master date: 2026-08-03 09:50:07 +0200
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:46:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398834.1635076 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU46-00083I-Q1; Mon, 24 Aug 2026 12:46:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398834.1635076; Mon, 24 Aug 2026 12:46:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU46-00083A-Mw; Mon, 24 Aug 2026 12:46:14 +0000
Received: by outflank-mailman (input) for mailman id 1398834;
 Mon, 24 Aug 2026 12:46: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 1wyU45-000832-WA
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU46-003G5X-0j
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU45-00BCmt-32
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rnm5t339jxlKs9AAL/ZCESHqbvntFsDdLtJIQbFgcDk=; b=50qPef9ysy+cSqz9mgBeWi4tRx
	TzI7voeL5S/1QXZSN3o6O4Q3ztEH82XY+Zc/nHF7UuVbv5F6mk4axLG/Dcawx+9WodB9DDZ5+jmhC
	MDJRG/pmj3Q3Jfmpy+m+DWtWz5om7FS4wZEsVUPR7gJibSGw1dUcx1vsKCEBmBqMDT2w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wyU45-00BCmt-32@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:46:13 +0000

commit 88c2d7324b26d979d85c102ef25afa7d77a82ff1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:54:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:54:59 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1077a93425d2dcca894883cf8565ee9ecf1672cc
    master date: 2026-08-05 12:00:17 +0200
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index a623a9ff66..490e73c13e 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -82,7 +76,16 @@ static void radix_tree_node_free(
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -707,27 +710,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 12:46:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 12:46:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398835.1635082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU4G-00086P-SZ; Mon, 24 Aug 2026 12:46:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398835.1635082; Mon, 24 Aug 2026 12:46:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyU4G-00086D-Pc; Mon, 24 Aug 2026 12:46:24 +0000
Received: by outflank-mailman (input) for mailman id 1398835;
 Mon, 24 Aug 2026 12:46: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 1wyU4G-000865-3v
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 12:46: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 1wyU4G-003G5d-18
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:46:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyU4G-00BEB6-08
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 12:46: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=SbnRxRoI1pLLjTjSDvGRxXGJfRGR1JOehyaT8RaPfoE=; b=3k54zyVaju/TgWwZfmVQrJvwFo
	fA7Aq2FgR0rkZZ4uCVBQtSLFQfUWSluKqciKZkfUO/JyVdvstPW+kwsSA1qIninclEH7QqdWtOgyP
	ZxIM1aATk3ZI5M7q4DDhc5ihqLM6Yx5XBGG6OBCCZ3n4mm6kCofHWKCOS1+FYVsF9sHk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wyU4G-00BEB6-08@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 12:46:24 +0000

commit 7b7f5be456027e4273165f577a1bbfd5ee95503a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:55:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:55:13 2026 +0200

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dfb428cb1142a5a468531410e0461fb2a9f2a4ea
    master date: 2026-08-18 12:51:08 +0100
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 9793fa2316..12e31c2005 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -345,14 +345,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsr(MSR_P6_EVNTSEL(0), evntsel, 0);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -384,6 +378,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -394,6 +390,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        rdmsrl(MSR_IA32_MISC_ENABLE, misc);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch (boot_cpu_data.x86) {
         case 6:
             setup_p6_watchdog((boot_cpu_data.x86_model < 14) 
@@ -401,7 +405,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:55:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398917.1635166 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX0q-0003uh-96; Mon, 24 Aug 2026 15:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398917.1635166; Mon, 24 Aug 2026 15: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 1wyX0q-0003uZ-6X; Mon, 24 Aug 2026 15:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1398917;
 Mon, 24 Aug 2026 15:55: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 1wyX0p-0003uT-Lh
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:55: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 1wyX0p-003Jo5-1s
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX0p-000XJU-0g
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55: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=jKVaTHT91hsBCTU+THkB7kefAaJX1uhbAVQNRtJ6MyE=; b=4geoVzJPChCs2dK1xLh/5OCCn7
	slIRSczUE2MxVv8m5r1g/dIAshNinRVr1duEP+dLTsK6USHlFj2Jh8CnTfII9XB86tut1ihEUCJkt
	54j5BLuneVsNstY0oHg2uLN53ykx0Hi9ZLQX1gE/a6ok+ONML2LR1eW+8AWmwuTERcIA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] update Xen version to 4.22.1-pre
Message-Id: <E1wyX0p-000XJU-0g@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:55:03 +0000

commit 34a4bac0177f17fe96997efa7132ff00e319825a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:45:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:45:07 2026 +0200

    update Xen version to 4.22.1-pre
---
 MAINTAINERS  | 106 +++++------------------------------------------------------
 xen/Makefile |   2 +-
 2 files changed, 10 insertions(+), 98 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 81bd0dfeec..e61f0ee659 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -54,6 +54,15 @@ list. Remember to copy the appropriate stable branch maintainer who
 will be listed in this section of the MAINTAINERS file in the
 appropriate branch.
 
+The maintainer for this branch is:
+
+	Jan Beulich <jbeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+       Anthony Perard <anthony.perard@vates.tech>
+
+
 	Unstable Subsystem Maintainers
 	==============================
 
@@ -104,103 +113,6 @@ Descriptions of section entries:
 	   xen-maintainers-<version format number of this file>
 
 
-	Check-in policy
-	===============
-
-In order for a patch to be checked in, in general, several conditions
-must be met:
-
-1. In order to get a change to a given file committed, it must have
-   the approval of at least one maintainer of that file.
-
-   A patch of course needs Acks from the maintainers of each file that
-   it changes; so a patch which changes xen/arch/x86/traps.c,
-   xen/arch/x86/mm/p2m.c, and xen/arch/x86/mm/shadow/multi.c would
-   require an Ack from each of the three sets of maintainers.
-
-   See below for rules on nested maintainership.
-
-2. Each change must have appropriate approval from someone other than
-   the person who wrote it.  This can be either:
-
-  a. An Acked-by from a maintainer of the code being touched (a
-     co-maintainer if available, or a more general level maintainer if
-     not available; see the secton on nested maintainership)
-
-  b. A Reviewed-by by anyone of suitable stature in the community
-
-3. Sufficient time must have been given for anyone to respond.  This
-   depends in large part upon the urgency and nature of the patch.
-   For a straightforward uncontroversial patch, a day or two may be
-   sufficient; for a controversial patch, a week or two may be better.
-
-4. There must be no "open" objections.
-
-In a case where one person submits a patch and a maintainer gives an
-Ack, the Ack stands in for both the approval requirement (#1) and the
-Acked-by-non-submitter requirement (#2).
-
-In a case where a maintainer themselves submits a patch, the
-Signed-off-by meets the approval requirement (#1); so a Review
-from anyone in the community suffices for requirement #2.
-
-Before a maintainer checks in their own patch with another community
-member's R-b but no co-maintainer Ack, it is especially important to
-give their co-maintainer opportunity to give feedback, perhaps
-declaring their intention to check it in without their co-maintainers
-ack a day before doing so.
-
-In the case where two people collaborate on a patch, at least one of
-whom is a maintainer -- typically where one maintainer will do an
-early version of the patch, and another maintainer will pick it up and
-revise it -- there should be two Signed-off-by's and one Acked-by or
-Reviewed-by; with the maintainer who did the most recent change
-sending the patch, and an Acked-by or Reviewed-by coming from the
-maintainer who did not most recently edit the patch.  This satisfies
-the requirement #2 because a) the Signed-off-by of the sender approves
-the final version of the patch; including all parts of the patch that
-the sender did not write b) the Reviewed-by approves the final version
-of the patch, including all patches that the reviewer did not write.
-Thus all code in the patch has been approved by someone who did not
-write it.
-
-Maintainers may choose to override non-maintainer objections in the
-case that consensus can't be reached.
-
-As always, no policy can cover all possible situations.  In
-exceptional circumstances, committers may commit a patch in absence of
-one or more of the above requirements, if they are reasonably
-confident that the other maintainers will approve of their decision in
-retrospect.
-
-       The meaning of nesting
-       ======================
-
-Many maintainership areas are "nested": for example, there are entries
-for xen/arch/x86 as well as xen/arch/x86/mm, and even
-xen/arch/x86/mm/shadow; and there is a section at the end called "THE
-REST" which lists all committers.  The meaning of nesting is that:
-
-1. Under normal circumstances, the Ack of the most specific maintainer
-is both necessary and sufficient to get a change to a given file
-committed.  So a change to xen/arch/x86/mm/shadow/multi.c requires the
-the Ack of the xen/arch/x86/mm/shadow maintainer for that part of the
-patch, but would not require the Ack of the xen/arch/x86 maintainer or
-the xen/arch/x86/mm maintainer.
-
-2. In unusual circumstances, a more general maintainer's Ack can stand
-in for or even overrule a specific maintainer's Ack.  Unusual
-circumstances might include:
- - The patch is fixing a high-priority issue causing immediate pain,
- and the more specific maintainer is not available.
- - The more specific maintainer has not responded either to the
- original patch, nor to "pings", within a reasonable amount of time.
- - The more general maintainer wants to overrule the more specific
- maintainer on some issue. (This should be exceptional.)
- - In the case of a disagreement between maintainers, THE REST can
- settle the matter by majority vote.  (This should be very exceptional
- indeed.)
-
 
 Maintainers List (try to look for most precise areas first)
 
diff --git a/xen/Makefile b/xen/Makefile
index 725f220ee6..7ab965c401 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    = 22
-export XEN_EXTRAVERSION ?= .0$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398918.1635170 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX10-0003wT-AO; Mon, 24 Aug 2026 15:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398918.1635170; Mon, 24 Aug 2026 15: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 1wyX10-0003wL-7t; Mon, 24 Aug 2026 15:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1398918;
 Mon, 24 Aug 2026 15:55: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 1wyX0z-0003wD-Hw
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:55: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 1wyX0z-003JoR-2W
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX0z-000Yrw-1U
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=07CCTCEdfRlV4GYwogMUycVhu7jdJO/8ykmVpejWopI=; b=1rXBWTWRIXNMc1+n/z/rXUjSFA
	Nwy57wpxTI1MZWm/ewooFeZpF5CppQAxFACRdMX6iCnToGGc20E9tiq2V/Z+hUQ3JATCi6mm/hjvg
	ogdds6aDiX1F4Yl/TLqXVQFqnSPS9YOPsxDr/1fUZi0IKBU7+HyJ2Hn9jz1XrzUx3USc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] nestedsvm: Allow destroying the domain fully
Message-Id: <E1wyX0z-000Yrw-1U@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:55:13 +0000

commit 76bc053ba179ca8606127cebf153efe6a4fec679
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Aug 24 11:46:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:46:08 2026 +0200

    nestedsvm: Allow destroying the domain fully
    
    Unmapping the virtual VMCB is performed near the end of the domain
    destroy procedure but the mapped guest frame prevents domain destroy
    from getting to that point. This means guests that call VMRUN cannot
    be fully destroyed.
    
    Move the unmap of the virtual VMCB earlier to fix the issue.
    
    Fixes: bcf557675d85 ("x86: properly use map_domain_page() in nested HVM code")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4d069a84ee0e29b182482b3ae04b243d2ef25ed4
    master date: 2026-06-30 09:41:35 +0200
---
 xen/arch/x86/hvm/svm/nestedhvm.h |  1 +
 xen/arch/x86/hvm/svm/nestedsvm.c | 15 +++++++++++++--
 xen/arch/x86/hvm/svm/svm.c       |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedhvm.h b/xen/arch/x86/hvm/svm/nestedhvm.h
index 9bfed5ffd7..9bb04a0434 100644
--- a/xen/arch/x86/hvm/svm/nestedhvm.h
+++ b/xen/arch/x86/hvm/svm/nestedhvm.h
@@ -48,6 +48,7 @@ bool cf_check nsvm_vmcb_guest_intercepts_event(
     struct vcpu *v, unsigned int vector, int errcode);
 bool cf_check nsvm_vmcb_hap_enabled(struct vcpu *v);
 enum hvm_intblk cf_check nsvm_intr_blocked(struct vcpu *v);
+void cf_check nsvm_domain_relinquish_resources(struct domain *d);
 
 /* Interrupts, vGIF */
 void svm_vmexit_do_clgi(struct cpu_user_regs *regs, struct vcpu *v);
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 9899cb2147..b06124c2c9 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -110,8 +110,6 @@ void cf_check nsvm_vcpu_destroy(struct vcpu *v)
         svm->ns_merged_msrpm = NULL;
     }
 
-    hvm_unmap_guest_frame(nv->nv_vvmcx, 1);
-    nv->nv_vvmcx = NULL;
     if ( nv->nv_n2vmcx )
     {
         free_vmcb(nv->nv_n2vmcx);
@@ -122,6 +120,19 @@ void cf_check nsvm_vcpu_destroy(struct vcpu *v)
     svm->ns_iomap = NULL;
 }
 
+void cf_check nsvm_domain_relinquish_resources(struct domain *d)
+{
+    struct vcpu *v;
+    struct nestedvcpu *nv;
+
+    for_each_vcpu ( d, v )
+    {
+        nv = &vcpu_nestedhvm(v);
+        hvm_unmap_guest_frame(nv->nv_vvmcx, 1);
+        nv->nv_vvmcx = NULL;
+    }
+}
+
 int cf_check nsvm_vcpu_reset(struct vcpu *v)
 {
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 49fcdd906c..38c61db1d7 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2420,6 +2420,7 @@ static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
     .nhvm_vmcx_hap_enabled = nsvm_vmcb_hap_enabled,
     .nhvm_intr_blocked = nsvm_intr_blocked,
     .nhvm_hap_walk_L1_p2m = nsvm_hap_walk_L1_p2m,
+    .nhvm_domain_relinquish_resources = nsvm_domain_relinquish_resources,
 
     .get_reg = svm_get_reg,
     .set_reg = svm_set_reg,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398919.1635173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1A-0003yi-Bs; Mon, 24 Aug 2026 15:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398919.1635173; Mon, 24 Aug 2026 15: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 1wyX1A-0003ya-9P; Mon, 24 Aug 2026 15:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1398919;
 Mon, 24 Aug 2026 15:55: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 1wyX19-0003yU-Lh
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:55: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 1wyX19-003JoY-2s
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX19-000a8d-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mklJKDo5Y4/6Fz/6kPxteSH+dB4+nneZoyG4w11nUyI=; b=nNVWiLHto4afRtd6giJWMfmMhZ
	1rQZJjssH4PZ+dyLh11iqsTevtoVLv243IEni0Ld7kk8edO2Gbk2UjKvEcqxJhw3Fm4VNFSGH2ZCm
	VgQBzGKQg+jTJt6IKSMbXg6iipo5u4wfisFwyT4fALV/DE8/RYVvpPcjv1rkhSNBeflA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] x86/emul: Adjust handling of CR8_LEGACY
Message-Id: <E1wyX19-000a8d-1t@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:55:23 +0000

commit 739dd1b8242c008e5c82cf17b11701312cd89755
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:46:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:46:32 2026 +0200

    x86/emul: Adjust handling of CR8_LEGACY
    
    The APM description of the AltMovCR8 feature bit is:
    
      "LOCK MOV CR0 means MOV CR8"
    
    Adjust the decode logic to behave like this.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    master commit: 7d48ef45b6df0cf8985b84305e02b7440de8f50f
    master date: 2026-07-10 19:35:49 +0100
---
 xen/arch/x86/x86_emulate/decode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 2c13356c4d..57f6baffb0 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
         break;
 
     case 0x20: case 0x22: /* mov to/from cr */
-        if ( s->lock_prefix && vcpu_has_cr8_legacy() )
+        if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg == 0 )
         {
-            s->modrm_reg += 8;
+            s->modrm_reg = 8;
             s->lock_prefix = false;
         }
-        /* fall through */
+        fallthrough;
     case 0x21: case 0x23: /* mov to/from dr */
         ASSERT(s->ea.type == OP_REG); /* Early operand adjustment ensures this. */
         generate_exception_if(s->lock_prefix, X86_EXC_UD);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:55:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:55:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398920.1635177 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1L-00040l-DH; Mon, 24 Aug 2026 15:55:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398920.1635177; Mon, 24 Aug 2026 15:55: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 1wyX1L-00040d-Aj; Mon, 24 Aug 2026 15:55:35 +0000
Received: by outflank-mailman (input) for mailman id 1398920;
 Mon, 24 Aug 2026 15:55: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 1wyX1J-00040V-R8
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:55: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 1wyX1K-003Joe-09
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX1J-000bFQ-2J
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4yICTn4k8flfEOdc9dgKEXdMrnZEUfcekZVrx8gjZXI=; b=ceRUhnU909x/b3NQW4WnB3WSOt
	s0RCwpShVnE1v8FwQAAE5bzOAikmPQcNCs6TyVPAxqvtHfKydpHBZYbdFTW87IbzYFPzJmTmNRGWI
	91XT37cTGiIJcaDRKxljGQOefeloNX0mWGNFbbBJqbdZK/hil98YK3UF3e2yx8YeFm0s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger assertion
Message-Id: <E1wyX1J-000bFQ-2J@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:55:33 +0000

commit c7c6381e7e26bb940b6e3e3b0c4bb88c15aa6e95
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:46:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:46:53 2026 +0200

    x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger assertion
    
    AFL has pointed out that the op_bytes-is-not-0 assertion in common SIMD
    handling can trigger for these insns. Indeed when the (relevant part of)
    the controlling mask register is 0, no memory is accessed at all. Leave
    op_bytes unaltered in this case, to engage the short-circuiting in common
    SIMD handling when fault_suppression is true and op_bytes is 0.
    
    While there also correct a related typo in the test harness.
    
    Fixes: 65f82d4ce1ea ("x86emul: support AVX512{F,_VBMI2} compress/expand insns")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cf90c8a48af2694d0653f754996a41672a153de4
    master date: 2026-07-20 09:50:00 +0200
---
 tools/tests/x86_emulator/predicates.c  | 2 +-
 xen/arch/x86/x86_emulate/x86_emulate.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index 8ff2653895..84717d3ebe 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -1946,7 +1946,7 @@ static const struct evex {
     { { 0x83 }, 2, T, R, pfx_66, W1, Ln }, /* vpmultishiftqb */
     { { 0x88 }, 2, T, R, pfx_66, Wn, Ln }, /* vpexpandp{s,d} */
     { { 0x89 }, 2, T, R, pfx_66, Wn, Ln }, /* vpexpand{d,q} */
-    { { 0x8a }, 2, T, W, pfx_66, Wn, Ln }, /* vpcompressp{s,d} */
+    { { 0x8a }, 2, T, W, pfx_66, Wn, Ln }, /* vcompressp{s,d} */
     { { 0x8b }, 2, T, W, pfx_66, Wn, Ln }, /* vpcompress{d,q} */
     { { 0x8d }, 2, F, R, pfx_66, Wn, Ln }, /* vperm{b,w} */
     { { 0x8f }, 2, F, R, pfx_66, W0, Ln }, /* vpshufbitqmb */
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 364e6c092d..bc51283854 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6186,9 +6186,11 @@ x86_emulate(
             ASSERT(op_bytes == n * elem_bytes);
             op_mask &= ~0ULL >> (64 - n);
             n = hweight64(op_mask);
-            op_bytes = n * elem_bytes;
             if ( n )
+            {
+                op_bytes = n * elem_bytes;
                 op_mask = ~0ULL >> (64 - n);
+            }
         }
         goto simd_zmm;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:55:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:55:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398921.1635181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1V-00042e-EU; Mon, 24 Aug 2026 15:55:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398921.1635181; Mon, 24 Aug 2026 15:55:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1V-00042W-C1; Mon, 24 Aug 2026 15:55:45 +0000
Received: by outflank-mailman (input) for mailman id 1398921;
 Mon, 24 Aug 2026 15:55: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 1wyX1U-00042Q-Bl
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:55: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 1wyX1U-003Joi-1r
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX1U-000cSK-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55: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=7no1buQhcJbs6DmySrIGfRLsbwHA5PAMTjKqlWfh57A=; b=29o+5lEBrGLbKsigU4GAkxiA2P
	8kbZwRQyes+v5RtLSg02eXtBtrQcJrVZSI54QOc4+0v135q1xNJo5znFBSxG7zDQyc94RlbwTBXwG
	yYuQCcrS/SwQ6094Hosq5jGitaS+7NIa/wv6aySOkZsEFg3T2rcUpSw2M13OaYQEE31w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
Message-Id: <E1wyX1U-000cSK-0t@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:55:44 +0000

commit 75c4992c384f001b42717098375541aead66795e
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Mon Aug 24 11:47:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:47:12 2026 +0200

    xen/sched: rt: fix NULL cpupool dereference in move_repl_timer()
    
    schedule_cpu_rm() clears the cpupool pointer of the scheduling
    resource before calling sched_deinit_pdata():
    
        sr->cpupool = NULL;
        ...
        sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);
    
    For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
    replenishment timer lives on the cpu being removed, and
    move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
    without checking it for NULL. Removing a pCPU owning the timer from
    an RTDS cpupool therefore dereferences NULL + 0x10 (the res_valid
    member) and panics:
    
        (XEN) Data Abort Trap. Syndrome=0x1c28005
        (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
        (XEN) Xen call trace:
        (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
        (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
        (XEN)
        (XEN) Panic on CPU 0:
        (XEN) CPU0: Unexpected Trap: Data Abort
    
    Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
    (observed on arm64, but the path is common code):
    
        xl cpupool-create name="test" sched="rtds"
        xl cpupool-cpu-remove Pool-0 1
        xl cpupool-cpu-add test 1
        xl cpupool-cpu-remove test 1
    
    The last command moves the RTDS replenishment timer to cpu1 (first
    and only cpu of the pool) and then removes cpu1, hitting the NULL
    dereference in the sched_deinit_pdata() callback.
    
    Use the cpupool back-pointer of the scheduler instead of the one of
    the scheduling resource. It is set by cpupool_create() before any
    pCPU can be assigned to the pool and stays valid for the whole
    lifetime of the scheduler, so it is still available when
    rt_deinit_pdata() runs. Other schedulers already rely on it the same
    way, e.g. credit2 in cpu_add_to_runqueue().
    
    Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    master commit: f294e3abe40cda37618d9fbad8cde86bbae0d1c6
    master date: 2026-07-21 09:47:36 +0200
---
 xen/common/sched/rt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 0fe045e591..1fccbf94d9 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -763,10 +763,16 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     return &prv->lock;
 }
 
-static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
+static void move_repl_timer(const struct scheduler *ops, unsigned int old_cpu)
 {
-    cpumask_t *online = get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu = cpumask_cycle(old_cpu, online);
+    struct rt_private *prv = rt_priv(ops);
+    /*
+     * Use the cpupool of the scheduler: the one of the scheduling resource
+     * is already cleared when this is called from rt_deinit_pdata().
+     */
+    const struct cpupool *c = ops->cpupool;
+    unsigned int new_cpu = c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
 
     /*
      * Make sure the timer run on one of the cpus that are still available
@@ -793,7 +799,7 @@ rt_deinit_pdata(const struct scheduler *ops, void *pcpu, int cpu)
     spin_lock_irqsave(&prv->lock, flags);
 
     if ( prv->repl_timer.cpu == cpu )
-        move_repl_timer(prv, cpu);
+        move_repl_timer(ops, cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
@@ -811,7 +817,7 @@ rt_move_timers(const struct scheduler *ops, struct sched_resource *sr)
     if ( prv->repl_timer.status != TIMER_STATUS_invalid &&
          prv->repl_timer.status != TIMER_STATUS_killed &&
          !cpumask_test_cpu(old_cpu, sr->cpupool->res_valid) )
-        move_repl_timer(prv, old_cpu);
+        move_repl_timer(ops, old_cpu);
 
     spin_unlock_irqrestore(&prv->lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:55:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398922.1635185 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1f-000459-HQ; Mon, 24 Aug 2026 15:55:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398922.1635185; Mon, 24 Aug 2026 15:55: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 1wyX1f-000452-Ek; Mon, 24 Aug 2026 15:55:55 +0000
Received: by outflank-mailman (input) for mailman id 1398922;
 Mon, 24 Aug 2026 15:55: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 1wyX1e-00044t-GN
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:55: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 1wyX1e-003Joo-2M
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX1e-000dkp-1Q
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:55: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=DA+8BPiLxH4c82gk6hhteIjdRfIlYFe1gUfI7sD9xgU=; b=CpthS8aYnqbuTAGw3ZBdmCllOs
	l4A660qWEJshdZwOdCUGq4UCIQ2DdCyo4EGgqQFCNvjVsirO6WLrZdmXy+/+57CETjZEdONXp3hNs
	ICk+kUhiz8+QExhLGEArKzPxG0T0jGBKoB1WY9/a2UmXjHR2FiYuK7oATe5E3wMaRPVQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] xen/sched: fix schedule_dump() handling of free cpus
Message-Id: <E1wyX1e-000dkp-1Q@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:55:54 +0000

commit fe13e27783e57ebacdff1315630675afc5493608
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:47:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:47:36 2026 +0200

    xen/sched: fix schedule_dump() handling of free cpus
    
    With the introduction of core scheduling, cpus not used by any cpupool
    have been switched to use the very simple idle scheduler instead of the
    default scheduler.
    
    Trying to obtain diagnostic scheduling data via the "r" debug key is
    scanning through all cpupools using the per-cpupool scheduler to print
    the related data. Unfortunately the switch to use the idle scheduler
    for free cpus wasn't reflected in schedule_dump(), causing the default
    scheduler's dump_cpu_state callback to be used for free cpus.
    
    This causes NULL dereferences in case the default scheduler is one of
    credit or null.
    
    Fix that by using the idle scheduler instead of the default scheduler
    for free cpus. Note that it is fine for a scheduler to have no
    dump_cpu_state callback.
    
    Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
    Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61
    master date: 2026-07-29 14:41:22 +0100
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 55b71301cf..9ccf5811bf 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3452,7 +3452,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:56:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:56:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398923.1635190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1p-000479-Iv; Mon, 24 Aug 2026 15:56:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398923.1635190; Mon, 24 Aug 2026 15:56:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1p-000471-GG; Mon, 24 Aug 2026 15:56:05 +0000
Received: by outflank-mailman (input) for mailman id 1398923;
 Mon, 24 Aug 2026 15:56: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 1wyX1o-00046q-Jh
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:56: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 1wyX1o-003JpM-2h
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX1o-000f54-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56: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=y7s32Ffqd5uUeChHzZ2LtmJ2wgXqaJR8vDD1xS0Ho4E=; b=KaUg2fpuVcfB4PboKt38eRtnpg
	KV+lHzkb1/fX32bnDs0RiP83+OzXsnFwAHRUJbyngy5QIOdLnAmu/c+d4oI2/q+WCujrhPU0mZh7v
	1p6G0taQww0tP/8Fai9uZbHhek9+Oq3On23z+MPM8fuZPrGe6y15ATYrlw15rbLXQyzc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] xen/evtchn: fix wrong usage of array_index_nospec()
Message-Id: <E1wyX1o-000f54-1l@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:56:04 +0000

commit d2785c41059195f13bdb5ac710558374f73920a2
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Aug 24 11:47:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:47:53 2026 +0200

    xen/evtchn: fix wrong usage of array_index_nospec()
    
    The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
    doesn't match the value it is meant to clamp.
    
    Fix it by clamping the port to a safe interval and use that value to
    calculate the event_array[] index.
    
    Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3a6cb6aae45ae979c47308e0cbb01e713a3ddd92
    master date: 2026-08-03 09:50:07 +0200
---
 xen/common/event_fifo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..611bf8a788 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
     w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:56:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:56:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398924.1635193 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1z-000497-KD; Mon, 24 Aug 2026 15:56:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398924.1635193; Mon, 24 Aug 2026 15:56:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX1z-00048z-Ha; Mon, 24 Aug 2026 15:56:15 +0000
Received: by outflank-mailman (input) for mailman id 1398924;
 Mon, 24 Aug 2026 15:56: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 1wyX1y-00048r-Mb
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:56: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 1wyX1y-003JpS-2z
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX1y-000ffJ-24
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56: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=ow+39/qdyuGfEwzYecqvrpBBkng/HN6IxQX48nSmbBo=; b=u4j5/2phAiuegLCBztqQF1ThmG
	yrs8NUUHWmOcBSWtqtbl4nR4tEfn7USB+bvn8OuIqZ9CCa6+Q8+d+zrP0pVZI4JkKZPDcYtrsu3Y5
	vtwClBbsEU+XlhCq/5LFO9hfaW9UjqefxTN/T3i/L3gMIMSp/quNPGeBmgaJLGUl8Jik=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] radix-tree: drop radix_tree_init_maxindex()
Message-Id: <E1wyX1y-000ffJ-24@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:56:14 +0000

commit 50e6dea12c36f3dc8cf262981a4543811d963eca
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Aug 24 11:48:11 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:48:11 2026 +0200

    radix-tree: drop radix_tree_init_maxindex()
    
    Radix trees are in principle usable as soon as memory allocation works.
    (Radix trees with only index 0 populated are usable even earlier.) If only
    there wasn't height_to_maxindex[], which is filled only by a pre-SMP
    initcall. The benefit of this array is rather limited - the calculations
    done by __maxindex() can as well be done by radix_tree_maxindex(); the
    overhead isn't all this high.
    
    This was found by UBSAN on a multi-segment system:
    
    (XEN) UBSAN: Undefined behaviour in common/radix-tree.c:83:27
    (XEN) index 12 is out of range for type 'long unsigned int [12]'
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d040323f9c>] R common/ubsan/ubsan.c#ubsan_epilogue+0xa/0xd5
    (XEN)    [<ffff82d040324d91>] F __ubsan_handle_out_of_bounds+0x9d/0xd4
    (XEN)    [<ffff82d04029265a>] F radix_tree_insert+0x24d/0x570
    (XEN)    [<ffff82d04037ac3e>] F drivers/passthrough/pci.c#alloc_pseg+0xc4/0x165
    (XEN)    [<ffff82d040a3b526>] F pci_add_segment+0xc/0x1b
    (XEN)    [<ffff82d040a5ad1b>] F acpi_parse_mcfg+0x29b/0x344
    (XEN)    [<ffff82d040a3f612>] F acpi_table_parse+0x5d/0x92
    (XEN)    [<ffff82d040a5bf55>] F acpi_mmcfg_init+0x3a2/0x71d
    (XEN)    [<ffff82d040a71ba6>] F pci_setup+0x17/0x29
    (XEN)    [<ffff82d040a784d0>] F __start_xen+0x394c/0x4ed8
    (XEN)    [<ffff82d040423057>] F __high_start+0xb7/0xb8
    
    Fixes: 21844b0e32e7 ("PCI multi-seg: introduce notion of PCI segments")
    Fixes: 8dc6738dbb3c ("Update radix-tree.[ch] from upstream Linux to gain RCU awareness")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1077a93425d2dcca894883cf8565ee9ecf1672cc
    master date: 2026-08-05 12:00:17 +0200
---
 xen/common/radix-tree.c | 41 ++++++++++-------------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)

diff --git a/xen/common/radix-tree.c b/xen/common/radix-tree.c
index ca610d36fc..bc1e8d0c04 100644
--- a/xen/common/radix-tree.c
+++ b/xen/common/radix-tree.c
@@ -32,12 +32,6 @@ struct radix_tree_path {
 #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \
 					  RADIX_TREE_MAP_SHIFT))
 
-/*
- * The height_to_maxindex array needs to be one deeper than the maximum
- * path as height 0 holds only 1 entry.
- */
-static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH + 1] __read_mostly;
-
 static inline void *ptr_to_indirect(void *ptr)
 {
 	return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
@@ -80,7 +74,16 @@ static void radix_tree_node_free(struct radix_tree_node *node)
  */
 static inline unsigned long radix_tree_maxindex(unsigned int height)
 {
-	return height_to_maxindex[height];
+	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
+	int shift = RADIX_TREE_INDEX_BITS - width;
+
+	if (shift < 0)
+		return ~0UL;
+
+	if (shift >= BITS_PER_LONG)
+		return 0UL;
+
+	return ~0UL >> shift;
 }
 
 /*
@@ -705,27 +708,3 @@ void radix_tree_init(struct radix_tree_root *root)
 {
 	*root = (struct radix_tree_root)RADIX_TREE_INIT();
 }
-
-static __init unsigned long __maxindex(unsigned int height)
-{
-	unsigned int width = height * RADIX_TREE_MAP_SHIFT;
-	int shift = RADIX_TREE_INDEX_BITS - width;
-
-	if (shift < 0)
-		return ~0UL;
-	if (shift >= BITS_PER_LONG)
-		return 0UL;
-	return ~0UL >> shift;
-}
-
-static int __init cf_check radix_tree_init_maxindex(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < ARRAY_SIZE(height_to_maxindex); i++)
-		height_to_maxindex[i] = __maxindex(i);
-
-	return 0;
-}
-/* pre-SMP just so it runs before 'normal' initcalls */
-presmp_initcall(radix_tree_init_maxindex);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:56:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:56:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398925.1635198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX29-0004BH-Lm; Mon, 24 Aug 2026 15:56:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398925.1635198; Mon, 24 Aug 2026 15:56:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX29-0004B9-J0; Mon, 24 Aug 2026 15:56:25 +0000
Received: by outflank-mailman (input) for mailman id 1398925;
 Mon, 24 Aug 2026 15:56: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 1wyX28-0004B3-Pa
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:56: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 1wyX29-003JpW-03
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX28-000gEx-2M
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56: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=fgNMGs0uWvkn29yL/2tS4jnEFPZATpdAzuxw8aZPtig=; b=39D0wP8G0mzQCVCObCbDFftKqk
	O5gOQjZ9/yp0VbYMauxVnBtIEZjtb2u6Xrb3UBoZPVUItcoZhBdONuCKG9AV0pehDr5lFu85PN2j/
	Co1lyzF50of/4XPwKwGwDU2AguZzmAhq+yZ9ZIx58VDTNRfShjazpo3p7lWPaoEJOZb8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] x86/nmi: Fix mis-classification of watchdog NMIs
Message-Id: <E1wyX28-000gEx-2M@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:56:24 +0000

commit aa4c4909b4267f6947de5b9a492fd382ea372085
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:48:33 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:48:33 2026 +0200

    x86/nmi: Fix mis-classification of watchdog NMIs
    
    It used to be the case that cpu_data[] inherited the BSP's cpuid_level until
    the AP had calculated it itself.  Following the rework, cpuid_level has a
    placeholder 1 until it is calculated properly.
    
    setup_apic_nmi_watchdog() happens to be called on the BSP after SMP bring-up,
    meaning that the first call is on CPU1.  It is also positioned in the window
    where cpu_data[] is wrong.
    
    As a result, setup_p6_watchdog()'s one-time calculation of the performance
    counter width falls back into Pentium compatibility mode assuming 32bit
    counters.  This causes a watchdog NMI which is delayed a little (e.g. from an
    SMI), to appear as if it hadn't overflowed, and therefore be considered as not
    a watchdog NMI.  On systems where unknown NMIs are treated as fatal, this
    results in a spurious crash.
    
    Switch setup_p6_watchdog() to use boot_cpu_data.cpuid_level, which is how this
    is checked almost everywhere else.
    
    core2_vpmu_init() used the same pattern to look at leaf 0xa.  Despite being
    init code and only running on the BSP, {boot,current}_cpu_data are different
    objects, so switch it over to checking boot_cpu_data.cpuid_level too.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dc5a77c6c4951e8ad75c884b3b6b87a1ba46c488
    master date: 2026-08-17 18:46:08 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c | 2 +-
 xen/arch/x86/nmi.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index ed9f62b936..2326caee58 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -896,7 +896,7 @@ const struct arch_vpmu_ops *__init core2_vpmu_init(void)
     unsigned int version = 0;
     unsigned int i;
 
-    if ( current_cpu_data.cpuid_level >= 0xa )
+    if ( boot_cpu_data.cpuid_level >= 0xa )
         version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
 
     switch ( version )
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 91f95fe6d0..ec85516609 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -321,7 +321,7 @@ static void setup_p6_watchdog(unsigned counter)
 {
     unsigned int evntsel;
 
-    if ( !nmi_p6_event_width && current_cpu_data.cpuid_level >= 0xa )
+    if ( !nmi_p6_event_width && boot_cpu_data.cpuid_level >= 0xa )
         nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
     if ( !nmi_p6_event_width )
         nmi_p6_event_width = P6_EVENT_WIDTH_MIN;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Mon Aug 24 15:56:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 24 Aug 2026 15:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1398926.1635202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX2J-0004DH-ND; Mon, 24 Aug 2026 15:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1398926.1635202; Mon, 24 Aug 2026 15:56:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wyX2J-0004D9-KQ; Mon, 24 Aug 2026 15:56:35 +0000
Received: by outflank-mailman (input) for mailman id 1398926;
 Mon, 24 Aug 2026 15:56:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wyX2I-0004Cz-SU
 for xen-changelog@lists.xenproject.org; Mon, 24 Aug 2026 15:56:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX2J-003Jpd-0M
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wyX2I-000gso-2f
 for xen-changelog@lists.xenproject.org;
 Mon, 24 Aug 2026 15:56:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=38CLpf/5c2C3GTtaBVE+s01zwnQlOeNKle5MFAiko5w=; b=BzFsPwdPw7QmKNbieyaBd8mRj4
	ouznT3mqSc2yhnSkc39ZYGZzvESG94wXXXpaW7+yvISh94YKJYFwq4DUbBfsFh8nXN8dGxMyuee96
	oSkLj1viJfqjqVYfhSkGpSRmgRKoHQ4lW+epdIrSsgy1XbDgoS31/g347DOAGMQS/o3s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
Message-Id: <E1wyX2I-000gso-2f@xenbits.xenproject.org>
Date: Mon, 24 Aug 2026 15:56:34 +0000

commit f98206e8a1b7e1182a0a7efcc21217b1f37e75ea
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 24 11:49:08 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Aug 24 11:49:08 2026 +0200

    x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms
    
    Right now it's only checked in setup_p4_watchdog(), and not in
    setup_p6_watchdog().
    
    Perform the check in the common Intel path in setup_apic_nmi_watchdog(), and
    pass misc_enable as a parameter into setup_p4_watchdog() to avoid reading it
    twice.
    
    Fixes: 0dfba864fbff ("NMI watchdog support in Xen.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: dfb428cb1142a5a468531410e0461fb2a9f2a4ea
    master date: 2026-08-18 12:51:08 +0100
---
 xen/arch/x86/nmi.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index ec85516609..802d085d2f 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -347,14 +347,8 @@ static void setup_p6_watchdog(unsigned counter)
     wrmsrns(MSR_P6_EVNTSEL(0), evntsel);
 }
 
-static void setup_p4_watchdog(void)
+static void setup_p4_watchdog(uint64_t misc_enable)
 {
-    uint64_t misc_enable;
-
-    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
-    if (!(misc_enable & MSR_IA32_MISC_ENABLE_PERF_AVAIL))
-        return;
-
     nmi_perfctr_msr = MSR_P4_IQ_PERFCTR0;
     nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
     if ( boot_cpu_data.x86_num_siblings == 2 )
@@ -386,6 +380,8 @@ static void setup_p4_watchdog(void)
 
 void setup_apic_nmi_watchdog(void)
 {
+    uint64_t misc;
+
     if ( nmi_watchdog == NMI_NONE )
         return;
 
@@ -396,6 +392,14 @@ void setup_apic_nmi_watchdog(void)
         break;
 
     case X86_VENDOR_INTEL:
+        misc = rdmsr(MSR_IA32_MISC_ENABLE);
+
+        if ( !(misc & MSR_IA32_MISC_ENABLE_PERF_AVAIL) )
+        {
+            printk(XENLOG_WARNING "Intel Perfmon unavailable\n");
+            break;
+        }
+
         switch ( boot_cpu_data.family )
         {
         case 6:
@@ -404,7 +408,7 @@ void setup_apic_nmi_watchdog(void)
                               : CORE_EVENT_CPU_CLOCKS_NOT_HALTED);
             break;
         case 15:
-            setup_p4_watchdog();
+            setup_p4_watchdog(misc);
             break;
         }
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 06:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 06:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399657.1635638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz7XL-0007u9-G1; Wed, 26 Aug 2026 06:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399657.1635638; Wed, 26 Aug 2026 06: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 1wz7XL-0007u1-D5; Wed, 26 Aug 2026 06:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1399657;
 Wed, 26 Aug 2026 06: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 1wz7XK-0007tu-9o
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 06: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 1wz7XK-006Wsc-0t
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz7XJ-00FmIz-31
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06: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=JD1kJYR0fuVu4+bDUJlH6UErcjycmEcjiUogyG6GHQg=; b=en32HsV+VrWailaiLS73DRtvHN
	VAFSnAcAXulYmzjV1oSaGYPcjucCyELT1VEZP9O3AM4vbbWbj8zSagXgn+6Cirj9SJNP5V8Lq2wdo
	YPDj3K+r3siKtiw5YJ3ErNvtM0HMu+URtWbCjEJl9QcAC2P0qS+hAhGVMVsEOIBWPG10=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Revert "MAINTAINERS: add myself as reviewer of i.MX8M related patches"
Message-Id: <E1wz7XJ-00FmIz-31@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 06:55:01 +0000

commit 9c5c40fd5406f36b4d98ed351fb005de26bd125b
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Aug 26 08:19:18 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:19:18 2026 +0200

    Revert "MAINTAINERS: add myself as reviewer of i.MX8M related patches"
    
    This reverts commit 420193f87cc70751aec0712cded82b44c66328d1 as it
    contains part of the changes (imx8m.c) that should belong to a different
    patch.
---
 MAINTAINERS                    | 7 -------
 xen/arch/arm/platforms/imx8m.c | 8 +++++++-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c60afc93a5..4dd97ffcad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -365,13 +365,6 @@ F:	tools/misc/xenhypfs.c
 F:	xen/common/hypfs.c
 F:	xen/include/xen/hypfs.h
 
-IMX8M SUPPORT
-R:	Wig Cheng <onlywig@gmail.com>
-F:	xen/arch/arm/arm64/debug-imx-uart.inc
-F:	xen/arch/arm/include/asm/imx-uart.h
-F:	xen/arch/arm/platforms/imx8m.c
-F:	xen/drivers/char/imx-uart.c
-
 IMX8QM/QXP SUPPORT
 R:	John Ernberg <john.ernberg@actia.se>
 F:	xen/arch/arm/platforms/imx8qm.c
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
index 669dd517e0..ad76935f5d 100644
--- a/xen/arch/arm/platforms/imx8m.c
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -111,8 +111,14 @@ static bool imx8m_smc(struct cpu_user_regs *regs)
          * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
          * i.MX8MP issues no NoC call, but the platform covers both.
          */
-        if ( subfunction_id != IMX_SIP_NOC_SF_PRIORITY )
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_NOC_SF_PRIORITY:
+            break;
+
+        default:
             return false;
+        }
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 06:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 06:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399658.1635642 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz7XU-0007vj-H0; Wed, 26 Aug 2026 06:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399658.1635642; Wed, 26 Aug 2026 06: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 1wz7XU-0007vc-EO; Wed, 26 Aug 2026 06:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1399658;
 Wed, 26 Aug 2026 06: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 1wz7XU-0007vW-5V
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 06: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 1wz7XU-006Wsh-1G
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz7XU-00Fmj4-0I
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06: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=oNAK5ILBdEE0d1m5AtFyIb7Tq8W+JZF7MpKWQxvWq10=; b=x41IfM7K/qTOR+YbdBbNUxEdtF
	XOFWVqjaQYl+dXA+JRoCS5lqOclBfwYLLvcDh20Zd29z7vUP67eiN4dGj84Z5u5vk+qQzBZR+r7uN
	A++gCMNw+BPcnsnIdmG+Chm76cL3z80QdH4VxFhcuS/0+TMEFGvJWLL6AyzBIDc6BRZQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Revert "xen/arm: add i.MX8M platform support"
Message-Id: <E1wz7XU-00Fmj4-0I@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 06:55:12 +0000

commit 3ca5ce7cd05de7b1b87f8026527fa03cd3541c42
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Aug 26 08:20:21 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:20:21 2026 +0200

    Revert "xen/arm: add i.MX8M platform support"
    
    This reverts commit 6febf12df5a1a4721e03af71af0b15e6d2187aa8 as it is
    missing a change that was incorrectly committed with a different patch.
---
 xen/arch/arm/platforms/Makefile |   1 -
 xen/arch/arm/platforms/imx8m.c  | 161 ----------------------------------------
 2 files changed, 162 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index cdf936c50d..bec6e55d1f 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -9,7 +9,6 @@ obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
 obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o
 obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o
-obj-$(CONFIG_ALL64_PLAT) += imx8m.o
 obj-$(CONFIG_ALL64_PLAT) += imx8qm.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp-eemi.o
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
deleted file mode 100644
index ad76935f5d..0000000000
--- a/xen/arch/arm/platforms/imx8m.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * i.MX 8M family setup
- *
- * Copyright 2026 Open-EP (E-Paper) Community
- */
-
-#include <xen/sched.h>
-#include <asm/platform.h>
-#include <asm/regs.h>
-#include <asm/smccc.h>
-
-static const char * const imx8m_dt_compat[] __initconst =
-{
-    "fsl,imx8mp",
-    "fsl,imx8mq",
-    "fsl,imx8mm",
-    "fsl,imx8mn",
-    NULL
-};
-
-#define IMX_SIP_FID(fid) \
-    ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
-                       ARM_SMCCC_CONV_64, \
-                       ARM_SMCCC_OWNER_SIP, \
-                       (fid))
-
-/*
- * SiP SMC function IDs used by the i.MX8M Linux drivers.  There is no
- * public specification for these; the IDs and their subfunctions are
- * extracted from the vendor kernel call sites (see drivers/soc/imx,
- * drivers/devfreq, drivers/remoteproc).
- */
-#define IMX_SIP_F_GPC       0x0   /* GPC power-domain control */
-#define IMX_SIP_F_CPUFREQ   0x1   /* CPU frequency scaling */
-#define IMX_SIP_F_DDR_DVFS  0x4   /* DRAM frequency scaling */
-#define IMX_SIP_F_SRC       0x5   /* SRC: M-core remoteproc start/stop */
-#define IMX_SIP_F_SOC_INFO  0x6   /* read-only SoC info query */
-#define IMX_SIP_F_NOC       0x8   /* NoC QoS priority setup */
-
-#define IMX_SIP_GPC_SF_PM_DOMAIN    0x03
-
-#define IMX_SIP_SRC_SF_M4_START     0x00
-#define IMX_SIP_SRC_SF_M4_STARTED   0x01
-#define IMX_SIP_SRC_SF_M4_STOP      0x02
-
-#define IMX_SIP_NOC_SF_PRIORITY     0x01
-
-static bool imx8m_smc(struct cpu_user_regs *regs)
-{
-    uint32_t function_id = get_user_reg(regs, 0);
-    uint32_t subfunction_id = get_user_reg(regs, 1);
-    struct arm_smccc_res res;
-
-    if ( !cpus_have_const_cap(ARM_SMCCC_1_1) )
-    {
-        printk_once(XENLOG_WARNING
-                    "imx8m: smc: no SMCCC 1.1 support. Disabling firmware calls\n");
-
-        return false;
-    }
-
-    /* Only the hardware domain may use the SiP calls */
-    if ( !is_hardware_domain(current->domain) )
-    {
-        gprintk(XENLOG_WARNING, "imx8m: smc: No access\n");
-        return false;
-    }
-
-    /*
-     * Forward only the subfunctions the dom0 kernel actually issues.  All
-     * of these manage hardware that belongs to the hardware domain (power
-     * domains, M-core, NoC) or are read-only queries.
-     */
-    switch ( function_id )
-    {
-    case IMX_SIP_FID(IMX_SIP_F_GPC):
-        if ( subfunction_id != IMX_SIP_GPC_SF_PM_DOMAIN )
-            return false;
-        break;
-
-    /*
-     * CPU and DRAM frequency scaling: the hardware domain does not see the
-     * whole system and cannot make an informed decision about resources
-     * shared with the other domains, so deny both (CPU frequency scaling
-     * is denied on the i.MX8QM platform for the same reason).
-     */
-    case IMX_SIP_FID(IMX_SIP_F_CPUFREQ):
-    case IMX_SIP_FID(IMX_SIP_F_DDR_DVFS):
-        return false;
-
-    case IMX_SIP_FID(IMX_SIP_F_SRC):
-        /* SRC: M-core remoteproc start, poll-started and stop. */
-        switch ( subfunction_id )
-        {
-        case IMX_SIP_SRC_SF_M4_START:
-        case IMX_SIP_SRC_SF_M4_STARTED:
-        case IMX_SIP_SRC_SF_M4_STOP:
-            break;
-
-        default:
-            return false;
-        }
-        break;
-
-    case IMX_SIP_FID(IMX_SIP_F_SOC_INFO):
-        break;
-
-    case IMX_SIP_FID(IMX_SIP_F_NOC):
-        /*
-         * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
-         * i.MX8MP issues no NoC call, but the platform covers both.
-         */
-        switch ( subfunction_id )
-        {
-        case IMX_SIP_NOC_SF_PRIORITY:
-            break;
-
-        default:
-            return false;
-        }
-        break;
-
-    default:
-        gprintk(XENLOG_WARNING,
-                "imx8m: smc: Unknown function id %x subfunction id %x\n",
-                function_id, subfunction_id);
-        return false;
-    }
-
-    arm_smccc_1_1_smc(function_id,
-                      subfunction_id,
-                      get_user_reg(regs, 2),
-                      get_user_reg(regs, 3),
-                      get_user_reg(regs, 4),
-                      get_user_reg(regs, 5),
-                      get_user_reg(regs, 6),
-                      get_user_reg(regs, 7),
-                      &res);
-
-    set_user_reg(regs, 0, res.a0);
-    set_user_reg(regs, 1, res.a1);
-    set_user_reg(regs, 2, res.a2);
-    set_user_reg(regs, 3, res.a3);
-
-    return true;
-}
-
-PLATFORM_START(imx8m, "i.MX 8M")
-    .compatible = imx8m_dt_compat,
-    .smc = imx8m_smc,
-PLATFORM_END
-
-/*
- * 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 Wed Aug 26 06:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 06:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399659.1635646 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz7Xf-0007xf-Io; Wed, 26 Aug 2026 06:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399659.1635646; Wed, 26 Aug 2026 06: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 1wz7Xf-0007xX-G6; Wed, 26 Aug 2026 06:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1399659;
 Wed, 26 Aug 2026 06: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 1wz7Xe-0007xL-8g
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 06: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 1wz7Xe-006Wsq-1a
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz7Xe-00Fn9E-0e
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06: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=lLOLeG75DvSFmFeC+T98LamicDcv2fuRj4ebhUJm8zc=; b=hsad8Fv+0PpGcU101SH47wAG8C
	OZd27nxn7Anl5z+fqxqseXz4C1eMyAuf3xixLn6c/9QWadxsnxDYEfXvfRQFpIo9VJGRsmQJPNZiX
	pgrVxscWfHVB1WVminyeDMb3DJFcwCPJFePgP/kbIPpEVK5YF5gjhtgBlwLzHZ3VOcEs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: add i.MX8M platform support
Message-Id: <E1wz7Xe-00Fn9E-0e@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 06:55:22 +0000

commit 5bca9bba736aac65c78301d497e01a70db2c3668
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:20 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:23:21 2026 +0200

    xen/arm: add i.MX8M platform support
    
    Add platform glue for the NXP i.MX8M family (i.MX8MP/MQ/MM/MN).
    
    When Linux is used as dom0 a number of drivers make SiP SMC calls into
    TF-A to manage hardware: GPC power domains, SRC (M-core remoteproc),
    SoC info and NoC QoS.  There is no public specification for these
    calls; the function IDs and their subfunctions are taken from the
    vendor kernel call sites.
    
    Forward only the specific subfunctions the hardware domain issues,
    following the whitelist model of the i.MX8QM platform.  Each service
    with a fixed set of subfunctions (GPC, SRC, NoC) filters them with an
    explicit switch on the subfunction id, and the SoC info call is a
    read-only query.  CPU and DRAM frequency scaling are denied because
    the hardware domain cannot make an informed decision about resources
    shared with the other domains, and any unknown function ID is
    rejected.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/platforms/Makefile |   1 +
 xen/arch/arm/platforms/imx8m.c  | 155 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 156 insertions(+)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index bec6e55d1f..cdf936c50d 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
 obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o
 obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o
+obj-$(CONFIG_ALL64_PLAT) += imx8m.o
 obj-$(CONFIG_ALL64_PLAT) += imx8qm.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp-eemi.o
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
new file mode 100644
index 0000000000..669dd517e0
--- /dev/null
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -0,0 +1,155 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * i.MX 8M family setup
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <xen/sched.h>
+#include <asm/platform.h>
+#include <asm/regs.h>
+#include <asm/smccc.h>
+
+static const char * const imx8m_dt_compat[] __initconst =
+{
+    "fsl,imx8mp",
+    "fsl,imx8mq",
+    "fsl,imx8mm",
+    "fsl,imx8mn",
+    NULL
+};
+
+#define IMX_SIP_FID(fid) \
+    ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
+                       ARM_SMCCC_CONV_64, \
+                       ARM_SMCCC_OWNER_SIP, \
+                       (fid))
+
+/*
+ * SiP SMC function IDs used by the i.MX8M Linux drivers.  There is no
+ * public specification for these; the IDs and their subfunctions are
+ * extracted from the vendor kernel call sites (see drivers/soc/imx,
+ * drivers/devfreq, drivers/remoteproc).
+ */
+#define IMX_SIP_F_GPC       0x0   /* GPC power-domain control */
+#define IMX_SIP_F_CPUFREQ   0x1   /* CPU frequency scaling */
+#define IMX_SIP_F_DDR_DVFS  0x4   /* DRAM frequency scaling */
+#define IMX_SIP_F_SRC       0x5   /* SRC: M-core remoteproc start/stop */
+#define IMX_SIP_F_SOC_INFO  0x6   /* read-only SoC info query */
+#define IMX_SIP_F_NOC       0x8   /* NoC QoS priority setup */
+
+#define IMX_SIP_GPC_SF_PM_DOMAIN    0x03
+
+#define IMX_SIP_SRC_SF_M4_START     0x00
+#define IMX_SIP_SRC_SF_M4_STARTED   0x01
+#define IMX_SIP_SRC_SF_M4_STOP      0x02
+
+#define IMX_SIP_NOC_SF_PRIORITY     0x01
+
+static bool imx8m_smc(struct cpu_user_regs *regs)
+{
+    uint32_t function_id = get_user_reg(regs, 0);
+    uint32_t subfunction_id = get_user_reg(regs, 1);
+    struct arm_smccc_res res;
+
+    if ( !cpus_have_const_cap(ARM_SMCCC_1_1) )
+    {
+        printk_once(XENLOG_WARNING
+                    "imx8m: smc: no SMCCC 1.1 support. Disabling firmware calls\n");
+
+        return false;
+    }
+
+    /* Only the hardware domain may use the SiP calls */
+    if ( !is_hardware_domain(current->domain) )
+    {
+        gprintk(XENLOG_WARNING, "imx8m: smc: No access\n");
+        return false;
+    }
+
+    /*
+     * Forward only the subfunctions the dom0 kernel actually issues.  All
+     * of these manage hardware that belongs to the hardware domain (power
+     * domains, M-core, NoC) or are read-only queries.
+     */
+    switch ( function_id )
+    {
+    case IMX_SIP_FID(IMX_SIP_F_GPC):
+        if ( subfunction_id != IMX_SIP_GPC_SF_PM_DOMAIN )
+            return false;
+        break;
+
+    /*
+     * CPU and DRAM frequency scaling: the hardware domain does not see the
+     * whole system and cannot make an informed decision about resources
+     * shared with the other domains, so deny both (CPU frequency scaling
+     * is denied on the i.MX8QM platform for the same reason).
+     */
+    case IMX_SIP_FID(IMX_SIP_F_CPUFREQ):
+    case IMX_SIP_FID(IMX_SIP_F_DDR_DVFS):
+        return false;
+
+    case IMX_SIP_FID(IMX_SIP_F_SRC):
+        /* SRC: M-core remoteproc start, poll-started and stop. */
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_SRC_SF_M4_START:
+        case IMX_SIP_SRC_SF_M4_STARTED:
+        case IMX_SIP_SRC_SF_M4_STOP:
+            break;
+
+        default:
+            return false;
+        }
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_SOC_INFO):
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_NOC):
+        /*
+         * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
+         * i.MX8MP issues no NoC call, but the platform covers both.
+         */
+        if ( subfunction_id != IMX_SIP_NOC_SF_PRIORITY )
+            return false;
+        break;
+
+    default:
+        gprintk(XENLOG_WARNING,
+                "imx8m: smc: Unknown function id %x subfunction id %x\n",
+                function_id, subfunction_id);
+        return false;
+    }
+
+    arm_smccc_1_1_smc(function_id,
+                      subfunction_id,
+                      get_user_reg(regs, 2),
+                      get_user_reg(regs, 3),
+                      get_user_reg(regs, 4),
+                      get_user_reg(regs, 5),
+                      get_user_reg(regs, 6),
+                      get_user_reg(regs, 7),
+                      &res);
+
+    set_user_reg(regs, 0, res.a0);
+    set_user_reg(regs, 1, res.a1);
+    set_user_reg(regs, 2, res.a2);
+    set_user_reg(regs, 3, res.a3);
+
+    return true;
+}
+
+PLATFORM_START(imx8m, "i.MX 8M")
+    .compatible = imx8m_dt_compat,
+    .smc = imx8m_smc,
+PLATFORM_END
+
+/*
+ * 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 Wed Aug 26 06:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 06:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399660.1635650 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz7Xp-0007zc-Jx; Wed, 26 Aug 2026 06:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399660.1635650; Wed, 26 Aug 2026 06: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 1wz7Xp-0007zU-HT; Wed, 26 Aug 2026 06:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1399660;
 Wed, 26 Aug 2026 06: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 1wz7Xo-0007zO-C4
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 06: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 1wz7Xo-006Wsu-1v
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz7Xo-00FnWs-0y
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 06: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=QqHc6SxiNzvHpDneB3WDssBYcH3cSqggcEyZT+BJOVQ=; b=KylhoYBlHmwzgB7g1hdbL+TtyB
	bxX5CyxFo7+bwn7IzJJ9GnDde2mjP9XbzxS37BWRW+U/7hZ231qcT2uNooC/ZD2OIggGJfQLTkfOj
	ZN1RWPsS2rNX0XMLKHxi12B3hrZEVsbd/kUZGOXmlT2TYyztmmKD5t41DJjoLVm/RnCc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: add myself as reviewer of i.MX8M related patches
Message-Id: <E1wz7Xo-00FnWs-0y@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 06:55:32 +0000

commit 6b8c423472dac216ca57fdbeba2787813b08c5a5
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:21 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:23:44 2026 +0200

    MAINTAINERS: add myself as reviewer of i.MX8M related patches
    
    I wrote the i.MX8M platform and UART support and can help review
    patches touching these areas.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4dd97ffcad..c60afc93a5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -365,6 +365,13 @@ F:	tools/misc/xenhypfs.c
 F:	xen/common/hypfs.c
 F:	xen/include/xen/hypfs.h
 
+IMX8M SUPPORT
+R:	Wig Cheng <onlywig@gmail.com>
+F:	xen/arch/arm/arm64/debug-imx-uart.inc
+F:	xen/arch/arm/include/asm/imx-uart.h
+F:	xen/arch/arm/platforms/imx8m.c
+F:	xen/drivers/char/imx-uart.c
+
 IMX8QM/QXP SUPPORT
 R:	John Ernberg <john.ernberg@actia.se>
 F:	xen/arch/arm/platforms/imx8qm.c
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 07:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 07:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399679.1635663 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz8TP-0007al-Nj; Wed, 26 Aug 2026 07:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399679.1635663; Wed, 26 Aug 2026 07:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz8TP-0007ad-L5; Wed, 26 Aug 2026 07:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1399679;
 Wed, 26 Aug 2026 07:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wz8TO-0007aV-FA
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 07:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz8TO-006Y1W-1v
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz8TO-000aeN-0x
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Uu+HXC491Q6J0Sn4NIN4Jn/3yCu/0C0nTb73HPGhwnk=; b=jpV/xDFu3+kH5emyszzziF4uh/
	UvueniZfqXl+HohPTZsk38LnGaePu7jW15BTSfXixnmsfc5QBWGPn3bY/jsbS8gNMiHbfIvEonCES
	dI4dNCwDeia29RF7RU5xn4TG3DXsKTigy82H81QMEkfOjQTK/atu0aucY07VyRV5Dr3E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "MAINTAINERS: add myself as reviewer of i.MX8M related patches"
Message-Id: <E1wz8TO-000aeN-0x@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 07:55:02 +0000

commit 9c5c40fd5406f36b4d98ed351fb005de26bd125b
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Aug 26 08:19:18 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:19:18 2026 +0200

    Revert "MAINTAINERS: add myself as reviewer of i.MX8M related patches"
    
    This reverts commit 420193f87cc70751aec0712cded82b44c66328d1 as it
    contains part of the changes (imx8m.c) that should belong to a different
    patch.
---
 MAINTAINERS                    | 7 -------
 xen/arch/arm/platforms/imx8m.c | 8 +++++++-
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c60afc93a5..4dd97ffcad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -365,13 +365,6 @@ F:	tools/misc/xenhypfs.c
 F:	xen/common/hypfs.c
 F:	xen/include/xen/hypfs.h
 
-IMX8M SUPPORT
-R:	Wig Cheng <onlywig@gmail.com>
-F:	xen/arch/arm/arm64/debug-imx-uart.inc
-F:	xen/arch/arm/include/asm/imx-uart.h
-F:	xen/arch/arm/platforms/imx8m.c
-F:	xen/drivers/char/imx-uart.c
-
 IMX8QM/QXP SUPPORT
 R:	John Ernberg <john.ernberg@actia.se>
 F:	xen/arch/arm/platforms/imx8qm.c
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
index 669dd517e0..ad76935f5d 100644
--- a/xen/arch/arm/platforms/imx8m.c
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -111,8 +111,14 @@ static bool imx8m_smc(struct cpu_user_regs *regs)
          * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
          * i.MX8MP issues no NoC call, but the platform covers both.
          */
-        if ( subfunction_id != IMX_SIP_NOC_SF_PRIORITY )
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_NOC_SF_PRIORITY:
+            break;
+
+        default:
             return false;
+        }
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 07:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 07:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399680.1635667 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz8TZ-0007cO-PY; Wed, 26 Aug 2026 07:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399680.1635667; Wed, 26 Aug 2026 07: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 1wz8TZ-0007cG-MN; Wed, 26 Aug 2026 07:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1399680;
 Wed, 26 Aug 2026 07: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 1wz8TY-0007cA-Ff
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 07: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 1wz8TY-006Y1c-2I
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz8TY-000b7Y-1I
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07: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=42txrcf0/COsrv0yOf8Cw+Fmi8xB0G3WGJ7G9A3Fut4=; b=UF+R1WG2czqy/3G5clXVc804Ti
	hYl5X125YSQ8XtQn8x72suH3yjSrCMLbcogPwaf6HERYdvc/+BZ5OBPtpXKaG2+vpZxCoAt6xLrBN
	9CTFG9jEg+mx2M4+1RLyx9bj7D52LOXW8c7u4YXEyITFs0eFSzDywOvubKlxvvoCy5gI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "xen/arm: add i.MX8M platform support"
Message-Id: <E1wz8TY-000b7Y-1I@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 07:55:12 +0000

commit 3ca5ce7cd05de7b1b87f8026527fa03cd3541c42
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Aug 26 08:20:21 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:20:21 2026 +0200

    Revert "xen/arm: add i.MX8M platform support"
    
    This reverts commit 6febf12df5a1a4721e03af71af0b15e6d2187aa8 as it is
    missing a change that was incorrectly committed with a different patch.
---
 xen/arch/arm/platforms/Makefile |   1 -
 xen/arch/arm/platforms/imx8m.c  | 161 ----------------------------------------
 2 files changed, 162 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index cdf936c50d..bec6e55d1f 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -9,7 +9,6 @@ obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
 obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o
 obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o
-obj-$(CONFIG_ALL64_PLAT) += imx8m.o
 obj-$(CONFIG_ALL64_PLAT) += imx8qm.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp-eemi.o
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
deleted file mode 100644
index ad76935f5d..0000000000
--- a/xen/arch/arm/platforms/imx8m.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * i.MX 8M family setup
- *
- * Copyright 2026 Open-EP (E-Paper) Community
- */
-
-#include <xen/sched.h>
-#include <asm/platform.h>
-#include <asm/regs.h>
-#include <asm/smccc.h>
-
-static const char * const imx8m_dt_compat[] __initconst =
-{
-    "fsl,imx8mp",
-    "fsl,imx8mq",
-    "fsl,imx8mm",
-    "fsl,imx8mn",
-    NULL
-};
-
-#define IMX_SIP_FID(fid) \
-    ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
-                       ARM_SMCCC_CONV_64, \
-                       ARM_SMCCC_OWNER_SIP, \
-                       (fid))
-
-/*
- * SiP SMC function IDs used by the i.MX8M Linux drivers.  There is no
- * public specification for these; the IDs and their subfunctions are
- * extracted from the vendor kernel call sites (see drivers/soc/imx,
- * drivers/devfreq, drivers/remoteproc).
- */
-#define IMX_SIP_F_GPC       0x0   /* GPC power-domain control */
-#define IMX_SIP_F_CPUFREQ   0x1   /* CPU frequency scaling */
-#define IMX_SIP_F_DDR_DVFS  0x4   /* DRAM frequency scaling */
-#define IMX_SIP_F_SRC       0x5   /* SRC: M-core remoteproc start/stop */
-#define IMX_SIP_F_SOC_INFO  0x6   /* read-only SoC info query */
-#define IMX_SIP_F_NOC       0x8   /* NoC QoS priority setup */
-
-#define IMX_SIP_GPC_SF_PM_DOMAIN    0x03
-
-#define IMX_SIP_SRC_SF_M4_START     0x00
-#define IMX_SIP_SRC_SF_M4_STARTED   0x01
-#define IMX_SIP_SRC_SF_M4_STOP      0x02
-
-#define IMX_SIP_NOC_SF_PRIORITY     0x01
-
-static bool imx8m_smc(struct cpu_user_regs *regs)
-{
-    uint32_t function_id = get_user_reg(regs, 0);
-    uint32_t subfunction_id = get_user_reg(regs, 1);
-    struct arm_smccc_res res;
-
-    if ( !cpus_have_const_cap(ARM_SMCCC_1_1) )
-    {
-        printk_once(XENLOG_WARNING
-                    "imx8m: smc: no SMCCC 1.1 support. Disabling firmware calls\n");
-
-        return false;
-    }
-
-    /* Only the hardware domain may use the SiP calls */
-    if ( !is_hardware_domain(current->domain) )
-    {
-        gprintk(XENLOG_WARNING, "imx8m: smc: No access\n");
-        return false;
-    }
-
-    /*
-     * Forward only the subfunctions the dom0 kernel actually issues.  All
-     * of these manage hardware that belongs to the hardware domain (power
-     * domains, M-core, NoC) or are read-only queries.
-     */
-    switch ( function_id )
-    {
-    case IMX_SIP_FID(IMX_SIP_F_GPC):
-        if ( subfunction_id != IMX_SIP_GPC_SF_PM_DOMAIN )
-            return false;
-        break;
-
-    /*
-     * CPU and DRAM frequency scaling: the hardware domain does not see the
-     * whole system and cannot make an informed decision about resources
-     * shared with the other domains, so deny both (CPU frequency scaling
-     * is denied on the i.MX8QM platform for the same reason).
-     */
-    case IMX_SIP_FID(IMX_SIP_F_CPUFREQ):
-    case IMX_SIP_FID(IMX_SIP_F_DDR_DVFS):
-        return false;
-
-    case IMX_SIP_FID(IMX_SIP_F_SRC):
-        /* SRC: M-core remoteproc start, poll-started and stop. */
-        switch ( subfunction_id )
-        {
-        case IMX_SIP_SRC_SF_M4_START:
-        case IMX_SIP_SRC_SF_M4_STARTED:
-        case IMX_SIP_SRC_SF_M4_STOP:
-            break;
-
-        default:
-            return false;
-        }
-        break;
-
-    case IMX_SIP_FID(IMX_SIP_F_SOC_INFO):
-        break;
-
-    case IMX_SIP_FID(IMX_SIP_F_NOC):
-        /*
-         * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
-         * i.MX8MP issues no NoC call, but the platform covers both.
-         */
-        switch ( subfunction_id )
-        {
-        case IMX_SIP_NOC_SF_PRIORITY:
-            break;
-
-        default:
-            return false;
-        }
-        break;
-
-    default:
-        gprintk(XENLOG_WARNING,
-                "imx8m: smc: Unknown function id %x subfunction id %x\n",
-                function_id, subfunction_id);
-        return false;
-    }
-
-    arm_smccc_1_1_smc(function_id,
-                      subfunction_id,
-                      get_user_reg(regs, 2),
-                      get_user_reg(regs, 3),
-                      get_user_reg(regs, 4),
-                      get_user_reg(regs, 5),
-                      get_user_reg(regs, 6),
-                      get_user_reg(regs, 7),
-                      &res);
-
-    set_user_reg(regs, 0, res.a0);
-    set_user_reg(regs, 1, res.a1);
-    set_user_reg(regs, 2, res.a2);
-    set_user_reg(regs, 3, res.a3);
-
-    return true;
-}
-
-PLATFORM_START(imx8m, "i.MX 8M")
-    .compatible = imx8m_dt_compat,
-    .smc = imx8m_smc,
-PLATFORM_END
-
-/*
- * 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 Wed Aug 26 07:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 07:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399681.1635671 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz8Tj-0007et-S0; Wed, 26 Aug 2026 07:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399681.1635671; Wed, 26 Aug 2026 07: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 1wz8Tj-0007el-PN; Wed, 26 Aug 2026 07:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1399681;
 Wed, 26 Aug 2026 07:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wz8Ti-0007ec-J6
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 07:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz8Ti-006Y1j-2d
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz8Ti-000bWd-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07: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=8D2bm74uhvDBDSOHRfJyR6jEbU8ymIgkc1CKmdZHlFc=; b=zCfNnM9pPlguFWZ2e6MmcMwfo/
	2ekG3D5RqLh+grIde3Yh2Pv1wiRnAmZ+3JPxmMY6ZTgKkIJ6qoPYlN4hVw2qRwfhnjdjnTKkPGE0B
	OTDf+8fhx6pq77X3j8oVivtUtx+ZmtT458Uwu9zq8vxI1iCy0HJt9o4MfZFN5fXGgb1c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: add i.MX8M platform support
Message-Id: <E1wz8Ti-000bWd-1f@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 07:55:22 +0000

commit 5bca9bba736aac65c78301d497e01a70db2c3668
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:20 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:23:21 2026 +0200

    xen/arm: add i.MX8M platform support
    
    Add platform glue for the NXP i.MX8M family (i.MX8MP/MQ/MM/MN).
    
    When Linux is used as dom0 a number of drivers make SiP SMC calls into
    TF-A to manage hardware: GPC power domains, SRC (M-core remoteproc),
    SoC info and NoC QoS.  There is no public specification for these
    calls; the function IDs and their subfunctions are taken from the
    vendor kernel call sites.
    
    Forward only the specific subfunctions the hardware domain issues,
    following the whitelist model of the i.MX8QM platform.  Each service
    with a fixed set of subfunctions (GPC, SRC, NoC) filters them with an
    explicit switch on the subfunction id, and the SoC info call is a
    read-only query.  CPU and DRAM frequency scaling are denied because
    the hardware domain cannot make an informed decision about resources
    shared with the other domains, and any unknown function ID is
    rejected.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/platforms/Makefile |   1 +
 xen/arch/arm/platforms/imx8m.c  | 155 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 156 insertions(+)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index bec6e55d1f..cdf936c50d 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
 obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o
 obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o
+obj-$(CONFIG_ALL64_PLAT) += imx8m.o
 obj-$(CONFIG_ALL64_PLAT) += imx8qm.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp-eemi.o
diff --git a/xen/arch/arm/platforms/imx8m.c b/xen/arch/arm/platforms/imx8m.c
new file mode 100644
index 0000000000..669dd517e0
--- /dev/null
+++ b/xen/arch/arm/platforms/imx8m.c
@@ -0,0 +1,155 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * i.MX 8M family setup
+ *
+ * Copyright 2026 Open-EP (E-Paper) Community
+ */
+
+#include <xen/sched.h>
+#include <asm/platform.h>
+#include <asm/regs.h>
+#include <asm/smccc.h>
+
+static const char * const imx8m_dt_compat[] __initconst =
+{
+    "fsl,imx8mp",
+    "fsl,imx8mq",
+    "fsl,imx8mm",
+    "fsl,imx8mn",
+    NULL
+};
+
+#define IMX_SIP_FID(fid) \
+    ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
+                       ARM_SMCCC_CONV_64, \
+                       ARM_SMCCC_OWNER_SIP, \
+                       (fid))
+
+/*
+ * SiP SMC function IDs used by the i.MX8M Linux drivers.  There is no
+ * public specification for these; the IDs and their subfunctions are
+ * extracted from the vendor kernel call sites (see drivers/soc/imx,
+ * drivers/devfreq, drivers/remoteproc).
+ */
+#define IMX_SIP_F_GPC       0x0   /* GPC power-domain control */
+#define IMX_SIP_F_CPUFREQ   0x1   /* CPU frequency scaling */
+#define IMX_SIP_F_DDR_DVFS  0x4   /* DRAM frequency scaling */
+#define IMX_SIP_F_SRC       0x5   /* SRC: M-core remoteproc start/stop */
+#define IMX_SIP_F_SOC_INFO  0x6   /* read-only SoC info query */
+#define IMX_SIP_F_NOC       0x8   /* NoC QoS priority setup */
+
+#define IMX_SIP_GPC_SF_PM_DOMAIN    0x03
+
+#define IMX_SIP_SRC_SF_M4_START     0x00
+#define IMX_SIP_SRC_SF_M4_STARTED   0x01
+#define IMX_SIP_SRC_SF_M4_STOP      0x02
+
+#define IMX_SIP_NOC_SF_PRIORITY     0x01
+
+static bool imx8m_smc(struct cpu_user_regs *regs)
+{
+    uint32_t function_id = get_user_reg(regs, 0);
+    uint32_t subfunction_id = get_user_reg(regs, 1);
+    struct arm_smccc_res res;
+
+    if ( !cpus_have_const_cap(ARM_SMCCC_1_1) )
+    {
+        printk_once(XENLOG_WARNING
+                    "imx8m: smc: no SMCCC 1.1 support. Disabling firmware calls\n");
+
+        return false;
+    }
+
+    /* Only the hardware domain may use the SiP calls */
+    if ( !is_hardware_domain(current->domain) )
+    {
+        gprintk(XENLOG_WARNING, "imx8m: smc: No access\n");
+        return false;
+    }
+
+    /*
+     * Forward only the subfunctions the dom0 kernel actually issues.  All
+     * of these manage hardware that belongs to the hardware domain (power
+     * domains, M-core, NoC) or are read-only queries.
+     */
+    switch ( function_id )
+    {
+    case IMX_SIP_FID(IMX_SIP_F_GPC):
+        if ( subfunction_id != IMX_SIP_GPC_SF_PM_DOMAIN )
+            return false;
+        break;
+
+    /*
+     * CPU and DRAM frequency scaling: the hardware domain does not see the
+     * whole system and cannot make an informed decision about resources
+     * shared with the other domains, so deny both (CPU frequency scaling
+     * is denied on the i.MX8QM platform for the same reason).
+     */
+    case IMX_SIP_FID(IMX_SIP_F_CPUFREQ):
+    case IMX_SIP_FID(IMX_SIP_F_DDR_DVFS):
+        return false;
+
+    case IMX_SIP_FID(IMX_SIP_F_SRC):
+        /* SRC: M-core remoteproc start, poll-started and stop. */
+        switch ( subfunction_id )
+        {
+        case IMX_SIP_SRC_SF_M4_START:
+        case IMX_SIP_SRC_SF_M4_STARTED:
+        case IMX_SIP_SRC_SF_M4_STOP:
+            break;
+
+        default:
+            return false;
+        }
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_SOC_INFO):
+        break;
+
+    case IMX_SIP_FID(IMX_SIP_F_NOC):
+        /*
+         * NoC QoS priority setup.  Only i.MX8MQ issues this at boot;
+         * i.MX8MP issues no NoC call, but the platform covers both.
+         */
+        if ( subfunction_id != IMX_SIP_NOC_SF_PRIORITY )
+            return false;
+        break;
+
+    default:
+        gprintk(XENLOG_WARNING,
+                "imx8m: smc: Unknown function id %x subfunction id %x\n",
+                function_id, subfunction_id);
+        return false;
+    }
+
+    arm_smccc_1_1_smc(function_id,
+                      subfunction_id,
+                      get_user_reg(regs, 2),
+                      get_user_reg(regs, 3),
+                      get_user_reg(regs, 4),
+                      get_user_reg(regs, 5),
+                      get_user_reg(regs, 6),
+                      get_user_reg(regs, 7),
+                      &res);
+
+    set_user_reg(regs, 0, res.a0);
+    set_user_reg(regs, 1, res.a1);
+    set_user_reg(regs, 2, res.a2);
+    set_user_reg(regs, 3, res.a3);
+
+    return true;
+}
+
+PLATFORM_START(imx8m, "i.MX 8M")
+    .compatible = imx8m_dt_compat,
+    .smc = imx8m_smc,
+PLATFORM_END
+
+/*
+ * 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 Wed Aug 26 07:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 07:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399682.1635675 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wz8Tt-0007gu-TW; Wed, 26 Aug 2026 07:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399682.1635675; Wed, 26 Aug 2026 07: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 1wz8Tt-0007gm-Qi; Wed, 26 Aug 2026 07:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1399682;
 Wed, 26 Aug 2026 07:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wz8Ts-0007gg-Mo
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 07:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz8Ts-006Y1n-2z
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wz8Ts-000bvg-1z
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 07:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gYDNVGGEQnU/EoAbdtflo2kiuf30EGAQW8ndG3DaY/4=; b=zOKteEXuOF3BKlq1KoUyEarIoR
	decOpgFBCIagKpRpfGRRzYbPZcGqatUMSaeYPwmashoyadOiy18jxuWXJYHP4zU1W4pIPmnqPjl4s
	aQd8Mqq+Yn8GY45FJfh3IB9LvOeruwXSfdnUQ3Uf0aDUaLC5UqIfNM2YNM9fXKDzBMYY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: add myself as reviewer of i.MX8M related patches
Message-Id: <E1wz8Ts-000bvg-1z@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 07:55:32 +0000

commit 6b8c423472dac216ca57fdbeba2787813b08c5a5
Author:     Wig Cheng <onlywig@gmail.com>
AuthorDate: Wed Aug 19 23:28:21 2026 +0800
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Aug 26 08:23:44 2026 +0200

    MAINTAINERS: add myself as reviewer of i.MX8M related patches
    
    I wrote the i.MX8M platform and UART support and can help review
    patches touching these areas.
    
    Signed-off-by: Wig Cheng <onlywig@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4dd97ffcad..c60afc93a5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -365,6 +365,13 @@ F:	tools/misc/xenhypfs.c
 F:	xen/common/hypfs.c
 F:	xen/include/xen/hypfs.h
 
+IMX8M SUPPORT
+R:	Wig Cheng <onlywig@gmail.com>
+F:	xen/arch/arm/arm64/debug-imx-uart.inc
+F:	xen/arch/arm/include/asm/imx-uart.h
+F:	xen/arch/arm/platforms/imx8m.c
+F:	xen/drivers/char/imx-uart.c
+
 IMX8QM/QXP SUPPORT
 R:	John Ernberg <john.ernberg@actia.se>
 F:	xen/arch/arm/platforms/imx8qm.c
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 09:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 09:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399774.1635754 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzALW-00018G-PB; Wed, 26 Aug 2026 09:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399774.1635754; Wed, 26 Aug 2026 09: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 1wzALW-000188-M0; Wed, 26 Aug 2026 09:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1399774;
 Wed, 26 Aug 2026 09:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzALW-000182-33
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 09:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzALV-006auH-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 09:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzALV-00798n-2D
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 09:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+0ParpcUT6hYzJEA+2XA6QPPi27T/rLB5LN7qob57q4=; b=sTDmfxYEavGkVCIjc3zA/JN3md
	SrgjUaRsEYAtRoadV7yUbMynln0PDX1cWRyoMdt4apFxgeIPgmBKe5zRjZ4/Tt1lrDH2ZDdu3YyGW
	DbK4OVYlmKzXvExhN++9rbI3f7Pzzw57D7q1ciDXpa0pZd9a/TYvRZos6SD94L3/lyBA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pci: prevent cross-device accesses in pci_mmcfg_{read,write}()
Message-Id: <E1wzALV-00798n-2D@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 09:55:01 +0000

commit 6acdfad3da51aa7ed716bee9bf7a39bba1fe47f7
Author:     Roger Pau Monne <roger@xenproject.org>
AuthorDate: Thu Aug 6 16:44:19 2026 +0200
Commit:     Roger Pau Monne <roger@xenproject.org>
CommitDate: Wed Aug 26 11:50:42 2026 +0200

    x86/pci: prevent cross-device accesses in pci_mmcfg_{read,write}()
    
    Introduce a specific check that prevents an accesses from spilling across
    two devices.
    
    Signed-off-by: Roger Pau Monné <roger@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/x86/x86_64/mmconfig_64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/mmconfig_64.c b/xen/arch/x86/x86_64/mmconfig_64.c
index 940cf6d747..91b1a398e6 100644
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -61,7 +61,8 @@ int pci_mmcfg_read(unsigned int seg, unsigned int bus,
     char __iomem *addr;
 
     /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
-    if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
+    if (unlikely((bus > 255) || (devfn > 255) ||
+                 (reg + len > PCI_CFG_SPACE_EXP_SIZE))) {
 err:        *value = -1;
         return -EINVAL;
     }
@@ -91,7 +92,8 @@ int pci_mmcfg_write(unsigned int seg, unsigned int bus,
     char __iomem *addr;
 
     /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
-    if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
+    if (unlikely((bus > 255) || (devfn > 255) ||
+                 (reg + len > PCI_CFG_SPACE_EXP_SIZE)))
         return -EINVAL;
 
     addr = pci_dev_base(seg, bus, devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 09:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 09:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399775.1635757 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzALg-00019y-QH; Wed, 26 Aug 2026 09:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399775.1635757; Wed, 26 Aug 2026 09:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzALg-00019q-NN; Wed, 26 Aug 2026 09:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1399775;
 Wed, 26 Aug 2026 09:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzALf-00019k-TH
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 09:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzALg-006auc-0Q
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 09:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzALf-0079qe-2e
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 09:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+4cfXf33I+jDB78r2uXyOTBBv+X6TVkMm3dXCIxC4wA=; b=1m1S5m+TzUrSnQxp9NDJh8zdVn
	A8Ew48XerFc+aXlVOvTh6/7W99ewd+UDNYYFFyxtRo/5xd7D9bTyt4bwUMJXy6wfSd55we0LSj8RG
	A/bONmbxCXcotbmRv65UjuYdX71SgFzKh4Gl50ctfA6bTkCUf10/vxcmxD4o2rmkjNYg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/vpci: allow unaligned accesses by the hardware domain
Message-Id: <E1wzALf-0079qe-2e@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 09:55:11 +0000

commit 79175b13906936855ae354f696f16093e5e29446
Author:     Roger Pau Monne <roger@xenproject.org>
AuthorDate: Thu Jul 30 10:07:06 2026 +0200
Commit:     Roger Pau Monne <roger@xenproject.org>
CommitDate: Wed Aug 26 11:50:42 2026 +0200

    xen/vpci: allow unaligned accesses by the hardware domain
    
    It's possible for domains to generate unaligned PCI config space accesses
    when using ECAM, and hence vPCI should support those at least for the
    hardware domain.  Such unaligned accesses to the PCI config space have been
    reported to come from ACPI logic.
    
    Relax the checking in vpci_access_allowed() to allow such accesses for the
    hardware domain, and fix the handling in pci_conf_{read,write}{16,32}() to
    fulfill them using MMCFG.
    
    MMCFG regions are identity exposed to the hardware domain, and hence such
    unaligned accesses can only come as a result of the host having MMCFG in the
    first place, as otherwise MMCFG won't be exposed to the hardware domain
    either.
    
    Note that vpci_ecam_{read,write}() already refuse accesses that cross a
    device boundary unconditionally.
    
    Reported-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Roger Pau Monné <roger@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 tools/include/xen-tools/common-macros.h | 2 ++
 xen/arch/x86/x86_64/pci.c               | 8 ++++----
 xen/drivers/vpci/vpci.c                 | 6 ++++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-tools/common-macros.h
index 88b4a0e5a6..1f9146b23b 100644
--- a/tools/include/xen-tools/common-macros.h
+++ b/tools/include/xen-tools/common-macros.h
@@ -68,6 +68,8 @@
     })
 #endif
 
+#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
+
 #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
 #define ROUNDDOWN(x, a) ((x) & ~((a) - 1))
 
diff --git a/xen/arch/x86/x86_64/pci.c b/xen/arch/x86/x86_64/pci.c
index 8d33429103..6298141c3c 100644
--- a/xen/arch/x86/x86_64/pci.c
+++ b/xen/arch/x86/x86_64/pci.c
@@ -26,7 +26,7 @@ uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg)
 
 uint16_t pci_conf_read16(pci_sbdf_t sbdf, unsigned int reg)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 2) )
     {
         uint32_t value;
 
@@ -39,7 +39,7 @@ uint16_t pci_conf_read16(pci_sbdf_t sbdf, unsigned int reg)
 
 uint32_t pci_conf_read32(pci_sbdf_t sbdf, unsigned int reg)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 4) )
     {
         uint32_t value;
 
@@ -60,7 +60,7 @@ void pci_conf_write8(pci_sbdf_t sbdf, unsigned int reg, uint8_t data)
 
 void pci_conf_write16(pci_sbdf_t sbdf, unsigned int reg, uint16_t data)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 2) )
         pci_mmcfg_write(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 2, data);
     else
         pci_conf_write(PCI_CONF_ADDRESS(sbdf, reg), reg & 2, 2, data);
@@ -68,7 +68,7 @@ void pci_conf_write16(pci_sbdf_t sbdf, unsigned int reg, uint16_t data)
 
 void pci_conf_write32(pci_sbdf_t sbdf, unsigned int reg, uint32_t data)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 4) )
         pci_mmcfg_write(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 4, data);
     else
         pci_conf_write(PCI_CONF_ADDRESS(sbdf, reg), 0, 4, data);
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index 0ac9ec8b04..9e2c27e3a3 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -685,6 +685,8 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
 /* Helper function to check an access size and alignment on vpci space. */
 bool vpci_access_allowed(unsigned int reg, unsigned int len)
 {
+    const struct domain *currd = current->domain;
+
     /* Check access size. */
     if ( len != 1 && len != 2 && len != 4 && len != 8 )
         return false;
@@ -695,8 +697,8 @@ bool vpci_access_allowed(unsigned int reg, unsigned int len)
         return false;
 #endif
 
-    /* Check that access is size aligned. */
-    if ( (reg & (len - 1)) )
+    /* Refuse unaligned accesses for non-hardware domains. */
+    if ( !is_hardware_domain(currd) && !IS_ALIGNED(reg, len) )
         return false;
 
     return true;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 11:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 11:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399802.1635779 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzBX6-0004bH-Bj; Wed, 26 Aug 2026 11:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399802.1635779; Wed, 26 Aug 2026 11: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 1wzBX6-0004b9-9C; Wed, 26 Aug 2026 11:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1399802;
 Wed, 26 Aug 2026 11:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzBX4-0004b3-Rj
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 11:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzBX4-006ce1-27
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 11:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzBX4-00COC3-15
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 11:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rmzP3OxtORiVa4l+bisp+Vi5kTdSQCoVx9TlcQtPz7E=; b=AXU+ugYNgsuEg0DxKNXpn8k//X
	KKth0eCBnmoF4KQ+/hF/H7bj/OP97Zv+PxwZzGAYL7QUZYX+EpqOZSz2Z705pfUSXqQzg/8A5Vudr
	OktukRclDga90rJ642bRc0v3gpzWJuC716Ji5LKpAFckNN88sEVwDFzIvcFXmZg4ZnC4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pci: prevent cross-device accesses in pci_mmcfg_{read,write}()
Message-Id: <E1wzBX4-00COC3-15@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 11:11:02 +0000

commit 6acdfad3da51aa7ed716bee9bf7a39bba1fe47f7
Author:     Roger Pau Monne <roger@xenproject.org>
AuthorDate: Thu Aug 6 16:44:19 2026 +0200
Commit:     Roger Pau Monne <roger@xenproject.org>
CommitDate: Wed Aug 26 11:50:42 2026 +0200

    x86/pci: prevent cross-device accesses in pci_mmcfg_{read,write}()
    
    Introduce a specific check that prevents an accesses from spilling across
    two devices.
    
    Signed-off-by: Roger Pau Monné <roger@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/x86/x86_64/mmconfig_64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/mmconfig_64.c b/xen/arch/x86/x86_64/mmconfig_64.c
index 940cf6d747..91b1a398e6 100644
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -61,7 +61,8 @@ int pci_mmcfg_read(unsigned int seg, unsigned int bus,
     char __iomem *addr;
 
     /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
-    if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
+    if (unlikely((bus > 255) || (devfn > 255) ||
+                 (reg + len > PCI_CFG_SPACE_EXP_SIZE))) {
 err:        *value = -1;
         return -EINVAL;
     }
@@ -91,7 +92,8 @@ int pci_mmcfg_write(unsigned int seg, unsigned int bus,
     char __iomem *addr;
 
     /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
-    if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
+    if (unlikely((bus > 255) || (devfn > 255) ||
+                 (reg + len > PCI_CFG_SPACE_EXP_SIZE)))
         return -EINVAL;
 
     addr = pci_dev_base(seg, bus, devfn);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 11:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 11:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399803.1635784 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzBXG-0004d5-Db; Wed, 26 Aug 2026 11:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1399803.1635784; Wed, 26 Aug 2026 11: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 1wzBXG-0004cv-AZ; Wed, 26 Aug 2026 11:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1399803;
 Wed, 26 Aug 2026 11:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzBXE-0004cm-HC
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 2026 11:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzBXE-006ce7-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 11:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzBXE-00CP25-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 11:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5KI9K9G/RgQWBnUO80dqdFu6O2I8N91SVtyLJEqdpk0=; b=qbXO5G+WW7oXro+VAjI5vkfm1m
	q+HOVFyPgBnWa5qY1GjGn3KXpsaOH2KqZ2ao7CpfrHSplSA6A8YcED2pgcleF7IsvShaHizUfOl0Q
	18dP4OnncO+SoP4f8c0jdLkb23oNlbck4DTzdIGBbp7r5s1ctFy4UgOhl719MeMYQKhc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vpci: allow unaligned accesses by the hardware domain
Message-Id: <E1wzBXE-00CP25-1U@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 11:11:12 +0000

commit 79175b13906936855ae354f696f16093e5e29446
Author:     Roger Pau Monne <roger@xenproject.org>
AuthorDate: Thu Jul 30 10:07:06 2026 +0200
Commit:     Roger Pau Monne <roger@xenproject.org>
CommitDate: Wed Aug 26 11:50:42 2026 +0200

    xen/vpci: allow unaligned accesses by the hardware domain
    
    It's possible for domains to generate unaligned PCI config space accesses
    when using ECAM, and hence vPCI should support those at least for the
    hardware domain.  Such unaligned accesses to the PCI config space have been
    reported to come from ACPI logic.
    
    Relax the checking in vpci_access_allowed() to allow such accesses for the
    hardware domain, and fix the handling in pci_conf_{read,write}{16,32}() to
    fulfill them using MMCFG.
    
    MMCFG regions are identity exposed to the hardware domain, and hence such
    unaligned accesses can only come as a result of the host having MMCFG in the
    first place, as otherwise MMCFG won't be exposed to the hardware domain
    either.
    
    Note that vpci_ecam_{read,write}() already refuse accesses that cross a
    device boundary unconditionally.
    
    Reported-by: Jason Andryuk <jason.andryuk@amd.com>
    Signed-off-by: Roger Pau Monné <roger@xenproject.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 tools/include/xen-tools/common-macros.h | 2 ++
 xen/arch/x86/x86_64/pci.c               | 8 ++++----
 xen/drivers/vpci/vpci.c                 | 6 ++++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-tools/common-macros.h
index 88b4a0e5a6..1f9146b23b 100644
--- a/tools/include/xen-tools/common-macros.h
+++ b/tools/include/xen-tools/common-macros.h
@@ -68,6 +68,8 @@
     })
 #endif
 
+#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
+
 #define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
 #define ROUNDDOWN(x, a) ((x) & ~((a) - 1))
 
diff --git a/xen/arch/x86/x86_64/pci.c b/xen/arch/x86/x86_64/pci.c
index 8d33429103..6298141c3c 100644
--- a/xen/arch/x86/x86_64/pci.c
+++ b/xen/arch/x86/x86_64/pci.c
@@ -26,7 +26,7 @@ uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg)
 
 uint16_t pci_conf_read16(pci_sbdf_t sbdf, unsigned int reg)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 2) )
     {
         uint32_t value;
 
@@ -39,7 +39,7 @@ uint16_t pci_conf_read16(pci_sbdf_t sbdf, unsigned int reg)
 
 uint32_t pci_conf_read32(pci_sbdf_t sbdf, unsigned int reg)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 4) )
     {
         uint32_t value;
 
@@ -60,7 +60,7 @@ void pci_conf_write8(pci_sbdf_t sbdf, unsigned int reg, uint8_t data)
 
 void pci_conf_write16(pci_sbdf_t sbdf, unsigned int reg, uint16_t data)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 2) )
         pci_mmcfg_write(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 2, data);
     else
         pci_conf_write(PCI_CONF_ADDRESS(sbdf, reg), reg & 2, 2, data);
@@ -68,7 +68,7 @@ void pci_conf_write16(pci_sbdf_t sbdf, unsigned int reg, uint16_t data)
 
 void pci_conf_write32(pci_sbdf_t sbdf, unsigned int reg, uint32_t data)
 {
-    if ( sbdf.seg || reg > 255 )
+    if ( sbdf.seg || reg > 255 || !IS_ALIGNED(reg, 4) )
         pci_mmcfg_write(sbdf.seg, sbdf.bus, sbdf.devfn, reg, 4, data);
     else
         pci_conf_write(PCI_CONF_ADDRESS(sbdf, reg), 0, 4, data);
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index 0ac9ec8b04..9e2c27e3a3 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -685,6 +685,8 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
 /* Helper function to check an access size and alignment on vpci space. */
 bool vpci_access_allowed(unsigned int reg, unsigned int len)
 {
+    const struct domain *currd = current->domain;
+
     /* Check access size. */
     if ( len != 1 && len != 2 && len != 4 && len != 8 )
         return false;
@@ -695,8 +697,8 @@ bool vpci_access_allowed(unsigned int reg, unsigned int len)
         return false;
 #endif
 
-    /* Check that access is size aligned. */
-    if ( (reg & (len - 1)) )
+    /* Refuse unaligned accesses for non-hardware domains. */
+    if ( !is_hardware_domain(currd) && !IS_ALIGNED(reg, len) )
         return false;
 
     return true;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 13:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 13:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399947.1635924 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzDvA-00069Z-0h; Wed, 26 Aug 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 1399947.1635924; Wed, 26 Aug 2026 13:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzDv9-00069R-Tr; Wed, 26 Aug 2026 13:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1399947;
 Wed, 26 Aug 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 1wzDv8-00069L-QL
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 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 1wzDv8-006fgv-2j
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzDv8-009TW6-1R
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 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=8pWp6DQ3rV8+r80HlNhuD8L6I13n0/3e1gWAoVOdJBI=; b=UcjxC9bPw0kAj5gt6gVDJCoRcq
	QJ/qlAp5orvQ+bfMtCV/0WXaHcuhyvjs/lwkTFqoSjB/IywEoCJit19spg/c7E2BZBP361BEp4zgu
	sWB7U3UCP2VVBb+ev0qGbq79GFuD4U7JcOY967kZN8Ld0r2pOMkb6s8uXvBNsv/0FJu8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul/fuzz: sanitize CR4 values
Message-Id: <E1wzDv8-009TW6-1R@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 13:44:02 +0000

commit 829d67e244e211216226bc0b9d1912a413ffe4c2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 26 14:14:03 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 26 14:14:03 2026 +0200

    x86emul/fuzz: sanitize CR4 values
    
    While the CPU policy is obtained from hardware, the CRn values to start
    with are taken from fuzzed input. Since most CR4 bits can only be set when
    the respective feature is indicated as available by CPUID, the emulator
    often only checks the CR4 bit. Without sanitization, assertions like the
    one in emul_test_read_xcr() (checking XSAVE support) could therefore
    trigger.
    
    Omit most paging-only bits from sanitization, as the core emulator doesn't
    itself walk page tables. LA57 wants checking for the bit being used by
    CANONICALIZE_MAYBE().
    
    Reported-by: Andrew Mbugua <andrewprecious388@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/x86_instruction_emulator/fuzz-emul.c | 111 +++++++++++++++++++++++-
 1 file changed, 109 insertions(+), 2 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
index a797d17fe5..dec4790aa6 100644
--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
+++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
@@ -824,6 +824,58 @@ static void sanitize_input(struct x86_emulate_ctxt *ctxt)
     regs->error_code = 0;
     regs->entry_vector = 0;
 
+    /*
+     * Most CR4 bits can only be set when corresponding CPUID bits are set.
+     * (In such cases the emulator may only check the CR4 bit.)
+     */
+    if ( !cpu_policy.basic.vme )
+        c->cr[4] &= ~(X86_CR4_VME | X86_CR4_PVI);
+
+    if ( !cpu_policy.basic.tsc )
+        c->cr[4] &= ~X86_CR4_TSD;
+
+    if ( !cpu_policy.basic.de )
+        c->cr[4] &= ~X86_CR4_DE;
+
+    if ( !cpu_policy.basic.fxsr )
+        c->cr[4] &= ~X86_CR4_OSFXSR;
+
+    if ( !cpu_policy.basic.sse )
+        c->cr[4] &= ~X86_CR4_OSXMMEXCPT;
+
+    if ( !cpu_policy.feat.umip )
+        c->cr[4] &= ~X86_CR4_UMIP;
+
+    if ( !cpu_policy.feat.la57 )
+        c->cr[4] &= ~X86_CR4_LA57;
+
+    if ( !cpu_policy.basic.vmx )
+        c->cr[4] &= ~X86_CR4_VMXE;
+
+    if ( !cpu_policy.basic.smx )
+        c->cr[4] &= ~X86_CR4_SMXE;
+
+    if ( !cpu_policy.feat.fsgsbase )
+        c->cr[4] &= ~X86_CR4_FSGSBASE;
+
+    if ( !cpu_policy.basic.pcid )
+        c->cr[4] &= ~X86_CR4_PCIDE;
+
+    if ( !cpu_policy.basic.xsave || !cpu_has_xsave )
+        c->cr[4] &= ~X86_CR4_OSXSAVE;
+
+    if ( !cpu_policy.feat.pku )
+        c->cr[4] &= ~X86_CR4_PKE;
+
+    if ( !cpu_policy.feat.cet_ss && !cpu_policy.feat.cet_ibt )
+        c->cr[4] &= ~X86_CR4_CET;
+
+    if ( !cpu_policy.feat.pks )
+        c->cr[4] &= ~X86_CR4_PKS;
+
+    if ( !cpu_policy.feat.fred )
+        c->cr[4] &= ~X86_CR4_FRED;
+
     /*
      * For both RIP and RSP make sure we test with canonical values in at
      * least a fair number of cases. As all other registers aren't tied to
@@ -839,10 +891,14 @@ static void sanitize_input(struct x86_emulate_ctxt *ctxt)
     if ( c->cr[0] & X86_CR0_PG )
         c->cr[0] |= X86_CR0_PE;
 
-    /* EFLAGS.VM not available in long mode */
+    /* EFLAGS.VM not available in long mode, but CR4.PAE is required. */
     if ( long_mode_active(ctxt) )
+    {
         regs->rflags &= ~X86_EFLAGS_VM;
 
+        c->cr[4] |= X86_CR4_PAE;
+    }
+
     /* EFLAGS.VM implies 16-bit mode */
     if ( regs->rflags & X86_EFLAGS_VM )
     {
@@ -862,12 +918,63 @@ static bool check_state(struct x86_emulate_ctxt *ctxt)
     const struct fuzz_corpus *c = s->corpus;
     const struct cpu_user_regs *regs = &c->regs;
 
-    if ( long_mode_active(ctxt) && !(c->cr[0] & X86_CR0_PG) )
+    if ( long_mode_active(ctxt) &&
+         (!(c->cr[0] & X86_CR0_PG) || !(c->cr[4] & X86_CR4_PAE)) )
         return false;
 
     if ( (c->cr[0] & X86_CR0_PG) && !(c->cr[0] & X86_CR0_PE) )
         return false;
 
+    if ( (c->cr[4] & (X86_CR4_VME | X86_CR4_PVI)) && !cpu_policy.basic.vme )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_TSD) && !cpu_policy.basic.tsc )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_DE) && !cpu_policy.basic.de )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_OSFXSR) && !cpu_policy.basic.fxsr )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_OSXMMEXCPT) && !cpu_policy.basic.sse )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_UMIP) && !cpu_policy.feat.umip )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_LA57) && !cpu_policy.feat.la57 )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_VMXE) && !cpu_policy.basic.vmx )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_SMXE) && !cpu_policy.basic.smx )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_FSGSBASE) && !cpu_policy.feat.fsgsbase )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_PCIDE) && !cpu_policy.basic.pcid )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_OSXSAVE) &&
+         (!cpu_policy.basic.xsave || !cpu_has_xsave) )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_PKE) && !cpu_policy.feat.pku )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_CET) &&
+         !cpu_policy.feat.cet_ss && !cpu_policy.feat.cet_ibt )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_PKS) && !cpu_policy.feat.pks )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_FRED) && !cpu_policy.feat.fred )
+        return false;
+
     if ( (regs->rflags & X86_EFLAGS_VM) &&
          (c->segments[x86_seg_cs].db || c->segments[x86_seg_ss].db) )
         return false;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 13:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399948.1635927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzDvK-0006BH-1l; Wed, 26 Aug 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 1399948.1635927; Wed, 26 Aug 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 1wzDvJ-0006B9-VE; Wed, 26 Aug 2026 13:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1399948;
 Wed, 26 Aug 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 1wzDvI-0006B1-OC
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 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 1wzDvI-006fh5-39
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzDvI-009Uhj-28
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 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=Ty9DinS/HZe/SoObAoadc46KKV6CUaJ7elzSGt7Bw9E=; b=jGiCoRfD5auCBMSgr/GAAweW01
	405O2rbS43g1LwvzReKDyhfXFIKDf8gdIB1bE0DcjiqimMBbLaSKA5gJrHtiT5nCEJxQx3xv8rhzq
	jfQCYV46M8Uczd+Ss7ZhvBPVALvM60mEm0tXdTfNsf594htgY6EsAummYM/cW99jXoC0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()
Message-Id: <E1wzDvI-009Uhj-28@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 13:44:12 +0000

commit bf8a74a3e107044eafd7174cf21286cda8f45c66
Author:     Jiaqing Zhao <Zhao.Jiaqing@amd.com>
AuthorDate: Wed Aug 26 14:14:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 26 14:14:20 2026 +0200

    x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()
    
    Hypervisor leaf 5 is PV-specific, but is gated with !is_hvm_domain(),
    which stays a runtime test in a build without PV support. Test for a
    PV domain directly so the compiler can discard the leaf when
    CONFIG_PV is disabled.
    
    Suggested-by: Roger Pau Monné <roger@xenproject.org>
    Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 6e9b15c9c3..a9aeb2d268 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -157,7 +157,7 @@ static void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf,
         break;
 
     case 5: /* PV-specific parameters */
-        if ( is_hvm_domain(d) || subleaf != 0 )
+        if ( !is_pv_domain(d) || subleaf != 0 )
             break;
 
         res->b = flsl(get_upper_mfn_bound()) + PAGE_SHIFT;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 14:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 14:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399986.1635949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzErD-0006sn-E0; Wed, 26 Aug 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 1399986.1635949; Wed, 26 Aug 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 1wzErD-0006sg-BB; Wed, 26 Aug 2026 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1399986;
 Wed, 26 Aug 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 1wzErC-0006sY-FT
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 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 1wzErC-006gyp-1E
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzErC-0010MO-0D
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 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=vdlpKpo0rmrBCoB4xTY17p4/26Gd/Cp0p6M2OvhRnzk=; b=uS2ck2mle0rz9fSloDDJduSuCj
	I/pSURaxgp7LLRr/7BgyV5DhX3SE6BoT/K8XwI0xyGivv7xtnTPaC3xbOhgbd03aFepPpg/bJ6D8n
	l7wKaEl9uOztjHFozg2PnGG8TsKYY8YF2Qhw02ERSvVnypEeUbynBmhrBTwovf9N7MnU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul/fuzz: sanitize CR4 values
Message-Id: <E1wzErC-0010MO-0D@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 14:44:02 +0000

commit 829d67e244e211216226bc0b9d1912a413ffe4c2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Aug 26 14:14:03 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 26 14:14:03 2026 +0200

    x86emul/fuzz: sanitize CR4 values
    
    While the CPU policy is obtained from hardware, the CRn values to start
    with are taken from fuzzed input. Since most CR4 bits can only be set when
    the respective feature is indicated as available by CPUID, the emulator
    often only checks the CR4 bit. Without sanitization, assertions like the
    one in emul_test_read_xcr() (checking XSAVE support) could therefore
    trigger.
    
    Omit most paging-only bits from sanitization, as the core emulator doesn't
    itself walk page tables. LA57 wants checking for the bit being used by
    CANONICALIZE_MAYBE().
    
    Reported-by: Andrew Mbugua <andrewprecious388@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/x86_instruction_emulator/fuzz-emul.c | 111 +++++++++++++++++++++++-
 1 file changed, 109 insertions(+), 2 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
index a797d17fe5..dec4790aa6 100644
--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
+++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
@@ -824,6 +824,58 @@ static void sanitize_input(struct x86_emulate_ctxt *ctxt)
     regs->error_code = 0;
     regs->entry_vector = 0;
 
+    /*
+     * Most CR4 bits can only be set when corresponding CPUID bits are set.
+     * (In such cases the emulator may only check the CR4 bit.)
+     */
+    if ( !cpu_policy.basic.vme )
+        c->cr[4] &= ~(X86_CR4_VME | X86_CR4_PVI);
+
+    if ( !cpu_policy.basic.tsc )
+        c->cr[4] &= ~X86_CR4_TSD;
+
+    if ( !cpu_policy.basic.de )
+        c->cr[4] &= ~X86_CR4_DE;
+
+    if ( !cpu_policy.basic.fxsr )
+        c->cr[4] &= ~X86_CR4_OSFXSR;
+
+    if ( !cpu_policy.basic.sse )
+        c->cr[4] &= ~X86_CR4_OSXMMEXCPT;
+
+    if ( !cpu_policy.feat.umip )
+        c->cr[4] &= ~X86_CR4_UMIP;
+
+    if ( !cpu_policy.feat.la57 )
+        c->cr[4] &= ~X86_CR4_LA57;
+
+    if ( !cpu_policy.basic.vmx )
+        c->cr[4] &= ~X86_CR4_VMXE;
+
+    if ( !cpu_policy.basic.smx )
+        c->cr[4] &= ~X86_CR4_SMXE;
+
+    if ( !cpu_policy.feat.fsgsbase )
+        c->cr[4] &= ~X86_CR4_FSGSBASE;
+
+    if ( !cpu_policy.basic.pcid )
+        c->cr[4] &= ~X86_CR4_PCIDE;
+
+    if ( !cpu_policy.basic.xsave || !cpu_has_xsave )
+        c->cr[4] &= ~X86_CR4_OSXSAVE;
+
+    if ( !cpu_policy.feat.pku )
+        c->cr[4] &= ~X86_CR4_PKE;
+
+    if ( !cpu_policy.feat.cet_ss && !cpu_policy.feat.cet_ibt )
+        c->cr[4] &= ~X86_CR4_CET;
+
+    if ( !cpu_policy.feat.pks )
+        c->cr[4] &= ~X86_CR4_PKS;
+
+    if ( !cpu_policy.feat.fred )
+        c->cr[4] &= ~X86_CR4_FRED;
+
     /*
      * For both RIP and RSP make sure we test with canonical values in at
      * least a fair number of cases. As all other registers aren't tied to
@@ -839,10 +891,14 @@ static void sanitize_input(struct x86_emulate_ctxt *ctxt)
     if ( c->cr[0] & X86_CR0_PG )
         c->cr[0] |= X86_CR0_PE;
 
-    /* EFLAGS.VM not available in long mode */
+    /* EFLAGS.VM not available in long mode, but CR4.PAE is required. */
     if ( long_mode_active(ctxt) )
+    {
         regs->rflags &= ~X86_EFLAGS_VM;
 
+        c->cr[4] |= X86_CR4_PAE;
+    }
+
     /* EFLAGS.VM implies 16-bit mode */
     if ( regs->rflags & X86_EFLAGS_VM )
     {
@@ -862,12 +918,63 @@ static bool check_state(struct x86_emulate_ctxt *ctxt)
     const struct fuzz_corpus *c = s->corpus;
     const struct cpu_user_regs *regs = &c->regs;
 
-    if ( long_mode_active(ctxt) && !(c->cr[0] & X86_CR0_PG) )
+    if ( long_mode_active(ctxt) &&
+         (!(c->cr[0] & X86_CR0_PG) || !(c->cr[4] & X86_CR4_PAE)) )
         return false;
 
     if ( (c->cr[0] & X86_CR0_PG) && !(c->cr[0] & X86_CR0_PE) )
         return false;
 
+    if ( (c->cr[4] & (X86_CR4_VME | X86_CR4_PVI)) && !cpu_policy.basic.vme )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_TSD) && !cpu_policy.basic.tsc )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_DE) && !cpu_policy.basic.de )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_OSFXSR) && !cpu_policy.basic.fxsr )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_OSXMMEXCPT) && !cpu_policy.basic.sse )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_UMIP) && !cpu_policy.feat.umip )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_LA57) && !cpu_policy.feat.la57 )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_VMXE) && !cpu_policy.basic.vmx )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_SMXE) && !cpu_policy.basic.smx )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_FSGSBASE) && !cpu_policy.feat.fsgsbase )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_PCIDE) && !cpu_policy.basic.pcid )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_OSXSAVE) &&
+         (!cpu_policy.basic.xsave || !cpu_has_xsave) )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_PKE) && !cpu_policy.feat.pku )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_CET) &&
+         !cpu_policy.feat.cet_ss && !cpu_policy.feat.cet_ibt )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_PKS) && !cpu_policy.feat.pks )
+        return false;
+
+    if ( (c->cr[4] & X86_CR4_FRED) && !cpu_policy.feat.fred )
+        return false;
+
     if ( (regs->rflags & X86_EFLAGS_VM) &&
          (c->segments[x86_seg_cs].db || c->segments[x86_seg_ss].db) )
         return false;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Aug 26 14:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 26 Aug 2026 14:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1399987.1635952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzErN-0006uh-F8; Wed, 26 Aug 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 1399987.1635952; Wed, 26 Aug 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 1wzErN-0006uZ-Cf; Wed, 26 Aug 2026 14:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1399987;
 Wed, 26 Aug 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 1wzErM-0006uP-9W
 for xen-changelog@lists.xenproject.org; Wed, 26 Aug 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 1wzErM-006gyy-1g
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 2026 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzErM-0012CV-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 26 Aug 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=3pyFIAqoF9ZbMK5YJjHPDJvOzkfLuDUZ7mjSy7FGwCk=; b=y4rCV8n8N4CCaihu85TkptNQX9
	PAm8dNadVN/HKlVqMTTAPb2Vg+xQ9R8jxROKT6gzT94GapJF+xTXv36DPZbhJgTmWN2CFiUGtvDWN
	2hR8NoLDkvxqekkdAPInfdHh1lqx+SFCFa6mGchAOKMnSl5v7OchwakSHTVsLFyaM9x8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()
Message-Id: <E1wzErM-0012CV-0i@xenbits.xenproject.org>
Date: Wed, 26 Aug 2026 14:44:12 +0000

commit bf8a74a3e107044eafd7174cf21286cda8f45c66
Author:     Jiaqing Zhao <Zhao.Jiaqing@amd.com>
AuthorDate: Wed Aug 26 14:14:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Aug 26 14:14:20 2026 +0200

    x86/cpuid: gate the hypervisor PV-only leaf on is_pv_domain()
    
    Hypervisor leaf 5 is PV-specific, but is gated with !is_hvm_domain(),
    which stays a runtime test in a build without PV support. Test for a
    PV domain directly so the compiler can discard the leaf when
    CONFIG_PV is disabled.
    
    Suggested-by: Roger Pau Monné <roger@xenproject.org>
    Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 6e9b15c9c3..a9aeb2d268 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -157,7 +157,7 @@ static void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf,
         break;
 
     case 5: /* PV-specific parameters */
-        if ( is_hvm_domain(d) || subleaf != 0 )
+        if ( !is_pv_domain(d) || subleaf != 0 )
             break;
 
         res->b = flsl(get_upper_mfn_bound()) + PAGE_SHIFT;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 07:22:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 07:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400355.1636032 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzUR1-0000qW-LO; Thu, 27 Aug 2026 07:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400355.1636032; Thu, 27 Aug 2026 07:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzUR1-0000qO-Ip; Thu, 27 Aug 2026 07:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1400355;
 Thu, 27 Aug 2026 07:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzUR0-0000qI-Ks
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 07:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzUR0-008Den-1y
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 07:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzUR0-001Yua-0w
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 07:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qNTj1mcFv5thq+M1uke2P0lPVmTumS+2W65W25K/dVU=; b=XkazFVL4mXy8/Zyqxg06dr/8Fc
	RHCApFFNonnNP9bzDHXXei2pxl4JWRgUNoR+Asc30ne4h6sOz75UYhIH+pHqECNF0qpQy5De1bVGW
	gfJ9JvDyXfdNuEj21Lnvsnc8FigC919dYppXzMDW9/OHebEMtFBk5eKgD4pRw8luvwAo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: Un-indent the HVM_FEP block in the #UD handler
Message-Id: <E1wzUR0-001Yua-0w@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 07:22:02 +0000

commit 673806d02e76629b4a6d0b145adc76af5b660aae
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Aug 27 08:05:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 27 08:05:53 2026 +0200

    x86/hvm: Un-indent the HVM_FEP block in the #UD handler
    
    FEP is now the only reason for the #UD handler to run.
    
    While the #UD handler is unreachable when CONFIG_HVM_FEP is disabled, it's
    helpful to keep the function around. Reinject #UD in the non-FEP case so
    DCE can remove the rest.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c | 59 +++++++++++++++++++++++++-------------------------
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 955fc062a5..9a4147b62e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3833,49 +3833,48 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
 void hvm_ud_intercept(struct cpu_user_regs *regs)
 {
     struct vcpu *cur = current;
-    bool should_emulate = false;
     struct hvm_emulate_ctxt ctxt;
+    const struct segment_register *cs;
+    uint32_t walk;
+    unsigned long addr;
+    char sig[5]; /* ud2; .ascii "xen" */
 
-    hvm_emulate_init_once(&ctxt, NULL, regs);
-
-    if ( opt_hvm_fep )
+    if ( !opt_hvm_fep )
     {
-        const struct segment_register *cs = &ctxt.seg_reg[x86_seg_cs];
-        uint32_t walk = ((ctxt.seg_reg[x86_seg_ss].dpl == 3)
-                         ? PFEC_user_mode : 0) | PFEC_insn_fetch;
-        unsigned long addr;
-        char sig[5]; /* ud2; .ascii "xen" */
-
-        if ( hvm_virtual_to_linear_addr(x86_seg_cs, cs, regs->rip,
-                                        sizeof(sig), hvm_access_insn_fetch,
-                                        cs, &addr) &&
-             (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
-                                         walk, NULL) == HVMTRANS_okay) &&
-             (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )
-        {
-            regs->rip += sizeof(sig);
-            regs->eflags &= ~X86_EFLAGS_RF;
+        ASSERT_UNREACHABLE();
+        goto reinject;
+    }
 
-            /* Zero the upper 32 bits of %rip if not in 64bit mode. */
-            if ( !(hvm_long_mode_active(cur) && cs->l) )
-                regs->rip = (uint32_t)regs->rip;
+    hvm_emulate_init_once(&ctxt, NULL, regs);
 
-            add_taint(TAINT_HVM_FEP);
+    cs = &ctxt.seg_reg[x86_seg_cs];
+    walk = ((ctxt.seg_reg[x86_seg_ss].dpl == 3)
+            ? PFEC_user_mode : 0) | PFEC_insn_fetch;
 
-            should_emulate = true;
-        }
-    }
-
-    if ( !should_emulate )
+    if ( hvm_virtual_to_linear_addr(x86_seg_cs, cs, regs->rip,
+                                    sizeof(sig), hvm_access_insn_fetch,
+                                    cs, &addr) &&
+         (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
+                                     walk, NULL) == HVMTRANS_okay) &&
+         (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )
     {
-        hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
-        return;
+        regs->rip += sizeof(sig);
+        regs->eflags &= ~X86_EFLAGS_RF;
+
+        /* Zero the upper 32 bits of %rip if not in 64bit mode. */
+        if ( !(hvm_long_mode_active(cur) && cs->l) )
+            regs->rip = (uint32_t)regs->rip;
+
+        add_taint(TAINT_HVM_FEP);
     }
+    else
+        goto reinject;
 
     switch ( hvm_emulate_one(&ctxt, VIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
+    reinject:
         hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
         break;
     case X86EMUL_EXCEPTION:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 07:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 07:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400356.1636035 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzURB-0000tL-Mf; Thu, 27 Aug 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 1400356.1636035; Thu, 27 Aug 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 1wzURB-0000tD-KA; Thu, 27 Aug 2026 07:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1400356;
 Thu, 27 Aug 2026 07:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzURA-0000sv-H7
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 07:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzURA-008Der-2R
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 07:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzURA-001auH-1P
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 07:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ul00vYVZQODhVF4sTpQK/ZDmCJDSNwBrFhvdW38d90E=; b=fBL10mzfBVTZDNs/96hjP6J3e2
	DZLDmLQHWLan0+ZunfJiMwbKfiAQ8e7fBLiAKYQF0pzS1itv746tYSkiJwFOmAv/GPFfEbbzJcWsS
	W1/urJYVA/p5+Cmlb36o5TuYk35zAavm1R4EwAvj1Qvs0iJuxBtO5yirF52a0Ka/zEDg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/IO-APIC: replace redundant irq_trigger() call
Message-Id: <E1wzURA-001auH-1P@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 07:22:12 +0000

commit 08149ec55598fa87d54fbfc00cc29263b078decf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Aug 27 08:06:39 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 27 08:06:39 2026 +0200

    x86/IO-APIC: replace redundant irq_trigger() call
    
    Just having called the function and stored the result, there's no point in
    calling it again right away with the same argument; the stored result can
    be used instead. And the stored result also doesn't need overwriting again
    with the same value.
    
    No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 46c2a43dac..8310314fbe 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1089,10 +1089,8 @@ static void __init setup_IO_APIC_irqs(void)
             entry.trigger = irq_trigger(idx);
             entry.polarity = irq_polarity(idx);
 
-            if (irq_trigger(idx)) {
-                entry.trigger = 1;
+            if (entry.trigger)
                 entry.mask = 1;
-            }
 
             irq = pin_2_irq(idx, apic, pin);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 07:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 07:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400358.1636040 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzURL-0000vr-Pe; Thu, 27 Aug 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 1400358.1636040; Thu, 27 Aug 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 1wzURL-0000vj-N7; Thu, 27 Aug 2026 07:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1400358;
 Thu, 27 Aug 2026 07:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzURK-0000vb-M8
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 07:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzURK-008Dex-2u
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 07:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzURK-001cjC-1u
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 07:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OyWetmlHYV5PvK/fOqvxcX7bR6dStjmvFvmPLAW+HyQ=; b=NtBFGljn1U1lt6zp6mQOuTpnF9
	izDgD55M6JKeQx5boigYzpBnyyZazp1ZLBlspxswL077Uu2XdZ850tOYTjYE5xi3o+v7KCT/51Jzg
	2cmsVil0JsGXNCl2fh9lOE5Ma/qUdK1tLvSot4J5l1FBSUYT5poiI5jjdQ66WP9FD4/A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nSVM: Expose the FlushByASID CPU feature support to L1 guests
Message-Id: <E1wzURK-001cjC-1u@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 07:22:22 +0000

commit cd36ac1c7716e6d63fe020cc357691cbb0f2e1af
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Thu Aug 27 08:07:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 27 08:07:01 2026 +0200

    x86/nSVM: Expose the FlushByASID CPU feature support to L1 guests
    
    Some hypervisors explicitly require FlushByASID capability to function under
    nested virtualization; otherwise, they fail to boot or run nested guests, see
    see Xen's start_nested_svm and (1) and (2). To ensure functional nested
    virtualization support and allow L1 hypervisors to correctly detect this
    hardware capability, extend the exposed HVM CPU policy to surface the
    FlushByASID CPU feature to the L1 guests when nestedhvm is enabled.
    
    (1) VMWare (Launchpad Bug #2008583) https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2008583
    (2) https://lore.kernel.org/all/b9915c9c-4cf6-051a-2d91-44cc6380f455@proxmox.com/T/#u
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu-policy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index eddcd9778f..48a3185eed 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -843,6 +843,7 @@ static void __init calculate_hvm_max_policy(void)
         p->extd.raw[0xa].d &= ((1u << SVM_FEATURE_NPT) |
                                (1u << SVM_FEATURE_LBRV) |
                                (1u << SVM_FEATURE_NRIPS) |
+                               (1u << SVM_FEATURE_FLUSHBYASID) |
                                (1u << SVM_FEATURE_PAUSEFILTER) |
                                (1u << SVM_FEATURE_DECODEASSISTS));
         /* Enable features which are always emulated. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 09:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 09:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400420.1636062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzW8U-0007e0-Rh; Thu, 27 Aug 2026 09:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400420.1636062; Thu, 27 Aug 2026 09:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzW8U-0007ds-Oy; Thu, 27 Aug 2026 09:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1400420;
 Thu, 27 Aug 2026 09:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzW8U-0007dm-7q
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 09:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzW8U-008GN2-16
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzW8U-003rF5-00
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=64kO5+/BKRDDzuVkyzDqyGxmBsi7G9WSfGOIv86oX1s=; b=5e5vfNWN5STuqu8a+0XCW3DR0q
	lI6JZuG5Z1wZD9zDBKBS9LGujiUYA21JMlBW6OuRpqcKRALj+ufWAgwp2k/xZdgasQi9LvottCqQR
	oxYrqLGQgMCTu3Aajaaw6VFWGrdolzeEY/uFD9+MZU/L/awU2dcDl8a+2sEqS5S2p+do=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Un-indent the HVM_FEP block in the #UD handler
Message-Id: <E1wzW8U-003rF5-00@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 09:11:02 +0000

commit 673806d02e76629b4a6d0b145adc76af5b660aae
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Aug 27 08:05:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 27 08:05:53 2026 +0200

    x86/hvm: Un-indent the HVM_FEP block in the #UD handler
    
    FEP is now the only reason for the #UD handler to run.
    
    While the #UD handler is unreachable when CONFIG_HVM_FEP is disabled, it's
    helpful to keep the function around. Reinject #UD in the non-FEP case so
    DCE can remove the rest.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c | 59 +++++++++++++++++++++++++-------------------------
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 955fc062a5..9a4147b62e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3833,49 +3833,48 @@ int hvm_descriptor_access_intercept(uint64_t exit_info,
 void hvm_ud_intercept(struct cpu_user_regs *regs)
 {
     struct vcpu *cur = current;
-    bool should_emulate = false;
     struct hvm_emulate_ctxt ctxt;
+    const struct segment_register *cs;
+    uint32_t walk;
+    unsigned long addr;
+    char sig[5]; /* ud2; .ascii "xen" */
 
-    hvm_emulate_init_once(&ctxt, NULL, regs);
-
-    if ( opt_hvm_fep )
+    if ( !opt_hvm_fep )
     {
-        const struct segment_register *cs = &ctxt.seg_reg[x86_seg_cs];
-        uint32_t walk = ((ctxt.seg_reg[x86_seg_ss].dpl == 3)
-                         ? PFEC_user_mode : 0) | PFEC_insn_fetch;
-        unsigned long addr;
-        char sig[5]; /* ud2; .ascii "xen" */
-
-        if ( hvm_virtual_to_linear_addr(x86_seg_cs, cs, regs->rip,
-                                        sizeof(sig), hvm_access_insn_fetch,
-                                        cs, &addr) &&
-             (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
-                                         walk, NULL) == HVMTRANS_okay) &&
-             (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )
-        {
-            regs->rip += sizeof(sig);
-            regs->eflags &= ~X86_EFLAGS_RF;
+        ASSERT_UNREACHABLE();
+        goto reinject;
+    }
 
-            /* Zero the upper 32 bits of %rip if not in 64bit mode. */
-            if ( !(hvm_long_mode_active(cur) && cs->l) )
-                regs->rip = (uint32_t)regs->rip;
+    hvm_emulate_init_once(&ctxt, NULL, regs);
 
-            add_taint(TAINT_HVM_FEP);
+    cs = &ctxt.seg_reg[x86_seg_cs];
+    walk = ((ctxt.seg_reg[x86_seg_ss].dpl == 3)
+            ? PFEC_user_mode : 0) | PFEC_insn_fetch;
 
-            should_emulate = true;
-        }
-    }
-
-    if ( !should_emulate )
+    if ( hvm_virtual_to_linear_addr(x86_seg_cs, cs, regs->rip,
+                                    sizeof(sig), hvm_access_insn_fetch,
+                                    cs, &addr) &&
+         (hvm_copy_from_guest_linear(sig, addr, sizeof(sig),
+                                     walk, NULL) == HVMTRANS_okay) &&
+         (memcmp(sig, "\xf\xb" "xen", sizeof(sig)) == 0) )
     {
-        hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
-        return;
+        regs->rip += sizeof(sig);
+        regs->eflags &= ~X86_EFLAGS_RF;
+
+        /* Zero the upper 32 bits of %rip if not in 64bit mode. */
+        if ( !(hvm_long_mode_active(cur) && cs->l) )
+            regs->rip = (uint32_t)regs->rip;
+
+        add_taint(TAINT_HVM_FEP);
     }
+    else
+        goto reinject;
 
     switch ( hvm_emulate_one(&ctxt, VIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
+    reinject:
         hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
         break;
     case X86EMUL_EXCEPTION:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 09:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 09:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400421.1636066 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzW8e-0007g3-Sw; Thu, 27 Aug 2026 09:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400421.1636066; Thu, 27 Aug 2026 09: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 1wzW8e-0007fv-QL; Thu, 27 Aug 2026 09:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1400421;
 Thu, 27 Aug 2026 09:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzW8e-0007fn-7d
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 09:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzW8e-008GN8-1T
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzW8e-003tJN-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UgwJ1NETNOEG4HxjVNrDerUATBMsxNVxW59/zkFE2Bo=; b=4VfsjoARkcgpq3GjpIp0wF0kSY
	oqik9DGL1P8UAgJtAbJ7XqLbtWWSyAj1YX+QVWp6f4G7xucuqJMLb6OJTsquHqWUu50irdLdozBFO
	y5dWcqTd2WHW/vPhjZNss0pGmZGu2JcG6uGG41T+MpWjUbCCJGmHIx5AJP+xKgMkedeo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/IO-APIC: replace redundant irq_trigger() call
Message-Id: <E1wzW8e-003tJN-0U@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 09:11:12 +0000

commit 08149ec55598fa87d54fbfc00cc29263b078decf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Aug 27 08:06:39 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 27 08:06:39 2026 +0200

    x86/IO-APIC: replace redundant irq_trigger() call
    
    Just having called the function and stored the result, there's no point in
    calling it again right away with the same argument; the stored result can
    be used instead. And the stored result also doesn't need overwriting again
    with the same value.
    
    No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 46c2a43dac..8310314fbe 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1089,10 +1089,8 @@ static void __init setup_IO_APIC_irqs(void)
             entry.trigger = irq_trigger(idx);
             entry.polarity = irq_polarity(idx);
 
-            if (irq_trigger(idx)) {
-                entry.trigger = 1;
+            if (entry.trigger)
                 entry.mask = 1;
-            }
 
             irq = pin_2_irq(idx, apic, pin);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 09:11:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 09:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400422.1636069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzW8o-0007hu-U4; Thu, 27 Aug 2026 09:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400422.1636069; Thu, 27 Aug 2026 09: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 1wzW8o-0007hm-Re; Thu, 27 Aug 2026 09:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1400422;
 Thu, 27 Aug 2026 09:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzW8o-0007hg-B4
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 09:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzW8o-008GNG-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzW8o-003vKU-0q
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0NpyaWgTkeNHmkKd9kV2PPierqU9as/NUpHAJL1bb0s=; b=tuLeIcgTgKNLoeoX/QJJAtP9V8
	Ee3j/gBjqmF8Zvl9TXMS4Q21YjCvO+zOI20xtps+mCWSPMcSisM/XGolzEIeo3/2DHHL96fdgjLek
	cLXiTZ9+EAB2mok3Fk2BDi3ebtLXxnrHweoT0y7EIeS/mRmjBwkPlSg830HuA9z/UKzU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nSVM: Expose the FlushByASID CPU feature support to L1 guests
Message-Id: <E1wzW8o-003vKU-0q@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 09:11:22 +0000

commit cd36ac1c7716e6d63fe020cc357691cbb0f2e1af
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Thu Aug 27 08:07:01 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Aug 27 08:07:01 2026 +0200

    x86/nSVM: Expose the FlushByASID CPU feature support to L1 guests
    
    Some hypervisors explicitly require FlushByASID capability to function under
    nested virtualization; otherwise, they fail to boot or run nested guests, see
    see Xen's start_nested_svm and (1) and (2). To ensure functional nested
    virtualization support and allow L1 hypervisors to correctly detect this
    hardware capability, extend the exposed HVM CPU policy to surface the
    FlushByASID CPU feature to the L1 guests when nestedhvm is enabled.
    
    (1) VMWare (Launchpad Bug #2008583) https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2008583
    (2) https://lore.kernel.org/all/b9915c9c-4cf6-051a-2d91-44cc6380f455@proxmox.com/T/#u
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu-policy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index eddcd9778f..48a3185eed 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -843,6 +843,7 @@ static void __init calculate_hvm_max_policy(void)
         p->extd.raw[0xa].d &= ((1u << SVM_FEATURE_NPT) |
                                (1u << SVM_FEATURE_LBRV) |
                                (1u << SVM_FEATURE_NRIPS) |
+                               (1u << SVM_FEATURE_FLUSHBYASID) |
                                (1u << SVM_FEATURE_PAUSEFILTER) |
                                (1u << SVM_FEATURE_DECODEASSISTS));
         /* Enable features which are always emulated. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 09:33:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 09:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400436.1636074 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzWTo-0001kq-Cc; Thu, 27 Aug 2026 09:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400436.1636074; Thu, 27 Aug 2026 09:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzWTo-0001ki-9z; Thu, 27 Aug 2026 09:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1400436;
 Thu, 27 Aug 2026 09:33: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 1wzWTn-0001kM-1p
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 09:33: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 1wzWTn-008Gtd-02
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzWTm-007oO2-2D
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pSq5vvyoQRHH+axQDA8zHY/Ntmaq1wdXXKUyAquts9U=; b=on8Al98C86Jgde005PMkYHHqUY
	GGHXlvzszim/HJjxc2LKYp7Qjn2avrQCGIStXgKkjspFMq5bEF+lq9Xq+PjFx28bvbQLxOCjjU5mS
	WSkanFybOnc2j7Ys24Se2wm73ZAYmKrxm5a+v1c9jlgWmo2FDLCM2XhhoSDLszmVbQVE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Hide PMU registers from the guest, when the vPMU feature is disabled
Message-Id: <E1wzWTm-007oO2-2D@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 09:33:02 +0000

commit b836ef686efe4d01fb54a12cb1e9df7ec0494201
Author:     Hirokazu Takahashi <taka@valinux.co.jp>
AuthorDate: Wed Aug 26 12:55:28 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 27 11:25:35 2026 +0200

    xen/arm: Hide PMU registers from the guest, when the vPMU feature is disabled
    
    On ARMv8.4-A and newer platforms, booting Dom0 Linux with ACPI enabled
    causes the domain to probe advanced PMU feature based on system ID
    register ID_AA64DFR0_EL1. During this probe, Linux accesses PMMIR_EL1,
    which causes unhandled register traps and crashes the domain.
    
    To address this issue, implement the following:
    
    - Add emulation for ID_AA64DFR{0,1}_EL1, ID_DFR{0,1}_EL1 and
      ID_DFR{0,1} register accesses for guest domains.
    - Hide PMU registers from a guest domain when its vPMU feature is
      disabled.
    - Proactively make SPE, TRBE, BRBE, Trace Extensions, SPMU, ITE and
      EBEP inaccessible to arm64 guest domains and hide TraceFilt,
      MMapTrc and CopTrc to arm32 guest domains, as they could
      potentially cause similar issues.
    
    Fixes: dbb948110a0e ("xen: Expose the PMU to the guests")
    Fixes: 07b9acea116e ("xen/arm: Add handler for ID registers on arm64")
    Fixes: 3669a1cb9598 ("xen/arm: create a cpuinfo structure for guest")
    Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/vsysreg.c          | 59 ++++++++++++++++++++++++++++++++---
 xen/arch/arm/cpufeature.c             | 18 +++++++++++
 xen/arch/arm/domain.c                 |  2 +-
 xen/arch/arm/include/asm/arm64/hsr.h  |  1 +
 xen/arch/arm/include/asm/cpregs.h     |  1 +
 xen/arch/arm/include/asm/cpufeature.h | 27 +++++++++++-----
 xen/arch/arm/vcpreg.c                 | 34 ++++++++++++++++----
 xen/include/xen/sched.h               |  5 +++
 8 files changed, 129 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index d9e3619dfb..66f4f23bb3 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -227,6 +227,7 @@ void do_sysreg(struct cpu_user_regs *regs,
      */
     case HSR_SYSREG_PMINTENSET_EL1:
     case HSR_SYSREG_PMINTENCLR_EL1:
+    case HSR_SYSREG_PMMIR_EL1:
         return handle_raz_wi(regs, regidx, hsr.sysreg.read, hsr, 1);
     case HSR_SYSREG_PMUSERENR_EL0:
         /* RO at EL0. RAZ/WI at EL1 */
@@ -300,8 +301,32 @@ void do_sysreg(struct cpu_user_regs *regs,
     GENERATE_TID3_INFO(ID_PFR0_EL1, pfr32, 0)
     GENERATE_TID3_INFO(ID_PFR1_EL1, pfr32, 1)
     GENERATE_TID3_INFO(ID_PFR2_EL1, pfr32, 2)
-    GENERATE_TID3_INFO(ID_DFR0_EL1, dbg32, 0)
-    GENERATE_TID3_INFO(ID_DFR1_EL1, dbg32, 1)
+
+    case HSR_SYSREG_ID_DFR0_EL1:
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+            info_dbg32.perfmon = 0;
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg32.bits[0]);
+    }
+
+    case HSR_SYSREG_ID_DFR1_EL1:
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+        {
+            info_dbg32.mtpmu = 0;
+            info_dbg32.hpmn0 = 0;
+        }
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg32.bits[1]);
+    }
+
     GENERATE_TID3_INFO(ID_AFR0_EL1, aux32, 0)
     GENERATE_TID3_INFO(ID_MMFR0_EL1, mm32, 0)
     GENERATE_TID3_INFO(ID_MMFR1_EL1, mm32, 1)
@@ -342,8 +367,34 @@ void do_sysreg(struct cpu_user_regs *regs,
     }
 
     GENERATE_TID3_INFO(ID_AA64PFR1_EL1, pfr64, 1)
-    GENERATE_TID3_INFO(ID_AA64DFR0_EL1, dbg64, 0)
-    GENERATE_TID3_INFO(ID_AA64DFR1_EL1, dbg64, 1)
+
+    case HSR_SYSREG_ID_AA64DFR0_EL1:
+    {
+        union cpuinfo_dbg64 info_dbg64 = domain_cpuinfo.dbg64;
+
+        if ( !is_vpmu_domain(v->domain) )
+        {
+            info_dbg64.pmu_ver = 0;
+            info_dbg64.pmss = 0;
+            info_dbg64.mtpmu = 0;
+            info_dbg64.hpmn0 = 0;
+        }
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg64.bits[0]);
+    }
+
+    case HSR_SYSREG_ID_AA64DFR1_EL1:
+    {
+        union cpuinfo_dbg64 info_dbg64 = domain_cpuinfo.dbg64;
+
+        if ( !is_vpmu_domain(v->domain) )
+            info_dbg64.pmicntr = 0;
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg64.bits[1]);
+    }
+
     GENERATE_TID3_INFO(ID_AA64ISAR0_EL1, isa64, 0)
     GENERATE_TID3_INFO(ID_AA64ISAR1_EL1, isa64, 1)
     GENERATE_TID3_INFO(ID_AA64MMFR0_EL1, mm64, 0)
diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index 94d14fb6a9..8d8cd19a96 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -219,8 +219,26 @@ static int __init create_domain_cpuinfo(void)
     domain_cpuinfo.isa64.api = 0;
     domain_cpuinfo.isa64.gpa = 0;
     domain_cpuinfo.isa64.gpi = 0;
+
+    /* Hide SPE, DPFZS, TRBE, BRBE, Trace Extensions, SPMU, ITE and EBEP */
+    domain_cpuinfo.dbg64.trace_ver = 0;
+    domain_cpuinfo.dbg64.pms_ver = 0;
+    domain_cpuinfo.dbg64.dpfzs = 0;
+    domain_cpuinfo.dbg64.trace_filt = 0;
+    domain_cpuinfo.dbg64.trace_buffer = 0;
+    domain_cpuinfo.dbg64.ext_trc_buff = 0;
+    domain_cpuinfo.dbg64.brbe = 0;
+    domain_cpuinfo.dbg64.syspmuid = 0;
+    domain_cpuinfo.dbg64.spmu = 0;
+    domain_cpuinfo.dbg64.ite = 0;
+    domain_cpuinfo.dbg64.ebep = 0;
 #endif
 
+    /* Hide Trace Extensions for AArch32 domain */
+    domain_cpuinfo.dbg32.coptrc = 0;
+    domain_cpuinfo.dbg32.mmaptrc = 0;
+    domain_cpuinfo.dbg32.tracefilt = 0;
+
     /* Hide AMU support */
 #ifdef CONFIG_ARM_64
     domain_cpuinfo.pfr64.amu = 0;
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index baa3a5d708..a739dd157e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -501,7 +501,7 @@ int arch_vcpu_create(struct vcpu *v)
     v->arch.hcr_el2 = get_default_hcr_flags();
 
     v->arch.mdcr_el2 = HDCR_TDRA | HDCR_TDOSA | HDCR_TDA;
-    if ( !(v->domain->options & XEN_DOMCTL_CDF_vpmu) )
+    if ( !is_vpmu_domain(v->domain) )
         v->arch.mdcr_el2 |= HDCR_TPM | HDCR_TPMCR;
 
     if ( (rc = vcpu_vgic_init(v)) != 0 )
diff --git a/xen/arch/arm/include/asm/arm64/hsr.h b/xen/arch/arm/include/asm/arm64/hsr.h
index 1495ccddea..ed18184cc7 100644
--- a/xen/arch/arm/include/asm/arm64/hsr.h
+++ b/xen/arch/arm/include/asm/arm64/hsr.h
@@ -84,6 +84,7 @@
 #define HSR_SYSREG_FAR_EL1        HSR_SYSREG(3,0,c6, c0,0)
 #define HSR_SYSREG_PMINTENSET_EL1 HSR_SYSREG(3,0,c9,c14,1)
 #define HSR_SYSREG_PMINTENCLR_EL1 HSR_SYSREG(3,0,c9,c14,2)
+#define HSR_SYSREG_PMMIR_EL1      HSR_SYSREG(3,0,c9,c14,6)
 #define HSR_SYSREG_MAIR_EL1       HSR_SYSREG(3,0,c10,c2,0)
 #define HSR_SYSREG_AMAIR_EL1      HSR_SYSREG(3,0,c10,c3,0)
 #define HSR_SYSREG_ICC_SGI1R_EL1  HSR_SYSREG(3,0,c12,c11,5)
diff --git a/xen/arch/arm/include/asm/cpregs.h b/xen/arch/arm/include/asm/cpregs.h
index a7503a190f..3f62b38dc0 100644
--- a/xen/arch/arm/include/asm/cpregs.h
+++ b/xen/arch/arm/include/asm/cpregs.h
@@ -246,6 +246,7 @@
 #define PMINTENSET      p15,0,c9,c14,1  /* Perf. Mon. Interrupt Enable Set Register */
 #define PMINTENCLR      p15,0,c9,c14,2  /* Perf. Mon. Interrupt Enable Clear Register */
 #define PMOVSSET        p15,0,c9,c14,3  /* Perf. Mon. Overflow Flag Status Set register */
+#define PMMIR           p15,0,c9,c14,6  /* Perf. Mon. Machine Identification Register */
 
 /* CP15 CR10: */
 #define MAIR0           p15,0,c10,c2,0  /* Memory Attribute Indirection Register 0 AKA PRRR */
diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index bf902a3970..c554686415 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -208,7 +208,7 @@ struct cpuinfo_arm {
         };
     } pfr64;
 
-    union {
+    union cpuinfo_dbg64 {
         register_t bits[2];
         struct {
             /* DFR0 */
@@ -216,19 +216,31 @@ struct cpuinfo_arm {
             unsigned long trace_ver:4;
             unsigned long pmu_ver:4;
             unsigned long brps:4;
-            unsigned long __res0:4;
+            unsigned long pmss:4;
             unsigned long wrps:4;
             unsigned long __res1:4;
             unsigned long ctx_cmps:4;
             unsigned long pms_ver:4;
             unsigned long double_lock:4;
             unsigned long trace_filt:4;
-            unsigned long __res2:4;
+            unsigned long trace_buffer:4;
             unsigned long mtpmu:4;
-            unsigned long __res3:12;
+            unsigned long brbe:4;
+            unsigned long ext_trc_buff:4;
+            unsigned long hpmn0:4;
 
             /* DFR1 */
-            unsigned long __res4:64;
+            unsigned long syspmuid:8;
+            unsigned long brps1:8;
+            unsigned long wrps1:8;
+            unsigned long ctx_cmps1:8;
+            unsigned long spmu:4;
+            unsigned long pmicntr:4;
+            unsigned long able:4;
+            unsigned long ite:4;
+            unsigned long ebep:4;
+            unsigned long dpfzs:4;
+            unsigned long abl_cmps:8;
         };
     } dbg64;
 
@@ -408,7 +420,7 @@ struct cpuinfo_arm {
         };
     } pfr32;
 
-    union {
+    union cpuinfo_dbg32 {
         register_t bits[2];
         struct {
             /* DFR0 */
@@ -426,7 +438,8 @@ struct cpuinfo_arm {
 
             /* DFR1 */
             unsigned long mtpmu:4;
-            unsigned long __res1:28;
+            unsigned long hpmn0:4;
+            unsigned long __res1:24;
 #ifdef CONFIG_ARM_64
             unsigned long __res2:32;
 #endif
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index 3205c7df46..3c315be9fd 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -276,10 +276,7 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
      *
      * NB: Both MDCR_EL2.TPM and MDCR_EL2.TPMCR cause trapping of PMCR.
      */
-    /* We could trap ID_DFR0 and tell the guest we don't support
-     * performance monitoring, but Linux doesn't check the ID_DFR0.
-     * Therefore it will read PMCR.
-     *
+    /*
      * We tell the guest we have 0 counters. Unfortunately we must
      * always support PMCCNTR (the cyle counter): we just RAZ/WI for all
      * PM register, which doesn't crash the kernel at least
@@ -292,6 +289,7 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
             return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMINTENSET):
     case HSR_CPREG32(PMINTENCLR):
+    case HSR_CPREG32(PMMIR):
         return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMCR):
     case HSR_CPREG32(PMCNTENSET):
@@ -320,8 +318,32 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
     GENERATE_TID3_INFO(ID_PFR0, pfr32, 0)
     GENERATE_TID3_INFO(ID_PFR1, pfr32, 1)
     GENERATE_TID3_INFO(ID_PFR2, pfr32, 2)
-    GENERATE_TID3_INFO(ID_DFR0, dbg32, 0)
-    GENERATE_TID3_INFO(ID_DFR1, dbg32, 1)
+
+    case HSR_CPREG32(ID_DFR0):
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+            info_dbg32.perfmon = 0;
+
+        return handle_ro_read_val(regs, regidx, cp32.read, hsr, 1,
+                                  info_dbg32.bits[0]);
+    }
+
+    case HSR_CPREG32(ID_DFR1):
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+        {
+            info_dbg32.mtpmu = 0;
+            info_dbg32.hpmn0 = 0;
+        }
+
+        return handle_ro_read_val(regs, regidx, cp32.read, hsr, 1,
+                                  info_dbg32.bits[1]);
+    }
+
     GENERATE_TID3_INFO(ID_AFR0, aux32, 0)
     GENERATE_TID3_INFO(ID_MMFR0, mm32, 0)
     GENERATE_TID3_INFO(ID_MMFR1, mm32, 1)
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index eef10c2ea2..e352e2b38e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -1269,6 +1269,11 @@ static always_inline bool is_iommu_enabled(const struct domain *d)
     return evaluate_nospec(d->options & XEN_DOMCTL_CDF_iommu);
 }
 
+static inline bool is_vpmu_domain(const struct domain *d)
+{
+    return d->options & XEN_DOMCTL_CDF_vpmu;
+}
+
 #ifdef CONFIG_MEM_PAGING
 # define mem_paging_enabled(d) vm_event_check_ring((d)->vm_event_paging)
 #else
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 09:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 09:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400437.1636078 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzWTy-0001mz-F8; Thu, 27 Aug 2026 09:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400437.1636078; Thu, 27 Aug 2026 09:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzWTy-0001ms-Cd; Thu, 27 Aug 2026 09:33:14 +0000
Received: by outflank-mailman (input) for mailman id 1400437;
 Thu, 27 Aug 2026 09:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wzWTw-0001mh-TI
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 09:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzWTx-008GvP-0Q
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzWTw-007qBJ-2h
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XQkL5f/AYTYRmsSy78WSEQ8vzf1HhiPsZ1EcUvuWQ5c=; b=r36hm1vlwLyx1O8j7VyPvtUlus
	1nevaZi3Z1zsJ7HD0zvbbIOOmMHTi91QI/jyLivOaG/mdfkBeXPEiN00HlcsszRApEWHykNljz1+5
	ep8oFQyWR9gh9napbNXzlGfpL3+fESc5QhNYbiqlrEX6g5kGFlka0gM9tZb7yQCXlIDs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: traps: report level 0 faults in panic_PAR()
Message-Id: <E1wzWTw-007qBJ-2h@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 09:33:12 +0000

commit 4e1f58ea1a20d8a831ad72aa30eafa618dfae750
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 25 08:23:28 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 27 11:25:41 2026 +0200

    xen/arm: traps: report level 0 faults in panic_PAR()
    
    decode_fsc() derives the fault level from the low two bits of the FSC, so
    level 0 is a valid output: FSC_FLT_TRANS is 0x04, i.e. "translation fault,
    level 0 or translation table base register".
    
    This is reachable on arm64 because xen_pgtable is the zeroeth-level root,
    but fsc_level_str() has no case for it and prints " (level invalid)"
    instead. At the time the function was created Xen used only three levels.
    
    Add the missing case. On arm32 the zeroeth level does not exist but FSC
    0 denotes address size fault at translation table base register.
    
    While at it, make decode_fsc() decode also address size faults.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 xen/arch/arm/include/asm/processor.h | 2 ++
 xen/arch/arm/traps.c                 | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..509040a1cd 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -521,6 +521,7 @@ extern register_t __cpu_logical_map[];
 /*
  * 543210 BIT
  * 00XXLL -- XX Fault Level LL
+ * ..00LL -- Address Size Fault LL
  * ..01LL -- Translation Fault LL
  * ..10LL -- Access Fault LL
  * ..11LL -- Permission Fault LL
@@ -534,6 +535,7 @@ extern register_t __cpu_logical_map[];
 #define FSC_TYPE_OTH   (_AC(0x02,U)<<4)
 #define FSC_TYPE_IMPL  (_AC(0x03,U)<<4)
 
+#define FSC_FLT_ADDR_SIZE (0x00)
 #define FSC_FLT_TRANS  (0x04)
 #define FSC_FLT_ACCESS (0x08)
 #define FSC_FLT_PERM   (0x0c)
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 0c01f37ad6..344aa21b98 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -307,6 +307,10 @@ static const char *decode_fsc(uint32_t fsc, int *level)
 
     switch ( fsc & 0x3f )
     {
+    case FSC_FLT_ADDR_SIZE ... FSC_FLT_ADDR_SIZE + 3:
+        msg = "Address size fault";
+        *level = fsc & FSC_LL_MASK;
+        break;
     case FSC_FLT_TRANS ... FSC_FLT_TRANS + 3:
         msg = "Translation fault";
         *level = fsc & FSC_LL_MASK;
@@ -363,6 +367,7 @@ static const char *fsc_level_str(int level)
     switch ( level )
     {
     case -1: return "";
+    case 0:  return " at level 0 or TTBR";
     case 1:  return " at level 1";
     case 2:  return " at level 2";
     case 3:  return " at level 3";
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 09:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 09:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400438.1636082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzWU8-0001oz-Gp; Thu, 27 Aug 2026 09:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400438.1636082; Thu, 27 Aug 2026 09:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzWU8-0001or-EG; Thu, 27 Aug 2026 09:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1400438;
 Thu, 27 Aug 2026 09:33: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 1wzWU7-0001ok-0u
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 2026 09:33: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 1wzWU7-008Gvf-0o
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzWU6-007rvq-33
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 09:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AaSAgt1G1nQtEmNWILDNhEVXRguV2mamkYrWGJbfXkk=; b=2y0uaCUPe1GvmuTieUoV+rkB2K
	7F/0TcxKLMsTO9kx2GWlpw2OgYoRPTbcWrbdRGxvQp9+b1j/GpRRZgqoQOfB7j3sgEmh5xneu1Kd7
	w4qbCX3Hvb4xZgguz/4Ip7ydar/dUK/o/AZz0vhwnuEUBs6DqS7Hl79TnSEiJ1GhXzWs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: traps: drop unreachable stage 2 decoding from panic_PAR()
Message-Id: <E1wzWU6-007rvq-33@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 09:33:22 +0000

commit 79225a0c77e13b693b4d2b903a88289704b79db6
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 25 08:23:29 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 27 11:25:41 2026 +0200

    xen/arm: traps: drop unreachable stage 2 decoding from panic_PAR()
    
    panic_PAR() is only called from va_to_par(), which translates using
    __va_to_par(), i.e. "at s1e2r" on arm64 and ATS1HR on arm32. Both
    perform an EL2 stage 1 only translation, so PAR.S (PAR_STAGE2) and
    PAR.PTW (PAR_STAGE21) can never be set.
    
    This has been the case since commit a14447dbcf171 ("xen: arm: do not
    panic when failing to translate a guest address"), which made
    gva_to_par() and gva_to_ipa() return -EFAULT instead of calling
    panic_PAR() for guest translations.
    
    Print stage 1 unconditionally and keep an ASSERT() to document the
    invariant. PAR_STAGE21 has no user left, so drop it. While at it, fix
    the spacing in the decode_fsc() call.
    
    No functional change intended.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 xen/arch/arm/include/asm/processor.h |  1 -
 xen/arch/arm/traps.c                 | 17 +++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index 509040a1cd..8ee8f88fb4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -507,7 +507,6 @@ extern register_t __cpu_logical_map[];
 /* .... If F == 1 */
 #define PAR_FSC_SHIFT   (1)
 #define PAR_FSC_MASK    (_AC(0x3f,U)<<PAR_FSC_SHIFT)
-#define PAR_STAGE21     (_AC(1,U)<<8)     /* Stage 2 Fault During Stage 1 Walk */
 #define PAR_STAGE2      (_AC(1,U)<<9)     /* Stage 2 Fault */
 
 /* If F == 0 */
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 344aa21b98..625d229396 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -379,16 +379,17 @@ void panic_PAR(uint64_t par)
 {
     const char *msg;
     int level = -1;
-    int stage = par & PAR_STAGE2 ? 2 : 1;
-    int second_in_first = !!(par & PAR_STAGE21);
 
-    msg = decode_fsc( (par&PAR_FSC_MASK) >> PAR_FSC_SHIFT, &level);
+    /*
+     * The only caller translates using "at s1e2r" (arm64) or ATS1HR
+     * (arm32), i.e. an EL2 stage 1 only translation.
+     */
+    ASSERT(!(par & PAR_STAGE2));
+
+    msg = decode_fsc((par & PAR_FSC_MASK) >> PAR_FSC_SHIFT, &level);
 
-    printk("PAR: %016"PRIx64": %s stage %d%s%s\n",
-           par, msg,
-           stage,
-           second_in_first ? " during second stage lookup" : "",
-           fsc_level_str(level));
+    printk("PAR: %016"PRIx64": %s stage 1%s\n",
+           par, msg, fsc_level_str(level));
 
     panic("Error during Hypervisor-to-physical address translation\n");
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 10:44:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 10:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400559.1636193 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzXaV-0000ZO-Pg; Thu, 27 Aug 2026 10:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1400559.1636193; Thu, 27 Aug 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 1wzXaV-0000ZG-N0; Thu, 27 Aug 2026 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1400559;
 Thu, 27 Aug 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 1wzXaU-0000ZA-N7
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 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 1wzXaU-008IiI-1o
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzXaU-003Ifq-0f
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 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=dNouetNOYlPcrlZn+ZASBOX1PwR4uvgZSytQkvXCQzY=; b=Cw9KA07Yp7AZcFNRikpm69bv45
	Ggs09XzLfTyFjd8Jt7gcnYF066I0gRlr/5LiVtZsmxOA9K7Dte2OoM0UzF/T0ROWWklolcnuSEqya
	QeettvklN2DB5tBHENIib5Hw+/ipNoN20wJE+GSpDmr8WQw5eXzFoWZCAouJdGcNs3eY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Hide PMU registers from the guest, when the vPMU feature is disabled
Message-Id: <E1wzXaU-003Ifq-0f@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 10:44:02 +0000

commit b836ef686efe4d01fb54a12cb1e9df7ec0494201
Author:     Hirokazu Takahashi <taka@valinux.co.jp>
AuthorDate: Wed Aug 26 12:55:28 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 27 11:25:35 2026 +0200

    xen/arm: Hide PMU registers from the guest, when the vPMU feature is disabled
    
    On ARMv8.4-A and newer platforms, booting Dom0 Linux with ACPI enabled
    causes the domain to probe advanced PMU feature based on system ID
    register ID_AA64DFR0_EL1. During this probe, Linux accesses PMMIR_EL1,
    which causes unhandled register traps and crashes the domain.
    
    To address this issue, implement the following:
    
    - Add emulation for ID_AA64DFR{0,1}_EL1, ID_DFR{0,1}_EL1 and
      ID_DFR{0,1} register accesses for guest domains.
    - Hide PMU registers from a guest domain when its vPMU feature is
      disabled.
    - Proactively make SPE, TRBE, BRBE, Trace Extensions, SPMU, ITE and
      EBEP inaccessible to arm64 guest domains and hide TraceFilt,
      MMapTrc and CopTrc to arm32 guest domains, as they could
      potentially cause similar issues.
    
    Fixes: dbb948110a0e ("xen: Expose the PMU to the guests")
    Fixes: 07b9acea116e ("xen/arm: Add handler for ID registers on arm64")
    Fixes: 3669a1cb9598 ("xen/arm: create a cpuinfo structure for guest")
    Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/vsysreg.c          | 59 ++++++++++++++++++++++++++++++++---
 xen/arch/arm/cpufeature.c             | 18 +++++++++++
 xen/arch/arm/domain.c                 |  2 +-
 xen/arch/arm/include/asm/arm64/hsr.h  |  1 +
 xen/arch/arm/include/asm/cpregs.h     |  1 +
 xen/arch/arm/include/asm/cpufeature.h | 27 +++++++++++-----
 xen/arch/arm/vcpreg.c                 | 34 ++++++++++++++++----
 xen/include/xen/sched.h               |  5 +++
 8 files changed, 129 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index d9e3619dfb..66f4f23bb3 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -227,6 +227,7 @@ void do_sysreg(struct cpu_user_regs *regs,
      */
     case HSR_SYSREG_PMINTENSET_EL1:
     case HSR_SYSREG_PMINTENCLR_EL1:
+    case HSR_SYSREG_PMMIR_EL1:
         return handle_raz_wi(regs, regidx, hsr.sysreg.read, hsr, 1);
     case HSR_SYSREG_PMUSERENR_EL0:
         /* RO at EL0. RAZ/WI at EL1 */
@@ -300,8 +301,32 @@ void do_sysreg(struct cpu_user_regs *regs,
     GENERATE_TID3_INFO(ID_PFR0_EL1, pfr32, 0)
     GENERATE_TID3_INFO(ID_PFR1_EL1, pfr32, 1)
     GENERATE_TID3_INFO(ID_PFR2_EL1, pfr32, 2)
-    GENERATE_TID3_INFO(ID_DFR0_EL1, dbg32, 0)
-    GENERATE_TID3_INFO(ID_DFR1_EL1, dbg32, 1)
+
+    case HSR_SYSREG_ID_DFR0_EL1:
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+            info_dbg32.perfmon = 0;
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg32.bits[0]);
+    }
+
+    case HSR_SYSREG_ID_DFR1_EL1:
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+        {
+            info_dbg32.mtpmu = 0;
+            info_dbg32.hpmn0 = 0;
+        }
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg32.bits[1]);
+    }
+
     GENERATE_TID3_INFO(ID_AFR0_EL1, aux32, 0)
     GENERATE_TID3_INFO(ID_MMFR0_EL1, mm32, 0)
     GENERATE_TID3_INFO(ID_MMFR1_EL1, mm32, 1)
@@ -342,8 +367,34 @@ void do_sysreg(struct cpu_user_regs *regs,
     }
 
     GENERATE_TID3_INFO(ID_AA64PFR1_EL1, pfr64, 1)
-    GENERATE_TID3_INFO(ID_AA64DFR0_EL1, dbg64, 0)
-    GENERATE_TID3_INFO(ID_AA64DFR1_EL1, dbg64, 1)
+
+    case HSR_SYSREG_ID_AA64DFR0_EL1:
+    {
+        union cpuinfo_dbg64 info_dbg64 = domain_cpuinfo.dbg64;
+
+        if ( !is_vpmu_domain(v->domain) )
+        {
+            info_dbg64.pmu_ver = 0;
+            info_dbg64.pmss = 0;
+            info_dbg64.mtpmu = 0;
+            info_dbg64.hpmn0 = 0;
+        }
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg64.bits[0]);
+    }
+
+    case HSR_SYSREG_ID_AA64DFR1_EL1:
+    {
+        union cpuinfo_dbg64 info_dbg64 = domain_cpuinfo.dbg64;
+
+        if ( !is_vpmu_domain(v->domain) )
+            info_dbg64.pmicntr = 0;
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  info_dbg64.bits[1]);
+    }
+
     GENERATE_TID3_INFO(ID_AA64ISAR0_EL1, isa64, 0)
     GENERATE_TID3_INFO(ID_AA64ISAR1_EL1, isa64, 1)
     GENERATE_TID3_INFO(ID_AA64MMFR0_EL1, mm64, 0)
diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index 94d14fb6a9..8d8cd19a96 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -219,8 +219,26 @@ static int __init create_domain_cpuinfo(void)
     domain_cpuinfo.isa64.api = 0;
     domain_cpuinfo.isa64.gpa = 0;
     domain_cpuinfo.isa64.gpi = 0;
+
+    /* Hide SPE, DPFZS, TRBE, BRBE, Trace Extensions, SPMU, ITE and EBEP */
+    domain_cpuinfo.dbg64.trace_ver = 0;
+    domain_cpuinfo.dbg64.pms_ver = 0;
+    domain_cpuinfo.dbg64.dpfzs = 0;
+    domain_cpuinfo.dbg64.trace_filt = 0;
+    domain_cpuinfo.dbg64.trace_buffer = 0;
+    domain_cpuinfo.dbg64.ext_trc_buff = 0;
+    domain_cpuinfo.dbg64.brbe = 0;
+    domain_cpuinfo.dbg64.syspmuid = 0;
+    domain_cpuinfo.dbg64.spmu = 0;
+    domain_cpuinfo.dbg64.ite = 0;
+    domain_cpuinfo.dbg64.ebep = 0;
 #endif
 
+    /* Hide Trace Extensions for AArch32 domain */
+    domain_cpuinfo.dbg32.coptrc = 0;
+    domain_cpuinfo.dbg32.mmaptrc = 0;
+    domain_cpuinfo.dbg32.tracefilt = 0;
+
     /* Hide AMU support */
 #ifdef CONFIG_ARM_64
     domain_cpuinfo.pfr64.amu = 0;
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index baa3a5d708..a739dd157e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -501,7 +501,7 @@ int arch_vcpu_create(struct vcpu *v)
     v->arch.hcr_el2 = get_default_hcr_flags();
 
     v->arch.mdcr_el2 = HDCR_TDRA | HDCR_TDOSA | HDCR_TDA;
-    if ( !(v->domain->options & XEN_DOMCTL_CDF_vpmu) )
+    if ( !is_vpmu_domain(v->domain) )
         v->arch.mdcr_el2 |= HDCR_TPM | HDCR_TPMCR;
 
     if ( (rc = vcpu_vgic_init(v)) != 0 )
diff --git a/xen/arch/arm/include/asm/arm64/hsr.h b/xen/arch/arm/include/asm/arm64/hsr.h
index 1495ccddea..ed18184cc7 100644
--- a/xen/arch/arm/include/asm/arm64/hsr.h
+++ b/xen/arch/arm/include/asm/arm64/hsr.h
@@ -84,6 +84,7 @@
 #define HSR_SYSREG_FAR_EL1        HSR_SYSREG(3,0,c6, c0,0)
 #define HSR_SYSREG_PMINTENSET_EL1 HSR_SYSREG(3,0,c9,c14,1)
 #define HSR_SYSREG_PMINTENCLR_EL1 HSR_SYSREG(3,0,c9,c14,2)
+#define HSR_SYSREG_PMMIR_EL1      HSR_SYSREG(3,0,c9,c14,6)
 #define HSR_SYSREG_MAIR_EL1       HSR_SYSREG(3,0,c10,c2,0)
 #define HSR_SYSREG_AMAIR_EL1      HSR_SYSREG(3,0,c10,c3,0)
 #define HSR_SYSREG_ICC_SGI1R_EL1  HSR_SYSREG(3,0,c12,c11,5)
diff --git a/xen/arch/arm/include/asm/cpregs.h b/xen/arch/arm/include/asm/cpregs.h
index a7503a190f..3f62b38dc0 100644
--- a/xen/arch/arm/include/asm/cpregs.h
+++ b/xen/arch/arm/include/asm/cpregs.h
@@ -246,6 +246,7 @@
 #define PMINTENSET      p15,0,c9,c14,1  /* Perf. Mon. Interrupt Enable Set Register */
 #define PMINTENCLR      p15,0,c9,c14,2  /* Perf. Mon. Interrupt Enable Clear Register */
 #define PMOVSSET        p15,0,c9,c14,3  /* Perf. Mon. Overflow Flag Status Set register */
+#define PMMIR           p15,0,c9,c14,6  /* Perf. Mon. Machine Identification Register */
 
 /* CP15 CR10: */
 #define MAIR0           p15,0,c10,c2,0  /* Memory Attribute Indirection Register 0 AKA PRRR */
diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index bf902a3970..c554686415 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -208,7 +208,7 @@ struct cpuinfo_arm {
         };
     } pfr64;
 
-    union {
+    union cpuinfo_dbg64 {
         register_t bits[2];
         struct {
             /* DFR0 */
@@ -216,19 +216,31 @@ struct cpuinfo_arm {
             unsigned long trace_ver:4;
             unsigned long pmu_ver:4;
             unsigned long brps:4;
-            unsigned long __res0:4;
+            unsigned long pmss:4;
             unsigned long wrps:4;
             unsigned long __res1:4;
             unsigned long ctx_cmps:4;
             unsigned long pms_ver:4;
             unsigned long double_lock:4;
             unsigned long trace_filt:4;
-            unsigned long __res2:4;
+            unsigned long trace_buffer:4;
             unsigned long mtpmu:4;
-            unsigned long __res3:12;
+            unsigned long brbe:4;
+            unsigned long ext_trc_buff:4;
+            unsigned long hpmn0:4;
 
             /* DFR1 */
-            unsigned long __res4:64;
+            unsigned long syspmuid:8;
+            unsigned long brps1:8;
+            unsigned long wrps1:8;
+            unsigned long ctx_cmps1:8;
+            unsigned long spmu:4;
+            unsigned long pmicntr:4;
+            unsigned long able:4;
+            unsigned long ite:4;
+            unsigned long ebep:4;
+            unsigned long dpfzs:4;
+            unsigned long abl_cmps:8;
         };
     } dbg64;
 
@@ -408,7 +420,7 @@ struct cpuinfo_arm {
         };
     } pfr32;
 
-    union {
+    union cpuinfo_dbg32 {
         register_t bits[2];
         struct {
             /* DFR0 */
@@ -426,7 +438,8 @@ struct cpuinfo_arm {
 
             /* DFR1 */
             unsigned long mtpmu:4;
-            unsigned long __res1:28;
+            unsigned long hpmn0:4;
+            unsigned long __res1:24;
 #ifdef CONFIG_ARM_64
             unsigned long __res2:32;
 #endif
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index 3205c7df46..3c315be9fd 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -276,10 +276,7 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
      *
      * NB: Both MDCR_EL2.TPM and MDCR_EL2.TPMCR cause trapping of PMCR.
      */
-    /* We could trap ID_DFR0 and tell the guest we don't support
-     * performance monitoring, but Linux doesn't check the ID_DFR0.
-     * Therefore it will read PMCR.
-     *
+    /*
      * We tell the guest we have 0 counters. Unfortunately we must
      * always support PMCCNTR (the cyle counter): we just RAZ/WI for all
      * PM register, which doesn't crash the kernel at least
@@ -292,6 +289,7 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
             return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMINTENSET):
     case HSR_CPREG32(PMINTENCLR):
+    case HSR_CPREG32(PMMIR):
         return handle_raz_wi(regs, regidx, cp32.read, hsr, 1);
     case HSR_CPREG32(PMCR):
     case HSR_CPREG32(PMCNTENSET):
@@ -320,8 +318,32 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
     GENERATE_TID3_INFO(ID_PFR0, pfr32, 0)
     GENERATE_TID3_INFO(ID_PFR1, pfr32, 1)
     GENERATE_TID3_INFO(ID_PFR2, pfr32, 2)
-    GENERATE_TID3_INFO(ID_DFR0, dbg32, 0)
-    GENERATE_TID3_INFO(ID_DFR1, dbg32, 1)
+
+    case HSR_CPREG32(ID_DFR0):
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+            info_dbg32.perfmon = 0;
+
+        return handle_ro_read_val(regs, regidx, cp32.read, hsr, 1,
+                                  info_dbg32.bits[0]);
+    }
+
+    case HSR_CPREG32(ID_DFR1):
+    {
+        union cpuinfo_dbg32 info_dbg32 = domain_cpuinfo.dbg32;
+
+        if ( !is_vpmu_domain(v->domain) )
+        {
+            info_dbg32.mtpmu = 0;
+            info_dbg32.hpmn0 = 0;
+        }
+
+        return handle_ro_read_val(regs, regidx, cp32.read, hsr, 1,
+                                  info_dbg32.bits[1]);
+    }
+
     GENERATE_TID3_INFO(ID_AFR0, aux32, 0)
     GENERATE_TID3_INFO(ID_MMFR0, mm32, 0)
     GENERATE_TID3_INFO(ID_MMFR1, mm32, 1)
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index eef10c2ea2..e352e2b38e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -1269,6 +1269,11 @@ static always_inline bool is_iommu_enabled(const struct domain *d)
     return evaluate_nospec(d->options & XEN_DOMCTL_CDF_iommu);
 }
 
+static inline bool is_vpmu_domain(const struct domain *d)
+{
+    return d->options & XEN_DOMCTL_CDF_vpmu;
+}
+
 #ifdef CONFIG_MEM_PAGING
 # define mem_paging_enabled(d) vm_event_check_ring((d)->vm_event_paging)
 #else
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 10:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400560.1636198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzXaf-0000bA-R4; Thu, 27 Aug 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 1400560.1636198; Thu, 27 Aug 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 1wzXaf-0000b2-OT; Thu, 27 Aug 2026 10:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1400560;
 Thu, 27 Aug 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 1wzXae-0000aq-F7
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 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 1wzXae-008IiV-2F
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 10:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzXae-003Kcl-1F
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 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=40NRwwh4v9PJ/ZE4nLJbS00iHQ1oX46t34DY26EHlPs=; b=5kythXwfx1NtTz2W6u7LgdjmQx
	HYmHRLbRPOHIryJJOZvBeTQN8SIqcYKbiXnTvUZL2baUZONDrKDF7yr/peioUfKpnIdtkW9Ng8ZG6
	e66XFPcHXfPTice6rgckf3YknqkMld7gtW/HPjjJAyr3JjTvZVBLpbnIsLu7CHZA73Z0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: traps: report level 0 faults in panic_PAR()
Message-Id: <E1wzXae-003Kcl-1F@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 10:44:12 +0000

commit 4e1f58ea1a20d8a831ad72aa30eafa618dfae750
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 25 08:23:28 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 27 11:25:41 2026 +0200

    xen/arm: traps: report level 0 faults in panic_PAR()
    
    decode_fsc() derives the fault level from the low two bits of the FSC, so
    level 0 is a valid output: FSC_FLT_TRANS is 0x04, i.e. "translation fault,
    level 0 or translation table base register".
    
    This is reachable on arm64 because xen_pgtable is the zeroeth-level root,
    but fsc_level_str() has no case for it and prints " (level invalid)"
    instead. At the time the function was created Xen used only three levels.
    
    Add the missing case. On arm32 the zeroeth level does not exist but FSC
    0 denotes address size fault at translation table base register.
    
    While at it, make decode_fsc() decode also address size faults.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 xen/arch/arm/include/asm/processor.h | 2 ++
 xen/arch/arm/traps.c                 | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..509040a1cd 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -521,6 +521,7 @@ extern register_t __cpu_logical_map[];
 /*
  * 543210 BIT
  * 00XXLL -- XX Fault Level LL
+ * ..00LL -- Address Size Fault LL
  * ..01LL -- Translation Fault LL
  * ..10LL -- Access Fault LL
  * ..11LL -- Permission Fault LL
@@ -534,6 +535,7 @@ extern register_t __cpu_logical_map[];
 #define FSC_TYPE_OTH   (_AC(0x02,U)<<4)
 #define FSC_TYPE_IMPL  (_AC(0x03,U)<<4)
 
+#define FSC_FLT_ADDR_SIZE (0x00)
 #define FSC_FLT_TRANS  (0x04)
 #define FSC_FLT_ACCESS (0x08)
 #define FSC_FLT_PERM   (0x0c)
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 0c01f37ad6..344aa21b98 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -307,6 +307,10 @@ static const char *decode_fsc(uint32_t fsc, int *level)
 
     switch ( fsc & 0x3f )
     {
+    case FSC_FLT_ADDR_SIZE ... FSC_FLT_ADDR_SIZE + 3:
+        msg = "Address size fault";
+        *level = fsc & FSC_LL_MASK;
+        break;
     case FSC_FLT_TRANS ... FSC_FLT_TRANS + 3:
         msg = "Translation fault";
         *level = fsc & FSC_LL_MASK;
@@ -363,6 +367,7 @@ static const char *fsc_level_str(int level)
     switch ( level )
     {
     case -1: return "";
+    case 0:  return " at level 0 or TTBR";
     case 1:  return " at level 1";
     case 2:  return " at level 2";
     case 3:  return " at level 3";
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Aug 27 10:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 27 Aug 2026 10:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1400561.1636202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wzXap-0000dK-SZ; Thu, 27 Aug 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 1400561.1636202; Thu, 27 Aug 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 1wzXap-0000dC-Pp; Thu, 27 Aug 2026 10:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1400561;
 Thu, 27 Aug 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 1wzXao-0000d2-Io
 for xen-changelog@lists.xenproject.org; Thu, 27 Aug 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 1wzXao-008Iih-2b
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 2026 10:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wzXao-003Mbw-1c
 for xen-changelog@lists.xenproject.org;
 Thu, 27 Aug 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=Vn/qK8zC2V3fZq4JGfk6tI2D3knFeXIni7Rp+96MrdQ=; b=xPh+5+tx6bx4i5vt6QwQ4Hy36V
	ApmNQK8yP6uWUb5gTBoWXzPmVovtKkFfDTz5ZsjLlN+lZoc70epszeorUnf557g12VE8U+c+s2vGc
	5yB0fr9tYUpUDPYtaq14MnXxwyvlcD5QNbTvRRMGm+ZdB3TQs4VkOJ5q3Iut6CX6wvj8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: traps: drop unreachable stage 2 decoding from panic_PAR()
Message-Id: <E1wzXao-003Mbw-1c@xenbits.xenproject.org>
Date: Thu, 27 Aug 2026 10:44:22 +0000

commit 79225a0c77e13b693b4d2b903a88289704b79db6
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Aug 25 08:23:29 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Aug 27 11:25:41 2026 +0200

    xen/arm: traps: drop unreachable stage 2 decoding from panic_PAR()
    
    panic_PAR() is only called from va_to_par(), which translates using
    __va_to_par(), i.e. "at s1e2r" on arm64 and ATS1HR on arm32. Both
    perform an EL2 stage 1 only translation, so PAR.S (PAR_STAGE2) and
    PAR.PTW (PAR_STAGE21) can never be set.
    
    This has been the case since commit a14447dbcf171 ("xen: arm: do not
    panic when failing to translate a guest address"), which made
    gva_to_par() and gva_to_ipa() return -EFAULT instead of calling
    panic_PAR() for guest translations.
    
    Print stage 1 unconditionally and keep an ASSERT() to document the
    invariant. PAR_STAGE21 has no user left, so drop it. While at it, fix
    the spacing in the decode_fsc() call.
    
    No functional change intended.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 xen/arch/arm/include/asm/processor.h |  1 -
 xen/arch/arm/traps.c                 | 17 +++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index 509040a1cd..8ee8f88fb4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -507,7 +507,6 @@ extern register_t __cpu_logical_map[];
 /* .... If F == 1 */
 #define PAR_FSC_SHIFT   (1)
 #define PAR_FSC_MASK    (_AC(0x3f,U)<<PAR_FSC_SHIFT)
-#define PAR_STAGE21     (_AC(1,U)<<8)     /* Stage 2 Fault During Stage 1 Walk */
 #define PAR_STAGE2      (_AC(1,U)<<9)     /* Stage 2 Fault */
 
 /* If F == 0 */
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 344aa21b98..625d229396 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -379,16 +379,17 @@ void panic_PAR(uint64_t par)
 {
     const char *msg;
     int level = -1;
-    int stage = par & PAR_STAGE2 ? 2 : 1;
-    int second_in_first = !!(par & PAR_STAGE21);
 
-    msg = decode_fsc( (par&PAR_FSC_MASK) >> PAR_FSC_SHIFT, &level);
+    /*
+     * The only caller translates using "at s1e2r" (arm64) or ATS1HR
+     * (arm32), i.e. an EL2 stage 1 only translation.
+     */
+    ASSERT(!(par & PAR_STAGE2));
+
+    msg = decode_fsc((par & PAR_FSC_MASK) >> PAR_FSC_SHIFT, &level);
 
-    printk("PAR: %016"PRIx64": %s stage %d%s%s\n",
-           par, msg,
-           stage,
-           second_in_first ? " during second stage lookup" : "",
-           fsc_level_str(level));
+    printk("PAR: %016"PRIx64": %s stage 1%s\n",
+           par, msg, fsc_level_str(level));
 
     panic("Error during Hypervisor-to-physical address translation\n");
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Aug 31 07:00:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Aug 2026 07:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1403785.1637755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1x0vzw-0004j9-Hb; Mon, 31 Aug 2026 07:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1403785.1637755; Mon, 31 Aug 2026 07:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1x0vzw-0004ii-ES; Mon, 31 Aug 2026 07:00:04 +0000
Received: by outflank-mailman (input) for mailman id 1403785;
 Mon, 31 Aug 2026 07:00:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1x0vzu-0004P0-Vd
 for xen-changelog@lists.xenproject.org; Mon, 31 Aug 2026 07:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1x0vzv-00EzMX-05
 for xen-changelog@lists.xenproject.org;
 Mon, 31 Aug 2026 07:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1x0vzu-003hTF-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 31 Aug 2026 07:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T60oAhMSBsHnS68XuTrV1wc7n5W5IVAd61ArCJ/NQq8=; b=pGxpdO8soLe8Qh9skrIYpYhwcU
	5ulUsIeUfyKewqQ9VnTlRTYSQK+KZy8nAnCAMar49ie3ybwPUXELGvL2p1aqFyrSL73oGIRGVs9E5
	hnWAR/QxJopseMFUNINKLqHsOLLjX7M6i1hiWBo7qhSQnuvuWOu9hZm9M9LVSXzJsIxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] ARM/vgic: Clean up vgic_v{2,3}_setup_hw()
Message-Id: <E1x0vzu-003hTF-2E@xenbits.xenproject.org>
Date: Mon, 31 Aug 2026 07:00:02 +0000

commit 452ee45ee13ebb6fed573266e6db67227c46936d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 28 09:04:09 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 31 08:38:30 2026 +0200

    ARM/vgic: Clean up vgic_v{2,3}_setup_hw()
    
    vgic_v{2,3}_setup_hw()'s callers are __init, so they should be too.
    vgic_v{2,3}_hw and gic_v2_hw_data are written once during init and
    unmodified thereafter, so make them __ro_after_init.  Reposition
    'bool enabled' in these structures to fit in the tail padding, removing
    8 bytes from their size when paddr_t is 8B.
    
    While at it, drop dead vgic_v3_setup_hw() dummy implementation
    from vgic/vgic.c. GICV3 depends on !NEW_VGIC.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/vgic-v2.c      |  8 ++++----
 xen/arch/arm/vgic-v3.c      | 11 +++++------
 xen/arch/arm/vgic/vgic-v2.c |  8 ++++----
 xen/arch/arm/vgic/vgic.c    | 11 -----------
 4 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 642407fd5b..3fa8cdeeab 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -25,7 +25,6 @@
 #include <asm/vreg.h>
 
 static struct {
-    bool enabled;
     /* Distributor interface address */
     paddr_t dbase;
     /* CPU interface address & size */
@@ -36,10 +35,11 @@ static struct {
 
     /* Offset to add to get an 8kB contiguous region if GIC is aliased */
     uint32_t aliased_offset;
-} vgic_v2_hw;
+    bool enabled;
+} vgic_v2_hw __ro_after_init;
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
-                      paddr_t vbase, uint32_t aliased_offset)
+void __init vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                             paddr_t vbase, uint32_t aliased_offset)
 {
     vgic_v2_hw.enabled = true;
     vgic_v2_hw.dbase = dbase;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index c01cc596d5..16e9d0cbad 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -44,19 +44,18 @@
 #define VGICD_CTLR_DEFAULT  (GICD_CTLR_ARE_NS)
 
 static struct {
-    bool enabled;
     /* Distributor interface address */
     paddr_t dbase;
     /* Re-distributor regions */
     unsigned int nr_rdist_regions;
     const struct rdist_region *regions;
     unsigned int intid_bits;  /* Number of interrupt ID bits */
-} vgic_v3_hw;
+    bool enabled;
+} vgic_v3_hw __ro_after_init;
 
-void vgic_v3_setup_hw(paddr_t dbase,
-                      unsigned int nr_rdist_regions,
-                      const struct rdist_region *regions,
-                      unsigned int intid_bits)
+void __init vgic_v3_setup_hw(paddr_t dbase, unsigned int nr_rdist_regions,
+                             const struct rdist_region *regions,
+                             unsigned int intid_bits)
 {
     vgic_v3_hw.enabled = true;
     vgic_v3_hw.dbase = dbase;
diff --git a/xen/arch/arm/vgic/vgic-v2.c b/xen/arch/arm/vgic/vgic-v2.c
index 6a558089c5..06fa365453 100644
--- a/xen/arch/arm/vgic/vgic-v2.c
+++ b/xen/arch/arm/vgic/vgic-v2.c
@@ -24,7 +24,6 @@
 #include "vgic.h"
 
 static struct {
-    bool enabled;
     paddr_t dbase;          /* Distributor interface address */
     paddr_t cbase;          /* CPU interface address & size */
     paddr_t csize;
@@ -32,10 +31,11 @@ static struct {
 
     /* Offset to add to get an 8kB contiguous region if GIC is aliased */
     uint32_t aliased_offset;
-} gic_v2_hw_data;
+    bool enabled;
+} gic_v2_hw_data __ro_after_init;
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
-                      paddr_t vbase, uint32_t aliased_offset)
+void __init vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                             paddr_t vbase, uint32_t aliased_offset)
 {
     gic_v2_hw_data.enabled = true;
     gic_v2_hw_data.dbase = dbase;
diff --git a/xen/arch/arm/vgic/vgic.c b/xen/arch/arm/vgic/vgic.c
index b2c0e1873a..ba029b8a3b 100644
--- a/xen/arch/arm/vgic/vgic.c
+++ b/xen/arch/arm/vgic/vgic.c
@@ -964,17 +964,6 @@ unsigned int vgic_max_vcpus(unsigned int domctl_vgic_version)
     }
 }
 
-#ifdef CONFIG_GICV3
-/* Dummy implementation to allow building without actual vGICv3 support. */
-void vgic_v3_setup_hw(paddr_t dbase,
-                      unsigned int nr_rdist_regions,
-                      const struct rdist_region *regions,
-                      unsigned int intid_bits)
-{
-    panic("New VGIC implementation does not yet support GICv3\n");
-}
-#endif
-
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Aug 31 07:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 31 Aug 2026 07:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1403788.1637758 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1x0wr9-0003bC-5P; Mon, 31 Aug 2026 07:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1403788.1637758; Mon, 31 Aug 2026 07:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1x0wr9-0003b4-2o; Mon, 31 Aug 2026 07:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1403788;
 Mon, 31 Aug 2026 07:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1x0wr7-0003ay-GN
 for xen-changelog@lists.xenproject.org; Mon, 31 Aug 2026 07:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1x0wr7-00F0LN-20
 for xen-changelog@lists.xenproject.org;
 Mon, 31 Aug 2026 07:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1x0wr7-008HIe-10
 for xen-changelog@lists.xenproject.org;
 Mon, 31 Aug 2026 07:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jDFly5mrFa+8RELxynIxHMyfFUSCvvfEWWtC/xNH7+4=; b=j3wqwD4FiVgeKNwF+U6qDLCNbF
	T9iYtVzkt4n4VTL1Pdrf/OTY+0ld8xZsf6UKmXzqFV4W8vgaYhqyozMwRfUaPhAo+R1tEt2Ef4UE3
	0Cdt7ZNKsHqjz67h9o4YIBJA7/aHULpGMDr+B2a8IkMdmJ8SATQQRWmUPAPajU8StROc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ARM/vgic: Clean up vgic_v{2,3}_setup_hw()
Message-Id: <E1x0wr7-008HIe-10@xenbits.xenproject.org>
Date: Mon, 31 Aug 2026 07:55:01 +0000

commit 452ee45ee13ebb6fed573266e6db67227c46936d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Aug 28 09:04:09 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Aug 31 08:38:30 2026 +0200

    ARM/vgic: Clean up vgic_v{2,3}_setup_hw()
    
    vgic_v{2,3}_setup_hw()'s callers are __init, so they should be too.
    vgic_v{2,3}_hw and gic_v2_hw_data are written once during init and
    unmodified thereafter, so make them __ro_after_init.  Reposition
    'bool enabled' in these structures to fit in the tail padding, removing
    8 bytes from their size when paddr_t is 8B.
    
    While at it, drop dead vgic_v3_setup_hw() dummy implementation
    from vgic/vgic.c. GICV3 depends on !NEW_VGIC.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/vgic-v2.c      |  8 ++++----
 xen/arch/arm/vgic-v3.c      | 11 +++++------
 xen/arch/arm/vgic/vgic-v2.c |  8 ++++----
 xen/arch/arm/vgic/vgic.c    | 11 -----------
 4 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 642407fd5b..3fa8cdeeab 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -25,7 +25,6 @@
 #include <asm/vreg.h>
 
 static struct {
-    bool enabled;
     /* Distributor interface address */
     paddr_t dbase;
     /* CPU interface address & size */
@@ -36,10 +35,11 @@ static struct {
 
     /* Offset to add to get an 8kB contiguous region if GIC is aliased */
     uint32_t aliased_offset;
-} vgic_v2_hw;
+    bool enabled;
+} vgic_v2_hw __ro_after_init;
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
-                      paddr_t vbase, uint32_t aliased_offset)
+void __init vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                             paddr_t vbase, uint32_t aliased_offset)
 {
     vgic_v2_hw.enabled = true;
     vgic_v2_hw.dbase = dbase;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index c01cc596d5..16e9d0cbad 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -44,19 +44,18 @@
 #define VGICD_CTLR_DEFAULT  (GICD_CTLR_ARE_NS)
 
 static struct {
-    bool enabled;
     /* Distributor interface address */
     paddr_t dbase;
     /* Re-distributor regions */
     unsigned int nr_rdist_regions;
     const struct rdist_region *regions;
     unsigned int intid_bits;  /* Number of interrupt ID bits */
-} vgic_v3_hw;
+    bool enabled;
+} vgic_v3_hw __ro_after_init;
 
-void vgic_v3_setup_hw(paddr_t dbase,
-                      unsigned int nr_rdist_regions,
-                      const struct rdist_region *regions,
-                      unsigned int intid_bits)
+void __init vgic_v3_setup_hw(paddr_t dbase, unsigned int nr_rdist_regions,
+                             const struct rdist_region *regions,
+                             unsigned int intid_bits)
 {
     vgic_v3_hw.enabled = true;
     vgic_v3_hw.dbase = dbase;
diff --git a/xen/arch/arm/vgic/vgic-v2.c b/xen/arch/arm/vgic/vgic-v2.c
index 6a558089c5..06fa365453 100644
--- a/xen/arch/arm/vgic/vgic-v2.c
+++ b/xen/arch/arm/vgic/vgic-v2.c
@@ -24,7 +24,6 @@
 #include "vgic.h"
 
 static struct {
-    bool enabled;
     paddr_t dbase;          /* Distributor interface address */
     paddr_t cbase;          /* CPU interface address & size */
     paddr_t csize;
@@ -32,10 +31,11 @@ static struct {
 
     /* Offset to add to get an 8kB contiguous region if GIC is aliased */
     uint32_t aliased_offset;
-} gic_v2_hw_data;
+    bool enabled;
+} gic_v2_hw_data __ro_after_init;
 
-void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
-                      paddr_t vbase, uint32_t aliased_offset)
+void __init vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
+                             paddr_t vbase, uint32_t aliased_offset)
 {
     gic_v2_hw_data.enabled = true;
     gic_v2_hw_data.dbase = dbase;
diff --git a/xen/arch/arm/vgic/vgic.c b/xen/arch/arm/vgic/vgic.c
index b2c0e1873a..ba029b8a3b 100644
--- a/xen/arch/arm/vgic/vgic.c
+++ b/xen/arch/arm/vgic/vgic.c
@@ -964,17 +964,6 @@ unsigned int vgic_max_vcpus(unsigned int domctl_vgic_version)
     }
 }
 
-#ifdef CONFIG_GICV3
-/* Dummy implementation to allow building without actual vGICv3 support. */
-void vgic_v3_setup_hw(paddr_t dbase,
-                      unsigned int nr_rdist_regions,
-                      const struct rdist_region *regions,
-                      unsigned int intid_bits)
-{
-    panic("New VGIC implementation does not yet support GICv3\n");
-}
-#endif
-
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master


