Server IP : 13.213.54.232 / Your IP : 216.73.217.11 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/modules/6.8.0-1031-aws/build/arch/loongarch/include/asm/ |
Upload File : |
/* SPDX-License-Identifier: GPL-2.0 */ /* * KFENCE support for LoongArch. * * Author: Enze Li <lienze@kylinos.cn> * Copyright (C) 2022-2023 KylinSoft Corporation. */ #ifndef _ASM_LOONGARCH_KFENCE_H #define _ASM_LOONGARCH_KFENCE_H #include <linux/kfence.h> #include <asm/pgtable.h> #include <asm/tlb.h> static inline bool arch_kfence_init_pool(void) { int err; char *kfence_pool = __kfence_pool; struct vm_struct *area; area = __get_vm_area_caller(KFENCE_POOL_SIZE, VM_IOREMAP, KFENCE_AREA_START, KFENCE_AREA_END, __builtin_return_address(0)); if (!area) return false; __kfence_pool = (char *)area->addr; err = ioremap_page_range((unsigned long)__kfence_pool, (unsigned long)__kfence_pool + KFENCE_POOL_SIZE, virt_to_phys((void *)kfence_pool), PAGE_KERNEL); if (err) { free_vm_area(area); __kfence_pool = kfence_pool; return false; } return true; } /* Protect the given page and flush TLB. */ static inline bool kfence_protect_page(unsigned long addr, bool protect) { pte_t *pte = virt_to_kpte(addr); if (WARN_ON(!pte) || pte_none(ptep_get(pte))) return false; if (protect) set_pte(pte, __pte(pte_val(ptep_get(pte)) & ~(_PAGE_VALID | _PAGE_PRESENT))); else set_pte(pte, __pte(pte_val(ptep_get(pte)) | (_PAGE_VALID | _PAGE_PRESENT))); preempt_disable(); local_flush_tlb_one(addr); preempt_enable(); return true; } #endif /* _ASM_LOONGARCH_KFENCE_H */