KVM: use smp_send_reschedule in kvm_vcpu_kick
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 7 May 2009 20:55:12 +0000 (17:55 -0300)
committerAvi Kivity <avi@redhat.com>
Wed, 10 Jun 2009 08:48:53 +0000 (11:48 +0300)
commit32f8840064d88cc3f6e85203aec7b6b57bebcb97
tree29a42942c71e9bdf1f3e71aa1674a29aa13ce320
parentd149c731e4f71982247a14409951259f36271dd7
KVM: use smp_send_reschedule in kvm_vcpu_kick

KVM uses a function call IPI to cause the exit of a guest running on a
physical cpu. For virtual interrupt notification there is no need to
wait on IPI receival, or to execute any function.

This is exactly what the reschedule IPI does, without the overhead
of function IPI. So use it instead of smp_call_function_single in
kvm_vcpu_kick.

Also change the "guest_mode" variable to a bit in vcpu->requests, and
use that to collapse multiple IPI's that would be issued between the
first one and zeroing of guest mode.

This allows kvm_vcpu_kick to called with interrupts disabled.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/ia64/kernel/irq_ia64.c
arch/ia64/kvm/kvm-ia64.c
arch/x86/kernel/smp.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h