]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/powerpc-64s-move-cpu_show_meltdown.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / powerpc-64s-move-cpu_show_meltdown.patch
1 From foo@baz Mon 29 Apr 2019 11:38:37 AM CEST
2 From: Michael Ellerman <mpe@ellerman.id.au>
3 Date: Mon, 22 Apr 2019 00:19:59 +1000
4 Subject: powerpc/64s: Move cpu_show_meltdown()
5 To: stable@vger.kernel.org, gregkh@linuxfoundation.org
6 Cc: linuxppc-dev@ozlabs.org, diana.craciun@nxp.com, msuchanek@suse.de, npiggin@gmail.com, christophe.leroy@c-s.fr
7 Message-ID: <20190421142037.21881-15-mpe@ellerman.id.au>
8
9 From: Michael Ellerman <mpe@ellerman.id.au>
10
11 commit 8ad33041563a10b34988800c682ada14b2612533 upstream.
12
13 This landed in setup_64.c for no good reason other than we had nowhere
14 else to put it. Now that we have a security-related file, that is a
15 better place for it so move it.
16
17 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 arch/powerpc/kernel/security.c | 11 +++++++++++
21 arch/powerpc/kernel/setup_64.c | 8 --------
22 2 files changed, 11 insertions(+), 8 deletions(-)
23
24 --- a/arch/powerpc/kernel/security.c
25 +++ b/arch/powerpc/kernel/security.c
26 @@ -5,6 +5,8 @@
27 // Copyright 2018, Michael Ellerman, IBM Corporation.
28
29 #include <linux/kernel.h>
30 +#include <linux/device.h>
31 +
32 #include <asm/security_features.h>
33
34
35 @@ -13,3 +15,12 @@ unsigned long powerpc_security_features
36 SEC_FTR_L1D_FLUSH_PR | \
37 SEC_FTR_BNDS_CHK_SPEC_BAR | \
38 SEC_FTR_FAVOUR_SECURITY;
39 +
40 +
41 +ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
42 +{
43 + if (rfi_flush)
44 + return sprintf(buf, "Mitigation: RFI Flush\n");
45 +
46 + return sprintf(buf, "Vulnerable\n");
47 +}
48 --- a/arch/powerpc/kernel/setup_64.c
49 +++ b/arch/powerpc/kernel/setup_64.c
50 @@ -961,12 +961,4 @@ static __init int rfi_flush_debugfs_init
51 }
52 device_initcall(rfi_flush_debugfs_init);
53 #endif
54 -
55 -ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
56 -{
57 - if (rfi_flush)
58 - return sprintf(buf, "Mitigation: RFI Flush\n");
59 -
60 - return sprintf(buf, "Vulnerable\n");
61 -}
62 #endif /* CONFIG_PPC_BOOK3S_64 */