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

[RFC PATCH v6 26/43] altp2m: Add altp2m_set_vcpu_idx



From: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>

This commit adds the altp2m_set_vcpu_idx function for both x86 and ARM.
Since the altp2m VCPU index is stored differently depending on which
architecture is used, the altp2m_set_vcpu_idx function makes it possible to
set this value in an architecture independent way for common code routines.

This is commit 3/4 of the altp2m_{get,set}_altp2m phase.

Signed-off-by: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
---
v6: Introduced this patch.
---
 xen/arch/arm/include/asm/altp2m.h | 5 +++++
 xen/arch/x86/include/asm/altp2m.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/xen/arch/arm/include/asm/altp2m.h 
b/xen/arch/arm/include/asm/altp2m.h
index bc695018e62c..f001e022a213 100644
--- a/xen/arch/arm/include/asm/altp2m.h
+++ b/xen/arch/arm/include/asm/altp2m.h
@@ -29,6 +29,11 @@ static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
     return v->arch.ap2m_idx;
 }
 
+static inline void altp2m_set_vcpu_idx(struct vcpu *v, unsigned int idx)
+{
+    v->arch.ap2m_idx = idx;
+}
+
 #else /* CONFIG_ALTP2M */
 
 static inline bool altp2m_supported(void)
diff --git a/xen/arch/x86/include/asm/altp2m.h 
b/xen/arch/x86/include/asm/altp2m.h
index a1b078783b3e..b3d348386a00 100644
--- a/xen/arch/x86/include/asm/altp2m.h
+++ b/xen/arch/x86/include/asm/altp2m.h
@@ -60,6 +60,11 @@ static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
     return vcpu_altp2m(v).p2midx;
 }
 
+static inline void altp2m_set_vcpu_idx(struct vcpu *v, unsigned int idx)
+{
+    vcpu_altp2m(v).p2midx = idx;
+}
+
 /*
  * Alternate p2m: shadow p2m tables used for alternate memory views
  */
-- 
2.34.1




 


Rackspace

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