[PATCH RFC v3 7/8] x86/xen: add __init for xen_pgd_walk
Chen Linxuan via B4 Relay
devnull+chenlinxuan.uniontech.com at kernel.org
Mon Apr 28 21:06:11 PDT 2025
From: Chen Linxuan <chenlinxuan at uniontech.com>
Presume that kernel is compiled for x86_64 with gcc version 13.3.0:
make allmodconfig
make KCFLAGS="-fno-inline-small-functions -fno-inline-functions-called-once"
This results a modpost warning:
WARNING: modpost: vmlinux: section mismatch in reference: xen_pgd_walk+0x42 (section: .text) -> xen_mark_pinned (section: .init.text)
As xen_pgd_walk is only referenced in xen_after_bootmem(void) which is
also in .init.text, I add __init for xen_pgd_walk to fix this issue.
Signed-off-by: Chen Linxuan <chenlinxuan at uniontech.com>
---
arch/x86/xen/mmu_pv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index 38971c6dcd4b78b6b14f51bc69c4bf6b70ebd622..53650888be0a7b1dba170a5b7ba9c654244b5125 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -696,7 +696,7 @@ static void __xen_pgd_walk(struct mm_struct *mm, pgd_t *pgd,
(*func)(mm, virt_to_page(pgd), PT_PGD);
}
-static void xen_pgd_walk(struct mm_struct *mm,
+static void __init xen_pgd_walk(struct mm_struct *mm,
void (*func)(struct mm_struct *mm, struct page *,
enum pt_level),
unsigned long limit)
--
2.43.0
More information about the Linux-nvme
mailing list