Skip to contentSkip to conversation

don't enter guest after SIPI was received by a CPU

PATCH Applied Gleb Natapov 3 participants 3 messages Sep 22, 2008 – Sep 23, 2008

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

PATCH 1/1 don't enter guest after SIPI was received by a CPU

Don't enter guest after SIPI was issued.

CPU should process SIPI message before entering a guest mode again. kvm_arch_vcpu_runnable() return true if CPU is in SIPI state, so we can't call it here.

arch/x86/kvm/x86.c +1 -1
index 61eddbe..612099f 100644
@@ -3239,7 +3239,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 
 	r = 1;
 	while (r > 0) {
-		if (kvm_arch_vcpu_runnable(vcpu))
+		if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE)
 			r = vcpu_enter_guest(vcpu, kvm_run);
 		else {
 			up_read(&vcpu->kvm->slots_lock);

--
Gleb.

#1 lore raw

Looks good. Thanks Gleb.

Quoted 23 lines · Gleb Natapov

Don't enter guest after SIPI was issued.

CPU should process SIPI message before entering a guest mode again. kvm_arch_vcpu_runnable() return true if CPU is in SIPI state, so we can't call it here.

arch/x86/kvm/x86.c +1 -2
index 61eddbe..612099f 100644
@@ -3239,7 +3239,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 
 	r = 1;
 	while (r > 0) {
-		if (kvm_arch_vcpu_runnable(vcpu))
+		if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE)
 			r = vcpu_enter_guest(vcpu, kvm_run);
 		else {
 			up_read(&vcpu->kvm->slots_lock);
--

Gleb.

Applied
#2 lore raw
In reply to Gleb Natapov
Quoted 7 lines · Gleb Natapov

Don't enter guest after SIPI was issued.

CPU should process SIPI message before entering a guest mode again. kvm_arch_vcpu_runnable() return true if CPU is in SIPI state, so we can't call it here.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function