]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Inject #GP if guest attempts to toggle CR4.LA57 in 64-bit mode
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 3 Jul 2020 02:17:14 +0000 (19:17 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 3 Jul 2020 16:15:56 +0000 (12:15 -0400)
commitf7b123feb269bd4b79c5ee176c07b1023542a065
treeee97b559b1348bd2c4e886ac231457ea1667e86d
parent4ab4339c0b2420482222b185afc7cfac01ed6d92
KVM: x86: Inject #GP if guest attempts to toggle CR4.LA57 in 64-bit mode

Inject a #GP on MOV CR4 if CR4.LA57 is toggled in 64-bit mode, which is
illegal per Intel's SDM:

  CR4.LA57
    57-bit linear addresses (bit 12 of CR4) ... blah blah blah ...
    This bit cannot be modified in IA-32e mode.

Note, the pseudocode for MOV CR doesn't call out the fault condition,
which is likely why the check was missed during initial development.
This is arguably an SDM bug and will hopefully be fixed in future
release of the SDM.

Fixes: 35af0ea6b11dd ("KVM: MMU: Expose the LA57 feature to VM.")
Cc: stable@vger.kernel.org
Reported-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200703021714.5549-1-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c