LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH 05/10] powerpc/64s: Move cpu_show_meltdown()
Date: Mon, 26 Mar 2018 20:12:10 +1100	[thread overview]
Message-ID: <20180326091215.7784-5-mpe@ellerman.id.au> (raw)
In-Reply-To: <20180326091215.7784-1-mpe@ellerman.id.au>

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.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/security.c | 12 ++++++++++++
 arch/powerpc/kernel/setup_64.c |  8 --------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index c62a5d7196e3..564e7f182a16 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -4,6 +4,9 @@
 //
 // Copyright 2018, Michael Ellerman, IBM Corporation.
 
+#include <linux/kernel.h>
+#include <linux/device.h>
+
 #include <asm/security_features.h>
 
 
@@ -12,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");
+}
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index c388cc3357fa..c27557aff394 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -927,12 +927,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 */
-- 
2.14.1

  parent reply	other threads:[~2018-03-26  9:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26  9:12 [PATCH 01/10] powerpc: Add security feature flags for Spectre/Meltdown Michael Ellerman
2018-03-26  9:12 ` [PATCH 02/10] powerpc/pseries: Add new H_GET_CPU_CHARACTERISTICS flags Michael Ellerman
2018-03-26  9:12 ` [PATCH 03/10] powerpc/pseries: Set or clear security feature flags Michael Ellerman
2018-03-26  9:12 ` [PATCH 04/10] powerpc/powernv: " Michael Ellerman
2018-03-26  9:12 ` Michael Ellerman [this message]
2018-03-26  9:12 ` [PATCH 06/10] powerpc/64s: Enhance the information in cpu_show_meltdown() Michael Ellerman
2018-03-26  9:12 ` [PATCH 07/10] powerpc/powernv: Use the security flags in pnv_setup_rfi_flush() Michael Ellerman
2018-03-26  9:12 ` [PATCH 08/10] powerpc/pseries: Use the security flags in pseries_setup_rfi_flush() Michael Ellerman
2018-03-26  9:12 ` [PATCH 09/10] powerpc/64s: Wire up cpu_show_spectre_v1() Michael Ellerman
2018-03-26  9:12 ` [PATCH 10/10] powerpc/64s: Wire up cpu_show_spectre_v2() Michael Ellerman
2018-03-27  8:46 ` [PATCH 01/10] powerpc: Add security feature flags for Spectre/Meltdown kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180326091215.7784-5-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox