Skip to contentSkip to conversation

Patch "x86/tsc: Fix ART for TSC_KNOWN_FREQ" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message Mar 20, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

x86/tsc: Fix ART for TSC_KNOWN_FREQ

to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
x86-tsc-fix-art-for-tsc_known_freq.patch
and it can be found in the queue-4.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 44fee88cea43d3c2cac962e0439cb10a3cabff6d Mon Sep 17 00:00:00 2001

From: Peter Zijlstra <[email protected]>
Date: Mon, 13 Mar 2017 15:57:12 +0100
Subject: x86/tsc: Fix ART for TSC_KNOWN_FREQ

From: Peter Zijlstra <[email protected]>

commit 44fee88cea43d3c2cac962e0439cb10a3cabff6d upstream.

Subhransu reported that convert_art_to_tsc() isn't working for him.

The ART to TSC relation is only set up for systems which use the refined TSC calibration. Systems with known TSC frequency (available via CPUID 15) are not using the refined calibration and therefor the ART to TSC relation is never established.

Add the setup to the known frequency init path which skips ART calibration. The init code needs to be duplicated as for systems which use refined calibration the ART setup must be delayed until calibration has been done.

The problem has been there since the ART support was introdduced, but only detected now because Subhransu tested the first time on hardware which has TSC frequency enumerated via CPUID 15.

Note for stable: The conditional has changed from TSC_RELIABLE to
TSC_KNOWN_FREQUENCY.

[ tglx: Rewrote changelog and identified the proper 'Fixes' commit ]

---
 arch/x86/kernel/tsc.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/tsc.c +2 -0
@@ -1310,6 +1310,8 @@ static int __init init_tsc_clocksource(v
 	 * the refined calibration and directly register it as a clocksource.
 	 */
 	if (boot_cpu_has(X86_FEATURE_TSC_KNOWN_FREQ)) {
+		if (boot_cpu_has(X86_FEATURE_ART))
+			art_related_clocksource = &clocksource_tsc;
 		clocksource_register_khz(&clocksource_tsc, tsc_khz);
 		return 0;
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.10/futex-fix-potential-use-after-free-in-futex_requeue_pi.patch queue-4.10/futex-add-missing-error-handling-to-futex_requeue_pi.patch queue-4.10/x86-perf-fix-cr4.pce-propagation-to-use-active_mm-instead-of-mm.patch queue-4.10/x86-intel_rdt-put-group-node-in-rdtgroup_kn_unlock.patch queue-4.10/locking-rwsem-fix-down_write_killable-for-config_rwsem_generic_spinlock-y.patch queue-4.10/x86-tsc-fix-art-for-tsc_known_freq.patch