All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.15 0/5] KVM: (almost) emulate UMIP on current processors
@ 2017-11-13 14:40 Paolo Bonzini
  2017-11-13 14:40 ` [PATCH 1/5] KVM: vmx: use X86_CR4_UMIP and X86_FEATURE_UMIP Paolo Bonzini
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Paolo Bonzini @ 2017-11-13 14:40 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: rkrcmar

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.

Add support for UMIP in virtual machines, and also allow emulation of
UMIP on older processors by enabling descriptor-table vmexits.  This
emulation is not perfect, because SMSW cannot be trapped.  However,
this is not an issue in practice because Linux is _also_ emulating SMSW
instructions on behalf of the program that executes them, because some
16-bit programs expect to use SMSW to detect vm86 mode.

Paolo

Paolo Bonzini (5):
  KVM: vmx: use X86_CR4_UMIP and X86_FEATURE_UMIP
  KVM: x86: add support for UMIP
  KVM: x86: emulate sldt and str
  KVM: x86: add support for emulating UMIP
  KVM: vmx: add support for emulating UMIP

 arch/x86/include/asm/kvm_host.h |  3 ++-
 arch/x86/kvm/cpuid.c            |  6 ++++--
 arch/x86/kvm/emulate.c          | 40 ++++++++++++++++++++++++++++++++++------
 arch/x86/kvm/svm.c              |  6 ++++++
 arch/x86/kvm/vmx.c              | 36 +++++++++++++++++++++++++++++++++---
 arch/x86/kvm/x86.c              |  3 +++
 6 files changed, 82 insertions(+), 12 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-06  2:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13 14:40 [PATCH for-4.15 0/5] KVM: (almost) emulate UMIP on current processors Paolo Bonzini
2017-11-13 14:40 ` [PATCH 1/5] KVM: vmx: use X86_CR4_UMIP and X86_FEATURE_UMIP Paolo Bonzini
2017-11-14  9:30   ` Wanpeng Li
2017-11-13 14:40 ` [PATCH 2/5] KVM: x86: add support for UMIP Paolo Bonzini
2017-11-15  0:40   ` Wanpeng Li
2018-02-06  2:45   ` Wanpeng Li
2017-11-13 14:40 ` [PATCH 3/5] KVM: x86: emulate sldt and str Paolo Bonzini
2017-11-15  0:41   ` Wanpeng Li
2017-11-13 14:40 ` [PATCH 4/5] KVM: x86: add support for emulating UMIP Paolo Bonzini
2017-11-15  0:42   ` Wanpeng Li
2017-11-13 14:40 ` [PATCH 5/5] KVM: vmx: " Paolo Bonzini
2017-11-15  0:42   ` Wanpeng Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.