Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2018023lqo; Mon, 13 May 2024 05:50:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUz+C3K3AE9sUNVFuNEKHPnq1iIr6GNHRvtgJMGQC8u4qsN+LI3m9veM2u+1Z1QzEaZ0/JBKWIHQh8KcjOmrW3yM89BiGoP+YQp7Qzvag== X-Google-Smtp-Source: AGHT+IHDK5nR+jRbYaF/FeBF3C/7qvFCrlca5f6aq1OUQ8zkjAZNMx/siww8ZW4coIVZl9DLan/+ X-Received: by 2002:a50:ccc8:0:b0:572:795a:b913 with SMTP id 4fb4d7f45d1cf-5734d67fd75mr7751398a12.34.1715604614018; Mon, 13 May 2024 05:50:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715604614; cv=pass; d=google.com; s=arc-20160816; b=FE0KJ3Z3htOESSMge4Qi9rgWPG5Exuv6INGYaAvhUUqiOqQrc/85UdqLjKWI+7Lnmr YIMryRiWJbogfhqWHYQwV0DEMcXKXBrFluheELcSSuzV3yxCOaZxS4Tbj4MJqjxw3vVQ zFlbC5aleIwTFQ96STOGX88hcH+/SXcR8MAx5AFTHtLvpskL36m7whXJozy7tUNGe2a1 jvBHCFh59U+KC2g1XcGtxE9uZW9s1kFS0VAUOMT5CiidT3J25pzfKwU8TkFCOSTFn6VE iz7ig23kpZklUk7VnyBqQT2+NtHKP+0Kndwq2EzskNR4wGohalV2MMUZjmSAwMwm0gFY h1RA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:content-transfer-encoding:message-id:references:subject :cc:to:dkim-signature:dkim-signature:from; bh=wOlaj9mDxhp1TY8owHYfJbnZf9zkKuB1uVd0RHg00mw=; fh=6LkEhNBL2mo5Mo+t6yemqdayPsF8SyUW68IBAGIUZAo=; b=iaS7qnJwts2WPq8hApLy98rjAxmKnX34FKsQBERZ5WEL4I8s+3SGsJ93jkMiRwpDoI DnAIEsWMBnrMdUm1WhbosgQLWlHYBXifojYA5hwad1gCC4lkkPJ6yRVseMrIbP2076gj S10M/Si8aJIG1JLMOiDpBekUrj0jMIoe2UgsNSmHRe3GIdlrplzUjUybjfyb3h0Ro7ke Y8vnxLhGyfOWDOJXsZwBpntmVy83o7lgjV3631WdzTlZy97aeSfrd7/xm90aI4ZIhZ3p pfSlMjZ9uruXXoLic3Dgu9O832SxX2qY7DMmYKLUMfrSy++tHNjqAMKPqpx+vVar1c3H 4Jxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=y3g4edEZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-177578-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d536fsi4959034a12.255.2024.05.13.05.50.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 05:50:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177578-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=y3g4edEZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-177578-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BB6CA1F2440F for ; Mon, 13 May 2024 12:50:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A4F314F9FE; Mon, 13 May 2024 12:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="y3g4edEZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PncxH9W3" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C1A114F9C9 for ; Mon, 13 May 2024 12:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715604605; cv=none; b=T19R8pY1TgVuQ+F/xuyzKDP0wtwjyu+shhs3S2IP0s9hGDt70tsB4QlueibUZRmdmC2KDDs97Iw4oI34llTEQQeCQbkIthTWnMaX+YydHOZfOAm4iTFREURZXhpbsVt5yDefWwswSSb0J94eHsIxaEqhJhlf7YmYimh9e4jRb40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715604605; c=relaxed/simple; bh=N5Y56Y2TdhmTcS0wPaae6uOxJO9iaTwgEEDTRTJEfRY=; h=From:To:Cc:Subject:References:Message-ID:Content-Type: MIME-Version:Date; b=IqwEFTOTb/qE72YsYO2SZEojAYNbkYioCg/0PLcki4I2WYGVdlgMyEua8yEd6DPXD2RRP1MwDpwK9jcripNBgVVglJ2hCxczhivRWOn9X+zm5QDn0azJEQcOxd4c1DyIkzwqVPopdUJrJ/iAznUEeL3uYUrV89iFOP1HPpUXpPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=y3g4edEZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PncxH9W3; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1715604602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=wOlaj9mDxhp1TY8owHYfJbnZf9zkKuB1uVd0RHg00mw=; b=y3g4edEZYYeGs5XKduf+p6cxzJioAAU9tqcich1ofX9uKW53rUTDKbd/iPneUf42haSWtW r2qbnenTfPnnI9ANtzwTx8TZW7kyZFz360lG3RqWsFvVDp1INOyOhkmp2fRgFZEnwfmb3Y NkpmO6jGeBBPwO/MYNzbLK05oppr4FsPAbd22jZ+hnvOfj/O1ZnBLZXdI02JZekZoPvieB 8qSeaiBfPxvySzaplEXU9tKNS2co7qHX1kGhgZRTMEpCfE3caYX1QzAx1AVz0wOrW5kClq N4eBjZaR/4p7aC4f4weEzLVflhybWl9Ms6oxOZxVY5HyG1iWTURHhUc6vh8eBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715604602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=wOlaj9mDxhp1TY8owHYfJbnZf9zkKuB1uVd0RHg00mw=; b=PncxH9W3FieA5KzsB3MZtlpCX1S7yGPoc4c/DYUk+YABOOfkojod5LQaoDGKX3uMbOR+uW u4SVWwtKg6HXQAAw== To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] x86/timers for v6.10-rc1 References: <171560454635.3871325.5773365584560034962.tglx@xen13.tec.linutronix.de> Message-ID: <171560455005.3871325.1102142666677911813.tglx@xen13.tec.linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 13 May 2024 14:50:02 +0200 (CEST) Linus, please pull the latest x86/timers branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-timers-2024-= 05-13 up to: 455f9075f144: x86/tsc: Trust initial offset in architectural TSC-adju= st MSRs A single update for the TSC synchronixation sanity checks: The sad state of TSC being notoriously non-sychronized for several decades caused the kernel to grow quite rigorous sanity checks to detect whether the TSC is valid to be used for timekeeping. The TSC ADJUST MSR provides the offset between the initial TSC value after hardware reset and later modifications. This allows to detect cases where firmware tampers with the TSC and also allows to correct the firmware induced damage by resetting the offset in a controlled way. The universal correct rule is that the TSC ADJUST value has to be consistent within all CPUs of a socket. The kernel further assumes that the TSC offset should be consistent between sockets. That's not really correct as systems with a huge number of sockets are not architecurally guaranteed to reset the per socket TSC base synchronously. In case that the per socket offset is not consistent the kernel resets it to the offset of the boot CPU and then does a synchronization check which corrects for the inter socket delays. That works most of the time, but it is suboptimal as the firmware has eventually better information about the per socket offset and on sane systems that offset should just work in the validation checks. Thanks, tglx ------------------> Daniel J Blueman (1): x86/tsc: Trust initial offset in architectural TSC-adjust MSRs arch/x86/kernel/tsc_sync.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index 1123ef3ccf90..4334033658ed 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c @@ -193,11 +193,9 @@ bool tsc_store_and_check_tsc_adjust(bool bootcpu) cur->warned =3D false; =20 /* - * If a non-zero TSC value for socket 0 may be valid then the default - * adjusted value cannot assumed to be zero either. + * The default adjust value cannot be assumed to be zero on any socket. */ - if (tsc_async_resets) - cur->adjusted =3D bootval; + cur->adjusted =3D bootval; =20 /* * Check whether this CPU is the first in a package to come up. In