Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1159968pxy; Thu, 29 Apr 2021 00:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpNRpksFU6pd/Bgi5jm7ZMjHZcUfaRgYJk7f6H+hQiij8bjg119eyr33C25C5QrvpS8Ac1 X-Received: by 2002:a17:902:b609:b029:ec:e80d:7ebd with SMTP id b9-20020a170902b609b02900ece80d7ebdmr28680549pls.75.1619681968530; Thu, 29 Apr 2021 00:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619681968; cv=none; d=google.com; s=arc-20160816; b=jWt7sH++ySAPWIrKWlx3ladauOgCDcvmwULqOExdADxdRB10FkgB7G5DMIHVsY+3Dp e9/eFGlmiMziGbQOXdPlK2PPmPPGDe8lLcY6ChRrJIRzdwOuP4QX95YSzN7G9NqWVFJc 7e3idExWSdptnLSb7Iv8XQez3MbYXao3rdgD/iqOrPZrajyyxpNc5S1J/78xGfE1YU2q jxiMwVkUnwc+oSxz0QH/PQQd4WgqaHc1B7m6nkFscXg7IREB/qC6a8OVzzqa/eCfs0Cd DlTv7oCm3T49ZvtnevW3EyX6udUcMXOHtIfq3gqUW2spgRlZU2FiKJq1za6vFjQAtiKE eQNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=cMzmKRUSl0hRDvQ5wReYg1zDctPKProQSGNeBPavu9U=; b=AXCp4THnGjVJdjWOghkWCi+c4Torm7/7ex7gHClvquCpyB+75646dgJc2wy9WjxJW6 FHSMLwE02ukPkzk733hxdTBZuletZEujFKuofYyZ8ucUpHLBhI8AoXnpN+IE4zIzpMwU vXccUHfsStslC/XtsjueYmQty0Juy2Gwwjcb0+7/nGBE47Jji6nWh67Z06mfH5ors9SX 8rZz9R3vDUhXNlen2E7v/xwhI2LSHr9MQucQkcBoQFaroiTdlHGhFLg/9F5ixQQu5x8R tg7nVNTZC6WRUYeQ8YcsvKLhH52VHqcuVfADyzu0lr1+sQeHWiugNTc2NtUhDZG9iXMA Jl7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m15si2442839plx.60.2021.04.29.00.39.15; Thu, 29 Apr 2021 00:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239747AbhD2HjX (ORCPT + 99 others); Thu, 29 Apr 2021 03:39:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:1980 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239762AbhD2HjH (ORCPT ); Thu, 29 Apr 2021 03:39:07 -0400 IronPort-SDR: jUrGf21yTe8sRKnxPPkd1nSS7eh1OpLcjLOwvEh8CoV/Rt2DVr5puR4y9l1NkwoG7QO7ltTYcq sXGmeZYOrt6Q== X-IronPort-AV: E=McAfee;i="6200,9189,9968"; a="196502442" X-IronPort-AV: E=Sophos;i="5.82,258,1613462400"; d="scan'208";a="196502442" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2021 00:38:21 -0700 IronPort-SDR: qyNJhMyS573341bMtMyQx7/cmndiTpoc0zlhI+GheSQDEwbQVSpGI+WeIO1n2To/9vI8oiR1Qo qqtznY9tO1DQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,258,1613462400"; d="scan'208";a="423944954" Received: from shbuild999.sh.intel.com (HELO localhost) ([10.239.147.94]) by fmsmga008.fm.intel.com with ESMTP; 29 Apr 2021 00:38:16 -0700 Date: Thu, 29 Apr 2021 15:38:16 +0800 From: Feng Tang To: Thomas Gleixner Cc: Peter Zijlstra , paulmck@kernel.org, kernel test robot , 0day robot , John Stultz , Stephen Boyd , Jonathan Corbet , Mark Rutland , Marc Zyngier , Andi Kleen , Xing Zhengjun , LKML , lkp@lists.01.org, kernel-team@fb.com, neeraju@codeaurora.org, zhengjun.xing@intel.com, x86@kernel.org, Paolo Bonzini , Borislav Petkov Subject: Re: [clocksource] 8c30ace35d: WARNING:at_kernel/time/clocksource.c:#clocksource_watchdog Message-ID: <20210429073816.GA317@shbuild999.sh.intel.com> References: <87y2d3mo2q.ffs@nanos.tec.linutronix.de> <87a6pimt1f.ffs@nanos.tec.linutronix.de> <871raumjj4.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871raumjj4.ffs@nanos.tec.linutronix.de> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021 at 07:00:15PM +0200, Thomas Gleixner wrote: > On Wed, Apr 28 2021 at 17:39, Peter Zijlstra wrote: > > On Wed, Apr 28, 2021 at 03:34:52PM +0200, Thomas Gleixner wrote: > >> #4 is the easy case because we can check MSR_TSC_ADJUST to figure out > >> whether something has written to MSR_TSC or MSR_TSC_ADJUST and undo > >> the damage in a sane way. > > > > This is after the fact though; userspace (and kernel space) will have > > observed non-linear time and things will be broken in various subtle and > > hard to tell ways. > > What I observed in the recent past is that _IF_ that happens it's a > small amount of cycles so it's not a given that this can be observed > accross CPUs. But yes, it's daft. Currently when tsc_adjust overriden is detected, the warning msg is "[Firmware Bug]: TSC ADJUST differs: CPU%u %lld --> %lld. Restoring", which is kind of gentle. With Borislav's patch of preventing user space from writing to tsc_adjust msr, the warning could be stronger? Adding something after that like: "Writing to TSC_ADJUST MSR is dangerous, and may cause the lost of your best clocksource: tsc, please check with your BIOS/OS vendors" Thanks, Feng > >> I can live with that and maybe we should have done that 15 years ago > >> instead of trying to work around it at the symptom level. > > > > Anybody that still has runtime BIOS wreckage will then silently suffer > > nonlinear time, doubly so for anybody not having TSC_ADJUST. Are we sure > > we can tell them all to bugger off and buy new hardware? > > > > At the very least we need something like tsc=broken, to explicitly mark > > TSC bad on machines, so that people that see TSC fail on their current > > kernels can continue to use the new kernels. This requires a whole lot > > of care on the part of users though, and will raise a ruckus, because I > > bet a fair number of these people are not even currently aware we're > > disabling TSC for them :/ > > I'm still allowed to dream, right? :) > > Thanks, > > tglx