KVM: x86/mmu: Move round_gfn_for_level() helper into mmu_internal.h
authorHou Wenlong <houwenlong.hwl@antgroup.com>
Mon, 10 Oct 2022 12:19:12 +0000 (20:19 +0800)
committerSean Christopherson <seanjc@google.com>
Tue, 24 Jan 2023 18:05:45 +0000 (10:05 -0800)
commitc667a3baeddcc982bf512c126aec8d0f04adecfe
treeb284603f20aa0a18506aef3485a02863de0014d4
parenta7e48ef77ff27ba2647edec271b302804a0b14c3
KVM: x86/mmu: Move round_gfn_for_level() helper into mmu_internal.h

Rounding down the GFN to a huge page size is a common pattern throughout
KVM, so move round_gfn_for_level() helper in tdp_iter.c to
mmu_internal.h for common usage. Also rename it as gfn_round_for_level()
to use gfn_* prefix and clean up the other call sites.

Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Link: https://lore.kernel.org/r/415c64782f27444898db650e21cf28eeb6441dfa.1665214747.git.houwenlong.hwl@antgroup.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h
arch/x86/kvm/mmu/paging_tmpl.h
arch/x86/kvm/mmu/tdp_iter.c