Skip to contentSkip to conversation

KVM: VMX: Fix invalid opcode of VPID

PATCH In review Yang, Sheng 2 participants 2 messages Jan 29, 2008 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: VMX: Fix invalid opcode of VPID

From db6524fb36bbf1f297ae171f18de382c32ed6840 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Tue, 29 Jan 2008 08:17:57 +0800
Subject: [PATCH] KVM: VMX: Fix invalid opcode of VPID

Add the missing "memory" in VPID clobber list, otherwise it would cause invalid opcode on host.

---
 arch/x86/kvm/vmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/vmx.c +1 -1
index 00a00e4..3d8949a 100644
@@ -238,7 +238,7 @@ static inline void __invvpid(int ext, u16 vpid, gva_t gva)
     asm volatile (ASM_VMX_INVVPID
 		  /* CF==1 or ZF==1 --> rc = -1 */
 		  "; ja 1f ; ud2 ; 1:"
-		  : : "a"(&operand), "c"(ext) : "cc");
+		  : : "a"(&operand), "c"(ext) : "cc", "memory");
 }
 
 static struct kvm_msr_entry *find_msr_entry(struct vcpu_vmx *vmx, u32 msr)

--
debian.1.5.3.7.1-dirty

From db6524fb36bbf1f297ae171f18de382c32ed6840 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Tue, 29 Jan 2008 08:17:57 +0800
Subject: [PATCH] KVM: VMX: Fix invalid opcode of VPID

Add the missing "memory" in VPID clobber list, otherwise it would cause invalid opcode on host.

---
 arch/x86/kvm/vmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/vmx.c +1 -1
index 00a00e4..3d8949a 100644
@@ -238,7 +238,7 @@ static inline void __invvpid(int ext, u16 vpid, gva_t gva)
     asm volatile (ASM_VMX_INVVPID
 		  /* CF==1 or ZF==1 --> rc = -1 */
 		  "; ja 1f ; ud2 ; 1:"
-		  : : "a"(&operand), "c"(ext) : "cc");
+		  : : "a"(&operand), "c"(ext) : "cc", "memory");
 }
 
 static struct kvm_msr_entry *find_msr_entry(struct vcpu_vmx *vmx, u32 msr)
Signature · 1 line
debian.1.5.3.7.1-dirty

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): 200801291641.55494.sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 19 lines · Sheng

From db6524fb36bbf1f297ae171f18de382c32ed6840 Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Tue, 29 Jan 2008 08:17:57 +0800
Subject: [PATCH] KVM: VMX: Fix invalid opcode of VPID

Add the missing "memory" in VPID clobber list, otherwise it would cause invalid opcode on host.

---
 arch/x86/kvm/vmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/vmx.c +0 -0
index 00a00e4..3d8949a 100644

arch/x86/kvm/vmx.c static inline void __invvpid(int ext, u16 vpid, gva_t gva) · line 244

Quoted 8 lines
arch/x86/kvm/vmx.c +1 -1
@@ -238,7 +238,7 @@ static inline void __invvpid(int ext, u16 vpid, gva_t gva)
     asm volatile (ASM_VMX_INVVPID
 		  /* CF==1 or ZF==1 --> rc = -1 */
 		  "; ja 1f ; ud2 ; 1:"
-		  : : "a"(&operand), "c"(ext) : "cc");
+		  : : "a"(&operand), "c"(ext) : "cc", "memory");
 }
 
 static struct kvm_msr_entry *find_msr_entry(struct vcpu_vmx *vmx, u32 msr)

Ah, yes. That's my fault -- since invvpid doesn't modify memory, I assumed a memory clobber wan't necessary, but it is since otherwise gcc doesn't force the operand into memory. Applied.

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/