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-prev] [day] [month] [year] [list]
Date:   Thu,  5 Oct 2023 20:48:45 -0700
From:   Sean Christopherson <>
To:     Sean Christopherson <>,,
        David Woodhouse <>
Cc:     Paolo Bonzini <>,
        Thomas Gleixner <>,
        Ingo Molnar <>, Borislav Petkov <>,
        Dave Hansen <>,,
        "H. Peter Anvin" <>, Paul Durrant <>,
        linux-kernel <>
Subject: Re: [PATCH v2] KVM: x86: Refine calculation of guest wall clock to
 use a single TSC read

On Thu, 05 Oct 2023 10:16:10 +0100, David Woodhouse wrote:
> When populating the guest's PV wall clock information, KVM currently does
> a simple 'kvm_get_real_ns() - get_kvmclock_ns(kvm)'. This is an antipattern
> which should be avoided; when working with the relationship between two
> clocks, it's never correct to obtain one of them "now" and then the other
> at a slightly different "now" after an unspecified period of preemption
> (which might not even be under the control of the kernel, if this is an
> L1 hosting an L2 guest under nested virtualization).
> [...]

Applied to kvm-x86 misc, thanks!  And double thanks for the function comment,
it's awesome!

Note, I moved the declaration in x86.h just below get_kvmclock_ns() to bundle
the two kvmclock helpers together.

[1/1] KVM: x86: Refine calculation of guest wall clock to use a single TSC read


Powered by blists - more mailing lists