]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Get CR4.SMEP from MMU, not vCPU, in shadow page fault
authorSean Christopherson <seanjc@google.com>
Tue, 22 Jun 2021 17:57:38 +0000 (10:57 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Jun 2021 22:00:48 +0000 (18:00 -0400)
commitaf650c71d9bc9a0f948277fa181c1036f86dc5b8
tree0687c57133088cb55714e1b2a863fd64fd6c1542
parent449b8bed4a128463c8de06c8e6143b4697ce1e5b
KVM: x86/mmu: Get CR4.SMEP from MMU, not vCPU, in shadow page fault

Use the current MMU instead of vCPU state to query CR4.SMEP when handling
a page fault.  In the nested NPT case, the current CR4.SMEP reflects L2,
whereas the page fault is shadowing L1's NPT, which uses L1's hCR4.
Practically speaking, this is a nop a NPT walks are always user faults,
i.e. this code will never be reached, but fix it up for consistency.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210622175739.3610207-54-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/paging_tmpl.h