[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 01/47] x86/tsc: Never re-calibrate TSC frequency if its exact timing is known
- To: Sean Christopherson <seanjc@xxxxxxxxxx>
- From: Borislav Petkov <bp@xxxxxxxxx>
- Date: Fri, 29 May 2026 20:07:31 -0700
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
- Authentication-results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de
- Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, Kiryl Shutsemau <kas@xxxxxxxxxx>, "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>, Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>, Wei Liu <wei.liu@xxxxxxxxxx>, Dexuan Cui <decui@xxxxxxxxxxxxx>, Long Li <longli@xxxxxxxxxxxxx>, Ajay Kaher <ajay.kaher@xxxxxxxxxxxx>, Alexey Makhalov <alexey.makhalov@xxxxxxxxxxxx>, Jan Kiszka <jan.kiszka@xxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>, John Stultz <jstultz@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>, Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>, Broadcom internal kernel review list <bcm-kernel-feedback-list@xxxxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stephen Boyd <sboyd@xxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-coco@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, David Woodhouse <dwmw@xxxxxxxxxxxx>, Tom Lendacky <thomas.lendacky@xxxxxxx>, Nikunj A Dadhania <nikunj@xxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>, Michael Kelley <mhklinux@xxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- Delivery-date: Sat, 30 May 2026 03:08:51 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, May 29, 2026 at 07:43:48AM -0700, Sean Christopherson wrote:
> Don't re-calibrate the TSC frequency if the TSC is known to run at a fixed
> frequency. In practice, this is likely one big nop, as re-calibration is
> used only for SMP=n kernels, and only for hardware that is 20+ years old,
> i.e. is extremely unlikely to collide with TSC_KNOWN_FREQ.
Why do we care?
So what if it recalibrates once on UP?
Look where it is called - all old rust which no one uses anymore.
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---
> arch/x86/kernel/tsc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index c5110eb554bc..08cf6625d484 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -946,7 +946,8 @@ void recalibrate_cpu_khz(void)
> return;
>
> cpu_khz = x86_platform.calibrate_cpu();
> - tsc_khz = x86_platform.calibrate_tsc();
> + if (!boot_cpu_has(X86_FEATURE_TSC_KNOWN_FREQ))
cpu_feature_enabled() everywhere please.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
|