]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/i386: do not set unsupported VMX secondary execution controls
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 31 Mar 2020 16:27:52 +0000 (18:27 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 22 Jun 2020 17:14:11 +0000 (12:14 -0500)
commit54bcaf08d66f9675e5662e061f5c4c0d8f3a2506
treee4aab48dbf9227364dfe61b5dfa3eaf3f7b7ab6e
parente727aa1a7b34fcaffb3bf0b4c64aae488f007b15
target/i386: do not set unsupported VMX secondary execution controls

Commit 048c95163b4 ("target/i386: work around KVM_GET_MSRS bug for
secondary execution controls") added a workaround for KVM pre-dating
commit 6defc591846d ("KVM: nVMX: include conditional controls in /dev/kvm
KVM_GET_MSRS") which wasn't setting certain available controls. The
workaround uses generic CPUID feature bits to set missing VMX controls.

It was found that in some cases it is possible to observe hosts which
have certain CPUID features but lack the corresponding VMX control.

In particular, it was reported that Azure VMs have RDSEED but lack
VMX_SECONDARY_EXEC_RDSEED_EXITING; attempts to enable this feature
bit result in QEMU abort.

Resolve the issue but not applying the workaround when we don't have
to. As there is no good way to find out if KVM has the fix itself, use
95c5c7c77c ("KVM: nVMX: list VMX MSRs in KVM_GET_MSR_INDEX_LIST") instead
as these [are supposed to] come together.

Fixes: 048c95163b4 ("target/i386: work around KVM_GET_MSRS bug for secondary execution controls")
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20200331162752.1209928-1-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 4a910e1f6ab4155ec8b24c49b2585cc486916985)
 Conflicts:
target/i386/kvm.c
*drop context dep. on 6702514814c
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target/i386/kvm.c