L1TF support in PowerPC SYSFS.
PATCH 1/1 L1TF support in PowerPC SYSFS.
From: Anthony Steinhauser <[email protected]>
PowerPC CPUs are vulnerable to L1TF to the same extent as to Meltdown. It is also mitigated by flushing the L1D on privilege transition. Currently the SYSFS gives a false negative on L1TF on CPUs that I verified to be vulnerable.
https://www.ibm.com/blogs/psirt/potential-impact-processors-power-family/
https://github.com/google/safeside/pull/52
--- arch/powerpc/kernel/security.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
arch/powerpc/kernel/security.c +12 -1
@@ -135,7 +135,8 @@ void setup_spectre_v2(void)#endif /* CONFIG_PPC_FSL_BOOK3E */ #ifdef CONFIG_PPC_BOOK3S_64 -ssize_t cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t cpu_show_delayed_fault_common ( +struct device *dev,struct device_attribute *attr,char *buf) {bool thread_priv;
@@ -167,6 +168,16 @@ 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) +{ +return cpu_show_delayed_fault_common (dev, attr, buf); +} + +ssize_t cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) +{ +return cpu_show_delayed_fault_common (dev, attr, buf); +}#endif ssize_t cpu_show_spectre_v1 (struct device *dev,struct device_attribute *attr,char *buf)
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
Michael Ellerman
reviewerHi Anthony,
Thanks for the patch.
Quoted 6 lines · [email protected] writes:
From: Anthony Steinhauser <[email protected]>
PowerPC CPUs are vulnerable to L1TF to the same extent as to Meltdown. It is also mitigated by flushing the L1D on privilege transition. Currently the SYSFS gives a false negative on L1TF on CPUs that I verified to be vulnerable.
Can you include the details of which CPUs you tested?
Quoted 4 lines
https://www.ibm.com/blogs/psirt/potential-impact-processors-power-family/
https://github.com/google/safeside/pull/52Signed-off-by Anthony Steinhauser <[email protected]>---
I don't usually retain links in the change log, because they bit rot, so I'll drop those, but they will remain in the email archive.
arch/powerpc/kernel/security.c void setup_spectre_v2(void) · line 138
Quoted 10 lines
arch/powerpc/kernel/security.c +1
-1@@ -135,7 +135,8 @@ void setup_spectre_v2(void)#endif /* CONFIG_PPC_FSL_BOOK3E */ #ifdef CONFIG_PPC_BOOK3S_64 -ssize_t cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t cpu_show_delayed_fault_common(
I guess that's an accurate name.
I probably would have just had cpu_show_l1tf() call cpu_show_meltdown(), but I guess either approach is fine.
cheers
Quoted 19 lines
arch/powerpc/kernel/security.c +10
-0@@ -167,6 +168,16 @@ 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) +{ +return cpu_show_delayed_fault_common (dev, attr, buf); +} + +ssize_t cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) +{ +return cpu_show_delayed_fault_common (dev, attr, buf); +}#endif ssize_t cpu_show_spectre_v1 (struct device *dev,struct device_attribute *attr,char *buf)Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
Hi Michael,
I tested in on Power9 Talos II Boston 004e 1202, PowerNV T2P9D01. Links can be naturally dropped. They're just for explanation.
Best,
Quoted 61 lines · Michael Ellerman
Hi Anthony,
Thanks for the patch.
Quoted 6 lines · [email protected] writes:
From: Anthony Steinhauser <[email protected]>
PowerPC CPUs are vulnerable to L1TF to the same extent as to Meltdown. It is also mitigated by flushing the L1D on privilege transition. Currently the SYSFS gives a false negative on L1TF on CPUs that I verified to be vulnerable.
Can you include the details of which CPUs you tested?
Quoted 4 lines
https://www.ibm.com/blogs/psirt/potential-impact-processors-power-family/
https://github.com/google/safeside/pull/52Signed-off-by Anthony Steinhauser <[email protected]>---
I don't usually retain links in the change log, because they bit rot, so I'll drop those, but they will remain in the email archive.
arch/powerpc/kernel/security.c void setup_spectre_v2(void) · line 138
Quoted 10 lines
arch/powerpc/kernel/security.c +1
-1@@ -135,7 +135,8 @@ void setup_spectre_v2(void)#endif /* CONFIG_PPC_FSL_BOOK3E */ #ifdef CONFIG_PPC_BOOK3S_64 -ssize_t cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) +static ssize_t cpu_show_delayed_fault_common(I guess that's an accurate name.
I probably would have just had
cpu_show_l1tf()callcpu_show_meltdown(), but I guess either approach is fine.cheers
Quoted 19 lines
arch/powerpc/kernel/security.c +10
-1@@ -167,6 +168,16 @@ 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) +{ +return cpu_show_delayed_fault_common (dev, attr, buf); +} + +ssize_t cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) +{ +return cpu_show_delayed_fault_common (dev, attr, buf); +}#endif ssize_t cpu_show_spectre_v1 (struct device *dev,struct device_attribute *attr,char *buf) --2.24.0.rc0.303.g954a862665-goog
Michael Ellerman
AppliedQuoted 9 lines · On Tue, 2019-10-29 at 19:07:59 UTC, [email protected] wrote:
From: Anthony Steinhauser <[email protected]>
PowerPC CPUs are vulnerable to L1TF to the same extent as to Meltdown. It is also mitigated by flushing the L1D on privilege transition. Currently the SYSFS gives a false negative on L1TF on CPUs that I verified to be vulnerable.
https://www.ibm.com/blogs/psirt/potential-impact-processors-power-family/
https://github.com/google/safeside/pull/52Signed-off-by Anthony Steinhauser <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/8e6b6da91ac9b9ec5a925b6cb13f287a54bd547d
cheers