Marco Elver | 16591e4 | 2021-01-22 09:18:37 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Marco Elver | d92230e | 2021-01-22 09:18:37 +0000 | [diff] [blame] | 2 | /* |
| 3 | * arm64 KFENCE support. |
| 4 | * |
| 5 | * Copyright (C) 2020, Google LLC. |
| 6 | */ |
Marco Elver | 16591e4 | 2021-01-22 09:18:37 +0000 | [diff] [blame] | 7 | |
| 8 | #ifndef __ASM_KFENCE_H |
| 9 | #define __ASM_KFENCE_H |
| 10 | |
| 11 | #include <asm/cacheflush.h> |
| 12 | |
Marco Elver | 16591e4 | 2021-01-22 09:18:37 +0000 | [diff] [blame] | 13 | static inline bool arch_kfence_init_pool(void) { return true; } |
| 14 | |
| 15 | static inline bool kfence_protect_page(unsigned long addr, bool protect) |
| 16 | { |
| 17 | set_memory_valid(addr, 1, !protect); |
| 18 | |
| 19 | return true; |
| 20 | } |
| 21 | |
| 22 | #endif /* __ASM_KFENCE_H */ |