mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 09:20:13 -04:00
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
28 lines
561 B
C
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
|