Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kfence, x86: only define helpers if !MODULE

x86's <asm/tlbflush.h> only declares non-module accessible functions
(such as flush_tlb_one_kernel) if !MODULE.

In preparation of including <asm/kfence.h> from the KFENCE test module,
only define the helpers if !MODULE to avoid breaking the build with
CONFIG_KFENCE_KUNIT_TEST=m.

Signed-off-by: Marco Elver <elver@google.com>
Link: https://lore.kernel.org/r/YQJdarx6XSUQ1tFZ@elver.google.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Marco Elver and committed by
Heiko Carstens
00e67bf0 3da77cf3

+4
+4
arch/x86/include/asm/kfence.h
··· 8 8 #ifndef _ASM_X86_KFENCE_H 9 9 #define _ASM_X86_KFENCE_H 10 10 11 + #ifndef MODULE 12 + 11 13 #include <linux/bug.h> 12 14 #include <linux/kfence.h> 13 15 ··· 67 65 preempt_enable(); 68 66 return true; 69 67 } 68 + 69 + #endif /* !MODULE */ 70 70 71 71 #endif /* _ASM_X86_KFENCE_H */