summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/book3s32/kuep.c
blob: c20733d6e02cb6013b847f2a7ba315b480984582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// SPDX-License-Identifier: GPL-2.0-or-later

#include <asm/kup.h>
#include <asm/smp.h>

struct static_key_false disable_kuep_key;

void setup_kuep(bool disabled)
{
	if (!disabled)
		kuep_lock();

	if (smp_processor_id() != boot_cpuid)
		return;

	if (disabled)
		static_branch_enable(&disable_kuep_key);
	else
		pr_info("Activating Kernel Userspace Execution Prevention\n");
}