Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1638362lqa; Mon, 29 Apr 2024 14:39:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXf2mXc2BercCxqdFzpLyhp7ysIaafPorWGdm6H5OA+KbO923ynQVDGqoaGCLv0F2Yg5gGBZJMLwXoHJK/zQE0KOBYRcB9TDriGsuHOBA== X-Google-Smtp-Source: AGHT+IF4V1iEwzPCwu8+5dmBG0BIz/FuvQimTHULdBqtZltZcMXHlGRILZ4fHpKW7vZaLYahGUWA X-Received: by 2002:a05:6a00:1810:b0:6eb:3c2d:76e0 with SMTP id y16-20020a056a00181000b006eb3c2d76e0mr17838346pfa.11.1714426774504; Mon, 29 Apr 2024 14:39:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714426774; cv=pass; d=google.com; s=arc-20160816; b=wWo68zz5yozsFkia6bT4B3TaAzzMaF5Yr25HnJAO0LG/biY9eiN6ODNJFs+qSDjP8n DOW4DFsgukqJ/stzVcflbv5yxlrEWGZCsoALdB07t82JOjyU2QTICaqzw9zSmz0AJyks 1cpaPi4zPLYggLEGi9RwEu5Z+nCuhGCuRF/hoglr4uILYkqplctBwja3xrjNyBJSvKig HSmUXVq1T0jsELAh6CPSBokXgplWpI0O1tII9XATpIs/93uD0o3BoXV1lU4Hitd5zBe0 iibQJPCM1dh04zEUKLrNzuSYXtZpwM9keV95hnwJpUd6B7Zn5wCU1AVaYvEEvSyzjxpy v+vQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=BTJ77so2WRoXGher0vupuLRohX0a5C8x4hw3nGSKDmM=; fh=gVvoDf3LSa9Y/677d8nqbP2xT3XdNFI4WQdqhWUrlaE=; b=CgEKAXVvvfO7TdQZfUncZYE/lSt1m5irspGwnAzgMNc4AJQ5Q+SKGIVbtqD7GJ2WeO Up+bYdDTFHHutFU+lbmDyW2Z2toc/kaQNzBMnPAnu2hBNBwp/i1t+NVCWtm7cxt+vTEG 7JfIj05M+YWA95dNZ4SQBAOJTZN0Tx430AzeNXlydvo0afaeNm/l+5TG4fz2Euy4EjaH Tc/XF0glgFrsldec1blhdTlo2ZX3k+EvP4owJdDwFrHSrR3e0G8StL3tO/LFuaXxUyIw gZz/48eQqhGBkZ83M/sedkGsw0m8hetAOOV2zBFSL6ehFou+zcu8uYJyxtH70D67pzJU TYkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=siBTceqN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+2nUi15d; 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-163075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163075-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j1-20020a62b601000000b006eaa8f9b018si8753598pff.241.2024.04.29.14.39.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 14:39:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=siBTceqN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+2nUi15d; 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-163075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163075-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BD32AB22AAF for ; Mon, 29 Apr 2024 21:38:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 576E1184107; Mon, 29 Apr 2024 21:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="siBTceqN"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="+2nUi15d" 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 86D65946C; Mon, 29 Apr 2024 21:38:10 +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=1714426692; cv=none; b=cuL8RWnI827dsp9GnSP9NUvDlw+D4ysrQj5zXeF2lPqBC2j+DL0GSDuic35/Vgl4aFHUI9/JJqMUA6mEmGEWNDAA1yjyFE5bgzyLkYtGNg8uxWwwG4/HMLbpThczfdlQG91lf8IoqfwHMw6ShG7vPaKNdpAYRk75111rtWWmpoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714426692; c=relaxed/simple; bh=k8g/TiU8lIU8Mibjz3VChly9XimolgFwCzPlqtxQveM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=HkY2BWP9afGnB7BJja6ij8MD3nMMW/wJ0Alf9Wr0SZiIqvDVUsPGjjzWk0BxG+/ivOCIsNRptC+SKMIlgARUV2Uz1Kdj3+q1VM5INNAxU10EgzODkrQMmtVveYJ5cG5gsFs5L7uTIe6hLkzO0W8LXASXXeSP8U7qVgz4m0QnChA= 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=siBTceqN; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=+2nUi15d; 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 Date: Mon, 29 Apr 2024 21:38:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1714426688; h=from:from:sender:sender:reply-to: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: in-reply-to:in-reply-to:references:references; bh=BTJ77so2WRoXGher0vupuLRohX0a5C8x4hw3nGSKDmM=; b=siBTceqN18t4AkSRqy1DqWvgDyioPnO6h1gudSE5tR93CnPHdjQvrVvM8W+sPd5olhkQIZ Hrze7YxMShI8YkY2LTwAA/+izT9jnbOOdSDYk5F1npQ/5FeY8sxfVEa3UGza460fOdfRqK hTJwR+uCRZf1mZySPhSFwundB8UIqrgl0uU9gOMR8a2jNX1On5aqD9jy0WaAd5BYXv5u/r dgbysIze0oFPkt0so4b60WFG7CoZi96BscrhOGxrnuj4Sm8a7mR2T0Q8Ux0nMcRUTFNsD4 d0jwkqPqpU026QeURH8DoSVfW8CnSpsaLu/w6E1ptw7JHeXhrYpZFLHT/Tucdg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714426688; h=from:from:sender:sender:reply-to: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: in-reply-to:in-reply-to:references:references; bh=BTJ77so2WRoXGher0vupuLRohX0a5C8x4hw3nGSKDmM=; b=+2nUi15dQtqXxR4ffhKiMVbLeNcXBXOeY2o+gcnERQZ4Q/MruYrKhxEBWH2OfInESyM6l9 6ANZK+nUvuy1+mAw== From: "tip-bot2 for Daniel J Blueman" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/timers] x86/tsc: Trust initial offset in architectural TSC-adjust MSRs Cc: Daniel J Blueman , Thomas Gleixner , Steffen Persvold , James Cleverdon , Dimitri Sivanich , Prarit Bhargava , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240419085146.175665-1-daniel@quora.org> References: <20240419085146.175665-1-daniel@quora.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171442668800.10875.19345624016971341.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/timers branch of tip: Commit-ID: 455f9075f14484f358b3c1d6845b4a438de198a7 Gitweb: https://git.kernel.org/tip/455f9075f14484f358b3c1d6845b4a438de198a7 Author: Daniel J Blueman AuthorDate: Fri, 19 Apr 2024 16:51:46 +08:00 Committer: Thomas Gleixner CommitterDate: Mon, 29 Apr 2024 23:27:16 +02:00 x86/tsc: Trust initial offset in architectural TSC-adjust MSRs 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 --- 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 1123ef3..4334033 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 = 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