Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1334881lqp; Mon, 15 Apr 2024 03:27:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUOwH1XdHVk3lsUZOukUWu8kwNv3LupupqlxuqgtdadipSMZ6oNPEHtsy6dpqvkmu84r5zzbjOqM/jDxRlgJQ0sJtfYqbR0CG+LW+Zf4g== X-Google-Smtp-Source: AGHT+IH4CmWGaQEiGHBUwCndBzG5GPvK7Sk+jXrBsz+PYDRtBQPD/h2RoWlhvYRJTiEtWeWakUkt X-Received: by 2002:a05:6a00:2d81:b0:6ea:c2a2:5648 with SMTP id fb1-20020a056a002d8100b006eac2a25648mr10343514pfb.3.1713176824532; Mon, 15 Apr 2024 03:27:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713176824; cv=pass; d=google.com; s=arc-20160816; b=nwLw4QMDglFIbfu58VIdRPUeixsh9/hcw7t/Ta34VGJ3Nh0kf8WTYG7cYBSWAJJF2C iLik+AVLZM0/tvL1W0WAQFyfndOKezVpXorDZJAtmJkchFYZK6KLaEMEXgphNgaddWTa n0ozqXkxZ94khjkC0fqaagPjTPeQonMcNDJa9I1VtOq+++pjH+7MpIqakvyHY3dKJcGV OUbczyUoiNugzD6EBezHWbp9UV3pwXRlyXB0M/wTOprZ8wli+R44TO4tUPPWZw99kOkO WfoKNqrQBCHLhtdrGc0J7kdSxKwm/x60YKrFcnTqd5Ezmt+DytxtXgS6mS/jrbW70/dC 9GRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pixuZERIF45TRFIuK2/vWu3NO2feKHANcyjnSRqQK+0=; fh=3mRB7emjndbSLPWHBeWoxOXeB1H5VE4Q3JMgAHimxZE=; b=nGdZyDwY/bWg4UfP3ZuRImIlsnCHYNREoPasHRVu2NeFu77Jfod7vLIGdK5Kwv6Tq8 D3P2R6/Rn47+vscVkL4zOSGDx+6hCe1HUmlGW5eqV1uMHTGDhlOB6fRGlpxHrWcnSHTl kythw4I2YVlNt3nwdHM7MfjFp1Zytmn+2yn60kMGnvvffuuGtpFGqQ0TzqzDjTxPYkg5 KO+kzhmQWw+QQZ6ZXL3iUniwmfQlbbHMA02BtJwf+TFmbzJusc3m9hfiO2SFBDzYcc8W pWxqGfVPqtWQJBwlyMeFfQVBjfnYBzOEGeTUeic8BkmA1Jln6WX7w2wwqsH6+yPanu9B 9osA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fl+Fy9hu; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-144658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144658-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ga14-20020a056a00620e00b006ecd76e92d0si7517618pfb.321.2024.04.15.03.27.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 03:27:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fl+Fy9hu; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-144658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144658-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 07443284DC8 for ; Mon, 15 Apr 2024 07:22:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9D1A22F0F; Mon, 15 Apr 2024 07:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="fl+Fy9hu" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 B5410208C1 for ; Mon, 15 Apr 2024 07:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713165735; cv=none; b=WF0UQpszUuaxeu/b5/C/DzZFcr6oS64dvkSn9veni6sdFjexklpbBhoKHlH7FkiGctsx7r4o5/WWYnqbYH0erotP2GI99vKpu4GuO9v4SwDjoVlXGHC/QheKomsnJTL6yqpCV+DMqdl+unNYGxoQItriNu4OSoTxxgakE5QxniQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713165735; c=relaxed/simple; bh=DT0z5c5Soncl7yZ6BZd8jDaZqESFh46sM5dtII7EO4U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bsDZET7Kp8znrCt8hD635GYVib3vQOWWJDG7CIOKTsIn4RIDAiQgi6/uhVhID1Uj6Ku7ZdIpTOiAMP1HKb9aYYQ07mEP9OS7wiO9vi7JqLknWCaB6LH5NB8LX2v5leox2U3j8T3Dej2l0BBBs3mWlMrQICcFJiPari4ETugLuUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=fl+Fy9hu; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pixuZERIF45TRFIuK2/vWu3NO2feKHANcyjnSRqQK+0=; b=fl+Fy9huSIq8mnnizg7USspAUP aFpfyUYuLo6/2ZoHez1uvg4xXUFONmv5jcHD8kj6UtZELRdxEYLjhorLbwO7Qz9NLB3j0OSuVLYpI IoQP+dvU1+OSIUDbWaRcHp2hpMaHNIv78sKnaahyAiVCo3gfeGODlb+/rsS5yhi0bV+VvPvYsOrYR tnEFSamqtFHMRt4+A7Icu/9bQ95QUehlpCIC104cZ5vWSEXCvFVWLYF7II7X3Vr6R59v/uAI0ZIUJ yYCpHR4ymrxrfPjtUAnujE25cZivXIK5hLJSd6Ec0NTlle1mBVtekUlmrrt0v2yTebFWsdGibsLDL Li942L5w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwGfI-0000000FC06-3IBh; Mon, 15 Apr 2024 07:22:08 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 3F79D30040C; Mon, 15 Apr 2024 09:22:08 +0200 (CEST) Date: Mon, 15 Apr 2024 09:22:08 +0200 From: Peter Zijlstra To: Daniel J Blueman Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: Trust initial offset in architectural TSC-adjust MSRs Message-ID: <20240415072208.GE40213@noisy.programming.kicks-ass.net> References: <20240226072533.341382-1-daniel@quora.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240226072533.341382-1-daniel@quora.org> On Mon, Feb 26, 2024 at 03:25:33PM +0800, Daniel J Blueman wrote: > 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. Given the amount of BIOS fail in general, I'm thinking the number of machines that have multi-chassis and get this right are far less than the 'small' systems that get this wrong.