KVM: x86: virtualize cpuid faulting
authorKyle Huey <me@kylehuey.com>
Mon, 20 Mar 2017 08:16:28 +0000 (01:16 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 21 Apr 2017 10:50:06 +0000 (12:50 +0200)
commitdb2336a80489e7c3c7728cefd9be58fac5ecfb39
tree2a462ecee35d68dea1b931ba5ee226933e663cd0
parentbd17117bb2af60d4bc44e0f9c859e800a3d99722
KVM: x86: virtualize cpuid faulting

Hardware support for faulting on the cpuid instruction is not required to
emulate it, because cpuid triggers a VM exit anyways. KVM handles the relevant
MSRs (MSR_PLATFORM_INFO and MSR_MISC_FEATURES_ENABLE) and upon a
cpuid-induced VM exit checks the cpuid faulting state and the CPL.
kvm_require_cpl is even kind enough to inject the GP fault for us.

Signed-off-by: Kyle Huey <khuey@kylehuey.com>
Reviewed-by: David Matlack <dmatlack@google.com>
[Return "1" from kvm_emulate_cpuid, it's not void. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/cpuid.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c