arm64, kfence: enable KFENCE for ARM64
[linux-2.6-microblaze.git] / arch / arm64 / include / asm / kfence.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * arm64 KFENCE support.
4  *
5  * Copyright (C) 2020, Google LLC.
6  */
7
8 #ifndef __ASM_KFENCE_H
9 #define __ASM_KFENCE_H
10
11 #include <asm/cacheflush.h>
12
13 #define KFENCE_SKIP_ARCH_FAULT_HANDLER "el1_sync"
14
15 static inline bool arch_kfence_init_pool(void) { return true; }
16
17 static inline bool kfence_protect_page(unsigned long addr, bool protect)
18 {
19         set_memory_valid(addr, 1, !protect);
20
21         return true;
22 }
23
24 #endif /* __ASM_KFENCE_H */