Thread (12 messages) flat view 12 messages, 4 authors, 2018-07-05

RE: [PATCH v2 3/3] powerpc/fsl: Implement cpu_show_spectre_v1/v2 for NXP PowerPC Book3E

From: Bharat Bhushan <hidden>
Date: 2018-06-12 02:59:18

Hi Diana,
-----Original Message-----
From: Diana Craciun [mailto:diana.craciun@nxp.com]
Sent: Monday, June 11, 2018 6:23 PM
To: linuxppc-dev@lists.ozlabs.org
Cc: mpe@ellerman.id.au; oss@buserror.net; Leo Li <redacted>;
Bharat Bhushan [off-list ref]; Diana Madalina Craciun
[off-list ref]
Subject: [PATCH v2 3/3] powerpc/fsl: Implement cpu_show_spectre_v1/v2 for
NXP PowerPC Book3E
Please add some description
quoted hunk ↗ jump to hunk
=20
Signed-off-by: Diana Craciun <redacted>
---
 arch/powerpc/Kconfig           |  2 +-
 arch/powerpc/kernel/security.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
=20
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index
940c955..a781d60 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -170,7 +170,7 @@ config PPC
 	select GENERIC_CLOCKEVENTS_BROADCAST	if SMP
 	select GENERIC_CMOS_UPDATE
 	select GENERIC_CPU_AUTOPROBE
-	select GENERIC_CPU_VULNERABILITIES	if PPC_BOOK3S_64
+	select GENERIC_CPU_VULNERABILITIES	if PPC_BOOK3S_64 ||
PPC_FSL_BOOK3E
 	select GENERIC_IRQ_SHOW
 	select GENERIC_IRQ_SHOW_LEVEL
 	select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/securit=
y.c
quoted hunk ↗ jump to hunk
index 797c975..aceaadc 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -183,3 +183,18 @@ ssize_t cpu_show_spectre_v2(struct device *dev,
struct device_attribute *attr, c  }  #endif /* CONFIG_PPC_BOOK3S_64 */
=20
+#ifdef CONFIG_PPC_FSL_BOOK3E
+ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute
+*attr, char *buf) {
+	if (barrier_nospec_enabled)
+		return sprintf(buf, "Mitigation: __user pointer sanitization\n");
+
+	return sprintf(buf, "Vulnerable\n");
+}
+
+ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute
+*attr, char *buf) {
+	return sprintf(buf, "Vulnerable\n");
+}
+#endif /* CONFIG_PPC_FSL_BOOK3E */
+
--
2.5.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help