Skip to contentSkip to conversation

KVM: fix vcpu_clear() bug

PATCH Applied Ingo Molnar 2 participants 2 messages Jan 30, 2007 1 message not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: fix vcpu_clear() bug

Subject: [patch] KVM: fix vcpu_clear() bug
From: Ingo Molnar <[email protected]>

if vcpu_clear() is called on a not yet run vcpu then vcpu->cpu will be -1. Check this case and dont call smp_call_function_single(-1).

this patch fixes the crash i reported earlier and -trunk now works fine on a 32-bit SMP host.

---
 drivers/kvm/vmx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/kvm/vmx.c +1 -1
Index: linux/drivers/kvm/vmx.c
===================================================================
@@ -127,7 +127,7 @@ static void __vcpu_clear(void *arg)
 
 static void vcpu_clear(struct kvm_vcpu *vcpu)
 {
-	if (vcpu->cpu != raw_smp_processor_id())
+	if (vcpu->cpu != raw_smp_processor_id() && vcpu->cpu != -1)
 		smp_call_function_single(vcpu->cpu, __vcpu_clear, vcpu, 0, 1);
 	else
 		__vcpu_clear(vcpu);

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

A message that is not in the archive (sent off-list or not yet received): [email protected]

Applied
#2 lore raw
Quoted 9 lines · Ingo Molnar

Subject: [patch] KVM: fix vcpu_clear() bug
From: Ingo Molnar <[email protected]>

if vcpu_clear() is called on a not yet run vcpu then vcpu->cpu will be -1. Check this case and dont call smp_call_function_single(-1).

this patch fixes the crash i reported earlier and -trunk now works fine on a 32-bit SMP host.

Applied, thanks.

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


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV