]> git.itanic.dy.fi Git - linux-stable/commit
KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 12 Jan 2022 17:01:34 +0000 (18:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Feb 2022 16:29:20 +0000 (17:29 +0100)
commitb8d19063e700c20d91821c4c827cd6c51a6baebb
tree41428fd02f379019fabcedd2e00a25dd0576d326
parent01a15e36b1fb209a0cd589a1ce007e11776b640b
KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use

commit 6cbbaab60ff33f59355492c241318046befd9ffc upstream.

Hyper-V TLFS explicitly forbids VMREAD and VMWRITE instructions when
Enlightened VMCS interface is in use:

"Any VMREAD or VMWRITE instructions while an enlightened VMCS is
active is unsupported and can result in unexpected behavior.""

Windows 11 + WSL2 seems to ignore this, attempts to VMREAD VMCS field
0x4404 ("VM-exit interruption information") are observed. Failing
these attempts with nested_vmx_failInvalid() makes such guests
unbootable.

Microsoft confirms this is a Hyper-V bug and claims that it'll get fixed
eventually but for the time being we need a workaround. (Temporary) allow
VMREAD to get data from the currently loaded Enlightened VMCS.

Note: VMWRITE instructions remain forbidden, it is not clear how to
handle them properly and hopefully won't ever be needed.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20220112170134.1904308-6-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx/evmcs.h
arch/x86/kvm/vmx/nested.c