Commit 0f53dfa3 authored by David Matlack's avatar David Matlack Committed by Paolo Bonzini

KVM: x86/mmu: Rename handle_removed_tdp_mmu_page() to handle_removed_pt()

First remove tdp_mmu_ from the name since it is redundant given that it
is a static function in tdp_mmu.c. There is a pattern of using tdp_mmu_
as a prefix in the names of static TDP MMU functions, but all of the
other handle_*() variants do not include such a prefix. So drop it
entirely.

Then change "page" to "pt" to convey that this is operating on a page
table rather than an struct page. Purposely use "pt" instead of "sp"
since this function takes the raw RCU-protected page table pointer as an
argument rather than  a pointer to the struct kvm_mmu_page.

No functional change intended.
Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
Message-Id: <20220119230739.2234394-7-dmatlack@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent c298a30c
...@@ -312,7 +312,7 @@ static void tdp_mmu_unlink_sp(struct kvm *kvm, struct kvm_mmu_page *sp, ...@@ -312,7 +312,7 @@ static void tdp_mmu_unlink_sp(struct kvm *kvm, struct kvm_mmu_page *sp,
} }
/** /**
* handle_removed_tdp_mmu_page - handle a pt removed from the TDP structure * handle_removed_pt() - handle a page table removed from the TDP structure
* *
* @kvm: kvm instance * @kvm: kvm instance
* @pt: the page removed from the paging structure * @pt: the page removed from the paging structure
...@@ -328,8 +328,7 @@ static void tdp_mmu_unlink_sp(struct kvm *kvm, struct kvm_mmu_page *sp, ...@@ -328,8 +328,7 @@ static void tdp_mmu_unlink_sp(struct kvm *kvm, struct kvm_mmu_page *sp,
* this thread will be responsible for ensuring the page is freed. Hence the * this thread will be responsible for ensuring the page is freed. Hence the
* early rcu_dereferences in the function. * early rcu_dereferences in the function.
*/ */
static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt, static void handle_removed_pt(struct kvm *kvm, tdp_ptep_t pt, bool shared)
bool shared)
{ {
struct kvm_mmu_page *sp = sptep_to_sp(rcu_dereference(pt)); struct kvm_mmu_page *sp = sptep_to_sp(rcu_dereference(pt));
int level = sp->role.level; int level = sp->role.level;
...@@ -492,8 +491,7 @@ static void __handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn, ...@@ -492,8 +491,7 @@ static void __handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,
* the paging structure. * the paging structure.
*/ */
if (was_present && !was_leaf && (pfn_changed || !is_present)) if (was_present && !was_leaf && (pfn_changed || !is_present))
handle_removed_tdp_mmu_page(kvm, handle_removed_pt(kvm, spte_to_child_pt(old_spte, level), shared);
spte_to_child_pt(old_spte, level), shared);
} }
static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn, static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment