Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1903371ybl; Tue, 3 Dec 2019 14:43:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwRnrtHkhdeP0IrnC/ZH5KfB7yyNKiK3lQy+KdvTkcMG/YRInyCjlhgQOufozK1LzQk7bvx X-Received: by 2002:aca:4183:: with SMTP id o125mr280243oia.125.1575413021636; Tue, 03 Dec 2019 14:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413021; cv=none; d=google.com; s=arc-20160816; b=Tv5Z6k53pXwJlgSuHaYagytxrMuNLiRXfpyGQO8tfeUjK4kLjxlkfU1On5a9eMPzJo EtUVxRMBOyp8ZBqsu91rH6AxVDnIJEHTWfj/E+YjQbQnbIzd094me7ZVecH/Z6767N7P vKGQUZVDor5Qm426m2rMU2ujdMnMao0fXWG5/UbtA8+fC61ncnol9p28J/TEtA7woW4L W/CnfqUlZ4lhWBe0VrIauBMUOU2h6W8uO2DShWHMJrPov82BJurcPFGRdhsqb+EDPcpr P1PpYq/5vPesok+V3A3fgrrJtR5vW5u62zvA0JO3m3uJrClQu9LTR+7/No+FfegKAIF6 wrDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yuLtcobjKDvzroQejxZtnavcUtyUv5RumjZzesDimkA=; b=T4gxeUdvoaV67Jg1SYcgyvCUJeKbMMbW/NU5nkpy5sY69WTW8NIFcVht2+cKK/grx1 2yJsk0t/VePZQGRbJ0u0X5mCMEr19wg3Ig7G6VzJpqFNUUjI1Rti0s1KFkDqoreOZ0vS Eo3HteGHB3vMiYjVhLuAJX8G6NVOUyfJzmJ97zjr4kxP5CkngDwWnJKpvPTkPHFWpgsE adeJ8Xj/N/0oMZdK8sAyUIcqR9VEsHuYnpoTLsbPyl7mg7PW4M4xD1YDkQ5DZx1lileh iY+EavjvD+5ncx/vy8nJxZ9BGXG6djTHUQ8aIv5elRv5K4bayzaZL2uk0+z5ACZzQJlH Wiqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ty5SlETn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si2183706oih.21.2019.12.03.14.43.29; Tue, 03 Dec 2019 14:43:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ty5SlETn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728583AbfLCWlo (ORCPT + 99 others); Tue, 3 Dec 2019 17:41:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:56274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727693AbfLCWlm (ORCPT ); Tue, 3 Dec 2019 17:41:42 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52584207DD; Tue, 3 Dec 2019 22:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575412901; bh=dWq0ySzyJnxJdJhCQJbxx49QxdxOFKU1fwd+oyAFV/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ty5SlETn7UoXOIsw6AN0zZy2r6Ph+Dll53tqaY79WUXocAbaN3S66qa8CmI7LJqQq t4IgdPM/ThS++ftJyH86k6wi3WdzvZch/Nff3oki/N/EziOTAN7cYLD7K0bnf/DLAw YI/c6y8H55Y7S8NLg+zAjn9UTmC4JR7CPyRG55mQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Zhivich , Thomas Gleixner , Sasha Levin Subject: [PATCH 5.3 060/135] x86/tsc: Respect tsc command line paraemeter for clocksource_tsc_early Date: Tue, 3 Dec 2019 23:35:00 +0100 Message-Id: <20191203213022.231008467@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203213005.828543156@linuxfoundation.org> References: <20191203213005.828543156@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Zhivich [ Upstream commit 63ec58b44fcc05efd1542045abd7faf056ac27d9 ] The introduction of clocksource_tsc_early broke the functionality of "tsc=reliable" and "tsc=nowatchdog" command line parameters, since clocksource_tsc_early is unconditionally registered with CLOCK_SOURCE_MUST_VERIFY and thus put on the watchdog list. This can cause the TSC to be declared unstable during boot: clocksource: timekeeping watchdog on CPU0: Marking clocksource 'tsc-early' as unstable because the skew is too large: clocksource: 'refined-jiffies' wd_now: fffb7018 wd_last: fffb6e9d mask: ffffffff clocksource: 'tsc-early' cs_now: 68a6a7070f6a0 cs_last: 68a69ab6f74d6 mask: ffffffffffffffff tsc: Marking TSC unstable due to clocksource watchdog The corresponding elapsed times are cs_nsec=1224152026 and wd_nsec=378942392, so the watchdog differs from TSC by 0.84 seconds. This happens when HPET is not available and jiffies are used as the TSC watchdog instead and the jiffies update is not happening due to lost timer interrupts in periodic mode, which can happen e.g. with expensive debug mechanisms enabled or under massive overload conditions in virtualized environments. Before the introduction of the early TSC clocksource the command line parameters "tsc=reliable" and "tsc=nowatchdog" could be used to work around this issue. Restore the behaviour by disabling the watchdog if requested on the kernel command line. [ tglx: Clarify changelog ] Fixes: aa83c45762a24 ("x86/tsc: Introduce early tsc clocksource") Signed-off-by: Michael Zhivich Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20191024175945.14338-1-mzhivich@akamai.com Signed-off-by: Sasha Levin --- arch/x86/kernel/tsc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 57d87f79558f2..04dd3cc6c6edd 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1505,6 +1505,9 @@ void __init tsc_init(void) return; } + if (tsc_clocksource_reliable || no_tsc_watchdog) + clocksource_tsc_early.flags &= ~CLOCK_SOURCE_MUST_VERIFY; + clocksource_register_khz(&clocksource_tsc_early, tsc_khz); detect_art(); } -- 2.20.1