Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3755253lfb; Mon, 9 May 2022 03:24:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGAuZBttsPSWUR6teNQwQQeWneJ0vEmyCBEpKntWGJzOVpHUbabzt+V4EX/mDqz6/JVhRT X-Received: by 2002:a63:680a:0:b0:3c2:7c45:c0ab with SMTP id d10-20020a63680a000000b003c27c45c0abmr12895373pgc.63.1652091885932; Mon, 09 May 2022 03:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652091885; cv=none; d=google.com; s=arc-20160816; b=UCq2XkFbMZl/Wj9vyy5s5qJoTv4lZ8edVk3KbLPkn3HPfx8jnsqvkPtzAKVsxRGYuP 8mbSocB9fEWUHlJaAD5e8fMYoxGkLSRaKPRo0P/Vqpq8ulqNdxpwg1U/YISszd3q5F8G SFPOrRjJI2tNSdsgNPgpxZnW0utppmOJmksmgP+6yFtyEj9zJGaDQ/+JPZFTsZBBcdtl ymdOCUhCcmsxPLn5Bvahb09hbpReQdwtAxQ8jiYx7TIM4Dm3k7i/fPgC98B3oEMXW9iN 2lLYCxEyxej8AMeGYV8R6UnYKYiVg73l0JsxpIIhN1c39/swapev0xK2KyMluuhj2owt FMOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IQlZz/h5atycWEAD+yUb3i16NDy1Qyycxp+32Nqj2f8=; b=xOP0CdE8f9TFqdIwJHzGV0vIU9SBE3LeoAzCZ8cjA4XcQDM1/oGP/UBPATZBXybLrw cbG0hLfhvvQItBVUjkLb/t8+XmoPPS7MRq9LxY7EJWEV6R9h1IMO/hXa9eZ6ruHELtlj 5Gv9zJnnNwlUlJbqZwvF4ihd737ZwWvVYojI6L+T6T0zINBPKccmTij+rVhae2dI3/Yv gNfPlqdWRvHoXpB+u4rWQ4WuCEmmUVR7qEHF9/v/XykLWR45lfxpVEeIZ0rOQMg6fO7E fJ1hlFZLOHPkIH48oWJBMBI/GUhNcgm4kV+o3c21eZt+OnC4aTnrGjoR3mzzO6ckp570 0XyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Bt171fII; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a19-20020aa79713000000b004fa9ef1a302si13224419pfg.234.2022.05.09.03.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:24:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Bt171fII; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D2F324825A; Mon, 9 May 2022 03:00:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234640AbiEIHZG (ORCPT + 99 others); Mon, 9 May 2022 03:25:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236483AbiEIHVO (ORCPT ); Mon, 9 May 2022 03:21:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 240C012609 for ; Mon, 9 May 2022 00:17:20 -0700 (PDT) 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=IQlZz/h5atycWEAD+yUb3i16NDy1Qyycxp+32Nqj2f8=; b=Bt171fII0kKQtSprI3kJJ7QBvb 8xWEHRUWSLTEL63TEdThGtconyY4PBBcq9bY6BXapEanBFko11TDGtvmn3rgWiUxM4exBhwGUDy5w VRDeFnZAaMOPpMWGE3EWM1/00ZypElWHZwcm4dhKc+yMBXJYEXVuNkEw8mx0L95qA5CMk5D6TLNbN eD3DBQ7mDSVe7f2MtG7DMOXfh1S/Xthy8Gt93C4sND48EpGku9AhXpW6hamyEYjrYuoMU+Kzf+GNU cbYOE+b4lwTVYRzj1yR/h2SZq6MCf4LNBj3y1XTX+HunJj6aa9MvtZL3qWLVrlX1aF8rOBD+zaKPK 1qrCmLsg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnxdV-003Dti-Nt; Mon, 09 May 2022 07:16:53 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id B82BF980E93; Mon, 9 May 2022 09:16:52 +0200 (CEST) Date: Mon, 9 May 2022 09:16:52 +0200 From: Peter Zijlstra To: Feng Tang Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Jonathan Corbet , x86@kernel.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, rui.zhang@intel.com, len.brown@intel.com, tim.c.chen@intel.com Subject: Re: [PATCH] x86/tsc: Add option to force HW timer based recalibration Message-ID: <20220509071652.GE76023@worktop.programming.kicks-ass.net> References: <20220508144733.91343-1-feng.tang@intel.com> <20220509045839.GA40730@shbuild999.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220509045839.GA40730@shbuild999.sh.intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 09, 2022 at 12:58:39PM +0800, Feng Tang wrote: > Sorry, just spotted some typos, here is the updated version > > > From ee8e3d772c623d27d79c43da5a76fb6252175aba Mon Sep 17 00:00:00 2001 > From: Feng Tang > Date: Sun, 8 May 2022 20:22:12 +0800 > Subject: [PATCH] x86/tsc: Add option to force HW timer based recalibration > > Currently when HW provides the tsc freq info through MSR or CPUID(0x15), > the info will be taken as the 'best guess', and kernel will set the > X86_FEATURE_TSC_KNOWN_FREQ flag and skip the HW timer based recalibration, > which works pretty well. > > And there is still very few corner case that the freq info is not > accurate enough with small deviation from the actual value, like on > a product with early buggy version of firmware or on some > pre-production hardware. > > Add an option 'recalibrate' for 'tsc' kernel parameter to force the > tsc freq recalibration with HPET/PM_TIMER, and warn if the deviation > from previous value is more than about 500 PPM. > > Signed-off-by: Feng Tang Why isn't 'tsc_early_khz=' not working for you? Afaict that will override calibrate_tsc() when provided and as such can be used on these early platforms for provide the right value until such time that the firmware is fixed.