All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/tsx: clear RTM and HLE when MSR_IA32_TSX_CTRL is not supported
@ 2021-09-06  2:46 Hao Peng
  2021-09-06  9:30 ` Borislav Petkov
  2021-09-07  5:14 ` Pawan Gupta
  0 siblings, 2 replies; 18+ messages in thread
From: Hao Peng @ 2021-09-06  2:46 UTC (permalink / raw)
  To: tglx, mingo, bp; +Cc: x86, linux-kernel

If hypervisor does not support MSR_IA32_TSX_CTRL, but guest supports
RTM and HLE features, it will affect TAA mitigation.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
 arch/x86/kernel/cpu/tsx.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/kernel/cpu/tsx.c b/arch/x86/kernel/cpu/tsx.c
index 9c7a5f049292..5e852c14fef2 100644
--- a/arch/x86/kernel/cpu/tsx.c
+++ b/arch/x86/kernel/cpu/tsx.c
@@ -122,6 +122,13 @@ void __init tsx_init(void)

        if (!tsx_ctrl_is_supported()) {
                tsx_ctrl_state = TSX_CTRL_NOT_SUPPORTED;
+
+               /* If hypervisor does not support MSR_IA32_TSX_CTRL emulation,
+                * but guest supports RTM and HLE features, it will affect TAA
+                * (tsx_async_abort)mitigation.
+                */
+               setup_clear_cpu_cap(X86_FEATURE_RTM);
+               setup_clear_cpu_cap(X86_FEATURE_HLE);
                return;
        }

--
2.27.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-09-08 16:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06  2:46 [PATCH] x86/tsx: clear RTM and HLE when MSR_IA32_TSX_CTRL is not supported Hao Peng
2021-09-06  9:30 ` Borislav Petkov
2021-09-07  1:47   ` Hao Peng
2021-09-07  2:08     ` Xiaoyao Li
2021-09-07  2:35       ` Hao Peng
2021-09-07  2:56         ` Xiaoyao Li
2021-09-07  3:40           ` Hao Peng
2021-09-07  4:26             ` Xiaoyao Li
2021-09-07  4:39               ` Hao Peng
2021-09-07  5:38                 ` Pawan Gupta
2021-09-07  6:56                   ` Hao Peng
2021-09-07 23:07                     ` Pawan Gupta
2021-09-07  5:28           ` Pawan Gupta
2021-09-07  5:14 ` Pawan Gupta
2021-09-07  6:36   ` Hao Peng
2021-09-07 22:59     ` Pawan Gupta
2021-09-08  5:06       ` Hao Peng
2021-09-08 16:02         ` Pawan Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.