summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/security.c
diff options
context:
space:
mode:
authorMichael Ellerman2018-03-27 14:01:44 +0200
committerMichael Ellerman2018-03-27 14:44:51 +0200
commit9a868f634349e62922c226834aa23e3d1329ae7f (patch)
tree463b77041dab7e21468ae99d9f294e069d889f39 /arch/powerpc/kernel/security.c
parentpowerpc/pseries: Add new H_GET_CPU_CHARACTERISTICS flags (diff)
downloadkernel-qcow2-linux-9a868f634349e62922c226834aa23e3d1329ae7f.tar.gz
kernel-qcow2-linux-9a868f634349e62922c226834aa23e3d1329ae7f.tar.xz
kernel-qcow2-linux-9a868f634349e62922c226834aa23e3d1329ae7f.zip
powerpc: Add security feature flags for Spectre/Meltdown
This commit adds security feature flags to reflect the settings we receive from firmware regarding Spectre/Meltdown mitigations. The feature names reflect the names we are given by firmware on bare metal machines. See the hostboot source for details. Arguably these could be firmware features, but that then requires them to be read early in boot so they're available prior to asm feature patching, but we don't actually want to use them for patching. We may also want to dynamically update them in future, which would be incompatible with the way firmware features work (at the moment at least). So for now just make them separate flags. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/security.c')
-rw-r--r--arch/powerpc/kernel/security.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
new file mode 100644
index 000000000000..4ccba00d224c
--- /dev/null
+++ b/arch/powerpc/kernel/security.c
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Security related flags and so on.
+//
+// Copyright 2018, Michael Ellerman, IBM Corporation.
+
+#include <linux/kernel.h>
+#include <asm/security_features.h>
+
+
+unsigned long powerpc_security_features __read_mostly = \
+ SEC_FTR_L1D_FLUSH_HV | \
+ SEC_FTR_L1D_FLUSH_PR | \
+ SEC_FTR_BNDS_CHK_SPEC_BAR | \
+ SEC_FTR_FAVOUR_SECURITY;