]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Get CR0.WP from MMU, not vCPU, in shadow page fault
authorSean Christopherson <seanjc@google.com>
Tue, 22 Jun 2021 17:57:37 +0000 (10:57 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Jun 2021 22:00:47 +0000 (18:00 -0400)
commit449b8bed4a128463c8de06c8e6143b4697ce1e5b
treeb12ff32bef0ae8548334e55203f436de8c3a7fd2
parenta36ab51335fe69b49e086015838c13adc89bb617
KVM: x86/mmu: Get CR0.WP from MMU, not vCPU, in shadow page fault

Use the current MMU instead of vCPU state to query CR0.WP when handling
a page fault.  In the nested NPT case, the current CR0.WP reflects L2,
whereas the page fault is shadowing L1's NPT.  Practically speaking, this
is a nop a NPT walks are always user faults, but fix it up for
consistency.

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