Skip to content

Commit c893b84

Browse files
dmatlackgregkh
authored andcommitted
KVM: x86/mmu: Rename __direct_map() to direct_map()
[ Upstream commit 6c882ef ] Rename __direct_map() to direct_map() since the leading underscores are unnecessary. This also makes the page fault handler names more consistent: kvm_tdp_mmu_page_fault() calls kvm_tdp_mmu_map() and direct_page_fault() calls direct_map(). Opportunistically make some trivial cleanups to comments that had to be modified anyway since they mentioned __direct_map(). Specifically, use "()" when referring to functions, and include kvm_tdp_mmu_map() among the various callers of disallowed_hugepage_adjust(). No functional change intended. Signed-off-by: David Matlack <dmatlack@google.com> Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220921173546.2674386-11-dmatlack@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Stable-dep-of: 2abd528 ("KVM: x86: Check for invalid/obsolete root *after* making MMU pages available") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kenta Akagi <k@mgml.me> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 851bb1a commit c893b84

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎arch/x86/kvm/mmu/mmu.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,11 +2995,11 @@ void disallowed_hugepage_adjust(u64 spte, gfn_t gfn, int cur_level,
29952995
is_shadow_present_pte(spte) &&
29962996
!is_large_pte(spte)) {
29972997
/*
2998-
* A small SPTE exists for this pfn, but FNAME(fetch)
2999-
* and __direct_map would like to create a large PTE
3000-
* instead: just force them to go down another level,
3001-
* patching back for them into pfn the next 9 bits of
3002-
* the address.
2998+
* A small SPTE exists for this pfn, but FNAME(fetch),
2999+
* direct_map(), or kvm_tdp_mmu_map() would like to create a
3000+
* large PTE instead: just force them to go down another level,
3001+
* patching back for them into pfn the next 9 bits of the
3002+
* address.
30033003
*/
30043004
u64 page_mask = KVM_PAGES_PER_HPAGE(level) -
30053005
KVM_PAGES_PER_HPAGE(level - 1);
@@ -3008,9 +3008,9 @@ void disallowed_hugepage_adjust(u64 spte, gfn_t gfn, int cur_level,
30083008
}
30093009
}
30103010

3011-
static int __direct_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
3012-
int map_writable, int max_level, kvm_pfn_t pfn,
3013-
bool prefault, bool is_tdp)
3011+
static int direct_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
3012+
int map_writable, int max_level, kvm_pfn_t pfn,
3013+
bool prefault, bool is_tdp)
30143014
{
30153015
bool nx_huge_page_workaround_enabled = is_nx_huge_page_enabled();
30163016
bool write = error_code & PFERR_WRITE_MASK;
@@ -4055,8 +4055,8 @@ static int direct_page_fault(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
40554055
if (r)
40564056
goto out_unlock;
40574057

4058-
r = __direct_map(vcpu, gpa, error_code, map_writable, max_level, pfn,
4059-
prefault, is_tdp);
4058+
r = direct_map(vcpu, gpa, error_code, map_writable, max_level, pfn,
4059+
prefault, is_tdp);
40604060

40614061
out_unlock:
40624062
write_unlock(&vcpu->kvm->mmu_lock);

0 commit comments

Comments
 (0)