linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Enable PV qspinlock for Hyper-V
@ 2018-09-21  7:25 Yi Sun
  2018-09-21  7:25 ` [PATCH v2 1/2] X86/Hyper-V: Add Guest IDLE MSR support Yi Sun
  2018-09-21  7:25 ` [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Yi Sun
  0 siblings, 2 replies; 9+ messages in thread
From: Yi Sun @ 2018-09-21  7:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: x86, tglx, chao.p.peng, chao.gao, isaku.yamahata,
	michael.h.kelley, tianyu.lan, Yi Sun, K. Y. Srinivasan,
	Haiyang Zhang, Stephen Hemminger, Jonathan Corbet

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.


Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Thomas Gleixner <tglx@linutronix.de>

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                   | 81 +++++++++++++++++++++++++
 arch/x86/include/asm/hyperv-tlfs.h              |  5 ++
 arch/x86/include/asm/mshyperv.h                 |  3 +
 arch/x86/kernel/cpu/mshyperv.c                  | 12 ++++
 6 files changed, 110 insertions(+)
 create mode 100644 arch/x86/hyperv/hv_spinlock.c

-- 
1.9.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-26  8:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21  7:25 [PATCH v2 0/2] Enable PV qspinlock for Hyper-V Yi Sun
2018-09-21  7:25 ` [PATCH v2 1/2] X86/Hyper-V: Add Guest IDLE MSR support Yi Sun
2018-09-21 16:52   ` Michael Kelley (EOSG)
2018-09-21  7:25 ` [PATCH v2 2/2] locking/pvqspinlock, hv: Enable PV qspinlock for Hyper-V Yi Sun
2018-09-21 17:02   ` Michael Kelley (EOSG)
2018-09-25  7:11     ` Yi Sun
2018-09-21 19:09   ` kbuild test robot
2018-09-26  2:15   ` kbuild test robot
2018-09-26  8:23   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).