[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 33/41] x86/kvmclock: Mark TSC as reliable when it's constant and nonstop
- To: Sean Christopherson <seanjc@xxxxxxxxxx>, Kiryl Shutsemau <kas@xxxxxxxxxx>, Paolo Bonzini <pbonzini@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>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxx>, John Stultz <jstultz@xxxxxxxxxx>
- From: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
- Date: Thu, 21 May 2026 00:51:45 +0100
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
- Cc: 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>, x86@xxxxxxxxxx, linux-coco@xxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Michael Kelley <mhklinux@xxxxxxxxxxx>, Tom Lendacky <thomas.lendacky@xxxxxxx>, Nikunj A Dadhania <nikunj@xxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- Delivery-date: Wed, 20 May 2026 23:51:57 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, 2026-05-15 at 12:19 -0700, Sean Christopherson wrote:
> Mark the TSC as reliable if the hypervisor (KVM) has enumerated the TSC
> as constant and nonstop, and the admin hasn't explicitly marked the TSC
> as unstable. Like most (all?) virtualization setups, any secondary
> clocksource that's used as a watchdog is guaranteed to be less reliable
> than a constant, nonstop TSC, as all clocksources the kernel uses as a
> watchdog are all but guaranteed to be emulated when running as a KVM
> guest. I.e. any observed discrepancies between the TSC and watchdog will
> be due to jitter in the watchdog.
>
> This is especially true for KVM, as the watchdog clocksource is usually
> emulated in host userspace, i.e. reading the clock incurs a roundtrip
> cost of thousands of cycles.
>
> Marking the TSC reliable addresses a flaw where the TSC will occasionally
> be marked unstable if the host is under moderate/heavy load.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
|