From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753039AbdKMOkq (ORCPT ); Mon, 13 Nov 2017 09:40:46 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:45740 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752923AbdKMOkh (ORCPT ); Mon, 13 Nov 2017 09:40:37 -0500 X-Google-Smtp-Source: AGs4zMaGvWmzmZL29Ppt8gdWfR1W5WbFqIwaa+6fBr4FK3CK29jPtR1UnQa3tJAeBlnojYQhAfAvzQ== From: Paolo Bonzini 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 Message-Id: <1510584031-36240-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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