xref: /linux/arch/powerpc/mm/book3s32/kuap.c (revision 86f46f3432727933be82f64b739712a6edb9d704)
191ec6671SChristophe Leroy // SPDX-License-Identifier: GPL-2.0-or-later
291ec6671SChristophe Leroy 
391ec6671SChristophe Leroy #include <asm/kup.h>
4*86f46f34SChristophe Leroy #include <asm/smp.h>
591ec6671SChristophe Leroy 
691ec6671SChristophe Leroy void __init setup_kuap(bool disabled)
791ec6671SChristophe Leroy {
8*86f46f34SChristophe Leroy 	kuap_update_sr(mfsr(0) | SR_KS, 0, TASK_SIZE);
9*86f46f34SChristophe Leroy 
10*86f46f34SChristophe Leroy 	if (smp_processor_id() != boot_cpuid)
11*86f46f34SChristophe Leroy 		return;
12*86f46f34SChristophe Leroy 
1391ec6671SChristophe Leroy 	pr_info("Activating Kernel Userspace Access Protection\n");
1491ec6671SChristophe Leroy 
1591ec6671SChristophe Leroy 	if (disabled)
1691ec6671SChristophe Leroy 		pr_warn("KUAP cannot be disabled yet on 6xx when compiled in\n");
1791ec6671SChristophe Leroy }
18