]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: Improve emulation of CPUID leaves 0BH and 1FH
authorJim Mattson <jmattson@google.com>
Thu, 26 Sep 2019 00:04:17 +0000 (17:04 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 Sep 2019 10:31:31 +0000 (12:31 +0200)
commit0f9764d3d12b53b7d6367cd28d25dc2da477d697
treeaa5a1f342f307d53b50bbc77032f0d849f392d9b
parent30360f7d0c65de0ff1781e4de3c506e9cab50a8e
kvm: x86: Improve emulation of CPUID leaves 0BH and 1FH

For these CPUID leaves, the EDX output is not dependent on the ECX
input (i.e. the SIGNIFCANT_INDEX flag doesn't apply to
EDX). Furthermore, the low byte of the ECX output is always identical
to the low byte of the ECX input. KVM does not produce the correct ECX
and EDX outputs for any undefined subleaves beyond the first.

Special-case these CPUID leaves in kvm_cpuid, so that the ECX and EDX
outputs are properly generated for all undefined subleaves.

Fixes: c01a1521061571 ("KVM: Enhance guest cpuid management")
Fixes: e0b3878643cefc ("KVM: x86: Add Intel CPUID.1F cpuid emulation support")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Marc Orr <marcorr@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Reviewed-by: Jacob Xu <jacobhxu@google.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c