[PATCH v1 0/3] Enable PV qspinlock for Hyper-V

From: Yi Sun
Date: Thu Sep 13 2018 - 05:37:58 EST


This patch adds the necessary Hyper-V specific code to allow
PV qspinlock work on Hyper-V.

In wait callback function, read HV_X64_MSR_GUEST_IDLE MSR
to trigger the guest's transition to the idle power state
which can be exited by an IPI even if IF flag is disabled.
Beside that, make HVCALL_NOTIFY_LONG_SPIN_WAIT hypervall to
notify the hypervisor that the calling virtual processor is
attempting to acquire a resource that is potentially held
by another virtual processor within the same partition. This
scheduling hint improves the scalability of partitions with
more than one virtual processor.

In kick callback function, just send platform IPI to make
waiting vcpu exit idle state.

In vcpu_is_preempted callback function, return false directly
because Hyper-V does not provide such interface so far.


Cc: "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>
Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Cc: Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>
Cc: Jonathan Corbet <corbet@xxxxxxx>

Yi Sun (3):
X86/Hyper-V: Add Guest IDLE MSR support
locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V
hv: add description for hv_nopvspin

Documentation/admin-guide/kernel-parameters.txt | 5 ++
arch/x86/hyperv/Makefile | 2 +-
arch/x86/hyperv/hv_spinlock.c | 99 +++++++++++++++++++++++++
arch/x86/include/asm/hyperv-tlfs.h | 5 ++
arch/x86/include/asm/mshyperv.h | 3 +
arch/x86/kernel/smpboot.c | 2 +
6 files changed, 115 insertions(+), 1 deletion(-)
create mode 100644 arch/x86/hyperv/hv_spinlock.c

--
1.9.1