1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 3 #ifndef _ASM_RISCV_KFENCE_H 4 #define _ASM_RISCV_KFENCE_H 5 6 #include <linux/kfence.h> 7 #include <linux/pfn.h> 8 #include <asm-generic/pgalloc.h> 9 #include <asm/pgtable.h> 10 11 static inline bool arch_kfence_init_pool(void) 12 { 13 return true; 14 } 15 16 static inline bool kfence_protect_page(unsigne 17 { 18 pte_t *pte = virt_to_kpte(addr); 19 20 if (protect) 21 set_pte(pte, __pte(pte_val(pte 22 else 23 set_pte(pte, __pte(pte_val(pte 24 25 flush_tlb_kernel_range(addr, addr + PA 26 27 return true; 28 } 29 30 #endif /* _ASM_RISCV_KFENCE_H */ 31
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.