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 21D1D143C5F; Thu, 13 Jun 2024 11:55:05 +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=1718279706; cv=none; b=WMeJnT1aodo3q4yp/8wEnNkBs/K164JJC8kzU4mvMQfJL6C7S7YZmxexWcm+zEsPxOtPuA1xwvOqSiRAUahHzmPRqe12ZF3nNa0cgwriPRV7dGnosfBkGwhkxomtSkg42+s5E9Azep/Is3ZMS7Q8yYBin3gmF6BedZ0o3NjFi9o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279706; c=relaxed/simple; bh=veJcn5dPI3tij2sr3p8WZDU1HX6lnSrnRkGZ5clFVLE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GZWWR8w4b3L4Z3WWmaCFOboxyE7yd3JbMIXwBhbyiIGMZ1nNSlvZ0dkZ5rddfMb/UlZjH2+UhGcpGTzlUnac/KV6rTiw+RLacA1vZpbBAsGOs3dowo/22051F8hHLt2oo9PkcUU/ynlE66FCAFcEnAnP6rC+jvU9GwLtYoQIxsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=N7i/7GWm; 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="N7i/7GWm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65EDEC32786; Thu, 13 Jun 2024 11:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718279705; bh=veJcn5dPI3tij2sr3p8WZDU1HX6lnSrnRkGZ5clFVLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N7i/7GWmCA+GK+wRHumNHAwbYMaPmbPdyu5V1aMNz6BQy+LkLvnIhTpl/ey4hqfPr 3bq+cCH4bql3wMPMK38b8C23G6olPf78HEnuTGcNRVpHxU0xkvzukWK5i1dNJ0gAOx ZWJTHSNDbWtINH91kyVOTNDkt8hW6xWp72BH4Nnk= 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 5.4 001/202] x86/tsc: Trust initial offset in architectural TSC-adjust MSRs Date: Thu, 13 Jun 2024 13:31:39 +0200 Message-ID: <20240613113227.819520277@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113227.759341286@linuxfoundation.org> References: <20240613113227.759341286@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-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 @@ -192,11 +192,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