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

[Xen-devel] [PATCH] x86/VMX: Implement vmptrst



Current codebase doesn't implement and use vmptrst. Implementing it as it may
be required in future.

Signed-off-by: Anshul Makkar <anshul.makkar@xxxxxxxxxx>
---
 xen/include/asm-x86/hvm/vmx/vmx.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h 
b/xen/include/asm-x86/hvm/vmx/vmx.h
index e5c6499..2db6c1d 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -328,6 +328,28 @@ static always_inline void __vmptrld(u64 addr)
                    : "memory");
 }
 
+static always_inline u64 __vmptrst(void)
+{
+    u64 paddr;
+
+    asm volatile (
+#ifdef HAVE_GAS_VMX
+                   "vmptrst %0\n"
+#else
+                   VMPTRST_OPCODE MODRM_EAX_07
+#endif
+
+#ifdef HAVE_GAS_VMX
+                   : "=m" (paddr)
+                   :
+#else
+                   :
+                   : "a" (&paddr),
+#endif
+                   : "memory");
+    return paddr;
+}
+
 static always_inline void __vmpclear(u64 addr)
 {
     asm volatile (
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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