Skip to content

Commit

Permalink
kfence, x86: only define helpers if !MODULE
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Heiko Carstens <[email protected]>
  • Loading branch information
melver authored and hcahca committed Jul 30, 2021
1 parent 3da77cf commit 00e67bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/include/asm/kfence.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#ifndef _ASM_X86_KFENCE_H
#define _ASM_X86_KFENCE_H

#ifndef MODULE

#include <linux/bug.h>
#include <linux/kfence.h>

Expand Down Expand Up @@ -66,4 +68,6 @@ static inline bool kfence_protect_page(unsigned long addr, bool protect)
return true;
}

#endif /* !MODULE */

#endif /* _ASM_X86_KFENCE_H */

0 comments on commit 00e67bf

Please sign in to comment.