]> git.hungrycats.org Git - linux/commitdiff
powerpc/64s: Move cpu_show_meltdown()
authorMichael Ellerman <mpe@ellerman.id.au>
Sat, 2 Jun 2018 11:08:58 +0000 (21:08 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jun 2018 14:44:36 +0000 (16:44 +0200)
commit 8ad33041563a10b34988800c682ada14b2612533 upstream.

This landed in setup_64.c for no good reason other than we had nowhere
else to put it. Now that we have a security-related file, that is a
better place for it so move it.

[mpe: Add extern for rfi_flush to fix bisection break]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/security_features.h
arch/powerpc/kernel/security.c
arch/powerpc/kernel/setup_64.c

index db00ad2c72c2965bfcbd7917a3a0d44761c48fdd..400a9050e0359c38aa0e4745df0c35ded6c890d0 100644 (file)
@@ -10,6 +10,7 @@
 
 
 extern unsigned long powerpc_security_features;
+extern bool rfi_flush;
 
 static inline void security_ftr_set(unsigned long feature)
 {
index 4ccba00d224cbcacebfe3266c3202efecc2151fc..564e7f182a16f6bcfed2060f4189f690222f2508 100644 (file)
@@ -5,6 +5,8 @@
 // Copyright 2018, Michael Ellerman, IBM Corporation.
 
 #include <linux/kernel.h>
+#include <linux/device.h>
+
 #include <asm/security_features.h>
 
 
@@ -13,3 +15,12 @@ unsigned long powerpc_security_features __read_mostly = \
        SEC_FTR_L1D_FLUSH_PR | \
        SEC_FTR_BNDS_CHK_SPEC_BAR | \
        SEC_FTR_FAVOUR_SECURITY;
+
+
+ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       if (rfi_flush)
+               return sprintf(buf, "Mitigation: RFI Flush\n");
+
+       return sprintf(buf, "Vulnerable\n");
+}
index eaa6039edddc79ba9f4372ce75ad6e5b21360131..eda7eefe492777464f97d4f401aac874fadbd0e1 100644 (file)
@@ -805,12 +805,4 @@ static __init int rfi_flush_debugfs_init(void)
 }
 device_initcall(rfi_flush_debugfs_init);
 #endif
-
-ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
-{
-       if (rfi_flush)
-               return sprintf(buf, "Mitigation: RFI Flush\n");
-
-       return sprintf(buf, "Vulnerable\n");
-}
 #endif /* CONFIG_PPC_BOOK3S_64 */