]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL
authorTao Xu <tao3.xu@intel.com>
Tue, 16 Jul 2019 06:55:50 +0000 (14:55 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 24 Sep 2019 12:34:36 +0000 (14:34 +0200)
commit182ea64b18555891d984f97c3a5748e6f1f4e062
tree98719f3f207dfe3d8ef0b8125c56b6ea2dca02de
parenta8b7181fd1b46a6cb6098b3280106511c0d4f3c8
KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL

UMWAIT and TPAUSE instructions use 32bit IA32_UMWAIT_CONTROL at MSR index
E1H to determines the maximum time in TSC-quanta that the processor can
reside in either C0.1 or C0.2.

This patch emulates MSR IA32_UMWAIT_CONTROL in guest and differentiate
IA32_UMWAIT_CONTROL between host and guest. The variable
mwait_control_cached in arch/x86/kernel/cpu/umwait.c caches the MSR value,
so this patch uses it to avoid frequently rdmsr of IA32_UMWAIT_CONTROL.

Co-developed-by: Jingqi Liu <jingqi.liu@intel.com>
Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
Signed-off-by: Tao Xu <tao3.xu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/cpu/umwait.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h
arch/x86/kvm/x86.c