Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / arm64 / include / asm / kfence.h
bloba81937fae9f6da772c6a3f0fc94fb19f019525a0
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * arm64 KFENCE support.
5 * Copyright (C) 2020, Google LLC.
6 */
8 #ifndef __ASM_KFENCE_H
9 #define __ASM_KFENCE_H
11 #include <asm/set_memory.h>
13 static inline bool arch_kfence_init_pool(void) { return true; }
15 static inline bool kfence_protect_page(unsigned long addr, bool protect)
17 set_memory_valid(addr, 1, !protect);
19 return true;
22 #ifdef CONFIG_KFENCE
23 extern bool kfence_early_init;
24 static inline bool arm64_kfence_can_set_direct_map(void)
26 return !kfence_early_init;
28 #else /* CONFIG_KFENCE */
29 static inline bool arm64_kfence_can_set_direct_map(void) { return false; }
30 #endif /* CONFIG_KFENCE */
32 #endif /* __ASM_KFENCE_H */