]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Reset MMU context if guest toggles CR4.SMAP or CR4.PKE
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 23 Sep 2020 21:53:52 +0000 (14:53 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Sep 2020 12:56:35 +0000 (08:56 -0400)
commit92eb427b8abac149c3de3af5e3bc23bf551e3ccf
tree31190bdf4f18c022e92f397990fd0a7bde2ff1f1
parent5a3f2c1a99cf9c254592ed8de17c1f03189018fb
KVM: x86: Reset MMU context if guest toggles CR4.SMAP or CR4.PKE

Reset the MMU context during kvm_set_cr4() if SMAP or PKE is toggled.
Recent commits to (correctly) not reload PDPTRs when SMAP/PKE are
toggled inadvertantly skipped the MMU context reset due to the mask
of bits that triggers PDPTR loads also being used to trigger MMU context
resets.

Fixes: c186276251e9 ("kvm: x86: Toggling CR4.SMAP does not load PDPTEs in PAE mode")
Fixes: 2e38dbb331fb ("kvm: x86: Toggling CR4.PKE does not load PDPTEs in PAE mode")
Cc: Jim Mattson <jmattson@google.com>
Cc: Peter Shier <pshier@google.com>
Cc: Oliver Upton <oupton@google.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923215352.17756-1-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c