All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Subject: [PATCH 0/2] x86/hyperv: Bug fix and what I hope is an enhancement
Date: Thu, 28 Oct 2021 15:21:46 -0700	[thread overview]
Message-ID: <20211028222148.2924457-1-seanjc@google.com> (raw)

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


             reply	other threads:[~2021-10-28 22:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 22:21 Sean Christopherson [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211028222148.2924457-1-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.