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

[RFC PATCH v6 05/43] altp2m: Move altp2m_supported to arch header


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
  • Date: Mon, 20 Apr 2026 17:18:29 -0400
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 40.93.4.0) 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=9p9JopnflYJnPfdpu0O1EcjHiZAqSeSW4TS/vKusOYI=; b=PjvqX+61NuR5PWzS4OgkbYbXxn1hZ5JJMZXfJxRoq2Pl7Cj67AKvbTcBfHpJsRZS0ePwqvNgOV5JuhSWbjXOQFjxt3zfutyyoQUZ/1SkujgBsbV2K22WYPGBYGem5ELnnf2yZuGD1Qz2AzzHtw8y3S+A4o3H1P4aT4kuyAzW4jQQnWgU2WZXunw/yDLkTUf4z6BnNvOvd/vndnK6mPQC7RIFo/cGB3Do3fPnajKDFdq6tnTTrcNAOYTDgB1a3rh51JS7GhxCVt6bMxXdYva7Z6l3aMT7mzkTi7cYFMIv3XT67K696adTcdQrDeoxNUJdmkV16djx7QVYdmUMPYl9fQ==
  • 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=9p9JopnflYJnPfdpu0O1EcjHiZAqSeSW4TS/vKusOYI=; b=BmqSSf1wPJkupXUHRFcRCBQfxm74HF8Lvv2yscmIHI/yQKkmelFBym42wMrfzBD659jqvlzKLhl0TkXL4L7i+5PIKODEt9lII26G8HTF6ya1td6muXux4JtvY7Vq4uha/+/TWTLUxFpKiX/QZoZhkO84uZizY+z2/ti0vEXCdHori6aKc1TOJVD7NQuJzfX9oXMV1vAAiRtPaq4Hk9FybNQJepnUrrsda7wYemLXeqc8WbG+YrUonYDaiGtrLAXApNz3kK46NmwhMj6qUfkUyayvMmw7uE8XZ4BfhFfwInPgq34ATa7huJMZEf6Oa8BLFuBOcayEKfQ92ECPryyS6g==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=sCnVKkOMlpg8ZS48BFPTcqJmjGuvI1vfLZTQb7/8FwVKYE6ogLzHtredKfkFoR6ArpXrHN83AZkNiKBRzNX1XtDy1y4cTKgd/jU8lfAsIlui1Q+5GoHUQXAtu5eUUzp7wYNB24axIYsGfMXkQtnFHR51VVfbqVZXsehjXILUW5t72HZgGiErTwBaDp14ASw6Ju8uWP7yhU8BO7vrGXuqP27dT0dX3AIALyQ+61E1nt6SWJeJDTRbZ0YhU0D79zwyb48BMaulKNbo54quGQhCSrfTFWkMjBN5n2j0NU5vZ3KhgSaTRGVGbYii4XXNBhIVdKkwoMpEpm7F1+qTEBmPzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hgm14QpOFHp0W8yp0SOeSgrAbr+MZLl8wZOQqcBVhRkBqJZUnM5sA37SBV4Re3AN6jPYCosB0LWqKJXJ7J9NL0G1EbEq9elcSkqc4FF7Lyi74tK05aOjhmUFS/GegvAA7E1qSpc61Vj8TSdfh8G3Sg3w6pt9DcgROzQoqoPV1ozvUWmo/c8gfggzHVjzc2TjQmR8ukYcxurQfapGcmyvdUkdYVk4VJF2OIlL+qth7TmgMBLdVjLZCrGJOg1n3C05Db/J5KwwFXagjOcsdUFYG3KIvnQShESWiVzSMeZtjmT02mwfoH/pIy6gv80Kj/pC1i4UNkCYS4ibD5aK67ZHBw==
  • 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>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Michal Orzel" <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 20 Apr 2026 21:19:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Following from the previous commit, this commit makes altp2m_supported
available through the asm/altp2m.h header.

This is commit 5/8 of the preparation phase.

Signed-off-by: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
---
v6: Introduced this patch.
---
 xen/arch/x86/domain.c              |  1 +
 xen/arch/x86/include/asm/altp2m.h  | 11 +++++++++++
 xen/arch/x86/include/asm/hvm/hvm.h | 11 -----------
 xen/include/asm-generic/altp2m.h   |  7 +++++++
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 512b18d4010f..e4f1cbf3b51e 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -39,6 +39,7 @@
 #include <xen/softirq.h>
 #include <xen/wait.h>
 
+#include <asm/altp2m.h>
 #include <asm/amd.h>
 #include <asm/cpu-policy.h>
 #include <asm/cpuidle.h>
diff --git a/xen/arch/x86/include/asm/altp2m.h 
b/xen/arch/x86/include/asm/altp2m.h
index ad5ded833a75..07e760f60659 100644
--- a/xen/arch/x86/include/asm/altp2m.h
+++ b/xen/arch/x86/include/asm/altp2m.h
@@ -28,6 +28,12 @@ static inline bool altp2m_is_eptp_valid(const struct domain 
*d,
         mfn_x(INVALID_MFN);
 }
 
+/* returns true if hardware supports alternate p2m's */
+static inline bool altp2m_supported(void)
+{
+    return hvm_funcs.caps.altp2m;
+}
+
 static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
 {
     return vcpu_altp2m(v).p2midx;
@@ -58,6 +64,11 @@ static inline bool altp2m_is_eptp_valid(const struct domain 
*d,
     return false;
 }
 
+static inline bool altp2m_supported(void)
+{
+    return false;
+}
+
 /* Only declaration is needed. DCE will optimise it out when linking. */
 uint16_t altp2m_vcpu_idx(const struct vcpu *v);
 void altp2m_vcpu_initialise(struct vcpu *v);
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h 
b/xen/arch/x86/include/asm/hvm/hvm.h
index 6406bb687718..e6d8042831dc 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -701,12 +701,6 @@ static inline bool hvm_hap_supported(void)
     return hvm_funcs.caps.hap;
 }
 
-/* returns true if hardware supports alternate p2m's */
-static inline bool altp2m_supported(void)
-{
-    return IS_ENABLED(CONFIG_ALTP2M) && hvm_funcs.caps.altp2m;
-}
-
 /* Returns true if we have the minimum hardware requirements for nested virt */
 static inline bool hvm_nested_virt_supported(void)
 {
@@ -876,11 +870,6 @@ static inline bool hvm_hap_supported(void)
     return false;
 }
 
-static inline bool altp2m_supported(void)
-{
-    return false;
-}
-
 static inline bool hvm_nested_virt_supported(void)
 {
     return false;
diff --git a/xen/include/asm-generic/altp2m.h b/xen/include/asm-generic/altp2m.h
index ecee6942f4e8..a3cdbdae9953 100644
--- a/xen/include/asm-generic/altp2m.h
+++ b/xen/include/asm-generic/altp2m.h
@@ -6,6 +6,13 @@
 
 struct vcpu;
 
+/* returns true if hardware supports alternate p2m's */
+static inline bool altp2m_supported(void)
+{
+    /* Not implemented on GENERIC. */
+    return false;
+}
+
 /* Alternate p2m VCPU */
 static inline unsigned int altp2m_vcpu_idx(const struct vcpu *v)
 {
-- 
2.34.1




 


Rackspace

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