324324.endm
325325
326326/*
327- * Macro to execute VERW instruction that mitigate transient data sampling
328- * attacks such as MDS. On affected systems a microcode update overloaded VERW
329- * instruction to also clear the CPU buffers. VERW clobbers CFLAGS.ZF.
330- *
327+ * Macro to execute VERW insns that mitigate transient data sampling
328+ * attacks such as MDS or TSA . On affected systems a microcode update
329+ * overloaded VERW insns to also clear the CPU buffers. VERW clobbers
330+ * CFLAGS.ZF.
331331 * Note: Only the memory operand variant of VERW clears the CPU buffers.
332332 */
333333.macro CLEAR_CPU_BUFFERS
334334#ifdef CONFIG_X86_64
335- ALTERNATIVE "", "verw mds_verw_sel (%rip)" , X86_FEATURE_CLEAR_CPU_BUF
335+ ALTERNATIVE "", "verw x86_verw_sel (%rip)" , X86_FEATURE_CLEAR_CPU_BUF
336336#else
337337 /*
338338 * In 32bit mode, the memory operand must be a %cs reference. The data
339339 * segments may not be usable (vm86 mode), and the stack segment may not
340340 * be flat (ESPFIX32).
341341 */
342- ALTERNATIVE "" , "verw %cs:mds_verw_sel " , X86_FEATURE_CLEAR_CPU_BUF
342+ ALTERNATIVE "" , "verw %cs:x86_verw_sel " , X86_FEATURE_CLEAR_CPU_BUF
343343#endif
344344.endm
345345
@@ -592,24 +592,24 @@ DECLARE_STATIC_KEY_FALSE(switch_to_cond_stibp);
592592DECLARE_STATIC_KEY_FALSE (switch_mm_cond_ibpb );
593593DECLARE_STATIC_KEY_FALSE (switch_mm_always_ibpb );
594594
595- DECLARE_STATIC_KEY_FALSE (mds_idle_clear );
595+ DECLARE_STATIC_KEY_FALSE (cpu_buf_idle_clear );
596596
597597DECLARE_STATIC_KEY_FALSE (switch_mm_cond_l1d_flush );
598598
599599DECLARE_STATIC_KEY_FALSE (mmio_stale_data_clear );
600600
601- extern u16 mds_verw_sel ;
601+ extern u16 x86_verw_sel ;
602602
603603#include <asm/segment.h>
604604
605605/**
606- * mds_clear_cpu_buffers - Mitigation for MDS and TAA vulnerability
606+ * x86_clear_cpu_buffers - Buffer clearing support for different x86 CPU vulns
607607 *
608608 * This uses the otherwise unused and obsolete VERW instruction in
609609 * combination with microcode which triggers a CPU buffer flush when the
610610 * instruction is executed.
611611 */
612- static __always_inline void mds_clear_cpu_buffers (void )
612+ static __always_inline void x86_clear_cpu_buffers (void )
613613{
614614 static const u16 ds = __KERNEL_DS ;
615615
@@ -626,14 +626,15 @@ static __always_inline void mds_clear_cpu_buffers(void)
626626}
627627
628628/**
629- * mds_idle_clear_cpu_buffers - Mitigation for MDS vulnerability
629+ * x86_idle_clear_cpu_buffers - Buffer clearing support in idle for the MDS
630+ * vulnerability
630631 *
631632 * Clear CPU buffers if the corresponding static key is enabled
632633 */
633- static __always_inline void mds_idle_clear_cpu_buffers (void )
634+ static __always_inline void x86_idle_clear_cpu_buffers (void )
634635{
635- if (static_branch_likely (& mds_idle_clear ))
636- mds_clear_cpu_buffers ();
636+ if (static_branch_likely (& cpu_buf_idle_clear ))
637+ x86_clear_cpu_buffers ();
637638}
638639
639640#endif /* __ASSEMBLY__ */
0 commit comments