]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
KVM: VMX: WARN on a MOV CR3 exit w/ unrestricted guest
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 5 Mar 2018 20:04:41 +0000 (12:04 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Mar 2018 21:01:37 +0000 (22:01 +0100)
CR3 load/store exiting are always off when unrestricted guest
is enabled.  WARN on the associated CR3 VMEXIT to detect code
that would re-introduce CR3 load/store exiting for unrestricted
guest.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c

index c517e966b829f4e6ad0d7d492f2a65cf268d4ccb..6cefd7b3ff7fc451a9e01875459ce2579043aadc 100644 (file)
@@ -6377,6 +6377,7 @@ static int handle_cr(struct kvm_vcpu *vcpu)
                        err = handle_set_cr0(vcpu, val);
                        return kvm_complete_insn_gp(vcpu, err);
                case 3:
+                       WARN_ON_ONCE(enable_unrestricted_guest);
                        err = kvm_set_cr3(vcpu, val);
                        return kvm_complete_insn_gp(vcpu, err);
                case 4:
@@ -6409,6 +6410,7 @@ static int handle_cr(struct kvm_vcpu *vcpu)
        case 1: /*mov from cr*/
                switch (cr) {
                case 3:
+                       WARN_ON_ONCE(enable_unrestricted_guest);
                        val = kvm_read_cr3(vcpu);
                        kvm_register_write(vcpu, reg, val);
                        trace_kvm_cr_read(cr, val);