RE: x86: use smp_send_reschedule in kvm_vcpu_kick

Zhang, Xiantao
2009-03-12T02:33:48Z

Avi Kivity wrote:
> Marcelo Tosatti wrote:
>> OK, reworked patch:
>> - change ia64 in addition to x86
>> - add comment on smp send reschedule handlers about KVM's usage
>>
>> Untested on IA64.
>>
>> 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.
>>
>
> Looks good. Will wait for Xiantao's test-n-ack before applying.

kvm-ia64 is broken due to recent check-ins about irq-bits, and we are trying to fix it. For this patch, ia64 has to export the symbol smp_send_reschedule before applying the patch.
Xiantao