aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>2018-03-30 13:28:24 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2018-04-03 07:50:08 -0400
commite7347a86830f38dc3e40c8f7e28c04412b12a2e7 (patch)
tree4a08d627a0850ba21ea0e3ea5fc7f6c6bbc0f9b8
parent252988cbf037f3d446eea222afb46cc134d32c71 (diff)
powerpc: Move default security feature flags
This moves the definition of the default security feature flags (i.e., enabled by default) closer to the security feature flags. This can be used to restore current flags to the default flags. Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/security_features.h8
-rw-r--r--arch/powerpc/kernel/security.c7
2 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/security_features.h b/arch/powerpc/include/asm/security_features.h
index 400a9050e035..fa4d2e1cf772 100644
--- a/arch/powerpc/include/asm/security_features.h
+++ b/arch/powerpc/include/asm/security_features.h
@@ -63,4 +63,12 @@ static inline bool security_ftr_enabled(unsigned long feature)
63// Firmware configuration indicates user favours security over performance 63// Firmware configuration indicates user favours security over performance
64#define SEC_FTR_FAVOUR_SECURITY 0x0000000000000200ull 64#define SEC_FTR_FAVOUR_SECURITY 0x0000000000000200ull
65 65
66
67// Features enabled by default
68#define SEC_FTR_DEFAULT \
69 (SEC_FTR_L1D_FLUSH_HV | \
70 SEC_FTR_L1D_FLUSH_PR | \
71 SEC_FTR_BNDS_CHK_SPEC_BAR | \
72 SEC_FTR_FAVOUR_SECURITY)
73
66#endif /* _ASM_POWERPC_SECURITY_FEATURES_H */ 74#endif /* _ASM_POWERPC_SECURITY_FEATURES_H */
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 2cee3dcd231b..bab5a27ea805 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -11,12 +11,7 @@
11#include <asm/security_features.h> 11#include <asm/security_features.h>
12 12
13 13
14unsigned long powerpc_security_features __read_mostly = \ 14unsigned long powerpc_security_features __read_mostly = SEC_FTR_DEFAULT;
15 SEC_FTR_L1D_FLUSH_HV | \
16 SEC_FTR_L1D_FLUSH_PR | \
17 SEC_FTR_BNDS_CHK_SPEC_BAR | \
18 SEC_FTR_FAVOUR_SECURITY;
19
20 15
21ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf) 16ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
22{ 17{