Skip to content

Commit 6a3d704

Browse files
committed
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: 77ac707 ("KVM: x86/tdp_mmu: Propagate building mirror page tables") Fixes: 94faba8 ("KVM: x86/tdp_mmu: Propagate tearing down mirror page tables") Reviewed-by: Kai Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 11d4517 commit 6a3d704

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/x86/kvm/mmu/tdp_mmu.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static void remove_external_spte(struct kvm *kvm, gfn_t gfn, u64 old_spte,
378378
/* Zapping leaf spte is allowed only when write lock is held. */
379379
lockdep_assert_held_write(&kvm->mmu_lock);
380380
/* Because write lock is held, operation should success. */
381-
ret = static_call(kvm_x86_remove_external_spte)(kvm, gfn, level, old_pfn);
381+
ret = kvm_x86_call(remove_external_spte)(kvm, gfn, level, old_pfn);
382382
KVM_BUG_ON(ret, kvm);
383383
}
384384

@@ -485,8 +485,8 @@ static void handle_removed_pt(struct kvm *kvm, tdp_ptep_t pt, bool shared)
485485
}
486486

487487
if (is_mirror_sp(sp) &&
488-
WARN_ON(static_call(kvm_x86_free_external_spt)(kvm, base_gfn, sp->role.level,
489-
sp->external_spt))) {
488+
WARN_ON(kvm_x86_call(free_external_spt)(kvm, base_gfn, sp->role.level,
489+
sp->external_spt))) {
490490
/*
491491
* Failed to free page table page in mirror page table and
492492
* 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
538538
* external page table, or leaf.
539539
*/
540540
if (is_leaf) {
541-
ret = static_call(kvm_x86_set_external_spte)(kvm, gfn, level, new_pfn);
541+
ret = kvm_x86_call(set_external_spte)(kvm, gfn, level, new_pfn);
542542
} else {
543543
void *external_spt = get_external_spt(gfn, new_spte, level);
544544

545545
KVM_BUG_ON(!external_spt, kvm);
546-
ret = static_call(kvm_x86_link_external_spt)(kvm, gfn, level, external_spt);
546+
ret = kvm_x86_call(link_external_spt)(kvm, gfn, level, external_spt);
547547
}
548548
if (ret)
549549
__kvm_tdp_mmu_write_spte(sptep, old_spte);

0 commit comments

Comments
 (0)