[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 05/36] KVM: x86: Fold __get_kvmclock() into get_kvmclock()
- To: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
- From: Sean Christopherson <seanjc@xxxxxxxxxx>
- Date: Tue, 28 Jul 2026 16:06:09 -0700
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
- Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Jonathan Cameron <jic23@xxxxxxxxxx>, Sascha Bischoff <Sascha.Bischoff@xxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Joey Gouly <joey.gouly@xxxxxxx>, Jack Allister <jalliste@xxxxxxxxxx>, Dongli Zhang <dongli.zhang@xxxxxxxxxx>, joe.jin@xxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kselftest@xxxxxxxxxxxxxxx
- Delivery-date: Tue, 28 Jul 2026 23:06:16 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Jul 28, 2026, David Woodhouse wrote:
> From: David Woodhouse <dwmw@xxxxxxxxxxxx>
>
> There is no need for the separate __get_kvmclock() helper; just inline
> its body into get_kvmclock() within the seqcount retry loop.
Actually, there ends up being quite a bit of value if we rework the inner helper
to be all about the master clock mode. If we go that route, then the main loop
is pretty self-explanatory, we can use early returns instead of continues and
subtle fall-throughs, and the indentation levels go down.
do {
data->flags = 0;
seq = read_seqcount_begin(&ka->pvclock_sc);
if (!__get_kvmclock_master_clock(kvm, data))
data->clock = get_kvmclock_base_ns() +
ka->kvmclock_offset;
} while (read_seqcount_retry(&ka->pvclock_sc, seq));
|