1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 3 * PA-RISC KFENCE support. 4 * 5 * Copyright (C) 2021, Helge Deller <deller@gm 6 */ 7 8 #ifndef _ASM_PARISC_KFENCE_H 9 #define _ASM_PARISC_KFENCE_H 10 11 #include <linux/kfence.h> 12 13 #include <asm/pgtable.h> 14 #include <asm/tlbflush.h> 15 16 static inline bool arch_kfence_init_pool(void) 17 { 18 return true; 19 } 20 21 /* Protect the given page and flush TLB. */ 22 static inline bool kfence_protect_page(unsigne 23 { 24 pte_t *pte = virt_to_kpte(addr); 25 26 if (WARN_ON(!pte)) 27 return false; 28 29 /* 30 * We need to avoid IPIs, as we may ge 31 * with interrupts disabled. 32 */ 33 34 if (protect) 35 set_pte(pte, __pte(pte_val(*pt 36 else 37 set_pte(pte, __pte(pte_val(*pt 38 39 flush_tlb_kernel_range(addr, addr + PA 40 41 return true; 42 } 43 44 #endif /* _ASM_PARISC_KFENCE_H */ 45
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.