[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH v6 38/43] arm/altp2m: Add support for altp2m_init_by_id


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
  • Date: Mon, 20 Apr 2026 17:32:01 -0400
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 40.93.12.7) smtp.rcpttodomain=amd.com smtp.mailfrom=elektrobit.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=elektrobit.com; dkim=pass (signature was verified) header.d=elektrobit.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=elektrobit.com] dmarc=[1,1,header.from=elektrobit.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 213.95.148.172) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=elektrobit.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=elektrobit.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+mqQCFvGSShVoc1hxR4OmlozNt7Xc1M2crX/MK/P+3E=; b=xvaf4xOdNdbwG1AWjZkpkO7qrbMOd3QI8Hb4NIThX4LoNZ/emn6o44hWZklf9bTpoLhETwvf8455hW4+gbPquPv6WJBSCxMAJHDMiLPsqvTawiQ+w15xf60pDgvm4SAOpYDzdYUkkS339gPR9oPBD/jl8C/TRiVffOXBLrfTxQcFH/H7NVfRtISopWVkfTt2vAYu8e9vr6B7j8OzdHyOoxj4pBHB26E0jpUakcoHeIle4a1dOTKVehvKtSXdqjdkdQ1YgStdl32saG3ld6VPLImqm0pHlvHVfFoN9LFnult/XfJ45DdcTWuxS/0Ex9z3ZX90BZRBygVMW+GMdJ/bbg==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+mqQCFvGSShVoc1hxR4OmlozNt7Xc1M2crX/MK/P+3E=; b=XGAq2T+D08L/gbcGXTX/QqxenU2vVZeYhhUAFevLVEX+5X4lIeYWSo5YolAKLQkGAj7guH8eJdcvRyr/m9VU/X+rhxf52MNYBuTmNwLK4aEPchBMcUpPT/VzfNKiSp8Yp7Dv4tT0S7Mr2++VPxguZ7N5D9NTb+Wlp9GbHkYucau6aTxHe6ifLofekoniqSpJ9WWslOnIU58BKsC+PsjmFUMqn/Kv/xUKPTZwxvDIFSHA2lRbVfCQ4EtlvV8+9zXHGpazfRguYfE6Jqn5sX3c0JqnRWxil7q58BKmIU5Jc0Y+2PQhaMfiMYaAo9YXnp7C5hD6E71GKcAtXMUcJJ/sMA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=q5eh3nY18OETb0x5CzmhK2gh3rJ5UHCk7B3NbxzsIlfpG/12JqVNyJkyMhEq9qAKUN02uS7iL4txF0F5ta1U0povTkfjpL8/UcK8tM50NBDDZjHnoibF8zxa78GpvKA3vDedZAAaPlE3WaDLiQMXcghQEJuLFTVaPkXKniRHCUvMupHKuGPkrzeUeicaawEE29G0OPwt7ne5aGByTMigQ5MX/2lLwCRS0qRaoaMS0D3xG/n2B29hMVzCTunkDFIA80DTzWkHKZa9ZOF4pvDcRzsN4NMPiwzxoBWcp6ShbDtCE/9euYzBfmQ0S2e4iNAzetM1jlAFc2QQemt9vQKqMA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vmXL+0Iw+nFTKu+TK/l3A8H8Md5QaUu8NOXhUPBn0W53/phPeGkD06YQ/KfnV4TxVWUtLVpFmwaEkMSnMVC4nM3lrhU8wOU/hvsIvAbCZu1MiNE7DMb4Q9HFNDOJcsXlgU/uXRslJhvJ1wBlMoYm08Hgkik4bPNDVVZEd34de9x0mvAQcrBpRzzNTBmv7U6JxWg5JxsIU7pwGTbfl5kt7l8sIvnrixuo7TZLpM3tbb97YfL/9JhWGJnUhW2lGEm1hWKxlMh7xP4/ISnlvd2/T5WsgWMiPgoekIsW1hDvuIp03nllINotcFJuimHueaJVy4iG/YYLGIMnbJcwzj+E/Q==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=elektrobit.com header.i="@elektrobit.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=elektrobit.com header.i="@elektrobit.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 20 Apr 2026 21:33:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This commit makes altp2m_init_by_id compatible with ARM by replacing the
x86 domain validity check with an architecture independent check. This
makes it possible to call the function in the common
HVMOP_altp2m_set_domain state implementation.

This is commit 2/2 of the altp2m_init_by_id phase.

Signed-off-by: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
---
v6: Introduced this patch.
---
 xen/common/altp2m.c      | 5 +----
 xen/include/xen/altp2m.h | 2 --
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/common/altp2m.c b/xen/common/altp2m.c
index 9f5f98e1e8a5..929449b1b03c 100644
--- a/xen/common/altp2m.c
+++ b/xen/common/altp2m.c
@@ -106,7 +106,6 @@ void altp2m_vcpu_destroy(struct vcpu *v)
         vcpu_unpause(v);
 }
 
-#ifdef CONFIG_X86
 int altp2m_init_by_id(struct domain *d, unsigned int idx)
 {
     int rc = -EINVAL;
@@ -117,14 +116,12 @@ int altp2m_init_by_id(struct domain *d, unsigned int idx)
 
     altp2m_lock(d);
 
-    if ( d->arch.altp2m_eptp[array_index_nospec(idx, MAX_EPTP)] ==
-         mfn_x(INVALID_MFN) )
+    if ( !altp2m_view_is_valid(d, idx) )
         rc = altp2m_activate_altp2m(d, idx, hostp2m->default_access);
 
     altp2m_unlock(d);
     return rc;
 }
-#endif
 
 /*
  * altp2m operations are envisioned as being used in several different
diff --git a/xen/include/xen/altp2m.h b/xen/include/xen/altp2m.h
index cd96c3b4792a..8fc16346d95b 100644
--- a/xen/include/xen/altp2m.h
+++ b/xen/include/xen/altp2m.h
@@ -71,10 +71,8 @@ static inline bool altp2m_set_altp2m(struct vcpu *v, 
unsigned int idx)
 
 int do_altp2m_op(XEN_GUEST_HANDLE_PARAM(void) arg);
 
-#ifdef CONFIG_X86
 /* Make a specific alternate p2m valid */
 int altp2m_init_by_id(struct domain *d, unsigned int idx);
-#endif
 
 #else /* CONFIG_ALTP2M */
 
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.