From 2965c646ee2d9d54a3f9c08360d0b1f28ec0f6d3 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 12 Jun 2006 12:01:32 +0100 Subject: [PATCH] [HVM][VMX] Fix error-detection inline asm code. Zero word-sized register before executing SETNA instruction which updates bottom byte. Signed-off-by: Keir Fraser --- xen/include/asm-x86/hvm/vmx/vmx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index 444751ec6e..81637d1a17 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -243,7 +243,7 @@ static always_inline int ___vmread( /* CF==1 or ZF==1 --> rc = -1 */ "setna %b0 ; neg %0" : "=q" (rc), "=c" (ecx) - : "a" (field) + : "0" (0), "a" (field) : "memory"); switch (size) { @@ -314,7 +314,7 @@ static inline int __vmwrite (unsigned long field, unsigned long value) /* CF==1 or ZF==1 --> rc = -1 */ "setna %b0 ; neg %0" : "=q" (rc) - : "a" (field) , "c" (value) + : "0" (0), "a" (field) , "c" (value) : "memory"); switch(field) { @@ -367,7 +367,7 @@ static inline int __vmxon (u64 addr) /* CF==1 or ZF==1 --> rc = -1 */ "setna %b0 ; neg %0" : "=q" (rc) - : "a" (&addr) + : "0" (0), "a" (&addr) : "memory"); return rc; -- 2.30.2