From xen-changelog-bounces@lists.xenproject.org Mon Nov 02 11:11:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2026 11:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1468125.1677151 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNpwN-0006Wl-Qb; Mon, 02 Nov 2026 11:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1468125.1677151; Mon, 02 Nov 2026 11:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNpwN-0006Wd-Nw; Mon, 02 Nov 2026 11:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1468125;
 Mon, 02 Nov 2026 11:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xNpwM-0006WU-Ct
 for xen-changelog@lists.xenproject.org; Mon, 02 Nov 2026 11:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNpwM-0000000AjPg-18mF
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 11:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNpwM-0000000BSr3-0uud
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 11:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xYyBujjWV9N0CvqootURKKe531jgx7B7h1gjYX/gIdg=; b=RfF4cjBr/oMQz93R28AXunL1K7
	mra++0tzBosqfg1W1ReZS7hSv04IdEZAtaRVqkCMiOhBMIECwXP/4tjTPCbLFYzoC4BRJLsSUkreq
	Tltma/a1VgztmQiVkY3OK10mV4tuAc6pqrzSErOftAtQleMIS1U0Xj8a9qWxGI8Tat3U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: invoke xenheap_max_mfn() unconditionally
Message-Id: <E1xNpwM-0000000BSr3-0uud@xenbits.xenproject.org>
Date: Mon, 02 Nov 2026 11:11:02 +0000

commit f93ffa1309cd7a265038d376d80a007fdea9bf3c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 10:59:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 10:59:27 2026 +0100

    x86: invoke xenheap_max_mfn() unconditionally
    
    Calling the function only conditionally can, when highmem_start isn't set
    and when hotplugged memory appears above the boundary where the "short"
    directmap ends, result in Xenheap allocations to yield memory which isn't
    accessible through the "short" directmap. Accesses from PV guest context
    would then either fault or access guest controlled memory.
    
    With this the bifurcation done by 88e3ed61642b ("x86/NUMA: make
    init_node_heap() respect Xen heap limit") can also be undone:
    end_boot_allocator() can be called from a single place, and system_state
    is bumped right afterwards.
    
    Fixes: adc5afbf1c70 ("x86: support up to 16Tb")
    Assisted-by: Claude Opus 5.5
    Reported-by: George Dunlap <gwd@xenproject.org>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <gwd@xenproject.org>
---
 xen/arch/x86/setup.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 446cd81276..df7cfcc563 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1916,16 +1916,17 @@ void asmlinkage __init noreturn __start_xen(void)
 
     numa_initmem_init(0, raw_max_page);
 
+    if ( !highmem_start )
+        xenheap_max_mfn(virt_to_mfn(HYPERVISOR_VIRT_END - 1));
+
+    end_boot_allocator();
+    system_state = SYS_STATE_boot;
+
     if ( max_page - 1 > virt_to_mfn(HYPERVISOR_VIRT_END - 1) )
     {
         unsigned long lo = virt_to_mfn(HYPERVISOR_VIRT_END - 1);
         uint64_t mask = PAGE_SIZE - 1;
 
-        if ( !highmem_start )
-            xenheap_max_mfn(lo);
-
-        end_boot_allocator();
-
         /* Pass the remaining memory in (lo, max_page) to the allocator. */
         for ( i = 0; i < boot_e820.nr_map; i++ )
         {
@@ -1944,10 +1945,6 @@ void asmlinkage __init noreturn __start_xen(void)
             init_domheap_pages(s, e);
         }
     }
-    else
-        end_boot_allocator();
-
-    system_state = SYS_STATE_boot;
 
     bsp_stack = cpu_alloc_stack(0); /* Needs to know IDT vs FRED */
     if ( !bsp_stack )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 02 11:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2026 11:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1468126.1677154 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNpwX-0006Zj-Rl; Mon, 02 Nov 2026 11:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1468126.1677154; Mon, 02 Nov 2026 11:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNpwX-0006Zb-PK; Mon, 02 Nov 2026 11:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1468126;
 Mon, 02 Nov 2026 11:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xNpwW-0006ZN-Dd
 for xen-changelog@lists.xenproject.org; Mon, 02 Nov 2026 11:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNpwW-0000000AjPs-1bg0
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 11:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNpwW-0000000BSvz-1Qop
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 11:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Wuf3oXQUVWd6xBfMJUhHHNAobrAqP9tiNVnbrHczBu4=; b=oM8dSRopwflZtaC+IMZ3t5epji
	uacmMxUppAZ7D6Jj6SmrVohc+rtBrgnhx4SdegqjOlJ4/KbWM54WQJES6Iy5O8CESxmh8TxulcA5x
	BxISdae0eIGatuiFwigJWSJYa4QxkJS308HjWoi1p0eS6WyMaDpI7XOQFd1xvpM6Uzhk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/nestedsvm: remove dead code for shadow-paging L1 hosts
Message-Id: <E1xNpwW-0000000BSvz-1Qop@xenbits.xenproject.org>
Date: Mon, 02 Nov 2026 11:11:12 +0000

commit 55fb4025966fe934053060187aa699ca167fddf8
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Mon Nov 2 11:00:18 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 11:00:18 2026 +0100

    x86/nestedsvm: remove dead code for shadow-paging L1 hosts
    
    Nested virtualization on a domain is only permitted together with HAP:
    sanitise_domain_config() rejects XEN_DOMCTL_CDF_nested_virt requested
    without XEN_DOMCTL_CDF_hap, since shadow paging is too slow to be usable
    as the L0 paging mode underneath an L1 hypervisor. This means the host
    (L0) can never be in shadow paging mode while nested_virt is enabled,
    i.e. paging_mode_shadow(v->domain) is always false in this context.
    
    The nested SVM code still had incomplete/speculative handling for the
    'host shadow paging + guest shadow paging' case in
    nsvm_vcpu_hostrestore(), nsvm_vmcb_prepare4vmrun(),
    nsvm_vmcb_prepare4vmexit() and nestedsvm_check_intercepts(). Remove it,
    and assert the host paging mode with a single
    BUG_ON(paging_mode_shadow(v->domain)) ahead of the guest paging mode
    checks, so the remaining comments only describe the guest mode.
    
    In nestedsvm_check_intercepts()'s #PF handling, fold the two identical
    NESTEDHVM_VMEXIT_INJECT returns.
    
    Also drop the now always-true paging_mode_hap() check from
    svm_nested_features_on_efer_update(), and the stale "shadow-on-shadow"
    TODO in paging_update_nestedmode().
    
    No functional change.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 125 +++++++++++++++------------------------
 xen/arch/x86/mm/paging.c         |   1 -
 2 files changed, 48 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 56d0f0fa4d..128008321d 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -237,27 +237,10 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
     hvm_update_guest_cr(v, 2);
 
     /* CR3 */
-    /* Nested paging mode */
-    if ( nestedhvm_paging_mode_hap(v) )
-    {
-        /* host nested paging + guest nested paging. */
-        /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
-    }
-    else if ( !paging_mode_shadow(v->domain) )
-    {
-        /* host nested paging + guest shadow paging. */
-        /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
-    }
-    else
-    {
-        /* host shadow paging + guest shadow paging. */
+    /* Nested virt requires HAP, so L1 is never in shadow mode. */
+    BUG_ON(paging_mode_shadow(v->domain));
 
-        /* Reset MMU context  -- XXX (hostrestore) not yet working*/
-        if ( !pagetable_is_null(v->arch.guest_table) )
-            put_page(pagetable_get_page(v->arch.guest_table));
-        v->arch.guest_table = pagetable_null();
-        /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
-    }
+    /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
     rc = hvm_set_cr3(n1vmcb->_cr3, false, true);
     if ( rc == X86EMUL_EXCEPTION )
         hvm_inject_hw_exception(X86_EXC_GP, 0);
@@ -519,10 +502,13 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     v->arch.hvm.guest_cr[2] = ns_vmcb->_cr2;
     hvm_update_guest_cr(v, 2);
 
+    /* Nested virt requires HAP, so L1 is never in shadow mode. */
+    BUG_ON(paging_mode_shadow(v->domain));
+
     /* Nested paging mode */
     if ( nestedhvm_paging_mode_hap(v) )
     {
-        /* host nested paging + guest nested paging. */
+        /* Nested paging. */
         vmcb_set_np(n2vmcb, true);
 
         nestedsvm_vmcb_set_nestedp2m(v, ns_vmcb, n2vmcb);
@@ -534,13 +520,14 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
         if ( rc != X86EMUL_OKAY )
             gdprintk(XENLOG_ERR, "hvm_set_cr3 failed, rc: %u\n", rc);
     }
-    else if ( !paging_mode_shadow(v->domain) )
+    else
     {
-        /* host nested paging + guest shadow paging. */
+        /* Shadow paging. */
         vmcb_set_np(n2vmcb, true);
         /* Keep h_cr3 as it is. */
         n2vmcb->_h_cr3 = n1vmcb->_h_cr3;
-        /* When l1 guest does shadow paging
+        /*
+         * When l1 guest does shadow paging
          * we assume it intercepts page faults.
          */
         /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
@@ -550,16 +537,6 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
         if ( rc != X86EMUL_OKAY )
             gdprintk(XENLOG_ERR, "hvm_set_cr3 failed, rc: %u\n", rc);
     }
-    else
-    {
-        /* host shadow paging + guest shadow paging. */
-        vmcb_set_np(n2vmcb, false);
-        n2vmcb->_h_cr3 = 0x0;
-
-        /* TODO: Once shadow-shadow paging is in place come back to here
-         * and set host_vmcb->_cr3 to the shadowed shadow table.
-         */
-    }
 
     /* DRn */
     if ( !clean.dr )
@@ -1032,35 +1009,35 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 
     ns_vmcb->event_inj.raw = 0;
 
+    /* Nested virt requires HAP, so L1 is never in shadow mode. */
+    BUG_ON(paging_mode_shadow(v->domain));
+
     /* Nested paging mode */
     if ( nestedhvm_paging_mode_hap(v) )
     {
-        /* host nested paging + guest nested paging. */
+        /* Nested paging. */
         vmcb_set_np(ns_vmcb, vmcb_get_np(n2vmcb));
         ns_vmcb->_cr3 = n2vmcb->_cr3;
-        /* The vmcb->h_cr3 is the shadowed h_cr3. The original
+        /*
+         * The vmcb->h_cr3 is the shadowed h_cr3. The original
          * unshadowed guest h_cr3 is kept in ns_vmcb->h_cr3,
-         * hence we keep the ns_vmcb->h_cr3 value. */
-    }
-    else if ( !paging_mode_shadow(v->domain) )
-    {
-        /* host nested paging + guest shadow paging. */
-        vmcb_set_np(ns_vmcb, false);
-        /* Throw h_cr3 away. Guest is not allowed to set it or
-         * it can break out, otherwise (security hole!) */
-        ns_vmcb->_h_cr3 = 0x0;
-        /* Stop intercepting #PF (already done above
-         * by restoring cached intercepts). */
-        ns_vmcb->_cr3 = n2vmcb->_cr3;
+         * hence we keep the ns_vmcb->h_cr3 value.
+         */
     }
     else
     {
-        /* host shadow paging + guest shadow paging. */
+        /* Shadow paging. */
         vmcb_set_np(ns_vmcb, false);
+        /*
+         * Throw h_cr3 away. Guest is not allowed to set it or
+         * it can break out, otherwise (security hole!)
+         */
         ns_vmcb->_h_cr3 = 0x0;
-        /* The vmcb->_cr3 is the shadowed cr3. The original
-         * unshadowed guest cr3 is kept in ns_vmcb->_cr3,
-         * hence we keep the ns_vmcb->_cr3 value. */
+        /*
+         * Stop intercepting #PF (already done above
+         * by restoring cached intercepts).
+         */
+        ns_vmcb->_cr3 = n2vmcb->_cr3;
     }
 
     /* LBR virtualization - keep lbr control as is */
@@ -1262,40 +1239,35 @@ nestedsvm_check_intercepts(struct vcpu *v, struct cpu_user_regs *regs,
         return NESTEDHVM_VMEXIT_HOST;
 
     case VMEXIT_NPF:
+        /* Nested virt requires HAP, so L1 is never in shadow mode. */
+        BUG_ON(paging_mode_shadow(v->domain));
+
         if ( nestedhvm_paging_mode_hap(v) )
         {
+            /* Nested paging. */
             if ( !is_intercepted )
                 return NESTEDHVM_VMEXIT_FATALERROR;
-            /* host nested paging + guest nested paging */
             return NESTEDHVM_VMEXIT_HOST;
         }
-        if ( !paging_mode_shadow(v->domain) )
-        {
-            if ( is_intercepted )
-                return NESTEDHVM_VMEXIT_FATALERROR;
-            /* host nested paging + guest shadow paging */
-            return NESTEDHVM_VMEXIT_HOST;
-        }
-        /* host shadow paging + guest shadow paging */
-        /* Can this happen? */
-        BUG();
+
+        /* Shadow paging. */
+        if ( is_intercepted )
+            return NESTEDHVM_VMEXIT_FATALERROR;
+        return NESTEDHVM_VMEXIT_HOST;
 
     case VMEXIT_EXCEPTION_PF:
-        if ( nestedhvm_paging_mode_hap(v) )
-        {
-            /* host nested paging + guest nested paging */
-            if ( !is_intercepted )
-                /* l1 guest intercepts #PF unnecessarily */
-                return NESTEDHVM_VMEXIT_HOST;
-            /* l2 guest intercepts #PF unnecessarily */
-            return NESTEDHVM_VMEXIT_INJECT;
-        }
-        if ( paging_mode_shadow(v->domain) )
-            /* host shadow paging + guest shadow paging */
-            return NESTEDHVM_VMEXIT_HOST;
+        /* Nested virt requires HAP, so L1 is never in shadow mode. */
+        BUG_ON(paging_mode_shadow(v->domain));
 
-        /* host nested paging + guest shadow paging */
+        /*
+         * Nested paging and L1 doesn't intercept #PF: it is L0's business.
+         * Otherwise (L2 intercepts #PF unnecessarily, or uses shadow
+         * paging) hand it to L1.
+         */
+        if ( nestedhvm_paging_mode_hap(v) && !is_intercepted )
+            return NESTEDHVM_VMEXIT_HOST;
         return NESTEDHVM_VMEXIT_INJECT;
+
     case VMEXIT_VMMCALL:
         /* Always let the guest handle VMMCALL/VMCALL */
         return NESTEDHVM_VMEXIT_INJECT;
@@ -1568,7 +1540,6 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
     if ( nsvm_efer_svm_enabled(v) )
     {
         if ( !vmcb->virt_ext.fields.vloadsave_enable &&
-             !paging_mode_shadow(v->domain) &&
              cpu_has_svm_vloadsave )
         {
             vmcb->virt_ext.fields.vloadsave_enable = 1;
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 4bb8d169de..7c6df8d5d0 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -932,7 +932,6 @@ void paging_update_nestedmode(struct vcpu *v)
         /* nested-on-nested */
         v->arch.paging.nestedmode = hap_paging_get_mode(v);
     else
-        /* TODO: shadow-on-shadow */
         v->arch.paging.nestedmode = NULL;
     hvm_asid_flush_vcpu(v);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 02 11:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2026 11:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1468127.1677159 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNpwh-0006dZ-Tl; Mon, 02 Nov 2026 11:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1468127.1677159; Mon, 02 Nov 2026 11:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNpwh-0006dS-Qi; Mon, 02 Nov 2026 11:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1468127;
 Mon, 02 Nov 2026 11:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xNpwg-0006cD-HB
 for xen-changelog@lists.xenproject.org; Mon, 02 Nov 2026 11:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNpwg-0000000AjQ4-259u
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 11:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNpwg-0000000BT1H-1rMY
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 11:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+fsYhvPIYO3GpnPNejW2UF4jeWhOPe8Jnz1+PlZFGFw=; b=w4OxB/0RGvDbB7YP7uOzkK5jlZ
	YdJKRaB8ohm9BWJLBoDHTMhyJlYw5QgJvPcpfH1Cn6lqaJLS58yBT10Rq4usYwih1uGiG7mOa0pZ+
	9CGNUKSAxcnvGFdbwf1BazUfpdmIlcPwi+vh9QHZotZsBCB/HE5THeKgrG2ESb5VlCrw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: probe the A/D update scheme if the DT advertises neither
Message-Id: <E1xNpwg-0000000BT1H-1rMY@xenbits.xenproject.org>
Date: Mon, 02 Nov 2026 11:11:22 +0000

commit d8e0282815561ff67ebe6b5dfd582a586dafff48
Author:     Baptiste Le Duc <baptiste.le-duc@vates.tech>
AuthorDate: Mon Nov 2 11:00:38 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 11:00:38 2026 +0100

    xen/riscv: probe the A/D update scheme if the DT advertises neither
    
    p2m_set_pte_flags() presets the A/D bits of G-stage PTEs only when
    RISCV_ISA_EXT_svade is set, which is correct only if the device tree is.
    
    The privileged spec allows exactly two schemes for updating the PTE A and D
    bits: hardware sets them on access and on write, or accessing a page whose
    A and/or D bit is clear raises a page fault so that software can set them
    (ratified as Svade). Every implementation uses one of them, but platforms
    designed before Svade and Svadu were ratified, such as the HiFive Premier
    P550, may advertise neither.
    
    Trust the device tree when it advertises Svade and/or Svadu, as for any
    other extension. When it advertises neither, probe the scheme in effect
    and record the matching extension in riscv_isa, so that such device trees
    can be used as-is, and warn that it is missing from "riscv,isa" along with
    the probed result.
    
    Introduce probe_hw_ad_update(): alias the first page of the Xen image
    read-only through the FIX_MISC fixmap slot with its A and D bits clear,
    then load from it under an exception table fixup. Hardware updating is in
    effect if the load completes and the A bit is then set. The probe fails
    otherwise, whether the load faults or completes leaving the A bit clear.
    The A bit being set by a speculative access still implies Svadu, as Svade
    only allows A to be set by software.
    
    Add Svadu to the known ISA extensions so it can be told apart from Svade.
    The comment above the enum asks for new extensions to go at the bottom to
    avoid shuffling, a leftover from Linux where the IDs were macros with
    explicit values. Nothing depends on the enum values, so have the comment
    say that multi-letter extensions follow the order of riscv_isa_ext[].
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/cpufeature.c             | 69 +++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/cpufeature.h | 13 ++++---
 2 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 3d5bbd2228..dff590f68a 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -20,6 +20,7 @@
 
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
+#include <asm/fixmap.h>
 
 #ifdef CONFIG_ACPI
 # error "cpufeature.c functions should be updated to support ACPI"
@@ -200,6 +201,7 @@ static const struct riscv_isa_ext_entry __initconstrel riscv_isa_ext[] = {
     RISCV_ISA_EXT_ENTRY(ssaia,          ANY),
     RISCV_ISA_EXT_ENTRY(sstc,           NONE),
     RISCV_ISA_EXT_ENTRY(svade,          NONE),
+    RISCV_ISA_EXT_ENTRY(svadu,          NONE),
     RISCV_ISA_EXT_ENTRY(svpbmt,         NONE),
 };
 
@@ -630,6 +632,51 @@ const char *get_guest_isa_str(void)
     return guest_isa_str;
 }
 
+/*
+ * Probe whether hardware updates the PTE A/D bits by reading through an alias
+ * mapping whose A and D bits are clear. Observing A set, even by a speculative
+ * access, implies Svadu, as Svade only allows A to be set by software.
+ */
+static bool __init probe_hw_ad_update(void)
+{
+    vaddr_t va = FIXMAP_ADDR(FIX_MISC);
+    pte_t *entry = &xen_fixmap[FIX_MISC];
+    bool a_set = false;
+
+    ASSERT(!pte_is_valid(*entry));
+
+    /*
+     * set_fixmap() can't be used, as pt_update_entry() always sets A and D.
+     *
+     * A and D belong to the PTE, not to the page, so a new PTE with A and D
+     * clear can point to any RAM page, whatever its other mappings. Use the
+     * first page of the Xen image, and map it read-only so that Xen can't be
+     * corrupted through this alias.
+     */
+    write_pte(entry, pte_from_mfn(maddr_to_mfn(virt_to_maddr(_start)),
+                                  PTE_VALID | PTE_READABLE));
+    flush_tlb_one_local(va);
+
+    /* Read from the alias, handling page fault */
+    asm_inline goto (
+        "1: lw zero, 0(%[va])\n"
+        ASM_EXTABLE(1b, %l[out])
+        :
+        : [va] "r" (va)
+        : "memory"
+        : out );
+
+    /* Check to see if hardware set A. */
+    RISCV_FENCE(r, r);
+    a_set = read_pte(entry).pte & PTE_ACCESSED;
+
+ out:
+    write_pte(entry, (pte_t){});
+    flush_tlb_one_local(va);
+
+    return a_set;
+}
+
 void __init riscv_fill_hwcap(void)
 {
     unsigned int i;
@@ -674,6 +721,28 @@ void __init riscv_fill_hwcap(void)
                "Zihintpause unavailable: cpu_relax() gives the CPU no hint; "
                "wire up this platform's pause equivalent in cpu_relax()\n");
 
+    /*
+     * The privileged spec allows exactly two schemes for updating the PTE A
+     * and D bits:
+     *  1) hardware sets them on access and on write;
+     *  2) accessing a page whose A and/or D bit is clear raises a page fault,
+     *     so that software can set them (ratified as Svade).
+     *
+     * Every implementation uses one of them, but may predate the extensions
+     * and advertise neither. In that case, trust the hardware probe.
+     */
+    if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_svade) &&
+         !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_svadu) )
+    {
+        bool hw_update = probe_hw_ad_update();
+
+        __set_bit(hw_update ? RISCV_ISA_EXT_svadu : RISCV_ISA_EXT_svade,
+                  riscv_isa);
+        printk(XENLOG_WARNING
+               "Svade/Svadu missing from \"riscv,isa\" - probed as %s\n",
+               hw_update ? "svadu" : "svade");
+    }
+
     for ( i = 0; i < req_extns_amount; i++ )
     {
         const struct riscv_isa_ext_data ext = required_extensions[i];
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index 2973eb13a5..b0a23be18e 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -8,13 +8,13 @@
 #include <xen/types.h>
 
 /*
- * These macros represent the logical IDs of each multi-letter RISC-V ISA
- * extension and are used in the ISA bitmap. The logical IDs start from
- * RISCV_ISA_EXT_BASE, which allows the 0-25 range to be reserved for single
- * letter extensions and are used in enum riscv_isa_ext_id.
+ * Logical IDs of RISC-V ISA extensions, used as bit positions in the ISA
+ * bitmap.
  *
- * New extensions should just be added to the bottom, rather than added
- * alphabetically, in order to avoid unnecessary shuffling.
+ * Single-letter extensions use IDs below RISCV_ISA_EXT_BASE and are sorted
+ * alphabetically. Multi-letter extensions start from RISCV_ISA_EXT_BASE and
+ * follow the same order as riscv_isa_ext[] (see the ordering rules described
+ * above it).
  */
 #define RISCV_ISA_EXT_BASE  26
 
@@ -41,6 +41,7 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_ssaia,
     RISCV_ISA_EXT_sstc,
     RISCV_ISA_EXT_svade,
+    RISCV_ISA_EXT_svadu,
     RISCV_ISA_EXT_svpbmt,
     RISCV_ISA_EXT_MAX
 };
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 02 12:33:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2026 12:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1468177.1677253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNrDk-0002jZ-Bl; Mon, 02 Nov 2026 12:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1468177.1677253; Mon, 02 Nov 2026 12:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNrDk-0002jR-8z; Mon, 02 Nov 2026 12:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1468177;
 Mon, 02 Nov 2026 12:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xNrDi-0002jL-GP
 for xen-changelog@lists.xenproject.org; Mon, 02 Nov 2026 12:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNrDi-0000000Akoi-1arc
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 12:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNrDi-0000000CNLv-1Mb6
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 12:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ybv2eCVO5hReT6xgtODLx3QqQSxm++S/JlwQvr60sQw=; b=mYikv7Red1inkzUp1AIcRCS194
	pWd1c/8d9P6FuJ/XfO+Sey3auaDYRIRf4ZakWUkgMet+mXe2z/FaZsX1IHhhF6gj3l1SfBrknhKxQ
	1aLyawA78D3lh+H0qyEt7GTl0MvhaiGf3y8w/ux/9OuFGITkJSZUlJk7xEMUG3M6jqJQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: invoke xenheap_max_mfn() unconditionally
Message-Id: <E1xNrDi-0000000CNLv-1Mb6@xenbits.xenproject.org>
Date: Mon, 02 Nov 2026 12:33:02 +0000

commit f93ffa1309cd7a265038d376d80a007fdea9bf3c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 10:59:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 10:59:27 2026 +0100

    x86: invoke xenheap_max_mfn() unconditionally
    
    Calling the function only conditionally can, when highmem_start isn't set
    and when hotplugged memory appears above the boundary where the "short"
    directmap ends, result in Xenheap allocations to yield memory which isn't
    accessible through the "short" directmap. Accesses from PV guest context
    would then either fault or access guest controlled memory.
    
    With this the bifurcation done by 88e3ed61642b ("x86/NUMA: make
    init_node_heap() respect Xen heap limit") can also be undone:
    end_boot_allocator() can be called from a single place, and system_state
    is bumped right afterwards.
    
    Fixes: adc5afbf1c70 ("x86: support up to 16Tb")
    Assisted-by: Claude Opus 5.5
    Reported-by: George Dunlap <gwd@xenproject.org>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <gwd@xenproject.org>
---
 xen/arch/x86/setup.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 446cd81276..df7cfcc563 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1916,16 +1916,17 @@ void asmlinkage __init noreturn __start_xen(void)
 
     numa_initmem_init(0, raw_max_page);
 
+    if ( !highmem_start )
+        xenheap_max_mfn(virt_to_mfn(HYPERVISOR_VIRT_END - 1));
+
+    end_boot_allocator();
+    system_state = SYS_STATE_boot;
+
     if ( max_page - 1 > virt_to_mfn(HYPERVISOR_VIRT_END - 1) )
     {
         unsigned long lo = virt_to_mfn(HYPERVISOR_VIRT_END - 1);
         uint64_t mask = PAGE_SIZE - 1;
 
-        if ( !highmem_start )
-            xenheap_max_mfn(lo);
-
-        end_boot_allocator();
-
         /* Pass the remaining memory in (lo, max_page) to the allocator. */
         for ( i = 0; i < boot_e820.nr_map; i++ )
         {
@@ -1944,10 +1945,6 @@ void asmlinkage __init noreturn __start_xen(void)
             init_domheap_pages(s, e);
         }
     }
-    else
-        end_boot_allocator();
-
-    system_state = SYS_STATE_boot;
 
     bsp_stack = cpu_alloc_stack(0); /* Needs to know IDT vs FRED */
     if ( !bsp_stack )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 02 12:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2026 12:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1468178.1677257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNrDu-0002lM-Cs; Mon, 02 Nov 2026 12:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1468178.1677257; Mon, 02 Nov 2026 12:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNrDu-0002lE-AQ; Mon, 02 Nov 2026 12:33:14 +0000
Received: by outflank-mailman (input) for mailman id 1468178;
 Mon, 02 Nov 2026 12:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xNrDs-0002ky-HQ
 for xen-changelog@lists.xenproject.org; Mon, 02 Nov 2026 12:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNrDs-0000000Akoq-25yL
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 12:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNrDs-0000000CNSB-1tS3
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 12:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5OvaemimDv+XA5Esk0M/IcQ4A4alAdDGi2zxQzeZMzE=; b=ukphSHhBNHnqlNXj7LH+BiOaI+
	hlO+yovs7gSlSRodga9cYA6ay+I82U3b5RLhcSZjHvxCUjseZE4OF/85426wGoXoCw1s9+LEjDUN0
	PwSXO68+zdxZudgQdnD6ZFfL5fJJLhjPqpJs6geP9nSKEJCQg5B/cqR5kkoQeF/0IpHM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/nestedsvm: remove dead code for shadow-paging L1 hosts
Message-Id: <E1xNrDs-0000000CNSB-1tS3@xenbits.xenproject.org>
Date: Mon, 02 Nov 2026 12:33:12 +0000

commit 55fb4025966fe934053060187aa699ca167fddf8
Author:     Chunjie Zhu <chunjie.zhu@citrix.com>
AuthorDate: Mon Nov 2 11:00:18 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 11:00:18 2026 +0100

    x86/nestedsvm: remove dead code for shadow-paging L1 hosts
    
    Nested virtualization on a domain is only permitted together with HAP:
    sanitise_domain_config() rejects XEN_DOMCTL_CDF_nested_virt requested
    without XEN_DOMCTL_CDF_hap, since shadow paging is too slow to be usable
    as the L0 paging mode underneath an L1 hypervisor. This means the host
    (L0) can never be in shadow paging mode while nested_virt is enabled,
    i.e. paging_mode_shadow(v->domain) is always false in this context.
    
    The nested SVM code still had incomplete/speculative handling for the
    'host shadow paging + guest shadow paging' case in
    nsvm_vcpu_hostrestore(), nsvm_vmcb_prepare4vmrun(),
    nsvm_vmcb_prepare4vmexit() and nestedsvm_check_intercepts(). Remove it,
    and assert the host paging mode with a single
    BUG_ON(paging_mode_shadow(v->domain)) ahead of the guest paging mode
    checks, so the remaining comments only describe the guest mode.
    
    In nestedsvm_check_intercepts()'s #PF handling, fold the two identical
    NESTEDHVM_VMEXIT_INJECT returns.
    
    Also drop the now always-true paging_mode_hap() check from
    svm_nested_features_on_efer_update(), and the stale "shadow-on-shadow"
    TODO in paging_update_nestedmode().
    
    No functional change.
    
    Signed-off-by: Chunjie Zhu <chunjie.zhu@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 125 +++++++++++++++------------------------
 xen/arch/x86/mm/paging.c         |   1 -
 2 files changed, 48 insertions(+), 78 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 56d0f0fa4d..128008321d 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -237,27 +237,10 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
     hvm_update_guest_cr(v, 2);
 
     /* CR3 */
-    /* Nested paging mode */
-    if ( nestedhvm_paging_mode_hap(v) )
-    {
-        /* host nested paging + guest nested paging. */
-        /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
-    }
-    else if ( !paging_mode_shadow(v->domain) )
-    {
-        /* host nested paging + guest shadow paging. */
-        /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
-    }
-    else
-    {
-        /* host shadow paging + guest shadow paging. */
+    /* Nested virt requires HAP, so L1 is never in shadow mode. */
+    BUG_ON(paging_mode_shadow(v->domain));
 
-        /* Reset MMU context  -- XXX (hostrestore) not yet working*/
-        if ( !pagetable_is_null(v->arch.guest_table) )
-            put_page(pagetable_get_page(v->arch.guest_table));
-        v->arch.guest_table = pagetable_null();
-        /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
-    }
+    /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
     rc = hvm_set_cr3(n1vmcb->_cr3, false, true);
     if ( rc == X86EMUL_EXCEPTION )
         hvm_inject_hw_exception(X86_EXC_GP, 0);
@@ -519,10 +502,13 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     v->arch.hvm.guest_cr[2] = ns_vmcb->_cr2;
     hvm_update_guest_cr(v, 2);
 
+    /* Nested virt requires HAP, so L1 is never in shadow mode. */
+    BUG_ON(paging_mode_shadow(v->domain));
+
     /* Nested paging mode */
     if ( nestedhvm_paging_mode_hap(v) )
     {
-        /* host nested paging + guest nested paging. */
+        /* Nested paging. */
         vmcb_set_np(n2vmcb, true);
 
         nestedsvm_vmcb_set_nestedp2m(v, ns_vmcb, n2vmcb);
@@ -534,13 +520,14 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
         if ( rc != X86EMUL_OKAY )
             gdprintk(XENLOG_ERR, "hvm_set_cr3 failed, rc: %u\n", rc);
     }
-    else if ( !paging_mode_shadow(v->domain) )
+    else
     {
-        /* host nested paging + guest shadow paging. */
+        /* Shadow paging. */
         vmcb_set_np(n2vmcb, true);
         /* Keep h_cr3 as it is. */
         n2vmcb->_h_cr3 = n1vmcb->_h_cr3;
-        /* When l1 guest does shadow paging
+        /*
+         * When l1 guest does shadow paging
          * we assume it intercepts page faults.
          */
         /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
@@ -550,16 +537,6 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
         if ( rc != X86EMUL_OKAY )
             gdprintk(XENLOG_ERR, "hvm_set_cr3 failed, rc: %u\n", rc);
     }
-    else
-    {
-        /* host shadow paging + guest shadow paging. */
-        vmcb_set_np(n2vmcb, false);
-        n2vmcb->_h_cr3 = 0x0;
-
-        /* TODO: Once shadow-shadow paging is in place come back to here
-         * and set host_vmcb->_cr3 to the shadowed shadow table.
-         */
-    }
 
     /* DRn */
     if ( !clean.dr )
@@ -1032,35 +1009,35 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 
     ns_vmcb->event_inj.raw = 0;
 
+    /* Nested virt requires HAP, so L1 is never in shadow mode. */
+    BUG_ON(paging_mode_shadow(v->domain));
+
     /* Nested paging mode */
     if ( nestedhvm_paging_mode_hap(v) )
     {
-        /* host nested paging + guest nested paging. */
+        /* Nested paging. */
         vmcb_set_np(ns_vmcb, vmcb_get_np(n2vmcb));
         ns_vmcb->_cr3 = n2vmcb->_cr3;
-        /* The vmcb->h_cr3 is the shadowed h_cr3. The original
+        /*
+         * The vmcb->h_cr3 is the shadowed h_cr3. The original
          * unshadowed guest h_cr3 is kept in ns_vmcb->h_cr3,
-         * hence we keep the ns_vmcb->h_cr3 value. */
-    }
-    else if ( !paging_mode_shadow(v->domain) )
-    {
-        /* host nested paging + guest shadow paging. */
-        vmcb_set_np(ns_vmcb, false);
-        /* Throw h_cr3 away. Guest is not allowed to set it or
-         * it can break out, otherwise (security hole!) */
-        ns_vmcb->_h_cr3 = 0x0;
-        /* Stop intercepting #PF (already done above
-         * by restoring cached intercepts). */
-        ns_vmcb->_cr3 = n2vmcb->_cr3;
+         * hence we keep the ns_vmcb->h_cr3 value.
+         */
     }
     else
     {
-        /* host shadow paging + guest shadow paging. */
+        /* Shadow paging. */
         vmcb_set_np(ns_vmcb, false);
+        /*
+         * Throw h_cr3 away. Guest is not allowed to set it or
+         * it can break out, otherwise (security hole!)
+         */
         ns_vmcb->_h_cr3 = 0x0;
-        /* The vmcb->_cr3 is the shadowed cr3. The original
-         * unshadowed guest cr3 is kept in ns_vmcb->_cr3,
-         * hence we keep the ns_vmcb->_cr3 value. */
+        /*
+         * Stop intercepting #PF (already done above
+         * by restoring cached intercepts).
+         */
+        ns_vmcb->_cr3 = n2vmcb->_cr3;
     }
 
     /* LBR virtualization - keep lbr control as is */
@@ -1262,40 +1239,35 @@ nestedsvm_check_intercepts(struct vcpu *v, struct cpu_user_regs *regs,
         return NESTEDHVM_VMEXIT_HOST;
 
     case VMEXIT_NPF:
+        /* Nested virt requires HAP, so L1 is never in shadow mode. */
+        BUG_ON(paging_mode_shadow(v->domain));
+
         if ( nestedhvm_paging_mode_hap(v) )
         {
+            /* Nested paging. */
             if ( !is_intercepted )
                 return NESTEDHVM_VMEXIT_FATALERROR;
-            /* host nested paging + guest nested paging */
             return NESTEDHVM_VMEXIT_HOST;
         }
-        if ( !paging_mode_shadow(v->domain) )
-        {
-            if ( is_intercepted )
-                return NESTEDHVM_VMEXIT_FATALERROR;
-            /* host nested paging + guest shadow paging */
-            return NESTEDHVM_VMEXIT_HOST;
-        }
-        /* host shadow paging + guest shadow paging */
-        /* Can this happen? */
-        BUG();
+
+        /* Shadow paging. */
+        if ( is_intercepted )
+            return NESTEDHVM_VMEXIT_FATALERROR;
+        return NESTEDHVM_VMEXIT_HOST;
 
     case VMEXIT_EXCEPTION_PF:
-        if ( nestedhvm_paging_mode_hap(v) )
-        {
-            /* host nested paging + guest nested paging */
-            if ( !is_intercepted )
-                /* l1 guest intercepts #PF unnecessarily */
-                return NESTEDHVM_VMEXIT_HOST;
-            /* l2 guest intercepts #PF unnecessarily */
-            return NESTEDHVM_VMEXIT_INJECT;
-        }
-        if ( paging_mode_shadow(v->domain) )
-            /* host shadow paging + guest shadow paging */
-            return NESTEDHVM_VMEXIT_HOST;
+        /* Nested virt requires HAP, so L1 is never in shadow mode. */
+        BUG_ON(paging_mode_shadow(v->domain));
 
-        /* host nested paging + guest shadow paging */
+        /*
+         * Nested paging and L1 doesn't intercept #PF: it is L0's business.
+         * Otherwise (L2 intercepts #PF unnecessarily, or uses shadow
+         * paging) hand it to L1.
+         */
+        if ( nestedhvm_paging_mode_hap(v) && !is_intercepted )
+            return NESTEDHVM_VMEXIT_HOST;
         return NESTEDHVM_VMEXIT_INJECT;
+
     case VMEXIT_VMMCALL:
         /* Always let the guest handle VMMCALL/VMCALL */
         return NESTEDHVM_VMEXIT_INJECT;
@@ -1568,7 +1540,6 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
     if ( nsvm_efer_svm_enabled(v) )
     {
         if ( !vmcb->virt_ext.fields.vloadsave_enable &&
-             !paging_mode_shadow(v->domain) &&
              cpu_has_svm_vloadsave )
         {
             vmcb->virt_ext.fields.vloadsave_enable = 1;
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 4bb8d169de..7c6df8d5d0 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -932,7 +932,6 @@ void paging_update_nestedmode(struct vcpu *v)
         /* nested-on-nested */
         v->arch.paging.nestedmode = hap_paging_get_mode(v);
     else
-        /* TODO: shadow-on-shadow */
         v->arch.paging.nestedmode = NULL;
     hvm_asid_flush_vcpu(v);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 02 12:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2026 12:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1468179.1677262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNrE4-0002nN-EX; Mon, 02 Nov 2026 12:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1468179.1677262; Mon, 02 Nov 2026 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xNrE4-0002nF-Bp; Mon, 02 Nov 2026 12:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1468179;
 Mon, 02 Nov 2026 12:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xNrE2-0002n6-Ko
 for xen-changelog@lists.xenproject.org; Mon, 02 Nov 2026 12:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNrE2-0000000Akou-2YC0
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 12:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xNrE2-0000000CNWV-2Lne
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Nov 2026 12:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JMdUuAN+gMv8GX/5rBXAgsbVCVxDE4S2D+l49lyjjko=; b=5CJ5zsalPKqxkYq1vvP/dd26Yw
	tea1A+QgBkBZi3ZgY8de58+C42kqFlmtJ9zAKKPribYFWC4H+iPdW9Jk/UxZrycI7me7fvtvnmOKy
	RkUc82/c4ILjSdoKpC37YfZm7utEQg7P2/9Ce56iYMA8v665NpKIY1w9t7aKNBKhrgd4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: probe the A/D update scheme if the DT advertises neither
Message-Id: <E1xNrE2-0000000CNWV-2Lne@xenbits.xenproject.org>
Date: Mon, 02 Nov 2026 12:33:22 +0000

commit d8e0282815561ff67ebe6b5dfd582a586dafff48
Author:     Baptiste Le Duc <baptiste.le-duc@vates.tech>
AuthorDate: Mon Nov 2 11:00:38 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 11:00:38 2026 +0100

    xen/riscv: probe the A/D update scheme if the DT advertises neither
    
    p2m_set_pte_flags() presets the A/D bits of G-stage PTEs only when
    RISCV_ISA_EXT_svade is set, which is correct only if the device tree is.
    
    The privileged spec allows exactly two schemes for updating the PTE A and D
    bits: hardware sets them on access and on write, or accessing a page whose
    A and/or D bit is clear raises a page fault so that software can set them
    (ratified as Svade). Every implementation uses one of them, but platforms
    designed before Svade and Svadu were ratified, such as the HiFive Premier
    P550, may advertise neither.
    
    Trust the device tree when it advertises Svade and/or Svadu, as for any
    other extension. When it advertises neither, probe the scheme in effect
    and record the matching extension in riscv_isa, so that such device trees
    can be used as-is, and warn that it is missing from "riscv,isa" along with
    the probed result.
    
    Introduce probe_hw_ad_update(): alias the first page of the Xen image
    read-only through the FIX_MISC fixmap slot with its A and D bits clear,
    then load from it under an exception table fixup. Hardware updating is in
    effect if the load completes and the A bit is then set. The probe fails
    otherwise, whether the load faults or completes leaving the A bit clear.
    The A bit being set by a speculative access still implies Svadu, as Svade
    only allows A to be set by software.
    
    Add Svadu to the known ISA extensions so it can be told apart from Svade.
    The comment above the enum asks for new extensions to go at the bottom to
    avoid shuffling, a leftover from Linux where the IDs were macros with
    explicit values. Nothing depends on the enum values, so have the comment
    say that multi-letter extensions follow the order of riscv_isa_ext[].
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/cpufeature.c             | 69 +++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/cpufeature.h | 13 ++++---
 2 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 3d5bbd2228..dff590f68a 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -20,6 +20,7 @@
 
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
+#include <asm/fixmap.h>
 
 #ifdef CONFIG_ACPI
 # error "cpufeature.c functions should be updated to support ACPI"
@@ -200,6 +201,7 @@ static const struct riscv_isa_ext_entry __initconstrel riscv_isa_ext[] = {
     RISCV_ISA_EXT_ENTRY(ssaia,          ANY),
     RISCV_ISA_EXT_ENTRY(sstc,           NONE),
     RISCV_ISA_EXT_ENTRY(svade,          NONE),
+    RISCV_ISA_EXT_ENTRY(svadu,          NONE),
     RISCV_ISA_EXT_ENTRY(svpbmt,         NONE),
 };
 
@@ -630,6 +632,51 @@ const char *get_guest_isa_str(void)
     return guest_isa_str;
 }
 
+/*
+ * Probe whether hardware updates the PTE A/D bits by reading through an alias
+ * mapping whose A and D bits are clear. Observing A set, even by a speculative
+ * access, implies Svadu, as Svade only allows A to be set by software.
+ */
+static bool __init probe_hw_ad_update(void)
+{
+    vaddr_t va = FIXMAP_ADDR(FIX_MISC);
+    pte_t *entry = &xen_fixmap[FIX_MISC];
+    bool a_set = false;
+
+    ASSERT(!pte_is_valid(*entry));
+
+    /*
+     * set_fixmap() can't be used, as pt_update_entry() always sets A and D.
+     *
+     * A and D belong to the PTE, not to the page, so a new PTE with A and D
+     * clear can point to any RAM page, whatever its other mappings. Use the
+     * first page of the Xen image, and map it read-only so that Xen can't be
+     * corrupted through this alias.
+     */
+    write_pte(entry, pte_from_mfn(maddr_to_mfn(virt_to_maddr(_start)),
+                                  PTE_VALID | PTE_READABLE));
+    flush_tlb_one_local(va);
+
+    /* Read from the alias, handling page fault */
+    asm_inline goto (
+        "1: lw zero, 0(%[va])\n"
+        ASM_EXTABLE(1b, %l[out])
+        :
+        : [va] "r" (va)
+        : "memory"
+        : out );
+
+    /* Check to see if hardware set A. */
+    RISCV_FENCE(r, r);
+    a_set = read_pte(entry).pte & PTE_ACCESSED;
+
+ out:
+    write_pte(entry, (pte_t){});
+    flush_tlb_one_local(va);
+
+    return a_set;
+}
+
 void __init riscv_fill_hwcap(void)
 {
     unsigned int i;
@@ -674,6 +721,28 @@ void __init riscv_fill_hwcap(void)
                "Zihintpause unavailable: cpu_relax() gives the CPU no hint; "
                "wire up this platform's pause equivalent in cpu_relax()\n");
 
+    /*
+     * The privileged spec allows exactly two schemes for updating the PTE A
+     * and D bits:
+     *  1) hardware sets them on access and on write;
+     *  2) accessing a page whose A and/or D bit is clear raises a page fault,
+     *     so that software can set them (ratified as Svade).
+     *
+     * Every implementation uses one of them, but may predate the extensions
+     * and advertise neither. In that case, trust the hardware probe.
+     */
+    if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_svade) &&
+         !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_svadu) )
+    {
+        bool hw_update = probe_hw_ad_update();
+
+        __set_bit(hw_update ? RISCV_ISA_EXT_svadu : RISCV_ISA_EXT_svade,
+                  riscv_isa);
+        printk(XENLOG_WARNING
+               "Svade/Svadu missing from \"riscv,isa\" - probed as %s\n",
+               hw_update ? "svadu" : "svade");
+    }
+
     for ( i = 0; i < req_extns_amount; i++ )
     {
         const struct riscv_isa_ext_data ext = required_extensions[i];
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index 2973eb13a5..b0a23be18e 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -8,13 +8,13 @@
 #include <xen/types.h>
 
 /*
- * These macros represent the logical IDs of each multi-letter RISC-V ISA
- * extension and are used in the ISA bitmap. The logical IDs start from
- * RISCV_ISA_EXT_BASE, which allows the 0-25 range to be reserved for single
- * letter extensions and are used in enum riscv_isa_ext_id.
+ * Logical IDs of RISC-V ISA extensions, used as bit positions in the ISA
+ * bitmap.
  *
- * New extensions should just be added to the bottom, rather than added
- * alphabetically, in order to avoid unnecessary shuffling.
+ * Single-letter extensions use IDs below RISCV_ISA_EXT_BASE and are sorted
+ * alphabetically. Multi-letter extensions start from RISCV_ISA_EXT_BASE and
+ * follow the same order as riscv_isa_ext[] (see the ordering rules described
+ * above it).
  */
 #define RISCV_ISA_EXT_BASE  26
 
@@ -41,6 +41,7 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_ssaia,
     RISCV_ISA_EXT_sstc,
     RISCV_ISA_EXT_svade,
+    RISCV_ISA_EXT_svadu,
     RISCV_ISA_EXT_svpbmt,
     RISCV_ISA_EXT_MAX
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469670.1678387 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODLz-0007aU-DB; Tue, 03 Nov 2026 12:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469670.1678387; Tue, 03 Nov 2026 12:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODLz-0007aM-Ag; Tue, 03 Nov 2026 12:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1469670;
 Tue, 03 Nov 2026 12:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODLx-0007aG-UC
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODLx-0000000CaBU-3aYe
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODLx-00000006So1-3OMV
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DndN2dLWAaP+BYWA8ZqfFXojD2sk9lL8ti7Na0nox6o=; b=qEwW2i7FCkh5Ac7rmTqy12OE6X
	3+W3tSbc/Ctpo+Z3fBwgsBCDFJ3HFx1K2vjbeLzdLFeUKWGfigfQIoGfLrcs9O/3b2U2AasXQGJzK
	CyZ551cDOGlescrPQe9LS46msl8/KQjqQznZCVMchbSIQPGHkjnE8uolH7G06AqgrIKc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xODLx-00000006So1-3OMV@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:11:01 +0000

commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:03:21 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index b15805f3f9..3dc5ff88da 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3083,10 +3083,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469671.1678392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODM9-0007cI-Et; Tue, 03 Nov 2026 12:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469671.1678392; Tue, 03 Nov 2026 12:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODM9-0007c9-CC; Tue, 03 Nov 2026 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1469671;
 Tue, 03 Nov 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 1xODM8-0007bw-01
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODM7-0000000CaBf-43JH
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODM7-00000006SzO-3rsv
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8sTWhAJ5+l8If8qHALEJXn2ZvsGZavlo8DtT6+QYixI=; b=HS9eXlBajSari9se5jTaBUIzc3
	KjjSQy+BsnM4N1xj/QQqNcylh8bWd3WogknZMHXtoYmZDo3oip/iJl5OqVqPoqVY5aJMxqOViFhye
	dv6Kk+L6G3GqEHHL4rXEti9n8v07g1qFgyyoNKwN/wvt36LnUBhrSAVHdgLpzn4GhFe0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xODM7-00000006SzO-3rsv@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:11:11 +0000

commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:03:21 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 3dc5ff88da..5e79c012b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2936,13 +2936,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2974,12 +2969,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3042,6 +3035,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469672.1678397 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODMJ-0007eT-GU; Tue, 03 Nov 2026 12:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469672.1678397; Tue, 03 Nov 2026 12:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODMJ-0007eL-DS; Tue, 03 Nov 2026 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1469672;
 Tue, 03 Nov 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 1xODMI-0007e8-FS
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMI-0000000CaBo-1rUA
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMI-00000006T7G-1ftt
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=CS4MpidUKtWBkq9yHlgLka2u4bXyPVlaobYiUqf1IqU=; b=cb+Vn4BMSoZPFrv6NFeejNkDtv
	mlpjeFggzquch2rD4AsHUDYRuiI17tRUKQrrRoJfkP1tLu8QlCcnJYu9wFTM1ZrJ1rQuwQS5afbbl
	Nm1P1QWWFf+a58HFql/PPaSQdUHw7qiUQ4dCgMXXy+cCFcR1ZPgeHndajvA0ynurfY20=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xODMI-00000006T7G-1ftt@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:11:22 +0000

commit f463f6d13f4b078df895b880c2b17581b2b74680
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:13 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 03e919fd24..3331a5478e 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3083,10 +3083,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469673.1678400 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODMU-0007gS-HH; Tue, 03 Nov 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 1469673.1678400; Tue, 03 Nov 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 1xODMU-0007gK-Eo; Tue, 03 Nov 2026 12:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1469673;
 Tue, 03 Nov 2026 12:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODMS-0007g6-JS
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMS-0000000CaBs-2LGz
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMS-00000006TJg-29Nw
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=qbbPKlul06Kp98GkPywmfl2jtKsERX/cUJjTgzb9qgM=; b=c6olr84HmTF9VAkNFm3QlgKxWR
	AfoTKEGbN3uGb27uvZd00U7m7MefVj5tMMpf95BQ3hrOzkmQpFE/eNkQOtHGfxj9mPvsDm3yg1z8Y
	m7FEKjE9fiQb+2BuiMJSHghWy+1Xc6L7FubY5OHBLvRpKkKc3uc5GlzThocfgvMoSQZ0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.22] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xODMS-00000006TJg-29Nw@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:11:32 +0000

commit d7ddb103825139c09bdafedc190712b877ebffd2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:13 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 3331a5478e..2ad5ef9270 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2936,13 +2936,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2974,12 +2969,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3042,6 +3035,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.22


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469674.1678404 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODMe-0007iU-If; Tue, 03 Nov 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 1469674.1678404; Tue, 03 Nov 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 1xODMe-0007iL-G3; Tue, 03 Nov 2026 12:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1469674;
 Tue, 03 Nov 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 1xODMd-0007iE-2X
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:11:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMd-0000000CaBw-0ByR
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMc-00000006TPA-49c6
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=rpGOneEZTfMkwIxWMKAQUZvhntsaZGsj5lfuU9fc/5A=; b=GPU10IX7GhWTlw24+xdyfU/QXM
	7/d7Dv1kLggMj1GFQ8LWs+OsjiEiWGyGHRHah2hxy1gKCx6ClRZvDxIu/8z3FHYuz6xsNOZlQEmzW
	32g3NAkE2DiEby9ePrNsS/SL8y4LL4QzgzhGBrD8w85Ethu+YURsiZT0aK2pD+cOW0p8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xODMc-00000006TPA-49c6@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:11:42 +0000

commit 6db96d2ae50f046df8fc5f1de28b2cebb3f11569
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:52 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2154802b2f..9109fd6bf5 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3084,10 +3084,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469675.1678408 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODMo-0007lP-K9; Tue, 03 Nov 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 1469675.1678408; Tue, 03 Nov 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 1xODMo-0007lH-HJ; Tue, 03 Nov 2026 12:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1469675;
 Tue, 03 Nov 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 1xODMn-0007l9-6D
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:11:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMn-0000000CaCG-0fFg
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMn-00000006Tbd-0ShF
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=G1tz4fAQhX6ANeLFfAjrhbVHgNgZ/9swqSnzN2W3rqE=; b=DB4w+nES5nCVRT1Ty5ssMNFVTD
	huLckNdFYXnYtEP5veKj5MPr8PwI11rKIve8S0hoOyzE5VLGFlDNv75wdJZungQrzTNqLfBaevYnj
	+Rn3OEvJFxXMUJl4eC4LDVJNQLuCbrkTu8mJawIG9UQMPnse6QYEYbsATBQclMjCE1h4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xODMn-00000006Tbd-0ShF@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:11:53 +0000

commit 6ef55592aff9616a98d8c0b3a3dbc1ff009a21eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:52 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 9109fd6bf5..86b9cb9fd1 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2937,13 +2937,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2975,12 +2970,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3043,6 +3036,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:12:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:12:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469676.1678412 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODMz-0007nk-LO; Tue, 03 Nov 2026 12:12:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469676.1678412; Tue, 03 Nov 2026 12:12: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 1xODMz-0007nc-Im; Tue, 03 Nov 2026 12:12:05 +0000
Received: by outflank-mailman (input) for mailman id 1469676;
 Tue, 03 Nov 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 1xODMx-0007nV-LN
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:12:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMx-0000000CaCZ-2dQi
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODMx-00000006Trm-2SoM
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=7MQw/Qqo4KXAUaiFVDGBJxXbXPFpMQNBN9EoJuFt+IM=; b=C1vxSYV7ft8mbq119juqulJ2VO
	Hg3xTgwfxRD76UpxkdW8F2LcTbZ+p+4PTrVIUWNvRpEK28rTCxaG5CFFpVkLPEJUkK45OUz1D11HG
	0yVeSSM7eA3TtsEONatvzr67+N3jfWnacsY8b3Sc90HDCp9II1YsjyhhXYU56tPYufR8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xODMx-00000006Trm-2SoM@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:12:03 +0000

commit c24e3f17cbc47f1a0777d17f4df1a847fb3f051d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:11 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 6d2cc43339..ce680619cc 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3082,10 +3082,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:12:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:12:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469677.1678415 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODN9-0007pj-N6; Tue, 03 Nov 2026 12:12:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469677.1678415; Tue, 03 Nov 2026 12:12:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODN9-0007pb-K7; Tue, 03 Nov 2026 12:12:15 +0000
Received: by outflank-mailman (input) for mailman id 1469677;
 Tue, 03 Nov 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 1xODN7-0007pR-QK
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:12:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODN7-0000000CaCf-3IMN
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODN7-00000006U9U-2tls
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=ncLxRClMa+Lo20WwSXC0g49NY0Be3V9Z2jfem9PQh1k=; b=MmD9pRp5W/eiIxqmrxjZrvsjUu
	6Ib1viv3vk/tytHkao9tlsRqxXK1/E5EJw4JttTD3Bo7GQXqoWGeKZSK249jhTX8TOI3qkYd+h4zn
	L8d9P/Jm9cnq5I637CBVHdiWR3lexWK35/8JrQyHbHaEF/2NQ/j5xiI1twT9YMFGA2Jg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xODN7-00000006U9U-2tls@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:12:13 +0000

commit 7abfd2bce281bf77091649af5e3dbfeef2aea188
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:11 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index ce680619cc..7bca91bf35 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2935,13 +2935,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2973,12 +2968,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3041,6 +3034,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:12:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:12:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469678.1678419 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNJ-0007sB-P0; Tue, 03 Nov 2026 12:12:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469678.1678419; Tue, 03 Nov 2026 12:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNJ-0007s3-MP; Tue, 03 Nov 2026 12:12:25 +0000
Received: by outflank-mailman (input) for mailman id 1469678;
 Tue, 03 Nov 2026 12:12:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODNI-0007rw-9t
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:12:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNI-0000000CaFR-197n
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNI-00000006UOj-107B
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7O4IMtqr8H/wry/WNthmBL/C0xuVWkVpyU3CFtkCqn8=; b=GBn0KA9aGf6xUaWpHIHXqRSJGc
	X34M7CQ8VxqKQXPGlZJN1dS3uUtY6X9zFFh5t66ELKXF5IkrO5KjEo5ycZX/r9NBUL5tJI7lcjq3C
	kHPW1lpCfBPY+oHuEYhKe+ySnBEjG2/w5yESkxJehoX7tR7nNhZPPuNQAcRUdadNq5fw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xODNI-00000006UOj-107B@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:12:24 +0000

commit e703d5e4a7413f4419b4c72f2a7ae7906c7e678e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:45 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 1ce74c5bfe..9875780ae3 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3081,10 +3081,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:12:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469679.1678423 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNT-0007u8-QX; Tue, 03 Nov 2026 12:12:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469679.1678423; Tue, 03 Nov 2026 12:12:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNT-0007ty-Np; Tue, 03 Nov 2026 12:12:35 +0000
Received: by outflank-mailman (input) for mailman id 1469679;
 Tue, 03 Nov 2026 12:12:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODNS-0007tq-DC
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:12:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNS-0000000CaFY-1Zji
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNS-00000006UXn-1REB
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pcjuIiiemBtCgkxmzkDTafqbasJjwOcIDQTGYgIa9a8=; b=1oT9U5o2Mwm9V5pjUPjyoUzD5p
	zFER4aZ/EqLfZ/C8wEv2V1zUofD5JegFW1smFONr2oDUpVtT/x6UGK4iCWahjWYCOD/2pF95Z6IpE
	8U/utS3vgQJg0i4lX/7RPyaS0ZDaguO784TNxCg0ok9p40F2+h6Z7RUW2bVNHKrfDm7E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xODNS-00000006UXn-1REB@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:12:34 +0000

commit 322fab7de5d03193f44cff59880303f66ea6473e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:45 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 9875780ae3..c93a243e05 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2934,13 +2934,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2972,12 +2967,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3040,6 +3033,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:12:46 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:12:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469680.1678427 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNe-0007wC-Rl; Tue, 03 Nov 2026 12:12:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469680.1678427; Tue, 03 Nov 2026 12:12:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNe-0007w2-P9; Tue, 03 Nov 2026 12:12:46 +0000
Received: by outflank-mailman (input) for mailman id 1469680;
 Tue, 03 Nov 2026 12:12:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODNc-0007vu-Qs
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:12:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNc-0000000CaFc-3LtW
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNc-00000006Upg-3Dw0
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=En/uWRswYr6+/ajgtC7G3gELudfhSanbsR7zdpXjDQ0=; b=4vesLqsY6psxUGbanWsd1oVBtA
	qNkri4/2Y881T+t9xsaRwdMnfYUvUSA2Lg2QyLAYhkPhR4YPRki4KVvWo7ZXpYtfM0TI4SESnqm9g
	IIhPSDs6IHKRBeqtqNXDYc0OVj9Bwuas+/xCnSyJ9WXl7po0SVTTZuYG/veGsMkb1FN4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xODNc-00000006Upg-3Dw0@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:12:44 +0000

commit 955b12ea84fdfd84cf183b30708d4162642ab58d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:07:17 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 742c9797c5..842d436848 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3081,10 +3081,10 @@ static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
                                     const struct gnttab_copy_buf *b,
                                     bool_t has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:12:56 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:12:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469681.1678432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNo-0007yK-TE; Tue, 03 Nov 2026 12:12:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469681.1678432; Tue, 03 Nov 2026 12:12:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNo-0007yC-QT; Tue, 03 Nov 2026 12:12:56 +0000
Received: by outflank-mailman (input) for mailman id 1469681;
 Tue, 03 Nov 2026 12:12:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODNm-0007xl-U6
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:12:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNm-0000000CaFz-3m3D
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNm-00000006V0e-3cxx
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:12:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G3Rap46lTTqHkqiMc+YqJf98+x8lycefdlNlI4IHuMA=; b=U+FPTIRKEZr0YgOn47Y7jZpz0D
	P3PtGYKImCmFMKEmqNnB0sUeacVhnSweXZbTOd3jgA1KxfyYxinzeZqDBzC4L95QKuAp6i9UJd2d+
	a/OSZ5/pCcAo4VuHMRNRWzv944pmHCmfipgqK8LCLOY7IPCmmBzpunK/u00g8MhWhWQk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xODNm-00000006V0e-3cxx@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:12:54 +0000

commit 3f6f7a73c6963bc81230470487e46665f6275af1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:07:27 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 842d436848..03543fc335 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2934,13 +2934,8 @@ struct gnttab_copy_buf {
     bool_t have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2972,12 +2967,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3040,6 +3033,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:13:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:13:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469682.1678436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNy-00081t-UM; Tue, 03 Nov 2026 12:13:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469682.1678436; Tue, 03 Nov 2026 12:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODNy-00081m-Rn; Tue, 03 Nov 2026 12:13:06 +0000
Received: by outflank-mailman (input) for mailman id 1469682;
 Tue, 03 Nov 2026 12:13:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODNx-00081c-CN
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:13:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNx-0000000CaGI-1Sz6
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:13:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODNx-00000006VFV-1JcB
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:13:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Duzy28qt6IllS/lW6qkw4/DdFrhsh7Um6vxtd/bggIA=; b=kj6y970OybWhx57zyQHWircjr1
	92ZfPabCLDJUMmAx75P1PTcof/+DcQvGf55DjmouCCDO/fH+oVZ50Ot5WKsPgIHNVPyv/e6QkDr9b
	jTu2MDA2oUJxKti1QPXWo16/wpBN8FCy94MGxCGGOm/fEudHmTNbTON/76UZJn5ojc/4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xODNx-00000006VFV-1JcB@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:13:05 +0000

commit 0aa0e2fc06bec65017e68de94c259427bf31e21c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:08:17 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 5932722ce0..682fa9af74 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3031,10 +3031,10 @@ static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
                                     const struct gnttab_copy_buf *b,
                                     bool_t has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:13:16 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:13:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469683.1678440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODO7-00083q-Vv; Tue, 03 Nov 2026 12:13:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469683.1678440; Tue, 03 Nov 2026 12:13:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODO7-00083h-TF; Tue, 03 Nov 2026 12:13:15 +0000
Received: by outflank-mailman (input) for mailman id 1469683;
 Tue, 03 Nov 2026 12:13:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xODO7-00083Z-Fk
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:13:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODO7-0000000CaGN-1roI
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:13:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODO7-00000006VNf-1jio
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:13:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tT+Svs4BrYxPJuFwRj782rVPzl6QNm3vByx2oxEnA7E=; b=ortIH27POzw09M7ek65V4PKlLp
	Mgs5SBSgQh5MwZGaDGvr4DlvC5U3GPucIvML8+sVTKzkcP3n1RMkS5wlVkM81fYlYTzYNyyYNy8BH
	8i+PyXdUsn7pGnMwVReAWSB5eKrhz+LLJW/KP7+aZGcHgvZ0CC4FGa+tpip8Eg0Wjwz4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xODO7-00000006VNf-1jio@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:13:15 +0000

commit 2445b30a442ff3554ec477d5ec6445f92634394a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:08:17 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 682fa9af74..c190fb7f4c 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2887,13 +2887,8 @@ struct gnttab_copy_buf {
     bool_t have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2925,12 +2920,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -2993,6 +2986,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469696.1678444 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODrv-0004aU-5U; Tue, 03 Nov 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 1469696.1678444; Tue, 03 Nov 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 1xODrv-0004aM-2r; Tue, 03 Nov 2026 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1469696;
 Tue, 03 Nov 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 1xODru-0004aG-BC
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODru-0000000Cazp-1CyM
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODru-00000006ssT-10yP
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=gaq60LLQa8Ak1LAB+qCkq46LWoOdc3/kFCDcYTgVh9Y=; b=LXMzX/ZzVbVZ7sTq6qWO5lsxVR
	CVyJwmrfnTNKtjZHgPuqwGN5YTWOnk5m+y0e7bmaAVfbUysyJoY194zN8O0bltJXzQ5H0fNtDNZmT
	2Clo9YjFJxzclyyN/cYfWDxLRaiw8127teAQH1AJEQ4j0Gs3aTqzkpj+JiTgv+zi+xUM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MCE: purge mce_amd.h
Message-Id: <E1xODru-00000006ssT-10yP@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:44:02 +0000

commit 328c07bd1a5741ab85f595d355cf137b90c17759
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 13:33:01 2026 +0100

    x86/MCE: purge mce_amd.h
    
    The sole two declarations there aren't needed, as the functions aren't
    reference from outside of mce_amd.c. (This also addresses two Misra rule
    8.7 violations, just that we apparently didn't accept that rule for some
    reason.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/mce_amd.c | 6 +++---
 xen/arch/x86/cpu/mcheck/mce_amd.h | 7 -------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index bf353c9a69..c00f7a517c 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -56,7 +56,6 @@
 
 #include "mce.h"
 #include "x86_mca.h"
-#include "mce_amd.h"
 #include "mcaction.h"
 #include "vmce.h"
 
@@ -101,7 +100,7 @@ mc_ec2type(uint16_t errorcode)
     return 0;
 }
 
-bool cf_check mc_amd_recoverable_scan(uint64_t status)
+static bool cf_check mc_amd_recoverable_scan(uint64_t status)
 {
     bool ret = false;
     enum mc_ec_type ectype;
@@ -131,7 +130,8 @@ bool cf_check mc_amd_recoverable_scan(uint64_t status)
     return ret;
 }
 
-bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
+static bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc,
+                                      int addrtype)
 {
     enum mc_ec_type ectype;
     uint16_t errorcode;
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.h b/xen/arch/x86/cpu/mcheck/mce_amd.h
deleted file mode 100644
index c12c25d745..0000000000
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _MCHECK_AMD_H
-#define _MCHECK_AMD_H
-
-bool cf_check mc_amd_recoverable_scan(uint64_t status);
-bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
-
-#endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469697.1678448 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xODs5-0004cf-7f; Tue, 03 Nov 2026 12:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469697.1678448; Tue, 03 Nov 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 1xODs5-0004cY-57; Tue, 03 Nov 2026 12:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1469697;
 Tue, 03 Nov 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 1xODs4-0004cS-E2
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODs4-0000000Cazv-1gdB
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xODs4-00000006t7h-1UN2
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=yPnNIRrW10jiBH+vewAk8NXTDje5SsyF7+6jQ8EwYqI=; b=2TyrHeLQ+ygJMvuL6XiK/avBhb
	0sj91r43fW/1MqpHrymT7Do5SBAPG+1gbQaZoYQ7rCH3DWbKQvkzpK9xBpKh2fLB+K6B3Qq3dI2Rk
	JfY94mI5YVP5NE266Vmd1hTmVRAKjDq+0Te0ehBNpKxZ4UyhGiGEwrfmWk0mDppyJQhw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] misra: deviate C library-style functions from Misra C:2012 rule 11.8
Message-Id: <E1xODs4-00000006t7h-1UN2@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:44:12 +0000

commit 2043d22b7e926f508cc23391b4c75325fa7211e9
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue Nov 3 12:04:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 13:33:01 2026 +0100

    misra: deviate C library-style functions from Misra C:2012 rule 11.8
    
    bsearch(), memchr(), strchr(), strpbrk(), strrchr() and strstr() all
    accept a const pointer/object but return a non-const pointer to the
    matched element or byte, matching their standard C library interfaces.
    The casts in these implementations strip const so that callers searching
    a non-const object get back a mutable pointer. Avoiding the casts would
    require deviating from the standard C library prototypes of these
    functions, so document these uses as deviations instead.
    
    Update docs/misra/rules.rst to note that this class of double-use
    library functions is deviated on a per-function basis.
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com> # automation/eclair_analysis/.*
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 8 ++++++++
 docs/misra/deviations.rst                        | 9 +++++++++
 docs/misra/rules.rst                             | 6 +++++-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index c7a800c62f..296340bb4c 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -451,6 +451,14 @@ write or not"
 -config=MC3A2.R11.8,reports+={safe,"any_area(any_loc(file(hvm_guestcopy)&&text(^.*__hvm_copy.*HVMCOPY_to_guest doesn't modify.*$)))"}
 -doc_end
 
+-doc_begin="Functions bsearch(), memchr(), strchr(), strpbrk(), strrchr() and
+strstr() accept a const pointer/object and return a non-const pointer to the
+matched element or byte, matching their standard C library interfaces. The
+casts in these implementations strip const so that a search of a non-const
+object yields a mutable pointer. This use is deemed safe."
+-config=MC3A2.R11.8,reports+={safe,"any_area(any_loc(file(^xen/include/xen/bsearch\\.h$||^xen/lib/(memchr|str+chr|strpbrk|strstr)\\.c$)))"}
+-doc_end
+
 -doc_begin="This construct is used to check if the type is scalar, and for this purpose the use of 0 as a null pointer constant is deliberate."
 -config=MC3A2.R11.9,reports+={deliberate, "any_area(any_loc(any_exp(macro(^__ACCESS_ONCE$))))"
 }
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 76be6b3251..bee4686675 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -440,6 +440,15 @@ Deviations related to MISRA C:2012 Rules:
        readability.
      - Tagged as `safe` for ECLAIR.
 
+   * - R11.8
+     - Functions bsearch(), memchr(), strchr(), strpbrk(), strrchr() and
+       strstr() accept a const pointer/object and return a non-const pointer
+       to the matched element or byte, matching their standard C library
+       interfaces. The casts in these implementations strip const so that a
+       search of a non-const object yields a mutable pointer. This use is
+       deemed safe.
+     - Tagged as `safe` for ECLAIR.
+
    * - R11.9
      - __ACCESS_ONCE uses an integer, which happens to be zero, as a
        compile time check. The typecheck uses a cast. The usage of zero or other
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 5f9fe4c860..7e191a0d4a 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -475,7 +475,11 @@ maintainers if you want to suggest a change.
    * - `Rule 11.8 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_08.c>`_
      - Required
      - A cast shall not remove any const or volatile qualification from the type pointed to by a pointer
-     -
+     - Some standard C library-style functions are inherently double-use,
+       accepting a const argument and returning a non-const pointer into
+       it so that callers searching a non-const object get back a
+       mutable pointer. The casts that implement this are deviated per
+       function.
 
    * - `Rule 11.9 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_09.c>`_
      - Required
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469749.1678506 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE2Z-0000TX-Em; Tue, 03 Nov 2026 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469749.1678506; Tue, 03 Nov 2026 12:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE2Z-0000TP-CG; Tue, 03 Nov 2026 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1469749;
 Tue, 03 Nov 2026 12:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOE2Y-0000TJ-EG
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE2Y-0000000CbFQ-1XbC
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE2Y-000000071qg-1IrD
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hG05rvme65xiud+48NhLJCE8LQVIQF91dEVAnOrdzeI=; b=a+41CaHxUQSODOa8JsBFGS21Sj
	sYaeZkP0XvwKMzgmtdUWFlBJjH9Z6nL0M/JmKQ5fMuBU2XsiSz0sco3cLHRuat0lrUPu1dnYvcTB3
	TWFy8GvHavNbVCudL+fxQez1WTI9xM0TmKmr8Lv94AL8+Yh+IC/9gUYH0Ol8kwvghg+c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xOE2Y-000000071qg-1IrD@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:55:02 +0000

commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:03:21 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index b15805f3f9..3dc5ff88da 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3083,10 +3083,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469750.1678510 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE2j-0000Vd-GK; Tue, 03 Nov 2026 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469750.1678510; Tue, 03 Nov 2026 12:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE2j-0000VV-Df; Tue, 03 Nov 2026 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1469750;
 Tue, 03 Nov 2026 12:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOE2i-0000VL-Gn
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE2i-0000000CbFU-22g2
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE2i-000000071zc-1ocR
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dN3VMPUECa8JzlP/fRpEGJqP+g0EhVNHUE/OIDj2RfU=; b=jUxPgnranymEGqFLXUb4Fi15CZ
	JrijTQ3NXeu6DKPFxrBt/I78gNutqJP9QrIRNonoWnvrmphbQzLETMrXlgBZjkaxzRIrTZ/kyevhx
	A4skmQFZek3vOUIILlKd2DmWBbi6k55Spgxjg5j38Cg06tW6nSkUEu2fHcskudUiatcw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xOE2i-000000071zc-1ocR@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:55:12 +0000

commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:03:21 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 3dc5ff88da..5e79c012b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2936,13 +2936,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2974,12 +2969,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3042,6 +3035,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469752.1678514 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE2u-0000Xw-HZ; Tue, 03 Nov 2026 12:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469752.1678514; Tue, 03 Nov 2026 12:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE2u-0000Xo-F0; Tue, 03 Nov 2026 12:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1469752;
 Tue, 03 Nov 2026 12:55:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOE2s-0000Xg-W6
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE2s-0000000CbFY-41yl
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE2s-0000000726C-3r1g
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jOnVLBPkT5FZ8bK8pxYFdR4QCAPfZxbKUFMl5syxBFQ=; b=4tcZIrmvawg+rb307M+YmksCJ3
	wU1CZBAFW4Czb1PtG8HigBgTFiHk1bsuVRGs4SOEsdWnKsjqisWqBtVk2khEa1M/miLJ6bUEYgoNs
	NWXKCtEeAviWCwOLhxLa+1onbyQxnHLcr3ZDt+FLs0050guUOFcEuMj7WqTdMDvrsO/k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xOE2s-0000000726C-3r1g@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:55:22 +0000

commit 0aa0e2fc06bec65017e68de94c259427bf31e21c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:08:17 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 5932722ce0..682fa9af74 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3031,10 +3031,10 @@ static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
                                     const struct gnttab_copy_buf *b,
                                     bool_t has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 12:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 12:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469754.1678518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE34-0000aO-Iw; Tue, 03 Nov 2026 12:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469754.1678518; Tue, 03 Nov 2026 12:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOE34-0000aH-GI; Tue, 03 Nov 2026 12:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1469754;
 Tue, 03 Nov 2026 12:55:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOE33-0000a6-3W
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 12:55:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE33-0000000CbFj-0Gbd
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOE33-000000072GP-0616
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 12:55:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jhXmzQURyini78qZr4HsZ3eTnA+SwnEvXhIjUxcTQFY=; b=o6scI1LGmYVonAariGtoxsgDyG
	DFujjJcEVX78JUKHqES8Yk387hhTeZeZFQjHWtBScKzCrfapcXhLau/LeUGocQZn+W0BtKh8LA+zG
	prr8NEPH/78o9j9ZZYjIyg/F2e9rA+axqcyKV445TugP4OxZi1R5AUe9gebza6mEyA5w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xOE33-000000072GP-0616@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 12:55:33 +0000

commit 2445b30a442ff3554ec477d5ec6445f92634394a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:08:17 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 682fa9af74..c190fb7f4c 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2887,13 +2887,8 @@ struct gnttab_copy_buf {
     bool_t have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2925,12 +2920,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -2993,6 +2986,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 13:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 13:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469840.1678603 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOEyd-0006e9-Mo; Tue, 03 Nov 2026 13:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469840.1678603; Tue, 03 Nov 2026 13:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOEyd-0006e1-Js; Tue, 03 Nov 2026 13:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1469840;
 Tue, 03 Nov 2026 13:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOEyc-0006dQ-6d
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 13:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOEyc-0000000CcTo-0Xjq
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 13:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOEyc-00000007mdL-0J2j
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 13:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/1n2fxARUgCkJHx7jbyTvGMgRdvCCQGkeziC0AvPDn4=; b=2AgM2pWYllA+e9DRagDvYlggW2
	jwJ71lNuh2H97xW+K/GdfBtKbBx2Y1/w59zCJ08dOlUfdJIhZz9witzS+vsQyOG2PDjdj5mhLyIRN
	qWwtXTm+CSmJT4yRyhMRKXFsb36ZWpGKLxz74QjMxmAbsM9rhnw/2vHlUKJmRBpL8MYw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xOEyc-00000007mdL-0J2j@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 13:55:02 +0000

commit f463f6d13f4b078df895b880c2b17581b2b74680
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:13 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 03e919fd24..3331a5478e 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3083,10 +3083,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 13:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 13:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469842.1678608 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOEyn-0006jU-PZ; Tue, 03 Nov 2026 13:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469842.1678608; Tue, 03 Nov 2026 13: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 1xOEyn-0006jM-LE; Tue, 03 Nov 2026 13:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1469842;
 Tue, 03 Nov 2026 13:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOEym-0006ix-8u
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 13:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOEym-0000000CcTs-10DW
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 13:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOEym-00000007mfY-0obN
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 13:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bMAeyZVSpnv4ItyiorKHkh/mY+HRLR9M24l80TnBnWM=; b=FZPIjCfQV0EMWq0Bg1IQHG0zUl
	NsO1ldY9exWw6weU6dmi5pj0wj86J0NqEQqnNOhTilELlnY9g4+EmBHVIGk4J5Km88bXk4tiMDGv4
	3I6RyE+gbMa3GNcLzQQOtd+NeBB1z3KXkz/8HL35DQZWrouXtCJEUKMMeqsvu+d1qAzM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.22] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xOEym-00000007mfY-0obN@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 13:55:12 +0000

commit d7ddb103825139c09bdafedc190712b877ebffd2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:13 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 3331a5478e..2ad5ef9270 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2936,13 +2936,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2974,12 +2969,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3042,6 +3035,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.22


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 14:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 14:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469933.1678700 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOFOl-0000dx-0M; Tue, 03 Nov 2026 14:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469933.1678700; Tue, 03 Nov 2026 14:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOFOk-0000dp-UA; Tue, 03 Nov 2026 14:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1469933;
 Tue, 03 Nov 2026 14:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOFOj-0000cb-N0
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 14:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOFOj-0000000Cd85-2YqK
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 14:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOFOj-000000084Ps-2NC2
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 14:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rndy9VpjjseIofy8MBgYCeFXLlWc818cwJFTajnXxLs=; b=H59vsnlRUos2wn6wnM14yucl7x
	k3l94dfEx/kZWzH3aA3AG4ffuS8YOrI3AOZA7rVQdGPj6M9ENO1advEtTJEbmDItkQ+wEsLJRCLmM
	im8k3ss0t9fKVMjNL0pT6mrUycd2jQDJWvkx5ZDRR6selOa8WmwKX4XNeJpPJy7jk84M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xOFOj-000000084Ps-2NC2@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 14:22:01 +0000

commit 6db96d2ae50f046df8fc5f1de28b2cebb3f11569
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:52 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2154802b2f..9109fd6bf5 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3084,10 +3084,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 14:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 14:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1469935.1678705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOFOv-0000iM-1m; Tue, 03 Nov 2026 14:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1469935.1678705; Tue, 03 Nov 2026 14:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOFOu-0000iE-VY; Tue, 03 Nov 2026 14:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1469935;
 Tue, 03 Nov 2026 14:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOFOt-0000h0-Og
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 14:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOFOt-0000000Cd8O-33ys
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 14:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOFOt-000000084V1-2rrC
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 14:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mvApTOoz2V/yrPV35P2f2WlKtMPT8oXz/TYK6TKyhdQ=; b=tWw5s+6UqXQLA+nNQTeGG7e8nI
	nRjFxnJLmTEq4nsTcrS7tELLZdnEgpb1BXRB+HCJ+m5cF8kYBt23gHQAogLA0zINd2EVVtKxSqWkD
	vuopMXADFXhk3l3N0pBsZk2cWfjkMRthX7S5C8lc+WyCQRF8L05RHCimZDi5FeaHwrvc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xOFOt-000000084V1-2rrC@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 14:22:11 +0000

commit 6ef55592aff9616a98d8c0b3a3dbc1ff009a21eb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:05:52 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 9109fd6bf5..86b9cb9fd1 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2937,13 +2937,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2975,12 +2970,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3043,6 +3036,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 15:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 15:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1470169.1678916 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOGg7-0005AF-8q; Tue, 03 Nov 2026 15:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1470169.1678916; Tue, 03 Nov 2026 15:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOGg7-0005A7-69; Tue, 03 Nov 2026 15:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1470169;
 Tue, 03 Nov 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 1xOGg6-00059y-Ej
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 15:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOGg6-0000000CemK-1fXk
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 15:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOGg6-00000008n7n-1Qs8
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 15:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5wZLJ2wZMEEs3F1lPKY1/DnFCVkuut4qocF7woXbjsM=; b=pSk2oXkl8Fa8X3lel9Qj0Yz7uG
	E0+/XNbAO6USu7e4ZEX48ZKInW8aHIj3dG9yXpgQy+TNDhaeslsN9cD9GvLtnC98teNf7+BXzlPUP
	s6+cM6rUz7H048Ce3/7HDk3v9xyI1t/5+ZCvAgO04MKRGxdMcCsFf7ha+qk9iEOW5FeM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xOGg6-00000008n7n-1Qs8@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 15:44:02 +0000

commit e703d5e4a7413f4419b4c72f2a7ae7906c7e678e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:45 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 1ce74c5bfe..9875780ae3 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3081,10 +3081,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 15:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 15:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1470170.1678919 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOGgH-0005C6-A7; Tue, 03 Nov 2026 15:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1470170.1678919; Tue, 03 Nov 2026 15:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOGgH-0005By-7U; Tue, 03 Nov 2026 15:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1470170;
 Tue, 03 Nov 2026 15:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOGgG-0005Bq-Hg
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 15:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOGgG-0000000CemO-28r2
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 15:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOGgG-00000008nCB-1xdx
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 15:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tAgOIVhd0TJPMX3GfRo9WjSZQWXRBb1yIOyZdueFXn0=; b=v5gt7jdaCNZkTKyyQdrBkUd0dv
	rpEhByx4oq5MeOyv7kKrExZnYApaYTYKKf+HOCwcH4hYG0DFAf14vQTk210at73eIlLkwEiCB7nOs
	KFaOfcw4t4c0WC1ngOEKK3oNP7Tx4M9jYXYxb6GeWwpo86HqvKT/BYrHd1nkTwO7Q900=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xOGgG-00000008nCB-1xdx@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 15:44:12 +0000

commit 322fab7de5d03193f44cff59880303f66ea6473e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:45 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 9875780ae3..c93a243e05 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2934,13 +2934,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2972,12 +2967,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3040,6 +3033,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 16:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 16:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1470217.1678943 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHcB-00027w-SI; Tue, 03 Nov 2026 16:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1470217.1678943; Tue, 03 Nov 2026 16:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHcB-00027o-PK; Tue, 03 Nov 2026 16:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1470217;
 Tue, 03 Nov 2026 16:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOHcA-00027h-1y
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 16:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHc9-0000000CgWq-4Afa
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 16:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHc9-00000009IkW-3vhF
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 16:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6Nac9uvqmLaluIYC5sKQnFAkQigRbKCops1HnQUhVkk=; b=SOuN59qk/0e+rEom5SU/DdxCEh
	wNXosecLT9u9LS3sf9hpichvcHnLFmRy8WMynGRmoMv1QJvWiNour4U0Cfo+hrktOn/OP0HgHQk6x
	HDSMCd8+sUIfutFNTyRi6BfA1zBDS33pkPQujhMwmMHFQAZNL7pf3W0bGSPgYmyH2fak=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MCE: purge mce_amd.h
Message-Id: <E1xOHc9-00000009IkW-3vhF@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 16:44:01 +0000

commit 328c07bd1a5741ab85f595d355cf137b90c17759
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 13:33:01 2026 +0100

    x86/MCE: purge mce_amd.h
    
    The sole two declarations there aren't needed, as the functions aren't
    reference from outside of mce_amd.c. (This also addresses two Misra rule
    8.7 violations, just that we apparently didn't accept that rule for some
    reason.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/mce_amd.c | 6 +++---
 xen/arch/x86/cpu/mcheck/mce_amd.h | 7 -------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index bf353c9a69..c00f7a517c 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -56,7 +56,6 @@
 
 #include "mce.h"
 #include "x86_mca.h"
-#include "mce_amd.h"
 #include "mcaction.h"
 #include "vmce.h"
 
@@ -101,7 +100,7 @@ mc_ec2type(uint16_t errorcode)
     return 0;
 }
 
-bool cf_check mc_amd_recoverable_scan(uint64_t status)
+static bool cf_check mc_amd_recoverable_scan(uint64_t status)
 {
     bool ret = false;
     enum mc_ec_type ectype;
@@ -131,7 +130,8 @@ bool cf_check mc_amd_recoverable_scan(uint64_t status)
     return ret;
 }
 
-bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
+static bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc,
+                                      int addrtype)
 {
     enum mc_ec_type ectype;
     uint16_t errorcode;
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.h b/xen/arch/x86/cpu/mcheck/mce_amd.h
deleted file mode 100644
index c12c25d745..0000000000
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _MCHECK_AMD_H
-#define _MCHECK_AMD_H
-
-bool cf_check mc_amd_recoverable_scan(uint64_t status);
-bool cf_check mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
-
-#endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 16:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 16:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1470218.1678946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHcL-00029c-TD; Tue, 03 Nov 2026 16:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1470218.1678946; Tue, 03 Nov 2026 16:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHcL-00029U-Qf; Tue, 03 Nov 2026 16:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1470218;
 Tue, 03 Nov 2026 16:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOHcK-00029E-5Z
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 16:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHcK-0000000CgWu-0WJ5
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 16:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHcK-00000009IpA-0F5Q
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 16:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bpTrVvOwaVxG4WQXKrf3vLWdDyqfyzND+lGiGJL75Ww=; b=G0L0RgpWHe6EgUrmGUWoJ8oWGQ
	N4+v63SQK5hjy8asfjylWsdrwgKvp8UrpFQo8+zV3eygsp+4iMDRQOF/bva4uylxlvBkKErV+7ec8
	JVZHFoBP3HoZ9HQ8MlOrh/ujaNLqxb9ztVxzjPdxKWmDTD1FR1clwJb3qHa34FiRIinI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] misra: deviate C library-style functions from Misra C:2012 rule 11.8
Message-Id: <E1xOHcK-00000009IpA-0F5Q@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 16:44:12 +0000

commit 2043d22b7e926f508cc23391b4c75325fa7211e9
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue Nov 3 12:04:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 13:33:01 2026 +0100

    misra: deviate C library-style functions from Misra C:2012 rule 11.8
    
    bsearch(), memchr(), strchr(), strpbrk(), strrchr() and strstr() all
    accept a const pointer/object but return a non-const pointer to the
    matched element or byte, matching their standard C library interfaces.
    The casts in these implementations strip const so that callers searching
    a non-const object get back a mutable pointer. Avoiding the casts would
    require deviating from the standard C library prototypes of these
    functions, so document these uses as deviations instead.
    
    Update docs/misra/rules.rst to note that this class of double-use
    library functions is deviated on a per-function basis.
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com> # automation/eclair_analysis/.*
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 8 ++++++++
 docs/misra/deviations.rst                        | 9 +++++++++
 docs/misra/rules.rst                             | 6 +++++-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index c7a800c62f..296340bb4c 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -451,6 +451,14 @@ write or not"
 -config=MC3A2.R11.8,reports+={safe,"any_area(any_loc(file(hvm_guestcopy)&&text(^.*__hvm_copy.*HVMCOPY_to_guest doesn't modify.*$)))"}
 -doc_end
 
+-doc_begin="Functions bsearch(), memchr(), strchr(), strpbrk(), strrchr() and
+strstr() accept a const pointer/object and return a non-const pointer to the
+matched element or byte, matching their standard C library interfaces. The
+casts in these implementations strip const so that a search of a non-const
+object yields a mutable pointer. This use is deemed safe."
+-config=MC3A2.R11.8,reports+={safe,"any_area(any_loc(file(^xen/include/xen/bsearch\\.h$||^xen/lib/(memchr|str+chr|strpbrk|strstr)\\.c$)))"}
+-doc_end
+
 -doc_begin="This construct is used to check if the type is scalar, and for this purpose the use of 0 as a null pointer constant is deliberate."
 -config=MC3A2.R11.9,reports+={deliberate, "any_area(any_loc(any_exp(macro(^__ACCESS_ONCE$))))"
 }
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 76be6b3251..bee4686675 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -440,6 +440,15 @@ Deviations related to MISRA C:2012 Rules:
        readability.
      - Tagged as `safe` for ECLAIR.
 
+   * - R11.8
+     - Functions bsearch(), memchr(), strchr(), strpbrk(), strrchr() and
+       strstr() accept a const pointer/object and return a non-const pointer
+       to the matched element or byte, matching their standard C library
+       interfaces. The casts in these implementations strip const so that a
+       search of a non-const object yields a mutable pointer. This use is
+       deemed safe.
+     - Tagged as `safe` for ECLAIR.
+
    * - R11.9
      - __ACCESS_ONCE uses an integer, which happens to be zero, as a
        compile time check. The typecheck uses a cast. The usage of zero or other
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 5f9fe4c860..7e191a0d4a 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -475,7 +475,11 @@ maintainers if you want to suggest a change.
    * - `Rule 11.8 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_08.c>`_
      - Required
      - A cast shall not remove any const or volatile qualification from the type pointed to by a pointer
-     -
+     - Some standard C library-style functions are inherently double-use,
+       accepting a const argument and returning a non-const pointer into
+       it so that callers searching a non-const object get back a
+       mutable pointer. The casts that implement this are deviated per
+       function.
 
    * - `Rule 11.9 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_11_09.c>`_
      - Required
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 16:55:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 16:55:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1470256.1678986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHmo-0005ZW-Ij; Tue, 03 Nov 2026 16:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1470256.1678986; Tue, 03 Nov 2026 16:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHmo-0005ZO-G5; Tue, 03 Nov 2026 16:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1470256;
 Tue, 03 Nov 2026 16:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOHmn-0005ZE-PC
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 16:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHmn-0000000Cgma-2xeg
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 16:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHmn-00000009SHD-2lAe
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 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=5069FFY5cYO8Pl5f2bGRKsvPLC4gjNUdZ3q+hbE9soA=; b=AUCVfEBuULNXZfRwmdxUe5Z76E
	GQV7nah9k+t+yokU8pLjdy56CHUzRefdAJk83mOvRUhdjqMKGlJgWBvdpw86J5EB9hmK+vO4YGX7/
	9hGgJvX45C/a0C/v+44oq8e17BnaHL9lXIwpCJZEyrfhCWKbv+szLAqf+0lEcjOSzu6c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xOHmn-00000009SHD-2lAe@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 16:55:01 +0000

commit c24e3f17cbc47f1a0777d17f4df1a847fb3f051d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:11 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 6d2cc43339..ce680619cc 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3082,10 +3082,10 @@ static bool gnttab_copy_buf_valid(
     const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
     bool has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue Nov 03 16:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Nov 2026 16:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1470260.1678990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHmz-0005gY-Kl; Tue, 03 Nov 2026 16:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1470260.1678990; Tue, 03 Nov 2026 16:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOHmz-0005gQ-IC; Tue, 03 Nov 2026 16:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1470260;
 Tue, 03 Nov 2026 16:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOHmx-0005gC-RN
 for xen-changelog@lists.xenproject.org; Tue, 03 Nov 2026 16:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHmx-0000000Cgmr-3OxR
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 16:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOHmx-00000009SeF-3EQ0
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Nov 2026 16:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LVcNmyWF+a4gotAZiOo9dTC4x7MXsekUtpuZG9OnOlA=; b=LyCICW1gP07YRbhw59SkjTr9+M
	XYnrNM1rkkVne0+rMayn445GkZ1awqRQYaDUFXnK2ViSzTyxEgS41nCq8Ri5h60seOaLiEMVel34K
	tlY/a3yM3GNVsivBqEWk2cUwCVvoohWlsKzdTKrtTRp9COa3BYjSgf2niQrUS3XK+EUo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xOHmx-00000009SeF-3EQ0@xenbits.xenproject.org>
Date: Tue, 03 Nov 2026 16:55:11 +0000

commit 7abfd2bce281bf77091649af5e3dbfeef2aea188
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:06:11 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index ce680619cc..7bca91bf35 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2935,13 +2935,8 @@ struct gnttab_copy_buf {
     bool have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2973,12 +2968,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3041,6 +3034,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 16:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 16:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472219.1680181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOdv5-0007I3-Ih; Wed, 04 Nov 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 1472219.1680181; Wed, 04 Nov 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 1xOdv5-0007Hv-Fw; Wed, 04 Nov 2026 16:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1472219;
 Wed, 04 Nov 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 1xOdv4-0007H3-Bv
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 16:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOdv4-0000000EjF8-1CB6
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 16:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOdv4-0000000686z-1051
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 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=KjtMy3H0QLdg+ufx4fzAMxPNfSMga2gUTVZVjI/UcYY=; b=bu4a7ss+THO4ob40BhoIHfiPnE
	68xrAuCDlS651plXgmBsNBcKi50EAheFbtju737oa9WtfVFw5onltai9xuR+StJXgpEHTdLjImIaP
	msIHVzlvx0C6+rvnzNknDRO5dVhiXYGQBph0hSmEzOyC7C/8fjfO2+Dbem5gH6+RgOoA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: domain_build.c: Use hwdom instead of dom0 where applicable
Message-Id: <E1xOdv4-0000000686z-1051@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 16:33:02 +0000

commit 65a22113b966e813101ba0bc96ae88d835589fb1
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Nov 3 17:46:24 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Nov 4 17:13:57 2026 +0100

    xen/arm: domain_build.c: Use hwdom instead of dom0 where applicable
    
    Since commit 52cb53f1816a ("xen/arm: dom0less hwdom construction"),
    construct_hwdom() and the helpers it relies on (allocate_memory_11(),
    prepare_dtb_hwdom(), handle_node(), find_gnttab_region(), etc.) are used
    not only for the regular dom0 but also for a hardware domain created by
    dom0less. Many comments and names on this path still refer to dom0, which
    is misleading.
    
    No functional change other than the panic messages.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 xen/arch/arm/domain_build.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 1ee1f1f6a7..606e85818e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -100,7 +100,7 @@ int __init parse_arch_dom0_param(const char *s, const char *e)
 #endif
 
 /*
- * Amount of extra space required to dom0's device tree. This covers
+ * Amount of extra space required to hwdom's device tree. This covers
  * nodes generated by Xen, which are not directly copied from the host DTB.
  * It is calculated as:
  *  - Space for /hypervisor node (128 bytes).
@@ -111,15 +111,15 @@ int __init parse_arch_dom0_param(const char *s, const char *e)
  *    plus the appendage to the main /memory node (NR_SHMEM_BANKS * (160 + 16)
  *    bytes). This overhead is dropped when CONFIG_STATIC_SHM is disabled.
  */
-#define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry) + \
-                             (NR_MEM_BANKS * 16) +                    \
-                             (IS_ENABLED(CONFIG_STATIC_SHM) ?         \
-                              (NR_SHMEM_BANKS * (160 + 16)) : 0))
+#define HWDOM_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry) + \
+                              (NR_MEM_BANKS * 16) +                    \
+                              (IS_ENABLED(CONFIG_STATIC_SHM) ?         \
+                               (NR_SHMEM_BANKS * (160 + 16)) : 0))
 
 paddr_t __init hwdom_get_fdt_alloc_size(void)
 {
     if ( acpi_disabled )
-        return fdt_totalsize(device_tree_flattened) + DOM0_FDT_EXTRA_SIZE;
+        return fdt_totalsize(device_tree_flattened) + HWDOM_FDT_EXTRA_SIZE;
 
     return ACPI_DOM0_FDT_MIN_SIZE;
 }
@@ -175,7 +175,7 @@ static bool __init insert_11_bank(struct domain *d,
 
     res = guest_physmap_add_page(d, _gfn(mfn_x(smfn)), smfn, order);
     if ( res )
-        panic("Failed map pages to DOM0: %d\n", res);
+        panic("Failed map pages to %pd: %d\n", d, res);
 
     kinfo->unassigned_mem -= size;
 
@@ -245,19 +245,19 @@ fail:
  *
  * Requirements:
  *
- * 1. The dom0 kernel should be loaded within the first 128MB of RAM. This
+ * 1. The hwdom kernel should be loaded within the first 128MB of RAM. This
  *    is necessary at least for Linux zImage kernels, which are all we
  *    support today.
- * 2. We want to put the dom0 kernel, ramdisk and DTB in the same
+ * 2. We want to put the hwdom kernel, ramdisk and DTB in the same
  *    bank. Partly this is just easier for us to deal with, but also
  *    the ramdisk and DTB must be placed within a certain proximity of
  *    the kernel within RAM.
- * 3. For dom0 we want to place as much of the RAM as we reasonably can
+ * 3. For hwdom we want to place as much of the RAM as we reasonably can
  *    below 4GB, so that it can be used by non-LPAE enabled kernels (32-bit).
- * 4. Some devices assigned to dom0 can only do 32-bit DMA access or
+ * 4. Some devices assigned to hwdom can only do 32-bit DMA access or
  *    even be more restricted. We want to allocate as much of the RAM
  *    as we reasonably can that can be accessed from all the devices..
- * 5. For 32-bit dom0 the kernel must be located below 4GB.
+ * 5. For 32-bit hwdom the kernel must be located below 4GB.
  * 6. We want to have a few largers banks rather than many smaller ones.
  *
  * For the first two requirements we need to make sure that the lowest
@@ -293,7 +293,7 @@ fail:
  * to be allocated in the low mem. Then for subsequent allocation, we
  * initially allocate memory only from low mem. Once that runs out out
  * (as described above) we allow higher allocations and continue until
- * that runs out (or we have allocated sufficient dom0 memory).
+ * that runs out (or we have allocated sufficient hwdom memory).
  */
 static void __init allocate_memory_11(struct domain *d,
                                       struct kernel_info *kinfo)
@@ -311,7 +311,7 @@ static void __init allocate_memory_11(struct domain *d,
     unsigned int bits;
 
     /*
-     * TODO: Implement memory bank allocation when DOM0 is not direct
+     * TODO: Implement memory bank allocation when hwdom is not direct
      * mapped
      */
     BUG_ON(!is_domain_direct_mapped(d));
@@ -409,8 +409,8 @@ static void __init allocate_memory_11(struct domain *d,
 
     if ( kinfo->unassigned_mem )
         /* Don't want format this as PRIpaddr (16 digit hex) */
-        panic("Failed to allocate requested dom0 memory. %ldMB unallocated\n",
-              (unsigned long)kinfo->unassigned_mem >> 20);
+        panic("Failed to allocate requested %pd memory. %ldMB unallocated\n",
+              d, (unsigned long)kinfo->unassigned_mem >> 20);
 
     for( i = 0; i < mem->nr_banks; i++ )
     {
@@ -516,7 +516,7 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
          * * remove bootargs, linux,uefi-system-table,
          *   linux,uefi-mmap-start, linux,uefi-mmap-size,
          *   linux,uefi-mmap-desc-size, and linux,uefi-mmap-desc-ver
-         *   (since EFI boot is not currently supported in dom0).
+         *   (since EFI boot is not currently supported in hwdom).
          */
         if ( dt_node_path_is_equal(node, "/chosen") )
         {
@@ -1544,7 +1544,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
 
     /*
      * Even if the IOMMU device is not used by Xen, it should not be
-     * passthrough to DOM0
+     * passthrough to hwdom.
      */
     if ( device_get_class(node) == DEVICE_IOMMU )
     {
@@ -1695,7 +1695,7 @@ static int __init prepare_dtb_hwdom(struct domain *d, struct kernel_info *kinfo)
     kinfo->phandle_intc = dt_interrupt_controller->phandle;
     fdt = device_tree_flattened;
 
-    new_size = fdt_totalsize(fdt) + DOM0_FDT_EXTRA_SIZE;
+    new_size = fdt_totalsize(fdt) + HWDOM_FDT_EXTRA_SIZE;
     kinfo->fdt = xmalloc_bytes(new_size);
     if ( kinfo->fdt == NULL )
         return -ENOMEM;
@@ -1764,7 +1764,7 @@ static void __init find_gnttab_region(struct domain *d,
         gnttab_resource_max_frames(d, XENMEM_resource_grant_table_id_shared);
 
     /*
-     * The region used by Xen on the memory will never be mapped in DOM0
+     * The region used by Xen on the memory will never be mapped in hwdom
      * memory layout. Therefore it can be used for the grant table.
      *
      * Only use the text section as it's always present and will contain
@@ -1776,7 +1776,7 @@ static void __init find_gnttab_region(struct domain *d,
 
 #ifdef CONFIG_ARM_32
     /*
-     * The gnttab region must be under 4GB in order to work with DOM0
+     * The gnttab region must be under 4GB in order to work with hwdom
      * using short page table.
      * In practice it's always the case because Xen is always located
      * below 4GB, but be safe.
@@ -1941,7 +1941,7 @@ int __init construct_hwdom(struct kernel_info *kinfo,
             return rc;
     }
 
-    /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
+    /* Map extra GIC MMIO, irqs and other hw stuffs to hwdom */
     rc = gic_map_hwdom_extra_mappings(d);
     if ( rc < 0 )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 17:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 17:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472302.1680231 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOegV-0000Rg-7c; Wed, 04 Nov 2026 17:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472302.1680231; Wed, 04 Nov 2026 17:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOegV-0000RY-4U; Wed, 04 Nov 2026 17:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1472302;
 Wed, 04 Nov 2026 17:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOegU-0000RS-13
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 17:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOegT-0000000EkLB-421B
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 17:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOegT-00000006o3i-3od7
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 17:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AlS9q8gBegMtMikZCjGu/xxNwsvE6m33aBguBd4SxeI=; b=MvCa7Xx0dIMQO1bHjltlKDteZ3
	Rxj3TlVRuXIpvwdpcjZGZ05GT7AwR+1hDn++5K6Hs9MrSiBuxv/hPvapaZR1WkJF07pYWZ0q5FlE/
	DVpe9WW1CO+sqSO4KWpFQvO0OU8ItCwVvQjIBKPNO8/x5zw+zTQsZRBBRotXjpi6jBUQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: domain_build.c: Use hwdom instead of dom0 where applicable
Message-Id: <E1xOegT-00000006o3i-3od7@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 17:22:01 +0000

commit 65a22113b966e813101ba0bc96ae88d835589fb1
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Nov 3 17:46:24 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed Nov 4 17:13:57 2026 +0100

    xen/arm: domain_build.c: Use hwdom instead of dom0 where applicable
    
    Since commit 52cb53f1816a ("xen/arm: dom0less hwdom construction"),
    construct_hwdom() and the helpers it relies on (allocate_memory_11(),
    prepare_dtb_hwdom(), handle_node(), find_gnttab_region(), etc.) are used
    not only for the regular dom0 but also for a hardware domain created by
    dom0less. Many comments and names on this path still refer to dom0, which
    is misleading.
    
    No functional change other than the panic messages.
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 xen/arch/arm/domain_build.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 1ee1f1f6a7..606e85818e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -100,7 +100,7 @@ int __init parse_arch_dom0_param(const char *s, const char *e)
 #endif
 
 /*
- * Amount of extra space required to dom0's device tree. This covers
+ * Amount of extra space required to hwdom's device tree. This covers
  * nodes generated by Xen, which are not directly copied from the host DTB.
  * It is calculated as:
  *  - Space for /hypervisor node (128 bytes).
@@ -111,15 +111,15 @@ int __init parse_arch_dom0_param(const char *s, const char *e)
  *    plus the appendage to the main /memory node (NR_SHMEM_BANKS * (160 + 16)
  *    bytes). This overhead is dropped when CONFIG_STATIC_SHM is disabled.
  */
-#define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry) + \
-                             (NR_MEM_BANKS * 16) +                    \
-                             (IS_ENABLED(CONFIG_STATIC_SHM) ?         \
-                              (NR_SHMEM_BANKS * (160 + 16)) : 0))
+#define HWDOM_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry) + \
+                              (NR_MEM_BANKS * 16) +                    \
+                              (IS_ENABLED(CONFIG_STATIC_SHM) ?         \
+                               (NR_SHMEM_BANKS * (160 + 16)) : 0))
 
 paddr_t __init hwdom_get_fdt_alloc_size(void)
 {
     if ( acpi_disabled )
-        return fdt_totalsize(device_tree_flattened) + DOM0_FDT_EXTRA_SIZE;
+        return fdt_totalsize(device_tree_flattened) + HWDOM_FDT_EXTRA_SIZE;
 
     return ACPI_DOM0_FDT_MIN_SIZE;
 }
@@ -175,7 +175,7 @@ static bool __init insert_11_bank(struct domain *d,
 
     res = guest_physmap_add_page(d, _gfn(mfn_x(smfn)), smfn, order);
     if ( res )
-        panic("Failed map pages to DOM0: %d\n", res);
+        panic("Failed map pages to %pd: %d\n", d, res);
 
     kinfo->unassigned_mem -= size;
 
@@ -245,19 +245,19 @@ fail:
  *
  * Requirements:
  *
- * 1. The dom0 kernel should be loaded within the first 128MB of RAM. This
+ * 1. The hwdom kernel should be loaded within the first 128MB of RAM. This
  *    is necessary at least for Linux zImage kernels, which are all we
  *    support today.
- * 2. We want to put the dom0 kernel, ramdisk and DTB in the same
+ * 2. We want to put the hwdom kernel, ramdisk and DTB in the same
  *    bank. Partly this is just easier for us to deal with, but also
  *    the ramdisk and DTB must be placed within a certain proximity of
  *    the kernel within RAM.
- * 3. For dom0 we want to place as much of the RAM as we reasonably can
+ * 3. For hwdom we want to place as much of the RAM as we reasonably can
  *    below 4GB, so that it can be used by non-LPAE enabled kernels (32-bit).
- * 4. Some devices assigned to dom0 can only do 32-bit DMA access or
+ * 4. Some devices assigned to hwdom can only do 32-bit DMA access or
  *    even be more restricted. We want to allocate as much of the RAM
  *    as we reasonably can that can be accessed from all the devices..
- * 5. For 32-bit dom0 the kernel must be located below 4GB.
+ * 5. For 32-bit hwdom the kernel must be located below 4GB.
  * 6. We want to have a few largers banks rather than many smaller ones.
  *
  * For the first two requirements we need to make sure that the lowest
@@ -293,7 +293,7 @@ fail:
  * to be allocated in the low mem. Then for subsequent allocation, we
  * initially allocate memory only from low mem. Once that runs out out
  * (as described above) we allow higher allocations and continue until
- * that runs out (or we have allocated sufficient dom0 memory).
+ * that runs out (or we have allocated sufficient hwdom memory).
  */
 static void __init allocate_memory_11(struct domain *d,
                                       struct kernel_info *kinfo)
@@ -311,7 +311,7 @@ static void __init allocate_memory_11(struct domain *d,
     unsigned int bits;
 
     /*
-     * TODO: Implement memory bank allocation when DOM0 is not direct
+     * TODO: Implement memory bank allocation when hwdom is not direct
      * mapped
      */
     BUG_ON(!is_domain_direct_mapped(d));
@@ -409,8 +409,8 @@ static void __init allocate_memory_11(struct domain *d,
 
     if ( kinfo->unassigned_mem )
         /* Don't want format this as PRIpaddr (16 digit hex) */
-        panic("Failed to allocate requested dom0 memory. %ldMB unallocated\n",
-              (unsigned long)kinfo->unassigned_mem >> 20);
+        panic("Failed to allocate requested %pd memory. %ldMB unallocated\n",
+              d, (unsigned long)kinfo->unassigned_mem >> 20);
 
     for( i = 0; i < mem->nr_banks; i++ )
     {
@@ -516,7 +516,7 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
          * * remove bootargs, linux,uefi-system-table,
          *   linux,uefi-mmap-start, linux,uefi-mmap-size,
          *   linux,uefi-mmap-desc-size, and linux,uefi-mmap-desc-ver
-         *   (since EFI boot is not currently supported in dom0).
+         *   (since EFI boot is not currently supported in hwdom).
          */
         if ( dt_node_path_is_equal(node, "/chosen") )
         {
@@ -1544,7 +1544,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
 
     /*
      * Even if the IOMMU device is not used by Xen, it should not be
-     * passthrough to DOM0
+     * passthrough to hwdom.
      */
     if ( device_get_class(node) == DEVICE_IOMMU )
     {
@@ -1695,7 +1695,7 @@ static int __init prepare_dtb_hwdom(struct domain *d, struct kernel_info *kinfo)
     kinfo->phandle_intc = dt_interrupt_controller->phandle;
     fdt = device_tree_flattened;
 
-    new_size = fdt_totalsize(fdt) + DOM0_FDT_EXTRA_SIZE;
+    new_size = fdt_totalsize(fdt) + HWDOM_FDT_EXTRA_SIZE;
     kinfo->fdt = xmalloc_bytes(new_size);
     if ( kinfo->fdt == NULL )
         return -ENOMEM;
@@ -1764,7 +1764,7 @@ static void __init find_gnttab_region(struct domain *d,
         gnttab_resource_max_frames(d, XENMEM_resource_grant_table_id_shared);
 
     /*
-     * The region used by Xen on the memory will never be mapped in DOM0
+     * The region used by Xen on the memory will never be mapped in hwdom
      * memory layout. Therefore it can be used for the grant table.
      *
      * Only use the text section as it's always present and will contain
@@ -1776,7 +1776,7 @@ static void __init find_gnttab_region(struct domain *d,
 
 #ifdef CONFIG_ARM_32
     /*
-     * The gnttab region must be under 4GB in order to work with DOM0
+     * The gnttab region must be under 4GB in order to work with hwdom
      * using short page table.
      * In practice it's always the case because Xen is always located
      * below 4GB, but be safe.
@@ -1941,7 +1941,7 @@ int __init construct_hwdom(struct kernel_info *kinfo,
             return rc;
     }
 
-    /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
+    /* Map extra GIC MMIO, irqs and other hw stuffs to hwdom */
     rc = gic_map_hwdom_extra_mappings(d);
     if ( rc < 0 )
         return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472393.1680252 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfcZ-0003JQ-LV; Wed, 04 Nov 2026 18:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472393.1680252; Wed, 04 Nov 2026 18: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 1xOfcZ-0003JI-Iy; Wed, 04 Nov 2026 18:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1472393;
 Wed, 04 Nov 2026 18: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 1xOfcY-0003JC-GP
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfcY-0000000ElfG-1sKy
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfcY-00000007LK3-1XBn
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JpIzdUnWahCRbpAGuHjNH2HY1VDl0FgfC15kT0n0m14=; b=O9hS8WSej5a77PIWtIyLWBmRUv
	rIjN01U+y/UrrccqK/m6RYYbPwu9ZQDWiEoE4XkSQ+1DV9dswRwUZyigQ/7e00mJMWXGvalwJRlWG
	8YuRsPRGjskRMZ8BynqZmsKL/kg7kIF/v16SVK+R7m1m1jEm10R1NyoM1/Nj64wLaFi0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/bitops: Remove unused get_bitmask_order()
Message-Id: <E1xOfcY-00000007LK3-1XBn@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:22:02 +0000

commit 38a7320650f5e0d1efccc9367ca7399e38ebd7ee
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 28 11:29:32 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    xen/bitops: Remove unused get_bitmask_order()
    
    This is a wrapper around fls() with an incorrect comment about the output
    range of the function.  It's also unused, so remove it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/bitops.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 24882fb482..214613f4b4 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -389,14 +389,6 @@ extern unsigned long find_first_zero_bit(const unsigned long *addr,
                                          unsigned long size);
 #endif
 
-static inline int get_bitmask_order(unsigned int count)
-{
-    int order;
-    
-    order = fls(count);
-    return order;   /* We could be slightly more clever with -1 here... */
-}
-
 static inline int get_count_order(unsigned int count)
 {
     int order;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472394.1680257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfcj-0003MM-N7; Wed, 04 Nov 2026 18:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472394.1680257; Wed, 04 Nov 2026 18:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfcj-0003ME-KR; Wed, 04 Nov 2026 18:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1472394;
 Wed, 04 Nov 2026 18:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfci-0003M4-KE
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfci-0000000ElfN-2Pbm
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfci-00000007LWd-29yF
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rt0F/Mwz21wCDvqUbux4g0T/G2qlBC2oyZO0HEhTxhY=; b=swRzDdgqIs1AUYevqzF6KBeyfe
	HOMl8xIqBScpA5kuHW9Z0tzZqVTF9smD+riMQ3CRRm5XzoJJ+Dho5zFxeyiz0XdKDVVZmEbNp/R8d
	mxXQRfstvZjfX4uEClq7XBMLPN68J2OlPjK41upy8KuY0LJyD8pMvN5B3aEE0gIR8u/0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mm: Remove loops in get_order_from_{pages,bytes}()
Message-Id: <E1xOfci-00000007LWd-29yF@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:22:12 +0000

commit 9d7c9d171bc85b786bf7bae4360473b4df136391
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 28 11:30:24 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    xen/mm: Remove loops in get_order_from_{pages,bytes}()
    
    These two functions are just fls() expressions in disguise.  Furthermore,
    GCC-12 at least won't const-propagate get_order_from_pages() with an input of
    3 or above, which covers most of the cases it gets used for.
    
    Rewrite them, and provide some self testing.
    
    Interesting, unless they are always_inline, GCC has a habit of out-of-lining
    them even when inlining would have been a win.  I expect this is to do with
    the fls() functions being superficially more complex.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/bitops.c  | 27 +++++++++++++++++++++++++++
 xen/include/xen/mm.h | 18 ++++--------------
 2 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 859a4ca5c1..1291cbbf09 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -259,3 +259,30 @@ static void __init __constructor test_muldiv64(void)
     if ( res != 0xffffffffffffffffULL )
         panic("muldiv64(), expecting -1ULL, got %#"PRIx64"\n", res);
 }
+
+#include <xen/mm.h>
+
+/* Not really bitops, but here in lieu of any better location */
+static void __init test_order_from_pages(void)
+{
+    CHECK(get_order_from_pages, 1, 0);
+    CHECK(get_order_from_pages, 2, 1);
+    CHECK(get_order_from_pages, 3, 2);
+    CHECK(get_order_from_pages, 4, 2);
+    CHECK(get_order_from_pages, 5, 3);
+    CHECK(get_order_from_pages, 8, 3);
+    CHECK(get_order_from_pages, 9, 4);
+}
+
+static void __init test_order_from_bytes(void)
+{
+    CHECK(get_order_from_bytes, PAGE_SIZE - 1, 0);
+    CHECK(get_order_from_bytes, PAGE_SIZE,     0);
+    CHECK(get_order_from_bytes, PAGE_SIZE + 1, 1);
+}
+
+static void __init __constructor test_orders(void)
+{
+    test_order_from_pages();
+    test_order_from_bytes();
+}
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 153c57f5dd..8f4bba9491 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -530,26 +530,16 @@ page_list_splice(struct page_list_head *list, struct page_list_head *head)
     list_for_each_entry_safe_reverse(pos, tmp, head, list)
 #endif
 
-static inline unsigned int get_order_from_bytes(paddr_t size)
+static always_inline unsigned int get_order_from_bytes(paddr_t size)
 {
-    unsigned int order;
-
     size = (size - 1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
 
-    return order;
+    return fls64(size);
 }
 
-static inline unsigned int get_order_from_pages(unsigned long nr_pages)
+static always_inline unsigned int get_order_from_pages(unsigned long nr_pages)
 {
-    unsigned int order;
-
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-
-    return order;
+    return flsl(nr_pages - 1);
 }
 
 #ifndef arch_free_heap_page
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472396.1680262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfct-0003Pw-Oz; Wed, 04 Nov 2026 18:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472396.1680262; Wed, 04 Nov 2026 18:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfct-0003Po-Lp; Wed, 04 Nov 2026 18:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1472396;
 Wed, 04 Nov 2026 18:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfcs-0003Pg-ND
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfcs-0000000Elfh-2sIn
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfcs-00000007LfP-2hXu
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PIPeC+7iJzJMluBFQfbiPFvkPTV1l6LJIigly0cD3Zo=; b=SwGmj3p6pOr012JMpfOq3c9oAG
	e5wbJNaJEdwkjUoQSXYGmK7ylNXadUeUpabvcVEr3rmifyMuZmGyJ5if3LE8z/i56dDHJ1pOGgxPJ
	plm9i6GjJqYrHkvyTJX2ROWr28OEpmVE1L7sL+wttVKQ0B/arqsrOa5JOYO7rdHkjn3E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Adjust vNMI handling to update the cleanbit
Message-Id: <E1xOfcs-00000007LfP-2hXu@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:22:22 +0000

commit 0e7b01ce3bffb81875aaeb87be723cacd7bac174
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 11:16:24 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Adjust vNMI handling to update the cleanbit
    
    Despite prior information to the contrary, APM Vol2 revision 3.46 October 2026
    has been adjusted to state that the vNMI fields in vINTR are covered by the
    TPR cleanbit.
    
    Adjust svm_inject_nmi() and svm_set_interrupt_shadow() to use vmcb_set_vintr()
    rather than writing into the VMCB directly.
    
    In svm_inject_nmi(), fix an inefficiency from the introduction of vNMI.  Move
    the reading of vmcb_get_general1_intercepts() to the point at which it is
    used; it does not need reading on the case that vNMIs are enabled.
    
    Fixes: 86a203ab8d38 ("x86/svm: Support vNMI on capable hardware")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/intr.c | 9 ++++++---
 xen/arch/x86/hvm/svm/svm.c  | 8 ++++++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 4b0debfa9a..2224f18347 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -30,12 +30,14 @@
 static void svm_inject_nmi(struct vcpu *v)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
-    u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
+    vintr_t vintr = vmcb_get_vintr(vmcb);
+    uint32_t general1_intercepts;
     intinfo_t event;
 
-    if ( vmcb->_vintr.fields.vnmi_enable )
+    if ( vintr.fields.vnmi_enable )
     {
-        vmcb->_vintr.fields.vnmi_pending = true;
+        vintr.fields.vnmi_pending = true;
+        vmcb_set_vintr(vmcb, vintr);
         return;
     }
 
@@ -51,6 +53,7 @@ static void svm_inject_nmi(struct vcpu *v)
      * SVM does not virtualise the NMI mask, so we emulate it by intercepting
      * the next IRET and blocking NMI injection until the intercept triggers.
      */
+    general1_intercepts = vmcb_get_general1_intercepts(vmcb);
     vmcb_set_general1_intercepts(
         vmcb, general1_intercepts | GENERAL1_INTERCEPT_IRET);
 }
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 1628c5e0ae..57779806bf 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -511,12 +511,16 @@ static void cf_check svm_set_interrupt_shadow(
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
     bool block_nmi = intr_shadow & HVM_INTR_SHADOW_NMI;
+    vintr_t vintr = vmcb_get_vintr(vmcb);
 
     vmcb->int_stat.intr_shadow =
         !!(intr_shadow & (HVM_INTR_SHADOW_MOV_SS|HVM_INTR_SHADOW_STI));
 
-    if ( vmcb->_vintr.fields.vnmi_enable )
-        vmcb->_vintr.fields.vnmi_blocking = block_nmi;
+    if ( vintr.fields.vnmi_enable )
+    {
+        vintr.fields.vnmi_blocking = block_nmi;
+        vmcb_set_vintr(vmcb, vintr);
+    }
     else
     {
         uint32_t gen1 = vmcb_get_general1_intercepts(vmcb);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472397.1680265 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfd3-0003S8-Qd; Wed, 04 Nov 2026 18:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472397.1680265; Wed, 04 Nov 2026 18:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfd3-0003S0-O2; Wed, 04 Nov 2026 18:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1472397;
 Wed, 04 Nov 2026 18:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfd2-0003Rs-R2
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfd2-0000000Elfl-3MfU
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfd2-00000007LlX-3DDn
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MQHLbAFmEVoqUp6Pz05YyMURtIL5PmC5c6yt0WT8Soc=; b=NrSLbi6n8U8l3X1XlO5ARN13dq
	sXFmqpJLRcuhWQsMIpJCNZjpGg5W0A40PHk9ntkXzCpb70WQkfp0BZQOMjLgMyV6HKcUoH4F392+R
	IBaQWHk5ccI+bl58vs8qQPC0N+XsphqIijNIlvJltXnc2DEHDdovaJNfkXk9i4QiSJNY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Drop {nmi,mce}_pending defines
Message-Id: <E1xOfd2-00000007LlX-3DDn@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:22:32 +0000

commit edfad6334a42e531e5dae3e612564decdd907a31
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 16:19:57 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86: Drop {nmi,mce}_pending defines
    
    These obscure the data layout in v->arch, and prevent using the names for
    other variables.
    
    Expand the defines in place.  No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/vmce.c    | 2 +-
 xen/arch/x86/cpu/vpmu.c           | 2 +-
 xen/arch/x86/domain.c             | 2 +-
 xen/arch/x86/domctl.c             | 2 +-
 xen/arch/x86/hvm/irq.c            | 8 ++++----
 xen/arch/x86/hvm/vioapic.c        | 2 +-
 xen/arch/x86/hvm/vlapic.c         | 2 +-
 xen/arch/x86/include/asm/domain.h | 3 ---
 xen/arch/x86/nmi.c                | 2 +-
 xen/arch/x86/pv/callback.c        | 2 +-
 xen/arch/x86/pv/traps.c           | 2 +-
 xen/arch/x86/x86_64/asm-offsets.c | 4 ++--
 12 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index 1a7e92506a..2b7ec6737d 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -410,7 +410,7 @@ int inject_vmce(struct domain *d, int vcpu)
 
         if ( (is_hvm_domain(d) ||
               pv_trap_callback_registered(v, X86_EXC_MC)) &&
-             !test_and_set_bool(v->arch.mce_pending) )
+             !test_and_set_bool(v->arch.mce_state.pending) )
         {
             mce_printk(MCE_VERBOSE, "MCE: inject vMCE to %pv\n", v);
             vcpu_kick(v);
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index e0f7edded3..5cc854d71c 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -316,7 +316,7 @@ void vpmu_do_interrupt(void)
         vlapic_set_irq(vlapic, vlapic_lvtpc & APIC_VECTOR_MASK, 0);
         break;
     case APIC_DM_NMI:
-        sampling->arch.nmi_pending = true;
+        sampling->arch.nmi_state.pending = true;
         break;
     }
 #endif
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 368e4deff3..f8e31cdc57 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1684,7 +1684,7 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !guest_handle_is_null(arg) )
             return -EINVAL;
 
-        if ( !test_and_set_bool(v->arch.nmi_pending) )
+        if ( !test_and_set_bool(v->arch.nmi_state.pending) )
             vcpu_kick(v);
         break;
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1e00510702..12c14bb3f5 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -584,7 +584,7 @@ long arch_do_domctl(
         {
         case XEN_DOMCTL_SENDTRIGGER_NMI:
             ret = 0;
-            if ( !test_and_set_bool(v->arch.nmi_pending) )
+            if ( !test_and_set_bool(v->arch.nmi_state.pending) )
                 vcpu_kick(v);
             break;
 
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 50a4314314..9a36ed1920 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -523,10 +523,10 @@ struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v)
      */
     hvm_sync_pir_to_irr(v);
 
-    if ( unlikely(v->arch.nmi_pending) )
+    if ( unlikely(v->arch.nmi_state.pending) )
         return hvm_intack_nmi;
 
-    if ( unlikely(v->arch.mce_pending) )
+    if ( unlikely(v->arch.mce_state.pending) )
         return hvm_intack_mce;
 
     if ( (plat->irq->callback_via_type == HVMIRQ_callback_vector)
@@ -551,11 +551,11 @@ struct hvm_intack hvm_vcpu_ack_pending_irq(
     switch ( intack.source )
     {
     case hvm_intsrc_nmi:
-        if ( !test_and_clear_bool(v->arch.nmi_pending) )
+        if ( !test_and_clear_bool(v->arch.nmi_state.pending) )
             intack = hvm_intack_none;
         break;
     case hvm_intsrc_mce:
-        if ( !test_and_clear_bool(v->arch.mce_pending) )
+        if ( !test_and_clear_bool(v->arch.mce_state.pending) )
             intack = hvm_intack_none;
         break;
     case hvm_intsrc_pic:
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index b633f15232..995fae7b3c 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -475,7 +475,7 @@ static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin)
         for_each_vcpu ( d, v )
             if ( vlapic_match_dest(vcpu_vlapic(v), NULL,
                                    0, dest, dest_mode) &&
-                 !test_and_set_bool(v->arch.nmi_pending) )
+                 !test_and_set_bool(v->arch.nmi_state.pending) )
                 vcpu_kick(v);
         break;
     }
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 0d7231c45b..6698779e22 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -356,7 +356,7 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
         break;
 
     case APIC_DM_NMI:
-        if ( !test_and_set_bool(v->arch.nmi_pending) )
+        if ( !test_and_set_bool(v->arch.nmi_state.pending) )
         {
             bool wake = false;
 
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 2d0a915410..634d0710bf 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -47,9 +47,6 @@ unsigned int arch_domain_struct_memflags(void);
 #define nmi_state              async_exception_state(VCPU_TRAP_NMI)
 #define mce_state              async_exception_state(VCPU_TRAP_MCE)
 
-#define nmi_pending            nmi_state.pending
-#define mce_pending            mce_state.pending
-
 struct trap_bounce {
     uint32_t      error_code;
     uint8_t       flags; /* TBF_ */
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index b3d18270b1..3a94471037 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -522,7 +522,7 @@ static void cf_check do_nmi_stats(unsigned char key)
     if ( !hardware_domain || !(v = domain_vcpu(hardware_domain, 0)) )
         return;
 
-    pend = v->arch.nmi_pending;
+    pend = v->arch.nmi_state.pending;
     mask = v->arch.async_exception_mask & (1 << VCPU_TRAP_NMI);
     if ( pend || mask )
         printk("%pv: NMI%s%s\n",
diff --git a/xen/arch/x86/pv/callback.c b/xen/arch/x86/pv/callback.c
index 38b819b566..29370a68ce 100644
--- a/xen/arch/x86/pv/callback.c
+++ b/xen/arch/x86/pv/callback.c
@@ -35,7 +35,7 @@ static int register_guest_nmi_callback(unsigned long address)
      * now.
      */
     if ( curr->vcpu_id == 0 && arch_get_nmi_reason(d) != 0 )
-        curr->arch.nmi_pending = true;
+        curr->arch.nmi_state.pending = true;
 
     return 0;
 }
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 21a1f4b717..b817b5b296 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -199,7 +199,7 @@ int pv_raise_nmi(struct vcpu *v)
 
     if ( cmpxchgptr(v_ptr, NULL, v) )
         return -EBUSY;
-    if ( !test_and_set_bool(v->arch.nmi_pending) )
+    if ( !test_and_set_bool(v->arch.nmi_state.pending) )
     {
         /* Not safe to wake up a vcpu here */
         raise_softirq(NMI_SOFTIRQ);
diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 3bc0f06c2e..ce5e7aae16 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -110,9 +110,9 @@ void __dummy__(void)
     OFFSET(VCPU_guest_context_flags, struct vcpu, arch.pv.vgc_flags);
     OFFSET(VCPU_cr3, struct vcpu, arch.cr3);
     OFFSET(VCPU_arch_msrs, struct vcpu, arch.msrs);
-    OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_pending);
-    OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_pending);
+    OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_state.pending);
     OFFSET(VCPU_nmi_old_mask, struct vcpu, arch.nmi_state.old_mask);
+    OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_state.pending);
     OFFSET(VCPU_mce_old_mask, struct vcpu, arch.mce_state.old_mask);
     OFFSET(VCPU_async_exception_mask, struct vcpu, arch.async_exception_mask);
     DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472398.1680269 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdD-0003VN-S0; Wed, 04 Nov 2026 18:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472398.1680269; Wed, 04 Nov 2026 18:22:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdD-0003VF-PP; Wed, 04 Nov 2026 18:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1472398;
 Wed, 04 Nov 2026 18:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfdC-0003V8-Uc
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdC-0000000Elfp-3qXQ
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdC-00000007Lpl-3e0l
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n07GPB09DreJDVGfPag+qyntFJGA8EHvtRjf6VEygm4=; b=6oC3VN3PjCfMvn5TC+QyOwmzE4
	0x31S8yMEk4f+10SUA3c36kf03khM6j5p1YgqrdXC63xS/5K5tGWuExXwYKx9UYGPaJrIewL9xGQ7
	SkDzV8r52Habwu83cVmaiPIdoRfMQtWeqn7MOHl4X5A2mJ2bxSNqdNMK+Mgcksj9e9Fk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pv: Improve code generation in async_exception_cleanup()
Message-Id: <E1xOfdC-00000007Lpl-3e0l@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:22:42 +0000

commit fcc3289cdf18c5ae5d7b066f7c6c82c188f7e679
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 16:22:11 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/pv: Improve code generation in async_exception_cleanup()
    
    Use new helpers to simplfiy the logic.  No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/iret.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/iret.c b/xen/arch/x86/pv/iret.c
index 39ce316b8d..52430f38d2 100644
--- a/xen/arch/x86/pv/iret.c
+++ b/xen/arch/x86/pv/iret.c
@@ -31,8 +31,8 @@ static void async_exception_cleanup(struct vcpu *curr)
     if ( !curr->arch.async_exception_mask )
         return;
 
-    if ( !(curr->arch.async_exception_mask & (curr->arch.async_exception_mask - 1)) )
-        trap = __scanbit(curr->arch.async_exception_mask, VCPU_TRAP_NONE);
+    if ( !multiple_bits_set(curr->arch.async_exception_mask) )
+        trap = ffs(curr->arch.async_exception_mask) - 1;
     else
         for ( trap = VCPU_TRAP_NONE + 1; trap <= VCPU_TRAP_LAST; ++trap )
             if ( (curr->arch.async_exception_mask ^
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472399.1680272 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdO-0003XK-To; Wed, 04 Nov 2026 18:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472399.1680272; Wed, 04 Nov 2026 18:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdO-0003XA-Qo; Wed, 04 Nov 2026 18:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1472399;
 Wed, 04 Nov 2026 18:22:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfdN-0003X0-1g
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:22:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdN-0000000Elfv-05cr
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdM-00000007Lu4-46R1
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:22:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sVy0iLkDMJaVbNhZIySWbtv1CWnrRqAN8ACk9VA8izo=; b=N0EDI81lmO9QWHCm3bQ5WBt/ka
	QfbpjVEiKjsyIhJpVn2/BcDc1TiieIXHQ97aYT7piQiyk7rRf0nh5OlEUokUDWyO4KTHSNt0NasPZ
	hv71crj1EM6ir/StrxT/3gfkCzUj9B1edSStcY85puFR1D1VGBWaoR44ZcUimG/WpkaQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Remove ioio_info_t type
Message-Id: <E1xOfdM-00000007Lu4-46R1@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:22:52 +0000

commit 8d436bf73e68dd3cf4d148e6313e642ab5dda412
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 15:02:45 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Remove ioio_info_t type
    
    This type duplicates what is already in the VMCB struct. Remove it and
    have the only user access the VMCB directly.
    
    No functional change intended.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 13 +++++--------
 xen/arch/x86/hvm/svm/vmcb.h      | 17 -----------------
 2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 128008321d..61c401240d 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -809,18 +809,16 @@ nsvm_vmcb_guest_intercepts_msr(unsigned long *msr_bitmap,
 }
 
 static int
-nsvm_vmcb_guest_intercepts_ioio(paddr_t iopm_pa, uint64_t exitinfo1)
+nsvm_vmcb_guest_intercepts_ioio(struct vmcb_struct *vmcb)
 {
-    unsigned long gfn = iopm_pa >> PAGE_SHIFT;
+    unsigned long gfn = vmcb->_iopm_base_pa >> PAGE_SHIFT;
     unsigned long *io_bitmap;
-    ioio_info_t ioinfo;
     uint16_t port;
     unsigned int size;
     bool intercepted;
 
-    ioinfo.bytes = exitinfo1;
-    port = ioinfo.fields.port;
-    size = ioinfo.fields.sz32 ? 4 : ioinfo.fields.sz16 ? 2 : 1;
+    port = vmcb->ei.io.port;
+    size = vmcb->ei.io.bytes;
 
     switch ( port )
     {
@@ -930,8 +928,7 @@ nsvm_vmcb_guest_intercepts_exitcode(struct vcpu *v,
         if ( !nestedsvm_vmcb_map(v, nv->nv_vvmcxaddr) )
             break;
         ns_vmcb = nv->nv_vvmcx;
-        vmexits = nsvm_vmcb_guest_intercepts_ioio(ns_vmcb->_iopm_base_pa,
-            ns_vmcb->exitinfo1);
+        vmexits = nsvm_vmcb_guest_intercepts_ioio(ns_vmcb);
         if ( vmexits == NESTEDHVM_VMEXIT_HOST )
             return 0;
         break;
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 28dae325ce..131815a712 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -352,23 +352,6 @@ typedef union
     } fields;
 } vintr_t;
 
-typedef union
-{
-    u64 bytes;
-    struct
-    {
-        u64 type: 1;
-        u64 rsv0: 1;
-        u64 str:  1;
-        u64 rep:  1;
-        u64 sz8:  1;
-        u64 sz16: 1;
-        u64 sz32: 1;
-        u64 rsv1: 9;
-        u64 port: 16;
-    } fields;
-} ioio_info_t;
-
 typedef union
 {
     u64 bytes;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472400.1680277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdY-0003am-Uw; Wed, 04 Nov 2026 18:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472400.1680277; Wed, 04 Nov 2026 18:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdY-0003ae-SD; Wed, 04 Nov 2026 18:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1472400;
 Wed, 04 Nov 2026 18:23:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfdX-0003aV-5l
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:23:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdX-0000000ElgG-0aiV
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdX-00000007Ly1-0P5u
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:23:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oKfMJzDcsTlnRkf44XaQerEGD4Lv0BFfD3/BpysIr1I=; b=OyRGPlb+2UlE3hfM0cwIM1MGiq
	4HRKn2kv+MxMh1o28SNz2Q+DMk7C0c1zc6Q7zxNL10gAtaqrbG2H0+vEbFaWJ417dHWy8vG1+yVf+
	ilFYsmgUbgMwEKh1A6nEmMzdckMmY0vPosB+aW2JdTSQY6YmqHfgLK0fNBvKiedR7K88=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Cleanup virt_ext_t type
Message-Id: <E1xOfdX-00000007Ly1-0P5u@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:23:03 +0000

commit dc5813a9c46317f2fde7df2f3899a6237e5fe066
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 15:02:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Cleanup virt_ext_t type
    
    Rearrange the union to drop the .fields infix, rename bytes to the more
    common raw, adjust types where appropriate, and simplify some names.
    Adjust the users accordingly.
    
    No functional change intended.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 12 +++++-------
 xen/arch/x86/hvm/svm/svm.c       |  2 +-
 xen/arch/x86/hvm/svm/vmcb.c      |  2 +-
 xen/arch/x86/hvm/svm/vmcb.h      |  8 ++++----
 4 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 61c401240d..a21d6f24a7 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -442,8 +442,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     /* Pending Interrupts */
     n2vmcb->event_inj = ns_vmcb->event_inj;
 
-    n2vmcb->virt_ext.bytes =
-        n1vmcb->virt_ext.bytes | ns_vmcb->virt_ext.bytes;
+    n2vmcb->virt_ext.raw = n1vmcb->virt_ext.raw | ns_vmcb->virt_ext.raw;
 
     /*
      * NextRIP is consumed on VMRUN as the return address pushed on the
@@ -1536,10 +1535,9 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
      */
     if ( nsvm_efer_svm_enabled(v) )
     {
-        if ( !vmcb->virt_ext.fields.vloadsave_enable &&
-             cpu_has_svm_vloadsave )
+        if ( !vmcb->virt_ext.vloadsave_en && cpu_has_svm_vloadsave )
         {
-            vmcb->virt_ext.fields.vloadsave_enable = 1;
+            vmcb->virt_ext.vloadsave_en = true;
             general2_intercepts  = vmcb_get_general2_intercepts(vmcb);
             general2_intercepts &= ~(GENERAL2_INTERCEPT_VMLOAD |
                                      GENERAL2_INTERCEPT_VMSAVE);
@@ -1561,9 +1559,9 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
     }
     else
     {
-        if ( vmcb->virt_ext.fields.vloadsave_enable )
+        if ( vmcb->virt_ext.vloadsave_en )
         {
-            vmcb->virt_ext.fields.vloadsave_enable = 0;
+            vmcb->virt_ext.vloadsave_en = false;
             general2_intercepts  = vmcb_get_general2_intercepts(vmcb);
             general2_intercepts |= (GENERAL2_INTERCEPT_VMLOAD |
                                     GENERAL2_INTERCEPT_VMSAVE);
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 57779806bf..666bcd3eb4 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1938,7 +1938,7 @@ static int cf_check svm_msr_write_intercept(
         vmcb_set_debugctlmsr(vmcb, msr_content);
         if ( !msr_content || !cpu_has_svm_lbrv )
             break;
-        vmcb->virt_ext.fields.lbr_enable = 1;
+        vmcb->virt_ext.lbr_en = true;
         svm_disable_intercept_for_msr(v, MSR_IA32_DEBUGCTLMSR);
         svm_disable_intercept_for_msr(v, MSR_IA32_LASTBRANCHFROMIP);
         svm_disable_intercept_for_msr(v, MSR_IA32_LASTBRANCHTOIP);
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index a6f09672a7..33c85ea3bf 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -291,7 +291,7 @@ void svm_vmcb_dump(const char *from, const struct vmcb_struct *vmcb)
            vmcb_get_sev(vmcb)    ? " SEV"    : "",
            vmcb_get_sev_es(vmcb) ? " SEV_ES" : "");
     printk("virtual vmload/vmsave = %d, virt_ext = %#"PRIx64"\n",
-           vmcb->virt_ext.fields.vloadsave_enable, vmcb->virt_ext.bytes);
+           vmcb->virt_ext.vloadsave_en, vmcb->virt_ext.raw);
     printk("cpl = %d efer = %#"PRIx64" star = %#"PRIx64" lstar = %#"PRIx64"\n",
            vmcb_get_cpl(vmcb), vmcb_get_efer(vmcb), vmcb->star, vmcb->lstar);
     printk("CR0 = 0x%016"PRIx64" CR2 = 0x%016"PRIx64"\n",
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 131815a712..8b351679fa 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -354,12 +354,12 @@ typedef union
 
 typedef union
 {
-    u64 bytes;
     struct
     {
-        u64 lbr_enable:1;
-        u64 vloadsave_enable:1;
-    } fields;
+        bool lbr_en:1;
+        bool vloadsave_en:1;
+    };
+    uint64_t raw;
 } virt_ext_t;
 
 typedef union
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:23:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:23:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472401.1680280 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdj-0003dm-0I; Wed, 04 Nov 2026 18:23:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472401.1680280; Wed, 04 Nov 2026 18:23:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdi-0003de-TX; Wed, 04 Nov 2026 18:23:14 +0000
Received: by outflank-mailman (input) for mailman id 1472401;
 Wed, 04 Nov 2026 18:23:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfdh-0003dW-91
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:23:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdh-0000000ElgN-10bl
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:23:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdh-00000007M3O-0rcI
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:23:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d+efiqKuJAyegJkIJyVBDRFmqo102k/RCGtqe2HuMqA=; b=Rw5DKhEA3VsLMZ8UTUqqTv1TJH
	tm9VKdQhqmkW0M+vEfov0cn7C1M6Q3MbDUXA9PbK9u0FielDMTrpWptT5U9FYv9wNFCDxk2g7QgN0
	rsMGoRJ6VENNzYtf6SN0mdS8MVY0Y0anySejrZ6KXw27DiGGeJCfoeguk3XDuFGEV4MI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Cleanup ns_hostflags type
Message-Id: <E1xOfdh-00000007M3O-0rcI@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:23:13 +0000

commit eed66b0907a637ca08ee32ea773ed851d31ed729
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 15:02:48 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Cleanup ns_hostflags type
    
    Rearrange the union to drop the .fields infix, rename bytes to the more
    common raw, and adjust types where appropriate. Adjust the users
    accordingly.
    
    No functional change intended.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c         | 11 +++++------
 xen/arch/x86/include/asm/hvm/svm-types.h |  9 ++++-----
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index a21d6f24a7..d970869cfd 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -151,7 +151,7 @@ int cf_check nsvm_vcpu_reset(struct vcpu *v)
     svm->ns_vmcb_guestcr3 = 0;
     svm->ns_vmcb_hostcr3 = 0;
     svm->ns_asid = 0;
-    svm->ns_hostflags.bytes = 0;
+    svm->ns_hostflags.raw = 0;
     svm->ns_vmexit.exitinfo1 = 0;
     svm->ns_vmexit.exitinfo2 = 0;
 
@@ -182,7 +182,7 @@ static int nsvm_vcpu_hostsave(struct vcpu *v, unsigned int inst_len)
     n1vmcb->_cr4 = v->arch.hvm.guest_cr[4];
 
     /* Remember the host interrupt flag */
-    svm->ns_hostflags.fields.rflagsif = !!(n1vmcb->rflags & X86_EFLAGS_IF);
+    svm->ns_hostflags.rflagsif = n1vmcb->rflags & X86_EFLAGS_IF;
 
     return 0;
 }
@@ -637,7 +637,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs *regs,
     svm->ns_hap_enabled = vmcb_get_np(ns_vmcb);
 
     /* Remember the V_INTR_MASK in hostflags */
-    svm->ns_hostflags.fields.vintrmask = !!ns_vmcb->_vintr.fields.intr_masking;
+    svm->ns_hostflags.vintrmask = ns_vmcb->_vintr.fields.intr_masking;
 
     /* Save l1 guest state (= host state) */
     ret = nsvm_vcpu_hostsave(v, inst_len);
@@ -978,7 +978,7 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 
     /* Virtual Interrupts */
     ns_vmcb->_vintr = n2vmcb->_vintr;
-    if ( !svm->ns_hostflags.fields.vintrmask )
+    if ( !svm->ns_hostflags.vintrmask )
         ns_vmcb->_vintr.fields.intr_masking = 0;
 
     /* Interrupt state */
@@ -1159,8 +1159,7 @@ enum hvm_intblk cf_check nsvm_intr_blocked(struct vcpu *v)
     {
         struct vmcb_struct *n2vmcb = nv->nv_n2vmcx;
 
-        if ( svm->ns_hostflags.fields.vintrmask &&
-             !svm->ns_hostflags.fields.rflagsif )
+        if ( svm->ns_hostflags.vintrmask && !svm->ns_hostflags.rflagsif )
             return hvm_intblk_rflags_ie;
 
         /* when l1 guest passes its devices through to the l2 guest
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index beab9a3af2..71427b3c11 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -77,12 +77,11 @@ struct nestedsvm {
     } ns_vmexit;
 
     union {
-        uint32_t bytes;
         struct {
-            uint32_t rflagsif:1;
-            uint32_t vintrmask:1;
-            uint32_t reserved:30;
-        } fields;
+            bool rflagsif:1;
+            bool vintrmask:1;
+        };
+        uint32_t raw;
     } ns_hostflags;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 18:23:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 18:23:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472402.1680285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfdt-0003hY-2C; Wed, 04 Nov 2026 18:23:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472402.1680285; Wed, 04 Nov 2026 18:23:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOfds-0003hP-Vq; Wed, 04 Nov 2026 18:23:24 +0000
Received: by outflank-mailman (input) for mailman id 1472402;
 Wed, 04 Nov 2026 18:23:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOfdr-0003gD-C6
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 18:23:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdr-0000000Elgk-1QO1
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOfdr-00000007M9C-1HIp
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 18:23:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aRQ6BsPdcL9HBAT93WpCthM+YoeGN0277pthOLhjiAw=; b=R83JTkTDfHJ8IfE6uIawk5FGez
	dimm/RG2xYpt6a6Pqx3XoIRYuO25N9V99mlm8O++cvxF6aC31mUvKGxYQ1snn922yJnYM/qHASIqo
	k4aVgi+hZjUF40gE3CVixKHFjex4KByjSZtlP44svbE6uWWi/9UbGVs4Q6hu7O6lYCTc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/gnttab: Drop owner->grant_table check in _cache_flush()
Message-Id: <E1xOfdr-00000007M9C-1HIp@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 18:23:23 +0000

commit bec8e3c1fb91b96f337c08c6daf1bb2563b320c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Sep 28 20:05:01 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    xen/gnttab: Drop owner->grant_table check in _cache_flush()
    
    The "owner && !owner->grant_table" case needs a put_page() in it's error path.
    
    In Xen 4.20 and earlier, this was addressed by XSA-520.  Since the addition of
    CONFIG_HAS_GRANT_CACHE_FLUSH in Xen 4.21, this path is only reachable on ARM,
    and system domains on ARM do not own any memory.
    
    Therefore delete the check, rather than inserting unreachable error handling.
    
    No functional change.
    
    This issue was also independently reported by Yehyeong Lee as the security
    team was already working on XSA-519/520.
    
    Reported-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 5e79c012b6..2285c4aee8 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3633,7 +3633,7 @@ static int _cache_flush(gnttab_cache_flush_t *cflush, grant_ref_t *cur_ref)
 
     page = mfn_to_page(mfn);
     owner = page_get_owner_and_reference(page);
-    if ( !owner || !owner->grant_table )
+    if ( !owner )
     {
         rcu_unlock_domain(d);
         return -EPERM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472433.1680290 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgNz-0003oq-7w; Wed, 04 Nov 2026 19:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472433.1680290; Wed, 04 Nov 2026 19:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgNz-0003of-5C; Wed, 04 Nov 2026 19:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1472433;
 Wed, 04 Nov 2026 19: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 1xOgNy-0003oZ-42
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgNy-0000000Emel-01SI
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgNx-00000007uqC-42Ya
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CUWDhgAhHOtTpM2Dq+txSfG08eKYTKROGTnfUv7E0/0=; b=WCi5ytj7La8mYTXhkcFRbcWqr3
	Jrp9EFaIH5vNfShvgP24vPptQztCjU5zNQoUaAHKSThCGwGstCDtxpxtWxMyZelmX67hPGZw2+pzH
	eWZXPZ66CDA9RYXq71hgdeOrSRy0ySIGnC19gC9s3yKXsr8yqZTDeEb4scabe6UwLbCI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/bitops: Remove unused get_bitmask_order()
Message-Id: <E1xOgNx-00000007uqC-42Ya@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:11:01 +0000

commit 38a7320650f5e0d1efccc9367ca7399e38ebd7ee
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 28 11:29:32 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    xen/bitops: Remove unused get_bitmask_order()
    
    This is a wrapper around fls() with an incorrect comment about the output
    range of the function.  It's also unused, so remove it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/bitops.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 24882fb482..214613f4b4 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -389,14 +389,6 @@ extern unsigned long find_first_zero_bit(const unsigned long *addr,
                                          unsigned long size);
 #endif
 
-static inline int get_bitmask_order(unsigned int count)
-{
-    int order;
-    
-    order = fls(count);
-    return order;   /* We could be slightly more clever with -1 here... */
-}
-
 static inline int get_count_order(unsigned int count)
 {
     int order;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472434.1680293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgO9-0003ql-91; Wed, 04 Nov 2026 19:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472434.1680293; Wed, 04 Nov 2026 19:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgO9-0003qd-6V; Wed, 04 Nov 2026 19:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1472434;
 Wed, 04 Nov 2026 19:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgO8-0003qT-5U
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgO8-0000000Emev-0VM5
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgO8-00000007uzh-0J1I
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19: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=+shL2Mjo4RgyvZzpbTro8xwqR2ANXmBbPav+fCpqxmY=; b=JexR/Vf0ghSFeONcdE2lTscNoJ
	xbogbo+cjGqCV0zQSwFjpsmP+fsE3D05//k5kYnLfRpMSrvcwv3nzMIgjQQK7sys99SZ17R/nDrtu
	c2yudpINp786kkM9xe0cdfjLOvKxrpWf9UrUF7C750wXVrtziWxCKJzna2/W7EPbUd2M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: Remove loops in get_order_from_{pages,bytes}()
Message-Id: <E1xOgO8-00000007uzh-0J1I@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:11:12 +0000

commit 9d7c9d171bc85b786bf7bae4360473b4df136391
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 28 11:30:24 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    xen/mm: Remove loops in get_order_from_{pages,bytes}()
    
    These two functions are just fls() expressions in disguise.  Furthermore,
    GCC-12 at least won't const-propagate get_order_from_pages() with an input of
    3 or above, which covers most of the cases it gets used for.
    
    Rewrite them, and provide some self testing.
    
    Interesting, unless they are always_inline, GCC has a habit of out-of-lining
    them even when inlining would have been a win.  I expect this is to do with
    the fls() functions being superficially more complex.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/bitops.c  | 27 +++++++++++++++++++++++++++
 xen/include/xen/mm.h | 18 ++++--------------
 2 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 859a4ca5c1..1291cbbf09 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -259,3 +259,30 @@ static void __init __constructor test_muldiv64(void)
     if ( res != 0xffffffffffffffffULL )
         panic("muldiv64(), expecting -1ULL, got %#"PRIx64"\n", res);
 }
+
+#include <xen/mm.h>
+
+/* Not really bitops, but here in lieu of any better location */
+static void __init test_order_from_pages(void)
+{
+    CHECK(get_order_from_pages, 1, 0);
+    CHECK(get_order_from_pages, 2, 1);
+    CHECK(get_order_from_pages, 3, 2);
+    CHECK(get_order_from_pages, 4, 2);
+    CHECK(get_order_from_pages, 5, 3);
+    CHECK(get_order_from_pages, 8, 3);
+    CHECK(get_order_from_pages, 9, 4);
+}
+
+static void __init test_order_from_bytes(void)
+{
+    CHECK(get_order_from_bytes, PAGE_SIZE - 1, 0);
+    CHECK(get_order_from_bytes, PAGE_SIZE,     0);
+    CHECK(get_order_from_bytes, PAGE_SIZE + 1, 1);
+}
+
+static void __init __constructor test_orders(void)
+{
+    test_order_from_pages();
+    test_order_from_bytes();
+}
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 153c57f5dd..8f4bba9491 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -530,26 +530,16 @@ page_list_splice(struct page_list_head *list, struct page_list_head *head)
     list_for_each_entry_safe_reverse(pos, tmp, head, list)
 #endif
 
-static inline unsigned int get_order_from_bytes(paddr_t size)
+static always_inline unsigned int get_order_from_bytes(paddr_t size)
 {
-    unsigned int order;
-
     size = (size - 1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
 
-    return order;
+    return fls64(size);
 }
 
-static inline unsigned int get_order_from_pages(unsigned long nr_pages)
+static always_inline unsigned int get_order_from_pages(unsigned long nr_pages)
 {
-    unsigned int order;
-
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-
-    return order;
+    return flsl(nr_pages - 1);
 }
 
 #ifndef arch_free_heap_page
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472435.1680298 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgOJ-0003uA-Ak; Wed, 04 Nov 2026 19:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472435.1680298; Wed, 04 Nov 2026 19:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgOJ-0003u1-7p; Wed, 04 Nov 2026 19:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1472435;
 Wed, 04 Nov 2026 19:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgOI-0003tv-8u
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOI-0000000EmfN-10q5
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOI-00000007v7p-0oq7
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19: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=hdnyuLze318xYPuPEPCc4yAYlYWwF8WKmzTkRhfo5ck=; b=tUGsDAXyaYeX4UrobG63quFaVO
	rbXnC8LHvia/l48ISJw6fZcUOcnujEQnBmShcLw/rG/3wKbUVwEtmlR4J1v4iszk7YIuH3AhX0yuk
	nfH42qLCEuT0LCzczQLj/vIdcJKPZJAsbPCjrShmfOx/FUCkz6CmCHiVj5WQzQF0/l4Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Adjust vNMI handling to update the cleanbit
Message-Id: <E1xOgOI-00000007v7p-0oq7@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:11:22 +0000

commit 0e7b01ce3bffb81875aaeb87be723cacd7bac174
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 11:16:24 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Adjust vNMI handling to update the cleanbit
    
    Despite prior information to the contrary, APM Vol2 revision 3.46 October 2026
    has been adjusted to state that the vNMI fields in vINTR are covered by the
    TPR cleanbit.
    
    Adjust svm_inject_nmi() and svm_set_interrupt_shadow() to use vmcb_set_vintr()
    rather than writing into the VMCB directly.
    
    In svm_inject_nmi(), fix an inefficiency from the introduction of vNMI.  Move
    the reading of vmcb_get_general1_intercepts() to the point at which it is
    used; it does not need reading on the case that vNMIs are enabled.
    
    Fixes: 86a203ab8d38 ("x86/svm: Support vNMI on capable hardware")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/intr.c | 9 ++++++---
 xen/arch/x86/hvm/svm/svm.c  | 8 ++++++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 4b0debfa9a..2224f18347 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -30,12 +30,14 @@
 static void svm_inject_nmi(struct vcpu *v)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
-    u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
+    vintr_t vintr = vmcb_get_vintr(vmcb);
+    uint32_t general1_intercepts;
     intinfo_t event;
 
-    if ( vmcb->_vintr.fields.vnmi_enable )
+    if ( vintr.fields.vnmi_enable )
     {
-        vmcb->_vintr.fields.vnmi_pending = true;
+        vintr.fields.vnmi_pending = true;
+        vmcb_set_vintr(vmcb, vintr);
         return;
     }
 
@@ -51,6 +53,7 @@ static void svm_inject_nmi(struct vcpu *v)
      * SVM does not virtualise the NMI mask, so we emulate it by intercepting
      * the next IRET and blocking NMI injection until the intercept triggers.
      */
+    general1_intercepts = vmcb_get_general1_intercepts(vmcb);
     vmcb_set_general1_intercepts(
         vmcb, general1_intercepts | GENERAL1_INTERCEPT_IRET);
 }
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 1628c5e0ae..57779806bf 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -511,12 +511,16 @@ static void cf_check svm_set_interrupt_shadow(
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
     bool block_nmi = intr_shadow & HVM_INTR_SHADOW_NMI;
+    vintr_t vintr = vmcb_get_vintr(vmcb);
 
     vmcb->int_stat.intr_shadow =
         !!(intr_shadow & (HVM_INTR_SHADOW_MOV_SS|HVM_INTR_SHADOW_STI));
 
-    if ( vmcb->_vintr.fields.vnmi_enable )
-        vmcb->_vintr.fields.vnmi_blocking = block_nmi;
+    if ( vintr.fields.vnmi_enable )
+    {
+        vintr.fields.vnmi_blocking = block_nmi;
+        vmcb_set_vintr(vmcb, vintr);
+    }
     else
     {
         uint32_t gen1 = vmcb_get_general1_intercepts(vmcb);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472436.1680301 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgOU-0003w7-Bn; Wed, 04 Nov 2026 19:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472436.1680301; Wed, 04 Nov 2026 19: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 1xOgOU-0003vz-9D; Wed, 04 Nov 2026 19:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1472436;
 Wed, 04 Nov 2026 19:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgOS-0003vp-D1
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOS-0000000EmfR-1Xqj
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOS-00000007vI2-1N5f
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19: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=zy7A5IwDH6L5xLNpHM7Z+FaYVn+Er0dqODGDzB44N8Y=; b=53kI7EOcZSIf9tld6Z/NhH2D/e
	AYo1QtTeC3J75JwtSRG66jyVTWloWB1cVoc50kCl+SlOvy0mkdFMkfeYjmnfJ5MdECeXgdfiJHnU3
	DctfT9MV7s6kPuqrVb5KV+TIgdl/FxxSTCnkMkItUXNR4JBy7iiTUokoSKG6R2AnqUyk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Drop {nmi,mce}_pending defines
Message-Id: <E1xOgOS-00000007vI2-1N5f@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:11:32 +0000

commit edfad6334a42e531e5dae3e612564decdd907a31
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 16:19:57 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86: Drop {nmi,mce}_pending defines
    
    These obscure the data layout in v->arch, and prevent using the names for
    other variables.
    
    Expand the defines in place.  No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mcheck/vmce.c    | 2 +-
 xen/arch/x86/cpu/vpmu.c           | 2 +-
 xen/arch/x86/domain.c             | 2 +-
 xen/arch/x86/domctl.c             | 2 +-
 xen/arch/x86/hvm/irq.c            | 8 ++++----
 xen/arch/x86/hvm/vioapic.c        | 2 +-
 xen/arch/x86/hvm/vlapic.c         | 2 +-
 xen/arch/x86/include/asm/domain.h | 3 ---
 xen/arch/x86/nmi.c                | 2 +-
 xen/arch/x86/pv/callback.c        | 2 +-
 xen/arch/x86/pv/traps.c           | 2 +-
 xen/arch/x86/x86_64/asm-offsets.c | 4 ++--
 12 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index 1a7e92506a..2b7ec6737d 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -410,7 +410,7 @@ int inject_vmce(struct domain *d, int vcpu)
 
         if ( (is_hvm_domain(d) ||
               pv_trap_callback_registered(v, X86_EXC_MC)) &&
-             !test_and_set_bool(v->arch.mce_pending) )
+             !test_and_set_bool(v->arch.mce_state.pending) )
         {
             mce_printk(MCE_VERBOSE, "MCE: inject vMCE to %pv\n", v);
             vcpu_kick(v);
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index e0f7edded3..5cc854d71c 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -316,7 +316,7 @@ void vpmu_do_interrupt(void)
         vlapic_set_irq(vlapic, vlapic_lvtpc & APIC_VECTOR_MASK, 0);
         break;
     case APIC_DM_NMI:
-        sampling->arch.nmi_pending = true;
+        sampling->arch.nmi_state.pending = true;
         break;
     }
 #endif
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 368e4deff3..f8e31cdc57 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1684,7 +1684,7 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !guest_handle_is_null(arg) )
             return -EINVAL;
 
-        if ( !test_and_set_bool(v->arch.nmi_pending) )
+        if ( !test_and_set_bool(v->arch.nmi_state.pending) )
             vcpu_kick(v);
         break;
 
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1e00510702..12c14bb3f5 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -584,7 +584,7 @@ long arch_do_domctl(
         {
         case XEN_DOMCTL_SENDTRIGGER_NMI:
             ret = 0;
-            if ( !test_and_set_bool(v->arch.nmi_pending) )
+            if ( !test_and_set_bool(v->arch.nmi_state.pending) )
                 vcpu_kick(v);
             break;
 
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 50a4314314..9a36ed1920 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -523,10 +523,10 @@ struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v)
      */
     hvm_sync_pir_to_irr(v);
 
-    if ( unlikely(v->arch.nmi_pending) )
+    if ( unlikely(v->arch.nmi_state.pending) )
         return hvm_intack_nmi;
 
-    if ( unlikely(v->arch.mce_pending) )
+    if ( unlikely(v->arch.mce_state.pending) )
         return hvm_intack_mce;
 
     if ( (plat->irq->callback_via_type == HVMIRQ_callback_vector)
@@ -551,11 +551,11 @@ struct hvm_intack hvm_vcpu_ack_pending_irq(
     switch ( intack.source )
     {
     case hvm_intsrc_nmi:
-        if ( !test_and_clear_bool(v->arch.nmi_pending) )
+        if ( !test_and_clear_bool(v->arch.nmi_state.pending) )
             intack = hvm_intack_none;
         break;
     case hvm_intsrc_mce:
-        if ( !test_and_clear_bool(v->arch.mce_pending) )
+        if ( !test_and_clear_bool(v->arch.mce_state.pending) )
             intack = hvm_intack_none;
         break;
     case hvm_intsrc_pic:
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index b633f15232..995fae7b3c 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -475,7 +475,7 @@ static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin)
         for_each_vcpu ( d, v )
             if ( vlapic_match_dest(vcpu_vlapic(v), NULL,
                                    0, dest, dest_mode) &&
-                 !test_and_set_bool(v->arch.nmi_pending) )
+                 !test_and_set_bool(v->arch.nmi_state.pending) )
                 vcpu_kick(v);
         break;
     }
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 0d7231c45b..6698779e22 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -356,7 +356,7 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
         break;
 
     case APIC_DM_NMI:
-        if ( !test_and_set_bool(v->arch.nmi_pending) )
+        if ( !test_and_set_bool(v->arch.nmi_state.pending) )
         {
             bool wake = false;
 
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index 2d0a915410..634d0710bf 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -47,9 +47,6 @@ unsigned int arch_domain_struct_memflags(void);
 #define nmi_state              async_exception_state(VCPU_TRAP_NMI)
 #define mce_state              async_exception_state(VCPU_TRAP_MCE)
 
-#define nmi_pending            nmi_state.pending
-#define mce_pending            mce_state.pending
-
 struct trap_bounce {
     uint32_t      error_code;
     uint8_t       flags; /* TBF_ */
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index b3d18270b1..3a94471037 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -522,7 +522,7 @@ static void cf_check do_nmi_stats(unsigned char key)
     if ( !hardware_domain || !(v = domain_vcpu(hardware_domain, 0)) )
         return;
 
-    pend = v->arch.nmi_pending;
+    pend = v->arch.nmi_state.pending;
     mask = v->arch.async_exception_mask & (1 << VCPU_TRAP_NMI);
     if ( pend || mask )
         printk("%pv: NMI%s%s\n",
diff --git a/xen/arch/x86/pv/callback.c b/xen/arch/x86/pv/callback.c
index 38b819b566..29370a68ce 100644
--- a/xen/arch/x86/pv/callback.c
+++ b/xen/arch/x86/pv/callback.c
@@ -35,7 +35,7 @@ static int register_guest_nmi_callback(unsigned long address)
      * now.
      */
     if ( curr->vcpu_id == 0 && arch_get_nmi_reason(d) != 0 )
-        curr->arch.nmi_pending = true;
+        curr->arch.nmi_state.pending = true;
 
     return 0;
 }
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 21a1f4b717..b817b5b296 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -199,7 +199,7 @@ int pv_raise_nmi(struct vcpu *v)
 
     if ( cmpxchgptr(v_ptr, NULL, v) )
         return -EBUSY;
-    if ( !test_and_set_bool(v->arch.nmi_pending) )
+    if ( !test_and_set_bool(v->arch.nmi_state.pending) )
     {
         /* Not safe to wake up a vcpu here */
         raise_softirq(NMI_SOFTIRQ);
diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 3bc0f06c2e..ce5e7aae16 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -110,9 +110,9 @@ void __dummy__(void)
     OFFSET(VCPU_guest_context_flags, struct vcpu, arch.pv.vgc_flags);
     OFFSET(VCPU_cr3, struct vcpu, arch.cr3);
     OFFSET(VCPU_arch_msrs, struct vcpu, arch.msrs);
-    OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_pending);
-    OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_pending);
+    OFFSET(VCPU_nmi_pending, struct vcpu, arch.nmi_state.pending);
     OFFSET(VCPU_nmi_old_mask, struct vcpu, arch.nmi_state.old_mask);
+    OFFSET(VCPU_mce_pending, struct vcpu, arch.mce_state.pending);
     OFFSET(VCPU_mce_old_mask, struct vcpu, arch.mce_state.old_mask);
     OFFSET(VCPU_async_exception_mask, struct vcpu, arch.async_exception_mask);
     DEFINE(VCPU_TRAP_NMI, VCPU_TRAP_NMI);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472437.1680305 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgOe-0003z6-DL; Wed, 04 Nov 2026 19:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472437.1680305; Wed, 04 Nov 2026 19: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 1xOgOe-0003yy-AZ; Wed, 04 Nov 2026 19:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1472437;
 Wed, 04 Nov 2026 19:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgOc-0003yq-GL
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOc-0000000EmfV-1z8T
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOc-00000007vQB-1npI
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=acHo0Wf8p+PyuvHNHYRcVGGdvus/LObLKDhMksFRNL8=; b=35h9EU3fUwzi5AW7OGjDY3iXN+
	oi8L2rpJvItKpkLPKhZMdGHcjrlO+OejUR9yoJVOXDFRtm3AhG8INM8uw3g3s4OctEYQbzhrRmDj5
	LaOiBP/0OKqrSEqFY0Oj0OVRJ2Q5ixIHlYDuFp/0piqXG3FDtfQfoJSk6tWUkWKbuFqE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Improve code generation in async_exception_cleanup()
Message-Id: <E1xOgOc-00000007vQB-1npI@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:11:42 +0000

commit fcc3289cdf18c5ae5d7b066f7c6c82c188f7e679
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 16:22:11 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/pv: Improve code generation in async_exception_cleanup()
    
    Use new helpers to simplfiy the logic.  No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/iret.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/iret.c b/xen/arch/x86/pv/iret.c
index 39ce316b8d..52430f38d2 100644
--- a/xen/arch/x86/pv/iret.c
+++ b/xen/arch/x86/pv/iret.c
@@ -31,8 +31,8 @@ static void async_exception_cleanup(struct vcpu *curr)
     if ( !curr->arch.async_exception_mask )
         return;
 
-    if ( !(curr->arch.async_exception_mask & (curr->arch.async_exception_mask - 1)) )
-        trap = __scanbit(curr->arch.async_exception_mask, VCPU_TRAP_NONE);
+    if ( !multiple_bits_set(curr->arch.async_exception_mask) )
+        trap = ffs(curr->arch.async_exception_mask) - 1;
     else
         for ( trap = VCPU_TRAP_NONE + 1; trap <= VCPU_TRAP_LAST; ++trap )
             if ( (curr->arch.async_exception_mask ^
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472438.1680309 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgOo-00041W-FL; Wed, 04 Nov 2026 19:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472438.1680309; Wed, 04 Nov 2026 19: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 1xOgOo-00041O-Cd; Wed, 04 Nov 2026 19:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1472438;
 Wed, 04 Nov 2026 19:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgOm-00041F-JX
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOm-0000000Emfb-2Nzb
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOm-00000007vXs-2FIz
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:11:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N0Jni6l3x84SY4Jh8Kk0vn0895Dmt9auk/Z2bdl83us=; b=d/wZvTf82FhanAnJpMGMjKKOZs
	ivsO0hLaZz1BqNaNwMnOfev7/7pR0YrpgiLfqy4+wMpTGhsV5uoRpnXBCHF0Nq2dOURZggAhmQBi4
	0ig98vYKHbYugczJo3u0V8L+uPc3olPlWi2T5owzyPdEzBA3LqGqCd1sN5X0/ApE7s9k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Remove ioio_info_t type
Message-Id: <E1xOgOm-00000007vXs-2FIz@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:11:52 +0000

commit 8d436bf73e68dd3cf4d148e6313e642ab5dda412
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 15:02:45 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Remove ioio_info_t type
    
    This type duplicates what is already in the VMCB struct. Remove it and
    have the only user access the VMCB directly.
    
    No functional change intended.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 13 +++++--------
 xen/arch/x86/hvm/svm/vmcb.h      | 17 -----------------
 2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 128008321d..61c401240d 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -809,18 +809,16 @@ nsvm_vmcb_guest_intercepts_msr(unsigned long *msr_bitmap,
 }
 
 static int
-nsvm_vmcb_guest_intercepts_ioio(paddr_t iopm_pa, uint64_t exitinfo1)
+nsvm_vmcb_guest_intercepts_ioio(struct vmcb_struct *vmcb)
 {
-    unsigned long gfn = iopm_pa >> PAGE_SHIFT;
+    unsigned long gfn = vmcb->_iopm_base_pa >> PAGE_SHIFT;
     unsigned long *io_bitmap;
-    ioio_info_t ioinfo;
     uint16_t port;
     unsigned int size;
     bool intercepted;
 
-    ioinfo.bytes = exitinfo1;
-    port = ioinfo.fields.port;
-    size = ioinfo.fields.sz32 ? 4 : ioinfo.fields.sz16 ? 2 : 1;
+    port = vmcb->ei.io.port;
+    size = vmcb->ei.io.bytes;
 
     switch ( port )
     {
@@ -930,8 +928,7 @@ nsvm_vmcb_guest_intercepts_exitcode(struct vcpu *v,
         if ( !nestedsvm_vmcb_map(v, nv->nv_vvmcxaddr) )
             break;
         ns_vmcb = nv->nv_vvmcx;
-        vmexits = nsvm_vmcb_guest_intercepts_ioio(ns_vmcb->_iopm_base_pa,
-            ns_vmcb->exitinfo1);
+        vmexits = nsvm_vmcb_guest_intercepts_ioio(ns_vmcb);
         if ( vmexits == NESTEDHVM_VMEXIT_HOST )
             return 0;
         break;
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 28dae325ce..131815a712 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -352,23 +352,6 @@ typedef union
     } fields;
 } vintr_t;
 
-typedef union
-{
-    u64 bytes;
-    struct
-    {
-        u64 type: 1;
-        u64 rsv0: 1;
-        u64 str:  1;
-        u64 rep:  1;
-        u64 sz8:  1;
-        u64 sz16: 1;
-        u64 sz32: 1;
-        u64 rsv1: 9;
-        u64 port: 16;
-    } fields;
-} ioio_info_t;
-
 typedef union
 {
     u64 bytes;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:12:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472439.1680313 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgOy-00043R-Gg; Wed, 04 Nov 2026 19:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472439.1680313; Wed, 04 Nov 2026 19:12:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgOy-00043J-Dz; Wed, 04 Nov 2026 19:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1472439;
 Wed, 04 Nov 2026 19:12:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgOw-00043B-NE
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:12:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOw-0000000Emfx-2qVS
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgOw-00000007vfq-2hH6
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:12:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mEKG0s7mpJpgLftIqIfb9Pxja5LaY4WA3G0ePgK+gq8=; b=0wC1folIvZRb00FwxI8lZHca7D
	QjcBW/on5GXaWD+kibsy2m1otEXX9Zbbi4ILC4otQNmjZeGOfS03u7+kI07jjVzT23GsOPo1Y5ory
	Q0G//8RdVyH/DaPhaifGPIpvXDwkyYmyqBop6whclF1Xl0SgOKkqVCouGBZ132Psy89A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Cleanup virt_ext_t type
Message-Id: <E1xOgOw-00000007vfq-2hH6@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:12:02 +0000

commit dc5813a9c46317f2fde7df2f3899a6237e5fe066
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 15:02:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Cleanup virt_ext_t type
    
    Rearrange the union to drop the .fields infix, rename bytes to the more
    common raw, adjust types where appropriate, and simplify some names.
    Adjust the users accordingly.
    
    No functional change intended.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 12 +++++-------
 xen/arch/x86/hvm/svm/svm.c       |  2 +-
 xen/arch/x86/hvm/svm/vmcb.c      |  2 +-
 xen/arch/x86/hvm/svm/vmcb.h      |  8 ++++----
 4 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 61c401240d..a21d6f24a7 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -442,8 +442,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     /* Pending Interrupts */
     n2vmcb->event_inj = ns_vmcb->event_inj;
 
-    n2vmcb->virt_ext.bytes =
-        n1vmcb->virt_ext.bytes | ns_vmcb->virt_ext.bytes;
+    n2vmcb->virt_ext.raw = n1vmcb->virt_ext.raw | ns_vmcb->virt_ext.raw;
 
     /*
      * NextRIP is consumed on VMRUN as the return address pushed on the
@@ -1536,10 +1535,9 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
      */
     if ( nsvm_efer_svm_enabled(v) )
     {
-        if ( !vmcb->virt_ext.fields.vloadsave_enable &&
-             cpu_has_svm_vloadsave )
+        if ( !vmcb->virt_ext.vloadsave_en && cpu_has_svm_vloadsave )
         {
-            vmcb->virt_ext.fields.vloadsave_enable = 1;
+            vmcb->virt_ext.vloadsave_en = true;
             general2_intercepts  = vmcb_get_general2_intercepts(vmcb);
             general2_intercepts &= ~(GENERAL2_INTERCEPT_VMLOAD |
                                      GENERAL2_INTERCEPT_VMSAVE);
@@ -1561,9 +1559,9 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
     }
     else
     {
-        if ( vmcb->virt_ext.fields.vloadsave_enable )
+        if ( vmcb->virt_ext.vloadsave_en )
         {
-            vmcb->virt_ext.fields.vloadsave_enable = 0;
+            vmcb->virt_ext.vloadsave_en = false;
             general2_intercepts  = vmcb_get_general2_intercepts(vmcb);
             general2_intercepts |= (GENERAL2_INTERCEPT_VMLOAD |
                                     GENERAL2_INTERCEPT_VMSAVE);
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 57779806bf..666bcd3eb4 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1938,7 +1938,7 @@ static int cf_check svm_msr_write_intercept(
         vmcb_set_debugctlmsr(vmcb, msr_content);
         if ( !msr_content || !cpu_has_svm_lbrv )
             break;
-        vmcb->virt_ext.fields.lbr_enable = 1;
+        vmcb->virt_ext.lbr_en = true;
         svm_disable_intercept_for_msr(v, MSR_IA32_DEBUGCTLMSR);
         svm_disable_intercept_for_msr(v, MSR_IA32_LASTBRANCHFROMIP);
         svm_disable_intercept_for_msr(v, MSR_IA32_LASTBRANCHTOIP);
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index a6f09672a7..33c85ea3bf 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -291,7 +291,7 @@ void svm_vmcb_dump(const char *from, const struct vmcb_struct *vmcb)
            vmcb_get_sev(vmcb)    ? " SEV"    : "",
            vmcb_get_sev_es(vmcb) ? " SEV_ES" : "");
     printk("virtual vmload/vmsave = %d, virt_ext = %#"PRIx64"\n",
-           vmcb->virt_ext.fields.vloadsave_enable, vmcb->virt_ext.bytes);
+           vmcb->virt_ext.vloadsave_en, vmcb->virt_ext.raw);
     printk("cpl = %d efer = %#"PRIx64" star = %#"PRIx64" lstar = %#"PRIx64"\n",
            vmcb_get_cpl(vmcb), vmcb_get_efer(vmcb), vmcb->star, vmcb->lstar);
     printk("CR0 = 0x%016"PRIx64" CR2 = 0x%016"PRIx64"\n",
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 131815a712..8b351679fa 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -354,12 +354,12 @@ typedef union
 
 typedef union
 {
-    u64 bytes;
     struct
     {
-        u64 lbr_enable:1;
-        u64 vloadsave_enable:1;
-    } fields;
+        bool lbr_en:1;
+        bool vloadsave_en:1;
+    };
+    uint64_t raw;
 } virt_ext_t;
 
 typedef union
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:12:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472440.1680317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgP8-00045W-Hv; Wed, 04 Nov 2026 19:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472440.1680317; Wed, 04 Nov 2026 19: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 1xOgP8-00045O-FK; Wed, 04 Nov 2026 19:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1472440;
 Wed, 04 Nov 2026 19:12:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgP6-00045F-Qn
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:12:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgP6-0000000Emg3-3L6a
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgP6-00000007vkL-36yq
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:12:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uOj+ejhmYMDVzjjNCJTPSv/SJCa2XGBxnnTUO5dDXfo=; b=CjiMArtFcpXWLTAB1BhEoi2Ptx
	V4asRDpCJMzTpV9cCq4Kf/slFQ9LklGMPwTITN8GmXbLJaAs2FPpFVOeK/52WYm2/A6C1Ef7tsFrn
	cHjk7BsWlbdviOeExkh11vakjNEjflJS3xVFBvcljIegn63FRdEKBqsjNwFKqk730Vnk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Cleanup ns_hostflags type
Message-Id: <E1xOgP6-00000007vkL-36yq@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:12:12 +0000

commit eed66b0907a637ca08ee32ea773ed851d31ed729
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Sep 28 15:02:48 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    x86/svm: Cleanup ns_hostflags type
    
    Rearrange the union to drop the .fields infix, rename bytes to the more
    common raw, and adjust types where appropriate. Adjust the users
    accordingly.
    
    No functional change intended.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c         | 11 +++++------
 xen/arch/x86/include/asm/hvm/svm-types.h |  9 ++++-----
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index a21d6f24a7..d970869cfd 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -151,7 +151,7 @@ int cf_check nsvm_vcpu_reset(struct vcpu *v)
     svm->ns_vmcb_guestcr3 = 0;
     svm->ns_vmcb_hostcr3 = 0;
     svm->ns_asid = 0;
-    svm->ns_hostflags.bytes = 0;
+    svm->ns_hostflags.raw = 0;
     svm->ns_vmexit.exitinfo1 = 0;
     svm->ns_vmexit.exitinfo2 = 0;
 
@@ -182,7 +182,7 @@ static int nsvm_vcpu_hostsave(struct vcpu *v, unsigned int inst_len)
     n1vmcb->_cr4 = v->arch.hvm.guest_cr[4];
 
     /* Remember the host interrupt flag */
-    svm->ns_hostflags.fields.rflagsif = !!(n1vmcb->rflags & X86_EFLAGS_IF);
+    svm->ns_hostflags.rflagsif = n1vmcb->rflags & X86_EFLAGS_IF;
 
     return 0;
 }
@@ -637,7 +637,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs *regs,
     svm->ns_hap_enabled = vmcb_get_np(ns_vmcb);
 
     /* Remember the V_INTR_MASK in hostflags */
-    svm->ns_hostflags.fields.vintrmask = !!ns_vmcb->_vintr.fields.intr_masking;
+    svm->ns_hostflags.vintrmask = ns_vmcb->_vintr.fields.intr_masking;
 
     /* Save l1 guest state (= host state) */
     ret = nsvm_vcpu_hostsave(v, inst_len);
@@ -978,7 +978,7 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 
     /* Virtual Interrupts */
     ns_vmcb->_vintr = n2vmcb->_vintr;
-    if ( !svm->ns_hostflags.fields.vintrmask )
+    if ( !svm->ns_hostflags.vintrmask )
         ns_vmcb->_vintr.fields.intr_masking = 0;
 
     /* Interrupt state */
@@ -1159,8 +1159,7 @@ enum hvm_intblk cf_check nsvm_intr_blocked(struct vcpu *v)
     {
         struct vmcb_struct *n2vmcb = nv->nv_n2vmcx;
 
-        if ( svm->ns_hostflags.fields.vintrmask &&
-             !svm->ns_hostflags.fields.rflagsif )
+        if ( svm->ns_hostflags.vintrmask && !svm->ns_hostflags.rflagsif )
             return hvm_intblk_rflags_ie;
 
         /* when l1 guest passes its devices through to the l2 guest
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index beab9a3af2..71427b3c11 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -77,12 +77,11 @@ struct nestedsvm {
     } ns_vmexit;
 
     union {
-        uint32_t bytes;
         struct {
-            uint32_t rflagsif:1;
-            uint32_t vintrmask:1;
-            uint32_t reserved:30;
-        } fields;
+            bool rflagsif:1;
+            bool vintrmask:1;
+        };
+        uint32_t raw;
     } ns_hostflags;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Nov 04 19:12:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2026 19:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1472441.1680322 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgPI-00049z-Jr; Wed, 04 Nov 2026 19:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1472441.1680322; Wed, 04 Nov 2026 19:12:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOgPI-00049p-Ge; Wed, 04 Nov 2026 19:12:24 +0000
Received: by outflank-mailman (input) for mailman id 1472441;
 Wed, 04 Nov 2026 19:12:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOgPG-00049g-UG
 for xen-changelog@lists.xenproject.org; Wed, 04 Nov 2026 19:12:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgPG-0000000EmgN-3jfJ
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOgPG-00000007vqr-3bQe
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Nov 2026 19:12:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q70wbuYnJR2gL0CFs9EHX7zwGkKpzQXKc9l4d+acIuA=; b=tuIi1Z9Ww4agkTSCbVN9puWEdR
	1w5P38ZGw4L8zaSzneFKBghswNjuHC2BiXcZTmCjSAF/aKoOmhY2b3QG+2KRxN5GefK6KfCJRmuhO
	QHo6sSnPMQgqCnFtFfKwgE5fIMg+qlPjNIRWjIZIaFFiqOjLMIqnBKuATGZ6JOA3YPgQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/gnttab: Drop owner->grant_table check in _cache_flush()
Message-Id: <E1xOgPG-00000007vqr-3bQe@xenbits.xenproject.org>
Date: Wed, 04 Nov 2026 19:12:22 +0000

commit bec8e3c1fb91b96f337c08c6daf1bb2563b320c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Sep 28 20:05:01 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Nov 4 18:11:35 2026 +0000

    xen/gnttab: Drop owner->grant_table check in _cache_flush()
    
    The "owner && !owner->grant_table" case needs a put_page() in it's error path.
    
    In Xen 4.20 and earlier, this was addressed by XSA-520.  Since the addition of
    CONFIG_HAS_GRANT_CACHE_FLUSH in Xen 4.21, this path is only reachable on ARM,
    and system domains on ARM do not own any memory.
    
    Therefore delete the check, rather than inserting unreachable error handling.
    
    No functional change.
    
    This issue was also independently reported by Yehyeong Lee as the security
    team was already working on XSA-519/520.
    
    Reported-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 5e79c012b6..2285c4aee8 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3633,7 +3633,7 @@ static int _cache_flush(gnttab_cache_flush_t *cflush, grant_ref_t *cur_ref)
 
     page = mfn_to_page(mfn);
     owner = page_get_owner_and_reference(page);
-    if ( !owner || !owner->grant_table )
+    if ( !owner )
     {
         rcu_unlock_domain(d);
         return -EPERM;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 08:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 08:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474173.1681349 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOsjT-0005tG-A2; Thu, 05 Nov 2026 08:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474173.1681349; Thu, 05 Nov 2026 08:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOsjT-0005t9-6z; Thu, 05 Nov 2026 08:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1474173;
 Thu, 05 Nov 2026 08:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOsjS-0005t3-64
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 08:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOsjS-0000000GbQy-0OZK
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 08:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOsjS-0000000F8qw-0Csp
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 08:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tJcqvZaCO9PcWi64JWd26farJmjCbGJLw8XIIFwBrVI=; b=5C1tpPglio7FNSWQ4VwfhBCuaM
	Ht5dOXFZ8DOKHAov060xDcEsq6NS7ztUv2A14M93vBVDec/NnNT5ppuRNCq1QmCAnhjif3inxgnZW
	gjQj06iEjdkRNzqEQ17KxBWaGK7CWPIkERX5ebtdrsj7Saqr++c8wmihrA71aOQws3u8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] gnttab: complete checking in gnttab_copy_buf_valid()
Message-Id: <E1xOsjS-0000000F8qw-0Csp@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 08:22:02 +0000

commit 955b12ea84fdfd84cf183b30708d4162642ab58d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:07:17 2026 +0000

    gnttab: complete checking in gnttab_copy_buf_valid()
    
    The ->have_grant field needs checking not only ahead of comparing GREFs,
    but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
    earlier batch element can be mistaken for a (possibly valid) MFN.
    
    This is CVE-2026-102703, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff)
---
 xen/common/grant_table.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 742c9797c5..842d436848 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3081,10 +3081,10 @@ static bool_t gnttab_copy_buf_valid(const struct gnttab_copy_ptr *p,
                                     const struct gnttab_copy_buf *b,
                                     bool_t has_gref)
 {
-    if ( !b->virt )
+    if ( !b->virt || b->have_grant != has_gref )
         return 0;
     if ( has_gref )
-        return b->have_grant && p->u.ref == b->ptr.u.ref;
+        return p->u.ref == b->ptr.u.ref;
     return p->u.gmfn == b->ptr.u.gmfn;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 08:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 08:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474174.1681354 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOsjd-0005v8-Bb; Thu, 05 Nov 2026 08:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474174.1681354; Thu, 05 Nov 2026 08:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOsjd-0005v1-8R; Thu, 05 Nov 2026 08:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1474174;
 Thu, 05 Nov 2026 08:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOsjc-0005uo-88
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 08:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOsjc-0000000GbR4-0qaY
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 08:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOsjc-0000000F8vB-0fgI
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 08:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9ygN5Ok2590YAmTu/copq3qYvxmiPXA5m6mNP0cHtdI=; b=nye1FGjNxU9R7i0zclhTmzX+iO
	zDJiZ7rk9FIim2qERp60ch09UEhd4K4GBr9nJwYeBwW7FCo30SDJtcPfKBFPbC+mG1oO5wTF5bR3x
	Qo9OLOJtyfppFbVCbXWxyg027VFAi6Rwtt5NtLTaSuYZ+ErqAHMDhPQZR8E0EyL6D3gE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] gnttab: move "only local domain may copy by frame" check
Message-Id: <E1xOsjc-0000000F8vB-0fgI@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 08:22:12 +0000

commit 3f6f7a73c6963bc81230470487e46665f6275af1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 12:07:06 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Nov 3 12:07:27 2026 +0000

    gnttab: move "only local domain may copy by frame" check
    
    gnttab_copy_one() calls gnttab_copy_lock_domain{s,}() only conditionally.
    The non-GREF check towards the requestor being DOMID_SELF, however, needs
    doing on every batch element. Move the check into gnttab_copy_claim_buf()
    to achieve that.
    
    This is CVE-2026-102704, part of XSA-523.
    
    Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a grant copy")
    Assisted-by: Claude
    Reported-by: Stephan Lipp <Stephan@Adalogics.com>
    Reported-by: CodeAnt AI Security Research <securityresearch@codeant.ai>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    (cherry picked from commit cd4d68f86cb111e2ea0a17cfb4fb8cd9c6c69e83)
---
 xen/common/grant_table.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 842d436848..03543fc335 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2934,13 +2934,8 @@ struct gnttab_copy_buf {
     bool_t have_type;
 };
 
-static int gnttab_copy_lock_domain(domid_t domid, bool is_gref,
-                                   struct gnttab_copy_buf *buf)
+static int gnttab_copy_lock_domain(domid_t domid, struct gnttab_copy_buf *buf)
 {
-    /* Only DOMID_SELF may reference via frame. */
-    if ( domid != DOMID_SELF && !is_gref )
-        return GNTST_permission_denied;
-
     buf->domain = rcu_lock_domain_by_any_id(domid);
 
     if ( !buf->domain )
@@ -2972,12 +2967,10 @@ static int gnttab_copy_lock_domains(const struct gnttab_copy *op,
 {
     int rc;
 
-    rc = gnttab_copy_lock_domain(op->source.domid,
-                                 op->flags & GNTCOPY_source_gref, src);
+    rc = gnttab_copy_lock_domain(op->source.domid, src);
     if ( rc < 0 )
         goto error;
-    rc = gnttab_copy_lock_domain(op->dest.domid,
-                                 op->flags & GNTCOPY_dest_gref, dest);
+    rc = gnttab_copy_lock_domain(op->dest.domid, dest);
     if ( rc < 0 )
         goto error;
 
@@ -3040,6 +3033,9 @@ static int gnttab_copy_claim_buf(const struct gnttab_copy *op,
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
     }
+    /* Only DOMID_SELF may reference via frame. */
+    else if ( ptr->domid != DOMID_SELF )
+        return GNTST_permission_denied;
     else
     {
         rc = get_paged_frame(ptr->u.gmfn, &buf->mfn, &buf->page,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 10:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 10:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474366.1681499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOubb-0005mT-3X; Thu, 05 Nov 2026 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474366.1681499; Thu, 05 Nov 2026 10:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOuba-0005lp-Tu; Thu, 05 Nov 2026 10:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1474366;
 Thu, 05 Nov 2026 10:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOubZ-0005jm-UQ
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 10:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOubZ-0000000GeQk-3YeK
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOubZ-0000000G9by-3JwE
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0GQrIyUCqgxfUbsuTXhZoDKZUaXH7kfIHhjObJnJpjI=; b=bJEhmh/D9qCnnOj6lVNv+rWlLU
	vF1y3Krk163MthCdFnZnBz7WBSY7OZvgVUyBG8jRoA4YfQ//VphBdPiFhJCp1rov4UAcrkNpx3x87
	UKLga7rhXNQbJ7r391nb9PxfSSXFPp8cqQaSYOftOWBKo1/wQDyJ8kFfebZGGTmJvogs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] lib: make memchr_inv() compliant with Misra rule 11.8
Message-Id: <E1xOubZ-0000000G9by-3JwE@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 10:22:01 +0000

commit 9e4bca2fae2a849bd25fefd7c0c645fb5821e056
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 5 09:47:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:47:43 2026 +0100

    lib: make memchr_inv() compliant with Misra rule 11.8
    
    Neither the sole present caller nor the two ones pending (in the AMX/ACE
    series on x86) require the casting away of constness.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
 xen/include/xen/string.h | 2 +-
 xen/lib/memchr_inv.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/string.h b/xen/include/xen/string.h
index 0ad65303da..6e077f0a03 100644
--- a/xen/include/xen/string.h
+++ b/xen/include/xen/string.h
@@ -33,7 +33,7 @@ void *memcpy(void *dest, const void *src, size_t n);
 void *memmove(void *dest, const void *src, size_t n);
 int memcmp(const void *cs, const void *ct, size_t count);
 void *memchr(const void *s, int c, size_t n);
-void *memchr_inv(const void *s, int c, size_t n);
+const void *memchr_inv(const void *s, int c, size_t n);
 
 #include <asm/string.h>
 
diff --git a/xen/lib/memchr_inv.c b/xen/lib/memchr_inv.c
index 1bf6cb6ee0..e082e09a54 100644
--- a/xen/lib/memchr_inv.c
+++ b/xen/lib/memchr_inv.c
@@ -13,13 +13,13 @@
  * returns the address of the first occurrence of a character other than @c,
  * or %NULL if the whole buffer contains just @c.
  */
-void *memchr_inv(const void *s, int c, size_t n)
+const void *memchr_inv(const void *s, int c, size_t n)
 {
 	const unsigned char *p = s;
 
 	while (n--)
 		if ((unsigned char)c != *p++)
-			return (void *)(p - 1);
+			return p - 1;
 
 	return NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 10:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474368.1681504 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOubl-00063r-6S; Thu, 05 Nov 2026 10:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474368.1681504; Thu, 05 Nov 2026 10:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOubl-00063j-3c; Thu, 05 Nov 2026 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1474368;
 Thu, 05 Nov 2026 10:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOubj-000631-W8
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 10:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOubj-0000000GeRB-42AO
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOubj-0000000G9j1-3oMF
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=85GdtKS445FgNGjlY/PI/8D3cYlg2+r5Xg8351jmDns=; b=fGxOzReAT4K8gB9KXxhsiSfxtZ
	mxL9ThBhobVUmYYgNN8mKZj0C0jBbIdhXRt/l+LJ3Hr8gnLd+imfBwJKFZ47Uj+3nUztAR7O9Q40z
	aGK4kdFNSklUbNny78GbxM5ug57mV9GqKHBnqAtukf1mlcFWLDVSkWmmIdxZfcc/AsVc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/platform: fix the MTRR rollback in XENPF_add_memtype
Message-Id: <E1xOubj-0000000G9j1-3oMF@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 10:22:11 +0000

commit 0fb2c553148e84444a4df523283e7bf4811c4c6f
Author:     Yuho Choi <oss.patchbox@gmail.com>
AuthorDate: Thu Nov 5 09:48:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:48:44 2026 +0100

    x86/platform: fix the MTRR rollback in XENPF_add_memtype
    
    If copying the result back to the caller fails, XENPF_add_memtype
    tries to undo mtrr_add_page() with mtrr_del_page(ret, 0, 0). By then
    ret holds -EFAULT, so mtrr_del_page() looks up an MTRR with base and
    size 0 and releases nothing. The register that was added, or whose
    usage count was raised, stays in use, and the caller only gets
    -EFAULT, without the register number it would need to delete it.
    
    Pass the register number saved in op->u.add_memtype.reg instead.
    
    Fixes: 8ee614278c2d ("[XEN] Fix memtype accessor domctls.")
    Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 6dee4922f3..0f3c791fc2 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -295,7 +295,7 @@ ret_t do_platform_op(
             ret = __copy_field_to_guest(u_xenpf_op, op, u.add_memtype) ?
                   -EFAULT : 0;
             if ( ret != 0 )
-                mtrr_del_page(ret, 0, 0);
+                mtrr_del_page(op->u.add_memtype.reg, 0, 0);
         }
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 10:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 10:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474369.1681509 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOubv-0006Cm-8A; Thu, 05 Nov 2026 10:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474369.1681509; Thu, 05 Nov 2026 10:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOubv-0006Ce-5M; Thu, 05 Nov 2026 10:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1474369;
 Thu, 05 Nov 2026 10:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOubu-00068f-3F
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 10:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOubu-0000000GeRG-0HNO
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOubu-0000000G9mE-04v9
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UewiGGOcHmqTNgsh93+O3VKlkdn+OmjGMLwvZjFnjto=; b=6bHsDBCg4f9eVCOVszOptMKs2w
	TVZDqzbXyzqtNSFefL5GDgF33IcBe/whZMDHhf/yPrnI5KI2rgCatQZXpdIz1QvKVnEZw7DTK8ZZx
	0ZhzcA5kIVoWZSPGQD5tIWs/IkG6+Q1YEumjGISF3IXaLh2YSM+qMbKzWalhNqiEVY8M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: apic: use APIC_EOI_ACK instead of open-coded 0
Message-Id: <E1xOubu-0000000G9mE-04v9@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 10:22:22 +0000

commit 5081b6649809e0eb54111bff56ea84035a490134
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Nov 5 09:49:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:49:07 2026 +0100

    x86: apic: use APIC_EOI_ACK instead of open-coded 0
    
    Use the symbolic value in ack_APIC_irq() instead of open-coded 0.
    
    Also, correct the EIO -> EOI typo in the constant name.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/apic.h    | 3 +--
 xen/arch/x86/include/asm/apicdef.h | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index f30d57ad22..a4f6d2c26c 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -155,8 +155,7 @@ void apic_wait_icr_idle(void);
 
 static inline void ack_APIC_irq(void)
 {
-	/* Docs say use 0 for future compatibility */
-	apic_write(APIC_EOI, 0);
+	apic_write(APIC_EOI, APIC_EOI_ACK);
 }
 
 extern int get_maxlvt(void);
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index 112c1dc613..d3dc7b1d76 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -25,7 +25,7 @@
 #define			APIC_ARBPRI_MASK	0xFF
 #define		APIC_PROCPRI	0xA0
 #define		APIC_EOI	0xB0
-#define			APIC_EIO_ACK		0x0		/* Write this to the EOI register */
+#define			APIC_EOI_ACK		0x0		/* Docs say use 0 for future compatibility */
 #define		APIC_RRR	0xC0
 #define		APIC_LDR	0xD0
 #define			APIC_LDR_MASK		(0xFFu<<24)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 10:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 10:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474375.1681514 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOuc5-0006MV-9q; Thu, 05 Nov 2026 10:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474375.1681514; Thu, 05 Nov 2026 10:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOuc5-0006MN-6f; Thu, 05 Nov 2026 10:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1474375;
 Thu, 05 Nov 2026 10:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOuc4-0006KR-6Q
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 10:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOuc4-0000000GeRK-0hDX
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOuc4-0000000G9vN-0X3b
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 10:22:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TMGkfxlaGRbNKQWNHtWFqtaZIdB54mCS6lj3oC45w34=; b=0ytJBQYuUMWP+FizlMx2G9Lrox
	CHs7PBaJmGjACpOnxmRI0ztRp5MEPWrxRTwyrzBLmTrB5OmDkSaUB58NIIcRtVo05jQvtlTMLLSbu
	SmgW3yrc/QmHv/PomwktlFEGLSUB6qPCRgEA5REZnp0pIN6v02JIjgr7WpWCkJJHJBGM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: fix typo s/interruopt/interrupt/
Message-Id: <E1xOuc4-0000000G9vN-0X3b@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 10:22:32 +0000

commit c4a09c112c391ffc1aea33afff49ffb28156fbdb
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Nov 5 09:49:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:49:34 2026 +0100

    x86/time: fix typo s/interruopt/interrupt/
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index f37fddc61e..0e5d06a9a8 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -207,7 +207,7 @@ static void cf_check timer_interrupt(int irq, void *dev_id)
     if ( hpet_legacy_irq_tick() )
         return;
 
-    /* Only for start-of-day interruopt tests in io_apic.c. */
+    /* Only for start-of-day interrupt tests in io_apic.c. */
     pit0_ticks++;
 
     /* Rough hack to allow accurate timers to sort-of-work with no APIC. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 11:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 11:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474449.1681561 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvN1-0002Vi-O1; Thu, 05 Nov 2026 11:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474449.1681561; Thu, 05 Nov 2026 11:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvN1-0002Va-LP; Thu, 05 Nov 2026 11:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1474449;
 Thu, 05 Nov 2026 11:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOvMz-0002VT-L0
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 11:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvMz-0000000GfRD-2RHH
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvMz-0000000GWVk-28o2
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11: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=0i5eJr+xb9OhqXUVKSo2lTN8hGfyFonFEC1rCmC9mT8=; b=ZxQKQ+p2SNkgbqTamPwVV8SDe8
	NYisPVhd6jcbocuMmIkBbN1rxBjBc0u3x4PLX/LmOUhYLGgKr6Nk6GFx45JXgljl/wpANVgVzliz/
	S7q7iH51GyUnR/Coi8aRnfeB+ITgUlvALTpDy6IauFT+R6Bbh05n1fQfSPAT1KA8BiJg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] lib: make memchr_inv() compliant with Misra rule 11.8
Message-Id: <E1xOvMz-0000000GWVk-28o2@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 11:11:01 +0000

commit 9e4bca2fae2a849bd25fefd7c0c645fb5821e056
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 5 09:47:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:47:43 2026 +0100

    lib: make memchr_inv() compliant with Misra rule 11.8
    
    Neither the sole present caller nor the two ones pending (in the AMX/ACE
    series on x86) require the casting away of constness.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
 xen/include/xen/string.h | 2 +-
 xen/lib/memchr_inv.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/string.h b/xen/include/xen/string.h
index 0ad65303da..6e077f0a03 100644
--- a/xen/include/xen/string.h
+++ b/xen/include/xen/string.h
@@ -33,7 +33,7 @@ void *memcpy(void *dest, const void *src, size_t n);
 void *memmove(void *dest, const void *src, size_t n);
 int memcmp(const void *cs, const void *ct, size_t count);
 void *memchr(const void *s, int c, size_t n);
-void *memchr_inv(const void *s, int c, size_t n);
+const void *memchr_inv(const void *s, int c, size_t n);
 
 #include <asm/string.h>
 
diff --git a/xen/lib/memchr_inv.c b/xen/lib/memchr_inv.c
index 1bf6cb6ee0..e082e09a54 100644
--- a/xen/lib/memchr_inv.c
+++ b/xen/lib/memchr_inv.c
@@ -13,13 +13,13 @@
  * returns the address of the first occurrence of a character other than @c,
  * or %NULL if the whole buffer contains just @c.
  */
-void *memchr_inv(const void *s, int c, size_t n)
+const void *memchr_inv(const void *s, int c, size_t n)
 {
 	const unsigned char *p = s;
 
 	while (n--)
 		if ((unsigned char)c != *p++)
-			return (void *)(p - 1);
+			return p - 1;
 
 	return NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 11:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 11:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474450.1681565 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvNB-0002Zs-PH; Thu, 05 Nov 2026 11:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474450.1681565; Thu, 05 Nov 2026 11:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvNB-0002Zk-Mh; Thu, 05 Nov 2026 11:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1474450;
 Thu, 05 Nov 2026 11: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 1xOvN9-0002YW-Nt
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 11:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvN9-0000000GfRa-2xWR
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvN9-0000000GWay-2hys
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11: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=p4cDTP3Ev6t6tKafH2EV/bYowft1JqHmF/Koadtt3e4=; b=07Re52MxwpVLazQC2E94cCw/zk
	2V2AQ7773N2pv5ENK6IyB/Nt4KjDQtxRxol2s8r4JvDqBYuACelY8UufkcAU9FH5+YamPoUVJ9h1J
	m3AAuyYgC0oaFLEgcM4TnQ4HZuSjAkp1CP9e88Qe6dDxbDwzZH4wfhMALOD32cu6HFpY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/platform: fix the MTRR rollback in XENPF_add_memtype
Message-Id: <E1xOvN9-0000000GWay-2hys@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 11:11:11 +0000

commit 0fb2c553148e84444a4df523283e7bf4811c4c6f
Author:     Yuho Choi <oss.patchbox@gmail.com>
AuthorDate: Thu Nov 5 09:48:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:48:44 2026 +0100

    x86/platform: fix the MTRR rollback in XENPF_add_memtype
    
    If copying the result back to the caller fails, XENPF_add_memtype
    tries to undo mtrr_add_page() with mtrr_del_page(ret, 0, 0). By then
    ret holds -EFAULT, so mtrr_del_page() looks up an MTRR with base and
    size 0 and releases nothing. The register that was added, or whose
    usage count was raised, stays in use, and the caller only gets
    -EFAULT, without the register number it would need to delete it.
    
    Pass the register number saved in op->u.add_memtype.reg instead.
    
    Fixes: 8ee614278c2d ("[XEN] Fix memtype accessor domctls.")
    Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 6dee4922f3..0f3c791fc2 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -295,7 +295,7 @@ ret_t do_platform_op(
             ret = __copy_field_to_guest(u_xenpf_op, op, u.add_memtype) ?
                   -EFAULT : 0;
             if ( ret != 0 )
-                mtrr_del_page(ret, 0, 0);
+                mtrr_del_page(op->u.add_memtype.reg, 0, 0);
         }
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 11:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 11:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474451.1681571 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvNL-0002bs-Qv; Thu, 05 Nov 2026 11:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474451.1681571; Thu, 05 Nov 2026 11:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvNL-0002bj-O3; Thu, 05 Nov 2026 11:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1474451;
 Thu, 05 Nov 2026 11:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOvNJ-0002bb-Rd
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 11:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvNJ-0000000GfRj-3QgF
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvNJ-0000000GWd7-3D7x
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11: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=wHfO/Tk2BVO0KhxCrxPpjoFpIR/Sl0970P3UeI8Eg/k=; b=CX1l/Phq7uR2kfXAsd8doU/QWW
	EVaHDO2MAKhPcOncXcPRukIrIEXEe87FzsO3BuLtual51PNA6r4JF7EbTD3/3AIK+/1LdFC50yT6/
	/EH33fOcsk4jA9MXIKVJHKlBHteEyq4IL+A4waog2H6PSQVdVZqzrt3cPYJFVgICahAg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: apic: use APIC_EOI_ACK instead of open-coded 0
Message-Id: <E1xOvNJ-0000000GWd7-3D7x@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 11:11:21 +0000

commit 5081b6649809e0eb54111bff56ea84035a490134
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Nov 5 09:49:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:49:07 2026 +0100

    x86: apic: use APIC_EOI_ACK instead of open-coded 0
    
    Use the symbolic value in ack_APIC_irq() instead of open-coded 0.
    
    Also, correct the EIO -> EOI typo in the constant name.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/apic.h    | 3 +--
 xen/arch/x86/include/asm/apicdef.h | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h
index f30d57ad22..a4f6d2c26c 100644
--- a/xen/arch/x86/include/asm/apic.h
+++ b/xen/arch/x86/include/asm/apic.h
@@ -155,8 +155,7 @@ void apic_wait_icr_idle(void);
 
 static inline void ack_APIC_irq(void)
 {
-	/* Docs say use 0 for future compatibility */
-	apic_write(APIC_EOI, 0);
+	apic_write(APIC_EOI, APIC_EOI_ACK);
 }
 
 extern int get_maxlvt(void);
diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/apicdef.h
index 112c1dc613..d3dc7b1d76 100644
--- a/xen/arch/x86/include/asm/apicdef.h
+++ b/xen/arch/x86/include/asm/apicdef.h
@@ -25,7 +25,7 @@
 #define			APIC_ARBPRI_MASK	0xFF
 #define		APIC_PROCPRI	0xA0
 #define		APIC_EOI	0xB0
-#define			APIC_EIO_ACK		0x0		/* Write this to the EOI register */
+#define			APIC_EOI_ACK		0x0		/* Docs say use 0 for future compatibility */
 #define		APIC_RRR	0xC0
 #define		APIC_LDR	0xD0
 #define			APIC_LDR_MASK		(0xFFu<<24)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Nov 05 11:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Nov 2026 11:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1474452.1681574 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvNV-0002fA-S2; Thu, 05 Nov 2026 11:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1474452.1681574; Thu, 05 Nov 2026 11:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xOvNV-0002f2-PM; Thu, 05 Nov 2026 11:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1474452;
 Thu, 05 Nov 2026 11:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xOvNT-0002eu-Uh
 for xen-changelog@lists.xenproject.org; Thu, 05 Nov 2026 11:11:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvNT-0000000GfRn-3qcp
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11:11:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xOvNT-0000000GWh8-3gqy
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Nov 2026 11:11:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zAtQKtZEsiipbx5Xofe1V2nOailiB6Rih6joTTihPK4=; b=1q4IQeT+f0JYJ59ftagAzorlxE
	OKMNpFeL5I2v5fb49LZACpHpu2vU0z7uZ07pzQpKPfXW2MUXlo2L6GuEjoqiOOnSjaIeAnPY+LV1y
	l2JfYwDXj9P16Oa57pruea4P+z3Non0VEP93dPXjW8fNTZUj4v6NA+9U7fYDxT/opxuQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: fix typo s/interruopt/interrupt/
Message-Id: <E1xOvNT-0000000GWh8-3gqy@xenbits.xenproject.org>
Date: Thu, 05 Nov 2026 11:11:31 +0000

commit c4a09c112c391ffc1aea33afff49ffb28156fbdb
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Nov 5 09:49:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 5 09:49:34 2026 +0100

    x86/time: fix typo s/interruopt/interrupt/
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
 xen/arch/x86/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index f37fddc61e..0e5d06a9a8 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -207,7 +207,7 @@ static void cf_check timer_interrupt(int irq, void *dev_id)
     if ( hpet_legacy_irq_tick() )
         return;
 
-    /* Only for start-of-day interruopt tests in io_apic.c. */
+    /* Only for start-of-day interrupt tests in io_apic.c. */
     pit0_ticks++;
 
     /* Rough hack to allow accurate timers to sort-of-work with no APIC. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 07:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 07:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479640.1683561 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQKDX-0005OP-SM; Mon, 09 Nov 2026 07:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1479640.1683561; Mon, 09 Nov 2026 07:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQKDX-0005OI-Pj; Mon, 09 Nov 2026 07:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1479640;
 Mon, 09 Nov 2026 07:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQKDW-0005O7-F9
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 07:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQKDW-00000003qPN-0BrA
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQKDW-00000002oeO-1MT0
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 07:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kNtlOOEy908uUZeh0FjwTH2+zr94JsXxg4OyOy2Wsz8=; b=Kymz/gEMYdMiSmNtJjA2yLiF4T
	lTR8vwnSki5EaB0Du+OPPN4bYcONmAeEt2g0Se/mnMZNJYHngxLP2mUK/xXpm+0pmEernerY11Lq0
	DqLj3JHQNvrrAG/DrJ1fmSah/w/ejLhGUFKpZnQMGjJf0WoXt+nNcxCqs0QyQOYyv/w0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arch/arm: Correct comment typos
Message-Id: <E1xQKDW-00000002oeO-1MT0@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 07:55:02 +0000

commit 94c3e7038d56c1c7ccf90c1d20314c6d30ae8729
Author:     Andrew Mbugua <andrewprecious388@gmail.com>
AuthorDate: Thu Nov 5 12:26:27 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Nov 9 08:28:44 2026 +0100

    xen/arch/arm: Correct comment typos
    
    No functional change.
    
    Signed-off-by: Andrew Mbugua <andrewprecious388@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/sve.c                 | 2 +-
 xen/arch/arm/domain.c                    | 2 +-
 xen/arch/arm/firmware/scmi-smc.c         | 2 +-
 xen/arch/arm/include/asm/arm64/efibind.h | 6 +++---
 xen/arch/arm/include/asm/asm_defns.h     | 2 +-
 xen/arch/arm/include/asm/cpregs.h        | 2 +-
 xen/arch/arm/include/asm/gic.h           | 4 ++--
 xen/arch/arm/include/asm/lpae.h          | 2 +-
 xen/arch/arm/include/asm/mm.h            | 4 ++--
 xen/arch/arm/include/asm/mmu/mm.h        | 2 +-
 xen/arch/arm/include/asm/tee/optee_msg.h | 2 +-
 xen/arch/arm/include/asm/vgic.h          | 2 +-
 xen/arch/arm/mmu/p2m.c                   | 2 +-
 xen/arch/arm/mmu/pt.c                    | 4 ++--
 xen/arch/arm/psci.c                      | 2 +-
 xen/arch/arm/tee/ffa.c                   | 2 +-
 xen/arch/arm/tee/ffa_partinfo.c          | 2 +-
 xen/arch/arm/tee/ffa_shm.c               | 2 +-
 xen/arch/arm/vgic-v2.c                   | 2 +-
 xen/arch/arm/vgic-v3-its.c               | 2 +-
 xen/arch/arm/vsmc.c                      | 2 +-
 xen/arch/arm/vuart.h                     | 2 +-
 22 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/arm64/sve.c b/xen/arch/arm/arm64/sve.c
index 23a9d0ba66..bce63b07b1 100644
--- a/xen/arch/arm/arm64/sve.c
+++ b/xen/arch/arm/arm64/sve.c
@@ -131,7 +131,7 @@ void sve_context_free(struct vcpu *v)
     sve_vl_bits = sve_decode_vl(v->domain->arch.sve_vl);
 
     /*
-     * Currenly points to the end of Z0-Z31 memory which is not the start of
+     * Currently points to the end of Z0-Z31 memory which is not the start of
      * the buffer. To be kept in sync with the sve_context_init().
      */
     v->arch.vfp.sve_zreg_ctx_end -=
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 34b5a85f9f..4c34f616e9 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -1047,7 +1047,7 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
  * logically restart work from this point.
  *
  * PROGRESS() markers must not be in the middle of loops. The loop
- * variable isn't preserved accross a continuation.
+ * variable isn't preserved across a continuation.
  *
  * To avoid redundant work, there should be a marker before each
  * function which may return -ERESTART.
diff --git a/xen/arch/arm/firmware/scmi-smc.c b/xen/arch/arm/firmware/scmi-smc.c
index 391df8b945..e776d94c91 100644
--- a/xen/arch/arm/firmware/scmi-smc.c
+++ b/xen/arch/arm/firmware/scmi-smc.c
@@ -32,7 +32,7 @@ static struct domain __read_mostly *scmi_dom;
 
 /*
  * Check if provided SMC Function Identifier matches the one known by the SCMI
- * layer, as read from DT prop 'arm,smc-id' during initialiation.
+ * layer, as read from DT prop 'arm,smc-id' during initialization.
  */
 static bool scmi_is_valid_smc_id(uint32_t fid)
 {
diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
index 7ab00e4f55..18f5615acf 100644
--- a/xen/arch/arm/include/asm/arm64/efibind.h
+++ b/xen/arch/arm/include/asm/arm64/efibind.h
@@ -142,8 +142,8 @@ typedef uint64_t   UINTN;
 // RUNTIME_CODE - pragma macro for declaring runtime code
 //
 
-#ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
-        #define EFIAPI          // Substitute expresion to force C calling convention
+#ifndef EFIAPI                  // Forces EFI calling conventions regardless of compiler options
+        #define EFIAPI          // Substitute expression to force C calling convention
 #endif
 
 #define BOOTSERVICE
@@ -163,7 +163,7 @@ typedef uint64_t   UINTN;
 
 
 //
-// When build similiar to FW, then link everything together as
+// When build is similar to FW, then link everything together as
 // one big module.
 //
 
diff --git a/xen/arch/arm/include/asm/asm_defns.h b/xen/arch/arm/include/asm/asm_defns.h
index 47efdf5234..ab6eecc8d0 100644
--- a/xen/arch/arm/include/asm/asm_defns.h
+++ b/xen/arch/arm/include/asm/asm_defns.h
@@ -15,7 +15,7 @@
 #elif defined(CONFIG_ARM_64)
 # define __OP32 "w"
 /*
- * Clang < 8.0 doesn't support register alllocation using the syntax rN.
+ * Clang < 8.0 doesn't support register allocation using the syntax rN.
  * See https://reviews.llvm.org/rL328829.
  */
 # define ASM_REG(index) asm("x" # index)
diff --git a/xen/arch/arm/include/asm/cpregs.h b/xen/arch/arm/include/asm/cpregs.h
index 3f62b38dc0..7e559253d7 100644
--- a/xen/arch/arm/include/asm/cpregs.h
+++ b/xen/arch/arm/include/asm/cpregs.h
@@ -347,7 +347,7 @@
 #define CONTEXTIDR      p15,0,c13,c0,1  /* Context ID Register */
 #define TPIDRURW        p15,0,c13,c0,2  /* Software Thread ID, User, R/W */
 #define TPIDRURO        p15,0,c13,c0,3  /* Software Thread ID, User, R/O */
-#define TPIDRPRW        p15,0,c13,c0,4  /* Software Thread ID, Priveleged */
+#define TPIDRPRW        p15,0,c13,c0,4  /* Software Thread ID, Privileged */
 #define HTPIDR          p15,4,c13,c0,2  /* HYp Software Thread Id Register */
 
 /* CP15 CR14:  */
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index 9af05da6aa..7ceae49774 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -151,7 +151,7 @@
 /*
  * The minimum GICC_BPR is required to be in the range 0-3. We set
  * GICC_BPR to 0 but we must expect that it might be 3. This means we
- * can rely on premption between the following ranges:
+ * can rely on preemption between the following ranges:
  * 0xf0..0xff
  * 0xe0..0xdf
  * 0xc0..0xcf
@@ -162,7 +162,7 @@
  *
  * Priorities within a range will not preempt each other.
  *
- * A GIC must support a mimimum of 16 priority levels.
+ * A GIC must support a minimum of 16 priority levels.
  */
 #define GIC_PRI_LOWEST     0xf0U
 #define GIC_PRI_IRQ        0xa0U
diff --git a/xen/arch/arm/include/asm/lpae.h b/xen/arch/arm/include/asm/lpae.h
index 8e062c9e37..43c178652b 100644
--- a/xen/arch/arm/include/asm/lpae.h
+++ b/xen/arch/arm/include/asm/lpae.h
@@ -36,7 +36,7 @@ typedef struct __packed {
      */
     unsigned long ai:3;         /* Attribute Index */
     unsigned long ns:1;         /* Not-Secure */
-    unsigned long up:1;         /* Unpriviledged access */
+    unsigned long up:1;         /* Unprivileged access */
     unsigned long ro:1;         /* Read-Only */
     unsigned long sh:2;         /* Shareability */
     unsigned long af:1;         /* Access Flag */
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 2eb8465aa9..9a87e71049 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -194,7 +194,7 @@ bool flags_has_rwx(unsigned int flags);
 extern void *early_fdt_map(paddr_t fdt_paddr);
 /* Remove early mappings */
 extern void remove_early_mappings(void);
-/* Prepare the memory subystem to bring-up the given secondary CPU */
+/* Prepare the memory subsystem to bring-up the given secondary CPU */
 extern int prepare_secondary_mm(int cpu);
 /* Map a frame table */
 void init_frametable(paddr_t ram_start);
@@ -271,7 +271,7 @@ static inline uint64_t gvirt_to_maddr(vaddr_t va, paddr_t *pa,
 
 /*
  * We define non-underscored wrappers for above conversion functions.
- * These are overriden in various source files while underscored version
+ * These are overridden in various source files while underscored version
  * remain intact.
  */
 #define virt_to_mfn(va)     __virt_to_mfn(va)
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index 7f4d59137d..7cebc60298 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -57,7 +57,7 @@ static inline void *maddr_to_virt(paddr_t ma)
 /**
  * Find the virtual address corresponding to a machine address
  *
- * The directmap covers all conventional memory accesible by the
+ * The directmap covers all conventional memory accessible by the
  * hypervisor. This means it's subject to PDX compression.
  *
  * Note there's an extra offset applied (directmap_base_pdx) on top of the
diff --git a/xen/arch/arm/include/asm/tee/optee_msg.h b/xen/arch/arm/include/asm/tee/optee_msg.h
index 09820ff863..0ccdf03fc4 100644
--- a/xen/arch/arm/include/asm/tee/optee_msg.h
+++ b/xen/arch/arm/include/asm/tee/optee_msg.h
@@ -292,7 +292,7 @@ struct optee_msg_arg {
  * [in] param[0].u.tmem.size		size (of first fragment)
  * [in] param[0].u.tmem.shm_ref		holds shared memory reference
  *
- * OPTEE_MSG_CMD_UNREGISTER_SHM unregisteres a previously registered shared
+ * OPTEE_MSG_CMD_UNREGISTER_SHM unregisters a previously registered shared
  * memory reference. The information is passed as:
  * [in] param[0].attr			OPTEE_MSG_ATTR_TYPE_RMEM_INPUT
  * [in] param[0].u.rmem.shm_ref		holds shared memory reference
diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index 26c53aaf3c..85e10aeece 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -358,7 +358,7 @@ extern void vgic_check_inflight_irqs_pending(struct vcpu *v,
 /* Maximum number of IRQs supported by vGIC */
 #define VGIC_MAX_IRQS 992U
 
-/* Default number of vGIC SPIs. 32 are substracted to cover local IRQs. */
+/* Default number of vGIC SPIs. 32 are subtracted to cover local IRQs. */
 #define VGIC_DEF_NR_SPIS (min(gic_number_lines(), VGIC_MAX_IRQS) - 32)
 
 static inline unsigned int vgic_def_nr_spis(void)
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 70d7c9fed9..53d28935af 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -1105,7 +1105,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
          * It is necessary to flush the TLB before writing the new entry
          * to keep coherency when the previous entry was valid.
          *
-         * Although, it could be defered when only the permissions are
+         * Although, it could be deferred when only the permissions are
          * changed (e.g in case of memaccess).
          */
         if ( lpae_is_valid(orig_pte) )
diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
index 621b47dbf5..81fe121517 100644
--- a/xen/arch/arm/mmu/pt.c
+++ b/xen/arch/arm/mmu/pt.c
@@ -160,7 +160,7 @@ lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr)
          * Outer Non-cacheable, must have a resultant shareability attribute
          * of Outer Shareable, otherwise shareability is UNPREDICTABLE.
          *
-         * On ARMv8 sharability is ignored and explicitly treated as Outer
+         * On ARMv8 shareability is ignored and explicitly treated as Outer
          * Shareable for Normal Inner Non_cacheable, Outer Non-cacheable.
          */
         e.pt.sh = LPAE_SH_OUTER;
@@ -171,7 +171,7 @@ lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr)
          * Shareability is ignored for non-Normal memory, Outer is as
          * good as anything.
          *
-         * On ARMv8 sharability is ignored and explicitly treated as Outer
+         * On ARMv8 shareability is ignored and explicitly treated as Outer
          * Shareable for any device memory type.
          */
         e.pt.sh = LPAE_SH_OUTER;
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 967cb4b77d..79947b124b 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -53,7 +53,7 @@ void call_psci_cpu_off(void)
     {
         struct arm_smccc_res res;
 
-        /* If successfull the PSCI cpu_off call doesn't return */
+        /* If successful the PSCI cpu_off call doesn't return */
         res = arm_smccc_smc(PSCI_0_2_FN32_CPU_OFF);
         panic("PSCI cpu off failed for CPU%d err=%d\n", smp_processor_id(),
               PSCI_RET(res));
diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 1fe33f2645..886c96414a 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -21,7 +21,7 @@
  * Unsupported FF-A interfaces:
  * o FFA_MSG_POLL and FFA_MSG_SEND - deprecated in FF-A-1.1-REL0
  * o FFA_MEM_RETRIEVE_* - Used when sharing memory from an SP to a VM
- * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when tranferring ownership
+ * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when transferring ownership
  *   or access of a memory region
  * o FFA_MSG_SEND2 and FFA_MSG_WAIT - Used for indirect messaging
  *
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index ed28820502..3b9bcb1b4f 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -269,7 +269,7 @@ static int32_t ffa_get_vm_partinfo(struct ffa_uuid uuid, uint32_t start_index,
      * Workaround for Linux FF-A Driver not accepting to have its own
      * entry in the list before FF-A v1.2 was supported.
      * This workaround is generally acceptable for other implementations
-     * as the specification was not completely clear on wether or not
+     * as the specification was not completely clear on whether or not
      * the requester endpoint information should be included or not
      */
     if ( ACCESS_ONCE(curr_ctx->guest_vers) >= FFA_VERSION_1_2 )
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 3d61caaeba..09ae0ca07d 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -482,7 +482,7 @@ static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
 
     /*
      * We're doing a rough check to see that no information is lost when
-     * tranfering the values into a struct ffa_mem_transaction_int below.
+     * transferring the values into a struct ffa_mem_transaction_int below.
      * The fields in struct ffa_mem_transaction_int are wide enough to hold
      * any valid value so being out of range means that something is wrong.
      */
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 62666a84db..6b5d290e8a 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -359,7 +359,7 @@ read_as_zero:
 
 read_impl_defined:
     printk(XENLOG_G_DEBUG
-           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           "%pv: vGICD: RAZ on implementation defined register offset %#08x\n",
            v, gicd_reg);
     *r = 0;
     return 1;
diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
index bc738614bb..79d056e21a 100644
--- a/xen/arch/arm/vgic-v3-its.c
+++ b/xen/arch/arm/vgic-v3-its.c
@@ -1561,7 +1561,7 @@ void vgic_v3_its_free_domain(struct domain *d)
 {
     struct virt_its *pos, *temp;
 
-    /* Cope with unitialized vITS */
+    /* Cope with uninitialized vITS */
     if ( list_head_is_null(&d->arch.vgic.vits_list) )
         return;
 
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index 78d5bdf56f..99cf7c6dae 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -71,7 +71,7 @@ static bool fill_revision(struct cpu_user_regs *regs, uint32_t major,
 static bool fill_function_call_count(struct cpu_user_regs *regs, uint32_t cnt)
 {
     /*
-     * Function call count is retuned as any other return value in register r0
+     * Function call count is returned as any other return value in register r0
      * (ARM DEN 0028B page 17)
      */
     set_user_reg(regs, 0, cnt);
diff --git a/xen/arch/arm/vuart.h b/xen/arch/arm/vuart.h
index e90d84c6ed..1a10f5ad7e 100644
--- a/xen/arch/arm/vuart.h
+++ b/xen/arch/arm/vuart.h
@@ -32,7 +32,7 @@ void domain_vuart_free(struct domain *d);
 static inline int domain_vuart_init(struct domain *d)
 {
     /*
-     * The vUART is unconditionally inialized for the hw domain. So we
+     * The vUART is unconditionally initialized for the hw domain. So we
      * can't return an error.
      */
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 11:00:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 11:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479821.1683710 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQN6Z-0001KP-DV; Mon, 09 Nov 2026 11:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1479821.1683710; Mon, 09 Nov 2026 11:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQN6Z-0001K5-AJ; Mon, 09 Nov 2026 11:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1479821;
 Mon, 09 Nov 2026 11: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 1xQN6Y-000132-2K
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 11:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQN6X-00000003umc-2sHt
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 11:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQN6X-00000004mjH-3yol
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 11: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=H8y84r9pjPuDj/builq0XzFvm52A7sPm6ciMeZ51wpo=; b=TpCXs5doZSaSyFGthKWb/B8w2U
	yIfcoVRf4sbIOLvJSqGkFlRcTFQ6AkyUzzc2UAOkZIeTF7q4R/CrfrLTkYnX0eP5cR1IdGyqrip8z
	aEGkMsGuvfEmEIBl/70ruRCoBBqxL3dbUZNv7YFn6tJ51tmB+AYDrRyiFKftQbvGCAIY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arch/arm: Correct comment typos
Message-Id: <E1xQN6X-00000004mjH-3yol@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 11:00:01 +0000

commit 94c3e7038d56c1c7ccf90c1d20314c6d30ae8729
Author:     Andrew Mbugua <andrewprecious388@gmail.com>
AuthorDate: Thu Nov 5 12:26:27 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon Nov 9 08:28:44 2026 +0100

    xen/arch/arm: Correct comment typos
    
    No functional change.
    
    Signed-off-by: Andrew Mbugua <andrewprecious388@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/sve.c                 | 2 +-
 xen/arch/arm/domain.c                    | 2 +-
 xen/arch/arm/firmware/scmi-smc.c         | 2 +-
 xen/arch/arm/include/asm/arm64/efibind.h | 6 +++---
 xen/arch/arm/include/asm/asm_defns.h     | 2 +-
 xen/arch/arm/include/asm/cpregs.h        | 2 +-
 xen/arch/arm/include/asm/gic.h           | 4 ++--
 xen/arch/arm/include/asm/lpae.h          | 2 +-
 xen/arch/arm/include/asm/mm.h            | 4 ++--
 xen/arch/arm/include/asm/mmu/mm.h        | 2 +-
 xen/arch/arm/include/asm/tee/optee_msg.h | 2 +-
 xen/arch/arm/include/asm/vgic.h          | 2 +-
 xen/arch/arm/mmu/p2m.c                   | 2 +-
 xen/arch/arm/mmu/pt.c                    | 4 ++--
 xen/arch/arm/psci.c                      | 2 +-
 xen/arch/arm/tee/ffa.c                   | 2 +-
 xen/arch/arm/tee/ffa_partinfo.c          | 2 +-
 xen/arch/arm/tee/ffa_shm.c               | 2 +-
 xen/arch/arm/vgic-v2.c                   | 2 +-
 xen/arch/arm/vgic-v3-its.c               | 2 +-
 xen/arch/arm/vsmc.c                      | 2 +-
 xen/arch/arm/vuart.h                     | 2 +-
 22 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/arm64/sve.c b/xen/arch/arm/arm64/sve.c
index 23a9d0ba66..bce63b07b1 100644
--- a/xen/arch/arm/arm64/sve.c
+++ b/xen/arch/arm/arm64/sve.c
@@ -131,7 +131,7 @@ void sve_context_free(struct vcpu *v)
     sve_vl_bits = sve_decode_vl(v->domain->arch.sve_vl);
 
     /*
-     * Currenly points to the end of Z0-Z31 memory which is not the start of
+     * Currently points to the end of Z0-Z31 memory which is not the start of
      * the buffer. To be kept in sync with the sve_context_init().
      */
     v->arch.vfp.sve_zreg_ctx_end -=
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 34b5a85f9f..4c34f616e9 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -1047,7 +1047,7 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
  * logically restart work from this point.
  *
  * PROGRESS() markers must not be in the middle of loops. The loop
- * variable isn't preserved accross a continuation.
+ * variable isn't preserved across a continuation.
  *
  * To avoid redundant work, there should be a marker before each
  * function which may return -ERESTART.
diff --git a/xen/arch/arm/firmware/scmi-smc.c b/xen/arch/arm/firmware/scmi-smc.c
index 391df8b945..e776d94c91 100644
--- a/xen/arch/arm/firmware/scmi-smc.c
+++ b/xen/arch/arm/firmware/scmi-smc.c
@@ -32,7 +32,7 @@ static struct domain __read_mostly *scmi_dom;
 
 /*
  * Check if provided SMC Function Identifier matches the one known by the SCMI
- * layer, as read from DT prop 'arm,smc-id' during initialiation.
+ * layer, as read from DT prop 'arm,smc-id' during initialization.
  */
 static bool scmi_is_valid_smc_id(uint32_t fid)
 {
diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
index 7ab00e4f55..18f5615acf 100644
--- a/xen/arch/arm/include/asm/arm64/efibind.h
+++ b/xen/arch/arm/include/asm/arm64/efibind.h
@@ -142,8 +142,8 @@ typedef uint64_t   UINTN;
 // RUNTIME_CODE - pragma macro for declaring runtime code
 //
 
-#ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
-        #define EFIAPI          // Substitute expresion to force C calling convention
+#ifndef EFIAPI                  // Forces EFI calling conventions regardless of compiler options
+        #define EFIAPI          // Substitute expression to force C calling convention
 #endif
 
 #define BOOTSERVICE
@@ -163,7 +163,7 @@ typedef uint64_t   UINTN;
 
 
 //
-// When build similiar to FW, then link everything together as
+// When build is similar to FW, then link everything together as
 // one big module.
 //
 
diff --git a/xen/arch/arm/include/asm/asm_defns.h b/xen/arch/arm/include/asm/asm_defns.h
index 47efdf5234..ab6eecc8d0 100644
--- a/xen/arch/arm/include/asm/asm_defns.h
+++ b/xen/arch/arm/include/asm/asm_defns.h
@@ -15,7 +15,7 @@
 #elif defined(CONFIG_ARM_64)
 # define __OP32 "w"
 /*
- * Clang < 8.0 doesn't support register alllocation using the syntax rN.
+ * Clang < 8.0 doesn't support register allocation using the syntax rN.
  * See https://reviews.llvm.org/rL328829.
  */
 # define ASM_REG(index) asm("x" # index)
diff --git a/xen/arch/arm/include/asm/cpregs.h b/xen/arch/arm/include/asm/cpregs.h
index 3f62b38dc0..7e559253d7 100644
--- a/xen/arch/arm/include/asm/cpregs.h
+++ b/xen/arch/arm/include/asm/cpregs.h
@@ -347,7 +347,7 @@
 #define CONTEXTIDR      p15,0,c13,c0,1  /* Context ID Register */
 #define TPIDRURW        p15,0,c13,c0,2  /* Software Thread ID, User, R/W */
 #define TPIDRURO        p15,0,c13,c0,3  /* Software Thread ID, User, R/O */
-#define TPIDRPRW        p15,0,c13,c0,4  /* Software Thread ID, Priveleged */
+#define TPIDRPRW        p15,0,c13,c0,4  /* Software Thread ID, Privileged */
 #define HTPIDR          p15,4,c13,c0,2  /* HYp Software Thread Id Register */
 
 /* CP15 CR14:  */
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index 9af05da6aa..7ceae49774 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -151,7 +151,7 @@
 /*
  * The minimum GICC_BPR is required to be in the range 0-3. We set
  * GICC_BPR to 0 but we must expect that it might be 3. This means we
- * can rely on premption between the following ranges:
+ * can rely on preemption between the following ranges:
  * 0xf0..0xff
  * 0xe0..0xdf
  * 0xc0..0xcf
@@ -162,7 +162,7 @@
  *
  * Priorities within a range will not preempt each other.
  *
- * A GIC must support a mimimum of 16 priority levels.
+ * A GIC must support a minimum of 16 priority levels.
  */
 #define GIC_PRI_LOWEST     0xf0U
 #define GIC_PRI_IRQ        0xa0U
diff --git a/xen/arch/arm/include/asm/lpae.h b/xen/arch/arm/include/asm/lpae.h
index 8e062c9e37..43c178652b 100644
--- a/xen/arch/arm/include/asm/lpae.h
+++ b/xen/arch/arm/include/asm/lpae.h
@@ -36,7 +36,7 @@ typedef struct __packed {
      */
     unsigned long ai:3;         /* Attribute Index */
     unsigned long ns:1;         /* Not-Secure */
-    unsigned long up:1;         /* Unpriviledged access */
+    unsigned long up:1;         /* Unprivileged access */
     unsigned long ro:1;         /* Read-Only */
     unsigned long sh:2;         /* Shareability */
     unsigned long af:1;         /* Access Flag */
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 2eb8465aa9..9a87e71049 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -194,7 +194,7 @@ bool flags_has_rwx(unsigned int flags);
 extern void *early_fdt_map(paddr_t fdt_paddr);
 /* Remove early mappings */
 extern void remove_early_mappings(void);
-/* Prepare the memory subystem to bring-up the given secondary CPU */
+/* Prepare the memory subsystem to bring-up the given secondary CPU */
 extern int prepare_secondary_mm(int cpu);
 /* Map a frame table */
 void init_frametable(paddr_t ram_start);
@@ -271,7 +271,7 @@ static inline uint64_t gvirt_to_maddr(vaddr_t va, paddr_t *pa,
 
 /*
  * We define non-underscored wrappers for above conversion functions.
- * These are overriden in various source files while underscored version
+ * These are overridden in various source files while underscored version
  * remain intact.
  */
 #define virt_to_mfn(va)     __virt_to_mfn(va)
diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
index 7f4d59137d..7cebc60298 100644
--- a/xen/arch/arm/include/asm/mmu/mm.h
+++ b/xen/arch/arm/include/asm/mmu/mm.h
@@ -57,7 +57,7 @@ static inline void *maddr_to_virt(paddr_t ma)
 /**
  * Find the virtual address corresponding to a machine address
  *
- * The directmap covers all conventional memory accesible by the
+ * The directmap covers all conventional memory accessible by the
  * hypervisor. This means it's subject to PDX compression.
  *
  * Note there's an extra offset applied (directmap_base_pdx) on top of the
diff --git a/xen/arch/arm/include/asm/tee/optee_msg.h b/xen/arch/arm/include/asm/tee/optee_msg.h
index 09820ff863..0ccdf03fc4 100644
--- a/xen/arch/arm/include/asm/tee/optee_msg.h
+++ b/xen/arch/arm/include/asm/tee/optee_msg.h
@@ -292,7 +292,7 @@ struct optee_msg_arg {
  * [in] param[0].u.tmem.size		size (of first fragment)
  * [in] param[0].u.tmem.shm_ref		holds shared memory reference
  *
- * OPTEE_MSG_CMD_UNREGISTER_SHM unregisteres a previously registered shared
+ * OPTEE_MSG_CMD_UNREGISTER_SHM unregisters a previously registered shared
  * memory reference. The information is passed as:
  * [in] param[0].attr			OPTEE_MSG_ATTR_TYPE_RMEM_INPUT
  * [in] param[0].u.rmem.shm_ref		holds shared memory reference
diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index 26c53aaf3c..85e10aeece 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -358,7 +358,7 @@ extern void vgic_check_inflight_irqs_pending(struct vcpu *v,
 /* Maximum number of IRQs supported by vGIC */
 #define VGIC_MAX_IRQS 992U
 
-/* Default number of vGIC SPIs. 32 are substracted to cover local IRQs. */
+/* Default number of vGIC SPIs. 32 are subtracted to cover local IRQs. */
 #define VGIC_DEF_NR_SPIS (min(gic_number_lines(), VGIC_MAX_IRQS) - 32)
 
 static inline unsigned int vgic_def_nr_spis(void)
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 70d7c9fed9..53d28935af 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -1105,7 +1105,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
          * It is necessary to flush the TLB before writing the new entry
          * to keep coherency when the previous entry was valid.
          *
-         * Although, it could be defered when only the permissions are
+         * Although, it could be deferred when only the permissions are
          * changed (e.g in case of memaccess).
          */
         if ( lpae_is_valid(orig_pte) )
diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
index 621b47dbf5..81fe121517 100644
--- a/xen/arch/arm/mmu/pt.c
+++ b/xen/arch/arm/mmu/pt.c
@@ -160,7 +160,7 @@ lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr)
          * Outer Non-cacheable, must have a resultant shareability attribute
          * of Outer Shareable, otherwise shareability is UNPREDICTABLE.
          *
-         * On ARMv8 sharability is ignored and explicitly treated as Outer
+         * On ARMv8 shareability is ignored and explicitly treated as Outer
          * Shareable for Normal Inner Non_cacheable, Outer Non-cacheable.
          */
         e.pt.sh = LPAE_SH_OUTER;
@@ -171,7 +171,7 @@ lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr)
          * Shareability is ignored for non-Normal memory, Outer is as
          * good as anything.
          *
-         * On ARMv8 sharability is ignored and explicitly treated as Outer
+         * On ARMv8 shareability is ignored and explicitly treated as Outer
          * Shareable for any device memory type.
          */
         e.pt.sh = LPAE_SH_OUTER;
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 967cb4b77d..79947b124b 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -53,7 +53,7 @@ void call_psci_cpu_off(void)
     {
         struct arm_smccc_res res;
 
-        /* If successfull the PSCI cpu_off call doesn't return */
+        /* If successful the PSCI cpu_off call doesn't return */
         res = arm_smccc_smc(PSCI_0_2_FN32_CPU_OFF);
         panic("PSCI cpu off failed for CPU%d err=%d\n", smp_processor_id(),
               PSCI_RET(res));
diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 1fe33f2645..886c96414a 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -21,7 +21,7 @@
  * Unsupported FF-A interfaces:
  * o FFA_MSG_POLL and FFA_MSG_SEND - deprecated in FF-A-1.1-REL0
  * o FFA_MEM_RETRIEVE_* - Used when sharing memory from an SP to a VM
- * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when tranferring ownership
+ * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when transferring ownership
  *   or access of a memory region
  * o FFA_MSG_SEND2 and FFA_MSG_WAIT - Used for indirect messaging
  *
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index ed28820502..3b9bcb1b4f 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -269,7 +269,7 @@ static int32_t ffa_get_vm_partinfo(struct ffa_uuid uuid, uint32_t start_index,
      * Workaround for Linux FF-A Driver not accepting to have its own
      * entry in the list before FF-A v1.2 was supported.
      * This workaround is generally acceptable for other implementations
-     * as the specification was not completely clear on wether or not
+     * as the specification was not completely clear on whether or not
      * the requester endpoint information should be included or not
      */
     if ( ACCESS_ONCE(curr_ctx->guest_vers) >= FFA_VERSION_1_2 )
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 3d61caaeba..09ae0ca07d 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -482,7 +482,7 @@ static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
 
     /*
      * We're doing a rough check to see that no information is lost when
-     * tranfering the values into a struct ffa_mem_transaction_int below.
+     * transferring the values into a struct ffa_mem_transaction_int below.
      * The fields in struct ffa_mem_transaction_int are wide enough to hold
      * any valid value so being out of range means that something is wrong.
      */
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 62666a84db..6b5d290e8a 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -359,7 +359,7 @@ read_as_zero:
 
 read_impl_defined:
     printk(XENLOG_G_DEBUG
-           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           "%pv: vGICD: RAZ on implementation defined register offset %#08x\n",
            v, gicd_reg);
     *r = 0;
     return 1;
diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
index bc738614bb..79d056e21a 100644
--- a/xen/arch/arm/vgic-v3-its.c
+++ b/xen/arch/arm/vgic-v3-its.c
@@ -1561,7 +1561,7 @@ void vgic_v3_its_free_domain(struct domain *d)
 {
     struct virt_its *pos, *temp;
 
-    /* Cope with unitialized vITS */
+    /* Cope with uninitialized vITS */
     if ( list_head_is_null(&d->arch.vgic.vits_list) )
         return;
 
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index 78d5bdf56f..99cf7c6dae 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -71,7 +71,7 @@ static bool fill_revision(struct cpu_user_regs *regs, uint32_t major,
 static bool fill_function_call_count(struct cpu_user_regs *regs, uint32_t cnt)
 {
     /*
-     * Function call count is retuned as any other return value in register r0
+     * Function call count is returned as any other return value in register r0
      * (ARM DEN 0028B page 17)
      */
     set_user_reg(regs, 0, cnt);
diff --git a/xen/arch/arm/vuart.h b/xen/arch/arm/vuart.h
index e90d84c6ed..1a10f5ad7e 100644
--- a/xen/arch/arm/vuart.h
+++ b/xen/arch/arm/vuart.h
@@ -32,7 +32,7 @@ void domain_vuart_free(struct domain *d);
 static inline int domain_vuart_init(struct domain *d)
 {
     /*
-     * The vUART is unconditionally inialized for the hw domain. So we
+     * The vUART is unconditionally initialized for the hw domain. So we
      * can't return an error.
      */
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 12:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 12:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479986.1683893 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOjE-00027C-3R; Mon, 09 Nov 2026 12:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1479986.1683893; Mon, 09 Nov 2026 12:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOjE-000274-0o; Mon, 09 Nov 2026 12:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1479986;
 Mon, 09 Nov 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 1xQOjC-00026q-Np
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjC-00000003wsY-1QVU
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjC-00000005h7T-2b73
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 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=LkJw8dSWdNUdnkrBCOOKQYq9jHC5KWOsABjrBcBHJR8=; b=fJO+mn8pvezRFcRgSphuREsgrj
	hFgdbmVpxXA98UTt9s8GBzLHJ7vgzep1PhhOo69Xi16aZXiYTK2Yb38r9PUbGHS2sfVPdk/TaZ141
	vGEQrJEp3ng2nEWlaer8PPu1K7nmCPxjhSzXfaDrXKNHHoNGShELd8BWTmWUrfA4KPpA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] common: Convert !test_bit(_VPF_down) into is_vcpu_online()
Message-Id: <E1xQOjC-00000005h7T-2b73@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 12:44:02 +0000

commit a6e71a63562c2aa638cf1c80e4b3fb79b649dbbc
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Mon Nov 9 11:31:56 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:31:56 2026 +0100

    common: Convert !test_bit(_VPF_down) into is_vcpu_online()
    
    Do the same for test_bit(_VPF_down) into !is_vcpu_online().
    
    No functional change.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domctl.c  | 2 +-
 xen/arch/arm/traps.c   | 2 +-
 xen/arch/arm/vgic.c    | 2 +-
 xen/arch/arm/vpsci.c   | 4 ++--
 xen/arch/x86/pv/shim.c | 2 +-
 xen/arch/x86/traps.c   | 2 +-
 xen/common/domain.c    | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index b76af56fad..292cc92159 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -203,7 +203,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     ctxt->ttbr1 = v->arch.ttbr1;
     ctxt->ttbcr = v->arch.ttbcr;
 
-    if ( !test_bit(_VPF_down, &v->pause_flags) )
+    if ( is_vcpu_online(v) )
         ctxt->flags |= VGCF_online;
 }
 
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 6a5dcef2aa..47a5c6bdd4 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1004,7 +1004,7 @@ static void show_guest_stack(struct vcpu *v, const struct cpu_user_regs *regs)
     void *mapped;
     unsigned long *stack, addr;
 
-    if ( test_bit(_VPF_down, &v->pause_flags) )
+    if ( !is_vcpu_online(v) )
     {
         printk("No stack trace, VCPU offline\n");
         return;
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index acded6a40f..062238a899 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -818,7 +818,7 @@ void vgic_inject_irq(struct domain *d, struct vcpu *v, unsigned int virq,
     }
 
     /* vcpu offline */
-    if ( test_bit(_VPF_down, &v->pause_flags) )
+    if ( !is_vcpu_online(v) )
     {
         spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index ac6af6118f..8c7a70c7a9 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -85,7 +85,7 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     if ( is_64bit_domain(d) && is_thumb )
         return PSCI_INVALID_ADDRESS;
 
-    if ( !test_bit(_VPF_down, &v->pause_flags) )
+    if ( is_vcpu_online(v) )
         return PSCI_ALREADY_ON;
 
     rc = vpsci_build_guest_context(v, entry_point, context_id, &ctxt);
@@ -195,7 +195,7 @@ static int32_t do_psci_0_2_affinity_info(register_t target_affinity,
         v = d->vcpu[vcpuid];
 
         if ( ( ( v->arch.vmpidr & tmask ) == target_affinity )
-                && ( !test_bit(_VPF_down, &v->pause_flags) ) )
+                && is_vcpu_online(v) )
             return PSCI_0_2_AFFINITY_LEVEL_ON;
     }
 
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 41000b0523..8ec03d7295 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -404,7 +404,7 @@ int pv_shim_shutdown(uint8_t reason)
         /* Stop the singleshot timer. */
         stop_timer(&v->singleshot_timer);
 
-        if ( test_bit(_VPF_down, &v->pause_flags) )
+        if ( !is_vcpu_online(v) )
             BUG_ON(vcpu_reset(v));
 
         if ( v != current )
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index ac01ba0872..5a702fe22c 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -918,7 +918,7 @@ void vcpu_show_execution_state(struct vcpu *v)
 {
     unsigned long flags = 0;
 
-    if ( test_bit(_VPF_down, &v->pause_flags) )
+    if ( !is_vcpu_online(v) )
     {
         printk("*** %pv is offline ***\n", v);
         return;
diff --git a/xen/common/domain.c b/xen/common/domain.c
index b41be89cd0..f3a2634d5f 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -2190,7 +2190,7 @@ long common_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case VCPUOP_down:
         for_each_vcpu ( d, v )
-            if ( v->vcpu_id != vcpuid && !test_bit(_VPF_down, &v->pause_flags) )
+            if ( v->vcpu_id != vcpuid && is_vcpu_online(v) )
             {
                rc = 1;
                break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 12:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 12:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479987.1683896 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOjO-00029I-4d; Mon, 09 Nov 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 1479987.1683896; Mon, 09 Nov 2026 12:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOjO-00029A-26; Mon, 09 Nov 2026 12:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1479987;
 Mon, 09 Nov 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 1xQOjM-00028x-Px
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 12:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjM-00000003wsc-1s2f
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjM-00000005hAz-32ph
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 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=26u0mOwM6xI3z8yrEastwj1cXPonnrdRWhg3izWhaIY=; b=ESr9f9X2NqwRbogS6n8iNnlXYy
	p2sYQPJiNyIyCQa1fPg9SCOq3vvDcs5vPOVNIX/BrwTqDI9cQoMDP49IgfLgKnYavZdxJuSH7nzYu
	atDYVXHCajsy6KdXoy8KvWekLeQU6N2BB6qkh+zQ05mx7TIemMuq0VzG/UcAfNWPZyYU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/credit: Uncount units dropped by csched_schedule()
Message-Id: <E1xQOjM-00000005hAz-32ph@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 12:44:12 +0000

commit 314d3603905256835c4f8a29a75e3bd5eafb29cf
Author:     Lin Liu <lin.liu01@citrix.com>
AuthorDate: Mon Nov 9 11:32:40 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:32:40 2026 +0100

    xen/credit: Uncount units dropped by csched_schedule()
    
    csched_schedule() takes snext off the runq without decrementing
    nr_runnable, as it is about to run.  A unit that stops being runnable
    is normally removed and uncounted by csched_unit_sleep(), but if the
    pick loop drops it first, the sleep finds nothing to do and the unit
    stays counted:
    
         CPU A                            CPU B
         domain_pause()                   csched_schedule(), lock held
           atomic_inc(&d->pause_count)
                                            __runq_remove(snext)
           vcpu_sleep_sync()                !unit_runnable_state(): drop
             waits for lock                 unlock
             csched_unit_sleep()
               not running, not queued:
               nothing to do
         domain_unpause()
           vcpu_wake()
             runq_insert()                nr_runnable +1 again
    
    Decrement nr_runnable when dropping the unit.
    
    Fixes: 7c7b407e7772 ("xen/sched: introduce unit_runnable_state()")
    Reported-by: Bengang Yuan <bengang.yuan@citrix.com>
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: Lin Liu <lin.liu01@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/credit.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 8df746bf6b..f1a9b4aed1 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1965,7 +1965,8 @@ static void cf_check csched_schedule(
         dec_nr_runnable(sched_cpu);
     }
 
-    do {
+    for ( ; ; )
+    {
         snext = __runq_elem(runq->next);
 
         /* Tasklet work (which runs in idle UNIT context) overrides all else. */
@@ -1993,7 +1994,12 @@ static void cf_check csched_schedule(
         else
             __runq_remove(snext);
 
-    } while ( !unit_runnable_state(snext->unit) );
+        if ( unit_runnable_state(snext->unit) )
+            break;
+
+        /* Dropped snext is off the runq but still counted: uncount it. */
+        dec_nr_runnable(sched_cpu);
+    }
 
     /*
      * Update idlers mask if necessary. When we're idling, other CPUs
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 12:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 12:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479988.1683901 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOjY-0002Bl-6J; Mon, 09 Nov 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 1479988.1683901; Mon, 09 Nov 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 1xQOjY-0002Bd-3R; Mon, 09 Nov 2026 12:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1479988;
 Mon, 09 Nov 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 1xQOjW-0002BS-T6
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 12:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjW-00000003wsz-2HEN
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjW-00000005hE9-3UJO
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 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=15az4NR4XEza5nHzwHbZX+su65ma16pKaeLRyOkkw+o=; b=5HNbJjqrI7TVPwVu5CbLEywfv3
	ZoBpEPyq4DYizTEzQNSNDXqw1b80txUfHj7/SB8HiWKFySIKOxufaq2xJyxgk+O2bVkbHtH1G01SD
	PPLIyDT8po9KjOMd2eE82OWGSczhnMd/Pd+aS7ALwmtUS8aIT6/XGZQrXhkykF9dGaN8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/EFI: guard against oversized modules
Message-Id: <E1xQOjW-00000005hE9-3UJO@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 12:44:22 +0000

commit f19e7f471ea1659bb960730a8e61017da4147364
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 9 11:33:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:33:14 2026 +0100

    x86/EFI: guard against oversized modules
    
    module_t's mod_end field (which we repurpose to hold a module's size)
    cannot hold values 4Gb and up. Don't let truncation go silently.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <gwd@xenproject.org>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/efi/efi-boot.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d738b839ee..757b2b529b 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -736,6 +736,13 @@ static void __init efi_arch_handle_module(const struct file *file,
     place_string(&mb_modules[mbi.mods_count].string, local_name.s);
     mb_modules[mbi.mods_count].mod_start = file->addr >> PAGE_SHIFT;
     mb_modules[mbi.mods_count].mod_end = file->size;
+
+    if ( mb_modules[mbi.mods_count].mod_end != file->size )
+    {
+        PrintStr(name);
+        blexit(L" is too large");
+    }
+
     ++mbi.mods_count;
     efi_bs->FreePool(ptr);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 12:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 12:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479989.1683905 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOji-0002EE-7Q; Mon, 09 Nov 2026 12:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1479989.1683905; Mon, 09 Nov 2026 12:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOji-0002E6-4p; Mon, 09 Nov 2026 12:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1479989;
 Mon, 09 Nov 2026 12:44: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 1xQOjh-0002Di-09
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 12:44:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjg-00000003wt3-2hAb
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjg-00000005hJE-3tIO
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 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=Rzafx9KsQUZiwO6z07HGy5osKFUay9h3vchrcV5pAEI=; b=W6r5SlNDqafZaiVYiIl1+z63Fb
	85lfN531que4suA4BIMXBqCc3Cp+7xQU6QMPBrBl5LdK6Jm6MvLRW1IxvXMDhGYsA49vq9pyD/bty
	GtvA8OjdFmymM6E3fD0K18V1xC10yrySzxOF12Ce29xRpJBJHAU0pWtrf6pp0XeBA5zk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpuidle: allocate processor_powers[] dynamically
Message-Id: <E1xQOjg-00000005hJE-3tIO@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 12:44:32 +0000

commit 3a5de37037f3b88aa66032cffd5108604297230a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 9 11:33:38 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:33:38 2026 +0100

    x86/cpuidle: allocate processor_powers[] dynamically
    
    There's no need to have a NR_CPUS-dimensioned static array there.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpu_idle.c       | 25 +++++++++++++++++++++----
 xen/arch/x86/include/asm/cpuidle.h |  2 +-
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index b2bca4dcf8..874346199e 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -44,6 +44,7 @@
 #include <xen/smp.h>
 #include <xen/softirq.h>
 #include <xen/trace.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/apic.h>
 #include <asm/cpuidle.h>
@@ -149,7 +150,7 @@ custom_param("max_cstate", parse_cstate);
 static bool __read_mostly local_apic_timer_c2_ok;
 boolean_param("lapic_timer_c2_ok", local_apic_timer_c2_ok);
 
-struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS];
+struct acpi_processor_power **__read_mostly processor_powers;
 
 /*
  * This field starts out as zero, and can be set to -1 just to signal it has
@@ -447,7 +448,9 @@ static void cf_check dump_cx(unsigned char key)
 
 static int __init cf_check cpu_idle_key_init(void)
 {
-    register_keyhandler('c', dump_cx, "dump ACPI Cx structures", 1);
+    if ( processor_powers )
+        register_keyhandler('c', dump_cx, "dump ACPI Cx structures", 1);
+
     return 0;
 }
 __initcall(cpu_idle_key_init);
@@ -1339,6 +1342,9 @@ long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power)
     if ( vendor_override > 0 )
         return 0;
 
+    if ( !processor_powers )
+        return -ENOMEM;
+
     print_cx_pminfo(acpi_id, power);
 
     cpu_id = get_cpu_id(acpi_id);
@@ -1512,12 +1518,14 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 #ifdef CONFIG_PM_STATS
 uint32_t pmstat_get_cx_nr(unsigned int cpu)
 {
-    return processor_powers[cpu] ? processor_powers[cpu]->count : 0;
+    return processor_powers && processor_powers[cpu]
+           ? processor_powers[cpu]->count : 0;
 }
 
 int pmstat_get_cx_stat(unsigned int cpu, struct pm_cx_stat *stat)
 {
-    struct acpi_processor_power *power = processor_powers[cpu];
+    struct acpi_processor_power *power = processor_powers
+                                         ? processor_powers[cpu] : NULL;
     uint64_t idle_usage = 0, idle_res = 0;
     uint64_t last_state_update_tick, current_stime, current_tick;
     uint64_t usage[ACPI_PROCESSOR_MAX_POWER] = { 0 };
@@ -1694,6 +1702,15 @@ static int __init cf_check cpuidle_presmp_init(void)
     if ( !xen_cpuidle )
         return 0;
 
+    processor_powers = xvzalloc_array(struct acpi_processor_power *,
+                                      nr_cpu_ids);
+    if ( !processor_powers )
+    {
+        printk("CPUIDLE: disabled - not enough memory\n");
+        xen_cpuidle = 0;
+        return -ENOMEM;
+    }
+
     mwait_idle_init(&cpu_nfb);
     cpu_nfb.notifier_call(&cpu_nfb, CPU_UP_PREPARE, cpu);
     cpu_nfb.notifier_call(&cpu_nfb, CPU_ONLINE, cpu);
diff --git a/xen/arch/x86/include/asm/cpuidle.h b/xen/arch/x86/include/asm/cpuidle.h
index 3a6b73142b..00cef39402 100644
--- a/xen/arch/x86/include/asm/cpuidle.h
+++ b/xen/arch/x86/include/asm/cpuidle.h
@@ -5,7 +5,7 @@
 #include <xen/notifier.h>
 #include <xen/sched.h>
 
-extern struct acpi_processor_power *processor_powers[];
+extern struct acpi_processor_power **processor_powers;
 
 extern void (*pm_idle_save)(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 12:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 12:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479990.1683908 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOjs-0002Gb-8w; Mon, 09 Nov 2026 12:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1479990.1683908; Mon, 09 Nov 2026 12:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOjs-0002GR-6D; Mon, 09 Nov 2026 12:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1479990;
 Mon, 09 Nov 2026 12:44:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQOjr-0002G6-3h
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 12:44:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjq-00000003wt7-3A7w
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOjr-00000005hNW-07uF
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44: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=bfti4GX4lmgcl0eMqZIXJ4+jJtNsQsLl4h5+IXNYDAM=; b=jX12FXSMs2A9gBwuplH+4eah04
	84ZNVND1ZPIJijj2hXBoa4+XBHxW5Fno6sHfTkmQUUwxrd9YU/dmqaGICuvHlyCWjYNAD+FbiY5rj
	JzCs6pjnv2Mnlv1lW14CLqAFxXWIhV1oEIbnT4sEnWB+eWp2PERYhDfTpUauya4zcLiI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpufreq: allocate processor_pminfo[] dynamically
Message-Id: <E1xQOjr-00000005hNW-07uF@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 12:44:43 +0000

commit 05457c29c0504bb50edef32de2093861876ad600
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 9 11:34:09 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:34:09 2026 +0100

    x86/cpufreq: allocate processor_pminfo[] dynamically
    
    There's no need to have a NR_CPUS-dimensioned static array there.
    
    As ordering of pre-SMP initcalls isn't well-defined, allocate the array
    from both cpufreq_presmp_init() and cpufreq_register_driver().
    
    Alongside adding a few NULL checks, drop a redundant one from
    get_cpufreq_para().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/drivers/acpi/pm-op.c                  |  5 ++---
 xen/drivers/acpi/pmstat.c                 |  2 +-
 xen/drivers/cpufreq/cpufreq.c             | 22 +++++++++++++++++++---
 xen/drivers/cpufreq/utility.c             |  2 +-
 xen/include/acpi/cpufreq/processor_perf.h |  2 +-
 5 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/acpi/pm-op.c b/xen/drivers/acpi/pm-op.c
index 07bddc58d9..47304a4063 100644
--- a/xen/drivers/acpi/pm-op.c
+++ b/xen/drivers/acpi/pm-op.c
@@ -104,8 +104,7 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     pmpt = processor_pminfo[op->cpuid];
     policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
 
-    if ( !pmpt ||
-         ((pmpt->init & XEN_PX_INIT) && !pmpt->perf.states) ||
+    if ( ((pmpt->init & XEN_PX_INIT) && !pmpt->perf.states) ||
          /* Avoid NULL deref of pmpt->perf.states[] */
          ((pmpt->init & XEN_CPPC_INIT) && pmpt->perf.state_count) ||
          !policy || !policy->governor )
@@ -369,7 +368,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
 
     if ( op->cpuid >= nr_cpu_ids || !cpu_online(op->cpuid) )
         return -EINVAL;
-    pmpt = processor_pminfo[op->cpuid];
+    pmpt = processor_pminfo ? processor_pminfo[op->cpuid] : NULL;
 
     switch ( op->cmd & PM_PARA_CATEGORY_MASK )
     {
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index 0f31736df2..a67b120128 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -227,7 +227,7 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
 
     if ( !op || (op->cpuid >= nr_cpu_ids) || !cpu_online(op->cpuid) )
         return -EINVAL;
-    pmpt = processor_pminfo[op->cpuid];
+    pmpt = processor_pminfo ? processor_pminfo[op->cpuid] : NULL;
 
     switch ( op->type & PMSTAT_CATEGORY_MASK )
     {
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 4b74f5590b..9476ac23b9 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -218,7 +218,7 @@ int cpufreq_limit_change(unsigned int cpu)
     struct cpufreq_policy policy;
 
     if (!cpu_online(cpu) || !(data = per_cpu(cpufreq_cpu_policy, cpu)) ||
-        !processor_pminfo[cpu])
+        !processor_pminfo || !processor_pminfo[cpu])
         return -ENODEV;
 
     perf = &processor_pminfo[cpu]->perf;
@@ -273,7 +273,7 @@ int cpufreq_add_cpu(unsigned int cpu)
     unsigned int shared_type;
 
     /* to protect the case when Px was not controlled by xen */
-    if ( !processor_pminfo[cpu] || !cpu_online(cpu) )
+    if ( !processor_pminfo || !processor_pminfo[cpu] || !cpu_online(cpu) )
         return -EINVAL;
 
     if ( !(processor_pminfo[cpu]->init & (XEN_PX_INIT | XEN_CPPC_INIT)) )
@@ -448,7 +448,7 @@ int cpufreq_del_cpu(unsigned int cpu)
     const struct xen_psd_package *domain_info;
 
     /* to protect the case when Px was not controlled by xen */
-    if ( !processor_pminfo[cpu] || !cpu_online(cpu) )
+    if ( !processor_pminfo || !processor_pminfo[cpu] || !cpu_online(cpu) )
         return -EINVAL;
 
     if ( !(processor_pminfo[cpu]->init & (XEN_PX_INIT | XEN_CPPC_INIT)) )
@@ -563,6 +563,9 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf)
     struct processor_pminfo *pmpt;
     struct processor_performance *pxpt;
 
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
     cpu = get_cpu_id(acpi_id);
     if ( cpu < 0 || !perf )
     {
@@ -726,6 +729,9 @@ int set_cppc_pminfo(unsigned int acpi_id,
     int ret = 0, cpu_id;
     struct processor_pminfo *pm_info;
 
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
     cpu_id = get_cpu_id(acpi_id);
     if ( cpu_id < 0 )
     {
@@ -947,6 +953,11 @@ static struct notifier_block cpu_nfb = {
 
 static int __init cf_check cpufreq_presmp_init(void)
 {
+    if ( !processor_pminfo )
+        processor_pminfo = xvzalloc_array(struct processor_pminfo *, nr_cpu_ids);
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
     register_cpu_notifier(&cpu_nfb);
     return 0;
 }
@@ -954,6 +965,11 @@ presmp_initcall(cpufreq_presmp_init);
 
 int __init cpufreq_register_driver(const struct cpufreq_driver *driver_data)
 {
+    if ( !processor_pminfo )
+        processor_pminfo = xvzalloc_array(struct processor_pminfo *, nr_cpu_ids);
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
    if ( !driver_data || !driver_data->init ||
         !driver_data->verify || !driver_data->exit ||
         (!driver_data->target == !driver_data->setpolicy) )
diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index e2cc9ff2af..9bd2a399b3 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -32,7 +32,7 @@
 #include <public/sysctl.h>
 
 struct cpufreq_driver __read_mostly cpufreq_driver;
-struct processor_pminfo *__read_mostly processor_pminfo[NR_CPUS];
+struct processor_pminfo **__read_mostly processor_pminfo;
 DEFINE_PER_CPU_READ_MOSTLY(struct cpufreq_policy *, cpufreq_cpu_policy);
 
 /*********************************************************************
diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h
index 0a87bc0384..eb5a0d57e1 100644
--- a/xen/include/acpi/cpufreq/processor_perf.h
+++ b/xen/include/acpi/cpufreq/processor_perf.h
@@ -59,7 +59,7 @@ struct processor_pminfo {
     uint32_t init;
 };
 
-extern struct processor_pminfo *processor_pminfo[NR_CPUS];
+extern struct processor_pminfo **processor_pminfo;
 
 struct px_stat {
     uint8_t total;        /* total Px states */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 12:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 12:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1479991.1683913 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOk2-0002Ij-AH; Mon, 09 Nov 2026 12:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1479991.1683913; Mon, 09 Nov 2026 12:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQOk2-0002Ib-7a; Mon, 09 Nov 2026 12:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1479991;
 Mon, 09 Nov 2026 12:44:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQOk1-0002IS-8I
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 12:44:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOk0-00000003wtB-3lkF
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQOk1-00000005hSN-0jIV
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 12:44:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DC99/pKXaqI7ssmnRsn08svKUND6LcCOieVZ+jU5XHs=; b=NkeeC4WmXqDxoQbDB+qUOWWYQk
	AiU7cNL+AqqDWGOiS9swNxqUTE3XVMFuK72gdpY3mtnVVHk4R9F5Ah83B6EQ7JK3siQmmTfGDfRAI
	E/y23BawFbKHPzsrZ0Q0tEyLiZhVjvXKs0ZqGUa4HsCNovpjR7VFesjLqv4ncasTT2EY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: align header inclusion guards with CODING_STYLE
Message-Id: <E1xQOk1-00000005hSN-0jIV@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 12:44:53 +0000

commit 9c5cd8c816491bd1dd6bd50f553a60a20f7f94f8
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Nov 9 11:34:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:34:58 2026 +0100

    xen/riscv: align header inclusion guards with CODING_STYLE
    
    Commit 7abea85c9f12 ("CODING_STYLE: Updated header guard
    recommendations") changed the recommended naming of inclusion guards
    for arch-specific headers to <arch>_<something>_H. Most RISC-V headers
    still use the ASM__RISCV__<FILENAME>_H form required by the previous
    rules, and a few use ASM_RISCV_<FILENAME>_H, which follows neither.
    
    Rename the guards to RISCV_<SOMETHING>_H. While doing so, also fix two
    guards which don't match their file names: extable.h used
    ASM__RISCV__ASM_EXTABLE_H and intc.h used the misspelt
    ASM__RISCV__INTERRUPT_CONTOLLER_H.
    
    No functional change.
    
    Assisted-by: Claude-Code:claude-opus-5-5
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/aplic-priv.h                 | 6 +++---
 xen/arch/riscv/include/asm/acpi.h           | 6 +++---
 xen/arch/riscv/include/asm/aplic.h          | 6 +++---
 xen/arch/riscv/include/asm/asm.h            | 6 +++---
 xen/arch/riscv/include/asm/atomic.h         | 6 +++---
 xen/arch/riscv/include/asm/bitops.h         | 6 +++---
 xen/arch/riscv/include/asm/bug.h            | 6 +++---
 xen/arch/riscv/include/asm/cache.h          | 6 +++---
 xen/arch/riscv/include/asm/cmpxchg.h        | 6 +++---
 xen/arch/riscv/include/asm/config.h         | 6 +++---
 xen/arch/riscv/include/asm/cpufeature.h     | 6 +++---
 xen/arch/riscv/include/asm/csr.h            | 6 +++---
 xen/arch/riscv/include/asm/current.h        | 6 +++---
 xen/arch/riscv/include/asm/domain.h         | 6 +++---
 xen/arch/riscv/include/asm/early_printk.h   | 6 +++---
 xen/arch/riscv/include/asm/event.h          | 6 +++---
 xen/arch/riscv/include/asm/extable.h        | 6 +++---
 xen/arch/riscv/include/asm/fence.h          | 6 +++---
 xen/arch/riscv/include/asm/fixmap.h         | 6 +++---
 xen/arch/riscv/include/asm/flushtlb.h       | 6 +++---
 xen/arch/riscv/include/asm/guest-layout.h   | 6 +++---
 xen/arch/riscv/include/asm/guest_access.h   | 6 +++---
 xen/arch/riscv/include/asm/guest_atomics.h  | 6 +++---
 xen/arch/riscv/include/asm/imsic.h          | 6 +++---
 xen/arch/riscv/include/asm/insn-defs.h      | 6 +++---
 xen/arch/riscv/include/asm/intc.h           | 6 +++---
 xen/arch/riscv/include/asm/io.h             | 6 +++---
 xen/arch/riscv/include/asm/irq.h            | 6 +++---
 xen/arch/riscv/include/asm/mm-types.h       | 6 +++---
 xen/arch/riscv/include/asm/mm.h             | 6 +++---
 xen/arch/riscv/include/asm/monitor.h        | 6 +++---
 xen/arch/riscv/include/asm/nospec.h         | 6 +++---
 xen/arch/riscv/include/asm/p2m.h            | 6 +++---
 xen/arch/riscv/include/asm/page-bits.h      | 6 +++---
 xen/arch/riscv/include/asm/page.h           | 6 +++---
 xen/arch/riscv/include/asm/paging.h         | 6 +++---
 xen/arch/riscv/include/asm/pmap.h           | 6 +++---
 xen/arch/riscv/include/asm/processor.h      | 6 +++---
 xen/arch/riscv/include/asm/regs.h           | 6 +++---
 xen/arch/riscv/include/asm/riscv_encoding.h | 6 +++---
 xen/arch/riscv/include/asm/sbi.h            | 6 +++---
 xen/arch/riscv/include/asm/setup.h          | 6 +++---
 xen/arch/riscv/include/asm/smp.h            | 6 +++---
 xen/arch/riscv/include/asm/spinlock.h       | 6 +++---
 xen/arch/riscv/include/asm/string.h         | 6 +++---
 xen/arch/riscv/include/asm/system.h         | 6 +++---
 xen/arch/riscv/include/asm/time.h           | 6 +++---
 xen/arch/riscv/include/asm/traps.h          | 6 +++---
 xen/arch/riscv/include/asm/types.h          | 6 +++---
 xen/arch/riscv/include/asm/vaplic.h         | 6 +++---
 xen/arch/riscv/include/asm/vmid.h           | 6 +++---
 xen/arch/riscv/include/asm/vsbi.h           | 6 +++---
 xen/arch/riscv/include/asm/vtimer.h         | 6 +++---
 53 files changed, 159 insertions(+), 159 deletions(-)

diff --git a/xen/arch/riscv/aplic-priv.h b/xen/arch/riscv/aplic-priv.h
index 35100d3a64..009020c83f 100644
--- a/xen/arch/riscv/aplic-priv.h
+++ b/xen/arch/riscv/aplic-priv.h
@@ -11,8 +11,8 @@
  * Copyright (c) Vates.
  */
 
-#ifndef ASM_RISCV_APLIC_PRIV_H
-#define ASM_RISCV_APLIC_PRIV_H
+#ifndef RISCV_APLIC_PRIV_H
+#define RISCV_APLIC_PRIV_H
 
 #include <xen/spinlock.h>
 #include <xen/types.h>
@@ -47,4 +47,4 @@ struct aplic_priv {
  */
 extern unsigned int guest_aplic_num_sources;
 
-#endif /* ASM_RISCV_APLIC_PRIV_H */
+#endif /* RISCV_APLIC_PRIV_H */
diff --git a/xen/arch/riscv/include/asm/acpi.h b/xen/arch/riscv/include/asm/acpi.h
index 0c553bd6b8..8c769b2c0b 100644
--- a/xen/arch/riscv/include/asm/acpi.h
+++ b/xen/arch/riscv/include/asm/acpi.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__ACPI_H
-#define ASM__RISCV__ACPI_H
+#ifndef RISCV_ACPI_H
+#define RISCV_ACPI_H
 
-#endif /* ASM__RISCV__ACPI_H */
+#endif /* RISCV_ACPI_H */
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index a2af55d54f..51be469b69 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -8,8 +8,8 @@
  * Copyright (c) Microchip.
  */
 
-#ifndef ASM_RISCV_APLIC_H
-#define ASM_RISCV_APLIC_H
+#ifndef RISCV_APLIC_H
+#define RISCV_APLIC_H
 
 #include <xen/types.h>
 
@@ -141,4 +141,4 @@ struct aplic_regs {
     uint32_t target[1023];      /* 0x3004 */
 };
 
-#endif /* ASM_RISCV_APLIC_H */
+#endif /* RISCV_APLIC_H */
diff --git a/xen/arch/riscv/include/asm/asm.h b/xen/arch/riscv/include/asm/asm.h
index e147b6f053..a663db4c23 100644
--- a/xen/arch/riscv/include/asm/asm.h
+++ b/xen/arch/riscv/include/asm/asm.h
@@ -3,8 +3,8 @@
  * Copyright (C) 2015 Regents of the University of California
  */
 
-#ifndef ASM__RISCV__ASM_H
-#define ASM__RISCV__ASM_H
+#ifndef RISCV_ASM_H
+#define RISCV_ASM_H
 
 #ifdef __ASSEMBLER__
 #include <xen/linkage.h>
@@ -52,4 +52,4 @@
 #error "Unexpected __SIZEOF_SHORT__"
 #endif
 
-#endif /* ASM__RISCV__ASM_H */
+#endif /* RISCV_ASM_H */
diff --git a/xen/arch/riscv/include/asm/atomic.h b/xen/arch/riscv/include/asm/atomic.h
index 8e0425cea0..3a0184d35d 100644
--- a/xen/arch/riscv/include/asm/atomic.h
+++ b/xen/arch/riscv/include/asm/atomic.h
@@ -19,8 +19,8 @@
  * Copyright (C) 2024 Vates SAS
  */
 
-#ifndef ASM__RISCV__ATOMIC_H
-#define ASM__RISCV__ATOMIC_H
+#ifndef RISCV_ATOMIC_H
+#define RISCV_ATOMIC_H
 
 #include <xen/atomic.h>
 
@@ -266,7 +266,7 @@ ATOMIC_OPS()
 #undef ATOMIC_OPS
 #undef ATOMIC_OP
 
-#endif /* ASM__RISCV__ATOMIC_H */
+#endif /* RISCV_ATOMIC_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/bitops.h b/xen/arch/riscv/include/asm/bitops.h
index 72a4a8c155..471eb07bd2 100644
--- a/xen/arch/riscv/include/asm/bitops.h
+++ b/xen/arch/riscv/include/asm/bitops.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (C) 2012 Regents of the University of California */
 
-#ifndef ASM__RISCV__BITOPS_H
-#define ASM__RISCV__BITOPS_H
+#ifndef RISCV_BITOPS_H
+#define RISCV_BITOPS_H
 
 #include <asm/system.h>
 
@@ -132,7 +132,7 @@ static inline void clear_bit(int nr, volatile void *p)
 
 #define arch_hweightl(x) __builtin_popcountl(x)
 
-#endif /* ASM__RISCV__BITOPS_H */
+#endif /* RISCV_BITOPS_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/bug.h b/xen/arch/riscv/include/asm/bug.h
index c2cdc2dc2a..8834dcea81 100644
--- a/xen/arch/riscv/include/asm/bug.h
+++ b/xen/arch/riscv/include/asm/bug.h
@@ -4,8 +4,8 @@
  * Copyright (C) 2021-2023 Vates
  *
  */
-#ifndef ASM__RISCV__BUG_H
-#define ASM__RISCV__BUG_H
+#ifndef RISCV_BUG_H
+#define RISCV_BUG_H
 
 #ifndef __ASSEMBLER__
 
@@ -15,4 +15,4 @@
 
 #endif /* !__ASSEMBLER__ */
 
-#endif /* ASM__RISCV__BUG_H */
+#endif /* RISCV_BUG_H */
diff --git a/xen/arch/riscv/include/asm/cache.h b/xen/arch/riscv/include/asm/cache.h
index d4cf1ac8e2..6b8dff48b7 100644
--- a/xen/arch/riscv/include/asm/cache.h
+++ b/xen/arch/riscv/include/asm/cache.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__CACHE_H
-#define ASM__RISCV__CACHE_H
+#ifndef RISCV_CACHE_H
+#define RISCV_CACHE_H
 
-#endif /* ASM__RISCV__CACHE_H */
+#endif /* RISCV_CACHE_H */
diff --git a/xen/arch/riscv/include/asm/cmpxchg.h b/xen/arch/riscv/include/asm/cmpxchg.h
index d47ebaffce..12268d0bab 100644
--- a/xen/arch/riscv/include/asm/cmpxchg.h
+++ b/xen/arch/riscv/include/asm/cmpxchg.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (C) 2014 Regents of the University of California */
 
-#ifndef ASM__RISCV__CMPXCHG_H
-#define ASM__RISCV__CMPXCHG_H
+#ifndef RISCV_CMPXCHG_H
+#define RISCV_CMPXCHG_H
 
 #include <xen/bitops.h>
 #include <xen/compiler.h>
@@ -230,7 +230,7 @@ static always_inline unsigned long __cmpxchg(volatile void *ptr,
               sizeof(*(ptr))); \
 })
 
-#endif /* ASM__RISCV__CMPXCHG_H */
+#endif /* RISCV_CMPXCHG_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index fd69057826..8d43ee76da 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__CONFIG_H
-#define ASM__RISCV__CONFIG_H
+#ifndef RISCV_CONFIG_H
+#define RISCV_CONFIG_H
 
 #include <xen/const.h>
 #include <xen/page-size.h>
@@ -164,7 +164,7 @@ extern unsigned long phys_offset; /* = load_start - XEN_VIRT_START */
 #error "Define KERNEL_LOAD_ADDR_ALIGNMENT"
 #endif
 
-#endif /* ASM__RISCV__CONFIG_H */
+#endif /* RISCV_CONFIG_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index b0a23be18e..d42189e8eb 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__CPUFEATURE_H
-#define ASM__RISCV__CPUFEATURE_H
+#ifndef RISCV_CPUFEATURE_H
+#define RISCV_CPUFEATURE_H
 
 #ifndef __ASSEMBLER__
 
@@ -57,7 +57,7 @@ bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__CPUFEATURE_H */
+#endif /* RISCV_CPUFEATURE_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/csr.h b/xen/arch/riscv/include/asm/csr.h
index 888d6a2a86..a805f7ed0b 100644
--- a/xen/arch/riscv/include/asm/csr.h
+++ b/xen/arch/riscv/include/asm/csr.h
@@ -3,8 +3,8 @@
  * Copyright (C) 2015 Regents of the University of California
  */
 
-#ifndef ASM__RISCV__CSR_H
-#define ASM__RISCV__CSR_H
+#ifndef RISCV_CSR_H
+#define RISCV_CSR_H
 
 #include <xen/const.h>
 
@@ -128,4 +128,4 @@ static always_inline bool csr_read_safe(unsigned long csr,
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__CSR_H */
+#endif /* RISCV_CSR_H */
diff --git a/xen/arch/riscv/include/asm/current.h b/xen/arch/riscv/include/asm/current.h
index 78ec52fd8a..06683d7ae0 100644
--- a/xen/arch/riscv/include/asm/current.h
+++ b/xen/arch/riscv/include/asm/current.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__CURRENT_H
-#define ASM__RISCV__CURRENT_H
+#ifndef RISCV_CURRENT_H
+#define RISCV_CURRENT_H
 
 #include <xen/bug.h>
 #include <xen/cache.h>
@@ -62,4 +62,4 @@ DECLARE_PER_CPU(struct vcpu *, curr_vcpu);
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__CURRENT_H */
+#endif /* RISCV_CURRENT_H */
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index e035b33ddf..98e5e72e58 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__DOMAIN_H
-#define ASM__RISCV__DOMAIN_H
+#ifndef RISCV_DOMAIN_H
+#define RISCV_DOMAIN_H
 
 #include <xen/mm.h>
 #include <xen/spinlock.h>
@@ -128,7 +128,7 @@ int vcpu_unset_interrupt(struct vcpu *v, unsigned int irq);
 void vcpu_sync_interrupts(struct vcpu *curr);
 void vcpu_flush_interrupts(struct vcpu *curr);
 
-#endif /* ASM__RISCV__DOMAIN_H */
+#endif /* RISCV_DOMAIN_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/early_printk.h b/xen/arch/riscv/include/asm/early_printk.h
index 2750045bdd..240b7f539a 100644
--- a/xen/arch/riscv/include/asm/early_printk.h
+++ b/xen/arch/riscv/include/asm/early_printk.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__EARLY_PRINTK_H
-#define ASM__RISCV__EARLY_PRINTK_H
+#ifndef RISCV_EARLY_PRINTK_H
+#define RISCV_EARLY_PRINTK_H
 
 #include <xen/early_printk.h>
 
@@ -11,4 +11,4 @@ void early_printk(const char *str);
 static inline void early_printk(const char *s) {};
 #endif
 
-#endif /* ASM__RISCV__EARLY_PRINTK_H */
+#endif /* RISCV_EARLY_PRINTK_H */
diff --git a/xen/arch/riscv/include/asm/event.h b/xen/arch/riscv/include/asm/event.h
index 116434c665..a1fc0bc6fd 100644
--- a/xen/arch/riscv/include/asm/event.h
+++ b/xen/arch/riscv/include/asm/event.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__EVENT_H
-#define ASM__RISCV__EVENT_H
+#ifndef RISCV_EVENT_H
+#define RISCV_EVENT_H
 
 #include <xen/lib.h>
 
@@ -29,7 +29,7 @@ static inline enum virq_type arch_get_virq_type(unsigned int virq)
     return VIRQ_GLOBAL;
 }
 
-#endif /* ASM__RISCV__EVENT_H */
+#endif /* RISCV_EVENT_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/extable.h b/xen/arch/riscv/include/asm/extable.h
index c0128a9181..0209b2f3bf 100644
--- a/xen/arch/riscv/include/asm/extable.h
+++ b/xen/arch/riscv/include/asm/extable.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__ASM_EXTABLE_H
-#define ASM__RISCV__ASM_EXTABLE_H
+#ifndef RISCV_EXTABLE_H
+#define RISCV_EXTABLE_H
 
 #ifdef __ASSEMBLER__
 
@@ -55,4 +55,4 @@ bool fixup_exception(struct cpu_user_regs *regs);
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* ASM__RISCV__ASM_EXTABLE_H */
+#endif /* RISCV_EXTABLE_H */
diff --git a/xen/arch/riscv/include/asm/fence.h b/xen/arch/riscv/include/asm/fence.h
index edfaac49cd..f5dd3096e5 100644
--- a/xen/arch/riscv/include/asm/fence.h
+++ b/xen/arch/riscv/include/asm/fence.h
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
-#ifndef ASM__RISCV__FENCE_H
-#define ASM__RISCV__FENCE_H
+#ifndef RISCV_FENCE_H
+#define RISCV_FENCE_H
 
 #define RISCV_ACQUIRE_BARRIER   "\tfence r , rw\n"
 #define RISCV_RELEASE_BARRIER   "\tfence rw, w\n"
 #define RISCV_FULL_BARRIER      "\tfence rw, rw\n"
 
-#endif	/* ASM__RISCV__FENCE_H */
+#endif	/* RISCV_FENCE_H */
diff --git a/xen/arch/riscv/include/asm/fixmap.h b/xen/arch/riscv/include/asm/fixmap.h
index 085d135c15..7e907c3d1c 100644
--- a/xen/arch/riscv/include/asm/fixmap.h
+++ b/xen/arch/riscv/include/asm/fixmap.h
@@ -2,8 +2,8 @@
 /*
  * fixmap.h: compile-time virtual memory allocation
  */
-#ifndef ASM__RISCV__FIXMAP_H
-#define ASM__RISCV__FIXMAP_H
+#ifndef RISCV_FIXMAP_H
+#define RISCV_FIXMAP_H
 
 #include <xen/bug.h>
 #include <xen/page-size.h>
@@ -48,4 +48,4 @@ static inline unsigned int virt_to_fix(vaddr_t vaddr)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__FIXMAP_H */
+#endif /* RISCV_FIXMAP_H */
diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index b0112d416d..e1d17430da 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__FLUSHTLB_H
-#define ASM__RISCV__FLUSHTLB_H
+#ifndef RISCV_FLUSHTLB_H
+#define RISCV_FLUSHTLB_H
 
 #include <xen/bug.h>
 #include <xen/cpumask.h>
@@ -53,7 +53,7 @@ static inline void arch_flush_tlb_mask(const cpumask_t *mask)
     sbi_remote_hfence_gvma(mask, 0, 0);
 }
 
-#endif /* ASM__RISCV__FLUSHTLB_H */
+#endif /* RISCV_FLUSHTLB_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index ceed9125e7..52d1f2e108 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -1,5 +1,5 @@
-#ifndef ASM_RISCV_GUEST_LAYOUT_H
-#define ASM_RISCV_GUEST_LAYOUT_H
+#ifndef RISCV_GUEST_LAYOUT_H
+#define RISCV_GUEST_LAYOUT_H
 
 #include <public/xen.h>
 
@@ -44,4 +44,4 @@
 #define GUEST_MAGIC_BASE  _UL(0x79000000)
 #define GUEST_MAGIC_SIZE  _UL(0x00200000)
 
-#endif /* ASM_RISCV_GUEST_LAYOUT_H */
+#endif /* RISCV_GUEST_LAYOUT_H */
diff --git a/xen/arch/riscv/include/asm/guest_access.h b/xen/arch/riscv/include/asm/guest_access.h
index 8d679319de..e94aa838a3 100644
--- a/xen/arch/riscv/include/asm/guest_access.h
+++ b/xen/arch/riscv/include/asm/guest_access.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__GUEST_ACCESS_H
-#define ASM__RISCV__GUEST_ACCESS_H
+#ifndef RISCV_GUEST_ACCESS_H
+#define RISCV_GUEST_ACCESS_H
 
 #include <xen/types.h>
 
@@ -25,7 +25,7 @@ unsigned long raw_clear_guest(void *to, unsigned int len);
 unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
                                  unsigned long len);
 
-#endif /* ASM__RISCV__GUEST_ACCESS_H */
+#endif /* RISCV_GUEST_ACCESS_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/guest_atomics.h b/xen/arch/riscv/include/asm/guest_atomics.h
index 22a7551804..1909e66721 100644
--- a/xen/arch/riscv/include/asm/guest_atomics.h
+++ b/xen/arch/riscv/include/asm/guest_atomics.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__GUEST_ATOMICS_H
-#define ASM__RISCV__GUEST_ATOMICS_H
+#ifndef RISCV_GUEST_ATOMICS_H
+#define RISCV_GUEST_ATOMICS_H
 
 #include <xen/bug.h>
 
@@ -32,7 +32,7 @@ guest_testop(test_and_change_bit)
 
 #define guest_test_bit(d, nr, p) ((void)(d), test_bit(nr, p))
 
-#endif /* ASM__RISCV__GUEST_ATOMICS_H */
+#endif /* RISCV_GUEST_ATOMICS_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index 2425430ed1..639ee327dc 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -8,8 +8,8 @@
  * (c) Microchip Technology Inc.
  */
 
-#ifndef ASM_RISCV_IMSIC_H
-#define ASM_RISCV_IMSIC_H
+#ifndef RISCV_IMSIC_H
+#define RISCV_IMSIC_H
 
 #include <xen/rwlock.h>
 #include <xen/spinlock.h>
@@ -96,4 +96,4 @@ unsigned int vcpu_guest_file_id(const struct vcpu *v);
 
 int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
 
-#endif /* ASM_RISCV_IMSIC_H */
+#endif /* RISCV_IMSIC_H */
diff --git a/xen/arch/riscv/include/asm/insn-defs.h b/xen/arch/riscv/include/asm/insn-defs.h
index 61aaa202fd..1bcdbfde3f 100644
--- a/xen/arch/riscv/include/asm/insn-defs.h
+++ b/xen/arch/riscv/include/asm/insn-defs.h
@@ -1,10 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM_RISCV_INSN_DEFS_H
-#define ASM_RISCV_INSN_DEFS_H
+#ifndef RISCV_INSN_DEFS_H
+#define RISCV_INSN_DEFS_H
 
 #define HFENCE_VVMA(vaddr, asid) \
     asm volatile ( "hfence.vvma %z0, %z1" \
                   :: "rJ" (vaddr), "rJ" (asid) : "memory" )
 
-#endif /* ASM_RISCV_INSN_DEFS_H */
+#endif /* RISCV_INSN_DEFS_H */
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index 1bfba7c615..9093173357 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -5,8 +5,8 @@
  * (c) 2024 Vates
  */
 
-#ifndef ASM__RISCV__INTERRUPT_CONTOLLER_H
-#define ASM__RISCV__INTERRUPT_CONTOLLER_H
+#ifndef RISCV_INTC_H
+#define RISCV_INTC_H
 
 struct dt_device_node;
 
@@ -91,4 +91,4 @@ void domain_vintc_deinit(struct domain *d);
 
 int vintc_reserve_virq(const struct domain *d, unsigned int virq);
 
-#endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
+#endif /* RISCV_INTC_H */
diff --git a/xen/arch/riscv/include/asm/io.h b/xen/arch/riscv/include/asm/io.h
index 9aeafd6b3b..547c144b98 100644
--- a/xen/arch/riscv/include/asm/io.h
+++ b/xen/arch/riscv/include/asm/io.h
@@ -35,8 +35,8 @@
  * Copyright (C) 2024 Vates
  */
 
-#ifndef ASM__RISCV__IO_H
-#define ASM__RISCV__IO_H
+#ifndef RISCV_IO_H
+#define RISCV_IO_H
 
 #include <xen/macros.h>
 #include <xen/types.h>
@@ -151,7 +151,7 @@ static inline uint64_t __raw_readq(const volatile void __iomem *addr)
 #define writel(v, c)    ({ __io_bw(); writel_cpu(v, c); __io_aw(); })
 #define writeq(v, c)    ({ __io_bw(); writeq_cpu(v, c); __io_aw(); })
 
-#endif /* ASM__RISCV__IO_H */
+#endif /* RISCV_IO_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/irq.h b/xen/arch/riscv/include/asm/irq.h
index 57e814d90c..2eb68a5baf 100644
--- a/xen/arch/riscv/include/asm/irq.h
+++ b/xen/arch/riscv/include/asm/irq.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__IRQ_H
-#define ASM__RISCV__IRQ_H
+#ifndef RISCV_IRQ_H
+#define RISCV_IRQ_H
 
 #include <xen/bug.h>
 #include <xen/device_tree.h>
@@ -57,7 +57,7 @@ int route_irq_to_guest(struct domain *d, unsigned int virq,
 
 int release_guest_irq(const struct domain *d, unsigned int virq);
 
-#endif /* ASM__RISCV__IRQ_H */
+#endif /* RISCV_IRQ_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/mm-types.h b/xen/arch/riscv/include/asm/mm-types.h
index fa512064b8..a04e8f8b17 100644
--- a/xen/arch/riscv/include/asm/mm-types.h
+++ b/xen/arch/riscv/include/asm/mm-types.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM_RISCV_MM_TYPES_H
-#define ASM_RISCV_MM_TYPES_H
+#ifndef RISCV_MM_TYPES_H
+#define RISCV_MM_TYPES_H
 
 typedef unsigned long pte_attr_t;
 
-#endif /* ASM_RISCV_MM_TYPES_H */
+#endif /* RISCV_MM_TYPES_H */
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 1ac66283ec..bb7c96e7d2 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__MM_H
-#define ASM__RISCV__MM_H
+#ifndef RISCV_MM_H
+#define RISCV_MM_H
 
 #include <public/xen.h>
 #include <xen/bug.h>
@@ -349,4 +349,4 @@ void setup_fixmap_mappings(void);
 
 void *early_fdt_map(paddr_t fdt_paddr);
 
-#endif /* ASM__RISCV__MM_H */
+#endif /* RISCV_MM_H */
diff --git a/xen/arch/riscv/include/asm/monitor.h b/xen/arch/riscv/include/asm/monitor.h
index fb3d3e8e3a..54e08cab8b 100644
--- a/xen/arch/riscv/include/asm/monitor.h
+++ b/xen/arch/riscv/include/asm/monitor.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__MONITOR_H
-#define ASM__RISCV__MONITOR_H
+#ifndef RISCV_MONITOR_H
+#define RISCV_MONITOR_H
 
 #include <xen/bug.h>
 
@@ -14,7 +14,7 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
     return 0;
 }
 
-#endif /* ASM__RISCV__MONITOR_H */
+#endif /* RISCV_MONITOR_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/nospec.h b/xen/arch/riscv/include/asm/nospec.h
index f9b0241c98..c969a9898f 100644
--- a/xen/arch/riscv/include/asm/nospec.h
+++ b/xen/arch/riscv/include/asm/nospec.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (C) 2024 Vates */
 
-#ifndef ASM__RISCV__NOSPEC_H
-#define ASM__RISCV__NOSPEC_H
+#ifndef RISCV_NOSPEC_H
+#define RISCV_NOSPEC_H
 
 static inline bool evaluate_nospec(bool condition)
 {
@@ -13,7 +13,7 @@ static inline void block_speculation(void)
 {
 }
 
-#endif /* ASM__RISCV__NOSPEC_H */
+#endif /* RISCV_NOSPEC_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 0d1dace1a0..c053828151 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__P2M_H
-#define ASM__RISCV__P2M_H
+#ifndef RISCV_P2M_H
+#define RISCV_P2M_H
 
 #include <xen/bitops.h>
 #include <xen/errno.h>
@@ -264,7 +264,7 @@ void p2m_ctxt_switch_from(struct vcpu *p);
 void p2m_ctxt_switch_to(struct vcpu *n);
 void p2m_handle_vmenter(void);
 
-#endif /* ASM__RISCV__P2M_H */
+#endif /* RISCV_P2M_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/page-bits.h b/xen/arch/riscv/include/asm/page-bits.h
index 788c7d9518..73b9f6378c 100644
--- a/xen/arch/riscv/include/asm/page-bits.h
+++ b/xen/arch/riscv/include/asm/page-bits.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__PAGE_BITS_H
-#define ASM__RISCV__PAGE_BITS_H
+#ifndef RISCV_PAGE_BITS_H
+#define RISCV_PAGE_BITS_H
 
 #define PAGE_SHIFT              12 /* 4 KiB Pages */
 #define PADDR_BITS              56 /* 44-bit PPN */
@@ -16,4 +16,4 @@
 
 #define PTE_PPN_SHIFT           10
 
-#endif /* ASM__RISCV__PAGE_BITS_H */
+#endif /* RISCV_PAGE_BITS_H */
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index f9e59e61de..7a2ac2be4d 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__PAGE_H
-#define ASM__RISCV__PAGE_H
+#ifndef RISCV_PAGE_H
+#define RISCV_PAGE_H
 
 #ifndef __ASSEMBLER__
 
@@ -253,4 +253,4 @@ pte_t pt_walk(vaddr_t va, unsigned int *pte_level);
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__PAGE_H */
+#endif /* RISCV_PAGE_H */
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index 103384723d..4f667aa0e7 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -1,5 +1,5 @@
-#ifndef ASM_RISCV_PAGING_H
-#define ASM_RISCV_PAGING_H
+#ifndef RISCV_PAGING_H
+#define RISCV_PAGING_H
 
 #include <asm-generic/paging.h>
 
@@ -18,4 +18,4 @@ void paging_free_page(struct domain *d, struct page_info *pg);
 
 struct page_info *paging_alloc_page(struct domain *d);
 
-#endif /* ASM_RISCV_PAGING_H */
+#endif /* RISCV_PAGING_H */
diff --git a/xen/arch/riscv/include/asm/pmap.h b/xen/arch/riscv/include/asm/pmap.h
index 146dd29f95..842c40ab6a 100644
--- a/xen/arch/riscv/include/asm/pmap.h
+++ b/xen/arch/riscv/include/asm/pmap.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef ASM__RISCV__PMAP_H
-#define ASM__RISCV__PMAP_H
+#ifndef RISCV_PMAP_H
+#define RISCV_PMAP_H
 
 #include <xen/bug.h>
 #include <xen/init.h>
@@ -33,4 +33,4 @@ static inline void __init arch_pmap_unmap(unsigned int slot)
     flush_tlb_one_local(FIXMAP_ADDR(slot));
 }
 
-#endif /* ASM__RISCV__PMAP_H */
+#endif /* RISCV_PMAP_H */
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index b1745c1071..007c22d2e6 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -7,8 +7,8 @@
  *
  */
 
-#ifndef ASM__RISCV__PROCESSOR_H
-#define ASM__RISCV__PROCESSOR_H
+#ifndef RISCV_PROCESSOR_H
+#define RISCV_PROCESSOR_H
 
 #ifndef __ASSEMBLER__
 
@@ -94,7 +94,7 @@ static inline void sfence_vma(void)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__PROCESSOR_H */
+#endif /* RISCV_PROCESSOR_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/regs.h b/xen/arch/riscv/include/asm/regs.h
index 531958f3d7..24674d37cf 100644
--- a/xen/arch/riscv/include/asm/regs.h
+++ b/xen/arch/riscv/include/asm/regs.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__REGS_H
-#define ASM__RISCV__REGS_H
+#ifndef RISCV_REGS_H
+#define RISCV_REGS_H
 
 #ifndef __ASSEMBLER__
 
@@ -17,7 +17,7 @@ static inline bool guest_mode(const struct cpu_user_regs *r)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__REGS_H */
+#endif /* RISCV_REGS_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/riscv_encoding.h b/xen/arch/riscv/include/asm/riscv_encoding.h
index 647268e6d0..f63672fc03 100644
--- a/xen/arch/riscv/include/asm/riscv_encoding.h
+++ b/xen/arch/riscv/include/asm/riscv_encoding.h
@@ -6,8 +6,8 @@
  *   Anup Patel <anup.patel@wdc.com>
  */
 
-#ifndef ASM__RISCV__RISCV_ENCODING_H
-#define ASM__RISCV__RISCV_ENCODING_H
+#ifndef RISCV_RISCV_ENCODING_H
+#define RISCV_RISCV_ENCODING_H
 
 #define _UL(X) _AC(X, UL)
 #define _ULL(X) _AC(X, ULL)
@@ -930,4 +930,4 @@
 
 /* clang-format on */
 
-#endif
+#endif /* RISCV_RISCV_ENCODING_H */
diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index 1952868e96..2a245d0b42 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -9,8 +9,8 @@
  * Copyright (c) 2019 Western Digital Corporation or its affiliates.
  */
 
-#ifndef ASM__RISCV__SBI_H
-#define ASM__RISCV__SBI_H
+#ifndef RISCV_SBI_H
+#define RISCV_SBI_H
 
 #include <xen/cpumask.h>
 
@@ -145,4 +145,4 @@ int sbi_remote_hfence_gvma_vmid(const cpumask_t *cpu_mask, vaddr_t start,
  */
 int sbi_init(void);
 
-#endif /* ASM__RISCV__SBI_H */
+#endif /* RISCV_SBI_H */
diff --git a/xen/arch/riscv/include/asm/setup.h b/xen/arch/riscv/include/asm/setup.h
index 73ce2f2933..8eee8a7463 100644
--- a/xen/arch/riscv/include/asm/setup.h
+++ b/xen/arch/riscv/include/asm/setup.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__SETUP_H
-#define ASM__RISCV__SETUP_H
+#ifndef RISCV_SETUP_H
+#define RISCV_SETUP_H
 
 #include <xen/types.h>
 
@@ -11,7 +11,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 
 void init_csr_masks(void);
 
-#endif /* ASM__RISCV__SETUP_H */
+#endif /* RISCV_SETUP_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/smp.h b/xen/arch/riscv/include/asm/smp.h
index 5dbacf1f9d..625e30b91b 100644
--- a/xen/arch/riscv/include/asm/smp.h
+++ b/xen/arch/riscv/include/asm/smp.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__SMP_H
-#define ASM__RISCV__SMP_H
+#ifndef RISCV_SMP_H
+#define RISCV_SMP_H
 
 #include <xen/cpumask.h>
 #include <xen/macros.h>
@@ -43,7 +43,7 @@ struct dt_device_node;
 int dt_processor_hartid(const struct dt_device_node *node,
                         unsigned long *hartid);
 
-#endif
+#endif /* RISCV_SMP_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/spinlock.h b/xen/arch/riscv/include/asm/spinlock.h
index 4a607eba52..1b43ed0636 100644
--- a/xen/arch/riscv/include/asm/spinlock.h
+++ b/xen/arch/riscv/include/asm/spinlock.h
@@ -1,5 +1,5 @@
-#ifndef ASM__RISCV__SPINLOCK_H
-#define ASM__RISCV__SPINLOCK_H
+#ifndef RISCV_SPINLOCK_H
+#define RISCV_SPINLOCK_H
 
 #define arch_lock_acquire_barrier() smp_mb()
 #define arch_lock_release_barrier() smp_mb()
@@ -12,4 +12,4 @@
     arch_lock_signal();             \
 })
 
-#endif /* ASM__RISCV__SPINLOCK_H */
+#endif /* RISCV_SPINLOCK_H */
diff --git a/xen/arch/riscv/include/asm/string.h b/xen/arch/riscv/include/asm/string.h
index a20af81f67..8dde5c4880 100644
--- a/xen/arch/riscv/include/asm/string.h
+++ b/xen/arch/riscv/include/asm/string.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__STRING_H
-#define ASM__RISCV__STRING_H
+#ifndef RISCV_STRING_H
+#define RISCV_STRING_H
 
-#endif /* ASM__RISCV__STRING_H */
+#endif /* RISCV_STRING_H */
diff --git a/xen/arch/riscv/include/asm/system.h b/xen/arch/riscv/include/asm/system.h
index f33af64fd2..cb38248775 100644
--- a/xen/arch/riscv/include/asm/system.h
+++ b/xen/arch/riscv/include/asm/system.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__SYSTEM_H
-#define ASM__RISCV__SYSTEM_H
+#ifndef RISCV_SYSTEM_H
+#define RISCV_SYSTEM_H
 
 #include <xen/stdbool.h>
 
@@ -78,7 +78,7 @@ static inline bool local_irq_is_enabled(void)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__SYSTEM_H */
+#endif /* RISCV_SYSTEM_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index 4d68900151..0e5b96a863 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__TIME_H
-#define ASM__RISCV__TIME_H
+#ifndef RISCV_TIME_H
+#define RISCV_TIME_H
 
 #include <xen/bug.h>
 #include <xen/muldiv64.h>
@@ -29,7 +29,7 @@ void preinit_xen_time(void);
 
 extern int (* __ro_after_init set_xen_timer)(uint64_t deadline);
 
-#endif /* ASM__RISCV__TIME_H */
+#endif /* RISCV_TIME_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/traps.h b/xen/arch/riscv/include/asm/traps.h
index 21fa3c3259..08c6215e93 100644
--- a/xen/arch/riscv/include/asm/traps.h
+++ b/xen/arch/riscv/include/asm/traps.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__TRAPS_H
-#define ASM__RISCV__TRAPS_H
+#ifndef RISCV_TRAPS_H
+#define RISCV_TRAPS_H
 
 #include <asm/processor.h>
 
@@ -13,4 +13,4 @@ void trap_init(void);
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__TRAPS_H */
+#endif /* RISCV_TRAPS_H */
diff --git a/xen/arch/riscv/include/asm/types.h b/xen/arch/riscv/include/asm/types.h
index d801596a20..b0d4c62aef 100644
--- a/xen/arch/riscv/include/asm/types.h
+++ b/xen/arch/riscv/include/asm/types.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__TYPES_H
-#define ASM__RISCV__TYPES_H
+#ifndef RISCV_TYPES_H
+#define RISCV_TYPES_H
 
 #if defined(CONFIG_RISCV_32)
 
@@ -25,7 +25,7 @@ typedef u64 register_t;
 
 #endif
 
-#endif /* ASM__RISCV__TYPES_H */
+#endif /* RISCV_TYPES_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/vaplic.h b/xen/arch/riscv/include/asm/vaplic.h
index 96080bfbc2..dcbe0d59a8 100644
--- a/xen/arch/riscv/include/asm/vaplic.h
+++ b/xen/arch/riscv/include/asm/vaplic.h
@@ -7,8 +7,8 @@
  * Copyright (c) Microchip.
  */
 
-#ifndef ASM__RISCV__VAPLIC_H
-#define ASM__RISCV__VAPLIC_H
+#ifndef RISCV_VAPLIC_H
+#define RISCV_VAPLIC_H
 
 #include <xen/kernel.h>
 #include <xen/types.h>
@@ -31,4 +31,4 @@ struct vaplic {
 int domain_vaplic_init(struct domain *d);
 void domain_vaplic_deinit(struct domain *d);
 
-#endif /* ASM__RISCV__VAPLIC_H */
+#endif /* RISCV_VAPLIC_H */
diff --git a/xen/arch/riscv/include/asm/vmid.h b/xen/arch/riscv/include/asm/vmid.h
index 1c500c4aff..2b4fc0df8e 100644
--- a/xen/arch/riscv/include/asm/vmid.h
+++ b/xen/arch/riscv/include/asm/vmid.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM_RISCV_VMID_H
-#define ASM_RISCV_VMID_H
+#ifndef RISCV_VMID_H
+#define RISCV_VMID_H
 
 struct vcpu;
 struct vcpu_vmid;
@@ -11,4 +11,4 @@ bool vmid_handle_vmenter(struct vcpu_vmid *vmid);
 void vmid_flush_vcpu(struct vcpu *v);
 void vmid_flush_hart(void);
 
-#endif /* ASM_RISCV_VMID_H */
+#endif /* RISCV_VMID_H */
diff --git a/xen/arch/riscv/include/asm/vsbi.h b/xen/arch/riscv/include/asm/vsbi.h
index fa0cad604e..c39dfbbe3b 100644
--- a/xen/arch/riscv/include/asm/vsbi.h
+++ b/xen/arch/riscv/include/asm/vsbi.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier:  GPL-2.0-only */
 
-#ifndef ASM_RISCV_VSBI_H
-#define ASM_RISCV_VSBI_H
+#ifndef RISCV_VSBI_H
+#define RISCV_VSBI_H
 
 struct cpu_user_regs;
 
@@ -28,4 +28,4 @@ const struct vsbi_ext *vsbi_find_extension(unsigned long eid);
 
 void check_vsbi_ext_ranges(void);
 
-#endif
+#endif /* RISCV_VSBI_H */
diff --git a/xen/arch/riscv/include/asm/vtimer.h b/xen/arch/riscv/include/asm/vtimer.h
index b4d48d1a17..950795be12 100644
--- a/xen/arch/riscv/include/asm/vtimer.h
+++ b/xen/arch/riscv/include/asm/vtimer.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__VTIMER_H
-#define ASM__RISCV__VTIMER_H
+#ifndef RISCV_VTIMER_H
+#define RISCV_VTIMER_H
 
 #include <xen/timer.h>
 
@@ -17,4 +17,4 @@ void vtimer_set_timer(struct vtimer *t, uint64_t ticks);
 void vtimer_ctxt_switch_from(struct vcpu *p);
 void vtimer_ctxt_switch_to(struct vcpu *n);
 
-#endif /* ASM__RISCV__VTIMER_H */
+#endif /* RISCV_VTIMER_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480103.1684053 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPJz-0008Nt-5t; Mon, 09 Nov 2026 13:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480103.1684053; Mon, 09 Nov 2026 13:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPJz-0008Nk-2r; Mon, 09 Nov 2026 13:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1480103;
 Mon, 09 Nov 2026 13:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPJy-0008NS-Gj
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPJy-00000003xhH-0ELE
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPJy-0000000634b-1O8q
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QKIKdKAB2bGMp2Qb3a3utGANk4B/WgqGextmX1J2fqc=; b=gD9G8l/3l5e+cevm99WMor6+r6
	loyYuJk/t9iHsqcU0TJmL0jGYas64iw6xPgF6qxv3tNrauIq3zcMcFaLJagAdPWnfljCJ1PNZeqjh
	D74Q16VL5UkPNSFGLk8U+5fi70y52lPQLPNnCdNyfggdLXjmWQJM4ji+lrSWRcCT05FY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: move SVM feature printout to a separate function
Message-Id: <E1xQPJy-0000000634b-1O8q@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:22:02 +0000

commit df1072bd2d70bd6c08fbfd1c3f29cec56482b91e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Mon Sep 21 13:01:50 2026 -0700
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 9 13:11:05 2026 +0000

    x86/hvm: move SVM feature printout to a separate function
    
    Isolate long SVM feature list printout in a separate function to
    improve readability.
    
    Not a functional change.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.c | 49 +++++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 666bcd3eb4..e11d5c5524 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2434,33 +2434,12 @@ static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
     },
 };
 
-const struct hvm_function_table * __init start_svm(void)
+static void __init print_svm_features(void)
 {
     bool printed = false;
 
-    svm_host_osvw_reset();
-
-    if ( _svm_cpu_up(true) )
-    {
-        setup_clear_cpu_cap(X86_FEATURE_SVM);
-        printk("SVM: failed to initialise.\n");
-        return NULL;
-    }
-
-    setup_vmcb_dump();
-
-    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
-        svm_feature_flags = cpuid_edx(0x8000000aU);
-
     printk("SVM: Supported advanced features:\n");
 
-    /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
-    if ( !cpu_has_svm_nrips )
-        __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
-
-    if ( cpu_has_tsc_ratio )
-        svm_function_table.tsc_scaling.ratio_frac_bits = 32;
-
 #define P(p,s) if ( p ) { printk(" - %s\n", s); printed = 1; }
     P(cpu_has_svm_npt, "Nested Page Tables (NPT)");
     P(cpu_has_svm_lbrv, "Last Branch Record (LBR) Virtualisation");
@@ -2481,11 +2460,37 @@ const struct hvm_function_table * __init start_svm(void)
 
     if ( !printed )
         printk(" - none\n");
+}
+
+const struct hvm_function_table * __init start_svm(void)
+{
+    svm_host_osvw_reset();
+
+    if ( _svm_cpu_up(true) )
+    {
+        setup_clear_cpu_cap(X86_FEATURE_SVM);
+        printk("SVM: failed to initialise.\n");
+        return NULL;
+    }
+
+    setup_vmcb_dump();
+
+    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
+        svm_feature_flags = cpuid_edx(0x8000000aU);
+
+    /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
+    if ( !cpu_has_svm_nrips )
+        __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
+
+    if ( cpu_has_tsc_ratio )
+        svm_function_table.tsc_scaling.ratio_frac_bits = 32;
 
     svm_function_table.caps.hap = cpu_has_svm_npt;
     svm_function_table.caps.hap_superpage_2mb = true;
     svm_function_table.caps.hap_superpage_1gb = cpu_has_page1gb;
 
+    print_svm_features();
+
     return &svm_function_table;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480107.1684055 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPK9-0008V2-6l; Mon, 09 Nov 2026 13:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480107.1684055; Mon, 09 Nov 2026 13:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPK9-0008Uv-49; Mon, 09 Nov 2026 13:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1480107;
 Mon, 09 Nov 2026 13:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPK8-0008Ud-Gm
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPK8-00000003xhL-0g2M
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPK8-000000063BO-1qFL
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QU2Regnsl3H3Gk/wtelaHBdvdzeluDVcQNfS4stbmxA=; b=OwQg/KW6HruTYUuiPRWvspDVVn
	rAdNzNv83vudRpoX+sAH4NhxQeufip8jpq/9/vYwOKf29oU53L/9Ifzwjqq94irBX+vYoSLmi8ovQ
	VT1GEVPMDw7S1Y7nvNi/CkCeVZ47ctSSIB1jkvxu25O6bXIVVXvWp8qdk7y3Ke2lzN6I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/ocaml: Fix cleaning bindings test
Message-Id: <E1xQPK8-000000063BO-1qFL@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:22:12 +0000

commit 853641a3685f937169bbc1d1334aa240c61ef050
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Nov 6 18:17:32 2026 -0500
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 9 13:11:05 2026 +0000

    tools/ocaml: Fix cleaning bindings test
    
    make clean fails in the bindings tests:
    
    make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings'
    rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
    rm: invalid option -- 'c'
    Try 'rm --help' for more information.
    
    LIBS is passed to rm.  Change to BINDINGSLIBS, similar to oxenstored.
    
    Fixes: d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/tests/bindings/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/tests/bindings/Makefile b/tools/ocaml/tests/bindings/Makefile
index 75f8babbaf..02255780bd 100644
--- a/tools/ocaml/tests/bindings/Makefile
+++ b/tools/ocaml/tests/bindings/Makefile
@@ -10,7 +10,7 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
 	-I $(OCAML_TOPLEVEL)/libs/eventchn
 
-LIBS = \
+BINDINGSLIBS = \
 	unix.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
@@ -21,7 +21,7 @@ LIBS = \
 PROGRAMS = test-ocaml-bindings
 OCAML_PROGRAM = test-ocaml-bindings
 
-test-ocaml-bindings_LIBS = $(LIBS)
+test-ocaml-bindings_LIBS = $(BINDINGSLIBS)
 test-ocaml-bindings_MLSORTED = $(shell $(OCAMLDEP) -sort $(OBJS:=.ml))
 test-ocaml-bindings_OBJS = $(test-ocaml-bindings_MLSORTED:.ml=)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480109.1684059 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPKJ-00008a-8A; Mon, 09 Nov 2026 13:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480109.1684059; Mon, 09 Nov 2026 13:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPKJ-00008R-5Y; Mon, 09 Nov 2026 13:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1480109;
 Mon, 09 Nov 2026 13:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPKI-00008J-Km
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPKI-00000003xhf-1BtL
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPKI-000000063Go-2KTe
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IfLHcHCP5c5HhuMjyDXEyfJEclrZkSM+Tuat2fNxZio=; b=uXmrmo/szIF5mvECDdz/8i248B
	8at2LkaEBakSAYnBlTOrypv78hOzXh2ncyT2SNcDqRUT2CiCXmWy0wAYjgS8Tp5g7Qc3yycSup7F9
	+yT0qwoGODMNBhAfYJgGCOuJ0xHXVuehqfb91Ri5EJUoicJ9A9pwz53czsChKIy0OCF8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Revert "xen/gnttab: Drop owner->grant_table check in _cache_flush()"
Message-Id: <E1xQPKI-000000063Go-2KTe@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:22:22 +0000

commit a5c26d0e73d4cde7c4620ea43cbd82ba7b2af02e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 9 12:21:21 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 9 13:11:05 2026 +0000

    Revert "xen/gnttab: Drop owner->grant_table check in _cache_flush()"
    
    The claim that ARM system domains don't own memory is false.
    CONFIG_STATIC_SHM is one example where DOM_IO does own memory.
    
    This reverts commit bec8e3c1fb91b96f337c08c6daf1bb2563b320c0.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2285c4aee8..5e79c012b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3633,7 +3633,7 @@ static int _cache_flush(gnttab_cache_flush_t *cflush, grant_ref_t *cur_ref)
 
     page = mfn_to_page(mfn);
     owner = page_get_owner_and_reference(page);
-    if ( !owner )
+    if ( !owner || !owner->grant_table )
     {
         rcu_unlock_domain(d);
         return -EPERM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480120.1684073 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfI-0004za-2x; Mon, 09 Nov 2026 13:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480120.1684073; Mon, 09 Nov 2026 13:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfI-0004zS-0G; Mon, 09 Nov 2026 13:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1480120;
 Mon, 09 Nov 2026 13:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPfG-0004zC-DA
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfF-00000003y7S-48St
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfG-00000006H5I-16Lg
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rdNnD7AxxBZegfGuhrTkiJLQODH48Qvw2yb0GUMyaHc=; b=KVcMa1Fgk7sYKCJM2dzOdbj+6d
	MMpwz6/Owj0fUZEf7fetAWsGTPeamISm7T3mb0gSpXQNatOtuk1JYZ9aQljsXybke/kG4/HM8Icrj
	Uzn/qqwamsMQXdcSYKjkGftCJ/5AnZahwv4JLe5Na/WRmffAokwNkhoWyI0X+LvWQ1EQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] common: Convert !test_bit(_VPF_down) into is_vcpu_online()
Message-Id: <E1xQPfG-00000006H5I-16Lg@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:44:02 +0000

commit a6e71a63562c2aa638cf1c80e4b3fb79b649dbbc
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Mon Nov 9 11:31:56 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:31:56 2026 +0100

    common: Convert !test_bit(_VPF_down) into is_vcpu_online()
    
    Do the same for test_bit(_VPF_down) into !is_vcpu_online().
    
    No functional change.
    
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domctl.c  | 2 +-
 xen/arch/arm/traps.c   | 2 +-
 xen/arch/arm/vgic.c    | 2 +-
 xen/arch/arm/vpsci.c   | 4 ++--
 xen/arch/x86/pv/shim.c | 2 +-
 xen/arch/x86/traps.c   | 2 +-
 xen/common/domain.c    | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index b76af56fad..292cc92159 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -203,7 +203,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     ctxt->ttbr1 = v->arch.ttbr1;
     ctxt->ttbcr = v->arch.ttbcr;
 
-    if ( !test_bit(_VPF_down, &v->pause_flags) )
+    if ( is_vcpu_online(v) )
         ctxt->flags |= VGCF_online;
 }
 
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 6a5dcef2aa..47a5c6bdd4 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1004,7 +1004,7 @@ static void show_guest_stack(struct vcpu *v, const struct cpu_user_regs *regs)
     void *mapped;
     unsigned long *stack, addr;
 
-    if ( test_bit(_VPF_down, &v->pause_flags) )
+    if ( !is_vcpu_online(v) )
     {
         printk("No stack trace, VCPU offline\n");
         return;
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index acded6a40f..062238a899 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -818,7 +818,7 @@ void vgic_inject_irq(struct domain *d, struct vcpu *v, unsigned int virq,
     }
 
     /* vcpu offline */
-    if ( test_bit(_VPF_down, &v->pause_flags) )
+    if ( !is_vcpu_online(v) )
     {
         spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index ac6af6118f..8c7a70c7a9 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -85,7 +85,7 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
     if ( is_64bit_domain(d) && is_thumb )
         return PSCI_INVALID_ADDRESS;
 
-    if ( !test_bit(_VPF_down, &v->pause_flags) )
+    if ( is_vcpu_online(v) )
         return PSCI_ALREADY_ON;
 
     rc = vpsci_build_guest_context(v, entry_point, context_id, &ctxt);
@@ -195,7 +195,7 @@ static int32_t do_psci_0_2_affinity_info(register_t target_affinity,
         v = d->vcpu[vcpuid];
 
         if ( ( ( v->arch.vmpidr & tmask ) == target_affinity )
-                && ( !test_bit(_VPF_down, &v->pause_flags) ) )
+                && is_vcpu_online(v) )
             return PSCI_0_2_AFFINITY_LEVEL_ON;
     }
 
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 41000b0523..8ec03d7295 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -404,7 +404,7 @@ int pv_shim_shutdown(uint8_t reason)
         /* Stop the singleshot timer. */
         stop_timer(&v->singleshot_timer);
 
-        if ( test_bit(_VPF_down, &v->pause_flags) )
+        if ( !is_vcpu_online(v) )
             BUG_ON(vcpu_reset(v));
 
         if ( v != current )
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index ac01ba0872..5a702fe22c 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -918,7 +918,7 @@ void vcpu_show_execution_state(struct vcpu *v)
 {
     unsigned long flags = 0;
 
-    if ( test_bit(_VPF_down, &v->pause_flags) )
+    if ( !is_vcpu_online(v) )
     {
         printk("*** %pv is offline ***\n", v);
         return;
diff --git a/xen/common/domain.c b/xen/common/domain.c
index b41be89cd0..f3a2634d5f 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -2190,7 +2190,7 @@ long common_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case VCPUOP_down:
         for_each_vcpu ( d, v )
-            if ( v->vcpu_id != vcpuid && !test_bit(_VPF_down, &v->pause_flags) )
+            if ( v->vcpu_id != vcpuid && is_vcpu_online(v) )
             {
                rc = 1;
                break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:44:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480121.1684077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfS-00052p-4P; Mon, 09 Nov 2026 13:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480121.1684077; Mon, 09 Nov 2026 13:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfS-00052h-1g; Mon, 09 Nov 2026 13:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1480121;
 Mon, 09 Nov 2026 13:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPfQ-00052F-Ek
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfQ-00000003y7W-0Pdi
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfQ-00000006HAB-1YRv
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JrQmb56scTzO8C51vw2YVZQUWrigYz9W/3gifcbBBJE=; b=HQRcG7I67q2Lfa76LcZVuw1Kxl
	xZM+jGY96lv4I6Hp0tP63uAgOuPfJUfGgn6f/XIwuco3k3vasGiiKyw1ZZYUS3aHLCZ9onBN6WiQI
	JvbgwK5EZRsdC6kS4/OhFk1sUO9rDy3aDr7I+Jmme7tpOtwHj25lCTqsYjfEPbaVs4y4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/credit: Uncount units dropped by csched_schedule()
Message-Id: <E1xQPfQ-00000006HAB-1YRv@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:44:12 +0000

commit 314d3603905256835c4f8a29a75e3bd5eafb29cf
Author:     Lin Liu <lin.liu01@citrix.com>
AuthorDate: Mon Nov 9 11:32:40 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:32:40 2026 +0100

    xen/credit: Uncount units dropped by csched_schedule()
    
    csched_schedule() takes snext off the runq without decrementing
    nr_runnable, as it is about to run.  A unit that stops being runnable
    is normally removed and uncounted by csched_unit_sleep(), but if the
    pick loop drops it first, the sleep finds nothing to do and the unit
    stays counted:
    
         CPU A                            CPU B
         domain_pause()                   csched_schedule(), lock held
           atomic_inc(&d->pause_count)
                                            __runq_remove(snext)
           vcpu_sleep_sync()                !unit_runnable_state(): drop
             waits for lock                 unlock
             csched_unit_sleep()
               not running, not queued:
               nothing to do
         domain_unpause()
           vcpu_wake()
             runq_insert()                nr_runnable +1 again
    
    Decrement nr_runnable when dropping the unit.
    
    Fixes: 7c7b407e7772 ("xen/sched: introduce unit_runnable_state()")
    Reported-by: Bengang Yuan <bengang.yuan@citrix.com>
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: Lin Liu <lin.liu01@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/credit.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 8df746bf6b..f1a9b4aed1 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1965,7 +1965,8 @@ static void cf_check csched_schedule(
         dec_nr_runnable(sched_cpu);
     }
 
-    do {
+    for ( ; ; )
+    {
         snext = __runq_elem(runq->next);
 
         /* Tasklet work (which runs in idle UNIT context) overrides all else. */
@@ -1993,7 +1994,12 @@ static void cf_check csched_schedule(
         else
             __runq_remove(snext);
 
-    } while ( !unit_runnable_state(snext->unit) );
+        if ( unit_runnable_state(snext->unit) )
+            break;
+
+        /* Dropped snext is off the runq but still counted: uncount it. */
+        dec_nr_runnable(sched_cpu);
+    }
 
     /*
      * Update idlers mask if necessary. When we're idling, other CPUs
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480122.1684080 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfc-000552-5W; Mon, 09 Nov 2026 13:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480122.1684080; Mon, 09 Nov 2026 13:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfc-00054u-31; Mon, 09 Nov 2026 13:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1480122;
 Mon, 09 Nov 2026 13:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPfa-00054f-IH
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfa-00000003y7t-0sLy
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfa-00000006HGz-22cM
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/1Smnk/ED8AHsbZYOE6t8MrqxaYxCK1bocUOWVVWSlM=; b=tAo3c1ESrManveRSd61aSbpkj+
	BUSMXwk+/enZ7EO6WI8Qj6bjs3pruA2pljBgt4Jr9Zahrccv6dxsFbDJrZKoGI0ehgwCLe5UFggou
	Vr/2P20/XlBU84MPu+RVug98NUA8lxo/hWwRAlzmm4VE2X2M1zVfSrSBl2YD10wT/5cg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/EFI: guard against oversized modules
Message-Id: <E1xQPfa-00000006HGz-22cM@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:44:22 +0000

commit f19e7f471ea1659bb960730a8e61017da4147364
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 9 11:33:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:33:14 2026 +0100

    x86/EFI: guard against oversized modules
    
    module_t's mod_end field (which we repurpose to hold a module's size)
    cannot hold values 4Gb and up. Don't let truncation go silently.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <gwd@xenproject.org>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/efi/efi-boot.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d738b839ee..757b2b529b 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -736,6 +736,13 @@ static void __init efi_arch_handle_module(const struct file *file,
     place_string(&mb_modules[mbi.mods_count].string, local_name.s);
     mb_modules[mbi.mods_count].mod_start = file->addr >> PAGE_SHIFT;
     mb_modules[mbi.mods_count].mod_end = file->size;
+
+    if ( mb_modules[mbi.mods_count].mod_end != file->size )
+    {
+        PrintStr(name);
+        blexit(L" is too large");
+    }
+
     ++mbi.mods_count;
     efi_bs->FreePool(ptr);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480123.1684085 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfm-00058T-7H; Mon, 09 Nov 2026 13:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480123.1684085; Mon, 09 Nov 2026 13:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfm-00058M-4Q; Mon, 09 Nov 2026 13:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1480123;
 Mon, 09 Nov 2026 13:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPfk-00057q-MA
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfk-00000003y7x-1KBt
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfk-00000006HSl-2Uvq
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZqOdQgkDqVfvFy5zQ+2k2thfIsjecD/vJL2vs/xlbdA=; b=NvTrIlfkqIZdVq/RtvmBtqLNWf
	JjVFcU+CjVmJTYlrErmILbnWshVZ2rry3RimeI0RKzwwZTgpArGZw1KIoTKkNOoJbRVudU5rGNWVe
	HXK2Qi0G2bSIUblzLSadauStxDeROdJuyxCrmWv3xB42fEBs4fK04mU+izjWevmvSnGU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpuidle: allocate processor_powers[] dynamically
Message-Id: <E1xQPfk-00000006HSl-2Uvq@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:44:32 +0000

commit 3a5de37037f3b88aa66032cffd5108604297230a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 9 11:33:38 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:33:38 2026 +0100

    x86/cpuidle: allocate processor_powers[] dynamically
    
    There's no need to have a NR_CPUS-dimensioned static array there.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/acpi/cpu_idle.c       | 25 +++++++++++++++++++++----
 xen/arch/x86/include/asm/cpuidle.h |  2 +-
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index b2bca4dcf8..874346199e 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -44,6 +44,7 @@
 #include <xen/smp.h>
 #include <xen/softirq.h>
 #include <xen/trace.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/apic.h>
 #include <asm/cpuidle.h>
@@ -149,7 +150,7 @@ custom_param("max_cstate", parse_cstate);
 static bool __read_mostly local_apic_timer_c2_ok;
 boolean_param("lapic_timer_c2_ok", local_apic_timer_c2_ok);
 
-struct acpi_processor_power *__read_mostly processor_powers[NR_CPUS];
+struct acpi_processor_power **__read_mostly processor_powers;
 
 /*
  * This field starts out as zero, and can be set to -1 just to signal it has
@@ -447,7 +448,9 @@ static void cf_check dump_cx(unsigned char key)
 
 static int __init cf_check cpu_idle_key_init(void)
 {
-    register_keyhandler('c', dump_cx, "dump ACPI Cx structures", 1);
+    if ( processor_powers )
+        register_keyhandler('c', dump_cx, "dump ACPI Cx structures", 1);
+
     return 0;
 }
 __initcall(cpu_idle_key_init);
@@ -1339,6 +1342,9 @@ long set_cx_pminfo(uint32_t acpi_id, struct xen_processor_power *power)
     if ( vendor_override > 0 )
         return 0;
 
+    if ( !processor_powers )
+        return -ENOMEM;
+
     print_cx_pminfo(acpi_id, power);
 
     cpu_id = get_cpu_id(acpi_id);
@@ -1512,12 +1518,14 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 #ifdef CONFIG_PM_STATS
 uint32_t pmstat_get_cx_nr(unsigned int cpu)
 {
-    return processor_powers[cpu] ? processor_powers[cpu]->count : 0;
+    return processor_powers && processor_powers[cpu]
+           ? processor_powers[cpu]->count : 0;
 }
 
 int pmstat_get_cx_stat(unsigned int cpu, struct pm_cx_stat *stat)
 {
-    struct acpi_processor_power *power = processor_powers[cpu];
+    struct acpi_processor_power *power = processor_powers
+                                         ? processor_powers[cpu] : NULL;
     uint64_t idle_usage = 0, idle_res = 0;
     uint64_t last_state_update_tick, current_stime, current_tick;
     uint64_t usage[ACPI_PROCESSOR_MAX_POWER] = { 0 };
@@ -1694,6 +1702,15 @@ static int __init cf_check cpuidle_presmp_init(void)
     if ( !xen_cpuidle )
         return 0;
 
+    processor_powers = xvzalloc_array(struct acpi_processor_power *,
+                                      nr_cpu_ids);
+    if ( !processor_powers )
+    {
+        printk("CPUIDLE: disabled - not enough memory\n");
+        xen_cpuidle = 0;
+        return -ENOMEM;
+    }
+
     mwait_idle_init(&cpu_nfb);
     cpu_nfb.notifier_call(&cpu_nfb, CPU_UP_PREPARE, cpu);
     cpu_nfb.notifier_call(&cpu_nfb, CPU_ONLINE, cpu);
diff --git a/xen/arch/x86/include/asm/cpuidle.h b/xen/arch/x86/include/asm/cpuidle.h
index 3a6b73142b..00cef39402 100644
--- a/xen/arch/x86/include/asm/cpuidle.h
+++ b/xen/arch/x86/include/asm/cpuidle.h
@@ -5,7 +5,7 @@
 #include <xen/notifier.h>
 #include <xen/sched.h>
 
-extern struct acpi_processor_power *processor_powers[];
+extern struct acpi_processor_power **processor_powers;
 
 extern void (*pm_idle_save)(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480124.1684089 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfw-0005CD-9e; Mon, 09 Nov 2026 13:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480124.1684089; Mon, 09 Nov 2026 13:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPfw-0005C5-77; Mon, 09 Nov 2026 13:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1480124;
 Mon, 09 Nov 2026 13:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPfu-0005Ai-Oz
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfu-00000003y83-1kz9
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPfu-00000006HYu-2ydi
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hMXIbCFySYeGdMxSrx1WlTJ5fDos2xNTONehg47eKws=; b=GXe6dk6kf+SCYP9mCYovidv75Z
	y/iIxk0yd3MjZOA+pSyyuVRlZDCQxYQaBk9jFa96ZkrVUMNOEMaVWzPHCar6FgzOj1vG5i4sE6zuH
	Q+A9teMS1K2lxIalwTvx6uLRRXSux2hxZsuwiBPgtpwrsrfafm+KyDXuo9jiJJaLJwLU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpufreq: allocate processor_pminfo[] dynamically
Message-Id: <E1xQPfu-00000006HYu-2ydi@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:44:42 +0000

commit 05457c29c0504bb50edef32de2093861876ad600
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 9 11:34:09 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:34:09 2026 +0100

    x86/cpufreq: allocate processor_pminfo[] dynamically
    
    There's no need to have a NR_CPUS-dimensioned static array there.
    
    As ordering of pre-SMP initcalls isn't well-defined, allocate the array
    from both cpufreq_presmp_init() and cpufreq_register_driver().
    
    Alongside adding a few NULL checks, drop a redundant one from
    get_cpufreq_para().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/drivers/acpi/pm-op.c                  |  5 ++---
 xen/drivers/acpi/pmstat.c                 |  2 +-
 xen/drivers/cpufreq/cpufreq.c             | 22 +++++++++++++++++++---
 xen/drivers/cpufreq/utility.c             |  2 +-
 xen/include/acpi/cpufreq/processor_perf.h |  2 +-
 5 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/acpi/pm-op.c b/xen/drivers/acpi/pm-op.c
index 07bddc58d9..47304a4063 100644
--- a/xen/drivers/acpi/pm-op.c
+++ b/xen/drivers/acpi/pm-op.c
@@ -104,8 +104,7 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     pmpt = processor_pminfo[op->cpuid];
     policy = per_cpu(cpufreq_cpu_policy, op->cpuid);
 
-    if ( !pmpt ||
-         ((pmpt->init & XEN_PX_INIT) && !pmpt->perf.states) ||
+    if ( ((pmpt->init & XEN_PX_INIT) && !pmpt->perf.states) ||
          /* Avoid NULL deref of pmpt->perf.states[] */
          ((pmpt->init & XEN_CPPC_INIT) && pmpt->perf.state_count) ||
          !policy || !policy->governor )
@@ -369,7 +368,7 @@ int do_pm_op(struct xen_sysctl_pm_op *op)
 
     if ( op->cpuid >= nr_cpu_ids || !cpu_online(op->cpuid) )
         return -EINVAL;
-    pmpt = processor_pminfo[op->cpuid];
+    pmpt = processor_pminfo ? processor_pminfo[op->cpuid] : NULL;
 
     switch ( op->cmd & PM_PARA_CATEGORY_MASK )
     {
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index 0f31736df2..a67b120128 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -227,7 +227,7 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
 
     if ( !op || (op->cpuid >= nr_cpu_ids) || !cpu_online(op->cpuid) )
         return -EINVAL;
-    pmpt = processor_pminfo[op->cpuid];
+    pmpt = processor_pminfo ? processor_pminfo[op->cpuid] : NULL;
 
     switch ( op->type & PMSTAT_CATEGORY_MASK )
     {
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 4b74f5590b..9476ac23b9 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -218,7 +218,7 @@ int cpufreq_limit_change(unsigned int cpu)
     struct cpufreq_policy policy;
 
     if (!cpu_online(cpu) || !(data = per_cpu(cpufreq_cpu_policy, cpu)) ||
-        !processor_pminfo[cpu])
+        !processor_pminfo || !processor_pminfo[cpu])
         return -ENODEV;
 
     perf = &processor_pminfo[cpu]->perf;
@@ -273,7 +273,7 @@ int cpufreq_add_cpu(unsigned int cpu)
     unsigned int shared_type;
 
     /* to protect the case when Px was not controlled by xen */
-    if ( !processor_pminfo[cpu] || !cpu_online(cpu) )
+    if ( !processor_pminfo || !processor_pminfo[cpu] || !cpu_online(cpu) )
         return -EINVAL;
 
     if ( !(processor_pminfo[cpu]->init & (XEN_PX_INIT | XEN_CPPC_INIT)) )
@@ -448,7 +448,7 @@ int cpufreq_del_cpu(unsigned int cpu)
     const struct xen_psd_package *domain_info;
 
     /* to protect the case when Px was not controlled by xen */
-    if ( !processor_pminfo[cpu] || !cpu_online(cpu) )
+    if ( !processor_pminfo || !processor_pminfo[cpu] || !cpu_online(cpu) )
         return -EINVAL;
 
     if ( !(processor_pminfo[cpu]->init & (XEN_PX_INIT | XEN_CPPC_INIT)) )
@@ -563,6 +563,9 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf)
     struct processor_pminfo *pmpt;
     struct processor_performance *pxpt;
 
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
     cpu = get_cpu_id(acpi_id);
     if ( cpu < 0 || !perf )
     {
@@ -726,6 +729,9 @@ int set_cppc_pminfo(unsigned int acpi_id,
     int ret = 0, cpu_id;
     struct processor_pminfo *pm_info;
 
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
     cpu_id = get_cpu_id(acpi_id);
     if ( cpu_id < 0 )
     {
@@ -947,6 +953,11 @@ static struct notifier_block cpu_nfb = {
 
 static int __init cf_check cpufreq_presmp_init(void)
 {
+    if ( !processor_pminfo )
+        processor_pminfo = xvzalloc_array(struct processor_pminfo *, nr_cpu_ids);
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
     register_cpu_notifier(&cpu_nfb);
     return 0;
 }
@@ -954,6 +965,11 @@ presmp_initcall(cpufreq_presmp_init);
 
 int __init cpufreq_register_driver(const struct cpufreq_driver *driver_data)
 {
+    if ( !processor_pminfo )
+        processor_pminfo = xvzalloc_array(struct processor_pminfo *, nr_cpu_ids);
+    if ( !processor_pminfo )
+        return -ENOMEM;
+
    if ( !driver_data || !driver_data->init ||
         !driver_data->verify || !driver_data->exit ||
         (!driver_data->target == !driver_data->setpolicy) )
diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index e2cc9ff2af..9bd2a399b3 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -32,7 +32,7 @@
 #include <public/sysctl.h>
 
 struct cpufreq_driver __read_mostly cpufreq_driver;
-struct processor_pminfo *__read_mostly processor_pminfo[NR_CPUS];
+struct processor_pminfo **__read_mostly processor_pminfo;
 DEFINE_PER_CPU_READ_MOSTLY(struct cpufreq_policy *, cpufreq_cpu_policy);
 
 /*********************************************************************
diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h
index 0a87bc0384..eb5a0d57e1 100644
--- a/xen/include/acpi/cpufreq/processor_perf.h
+++ b/xen/include/acpi/cpufreq/processor_perf.h
@@ -59,7 +59,7 @@ struct processor_pminfo {
     uint32_t init;
 };
 
-extern struct processor_pminfo *processor_pminfo[NR_CPUS];
+extern struct processor_pminfo **processor_pminfo;
 
 struct px_stat {
     uint8_t total;        /* total Px states */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 13:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 13:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480125.1684093 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPg6-0005EL-Bd; Mon, 09 Nov 2026 13:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480125.1684093; Mon, 09 Nov 2026 13:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQPg6-0005ED-8b; Mon, 09 Nov 2026 13:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1480125;
 Mon, 09 Nov 2026 13:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQPg4-0005E6-T8
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 13:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPg4-00000003y87-2FqW
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQPg4-00000006Hc5-3SD7
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 13:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3dqpWNY01Ue+vj71qt/iNbM2qKOeQCuo5/jicwSNPHs=; b=ssSP2DzNk5zzYAXeBMWn5Rgdj1
	NKBaWkppWO/09xUtlivx/ZRhdI7yK9dgNH5xwj8Ng6t0SuMFLQBFJVo8mplMKhtEQdazGNghYZh/n
	ats4I0WDpZXoHvPLNOVdkBHz4+glJ0irA5gMddSharNl0wHhIBqcg3i2g1oCL+OVkAAw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: align header inclusion guards with CODING_STYLE
Message-Id: <E1xQPg4-00000006Hc5-3SD7@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 13:44:52 +0000

commit 9c5cd8c816491bd1dd6bd50f553a60a20f7f94f8
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Nov 9 11:34:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 9 11:34:58 2026 +0100

    xen/riscv: align header inclusion guards with CODING_STYLE
    
    Commit 7abea85c9f12 ("CODING_STYLE: Updated header guard
    recommendations") changed the recommended naming of inclusion guards
    for arch-specific headers to <arch>_<something>_H. Most RISC-V headers
    still use the ASM__RISCV__<FILENAME>_H form required by the previous
    rules, and a few use ASM_RISCV_<FILENAME>_H, which follows neither.
    
    Rename the guards to RISCV_<SOMETHING>_H. While doing so, also fix two
    guards which don't match their file names: extable.h used
    ASM__RISCV__ASM_EXTABLE_H and intc.h used the misspelt
    ASM__RISCV__INTERRUPT_CONTOLLER_H.
    
    No functional change.
    
    Assisted-by: Claude-Code:claude-opus-5-5
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/aplic-priv.h                 | 6 +++---
 xen/arch/riscv/include/asm/acpi.h           | 6 +++---
 xen/arch/riscv/include/asm/aplic.h          | 6 +++---
 xen/arch/riscv/include/asm/asm.h            | 6 +++---
 xen/arch/riscv/include/asm/atomic.h         | 6 +++---
 xen/arch/riscv/include/asm/bitops.h         | 6 +++---
 xen/arch/riscv/include/asm/bug.h            | 6 +++---
 xen/arch/riscv/include/asm/cache.h          | 6 +++---
 xen/arch/riscv/include/asm/cmpxchg.h        | 6 +++---
 xen/arch/riscv/include/asm/config.h         | 6 +++---
 xen/arch/riscv/include/asm/cpufeature.h     | 6 +++---
 xen/arch/riscv/include/asm/csr.h            | 6 +++---
 xen/arch/riscv/include/asm/current.h        | 6 +++---
 xen/arch/riscv/include/asm/domain.h         | 6 +++---
 xen/arch/riscv/include/asm/early_printk.h   | 6 +++---
 xen/arch/riscv/include/asm/event.h          | 6 +++---
 xen/arch/riscv/include/asm/extable.h        | 6 +++---
 xen/arch/riscv/include/asm/fence.h          | 6 +++---
 xen/arch/riscv/include/asm/fixmap.h         | 6 +++---
 xen/arch/riscv/include/asm/flushtlb.h       | 6 +++---
 xen/arch/riscv/include/asm/guest-layout.h   | 6 +++---
 xen/arch/riscv/include/asm/guest_access.h   | 6 +++---
 xen/arch/riscv/include/asm/guest_atomics.h  | 6 +++---
 xen/arch/riscv/include/asm/imsic.h          | 6 +++---
 xen/arch/riscv/include/asm/insn-defs.h      | 6 +++---
 xen/arch/riscv/include/asm/intc.h           | 6 +++---
 xen/arch/riscv/include/asm/io.h             | 6 +++---
 xen/arch/riscv/include/asm/irq.h            | 6 +++---
 xen/arch/riscv/include/asm/mm-types.h       | 6 +++---
 xen/arch/riscv/include/asm/mm.h             | 6 +++---
 xen/arch/riscv/include/asm/monitor.h        | 6 +++---
 xen/arch/riscv/include/asm/nospec.h         | 6 +++---
 xen/arch/riscv/include/asm/p2m.h            | 6 +++---
 xen/arch/riscv/include/asm/page-bits.h      | 6 +++---
 xen/arch/riscv/include/asm/page.h           | 6 +++---
 xen/arch/riscv/include/asm/paging.h         | 6 +++---
 xen/arch/riscv/include/asm/pmap.h           | 6 +++---
 xen/arch/riscv/include/asm/processor.h      | 6 +++---
 xen/arch/riscv/include/asm/regs.h           | 6 +++---
 xen/arch/riscv/include/asm/riscv_encoding.h | 6 +++---
 xen/arch/riscv/include/asm/sbi.h            | 6 +++---
 xen/arch/riscv/include/asm/setup.h          | 6 +++---
 xen/arch/riscv/include/asm/smp.h            | 6 +++---
 xen/arch/riscv/include/asm/spinlock.h       | 6 +++---
 xen/arch/riscv/include/asm/string.h         | 6 +++---
 xen/arch/riscv/include/asm/system.h         | 6 +++---
 xen/arch/riscv/include/asm/time.h           | 6 +++---
 xen/arch/riscv/include/asm/traps.h          | 6 +++---
 xen/arch/riscv/include/asm/types.h          | 6 +++---
 xen/arch/riscv/include/asm/vaplic.h         | 6 +++---
 xen/arch/riscv/include/asm/vmid.h           | 6 +++---
 xen/arch/riscv/include/asm/vsbi.h           | 6 +++---
 xen/arch/riscv/include/asm/vtimer.h         | 6 +++---
 53 files changed, 159 insertions(+), 159 deletions(-)

diff --git a/xen/arch/riscv/aplic-priv.h b/xen/arch/riscv/aplic-priv.h
index 35100d3a64..009020c83f 100644
--- a/xen/arch/riscv/aplic-priv.h
+++ b/xen/arch/riscv/aplic-priv.h
@@ -11,8 +11,8 @@
  * Copyright (c) Vates.
  */
 
-#ifndef ASM_RISCV_APLIC_PRIV_H
-#define ASM_RISCV_APLIC_PRIV_H
+#ifndef RISCV_APLIC_PRIV_H
+#define RISCV_APLIC_PRIV_H
 
 #include <xen/spinlock.h>
 #include <xen/types.h>
@@ -47,4 +47,4 @@ struct aplic_priv {
  */
 extern unsigned int guest_aplic_num_sources;
 
-#endif /* ASM_RISCV_APLIC_PRIV_H */
+#endif /* RISCV_APLIC_PRIV_H */
diff --git a/xen/arch/riscv/include/asm/acpi.h b/xen/arch/riscv/include/asm/acpi.h
index 0c553bd6b8..8c769b2c0b 100644
--- a/xen/arch/riscv/include/asm/acpi.h
+++ b/xen/arch/riscv/include/asm/acpi.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__ACPI_H
-#define ASM__RISCV__ACPI_H
+#ifndef RISCV_ACPI_H
+#define RISCV_ACPI_H
 
-#endif /* ASM__RISCV__ACPI_H */
+#endif /* RISCV_ACPI_H */
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index a2af55d54f..51be469b69 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -8,8 +8,8 @@
  * Copyright (c) Microchip.
  */
 
-#ifndef ASM_RISCV_APLIC_H
-#define ASM_RISCV_APLIC_H
+#ifndef RISCV_APLIC_H
+#define RISCV_APLIC_H
 
 #include <xen/types.h>
 
@@ -141,4 +141,4 @@ struct aplic_regs {
     uint32_t target[1023];      /* 0x3004 */
 };
 
-#endif /* ASM_RISCV_APLIC_H */
+#endif /* RISCV_APLIC_H */
diff --git a/xen/arch/riscv/include/asm/asm.h b/xen/arch/riscv/include/asm/asm.h
index e147b6f053..a663db4c23 100644
--- a/xen/arch/riscv/include/asm/asm.h
+++ b/xen/arch/riscv/include/asm/asm.h
@@ -3,8 +3,8 @@
  * Copyright (C) 2015 Regents of the University of California
  */
 
-#ifndef ASM__RISCV__ASM_H
-#define ASM__RISCV__ASM_H
+#ifndef RISCV_ASM_H
+#define RISCV_ASM_H
 
 #ifdef __ASSEMBLER__
 #include <xen/linkage.h>
@@ -52,4 +52,4 @@
 #error "Unexpected __SIZEOF_SHORT__"
 #endif
 
-#endif /* ASM__RISCV__ASM_H */
+#endif /* RISCV_ASM_H */
diff --git a/xen/arch/riscv/include/asm/atomic.h b/xen/arch/riscv/include/asm/atomic.h
index 8e0425cea0..3a0184d35d 100644
--- a/xen/arch/riscv/include/asm/atomic.h
+++ b/xen/arch/riscv/include/asm/atomic.h
@@ -19,8 +19,8 @@
  * Copyright (C) 2024 Vates SAS
  */
 
-#ifndef ASM__RISCV__ATOMIC_H
-#define ASM__RISCV__ATOMIC_H
+#ifndef RISCV_ATOMIC_H
+#define RISCV_ATOMIC_H
 
 #include <xen/atomic.h>
 
@@ -266,7 +266,7 @@ ATOMIC_OPS()
 #undef ATOMIC_OPS
 #undef ATOMIC_OP
 
-#endif /* ASM__RISCV__ATOMIC_H */
+#endif /* RISCV_ATOMIC_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/bitops.h b/xen/arch/riscv/include/asm/bitops.h
index 72a4a8c155..471eb07bd2 100644
--- a/xen/arch/riscv/include/asm/bitops.h
+++ b/xen/arch/riscv/include/asm/bitops.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (C) 2012 Regents of the University of California */
 
-#ifndef ASM__RISCV__BITOPS_H
-#define ASM__RISCV__BITOPS_H
+#ifndef RISCV_BITOPS_H
+#define RISCV_BITOPS_H
 
 #include <asm/system.h>
 
@@ -132,7 +132,7 @@ static inline void clear_bit(int nr, volatile void *p)
 
 #define arch_hweightl(x) __builtin_popcountl(x)
 
-#endif /* ASM__RISCV__BITOPS_H */
+#endif /* RISCV_BITOPS_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/bug.h b/xen/arch/riscv/include/asm/bug.h
index c2cdc2dc2a..8834dcea81 100644
--- a/xen/arch/riscv/include/asm/bug.h
+++ b/xen/arch/riscv/include/asm/bug.h
@@ -4,8 +4,8 @@
  * Copyright (C) 2021-2023 Vates
  *
  */
-#ifndef ASM__RISCV__BUG_H
-#define ASM__RISCV__BUG_H
+#ifndef RISCV_BUG_H
+#define RISCV_BUG_H
 
 #ifndef __ASSEMBLER__
 
@@ -15,4 +15,4 @@
 
 #endif /* !__ASSEMBLER__ */
 
-#endif /* ASM__RISCV__BUG_H */
+#endif /* RISCV_BUG_H */
diff --git a/xen/arch/riscv/include/asm/cache.h b/xen/arch/riscv/include/asm/cache.h
index d4cf1ac8e2..6b8dff48b7 100644
--- a/xen/arch/riscv/include/asm/cache.h
+++ b/xen/arch/riscv/include/asm/cache.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__CACHE_H
-#define ASM__RISCV__CACHE_H
+#ifndef RISCV_CACHE_H
+#define RISCV_CACHE_H
 
-#endif /* ASM__RISCV__CACHE_H */
+#endif /* RISCV_CACHE_H */
diff --git a/xen/arch/riscv/include/asm/cmpxchg.h b/xen/arch/riscv/include/asm/cmpxchg.h
index d47ebaffce..12268d0bab 100644
--- a/xen/arch/riscv/include/asm/cmpxchg.h
+++ b/xen/arch/riscv/include/asm/cmpxchg.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (C) 2014 Regents of the University of California */
 
-#ifndef ASM__RISCV__CMPXCHG_H
-#define ASM__RISCV__CMPXCHG_H
+#ifndef RISCV_CMPXCHG_H
+#define RISCV_CMPXCHG_H
 
 #include <xen/bitops.h>
 #include <xen/compiler.h>
@@ -230,7 +230,7 @@ static always_inline unsigned long __cmpxchg(volatile void *ptr,
               sizeof(*(ptr))); \
 })
 
-#endif /* ASM__RISCV__CMPXCHG_H */
+#endif /* RISCV_CMPXCHG_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index fd69057826..8d43ee76da 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__CONFIG_H
-#define ASM__RISCV__CONFIG_H
+#ifndef RISCV_CONFIG_H
+#define RISCV_CONFIG_H
 
 #include <xen/const.h>
 #include <xen/page-size.h>
@@ -164,7 +164,7 @@ extern unsigned long phys_offset; /* = load_start - XEN_VIRT_START */
 #error "Define KERNEL_LOAD_ADDR_ALIGNMENT"
 #endif
 
-#endif /* ASM__RISCV__CONFIG_H */
+#endif /* RISCV_CONFIG_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index b0a23be18e..d42189e8eb 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__CPUFEATURE_H
-#define ASM__RISCV__CPUFEATURE_H
+#ifndef RISCV_CPUFEATURE_H
+#define RISCV_CPUFEATURE_H
 
 #ifndef __ASSEMBLER__
 
@@ -57,7 +57,7 @@ bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__CPUFEATURE_H */
+#endif /* RISCV_CPUFEATURE_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/csr.h b/xen/arch/riscv/include/asm/csr.h
index 888d6a2a86..a805f7ed0b 100644
--- a/xen/arch/riscv/include/asm/csr.h
+++ b/xen/arch/riscv/include/asm/csr.h
@@ -3,8 +3,8 @@
  * Copyright (C) 2015 Regents of the University of California
  */
 
-#ifndef ASM__RISCV__CSR_H
-#define ASM__RISCV__CSR_H
+#ifndef RISCV_CSR_H
+#define RISCV_CSR_H
 
 #include <xen/const.h>
 
@@ -128,4 +128,4 @@ static always_inline bool csr_read_safe(unsigned long csr,
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__CSR_H */
+#endif /* RISCV_CSR_H */
diff --git a/xen/arch/riscv/include/asm/current.h b/xen/arch/riscv/include/asm/current.h
index 78ec52fd8a..06683d7ae0 100644
--- a/xen/arch/riscv/include/asm/current.h
+++ b/xen/arch/riscv/include/asm/current.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__CURRENT_H
-#define ASM__RISCV__CURRENT_H
+#ifndef RISCV_CURRENT_H
+#define RISCV_CURRENT_H
 
 #include <xen/bug.h>
 #include <xen/cache.h>
@@ -62,4 +62,4 @@ DECLARE_PER_CPU(struct vcpu *, curr_vcpu);
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__CURRENT_H */
+#endif /* RISCV_CURRENT_H */
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index e035b33ddf..98e5e72e58 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__DOMAIN_H
-#define ASM__RISCV__DOMAIN_H
+#ifndef RISCV_DOMAIN_H
+#define RISCV_DOMAIN_H
 
 #include <xen/mm.h>
 #include <xen/spinlock.h>
@@ -128,7 +128,7 @@ int vcpu_unset_interrupt(struct vcpu *v, unsigned int irq);
 void vcpu_sync_interrupts(struct vcpu *curr);
 void vcpu_flush_interrupts(struct vcpu *curr);
 
-#endif /* ASM__RISCV__DOMAIN_H */
+#endif /* RISCV_DOMAIN_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/early_printk.h b/xen/arch/riscv/include/asm/early_printk.h
index 2750045bdd..240b7f539a 100644
--- a/xen/arch/riscv/include/asm/early_printk.h
+++ b/xen/arch/riscv/include/asm/early_printk.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__EARLY_PRINTK_H
-#define ASM__RISCV__EARLY_PRINTK_H
+#ifndef RISCV_EARLY_PRINTK_H
+#define RISCV_EARLY_PRINTK_H
 
 #include <xen/early_printk.h>
 
@@ -11,4 +11,4 @@ void early_printk(const char *str);
 static inline void early_printk(const char *s) {};
 #endif
 
-#endif /* ASM__RISCV__EARLY_PRINTK_H */
+#endif /* RISCV_EARLY_PRINTK_H */
diff --git a/xen/arch/riscv/include/asm/event.h b/xen/arch/riscv/include/asm/event.h
index 116434c665..a1fc0bc6fd 100644
--- a/xen/arch/riscv/include/asm/event.h
+++ b/xen/arch/riscv/include/asm/event.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__EVENT_H
-#define ASM__RISCV__EVENT_H
+#ifndef RISCV_EVENT_H
+#define RISCV_EVENT_H
 
 #include <xen/lib.h>
 
@@ -29,7 +29,7 @@ static inline enum virq_type arch_get_virq_type(unsigned int virq)
     return VIRQ_GLOBAL;
 }
 
-#endif /* ASM__RISCV__EVENT_H */
+#endif /* RISCV_EVENT_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/extable.h b/xen/arch/riscv/include/asm/extable.h
index c0128a9181..0209b2f3bf 100644
--- a/xen/arch/riscv/include/asm/extable.h
+++ b/xen/arch/riscv/include/asm/extable.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__ASM_EXTABLE_H
-#define ASM__RISCV__ASM_EXTABLE_H
+#ifndef RISCV_EXTABLE_H
+#define RISCV_EXTABLE_H
 
 #ifdef __ASSEMBLER__
 
@@ -55,4 +55,4 @@ bool fixup_exception(struct cpu_user_regs *regs);
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* ASM__RISCV__ASM_EXTABLE_H */
+#endif /* RISCV_EXTABLE_H */
diff --git a/xen/arch/riscv/include/asm/fence.h b/xen/arch/riscv/include/asm/fence.h
index edfaac49cd..f5dd3096e5 100644
--- a/xen/arch/riscv/include/asm/fence.h
+++ b/xen/arch/riscv/include/asm/fence.h
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
-#ifndef ASM__RISCV__FENCE_H
-#define ASM__RISCV__FENCE_H
+#ifndef RISCV_FENCE_H
+#define RISCV_FENCE_H
 
 #define RISCV_ACQUIRE_BARRIER   "\tfence r , rw\n"
 #define RISCV_RELEASE_BARRIER   "\tfence rw, w\n"
 #define RISCV_FULL_BARRIER      "\tfence rw, rw\n"
 
-#endif	/* ASM__RISCV__FENCE_H */
+#endif	/* RISCV_FENCE_H */
diff --git a/xen/arch/riscv/include/asm/fixmap.h b/xen/arch/riscv/include/asm/fixmap.h
index 085d135c15..7e907c3d1c 100644
--- a/xen/arch/riscv/include/asm/fixmap.h
+++ b/xen/arch/riscv/include/asm/fixmap.h
@@ -2,8 +2,8 @@
 /*
  * fixmap.h: compile-time virtual memory allocation
  */
-#ifndef ASM__RISCV__FIXMAP_H
-#define ASM__RISCV__FIXMAP_H
+#ifndef RISCV_FIXMAP_H
+#define RISCV_FIXMAP_H
 
 #include <xen/bug.h>
 #include <xen/page-size.h>
@@ -48,4 +48,4 @@ static inline unsigned int virt_to_fix(vaddr_t vaddr)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__FIXMAP_H */
+#endif /* RISCV_FIXMAP_H */
diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index b0112d416d..e1d17430da 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__FLUSHTLB_H
-#define ASM__RISCV__FLUSHTLB_H
+#ifndef RISCV_FLUSHTLB_H
+#define RISCV_FLUSHTLB_H
 
 #include <xen/bug.h>
 #include <xen/cpumask.h>
@@ -53,7 +53,7 @@ static inline void arch_flush_tlb_mask(const cpumask_t *mask)
     sbi_remote_hfence_gvma(mask, 0, 0);
 }
 
-#endif /* ASM__RISCV__FLUSHTLB_H */
+#endif /* RISCV_FLUSHTLB_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index ceed9125e7..52d1f2e108 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -1,5 +1,5 @@
-#ifndef ASM_RISCV_GUEST_LAYOUT_H
-#define ASM_RISCV_GUEST_LAYOUT_H
+#ifndef RISCV_GUEST_LAYOUT_H
+#define RISCV_GUEST_LAYOUT_H
 
 #include <public/xen.h>
 
@@ -44,4 +44,4 @@
 #define GUEST_MAGIC_BASE  _UL(0x79000000)
 #define GUEST_MAGIC_SIZE  _UL(0x00200000)
 
-#endif /* ASM_RISCV_GUEST_LAYOUT_H */
+#endif /* RISCV_GUEST_LAYOUT_H */
diff --git a/xen/arch/riscv/include/asm/guest_access.h b/xen/arch/riscv/include/asm/guest_access.h
index 8d679319de..e94aa838a3 100644
--- a/xen/arch/riscv/include/asm/guest_access.h
+++ b/xen/arch/riscv/include/asm/guest_access.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__GUEST_ACCESS_H
-#define ASM__RISCV__GUEST_ACCESS_H
+#ifndef RISCV_GUEST_ACCESS_H
+#define RISCV_GUEST_ACCESS_H
 
 #include <xen/types.h>
 
@@ -25,7 +25,7 @@ unsigned long raw_clear_guest(void *to, unsigned int len);
 unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
                                  unsigned long len);
 
-#endif /* ASM__RISCV__GUEST_ACCESS_H */
+#endif /* RISCV_GUEST_ACCESS_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/guest_atomics.h b/xen/arch/riscv/include/asm/guest_atomics.h
index 22a7551804..1909e66721 100644
--- a/xen/arch/riscv/include/asm/guest_atomics.h
+++ b/xen/arch/riscv/include/asm/guest_atomics.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__GUEST_ATOMICS_H
-#define ASM__RISCV__GUEST_ATOMICS_H
+#ifndef RISCV_GUEST_ATOMICS_H
+#define RISCV_GUEST_ATOMICS_H
 
 #include <xen/bug.h>
 
@@ -32,7 +32,7 @@ guest_testop(test_and_change_bit)
 
 #define guest_test_bit(d, nr, p) ((void)(d), test_bit(nr, p))
 
-#endif /* ASM__RISCV__GUEST_ATOMICS_H */
+#endif /* RISCV_GUEST_ATOMICS_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index 2425430ed1..639ee327dc 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -8,8 +8,8 @@
  * (c) Microchip Technology Inc.
  */
 
-#ifndef ASM_RISCV_IMSIC_H
-#define ASM_RISCV_IMSIC_H
+#ifndef RISCV_IMSIC_H
+#define RISCV_IMSIC_H
 
 #include <xen/rwlock.h>
 #include <xen/spinlock.h>
@@ -96,4 +96,4 @@ unsigned int vcpu_guest_file_id(const struct vcpu *v);
 
 int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
 
-#endif /* ASM_RISCV_IMSIC_H */
+#endif /* RISCV_IMSIC_H */
diff --git a/xen/arch/riscv/include/asm/insn-defs.h b/xen/arch/riscv/include/asm/insn-defs.h
index 61aaa202fd..1bcdbfde3f 100644
--- a/xen/arch/riscv/include/asm/insn-defs.h
+++ b/xen/arch/riscv/include/asm/insn-defs.h
@@ -1,10 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM_RISCV_INSN_DEFS_H
-#define ASM_RISCV_INSN_DEFS_H
+#ifndef RISCV_INSN_DEFS_H
+#define RISCV_INSN_DEFS_H
 
 #define HFENCE_VVMA(vaddr, asid) \
     asm volatile ( "hfence.vvma %z0, %z1" \
                   :: "rJ" (vaddr), "rJ" (asid) : "memory" )
 
-#endif /* ASM_RISCV_INSN_DEFS_H */
+#endif /* RISCV_INSN_DEFS_H */
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index 1bfba7c615..9093173357 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -5,8 +5,8 @@
  * (c) 2024 Vates
  */
 
-#ifndef ASM__RISCV__INTERRUPT_CONTOLLER_H
-#define ASM__RISCV__INTERRUPT_CONTOLLER_H
+#ifndef RISCV_INTC_H
+#define RISCV_INTC_H
 
 struct dt_device_node;
 
@@ -91,4 +91,4 @@ void domain_vintc_deinit(struct domain *d);
 
 int vintc_reserve_virq(const struct domain *d, unsigned int virq);
 
-#endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
+#endif /* RISCV_INTC_H */
diff --git a/xen/arch/riscv/include/asm/io.h b/xen/arch/riscv/include/asm/io.h
index 9aeafd6b3b..547c144b98 100644
--- a/xen/arch/riscv/include/asm/io.h
+++ b/xen/arch/riscv/include/asm/io.h
@@ -35,8 +35,8 @@
  * Copyright (C) 2024 Vates
  */
 
-#ifndef ASM__RISCV__IO_H
-#define ASM__RISCV__IO_H
+#ifndef RISCV_IO_H
+#define RISCV_IO_H
 
 #include <xen/macros.h>
 #include <xen/types.h>
@@ -151,7 +151,7 @@ static inline uint64_t __raw_readq(const volatile void __iomem *addr)
 #define writel(v, c)    ({ __io_bw(); writel_cpu(v, c); __io_aw(); })
 #define writeq(v, c)    ({ __io_bw(); writeq_cpu(v, c); __io_aw(); })
 
-#endif /* ASM__RISCV__IO_H */
+#endif /* RISCV_IO_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/irq.h b/xen/arch/riscv/include/asm/irq.h
index 57e814d90c..2eb68a5baf 100644
--- a/xen/arch/riscv/include/asm/irq.h
+++ b/xen/arch/riscv/include/asm/irq.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__IRQ_H
-#define ASM__RISCV__IRQ_H
+#ifndef RISCV_IRQ_H
+#define RISCV_IRQ_H
 
 #include <xen/bug.h>
 #include <xen/device_tree.h>
@@ -57,7 +57,7 @@ int route_irq_to_guest(struct domain *d, unsigned int virq,
 
 int release_guest_irq(const struct domain *d, unsigned int virq);
 
-#endif /* ASM__RISCV__IRQ_H */
+#endif /* RISCV_IRQ_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/mm-types.h b/xen/arch/riscv/include/asm/mm-types.h
index fa512064b8..a04e8f8b17 100644
--- a/xen/arch/riscv/include/asm/mm-types.h
+++ b/xen/arch/riscv/include/asm/mm-types.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM_RISCV_MM_TYPES_H
-#define ASM_RISCV_MM_TYPES_H
+#ifndef RISCV_MM_TYPES_H
+#define RISCV_MM_TYPES_H
 
 typedef unsigned long pte_attr_t;
 
-#endif /* ASM_RISCV_MM_TYPES_H */
+#endif /* RISCV_MM_TYPES_H */
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 1ac66283ec..bb7c96e7d2 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__MM_H
-#define ASM__RISCV__MM_H
+#ifndef RISCV_MM_H
+#define RISCV_MM_H
 
 #include <public/xen.h>
 #include <xen/bug.h>
@@ -349,4 +349,4 @@ void setup_fixmap_mappings(void);
 
 void *early_fdt_map(paddr_t fdt_paddr);
 
-#endif /* ASM__RISCV__MM_H */
+#endif /* RISCV_MM_H */
diff --git a/xen/arch/riscv/include/asm/monitor.h b/xen/arch/riscv/include/asm/monitor.h
index fb3d3e8e3a..54e08cab8b 100644
--- a/xen/arch/riscv/include/asm/monitor.h
+++ b/xen/arch/riscv/include/asm/monitor.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__MONITOR_H
-#define ASM__RISCV__MONITOR_H
+#ifndef RISCV_MONITOR_H
+#define RISCV_MONITOR_H
 
 #include <xen/bug.h>
 
@@ -14,7 +14,7 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
     return 0;
 }
 
-#endif /* ASM__RISCV__MONITOR_H */
+#endif /* RISCV_MONITOR_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/nospec.h b/xen/arch/riscv/include/asm/nospec.h
index f9b0241c98..c969a9898f 100644
--- a/xen/arch/riscv/include/asm/nospec.h
+++ b/xen/arch/riscv/include/asm/nospec.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (C) 2024 Vates */
 
-#ifndef ASM__RISCV__NOSPEC_H
-#define ASM__RISCV__NOSPEC_H
+#ifndef RISCV_NOSPEC_H
+#define RISCV_NOSPEC_H
 
 static inline bool evaluate_nospec(bool condition)
 {
@@ -13,7 +13,7 @@ static inline void block_speculation(void)
 {
 }
 
-#endif /* ASM__RISCV__NOSPEC_H */
+#endif /* RISCV_NOSPEC_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 0d1dace1a0..c053828151 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__P2M_H
-#define ASM__RISCV__P2M_H
+#ifndef RISCV_P2M_H
+#define RISCV_P2M_H
 
 #include <xen/bitops.h>
 #include <xen/errno.h>
@@ -264,7 +264,7 @@ void p2m_ctxt_switch_from(struct vcpu *p);
 void p2m_ctxt_switch_to(struct vcpu *n);
 void p2m_handle_vmenter(void);
 
-#endif /* ASM__RISCV__P2M_H */
+#endif /* RISCV_P2M_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/page-bits.h b/xen/arch/riscv/include/asm/page-bits.h
index 788c7d9518..73b9f6378c 100644
--- a/xen/arch/riscv/include/asm/page-bits.h
+++ b/xen/arch/riscv/include/asm/page-bits.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__PAGE_BITS_H
-#define ASM__RISCV__PAGE_BITS_H
+#ifndef RISCV_PAGE_BITS_H
+#define RISCV_PAGE_BITS_H
 
 #define PAGE_SHIFT              12 /* 4 KiB Pages */
 #define PADDR_BITS              56 /* 44-bit PPN */
@@ -16,4 +16,4 @@
 
 #define PTE_PPN_SHIFT           10
 
-#endif /* ASM__RISCV__PAGE_BITS_H */
+#endif /* RISCV_PAGE_BITS_H */
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index f9e59e61de..7a2ac2be4d 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__PAGE_H
-#define ASM__RISCV__PAGE_H
+#ifndef RISCV_PAGE_H
+#define RISCV_PAGE_H
 
 #ifndef __ASSEMBLER__
 
@@ -253,4 +253,4 @@ pte_t pt_walk(vaddr_t va, unsigned int *pte_level);
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__PAGE_H */
+#endif /* RISCV_PAGE_H */
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index 103384723d..4f667aa0e7 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -1,5 +1,5 @@
-#ifndef ASM_RISCV_PAGING_H
-#define ASM_RISCV_PAGING_H
+#ifndef RISCV_PAGING_H
+#define RISCV_PAGING_H
 
 #include <asm-generic/paging.h>
 
@@ -18,4 +18,4 @@ void paging_free_page(struct domain *d, struct page_info *pg);
 
 struct page_info *paging_alloc_page(struct domain *d);
 
-#endif /* ASM_RISCV_PAGING_H */
+#endif /* RISCV_PAGING_H */
diff --git a/xen/arch/riscv/include/asm/pmap.h b/xen/arch/riscv/include/asm/pmap.h
index 146dd29f95..842c40ab6a 100644
--- a/xen/arch/riscv/include/asm/pmap.h
+++ b/xen/arch/riscv/include/asm/pmap.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef ASM__RISCV__PMAP_H
-#define ASM__RISCV__PMAP_H
+#ifndef RISCV_PMAP_H
+#define RISCV_PMAP_H
 
 #include <xen/bug.h>
 #include <xen/init.h>
@@ -33,4 +33,4 @@ static inline void __init arch_pmap_unmap(unsigned int slot)
     flush_tlb_one_local(FIXMAP_ADDR(slot));
 }
 
-#endif /* ASM__RISCV__PMAP_H */
+#endif /* RISCV_PMAP_H */
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index b1745c1071..007c22d2e6 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -7,8 +7,8 @@
  *
  */
 
-#ifndef ASM__RISCV__PROCESSOR_H
-#define ASM__RISCV__PROCESSOR_H
+#ifndef RISCV_PROCESSOR_H
+#define RISCV_PROCESSOR_H
 
 #ifndef __ASSEMBLER__
 
@@ -94,7 +94,7 @@ static inline void sfence_vma(void)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__PROCESSOR_H */
+#endif /* RISCV_PROCESSOR_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/regs.h b/xen/arch/riscv/include/asm/regs.h
index 531958f3d7..24674d37cf 100644
--- a/xen/arch/riscv/include/asm/regs.h
+++ b/xen/arch/riscv/include/asm/regs.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__REGS_H
-#define ASM__RISCV__REGS_H
+#ifndef RISCV_REGS_H
+#define RISCV_REGS_H
 
 #ifndef __ASSEMBLER__
 
@@ -17,7 +17,7 @@ static inline bool guest_mode(const struct cpu_user_regs *r)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__REGS_H */
+#endif /* RISCV_REGS_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/riscv_encoding.h b/xen/arch/riscv/include/asm/riscv_encoding.h
index 647268e6d0..f63672fc03 100644
--- a/xen/arch/riscv/include/asm/riscv_encoding.h
+++ b/xen/arch/riscv/include/asm/riscv_encoding.h
@@ -6,8 +6,8 @@
  *   Anup Patel <anup.patel@wdc.com>
  */
 
-#ifndef ASM__RISCV__RISCV_ENCODING_H
-#define ASM__RISCV__RISCV_ENCODING_H
+#ifndef RISCV_RISCV_ENCODING_H
+#define RISCV_RISCV_ENCODING_H
 
 #define _UL(X) _AC(X, UL)
 #define _ULL(X) _AC(X, ULL)
@@ -930,4 +930,4 @@
 
 /* clang-format on */
 
-#endif
+#endif /* RISCV_RISCV_ENCODING_H */
diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index 1952868e96..2a245d0b42 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -9,8 +9,8 @@
  * Copyright (c) 2019 Western Digital Corporation or its affiliates.
  */
 
-#ifndef ASM__RISCV__SBI_H
-#define ASM__RISCV__SBI_H
+#ifndef RISCV_SBI_H
+#define RISCV_SBI_H
 
 #include <xen/cpumask.h>
 
@@ -145,4 +145,4 @@ int sbi_remote_hfence_gvma_vmid(const cpumask_t *cpu_mask, vaddr_t start,
  */
 int sbi_init(void);
 
-#endif /* ASM__RISCV__SBI_H */
+#endif /* RISCV_SBI_H */
diff --git a/xen/arch/riscv/include/asm/setup.h b/xen/arch/riscv/include/asm/setup.h
index 73ce2f2933..8eee8a7463 100644
--- a/xen/arch/riscv/include/asm/setup.h
+++ b/xen/arch/riscv/include/asm/setup.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__SETUP_H
-#define ASM__RISCV__SETUP_H
+#ifndef RISCV_SETUP_H
+#define RISCV_SETUP_H
 
 #include <xen/types.h>
 
@@ -11,7 +11,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 
 void init_csr_masks(void);
 
-#endif /* ASM__RISCV__SETUP_H */
+#endif /* RISCV_SETUP_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/smp.h b/xen/arch/riscv/include/asm/smp.h
index 5dbacf1f9d..625e30b91b 100644
--- a/xen/arch/riscv/include/asm/smp.h
+++ b/xen/arch/riscv/include/asm/smp.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__SMP_H
-#define ASM__RISCV__SMP_H
+#ifndef RISCV_SMP_H
+#define RISCV_SMP_H
 
 #include <xen/cpumask.h>
 #include <xen/macros.h>
@@ -43,7 +43,7 @@ struct dt_device_node;
 int dt_processor_hartid(const struct dt_device_node *node,
                         unsigned long *hartid);
 
-#endif
+#endif /* RISCV_SMP_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/spinlock.h b/xen/arch/riscv/include/asm/spinlock.h
index 4a607eba52..1b43ed0636 100644
--- a/xen/arch/riscv/include/asm/spinlock.h
+++ b/xen/arch/riscv/include/asm/spinlock.h
@@ -1,5 +1,5 @@
-#ifndef ASM__RISCV__SPINLOCK_H
-#define ASM__RISCV__SPINLOCK_H
+#ifndef RISCV_SPINLOCK_H
+#define RISCV_SPINLOCK_H
 
 #define arch_lock_acquire_barrier() smp_mb()
 #define arch_lock_release_barrier() smp_mb()
@@ -12,4 +12,4 @@
     arch_lock_signal();             \
 })
 
-#endif /* ASM__RISCV__SPINLOCK_H */
+#endif /* RISCV_SPINLOCK_H */
diff --git a/xen/arch/riscv/include/asm/string.h b/xen/arch/riscv/include/asm/string.h
index a20af81f67..8dde5c4880 100644
--- a/xen/arch/riscv/include/asm/string.h
+++ b/xen/arch/riscv/include/asm/string.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__STRING_H
-#define ASM__RISCV__STRING_H
+#ifndef RISCV_STRING_H
+#define RISCV_STRING_H
 
-#endif /* ASM__RISCV__STRING_H */
+#endif /* RISCV_STRING_H */
diff --git a/xen/arch/riscv/include/asm/system.h b/xen/arch/riscv/include/asm/system.h
index f33af64fd2..cb38248775 100644
--- a/xen/arch/riscv/include/asm/system.h
+++ b/xen/arch/riscv/include/asm/system.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__SYSTEM_H
-#define ASM__RISCV__SYSTEM_H
+#ifndef RISCV_SYSTEM_H
+#define RISCV_SYSTEM_H
 
 #include <xen/stdbool.h>
 
@@ -78,7 +78,7 @@ static inline bool local_irq_is_enabled(void)
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__SYSTEM_H */
+#endif /* RISCV_SYSTEM_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
index 4d68900151..0e5b96a863 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef ASM__RISCV__TIME_H
-#define ASM__RISCV__TIME_H
+#ifndef RISCV_TIME_H
+#define RISCV_TIME_H
 
 #include <xen/bug.h>
 #include <xen/muldiv64.h>
@@ -29,7 +29,7 @@ void preinit_xen_time(void);
 
 extern int (* __ro_after_init set_xen_timer)(uint64_t deadline);
 
-#endif /* ASM__RISCV__TIME_H */
+#endif /* RISCV_TIME_H */
 
 /*
  * Local variables:
diff --git a/xen/arch/riscv/include/asm/traps.h b/xen/arch/riscv/include/asm/traps.h
index 21fa3c3259..08c6215e93 100644
--- a/xen/arch/riscv/include/asm/traps.h
+++ b/xen/arch/riscv/include/asm/traps.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__TRAPS_H
-#define ASM__RISCV__TRAPS_H
+#ifndef RISCV_TRAPS_H
+#define RISCV_TRAPS_H
 
 #include <asm/processor.h>
 
@@ -13,4 +13,4 @@ void trap_init(void);
 
 #endif /* __ASSEMBLER__ */
 
-#endif /* ASM__RISCV__TRAPS_H */
+#endif /* RISCV_TRAPS_H */
diff --git a/xen/arch/riscv/include/asm/types.h b/xen/arch/riscv/include/asm/types.h
index d801596a20..b0d4c62aef 100644
--- a/xen/arch/riscv/include/asm/types.h
+++ b/xen/arch/riscv/include/asm/types.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__TYPES_H
-#define ASM__RISCV__TYPES_H
+#ifndef RISCV_TYPES_H
+#define RISCV_TYPES_H
 
 #if defined(CONFIG_RISCV_32)
 
@@ -25,7 +25,7 @@ typedef u64 register_t;
 
 #endif
 
-#endif /* ASM__RISCV__TYPES_H */
+#endif /* RISCV_TYPES_H */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/riscv/include/asm/vaplic.h b/xen/arch/riscv/include/asm/vaplic.h
index 96080bfbc2..dcbe0d59a8 100644
--- a/xen/arch/riscv/include/asm/vaplic.h
+++ b/xen/arch/riscv/include/asm/vaplic.h
@@ -7,8 +7,8 @@
  * Copyright (c) Microchip.
  */
 
-#ifndef ASM__RISCV__VAPLIC_H
-#define ASM__RISCV__VAPLIC_H
+#ifndef RISCV_VAPLIC_H
+#define RISCV_VAPLIC_H
 
 #include <xen/kernel.h>
 #include <xen/types.h>
@@ -31,4 +31,4 @@ struct vaplic {
 int domain_vaplic_init(struct domain *d);
 void domain_vaplic_deinit(struct domain *d);
 
-#endif /* ASM__RISCV__VAPLIC_H */
+#endif /* RISCV_VAPLIC_H */
diff --git a/xen/arch/riscv/include/asm/vmid.h b/xen/arch/riscv/include/asm/vmid.h
index 1c500c4aff..2b4fc0df8e 100644
--- a/xen/arch/riscv/include/asm/vmid.h
+++ b/xen/arch/riscv/include/asm/vmid.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM_RISCV_VMID_H
-#define ASM_RISCV_VMID_H
+#ifndef RISCV_VMID_H
+#define RISCV_VMID_H
 
 struct vcpu;
 struct vcpu_vmid;
@@ -11,4 +11,4 @@ bool vmid_handle_vmenter(struct vcpu_vmid *vmid);
 void vmid_flush_vcpu(struct vcpu *v);
 void vmid_flush_hart(void);
 
-#endif /* ASM_RISCV_VMID_H */
+#endif /* RISCV_VMID_H */
diff --git a/xen/arch/riscv/include/asm/vsbi.h b/xen/arch/riscv/include/asm/vsbi.h
index fa0cad604e..c39dfbbe3b 100644
--- a/xen/arch/riscv/include/asm/vsbi.h
+++ b/xen/arch/riscv/include/asm/vsbi.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier:  GPL-2.0-only */
 
-#ifndef ASM_RISCV_VSBI_H
-#define ASM_RISCV_VSBI_H
+#ifndef RISCV_VSBI_H
+#define RISCV_VSBI_H
 
 struct cpu_user_regs;
 
@@ -28,4 +28,4 @@ const struct vsbi_ext *vsbi_find_extension(unsigned long eid);
 
 void check_vsbi_ext_ranges(void);
 
-#endif
+#endif /* RISCV_VSBI_H */
diff --git a/xen/arch/riscv/include/asm/vtimer.h b/xen/arch/riscv/include/asm/vtimer.h
index b4d48d1a17..950795be12 100644
--- a/xen/arch/riscv/include/asm/vtimer.h
+++ b/xen/arch/riscv/include/asm/vtimer.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef ASM__RISCV__VTIMER_H
-#define ASM__RISCV__VTIMER_H
+#ifndef RISCV_VTIMER_H
+#define RISCV_VTIMER_H
 
 #include <xen/timer.h>
 
@@ -17,4 +17,4 @@ void vtimer_set_timer(struct vtimer *t, uint64_t ticks);
 void vtimer_ctxt_switch_from(struct vcpu *p);
 void vtimer_ctxt_switch_to(struct vcpu *n);
 
-#endif /* ASM__RISCV__VTIMER_H */
+#endif /* RISCV_VTIMER_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 17:22:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 17:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480313.1684268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQT4F-0002sb-0Z; Mon, 09 Nov 2026 17:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480313.1684268; Mon, 09 Nov 2026 17:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQT4E-0002sU-UE; Mon, 09 Nov 2026 17:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1480313;
 Mon, 09 Nov 2026 17:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQT4D-0002sC-Pv
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 17:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQT4D-000000043CT-1lgR
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 17:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQT4D-00000008Mp6-2tFH
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 17:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EE05kWcVwcrnNv4iEuD/ZWqoyHQl+RRIiPshOL0ifMg=; b=W4o4urGoRxLe8KcDWgRybLoWJF
	tgsBg5YAmXZHl4XtLTNjS3WHSfomvVitwvhkPXCyWZaAsG4lEzknmG73dyghdS+My34lsZanwmCmS
	un8FYL/vhhwpihS/9pzTD7Ud5NTQwGjp5OEHFnmMCCXatQ1/GKVzVofoAkqO8JFIDhTs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: move SVM feature printout to a separate function
Message-Id: <E1xQT4D-00000008Mp6-2tFH@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 17:22:01 +0000

commit df1072bd2d70bd6c08fbfd1c3f29cec56482b91e
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Mon Sep 21 13:01:50 2026 -0700
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 9 13:11:05 2026 +0000

    x86/hvm: move SVM feature printout to a separate function
    
    Isolate long SVM feature list printout in a separate function to
    improve readability.
    
    Not a functional change.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.c | 49 +++++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 666bcd3eb4..e11d5c5524 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2434,33 +2434,12 @@ static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
     },
 };
 
-const struct hvm_function_table * __init start_svm(void)
+static void __init print_svm_features(void)
 {
     bool printed = false;
 
-    svm_host_osvw_reset();
-
-    if ( _svm_cpu_up(true) )
-    {
-        setup_clear_cpu_cap(X86_FEATURE_SVM);
-        printk("SVM: failed to initialise.\n");
-        return NULL;
-    }
-
-    setup_vmcb_dump();
-
-    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
-        svm_feature_flags = cpuid_edx(0x8000000aU);
-
     printk("SVM: Supported advanced features:\n");
 
-    /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
-    if ( !cpu_has_svm_nrips )
-        __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
-
-    if ( cpu_has_tsc_ratio )
-        svm_function_table.tsc_scaling.ratio_frac_bits = 32;
-
 #define P(p,s) if ( p ) { printk(" - %s\n", s); printed = 1; }
     P(cpu_has_svm_npt, "Nested Page Tables (NPT)");
     P(cpu_has_svm_lbrv, "Last Branch Record (LBR) Virtualisation");
@@ -2481,11 +2460,37 @@ const struct hvm_function_table * __init start_svm(void)
 
     if ( !printed )
         printk(" - none\n");
+}
+
+const struct hvm_function_table * __init start_svm(void)
+{
+    svm_host_osvw_reset();
+
+    if ( _svm_cpu_up(true) )
+    {
+        setup_clear_cpu_cap(X86_FEATURE_SVM);
+        printk("SVM: failed to initialise.\n");
+        return NULL;
+    }
+
+    setup_vmcb_dump();
+
+    if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
+        svm_feature_flags = cpuid_edx(0x8000000aU);
+
+    /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
+    if ( !cpu_has_svm_nrips )
+        __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
+
+    if ( cpu_has_tsc_ratio )
+        svm_function_table.tsc_scaling.ratio_frac_bits = 32;
 
     svm_function_table.caps.hap = cpu_has_svm_npt;
     svm_function_table.caps.hap_superpage_2mb = true;
     svm_function_table.caps.hap_superpage_1gb = cpu_has_page1gb;
 
+    print_svm_features();
+
     return &svm_function_table;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 17:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 17:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480314.1684272 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQT4P-0002uk-2D; Mon, 09 Nov 2026 17:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480314.1684272; Mon, 09 Nov 2026 17:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQT4O-0002uc-Vk; Mon, 09 Nov 2026 17:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1480314;
 Mon, 09 Nov 2026 17:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQT4N-0002uK-TH
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 17:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQT4N-000000043CX-2I26
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 17:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQT4N-00000008MwZ-3PPS
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 17:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wFKXkTLqvK4jfXUMcbisNy9o/Fgye3xdzWFPuQ6G5+w=; b=RgGdbw1mp5HVIyyhGZNtNnvLD5
	V1aUiQSYjOyeJj09cVmkNeEeABqz//LYEffp4YptJ2Hu8fA/o9VkuAYvgIYJ1Yh58KYqvVcO7KaXt
	e11O58jqWUvb/MLQBlj07qJB+y+5bD0+Ag+Jjfet1onU3srpkUB8cpJNXumKqK8GROW0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/ocaml: Fix cleaning bindings test
Message-Id: <E1xQT4N-00000008MwZ-3PPS@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 17:22:11 +0000

commit 853641a3685f937169bbc1d1334aa240c61ef050
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Nov 6 18:17:32 2026 -0500
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 9 13:11:05 2026 +0000

    tools/ocaml: Fix cleaning bindings test
    
    make clean fails in the bindings tests:
    
    make[7]: Entering directory '/home/amd/xen/tools/ocaml/tests/bindings'
    rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit unix.cmxa -ccopt -L -ccopt ....
    rm: invalid option -- 'c'
    Try 'rm --help' for more information.
    
    LIBS is passed to rm.  Change to BINDINGSLIBS, similar to oxenstored.
    
    Fixes: d97847e858f1 ("tools/ocaml: Gitlab CI test for bindings")
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/tests/bindings/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/tests/bindings/Makefile b/tools/ocaml/tests/bindings/Makefile
index 75f8babbaf..02255780bd 100644
--- a/tools/ocaml/tests/bindings/Makefile
+++ b/tools/ocaml/tests/bindings/Makefile
@@ -10,7 +10,7 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
 	-I $(OCAML_TOPLEVEL)/libs/eventchn
 
-LIBS = \
+BINDINGSLIBS = \
 	unix.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
@@ -21,7 +21,7 @@ LIBS = \
 PROGRAMS = test-ocaml-bindings
 OCAML_PROGRAM = test-ocaml-bindings
 
-test-ocaml-bindings_LIBS = $(LIBS)
+test-ocaml-bindings_LIBS = $(BINDINGSLIBS)
 test-ocaml-bindings_MLSORTED = $(shell $(OCAMLDEP) -sort $(OBJS:=.ml))
 test-ocaml-bindings_OBJS = $(test-ocaml-bindings_MLSORTED:.ml=)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Nov 09 17:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Nov 2026 17:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1480315.1684275 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQT4Z-0002yH-3j; Mon, 09 Nov 2026 17:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1480315.1684275; Mon, 09 Nov 2026 17:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1xQT4Z-0002y9-13; Mon, 09 Nov 2026 17:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1480315;
 Mon, 09 Nov 2026 17:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1xQT4Y-0002xt-0u
 for xen-changelog@lists.xenproject.org; Mon, 09 Nov 2026 17:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQT4X-000000043Cr-2ldc
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 17:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.98.2)
 (envelope-from <infra@xenproject.org>) id 1xQT4X-00000008N3V-3vj5
 for xen-changelog@lists.xenproject.org;
 Mon, 09 Nov 2026 17:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PBBycLv8RNIPuLG314uneivajDoDJmWbA6+Sqs/M4hQ=; b=6C2pF/wN7uWlmX+CJUEPL28B7x
	2LTsDjzdM+9eWxgZAFIvjjXtvZHyYfq8ZGrryoXD+XlSbq7VHa64hb2c0cMUb/1RAqZFSYxW6ARxE
	2OlmmPU5QYbLIPFWKcDtyqvhO4M1/tu7SDk2CXfveg0To7o0fEBE3fDR4yHne7pJi3jU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "xen/gnttab: Drop owner->grant_table check in _cache_flush()"
Message-Id: <E1xQT4X-00000008N3V-3vj5@xenbits.xenproject.org>
Date: Mon, 09 Nov 2026 17:22:21 +0000

commit a5c26d0e73d4cde7c4620ea43cbd82ba7b2af02e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 9 12:21:21 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Mon Nov 9 13:11:05 2026 +0000

    Revert "xen/gnttab: Drop owner->grant_table check in _cache_flush()"
    
    The claim that ARM system domains don't own memory is false.
    CONFIG_STATIC_SHM is one example where DOM_IO does own memory.
    
    This reverts commit bec8e3c1fb91b96f337c08c6daf1bb2563b320c0.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2285c4aee8..5e79c012b6 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3633,7 +3633,7 @@ static int _cache_flush(gnttab_cache_flush_t *cflush, grant_ref_t *cur_ref)
 
     page = mfn_to_page(mfn);
     owner = page_get_owner_and_reference(page);
-    if ( !owner )
+    if ( !owner || !owner->grant_table )
     {
         rcu_unlock_domain(d);
         return -EPERM;
--
generated by git-patchbot for /home/xen/git/xen.git#master


