aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
authorRick Edgecombe <rick.p.edgecombe@intel.com>2026-05-09 15:56:47 +0800
committerSean Christopherson <seanjc@google.com>2026-05-27 17:19:19 -0700
commit41367d77ee4eba4b062835723b1756b0b6a86324 (patch)
tree69776547bded0a627caad7229c8b1ee034522b16 /arch
parent28c77a0378044b96f9c82cdd889872ab88191857 (diff)
downloadlinux-next-history-41367d77ee4eba4b062835723b1756b0b6a86324.tar.gz
KVM: x86/mmu: Drop KVM_BUG_ON() on shared lock to zap child external PTEs
Drop the KVM_BUG_ON() in the KVM MMU core before zapping child external PTEs, since requiring zapping PTEs to be protected by exclusive mmu_lock is TDX's specific requirement. No need to plumb the shared/exclusive info into the remove_external_spte() op or move the KVM_BUG_ON() to TDX, because - There's already an assertion of exclusive mmu_lock protection in TDX. - The KVM_BUG_ON() is a bit redundant given that if there's any bug causing zapping of leaf PTEs in S-EPT under shared mmu_lock, SEAMCALL failures due to contention would result in TDX_BUG_ON() in TDX. Link: https://lore.kernel.org/kvm/aYUarHf3KEwHGuJe@google.com/ Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com> Signed-off-by: Yan Zhao <yan.y.zhao@intel.com> Link: https://patch.msgid.link/20260509075647.4290-1-yan.y.zhao@intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/mmu/tdp_mmu.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index 3c3e73ce8da98..3ba7556a8d2fd 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -473,10 +473,8 @@ static void handle_removed_pt(struct kvm *kvm, tdp_ptep_t pt, bool shared)
}
handle_changed_spte(kvm, sp, gfn, old_spte, FROZEN_SPTE, level, shared);
- if (is_mirror_sp(sp)) {
- KVM_BUG_ON(shared, kvm);
+ if (is_mirror_sp(sp))
remove_external_spte(kvm, gfn, old_spte, level);
- }
}
if (is_mirror_sp(sp) &&