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


