Skip to content

Commit ad3c2e1

Browse files
pa1guptasuryasaimadhu
authored andcommitted
x86/events/intel: Do not deploy TSX force abort workaround when TSX is deprecated
Earlier workaround added by 400816f ("perf/x86/intel: Implement support for TSX Force Abort") for perf counter interactions [1] are not required on some client systems which received a microcode update that deprecates TSX. Bypass the perf workaround when such microcode is enumerated. [1] [ bp: Look for document ID 604224, "Performance Monitoring Impact of Intel Transactional Synchronization Extension Memory". Since there's no way for us to have stable links to documents... ] [ bp: Massage comment. ] Signed-off-by: Pawan Gupta <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Andi Kleen <[email protected]> Reviewed-by: Tony Luck <[email protected]> Tested-by: Neelima Krishnan <[email protected]> Link: https://lkml.kernel.org/r/e4d410f786946280ced02dd07c74e0a74f1d10cb.1623704845.git-series.pawan.kumar.gupta@linux.intel.com
1 parent 1348924 commit ad3c2e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/x86/events/intel/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6015,7 +6015,13 @@ __init int intel_pmu_init(void)
60156015
tsx_attr = hsw_tsx_events_attrs;
60166016
intel_pmu_pebs_data_source_skl(pmem);
60176017

6018-
if (boot_cpu_has(X86_FEATURE_TSX_FORCE_ABORT)) {
6018+
/*
6019+
* Processors with CPUID.RTM_ALWAYS_ABORT have TSX deprecated by default.
6020+
* TSX force abort hooks are not required on these systems. Only deploy
6021+
* workaround when microcode has not enabled X86_FEATURE_RTM_ALWAYS_ABORT.
6022+
*/
6023+
if (boot_cpu_has(X86_FEATURE_TSX_FORCE_ABORT) &&
6024+
!boot_cpu_has(X86_FEATURE_RTM_ALWAYS_ABORT)) {
60196025
x86_pmu.flags |= PMU_FL_TFA;
60206026
x86_pmu.get_event_constraints = tfa_get_event_constraints;
60216027
x86_pmu.enable_all = intel_tfa_pmu_enable_all;

0 commit comments

Comments
 (0)