mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: rkrcmar@redhat.com
Subject: [PATCH for-4.15 0/5] KVM: (almost) emulate UMIP on current processors
Date: Mon, 13 Nov 2017 15:40:26 +0100	[thread overview]
Message-ID: <1510584031-36240-1-git-send-email-pbonzini@redhat.com> (raw)

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

             reply	other threads:[~2017-11-13 14:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 14:40 Paolo Bonzini [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1510584031-36240-1-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®