aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-09-23 17:37:00 +0200
committerJan Beulich <jbeulich@suse.com>2013-09-23 17:37:00 +0200
commit36291997b655421e1b5d3cfe5c012464b1041ba8 (patch)
tree56fbcb27490225c2f8fb530c7efc59cc99b58de7 /xen/include/asm-x86
parent14fcce2fa883405bab26b60821a6cc5f2c770833 (diff)
downloadxen-36291997b655421e1b5d3cfe5c012464b1041ba8.tar.gz
xen-36291997b655421e1b5d3cfe5c012464b1041ba8.tar.bz2
xen-36291997b655421e1b5d3cfe5c012464b1041ba8.zip
VMX: also use proper instruction mnemonic for VMREAD
... when assembler supports it, following commit cfd54835 ("VMX: use proper instruction mnemonics if assembler supports them"). This merely got split off from the earlier change becase of the significant number of call sites needing to be changed. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Diffstat (limited to 'xen/include/asm-x86')
-rw-r--r--xen/include/asm-x86/hvm/vmx/vmx.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 9816ce4dce..0cb6a427ec 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -322,21 +322,26 @@ static inline void __vmpclear(u64 addr)
: "memory");
}
-static inline unsigned long __vmread(unsigned long field)
+static inline void __vmread(unsigned long field, unsigned long *value)
{
- unsigned long ecx;
-
- asm volatile ( VMREAD_OPCODE
- MODRM_EAX_ECX
+ asm volatile (
+#ifdef HAVE_GAS_VMX
+ "vmread %1, %0\n\t"
+#else
+ VMREAD_OPCODE MODRM_EAX_ECX
+#endif
/* CF==1 or ZF==1 --> crash (ud2) */
UNLIKELY_START(be, vmread)
"\tud2\n"
UNLIKELY_END_SECTION
- : "=c" (ecx)
+#ifdef HAVE_GAS_VMX
+ : "=rm" (*value)
+ : "r" (field)
+#else
+ : "=c" (*value)
: "a" (field)
+#endif
: "memory");
-
- return ecx;
}
static inline void __vmwrite(unsigned long field, unsigned long value)