Longpeng(Mike) 199b5763d3 KVM: add spinlock optimization framework
If a vcpu exits due to request a user mode spinlock, then
the spinlock-holder may be preempted in user mode or kernel mode.
(Note that not all architectures trap spin loops in user mode,
only AMD x86 and ARM/ARM64 currently do).

But if a vcpu exits in kernel mode, then the holder must be
preempted in kernel mode, so we should choose a vcpu in kernel mode
as a more likely candidate for the lock holder.

This introduces kvm_arch_vcpu_in_kernel() to decide whether the
vcpu is in kernel-mode when it's preempted.  kvm_vcpu_on_spin's
new argument says the same of the spinning VCPU.

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08 10:57:43 +02:00
..
2017-07-06 18:38:31 -07:00
2017-04-12 20:17:15 +02:00
2017-04-12 20:17:13 +02:00
2017-07-19 16:19:14 +02:00
2016-01-15 17:56:32 -08:00
2017-05-08 17:15:12 -07:00
2017-08-08 10:57:43 +02:00
2017-08-08 10:57:43 +02:00
2017-08-08 10:57:43 +02:00
2017-04-21 12:50:28 +02:00