File Index
Files and directories
Sign in
FILE

kfence.h

File preview with syntax highlighting.

linux-6.19.14/arch/arm64/include/asm/kfence.h C
 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/set_memory.h>
12
13static inline bool kfence_protect_page(unsigned long addr, bool protect)
14{
15	set_memory_valid(addr, 1, !protect);
16
17	return true;
18}
19
20#ifdef CONFIG_KFENCE
21extern bool kfence_early_init;
22static inline bool arm64_kfence_can_set_direct_map(void)
23{
24	return !kfence_early_init;
25}
26bool arch_kfence_init_pool(void);
27#else /* CONFIG_KFENCE */
28static inline bool arm64_kfence_can_set_direct_map(void) { return false; }
29#endif /* CONFIG_KFENCE */
30
31#endif /* __ASM_KFENCE_H */
~/ Read-only file preview.