Files
linux/arch/powerpc/mm/nohash/kup.c
Christophe Leroy 732b32daef powerpc: Remove core support for 40x
Now that 40x platforms have gone, remove support
for 40x in the core of powerpc arch.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240628121201.130802-4-mpe@ellerman.id.au
2024-06-28 22:28:47 +10:00

28 lines
561 B
C

// SPDX-License-Identifier: GPL-2.0-or-later
/*
* This file contains the routines for initializing kernel userspace protection
*/
#include <linux/export.h>
#include <linux/init.h>
#include <linux/printk.h>
#include <linux/smp.h>
#include <asm/kup.h>
#include <asm/smp.h>
#ifdef CONFIG_PPC_KUAP
void setup_kuap(bool disabled)
{
if (disabled) {
if (smp_processor_id() == boot_cpuid)
cur_cpu_spec->mmu_features &= ~MMU_FTR_KUAP;
return;
}
pr_info("Activating Kernel Userspace Access Protection\n");
prevent_user_access(KUAP_READ_WRITE);
}
#endif