Thread (13 messages) 13 messages, 3 authors, 2018-07-20

Re: [PATCH v4 4/6] powerpc/fsl: Enable cpu vulnerabilities reporting for NXP PPC BOOK3E

From: Diana Madalina Craciun <hidden>
Date: 2018-07-18 14:29:37

On 7/17/2018 7:47 PM, LEROY Christophe wrote:=0A=
Diana Craciun [off-list ref] a =E9crit :=0A=
=0A=
quoted
The NXP PPC Book3E platforms are not vulnerable to meltdown and=0A=
Spectre v4, so make them PPC_BOOK3S_64 specific.=0A=
=0A=
Signed-off-by: Diana Craciun <redacted>=0A=
---=0A=
History:=0A=
=0A=
v2-->v3=0A=
- used the existing functions for spectre v1/v2=0A=
=0A=
 arch/powerpc/Kconfig           | 7 ++++++-=0A=
 arch/powerpc/kernel/security.c | 2 ++=0A=
 2 files changed, 8 insertions(+), 1 deletion(-)=0A=
=0A=
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig=0A=
index 9f2b75f..116c953 100644=0A=
--- a/arch/powerpc/Kconfig=0A=
+++ b/arch/powerpc/Kconfig=0A=
@@ -165,7 +165,7 @@ config PPC=0A=
 	select GENERIC_CLOCKEVENTS_BROADCAST	if SMP=0A=
 	select GENERIC_CMOS_UPDATE=0A=
 	select GENERIC_CPU_AUTOPROBE=0A=
-	select GENERIC_CPU_VULNERABILITIES	if PPC_BOOK3S_64=0A=
+	select GENERIC_CPU_VULNERABILITIES	if PPC_NOSPEC=0A=
I don't understand.  You say this patch is to make something specific  =
=0A=
to book3s64 specific, and you are creating a new config param that  =0A=
make things less specific=0A=
=0A=
Christophe=0A=
=0A=
In order to enable the vulnerabilities reporting on NXP socs I need to=0A=
enable them for PPC_FSL_BOOK3E. So they will be enabled for both=0A=
PPC_FSL_BOOK3E and PPC_BOOK3S_64. This is the reason for adding the=0A=
Kconfig. However this will enable: spectre v1/v2 and meltdown. NXP socs=0A=
are not vulnerable to meltdown, so I made the meltdown reporting=0A=
PPC_BOOK3S_64 specific. I guess I can have the PPC_NOSPEC definition in=0A=
a separate patch to be more clear.=0A=
=0A=
Diana=0A=
=0A=
=0A=
quoted
 	select GENERIC_IRQ_SHOW=0A=
 	select GENERIC_IRQ_SHOW_LEVEL=0A=
 	select GENERIC_SMP_IDLE_THREAD=0A=
@@ -240,6 +240,11 @@ config PPC=0A=
 	# Please keep this list sorted alphabetically.=0A=
 	#=0A=
=0A=
+config PPC_NOSPEC=0A=
+    bool=0A=
+    default y=0A=
+    depends on PPC_BOOK3S_64 || PPC_FSL_BOOK3E=0A=
+=0A=
 config GENERIC_CSUM=0A=
 	def_bool n=0A=
=0A=
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/securi=
ty.c=0A=
quoted
index 3a4e5c3..539c744 100644=0A=
--- a/arch/powerpc/kernel/security.c=0A=
+++ b/arch/powerpc/kernel/security.c=0A=
@@ -92,6 +92,7 @@ static __init int barrier_nospec_debugfs_init(void)=0A=
 device_initcall(barrier_nospec_debugfs_init);=0A=
 #endif /* CONFIG_DEBUG_FS */=0A=
=0A=
+#ifdef CONFIG_PPC_BOOK3S_64=0A=
 ssize_t cpu_show_meltdown(struct device *dev, struct  =0A=
device_attribute *attr, char *buf)=0A=
 {=0A=
 	bool thread_priv;=0A=
@@ -124,6 +125,7 @@ ssize_t cpu_show_meltdown(struct device *dev,  =0A=
struct device_attribute *attr, cha=0A=
=0A=
 	return sprintf(buf, "Vulnerable\n");=0A=
 }=0A=
+#endif=0A=
=0A=
 ssize_t cpu_show_spectre_v1(struct device *dev, struct  =0A=
device_attribute *attr, char *buf)=0A=
 {=0A=
--=0A=
2.5.5=0A=
=0A=
=0A=
=0A=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help