aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu/tdp_mmu.c
diff options
context:
space:
mode:
authorDavid Matlack <dmatlack@google.com>2021-06-17 23:19:48 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-18 06:45:47 -0400
commit0485cf8dbe964b6cc485178da6ee8ae7b2d0d15c (patch)
tree17c0669262765bc262aee6eeafd4ec375edfdb20 /arch/x86/kvm/mmu/tdp_mmu.c
parentKVM: x86/mmu: Refactor is_tdp_mmu_root into is_tdp_mmu (diff)
downloadlinux-dev-0485cf8dbe964b6cc485178da6ee8ae7b2d0d15c.tar.xz
linux-dev-0485cf8dbe964b6cc485178da6ee8ae7b2d0d15c.zip
KVM: x86/mmu: Remove redundant root_hpa checks
The root_hpa checks below the top-level check in kvm_mmu_page_fault are theoretically redundant since there is no longer a way for the root_hpa to be reset during a page fault. The details of why are described in commit ddce6208217c ("KVM: x86/mmu: Move root_hpa validity checks to top of page fault handler") __direct_map, kvm_tdp_mmu_map, and get_mmio_spte are all only reachable through kvm_mmu_page_fault, therefore their root_hpa checks are redundant. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: David Matlack <dmatlack@google.com> Message-Id: <20210617231948.2591431-5-dmatlack@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--arch/x86/kvm/mmu/tdp_mmu.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index d4c254dc4d5f..caac4ddb46df 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -983,9 +983,6 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
int level;
int req_level;
- if (WARN_ON(!VALID_PAGE(vcpu->arch.mmu->root_hpa)))
- return RET_PF_RETRY;
-
level = kvm_mmu_hugepage_adjust(vcpu, gfn, max_level, &pfn,
huge_page_disallowed, &req_level);