Skip to contentSkip to conversation

SYSFS reporting of L1TF on PowerPC.

PATCH New Anthony Steinhauser 1 participant 1 message Oct 23, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SYSFS reporting of L1TF on PowerPC.

L1TF affects PowerPC of the same range as Meltdown-US.
I tested it personally:
https://github.com/google/safeside/pull/52
and it is also admitted in the IBM report:
https://www.ibm.com/blogs/psirt/potential-impact-processors-power-family/
Similarly to Meltdown it is effectively mitigated by the rfi_flush.

---
 arch/powerpc/kernel/security.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/powerpc/kernel/security.c +12 -0
index 7cfcb294b11c..410232e79371 100644
@@ -167,6 +167,18 @@ ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, cha
 
 	return sprintf(buf, "Vulnerable\n");
 }
+
+ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	if (rfi_flush)
+		return sprintf(buf, "Mitigation: RFI Flush");
+
+	if (!security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV) &&
+	    !security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR))
+		return sprintf(buf, "Not affected\n");
+
+	return sprintf(buf, "Vulnerable\n");
+}
 #endif
 
 ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, char *buf)
Signature · 1 line
2.23.0.866.gb869b98d4c-goog