mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
KVM: x86/mmu: Use kvm_x86_call() instead of manual static_call()
Use KVM's preferred kvm_x86_call() wrapper to invoke static calls related to mirror page tables. No functional change intended. Fixes:77ac7079e6("KVM: x86/tdp_mmu: Propagate building mirror page tables") Fixes:94faba8999("KVM: x86/tdp_mmu: Propagate tearing down mirror page tables") Reviewed-by: Kai Huang <kai.huang@intel.com> Link: https://lore.kernel.org/r/20250331182703.725214-1-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
11d4517511
commit
6a3d704959
|
|
@ -378,7 +378,7 @@ static void remove_external_spte(struct kvm *kvm, gfn_t gfn, u64 old_spte,
|
|||
/* Zapping leaf spte is allowed only when write lock is held. */
|
||||
lockdep_assert_held_write(&kvm->mmu_lock);
|
||||
/* Because write lock is held, operation should success. */
|
||||
ret = static_call(kvm_x86_remove_external_spte)(kvm, gfn, level, old_pfn);
|
||||
ret = kvm_x86_call(remove_external_spte)(kvm, gfn, level, old_pfn);
|
||||
KVM_BUG_ON(ret, kvm);
|
||||
}
|
||||
|
||||
|
|
@ -485,8 +485,8 @@ static void handle_removed_pt(struct kvm *kvm, tdp_ptep_t pt, bool shared)
|
|||
}
|
||||
|
||||
if (is_mirror_sp(sp) &&
|
||||
WARN_ON(static_call(kvm_x86_free_external_spt)(kvm, base_gfn, sp->role.level,
|
||||
sp->external_spt))) {
|
||||
WARN_ON(kvm_x86_call(free_external_spt)(kvm, base_gfn, sp->role.level,
|
||||
sp->external_spt))) {
|
||||
/*
|
||||
* Failed to free page table page in mirror page table and
|
||||
* there is nothing to do further.
|
||||
|
|
@ -538,12 +538,12 @@ static int __must_check set_external_spte_present(struct kvm *kvm, tdp_ptep_t sp
|
|||
* external page table, or leaf.
|
||||
*/
|
||||
if (is_leaf) {
|
||||
ret = static_call(kvm_x86_set_external_spte)(kvm, gfn, level, new_pfn);
|
||||
ret = kvm_x86_call(set_external_spte)(kvm, gfn, level, new_pfn);
|
||||
} else {
|
||||
void *external_spt = get_external_spt(gfn, new_spte, level);
|
||||
|
||||
KVM_BUG_ON(!external_spt, kvm);
|
||||
ret = static_call(kvm_x86_link_external_spt)(kvm, gfn, level, external_spt);
|
||||
ret = kvm_x86_call(link_external_spt)(kvm, gfn, level, external_spt);
|
||||
}
|
||||
if (ret)
|
||||
__kvm_tdp_mmu_write_spte(sptep, old_spte);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user