diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2018-03-05 12:04:36 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-03-16 22:01:33 +0100 |
commit | f7eaeb0ad815730dc63e8974e6f9f4d93b8ca8bb (patch) | |
tree | 44db7cd8c4860a710fe3267ea27a257f801a1f55 | |
parent | 915e6f78bd0641da692ffa7e0b766e633e12e628 (diff) | |
download | linux-stable-f7eaeb0ad815730dc63e8974e6f9f4d93b8ca8bb.tar.gz linux-stable-f7eaeb0ad815730dc63e8974e6f9f4d93b8ca8bb.tar.bz2 linux-stable-f7eaeb0ad815730dc63e8974e6f9f4d93b8ca8bb.zip |
KVM: VMX: don't configure RM TSS for unrestricted guest
An unrestricted guest can run with CR0.PG==0 and/or CR0.PE==0,
e.g. it can run in Real Mode without requiring host emulation.
The RM TSS is only used for emulating RM, i.e. it will never
be used when unrestricted guest is enabled and so doesn't need
to be configured.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r-- | arch/x86/kvm/vmx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 5726cee43f4f..a5d2c6977e3c 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6044,6 +6044,9 @@ static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr) { int ret; + if (enable_unrestricted_guest) + return 0; + ret = x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, addr, PAGE_SIZE * 3); if (ret) |