From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A170D217704 for ; Tue, 28 Jul 2026 01:15:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785201329; cv=none; b=uBYp/D4qQ1rkbnkS10IdF8rRaUyUjQlOdxuQs+Rv2uALanNEhgkkJBhxiUWtsCDufcwvGGFL/3OJLa6O4PiH1LQmsTsC91M0z+5lB2pj2Ct1iTuI4OlsV/FR2v1A1Cg09UbMIuOlTwXKhkeuVFi8IqoOto7dGoU32w9UzfC0D3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785201329; c=relaxed/simple; bh=y/XcUrQ9JDmytrIFC28W6hlKYpOa2xKcjTs85GAJWDY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=CNfbDnxJuY/FmjKoALy3vdZWYG1NiUigW/TQgc0p6vnmqKXaqtUd0h1tM+IzbqhOaxCsb5KDmCrTARhBrvVsnLZyRwnzuuBc1H90PbTrXssyl3ISKAQqz9nxhGRNimmOYgt6qIa83DT3LBkEOQ+57HIOfW3s3ELY3J0P6hcn0/I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=nkr26+jY; arc=none smtp.client-ip=209.85.214.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nkr26+jY" Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2ccb6823efcso31691465ad.0 for ; Mon, 27 Jul 2026 18:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785201327; x=1785806127; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=c0xvxXA1DaICzQTJ/i8SO6Ba9ZbY1wPwU/bxHtjqVsI=; b=nkr26+jY9SF2mcbJwzW8twOpyeORwlisIuc4yZFEk+V+a9jyM7ceEwy9pxrhMRPny2 aUup54qj3bynFaX2baeVVO8o60kNkeLFKJLXzuSGXEzCfskuBtl3schibaV5bsFxoP05 hUwZiUrDD9PmNaC4gYXGvX6stfDOKs6PN4nFqVxvMO+UWcoLHDszNmHwnP6rCALwtGa2 KRDa3pr3mv1xorNTcWxWLTmhOLm23NX+9CZE8dXOztNAYTKUmqqFweaS3MIsdi/aNQHV EsRZg+9PGtbd/VAhIulTEMBfeAEw333aN7yHCMPsu+VE47p+2xFJPKPn7m+Vdlp8a1Jw 0grw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785201327; x=1785806127; h=content-transfer-encoding:content-type:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=c0xvxXA1DaICzQTJ/i8SO6Ba9ZbY1wPwU/bxHtjqVsI=; b=ZLc9haoPZpur/Atl7j9JdBkNEqhqCzYtkm8LtjK5yO4Hr6u0hpd/PwtWX/3j4/lCLL fwyvDAyxmIdSE7fH5nzCQXbXgIK9xBAcOpxtPACe/6Rci3gRfV5DzLWv68MzD0U7k4dJ qZuihb5LOgS8IsjE7GrgI6wRkQmOV6/EYT8WkOIn4Mjw9O6JPdaMROdq3UX6cqIvMfmE zCZkAernfaRTNv0aFPJw0XT18WXUwgAj/0TmJM8mjBWHNAAwomWzN9Yck2UyOBc6DmDR UDqPfB5yRSbDiv8isam8qu3hyNMFP870Zx5x2ySbRDuy6MW0jMjpzC3e6Y0Po8WoTyHV 9G9Q== X-Forwarded-Encrypted: i=1; AHgh+RoaHpap9FrBaqrDgwwL9wMkIrsv2+FG0fFbjsOuYK4nCPx/LYTtADNKeP7dGK2mNlVQ7eEgPTV7sliZJ7U=@vger.kernel.org X-Gm-Message-State: AOJu0YzsqcJFsGDhc2/kKLyznkOWky6wBGa3vBe788En5cFCU+x+wNwU XVWB1k9afLHZ6KdeFHzrAC4JoYvMp5KTvtjXyuoljMd6Df+DfiFTE/wMgBS656B0cCnoddS5Mtt fsxXHTA== X-Received: from plas11.prod.google.com ([2002:a17:903:200b:b0:2ca:eea9:9845]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ef11:b0:2cc:670d:9b2f with SMTP id d9443c01a7336-2d015d57715mr2698085ad.33.1785201326747; Mon, 27 Jul 2026 18:15:26 -0700 (PDT) Date: Mon, 27 Jul 2026 18:15:26 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-6-dwmw2@infradead.org> Message-ID: Subject: Re: [PATCH v6 05/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration From: Sean Christopherson To: David Woodhouse Cc: Paolo Bonzini , Jonathan Corbet , Shuah Khan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Vitaly Kuznetsov , Juergen Gross , Boris Ostrovsky , Paul Durrant , Jonathan Cameron , Sascha Bischoff , Marc Zyngier , Joey Gouly , Jack Allister , Dongli Zhang , joe.jin@oracle.com, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sat, Jul 25, 2026, David Woodhouse wrote: > On Fri, 2026-07-24 at 14:17 -0700, Sean Christopherson wrote: > > Please post this as a standalone mini-series.=C2=A0 AFAICT, the only de= pendency of > > any kind is a minor conflict with the s/hw_tsc_khz/hw_tsc_hz change, an= d that's > > trivial to sort out later on. >=20 > Hm? The calculations in kvm_vcpu_ioctl_set_clock_guest() are all Hz- > based, not kHz. This *was* the start of the series (Jack posted it on > its own in 2024), and I thought I'd moved the khz/hz thing to live > before it on purpose? >=20 > The kvm_xen_shared_info_init() one could be later, I guess. But is also > trivial (and its commit message sets the stage for a bunch of the > cleanups by analysing the various *different* ways that kvmclock gets > derived).=20 >=20 > I confess I'm not stunningly keen on breaking the series up. Can the KVM_[GS]ET_CLOCK_GUEST changes be moved to the end of the series? = The total size of the series doesn't scare me, I just don't want to end up with= all the fixes and cleanups stuck behind a patch that isn't a hard dependency. = E.g. AFAICT, none of the following changes, include selftests updates, actualy r= ely on KVM_[GS]ET_CLOCK_GUEST existing. > How about we just do it in stages? Merge patch 1 as it's fairly trivial,= =20 Ya, I pushed that to kvm-x86 last week, though I rebased it today because o= f an unrelated goof. It's currently commit 710b3a30f407 ("KVM: x86/xen: Do not = corrupt KVM clock in kvm_xen_shared_info_init()"). If nothing blows up in the next= or two, that should be the stable hash going forward. > and then I can use its commit ID when I refer to its taxonomy later. Then= we > can do patches 2-6 which are the KVM_[GS]ET_CLOCK_GUEST support. And I ca= n > repost the remainder on top of that? >=20 > > > +4.145 KVM_GET_CLOCK_GUEST > > > +---------------------------- > > > + > > > +:Capability: none > >=20 > > Why not add a CAP?=C2=A0 The check in the subsequent selftest is quite = gross. >=20 > Because nobody would ever use it in practice anyway. Even if the ioctl > is present, you *still* have to try it and fall back to the old method > because there are ways that a *guest* can force master clock mode off. Hmm, I can see setups where a single entity controls both the host and the = guest wanting to assert that KVM_SET_CLOCK_GUEST succeeds, though I suppose it's unlikely such setups would use KVM_SET_CLOCK_GUEST in the first place.