Skip to content

Commit 6210556

Browse files
shvipinsean-jc
authored andcommitted
KVM: x86/mmu: Rename kvm_tdp_mmu_zap_sp() to better indicate its purpose
kvm_tdp_mmu_zap_sp() is only used for NX huge page recovery, so rename it to kvm_tdp_mmu_zap_possible_nx_huge_page(). In a future commit, this function will be changed to include logic specific to NX huge page recovery. Signed-off-by: Vipin Sharma <[email protected]> Signed-off-by: James Houghton <[email protected]> https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 6777885 commit 6210556

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

arch/x86/kvm/mmu/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7673,7 +7673,7 @@ static void kvm_recover_nx_huge_pages(struct kvm *kvm,
76737673
if (slot && kvm_slot_dirty_track_enabled(slot))
76747674
unaccount_nx_huge_page(kvm, sp);
76757675
else if (is_tdp_mmu)
7676-
flush |= kvm_tdp_mmu_zap_sp(kvm, sp);
7676+
flush |= kvm_tdp_mmu_zap_possible_nx_huge_page(kvm, sp);
76777677
else
76787678
kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list);
76797679
WARN_ON_ONCE(sp->nx_huge_page_disallowed);

arch/x86/kvm/mmu/tdp_mmu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,8 @@ static void tdp_mmu_zap_root(struct kvm *kvm, struct kvm_mmu_page *root,
925925
rcu_read_unlock();
926926
}
927927

928-
bool kvm_tdp_mmu_zap_sp(struct kvm *kvm, struct kvm_mmu_page *sp)
928+
bool kvm_tdp_mmu_zap_possible_nx_huge_page(struct kvm *kvm,
929+
struct kvm_mmu_page *sp)
929930
{
930931
u64 old_spte;
931932

arch/x86/kvm/mmu/tdp_mmu.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ static inline struct kvm_mmu_page *tdp_mmu_get_root(struct kvm_vcpu *vcpu,
6464
}
6565

6666
bool kvm_tdp_mmu_zap_leafs(struct kvm *kvm, gfn_t start, gfn_t end, bool flush);
67-
bool kvm_tdp_mmu_zap_sp(struct kvm *kvm, struct kvm_mmu_page *sp);
67+
bool kvm_tdp_mmu_zap_possible_nx_huge_page(struct kvm *kvm,
68+
struct kvm_mmu_page *sp);
6869
void kvm_tdp_mmu_zap_all(struct kvm *kvm);
6970
void kvm_tdp_mmu_invalidate_roots(struct kvm *kvm,
7071
enum kvm_tdp_mmu_root_types root_types);

0 commit comments

Comments
 (0)