1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * This file contains the routines for initializing kernel userspace protection
6 #include <linux/export.h>
7 #include <linux/init.h>
8 #include <linux/printk.h>
14 #ifdef CONFIG_PPC_KUAP
15 void setup_kuap(bool disabled)
18 if (IS_ENABLED(CONFIG_40x))
20 if (smp_processor_id() == boot_cpuid)
21 cur_cpu_spec->mmu_features &= ~MMU_FTR_KUAP;
25 pr_info("Activating Kernel Userspace Access Protection\n");
27 prevent_user_access(KUAP_READ_WRITE);