|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC PATCH v6 05/43] altp2m: Move altp2m_supported to arch header
From: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |