From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 42FDE426EA2 for ; Thu, 21 May 2026 20:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779395757; cv=none; b=PwYrW/a7Z7Ex+X5ANReLOIUyjGhWi8hVQS4lxvKpReU9UiQY6bf7dhlr3WG4zy9QL94xGH6+DztgzpxnTNP+WIdOyVfJVIF4lMstC9UeqS7bPdjtciN+KwP0wWUVN767iLFOhzI41wykSBDP79FEUaZ399tenDEd0+Y/nB1o2zc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779395757; c=relaxed/simple; bh=ipWhDnS3c8Of+slJErBTF5Vqt6ODkaCbWe9MFVov0zI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MKI7T64V9elgeTCv0WHFjpAsucX+DH2CXNbkYpFhGz1BOeH2H9umhNjRgKxmW+Y6dT35ED3YWgK8WAUJhaNCepa6wC0fM/9Zth5H5LUdPzQ1NNATYYgxDDb5FPnRiVACcOm4EH+MImWBZwaCxblBalpOhbOKIuaEm8fe3qsOrnw= 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=UYpxBcWh; arc=none smtp.client-ip=209.85.214.202 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="UYpxBcWh" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2b7aba0af02so61629755ad.2 for ; Thu, 21 May 2026 13:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779395754; x=1780000554; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=ipWhDnS3c8Of+slJErBTF5Vqt6ODkaCbWe9MFVov0zI=; b=UYpxBcWhQ1GLHsXNqJo6KM8ByYjzTA3ylvmkshJs4Z1N83lqUj5kDuNrDU5va2VUX1 FcAFN8D136WHs4lTAOhuqN8AMkVyYNvy2ruSoZGhrjf9KBT4UCVzPGO7+eFHXMSKAFle Km34N8coFDUxb7YezBr7BE7Edjw6l+OHrrUmrcohqpft1oaXObObcEqlD54yIUqNON1Y ZBWUonDcueBay43F/c6Ro+24dKw2fy4d/mn3FYLa57A4ODCf5d2+Kny7i6EFt9kfFmoU zbt5l0N6LysGW8aj+tQXwyoZjL7be9/ykZG2zUk/HnHbXU18OfsJRA7eUHAeJg4KWt0z HbdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779395754; x=1780000554; h=content-transfer-encoding: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; bh=ipWhDnS3c8Of+slJErBTF5Vqt6ODkaCbWe9MFVov0zI=; b=Me6+JdWa4k3k6PSlDsckgsqRuasgI73yUIgu7Vi4og5nZYcrJ8cUm9cQzN9EkIW/b6 EWv0MzuiM91Y0GJ0YqL1seZUjwEc7Xb8MXbW+PSbSsdfRh48lebk8hiD61S7EEmZI07I cKzuD6AvyTWc5u4DBC452kmajdEkrQcpW9tTlukqLn78xHpnPVYhAd7b45XfcdvJlQ2+ 0mnmwJ92WcUnmYV5KcP2KxDeyUN3QepIo+JvWqdK1+PET/pSevbwZW9AYvLsjB52+ReZ Z7zw5HNM63wJ+/yRoZDUk9CXV4fygxaugCruF2xvo451rvO+03odnA97z9OYMP1tKJ3L hw0w== X-Forwarded-Encrypted: i=1; AFNElJ+unObUO6nyTJiMncHZulJwsIZnRxwdJa5WISPCr3PHCXeoGsTStChE9n+McFUTSXM2YNLh3lILSW28iFA=@vger.kernel.org X-Gm-Message-State: AOJu0YwfofYIQzsokno9eKMXtLcgyjzB5X2nOHGpXu7hSAEEX7jU8JHa t27wjCYifaqy5plLiEXVrhet5fqUBUIly4eAFhNA5a49dTOv8ZhaXP0OEChGs8FUzGSUJRooqog Lmfyr6w== X-Received: from pglv7.prod.google.com ([2002:a63:1507:0:b0:c80:192c:51ff]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:d491:b0:3b2:8677:813e with SMTP id adf61e73a8af0-3b328ec5909mr476744637.42.1779395753857; Thu, 21 May 2026 13:35:53 -0700 (PDT) Date: Thu, 21 May 2026 13:35:53 -0700 In-Reply-To: <13d79ba1e0450068c9573ccd8deb3ec007aea8d6.camel@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260515191942.1892718-1-seanjc@google.com> <20260515191942.1892718-30-seanjc@google.com> <13d79ba1e0450068c9573ccd8deb3ec007aea8d6.camel@infradead.org> Message-ID: Subject: Re: [PATCH v3 29/41] x86/paravirt: Plumb a return code into __paravirt_set_sched_clock() From: Sean Christopherson To: David Woodhouse Cc: Kiryl Shutsemau , Paolo Bonzini , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Ajay Kaher , Alexey Makhalov , Jan Kiszka , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Juergen Gross , Daniel Lezcano , Thomas Gleixner , John Stultz , Rick Edgecombe , Vitaly Kuznetsov , Broadcom internal kernel review list , Boris Ostrovsky , Stephen Boyd , x86@kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Michael Kelley , Tom Lendacky , Nikunj A Dadhania , Thomas Gleixner Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, May 21, 2026, David Woodhouse wrote: > On Fri, 2026-05-15 at 12:19 -0700, Sean Christopherson wrote: > > Add a return code to __paravirt_set_sched_clock() so that the kernel ca= n > > reject attempts to use a PV sched_clock without breaking the caller.=C2= =A0 E.g. > > when running as a CoCo VM with a secure TSC, using a PV clock is genera= lly > > undesirable. > >=20 > > Note, kvmclock is the only PV clock that does anything "extra" beyond > > simply registering itself as sched_clock, i.e. is the only caller that > > needs to check the new return value. > >=20 > > Signed-off-by: Sean Christopherson >=20 > Oooh... can we use this to reject the kvmclock when we have a stable > and reliable TSC even for non-CoCo guests? Yes, but I would much rather "fix" kvmclock to not even attempt to register= itself as the sched_clock (which this series does).