Skip to contentSkip to conversation

kvm/vmx: fix the return value of handle_vmcall()

PATCH In review Jesse Larrew 2 participants 2 messages Dec 10, 2012 – Dec 11, 2012

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

PATCH 1/1 kvm/vmx: fix the return value of handle_vmcall()

The return value of kvm_emulate_hypercall() is intended to inform callers whether or not we need to exit to userspace. However, handle_vmcall() currently ignores the return value.

This patch simply propogates the return value from kvm_emulate_hypercall() to callers so that it can be acted upon appropriately.

---
 arch/x86/kvm/vmx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/vmx.c +1 -2
index f858159..8b37f5f 100644
@@ -4682,8 +4682,7 @@ static int handle_halt(struct kvm_vcpu *vcpu)
 static int handle_vmcall(struct kvm_vcpu *vcpu)
 {
 	skip_emulated_instruction(vcpu);
-	kvm_emulate_hypercall(vcpu);
-	return 1;
+	return kvm_emulate_hypercall(vcpu);
 }
 
 static int handle_invd(struct kvm_vcpu *vcpu)
Signature · 7 lines
1.7.11.7

Jesse Larrew
Software Engineer, KVM Team
IBM Linux Technology Center
Phone: (512) 973-2052 (T/L: 363-2052)
[email protected]
#1 lore raw
Quoted 5 lines · Jesse Larrew

The return value of kvm_emulate_hypercall() is intended to inform callers whether or not we need to exit to userspace. However, handle_vmcall() currently ignores the return value.

No, it it not. KVM does not handle vmcalls in userspace.

Quoted 36 lines

This patch simply propogates the return value from kvm_emulate_hypercall() to callers so that it can be acted upon appropriately.

---
 arch/x86/kvm/vmx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/vmx.c +1 -2
index f858159..8b37f5f 100644
@@ -4682,8 +4682,7 @@ static int handle_halt(struct kvm_vcpu *vcpu)
 static int handle_vmcall(struct kvm_vcpu *vcpu)
 {
 	skip_emulated_instruction(vcpu);
-	kvm_emulate_hypercall(vcpu);
-	return 1;
+	return kvm_emulate_hypercall(vcpu);
 }
 
 static int handle_invd(struct kvm_vcpu *vcpu)
Signature · 13 lines
1.7.11.7

Jesse Larrew
Software Engineer, KVM Team
IBM Linux Technology Center
Phone: (512) 973-2052 (T/L: 363-2052)
[email protected]

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

--
Gleb.