mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
KVM: TDX: Move lockdep assert in __tdp_mmu_set_spte_atomic() to TDX code
Move the MMU lockdep assert in __tdp_mmu_set_spte_atomic() into the TDX specific op because the assert is TDX specific in intention. The TDP MMU has many lockdep asserts for various scenarios, and in fact the callchains that are used for TDX already have a lockdep assert which covers the case in __tdp_mmu_set_spte_atomic(). However, these asserts are for management of the TDP root owned by KVM. In the __tdp_mmu_set_spte_atomic() assert case, it is helping with a scheme to avoid contention in the TDX module during zap operations. That is very TDX specific. One option would be to just remove the assert in __tdp_mmu_set_spte_atomic() and rely on the other ones in the TDP MMU. But that assert is for a different intention, and too far away from the SEAMCALL that needs it. So just move it to TDX code. 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/20260509075557.4226-1-yan.y.zhao@intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
6b1280a738
commit
40342185fd
|
|
@ -612,8 +612,6 @@ static inline int __must_check __tdp_mmu_set_spte_atomic(struct kvm *kvm,
|
|||
if (is_mirror_sptep(iter->sptep) && !is_frozen_spte(new_spte)) {
|
||||
int ret;
|
||||
|
||||
lockdep_assert_held(&kvm->mmu_lock);
|
||||
|
||||
/*
|
||||
* We need to lock out other updates to the SPTE until the external
|
||||
* page table has been modified. Use FROZEN_SPTE similar to
|
||||
|
|
|
|||
|
|
@ -1721,6 +1721,8 @@ static int tdx_sept_map_leaf_spte(struct kvm *kvm, gfn_t gfn, enum pg_level leve
|
|||
static int tdx_sept_set_private_spte(struct kvm *kvm, gfn_t gfn, u64 old_spte,
|
||||
u64 new_spte, enum pg_level level)
|
||||
{
|
||||
lockdep_assert_held(&kvm->mmu_lock);
|
||||
|
||||
if (KVM_BUG_ON(is_shadow_present_pte(old_spte), kvm))
|
||||
return -EIO;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user