Enable PV qspinlock for Hyper-V
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest2 patches 5 repliesIn review
- v32 patches 4 repliesSuperseded
- v22 patches 4 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 9 replies | Superseded |
Changes in v4 from the cover letter
- To avoid possible hang issue (if hv_qlock_wait can be interrupted, kick may happen before reading HV_X64_MSR_GUEST_IDLE so that hang happens), disable interrupt before READ_ONCE, then restore it after reading HV_X64_MSR_GUEST_IDLE.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | X86/Hyper-V: Add Guest IDLE MSR supportarch/ | +5 | 0 replies | |
| 2/2 | locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-VDocumentation/ arch/ arch/ +2 more | +109 | 5 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Michael Kelley | Juergen Gross |
|---|---|---|
| 1/2 | R-b | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/2] Enable PV qspinlock for Hyper-V
v3->v4:
- To avoid possible hang issue (if hv_qlock_wait can be interrupted, kick may happen before reading HV_X64_MSR_GUEST_IDLE so that hang happens), disable interrupt before READ_ONCE, then restore it after reading HV_X64_MSR_GUEST_IDLE.v2->v3:
- use "Hyper-V: " as the message prefix
- remove unnecessary header files
- remove unnecessary check in 'hv_qlock_wait'
- fix compilation error on different platforms
v1->v2:
- compile hv_spinlock.c only when CONFIG_PARAVIRT_SPINLOCKS enabled
- merge v1 patch 2/3 to single patch
- remove part of the boilerplate in hv_spinlock.c
- declare hv_pvspin as __initdata
- remove spin_wait_info and hv_notify_long_spin_wait because SpinWaitInfo is a standalone feature.
- add comments for reading HV_X64_MSR_GUEST_IDLE
- replace pr_warn to pr_info
- use pr_fmt instead of the 'hv:' prefix
- register callback function for smp_ops.smp_prepare_boot_cpu to initialize hyper-v spinlock
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.
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.
Yi Sun (2):
X86/Hyper-V: Add Guest IDLE MSR support locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V
Documentation/admin-guide/kernel-parameters.txt | 5 ++ arch/x86/hyperv/Makefile | 4 ++ arch/x86/hyperv/hv_spinlock.c | 85 +++++++++++++++++++++++++ arch/x86/include/asm/hyperv-tlfs.h | 5 ++ arch/x86/include/asm/mshyperv.h | 1 + arch/x86/kernel/cpu/mshyperv.c | 14 ++++ 6 files changed, 114 insertions(+) create mode 100644 arch/x86/hyperv/hv_spinlock.c
Signature · 1 line
1.9.1