Skip to contentSkip to conversation

x86/tsx: Fix backport of "x86/cpuid: Rework HLE and RTM handling"

PATCH In review Andrew Cooper 2 participants 3 messages Jul 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/tsx: Fix backport of "x86/cpuid: Rework HLE and RTM handling"

The backport dropped the hunk deleting the setup_clear_cpu_cap() for HLE/RTM, but retained the hunk adding setup_force_cpu_cap().

Calling both force and clear on the same feature elicits an error, and clear takes precedence, which breaks the part of the bufix which makes migration from older versions of Xen function safely for VMs using TSX.

Fixes f17d848c4caa ("x86/cpuid: Rework HLE and RTM handling")

---
CC: Jan Beulich <[email protected]>

---
 xen/arch/x86/spec_ctrl.c | 3 ---
 1 file changed, 3 deletions(-)
xen/arch/x86/spec_ctrl.c +0 -3
index 33343062a7b6..1cfd02d7d7cf 100644
@@ -1150,9 +1150,6 @@ void __init init_speculation_mitigations(void)
          ((hw_smt_enabled && opt_smt) ||
           !boot_cpu_has(X86_FEATURE_SC_VERW_IDLE)) )
     {
-        setup_clear_cpu_cap(X86_FEATURE_HLE);
-        setup_clear_cpu_cap(X86_FEATURE_RTM);
-
         opt_tsx = 0;
         tsx_init();
     }
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrew Cooper

The backport dropped the hunk deleting the setup_clear_cpu_cap() for HLE/RTM, but retained the hunk adding setup_force_cpu_cap().

Calling both force and clear on the same feature elicits an error, and clear takes precedence,

Right, I particularly didn't pay attention to this interaction aspect.

Quoted 5 lines

which breaks the part of the bufix which makes migration from older versions of Xen function safely for VMs using TSX.

Fixes f17d848c4caa ("x86/cpuid: Rework HLE and RTM handling")

Are you going to put this in, or should I?

Jan

#2 lore raw
Quoted 9 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

The backport dropped the hunk deleting the setup_clear_cpu_cap() for HLE/RTM, but retained the hunk adding setup_force_cpu_cap().

Calling both force and clear on the same feature elicits an error, and clear takes precedence,

Right, I particularly didn't pay attention to this interaction aspect.

Quoted 6 lines
Quoted 5 lines

which breaks the part of the bufix which makes migration from older versions of Xen function safely for VMs using TSX.

Fixes f17d848c4caa ("x86/cpuid: Rework HLE and RTM handling")

Thanks.

Quoted 1 line

Are you going to put this in, or should I?

Feel free to.

~Andrew