OSDN Git Service

KVM: x86/mmu: Pivot on "TDP MMU enabled" when handling direct page faults
authorSean Christopherson <seanjc@google.com>
Wed, 12 Oct 2022 18:16:58 +0000 (18:16 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Dec 2022 11:03:02 +0000 (06:03 -0500)
commit94fbbfbbdffdce23d9c37e65da711adbc1bfe642
tree51884e3c9efe470fe14090d7a249f2c19b7a6517
parentf2e4535c273af02efe5f58ec201cf7e14a6c895a
KVM: x86/mmu: Pivot on "TDP MMU enabled" when handling direct page faults

When handling direct page faults, pivot on the TDP MMU being globally
enabled instead of checking if the target MMU is a TDP MMU.  Now that the
TDP MMU is all-or-nothing, if the TDP MMU is enabled, KVM will reach
direct_page_fault() if and only if the MMU is a TDP MMU.  When TDP is
enabled (obviously required for the TDP MMU), only non-nested TDP page
faults reach direct_page_fault(), i.e. nonpaging MMUs are impossible, as
NPT requires paging to be enabled and EPT faults use ept_page_fault().

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221012181702.3663607-8-seanjc@google.com>
[Use tdp_mmu_enabled variable. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c