lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170313145712.GI3312@twins.programming.kicks-ass.net>
Date:   Mon, 13 Mar 2017 15:57:12 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, subhransu.s.prusty@...el.com,
        kevin.b.stanton@...el.com, akataria@...are.com,
        john.stultz@...aro.org, christopher.s.hall@...el.com,
        Ingo Molnar <mingo@...nel.org>
Subject: x86/tsc: Fix ART for TSC_KNOWN_FREQ


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

It turns out that because of commit:

  57779dc2b3b7 ("x86, tsc: Skip refined tsc calibration on systems with reliable TSC")

Systems with TSC_KNOWN_FREQ (due to having CPUID.15h) will not run the
refined calibration thing, and then forget to set the ART clocksource
relation.

We cannot set the ART relation prior to running the refined calibration;
therefore duplicate the lines.

XXX: should we clear this in mark_tsc_unstable() ?

Reported-by: "Prusty, Subhransu S" <subhransu.s.prusty@...el.com>
Cc: kevin.b.stanton@...el.com
Cc: Alok N Kataria <akataria@...are.com>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Christopher Hall <christopher.s.hall@...el.com>
Fixes: 57779dc2b3b7 ("x86, tsc: Skip refined tsc calibration on systems with reliable TSC")
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
 arch/x86/kernel/tsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 4f7a9833d8e5..c73a7f9e881a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1333,6 +1333,8 @@ static int __init init_tsc_clocksource(void)
 	 * 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;
 	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ