[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:31:28 -0400
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 40.93.1.104) 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=JgNbQOOH0xIdi5fx+MKboRB+ui+9rZvo76x+Vig/W8/8GW8k1TzoP5cIwWEZnKwREMFGeAHLihZhY/neYbNswirY7TB2gLf6e/XHxzOhDCkQbWUklokeuqmHpgd9OkZVBq46VxwbadoL13oW2Y06xptDK6cKLGx1c/ZGn94syBdH64OdEqaAhqP4+VwL5DerdLv0V46I0zQ78gu25TIhOGi+RmPNn+MWPouufbww2+fQ2ESxYZ2qkQuEHYUV1GuVpTOi9FcVasVDtFI6gyS0XKPUvmH9TzPcjMJfyu1DbZRwYY30FCs4hFf3v3Fbf2H8zZsDYyv8wATUj63etk8S/w==
- 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=ss+x0oIIpF8ialTH1Ey6qw18chedtggedhDAh731GL7V9j3DIdSqa7A2PXs30C406YDn21MfMXFxeeAl/rnPnSgAH1768AtlrxHCN5PVPTXyYvlk3izZ6FfrOUJ4hNgkD+YJQiJOXR2K8LxMzwP+fTAUvILw/7xKniSbuoTTQSe6kO+jKLbCOFLbgdx6nE5ylTPRkemtrZgtH9SiTL1KWeL46J9BhGoDfmOdulvYYAbMcd8FLnxoSl8020QnrBfb2tFgNs1MebrR4Ln0dvDT6KVhQyGH2NyWu9YJIRNTD8woBBwmQ/xaQMLZm3ztF49AgZyevbA6s/g8sb29xkvhxQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=QdjSeA68MxPOKb1Ita6nVIfnQ3kZC43XRdwWzmtlCotpewe/4FjhnhJh7XeoyLgvKlDEVw7ZAHxfGTZn3XydBJt4oByCvmX/mvPYkSdepoag5219nbpBwKXcmtqEOgDG04GXJ+iUvNm11gtyZ7XprrSyIE1S28MF3uqEspO6s4zSCI3th6ZEtN5RWMYbB58/ZSQNz1v2hYxSMYHHQb828a5xTRcfNB+XbycYuMNOzXUiUjip+lizlqA7MDKOWJVv/lLFPSeNzvSwPTS4KChQqNl7LQvG9mQJtL5MaEIKe0Z9Xx0NhIDMKkCNzx3oZ4gC3QRHuw3v7XSLsZl0vhDCjw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X1UfyeHo8DrkFwD+fCG3AA/0efN+0LgFSmjaP14pXyw3XRZp8xOX4uTL8ZQdQyKyIJUO68/Tks87Jzm4aBCd+Up8PS5PllUWB6LTXxjV9k2jS6NJuYALHwHMjh+S4fbBlzmLBae89mb/jGMDKJlMG7v/9UR2rnTaxYS+VE+Ep23MKqdcv6DZ38ir45LwWC3XAc6o1hZzg8P3GHJQwnDoeuiYvkWinJMft5M91683udOgynoFQBgsv2TzKFiCIBlZ0Nh6EDacdOeU2MTaLn/N9s3eaB+AN4nsFEs91NVAOeXFMO1NUIdmoiFoL+td20BedE1yTx359dYXG833cJCyCw==
- 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:32:50 +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
|