Skip to contentSkip to conversation

KVM: VMX: Add AX to list of registers clobbered by guest switch

PATCH Applied Jan Kiszka 2 participants 2 messages Sep 28, 2010 – Sep 29, 2010

Subsystems (3)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

By chance this caused no harm so far. We overwrite AX during switch to/from guest context, so we must declare this.

---
 arch/x86/kvm/vmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/vmx.c +1 -1
index 1a5ecfd..e315930 100644
@@ -4013,7 +4013,7 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
 #endif
 		[cr2]"i"(offsetof(struct vcpu_vmx, vcpu.arch.cr2))
 	      : "cc", "memory"
-		, R"bx", R"di", R"si"
+		, R"ax", R"bx", R"di", R"si"
 #ifdef CONFIG_X86_64
 		, "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
 #endif
Signature · 1 line
1.7.1
Applied
#1 lore raw
Quoted 2 lines · Jan Kiszka

By chance this caused no harm so far. We overwrite AX during switch to/from guest context, so we must declare this.

Applied, thanks.

I think we can remove the use of ax, which should reduce the chance of a compile failure due to register pressure. But that can come later.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.