linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/hyperv: Bug fix and what I hope is an enhancement
@ 2021-10-28 22:21 Sean Christopherson
  2021-10-28 22:21 ` [PATCH 1/2] x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails Sean Christopherson
  2021-10-28 22:21 ` [PATCH 2/2] x86/hyperv: Move required MSRs check to initial platform probing Sean Christopherson
  0 siblings, 2 replies; 10+ messages in thread
From: Sean Christopherson @ 2021-10-28 22:21 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Dexuan Cui, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: H. Peter Anvin, linux-hyperv, linux-kernel, Vitaly Kuznetsov,
	Sean Christopherson

Patch 01 is a fix for a NULL pointer deref that I ran into with a bad VMM
configuration.

Patch 02 effectively makes the required MSRs mandatory for recognizing
Hyper-V at all.  I'm not confident this is truly desirable, e.g. there
might be some features that are still kinda sorta usable, but on the other
hand there's a large pile of features that end up being a waste of cycles
to worm their way back to the native ops.

QEMU 5.1 (and other versions) makes it all too easy to advertise Hyper-V
and a slew of features without advertising the Hyper-V HYPERCALL MSR, e.g.
forcing QEMU features +hv-ipi,+hv-tlbflush,+hv-vpindex,+hv-reenlightenment
advertises a bunch of things, but not the HYPERCALL MSR.

That results in the guest identifying Hyper-V and setting a variety of PV
ops that then get ignored because hyperv_init() silently disables Hyper-V
for all intents and purposes.  The VMM (or its controller) is obviously
off in the weeds, but ideally the guest kernel would acknowledge the bad
setup in some way.

Sean Christopherson (2):
  x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup
    fails
  x86/hyperv: Move required MSRs check to initial platform probing

 arch/x86/hyperv/hv_init.c      | 16 +++++++---------
 arch/x86/kernel/cpu/mshyperv.c | 20 +++++++++++++++-----
 2 files changed, 22 insertions(+), 14 deletions(-)

-- 
2.33.0.1079.g6e70778dc9-goog


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

end of thread, other threads:[~2021-11-04 12:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 22:21 [PATCH 0/2] x86/hyperv: Bug fix and what I hope is an enhancement Sean Christopherson
2021-10-28 22:21 ` [PATCH 1/2] x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails Sean Christopherson
2021-10-29  9:14   ` Vitaly Kuznetsov
2021-11-02 12:17     ` Wei Liu
2021-11-02 14:31       ` Sean Christopherson
2021-11-04 12:10         ` Wei Liu
2021-11-04 12:24           ` Wei Liu
2021-10-28 22:21 ` [PATCH 2/2] x86/hyperv: Move required MSRs check to initial platform probing Sean Christopherson
2021-10-29  9:20   ` Vitaly Kuznetsov
2021-11-04 12:13     ` Wei Liu

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).