From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D16D619DF46; Thu, 6 Jun 2024 14:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683095; cv=none; b=WlUVTzougGeYlHb+4r7jai65AuDrKQiWme6I3tmKkX83kUbxPv2y+4Zx5lCBoJUKmQdyuo7waiE8LMZ+pmN7sc8ML58acFQtkbm9UPvPVmFIetGIcrV6jLqYtZMw9VBWlZ0THkx+kFrJmmn4VUs8Usi9g0TGUv6n+fyDzJT99c0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683095; c=relaxed/simple; bh=5Ff5iHYAY9PyjCJVbN3+3LVrDQ13GZwaJn/ZdfxM2gM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ilspra0CKhlDgtGN1+60rt4Dd9xRt9zsGSitUo1G9SRaFBvBboC/lhp0hxU5+8kpwx3Fh6Xf9k7f0Lgn270Stnt74Fxnz+NAEhC6iI3xjS70KDRvwj9n/OzuUOOD59j4c4AAwfhBs/EZM8YyFKIJ91kY/omeO/O6u33PtPD4wFc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=leJmD12h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="leJmD12h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B21DDC2BD10; Thu, 6 Jun 2024 14:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717683095; bh=5Ff5iHYAY9PyjCJVbN3+3LVrDQ13GZwaJn/ZdfxM2gM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=leJmD12hgztj7x55emoGFQZZORKQPOQ2XSB3EmCTP9dCVd2nhdWFCGvV6zZdiWNKs IdYsNe/7DxVJiBffKqVH94h0J58TWvhVc0IYD3JfS7whtPlL/ZaEldBGHdcRddEnm4 dL8pMBUru0q6RRdnk5RFQdkjFjHVhr4Z7FsmF9d0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daniel J Blueman , Thomas Gleixner , Steffen Persvold , James Cleverdon , Dimitri Sivanich , Prarit Bhargava Subject: [PATCH 6.6 001/744] x86/tsc: Trust initial offset in architectural TSC-adjust MSRs Date: Thu, 6 Jun 2024 15:54:33 +0200 Message-ID: <20240606131732.500554749@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606131732.440653204@linuxfoundation.org> References: <20240606131732.440653204@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daniel J Blueman commit 455f9075f14484f358b3c1d6845b4a438de198a7 upstream. When the BIOS configures the architectural TSC-adjust MSRs on secondary sockets to correct a constant inter-chassis offset, after Linux brings the cores online, the TSC sync check later resets the core-local MSR to 0, triggering HPET fallback and leading to performance loss. Fix this by unconditionally using the initial adjust values read from the MSRs. Trusting the initial offsets in this architectural mechanism is a better approach than special-casing workarounds for specific platforms. Signed-off-by: Daniel J Blueman Signed-off-by: Thomas Gleixner Reviewed-by: Steffen Persvold Reviewed-by: James Cleverdon Reviewed-by: Dimitri Sivanich Reviewed-by: Prarit Bhargava Link: https://lore.kernel.org/r/20240419085146.175665-1-daniel@quora.org Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/tsc_sync.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- 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 cur->warned = false; /* - * 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 = bootval; + cur->adjusted = bootval; /* * Check whether this CPU is the first in a package to come up. In