summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/dexcr.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/dexcr.c')
-rw-r--r--arch/powerpc/kernel/dexcr.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/dexcr.c b/arch/powerpc/kernel/dexcr.c
new file mode 100644
index 000000000000..d5cd77421088
--- /dev/null
+++ b/arch/powerpc/kernel/dexcr.c
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include <linux/capability.h>
+#include <linux/cpu.h>
+#include <linux/init.h>
+#include <linux/prctl.h>
+#include <linux/sched.h>
+
+#include <asm/cpu_has_feature.h>
+#include <asm/cputable.h>
+#include <asm/processor.h>
+#include <asm/reg.h>
+
+static int __init init_task_dexcr(void)
+{
+ if (!early_cpu_has_feature(CPU_FTR_ARCH_31))
+ return 0;
+
+ current->thread.dexcr_onexec = mfspr(SPRN_DEXCR);
+
+ return 0;
+}
+early_initcall(init_task_dexcr)