Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2619660ybl; Mon, 20 Jan 2020 06:22:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyNRyFKdP9xLodhg5oVcmWShkVmeTiRjaxNXs1qPc5rShOnqa4aC/qrYkBcQwF8uI9AlTi8 X-Received: by 2002:aca:b943:: with SMTP id j64mr13326996oif.155.1579530126630; Mon, 20 Jan 2020 06:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579530126; cv=none; d=google.com; s=arc-20160816; b=Tvt0fZDD0CyoeO9TaFj4tbykpsIWN6EShHsISwRKjf9OtbLK4ZGuLVDMDJ5s8hRQ8O 8wqur7hXNl087yxb4FbHlQlx3cH0I+3hU2rxBtiHlkccCfcqFb5O+MVIRFVwexS5J75f CJlHroiyI5ObvZIxS1OnPXWOTUoFheR6thUkE3mjK0GUdWOjk94WS/Opf1QdN9dbIb3c bbWiMj2PCZYbJDhx6hXWGZe4PhH1fLW4hgILNEeW7+cfVqD3JLbIXieG+BhIXzfJlrsn nGCqwN8xPqUL5Qy3Y79JKMRC55zbJNMSDziF6D9bOc+G54hC1QfDhxJgdIWnA6X8rc5+ R71g== 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 :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=F6zq9nm/Ri9Wc3JAzDzqc/NsBZlXQNstVWMJ+FiUD2Q=; b=Rv74NM7f9IkwpYV/6VcctaUpwv3fSO3fwGE88QSjrvORr3QuDCobeVMPVgFYub9xSM XDwp9xfsH1qBiY408VpmBk3WG5enjUqkKqlOCpkqlQ5kkAjN1jP5KeJUgrZevsuakusj kBP7AwZn98s1IZjAMULVzbrg5OaEc7YGHJi/7gVNCdWDVB1TXuJU48gCCZ2dNo0mqU81 1c0go6DDRuxN/6J59TuoUK8QyIO+WGr3Ar7JAa8Vv9r0HPZwysvnsBExHaQ3WBzWzo2U qogJyGZmE6kr55KZksqVeuYW0RvuroYmHu23qyeeaSYhMVPVfV7qu9QXyGDo+ZM9zFY5 Fwsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=default header.b=TCR5hUsb; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si17872383oih.0.2020.01.20.06.21.54; Mon, 20 Jan 2020 06:22:06 -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=@protonmail.com header.s=default header.b=TCR5hUsb; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729014AbgATOUN (ORCPT + 99 others); Mon, 20 Jan 2020 09:20:13 -0500 Received: from mail4.protonmail.ch ([185.70.40.27]:32249 "EHLO mail4.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727285AbgATOUN (ORCPT ); Mon, 20 Jan 2020 09:20:13 -0500 Date: Mon, 20 Jan 2020 14:20:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1579530011; bh=F6zq9nm/Ri9Wc3JAzDzqc/NsBZlXQNstVWMJ+FiUD2Q=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=TCR5hUsb/JnJc7uM8oxBC3I6eBvwEg/FoIUMNWIeHnlCgpRePl2SfSTFz80zqlASn 6rKu+yfYy1x6o5WPBkXVuHEsNIcUjgn75L6LhZBTNCMbBIX0ggE9oNfjLAumZro3Xb iBytV4Ecp7y7Z83BtkHWlAyM4Rgn6jw8aJe5MIgQ= To: Thomas Gleixner From: Krzysztof Piecuch Cc: Andy Lutomirski , "corbet\\@lwn.net" , "mingo\\@redhat.com" , "bp\\@alien8.de" , "hpa\\@zytor.com" , "x86\\@kernel.org" , "mchehab+samsung\\@kernel.org" , "jpoimboe\\@redhat.com" , "gregkh\\@linuxfoundation.org" , "pawan.kumar.gupta\\@linux.intel.com" , "paulmck\\@linux.ibm.com" , "jgross\\@suse.com" , "rafael.j.wysocki\\@intel.com" , "viresh.kumar\\@linaro.org" , "drake\\@endlessm.com" , "malat\\@debian.org" , "mzhivich\\@akamai.com" , "juri.lelli\\@redhat.com" , "linux-doc\\@vger.kernel.org" , "linux-kernel\\@vger.kernel.org" Reply-To: Krzysztof Piecuch Subject: Re: [PATCH] x86/tsc: Add tsc_tuned_baseclk flag disabling CPUID.16h use for tsc calibration Message-ID: In-Reply-To: <871rru4535.fsf@nanos.tec.linutronix.de> References: <9rN6HvBfpUYE7XjHYSTKXKkKOUHQd_skSYGqjXlI0jTIk4nqLoLUloev1jgSayOdvzmkXgRNP8j_mgcikMJy6L_JN_vJhUJn9vD9xm_ueSo=@protonmail.com> <6BFAC54D-65CA-4F8A-9C5B-CEFB108C90FD@amacapital.net> <871rru4535.fsf@nanos.tec.linutronix.de> Feedback-ID: krphKiiPlx_XKIryTSpdJ_XtBwogkHXWA-Us-PsTeaBSrzOTAKWxwbFkseT4Z85b_7PMRvSnq3Ah7f9INXrOMw==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,BAYES_05, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, January 20, 2020 1:42 PM, Thomas Gleixner w= rote: > > Simply because all of this is horribly fragile and if you put virt into > the picture it gets even worse. > > The initial calibration via PIT/HPET is halfways accurate in most cases > and we use the 1% as a sanity check. > > > Ideally it would be better to get the early calibration right than > > risk getting it wrong because of an "anomaly". > > Ideally we would just have a way to read the stupid frequency from some > reliable place, but there is no such thing. > > Guess why we have all this code, surely not because we have nothing > better to do than dreaming up a variety of weird ways to figure out that > frequency. Thank you for the explanation. > Widening the error window here is clearly a hack. As you have to supply > a valid number there, then why not just providing the frequency itself > on the command line? That would at least make most sense and would avoid > to use completely wrong data in the early boot stage. That sounds good. I'll assume that the user will be supposed to provide a flag tsc_early_hz= =3D so that refine_calibration_work can get better numbers while still doing the 1% sanity check. I'll send a patch this week.