[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 26/41] x86/kvmclock: WARN if wall clock is read while kvmclock is suspended
- 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:19:54 +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:20:25 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, 2026-05-15 at 12:19 -0700, Sean Christopherson wrote:
> WARN if kvmclock is still suspended when its wallclock is read, i.e. when
> the kernel reads its persistent clock. The wallclock subtly depends on
> the BSP's kvmclock being enabled, and returns garbage if kvmclock is
> disabled.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Although I still hate the whole KVM wallclock thing, as the kvmclock
itself is monotonic_raw, so adding that to the wallclock epoch is kind
of wrong.
Maybe the host should updated the wallclock occasionally to keep it up
to date...
Or maybe the guest should prefer the KVM_HC_CLOCK_PAIRING hypercall if
it exists, over kvm-wallclock.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
|