-From 4e155de21ab99124e98272454461a5e94a3c542a Mon Sep 17 00:00:00 2001
+From d8010d4ba43e9f790925375a7de100604a5e2dba Mon Sep 17 00:00:00 2001
From: "Borislav Petkov (AMD)" <bp@alien8.de>
Date: Wed, 11 Sep 2024 10:53:08 +0200
Subject: x86/bugs: Add a Transient Scheduler Attacks mitigation
-From: "Borislav Petkov (AMD)" <bp@alien8.de>
+From: Borislav Petkov (AMD) <bp@alien8.de>
-Commit d8010d4ba43e9f790925375a7de100604a5e2dba upstream.
+commit d8010d4ba43e9f790925375a7de100604a5e2dba upstream.
Add the required features detection glue to bugs.c et all in order to
support the TSA mitigation.
arch/x86/kernel/cpu/common.c | 14 ++
arch/x86/kernel/cpu/scattered.c | 2
arch/x86/kvm/svm/vmenter.S | 6 +
- drivers/base/cpu.c | 2
+ drivers/base/cpu.c | 7 +
include/linux/cpu.h | 1
- 14 files changed, 254 insertions(+), 5 deletions(-)
+ 14 files changed, 259 insertions(+), 5 deletions(-)
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
-@@ -616,6 +616,7 @@ static DEVICE_ATTR(gather_data_sampling,
+@@ -601,6 +601,11 @@ ssize_t __weak cpu_show_indirect_target_
+ return sysfs_emit(buf, "Not affected\n");
+ }
+
++ssize_t __weak cpu_show_tsa(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sysfs_emit(buf, "Not affected\n");
++}
++
+ static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
+ static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
+ static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL);
+@@ -616,6 +621,7 @@ static DEVICE_ATTR(gather_data_sampling,
static DEVICE_ATTR(spec_rstack_overflow, 0444, cpu_show_spec_rstack_overflow, NULL);
static DEVICE_ATTR(reg_file_data_sampling, 0444, cpu_show_reg_file_data_sampling, NULL);
static DEVICE_ATTR(indirect_target_selection, 0444, cpu_show_indirect_target_selection, NULL);
static struct attribute *cpu_root_vulnerabilities_attrs[] = {
&dev_attr_meltdown.attr,
-@@ -633,6 +634,7 @@ static struct attribute *cpu_root_vulner
+@@ -633,6 +639,7 @@ static struct attribute *cpu_root_vulner
&dev_attr_spec_rstack_overflow.attr,
&dev_attr_reg_file_data_sampling.attr,
&dev_attr_indirect_target_selection.attr,