]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: add support for emulating UMIP
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Jul 2016 08:36:41 +0000 (10:36 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Dec 2017 08:26:39 +0000 (09:26 +0100)
commite900a33c861ae62e84eac1794878a2fb6288f71d
treecfe09da682c97a58b7389f341e4d295b03cdceb9
parentf73a1cac5f38161203e76ea5fe7d4661a2961be6
KVM: x86: add support for emulating UMIP

The User-Mode Instruction Prevention feature present in recent Intel
processor prevents a group of instructions (sgdt, sidt, sldt, smsw, and
str) from being executed with CPL > 0. Otherwise, a general protection
fault is issued.

UMIP instructions in general are also able to trigger vmexits, so we can
actually emulate UMIP on older processors.  This commit sets up the
infrastructure so that kvm-intel.ko and kvm-amd.ko can set the UMIP
feature bit for CPUID even if the feature is not actually available
in hardware.

Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c