]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/bugs: Add a Transient Scheduler Attacks mitigation
authorBorislav Petkov (AMD) <bp@alien8.de>
Wed, 11 Sep 2024 08:53:08 +0000 (10:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:05:14 +0000 (16:05 +0200)
Commit d8010d4ba43e9f790925375a7de100604a5e2dba upstream.

Add the required features detection glue to bugs.c et all in order to
support the TSA mitigation.

Co-developed-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 files changed:
Documentation/ABI/testing/sysfs-devices-system-cpu
Documentation/admin-guide/kernel-parameters.txt
arch/x86/Kconfig
arch/x86/include/asm/cpu.h
arch/x86/include/asm/cpufeatures.h
arch/x86/include/asm/mwait.h
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/cpu/amd.c
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/microcode/amd.c
arch/x86/kernel/cpu/scattered.c
arch/x86/kvm/svm/vmenter.S
drivers/base/cpu.c
include/linux/cpu.h

index 6a1acabb29d85f4954d424eff416e98474a0412d..53755b2021ed012a98ff3c59533e7520b562947b 100644 (file)
@@ -523,6 +523,7 @@ What:               /sys/devices/system/cpu/vulnerabilities
                /sys/devices/system/cpu/vulnerabilities/spectre_v1
                /sys/devices/system/cpu/vulnerabilities/spectre_v2
                /sys/devices/system/cpu/vulnerabilities/srbds
+               /sys/devices/system/cpu/vulnerabilities/tsa
                /sys/devices/system/cpu/vulnerabilities/tsx_async_abort
 Date:          January 2018
 Contact:       Linux kernel mailing list <linux-kernel@vger.kernel.org>
index b5cb36148554131c28684bea930523596feef12f..f402bbaccc8aa3184d74e027a3047b8f8b608846 100644 (file)
                        having this key zero'ed is acceptable. E.g. in testing
                        scenarios.
 
+       tsa=            [X86] Control mitigation for Transient Scheduler
+                       Attacks on AMD CPUs. Search the following in your
+                       favourite search engine for more details:
+
+                       "Technical guidance for mitigating transient scheduler
+                       attacks".
+
+                       off             - disable the mitigation
+                       on              - enable the mitigation (default)
+                       user            - mitigate only user/kernel transitions
+                       vm              - mitigate only guest/host transitions
+
+
        tsc=            Disable clocksource stability checks for TSC.
                        Format: <string>
                        [x86] reliable: mark tsc clocksource as reliable, this
index 15425c9bdc2bcf576c40aff5c9eadb333c6c8243..dfa334e3d1a033d3f02bfebb8ca8db1aa9dc3087 100644 (file)
@@ -2760,6 +2760,15 @@ config MITIGATION_ITS
          disabled, mitigation cannot be enabled via cmdline.
          See <file:Documentation/admin-guide/hw-vuln/indirect-target-selection.rst>
 
+config MITIGATION_TSA
+       bool "Mitigate Transient Scheduler Attacks"
+       depends on CPU_SUP_AMD
+       default y
+       help
+         Enable mitigation for Transient Scheduler Attacks. TSA is a hardware
+         security vulnerability on AMD CPUs which can lead to forwarding of
+         invalid info to subsequent instructions and thus can affect their
+         timing and thereby cause a leakage.
 endif
 
 config ARCH_HAS_ADD_PAGES
index aa30fd8cad7f5285534c9e4b24e2846d1429f480..b6099456477cd75f326459fa5c2797e2a54b2a50 100644 (file)
@@ -69,4 +69,16 @@ int intel_microcode_sanity_check(void *mc, bool print_err, int hdr_type);
 
 extern struct cpumask cpus_stop_mask;
 
+union zen_patch_rev {
+       struct {
+               __u32 rev        : 8,
+                     stepping   : 4,
+                     model      : 4,
+                     __reserved : 4,
+                     ext_model  : 4,
+                     ext_fam    : 8;
+       };
+       __u32 ucode_rev;
+};
+
 #endif /* _ASM_X86_CPU_H */
index 308e7d97135cf6f918f1abc0222fd5a912107093..ef5749a0d8c24d116f314d12d57209b52e223769 100644 (file)
 #define X86_FEATURE_NO_NESTED_DATA_BP  (20*32+ 0) /* No Nested Data Breakpoints */
 #define X86_FEATURE_WRMSR_XX_BASE_NS   (20*32+ 1) /* WRMSR to {FS,GS,KERNEL_GS}_BASE is non-serializing */
 #define X86_FEATURE_LFENCE_RDTSC       (20*32+ 2) /* LFENCE always serializing / synchronizes RDTSC */
+#define X86_FEATURE_VERW_CLEAR         (20*32+ 5) /* The memory form of VERW mitigates TSA */
 #define X86_FEATURE_NULL_SEL_CLR_BASE  (20*32+ 6) /* Null Selector Clears Base */
 #define X86_FEATURE_AUTOIBRS           (20*32+ 8) /* Automatic IBRS */
 #define X86_FEATURE_NO_SMM_CTL_MSR     (20*32+ 9) /* SMM_CTL MSR is not present */
 #define X86_FEATURE_FAST_CPPC          (21*32 + 5) /* AMD Fast CPPC */
 #define X86_FEATURE_INDIRECT_THUNK_ITS (21*32 + 6) /* Use thunk for indirect branches in lower half of cacheline */
 
+#define X86_FEATURE_TSA_SQ_NO          (21*32+11) /* AMD CPU not vulnerable to TSA-SQ */
+#define X86_FEATURE_TSA_L1_NO          (21*32+12) /* AMD CPU not vulnerable to TSA-L1 */
+#define X86_FEATURE_CLEAR_CPU_BUF_VM   (21*32+13) /* Clear CPU buffers using VERW before VMRUN */
+
 /*
  * BUG word(s)
  */
 #define X86_BUG_IBPB_NO_RET            X86_BUG(1*32 + 4) /* "ibpb_no_ret" IBPB omits return target predictions */
 #define X86_BUG_ITS                    X86_BUG(1*32 + 5) /* "its" CPU is affected by Indirect Target Selection */
 #define X86_BUG_ITS_NATIVE_ONLY                X86_BUG(1*32 + 6) /* "its_native_only" CPU is affected by ITS, VMX is not affected */
+#define X86_BUG_TSA                    X86_BUG( 1*32+ 9) /* "tsa" CPU is affected by Transient Scheduler Attacks */
 #endif /* _ASM_X86_CPUFEATURES_H */
index 26755a3bbd55eb07cf550b892b10aa297a0ab4dc..b409579f5261ed34180554dd3b81946f74cedcda 100644 (file)
@@ -80,7 +80,7 @@ static __always_inline void __mwait(unsigned long eax, unsigned long ecx)
 static __always_inline void __mwaitx(unsigned long eax, unsigned long ebx,
                                     unsigned long ecx)
 {
-       /* No MDS buffer clear as this is AMD/HYGON only */
+       /* No need for TSA buffer clearing on AMD */
 
        /* "mwaitx %eax, %ebx, %ecx;" */
        asm volatile(".byte 0x0f, 0x01, 0xfb;"
index c953844dd9bdfedf8181703ffa17f893514f7cca..331f6a05535d4cbe072ddf2c460d4fd5fc716123 100644 (file)
  * CFLAGS.ZF.
  * Note: Only the memory operand variant of VERW clears the CPU buffers.
  */
-.macro CLEAR_CPU_BUFFERS
+.macro __CLEAR_CPU_BUFFERS feature
 #ifdef CONFIG_X86_64
-       ALTERNATIVE "", "verw x86_verw_sel(%rip)", X86_FEATURE_CLEAR_CPU_BUF
+       ALTERNATIVE "", "verw x86_verw_sel(%rip)", \feature
 #else
        /*
         * In 32bit mode, the memory operand must be a %cs reference. The data
         * segments may not be usable (vm86 mode), and the stack segment may not
         * be flat (ESPFIX32).
         */
-       ALTERNATIVE "", "verw %cs:x86_verw_sel", X86_FEATURE_CLEAR_CPU_BUF
+       ALTERNATIVE "", "verw %cs:x86_verw_sel", \feature
 #endif
 .endm
 
+#define CLEAR_CPU_BUFFERS \
+       __CLEAR_CPU_BUFFERS X86_FEATURE_CLEAR_CPU_BUF
+
+#define VM_CLEAR_CPU_BUFFERS \
+       __CLEAR_CPU_BUFFERS X86_FEATURE_CLEAR_CPU_BUF_VM
+
 #ifdef CONFIG_X86_64
 .macro CLEAR_BRANCH_HISTORY
        ALTERNATIVE "", "call clear_bhb_loop", X86_FEATURE_CLEAR_BHB_LOOP
@@ -617,7 +623,7 @@ static __always_inline void x86_clear_cpu_buffers(void)
 
 /**
  * x86_idle_clear_cpu_buffers - Buffer clearing support in idle for the MDS
- * vulnerability
+ * and TSA vulnerabilities.
  *
  * Clear CPU buffers if the corresponding static key is enabled
  */
index e432910859cb1aa4dc98566ea8c891c8874b73df..8a740e92e483eda3b72ef94782eec4213cd2cdba 100644 (file)
@@ -368,6 +368,63 @@ static void bsp_determine_snp(struct cpuinfo_x86 *c)
 #endif
 }
 
+static bool amd_check_tsa_microcode(void)
+{
+       struct cpuinfo_x86 *c = &boot_cpu_data;
+       union zen_patch_rev p;
+       u32 min_rev = 0;
+
+       p.ext_fam       = c->x86 - 0xf;
+       p.model         = c->x86_model;
+       p.stepping      = c->x86_stepping;
+
+       if (cpu_has(c, X86_FEATURE_ZEN3) ||
+           cpu_has(c, X86_FEATURE_ZEN4)) {
+               switch (p.ucode_rev >> 8) {
+               case 0xa0011:   min_rev = 0x0a0011d7; break;
+               case 0xa0012:   min_rev = 0x0a00123b; break;
+               case 0xa0082:   min_rev = 0x0a00820d; break;
+               case 0xa1011:   min_rev = 0x0a10114c; break;
+               case 0xa1012:   min_rev = 0x0a10124c; break;
+               case 0xa1081:   min_rev = 0x0a108109; break;
+               case 0xa2010:   min_rev = 0x0a20102e; break;
+               case 0xa2012:   min_rev = 0x0a201211; break;
+               case 0xa4041:   min_rev = 0x0a404108; break;
+               case 0xa5000:   min_rev = 0x0a500012; break;
+               case 0xa6012:   min_rev = 0x0a60120a; break;
+               case 0xa7041:   min_rev = 0x0a704108; break;
+               case 0xa7052:   min_rev = 0x0a705208; break;
+               case 0xa7080:   min_rev = 0x0a708008; break;
+               case 0xa70c0:   min_rev = 0x0a70c008; break;
+               case 0xaa002:   min_rev = 0x0aa00216; break;
+               default:
+                       pr_debug("%s: ucode_rev: 0x%x, current revision: 0x%x\n",
+                                __func__, p.ucode_rev, c->microcode);
+                       return false;
+               }
+       }
+
+       if (!min_rev)
+               return false;
+
+       return c->microcode >= min_rev;
+}
+
+static void tsa_init(struct cpuinfo_x86 *c)
+{
+       if (cpu_has(c, X86_FEATURE_HYPERVISOR))
+               return;
+
+       if (cpu_has(c, X86_FEATURE_ZEN3) ||
+           cpu_has(c, X86_FEATURE_ZEN4)) {
+               if (amd_check_tsa_microcode())
+                       setup_force_cpu_cap(X86_FEATURE_VERW_CLEAR);
+       } else {
+               setup_force_cpu_cap(X86_FEATURE_TSA_SQ_NO);
+               setup_force_cpu_cap(X86_FEATURE_TSA_L1_NO);
+       }
+}
+
 static void bsp_init_amd(struct cpuinfo_x86 *c)
 {
        if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
@@ -475,6 +532,9 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
        }
 
        bsp_determine_snp(c);
+
+       tsa_init(c);
+
        return;
 
 warn:
index e021dd4ad3fe4d33a3715f25f88776dc619f75cd..c2c7b76d953f77bdbb99350074cc763c8dc7fcaa 100644 (file)
@@ -50,6 +50,7 @@ static void __init l1d_flush_select_mitigation(void);
 static void __init srso_select_mitigation(void);
 static void __init gds_select_mitigation(void);
 static void __init its_select_mitigation(void);
+static void __init tsa_select_mitigation(void);
 
 /* The base value of the SPEC_CTRL MSR without task-specific bits set */
 u64 x86_spec_ctrl_base;
@@ -185,6 +186,7 @@ void __init cpu_select_mitigations(void)
        srso_select_mitigation();
        gds_select_mitigation();
        its_select_mitigation();
+       tsa_select_mitigation();
 }
 
 /*
@@ -2103,6 +2105,94 @@ static void update_mds_branch_idle(void)
 #define TAA_MSG_SMT "TAA CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_abort.html for more details.\n"
 #define MMIO_MSG_SMT "MMIO Stale Data CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/processor_mmio_stale_data.html for more details.\n"
 
+#undef pr_fmt
+#define pr_fmt(fmt)    "Transient Scheduler Attacks: " fmt
+
+enum tsa_mitigations {
+       TSA_MITIGATION_NONE,
+       TSA_MITIGATION_UCODE_NEEDED,
+       TSA_MITIGATION_USER_KERNEL,
+       TSA_MITIGATION_VM,
+       TSA_MITIGATION_FULL,
+};
+
+static const char * const tsa_strings[] = {
+       [TSA_MITIGATION_NONE]           = "Vulnerable",
+       [TSA_MITIGATION_UCODE_NEEDED]   = "Vulnerable: Clear CPU buffers attempted, no microcode",
+       [TSA_MITIGATION_USER_KERNEL]    = "Mitigation: Clear CPU buffers: user/kernel boundary",
+       [TSA_MITIGATION_VM]             = "Mitigation: Clear CPU buffers: VM",
+       [TSA_MITIGATION_FULL]           = "Mitigation: Clear CPU buffers",
+};
+
+static enum tsa_mitigations tsa_mitigation __ro_after_init =
+       IS_ENABLED(CONFIG_MITIGATION_TSA) ? TSA_MITIGATION_FULL : TSA_MITIGATION_NONE;
+
+static int __init tsa_parse_cmdline(char *str)
+{
+       if (!str)
+               return -EINVAL;
+
+       if (!strcmp(str, "off"))
+               tsa_mitigation = TSA_MITIGATION_NONE;
+       else if (!strcmp(str, "on"))
+               tsa_mitigation = TSA_MITIGATION_FULL;
+       else if (!strcmp(str, "user"))
+               tsa_mitigation = TSA_MITIGATION_USER_KERNEL;
+       else if (!strcmp(str, "vm"))
+               tsa_mitigation = TSA_MITIGATION_VM;
+       else
+               pr_err("Ignoring unknown tsa=%s option.\n", str);
+
+       return 0;
+}
+early_param("tsa", tsa_parse_cmdline);
+
+static void __init tsa_select_mitigation(void)
+{
+       if (tsa_mitigation == TSA_MITIGATION_NONE)
+               return;
+
+       if (cpu_mitigations_off() || !boot_cpu_has_bug(X86_BUG_TSA)) {
+               tsa_mitigation = TSA_MITIGATION_NONE;
+               return;
+       }
+
+       if (!boot_cpu_has(X86_FEATURE_VERW_CLEAR))
+               tsa_mitigation = TSA_MITIGATION_UCODE_NEEDED;
+
+       switch (tsa_mitigation) {
+       case TSA_MITIGATION_USER_KERNEL:
+               setup_force_cpu_cap(X86_FEATURE_CLEAR_CPU_BUF);
+               break;
+
+       case TSA_MITIGATION_VM:
+               setup_force_cpu_cap(X86_FEATURE_CLEAR_CPU_BUF_VM);
+               break;
+
+       case TSA_MITIGATION_UCODE_NEEDED:
+               if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
+                       goto out;
+
+               pr_notice("Forcing mitigation on in a VM\n");
+
+               /*
+                * On the off-chance that microcode has been updated
+                * on the host, enable the mitigation in the guest just
+                * in case.
+                */
+               fallthrough;
+       case TSA_MITIGATION_FULL:
+               setup_force_cpu_cap(X86_FEATURE_CLEAR_CPU_BUF);
+               setup_force_cpu_cap(X86_FEATURE_CLEAR_CPU_BUF_VM);
+               break;
+       default:
+               break;
+       }
+
+out:
+       pr_info("%s\n", tsa_strings[tsa_mitigation]);
+}
+
 void cpu_bugs_smt_update(void)
 {
        mutex_lock(&spec_ctrl_mutex);
@@ -2156,6 +2246,24 @@ void cpu_bugs_smt_update(void)
                break;
        }
 
+       switch (tsa_mitigation) {
+       case TSA_MITIGATION_USER_KERNEL:
+       case TSA_MITIGATION_VM:
+       case TSA_MITIGATION_FULL:
+       case TSA_MITIGATION_UCODE_NEEDED:
+               /*
+                * TSA-SQ can potentially lead to info leakage between
+                * SMT threads.
+                */
+               if (sched_smt_active())
+                       static_branch_enable(&cpu_buf_idle_clear);
+               else
+                       static_branch_disable(&cpu_buf_idle_clear);
+               break;
+       case TSA_MITIGATION_NONE:
+               break;
+       }
+
        mutex_unlock(&spec_ctrl_mutex);
 }
 
@@ -3084,6 +3192,11 @@ static ssize_t gds_show_state(char *buf)
        return sysfs_emit(buf, "%s\n", gds_strings[gds_mitigation]);
 }
 
+static ssize_t tsa_show_state(char *buf)
+{
+       return sysfs_emit(buf, "%s\n", tsa_strings[tsa_mitigation]);
+}
+
 static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr,
                               char *buf, unsigned int bug)
 {
@@ -3145,6 +3258,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
        case X86_BUG_ITS:
                return its_show_state(buf);
 
+       case X86_BUG_TSA:
+               return tsa_show_state(buf);
+
        default:
                break;
        }
@@ -3229,6 +3345,11 @@ ssize_t cpu_show_indirect_target_selection(struct device *dev, struct device_att
 {
        return cpu_show_common(dev, attr, buf, X86_BUG_ITS);
 }
+
+ssize_t cpu_show_tsa(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       return cpu_show_common(dev, attr, buf, X86_BUG_TSA);
+}
 #endif
 
 void __warn_thunk(void)
index a11c61fd7d52cf0c95e9978cd4f17b7d7f4eb746..ed072b126111c3364ec3e3cbf581391b8bff85d5 100644 (file)
@@ -1233,6 +1233,8 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {
 #define ITS            BIT(8)
 /* CPU is affected by Indirect Target Selection, but guest-host isolation is not affected */
 #define ITS_NATIVE_ONLY        BIT(9)
+/* CPU is affected by Transient Scheduler Attacks */
+#define TSA            BIT(10)
 
 static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = {
        VULNBL_INTEL_STEPPINGS(INTEL_IVYBRIDGE,         X86_STEPPING_ANY,               SRBDS),
@@ -1280,7 +1282,7 @@ static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = {
        VULNBL_AMD(0x16, RETBLEED),
        VULNBL_AMD(0x17, RETBLEED | SMT_RSB | SRSO),
        VULNBL_HYGON(0x18, RETBLEED | SMT_RSB | SRSO),
-       VULNBL_AMD(0x19, SRSO),
+       VULNBL_AMD(0x19, SRSO | TSA),
        {}
 };
 
@@ -1490,6 +1492,16 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
                        setup_force_cpu_bug(X86_BUG_ITS_NATIVE_ONLY);
        }
 
+       if (c->x86_vendor == X86_VENDOR_AMD) {
+               if (!cpu_has(c, X86_FEATURE_TSA_SQ_NO) ||
+                   !cpu_has(c, X86_FEATURE_TSA_L1_NO)) {
+                       if (cpu_matches(cpu_vuln_blacklist, TSA) ||
+                           /* Enable bug on Zen guests to allow for live migration. */
+                           (cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has(c, X86_FEATURE_ZEN)))
+                               setup_force_cpu_bug(X86_BUG_TSA);
+               }
+       }
+
        if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN))
                return;
 
index 2f84164b20e011a15b98b5e34fc238951bfeabbb..765b4646648f7b398a7ef52707c26681f66f10e5 100644 (file)
@@ -94,18 +94,6 @@ static struct equiv_cpu_table {
        struct equiv_cpu_entry *entry;
 } equiv_table;
 
-union zen_patch_rev {
-       struct {
-               __u32 rev        : 8,
-                     stepping   : 4,
-                     model      : 4,
-                     __reserved : 4,
-                     ext_model  : 4,
-                     ext_fam    : 8;
-       };
-       __u32 ucode_rev;
-};
-
 union cpuid_1_eax {
        struct {
                __u32 stepping    : 4,
index c84c30188fdf2414fd6c08b6c95ce3a352e03c2b..bc4993aa41edf2033fb1a7eb50c528e1a6e5a81b 100644 (file)
@@ -49,6 +49,8 @@ static const struct cpuid_bit cpuid_bits[] = {
        { X86_FEATURE_MBA,              CPUID_EBX,  6, 0x80000008, 0 },
        { X86_FEATURE_SMBA,             CPUID_EBX,  2, 0x80000020, 0 },
        { X86_FEATURE_BMEC,             CPUID_EBX,  3, 0x80000020, 0 },
+       { X86_FEATURE_TSA_SQ_NO,        CPUID_ECX,  1, 0x80000021, 0 },
+       { X86_FEATURE_TSA_L1_NO,        CPUID_ECX,  2, 0x80000021, 0 },
        { X86_FEATURE_PERFMON_V2,       CPUID_EAX,  0, 0x80000022, 0 },
        { X86_FEATURE_AMD_LBR_V2,       CPUID_EAX,  1, 0x80000022, 0 },
        { X86_FEATURE_AMD_LBR_PMC_FREEZE,       CPUID_EAX,  2, 0x80000022, 0 },
index 0c61153b275f64e527b4a9e39857c2f95e848de5..235c4af6b692a4618ad24e530eb3a19672f69a38 100644 (file)
@@ -169,6 +169,9 @@ SYM_FUNC_START(__svm_vcpu_run)
 #endif
        mov VCPU_RDI(%_ASM_DI), %_ASM_DI
 
+       /* Clobbers EFLAGS.ZF */
+       VM_CLEAR_CPU_BUFFERS
+
        /* Enter guest mode */
 3:     vmrun %_ASM_AX
 4:
@@ -335,6 +338,9 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run)
        mov SVM_current_vmcb(%rdi), %rax
        mov KVM_VMCB_pa(%rax), %rax
 
+       /* Clobbers EFLAGS.ZF */
+       VM_CLEAR_CPU_BUFFERS
+
        /* Enter guest mode */
 1:     vmrun %rax
 2:
index d88f721cf68cde9152c58914f82dc4ca90f6190a..02870e70ed59556c89a493d0c93de81bcccfc851 100644 (file)
@@ -600,6 +600,7 @@ CPU_SHOW_VULN_FALLBACK(spec_rstack_overflow);
 CPU_SHOW_VULN_FALLBACK(gds);
 CPU_SHOW_VULN_FALLBACK(reg_file_data_sampling);
 CPU_SHOW_VULN_FALLBACK(indirect_target_selection);
+CPU_SHOW_VULN_FALLBACK(tsa);
 
 static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
 static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
@@ -616,6 +617,7 @@ static DEVICE_ATTR(spec_rstack_overflow, 0444, cpu_show_spec_rstack_overflow, NU
 static DEVICE_ATTR(gather_data_sampling, 0444, cpu_show_gds, 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 DEVICE_ATTR(tsa, 0444, cpu_show_tsa, NULL);
 
 static struct attribute *cpu_root_vulnerabilities_attrs[] = {
        &dev_attr_meltdown.attr,
@@ -633,6 +635,7 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = {
        &dev_attr_gather_data_sampling.attr,
        &dev_attr_reg_file_data_sampling.attr,
        &dev_attr_indirect_target_selection.attr,
+       &dev_attr_tsa.attr,
        NULL
 };
 
index cc668a054d09605ef2d70543f02dbe05933b17e5..4342b5694909520c45760febeb44fca40f6bda7c 100644 (file)
@@ -79,6 +79,7 @@ extern ssize_t cpu_show_reg_file_data_sampling(struct device *dev,
                                               struct device_attribute *attr, char *buf);
 extern ssize_t cpu_show_indirect_target_selection(struct device *dev,
                                                  struct device_attribute *attr, char *buf);
+extern ssize_t cpu_show_tsa(struct device *dev, struct device_attribute *attr, char *buf);
 
 extern __printf(4, 5)
 struct device *cpu_device_create(struct device *parent, void *drvdata,