Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2128364imm; Thu, 19 Jul 2018 13:46:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcVF5jwUce1tHK8o867WGm4nmRQAMhiuIrKw6Pj885Iw+k8yi3GZk0+Tky9OnA0Ce8tNXk4 X-Received: by 2002:a63:2359:: with SMTP id u25-v6mr11484637pgm.220.1532033162406; Thu, 19 Jul 2018 13:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532033162; cv=none; d=google.com; s=arc-20160816; b=InY/8tF1CRXCLlyVpLmmVit+dCg4PwlhFpqcP7Nj9Fb5RHsdDFstjhsVDfqniHSFNp h7pmhq0GU/22rK9JcrpoIRCUV+RXOe9WdLMtY1iZg/wJ0eEPlxHo5H/S5OWhdjo0oIwC a9pwD5QHd11eF8qMSCy6BkVrarYw5TaIQ1mfANN6PmAT8cPA9k5N6P53vHyyyziKeqhT qda1NOsXRU5kTJK9ai+S4VLxpFme9g3AEEJfKvfT1hZik1UnVEWaVR6bteNnEi+uQPim geXGVi0YJgYmmZiN72yrqdgBK+v8LjsjHixJd0d4VC8DvxN3qGStLrcwg7n7t0Oal5Xy +ecA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=A+QXdrXBH0IrwI5stpEqvUKEHCGeVM67/IBZVBJo2vo=; b=UFdP7lKfUPm6MRQ4W4rmKeA7Rv0eNtUkbI9/6qDwylZG8Xny8EwBd6ramLL1PkIC0n 6NQtnlBdyvB/sdZtyOMu1zGeDXBwAcn4f2kgnSMUN3gKkb/IhYcbqnT1s85DraKwSW2q w/XJldXEk4oJTqOWv0sVtxUnnTx1Jc8MLq0xPnc/rBlQiW2atXW9h/dkwfrI87j2k/MJ IKPHA1XVqi4JxxuLHVZqDW4Gd6DZTYetzfz6ux+Qfqx1+0kUeF4jb+XUie/IZsM8G6Dn GJwiEJVpHsO6kX1uFOYbWkCaqNaNCGoZ4rFTXrKTND6ej3dxf2J0OlfFsQv2XXlXDBVK UWQw== ARC-Authentication-Results: i=1; mx.google.com; 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 p3-v6si90405plr.131.2018.07.19.13.45.43; Thu, 19 Jul 2018 13:46:02 -0700 (PDT) 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; 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 S1729594AbeGSV3y (ORCPT + 99 others); Thu, 19 Jul 2018 17:29:54 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:34106 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbeGSV3y (ORCPT ); Thu, 19 Jul 2018 17:29:54 -0400 Received: from p4fea5a5a.dip0.t-ipconnect.de ([79.234.90.90] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fgFmY-00065d-3c; Thu, 19 Jul 2018 22:44:14 +0200 Date: Thu, 19 Jul 2018 22:44:13 +0200 (CEST) From: Thomas Gleixner To: Pavel Tatashin cc: peterz@infradead.org, Steven Sistare , Daniel Jordan , linux@armlinux.org.uk, schwidefsky@de.ibm.com, Heiko Carstens , John Stultz , sboyd@codeaurora.org, x86@kernel.org, LKML , mingo@redhat.com, hpa@zytor.com, douly.fnst@cn.fujitsu.com, prarit@redhat.com, feng.tang@intel.com, Petr Mladek , gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, pbonzini@redhat.com Subject: Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once In-Reply-To: Message-ID: References: <20180718022211.6259-1-pasha.tatashin@oracle.com> <20180718022211.6259-21-pasha.tatashin@oracle.com> <20180719103340.GA2494@hirez.programming.kicks-ass.net> <4295075b-8a0f-1723-2e80-1bbd2f038846@oracle.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Jul 2018, Pavel Tatashin wrote: > On Thu, Jul 19, 2018 at 12:49 PM Pavel Tatashin > wrote: > > > > > So create two functions. native_...early..() and native....(). The early > > > one does not contain the hpet/pmtimer stuff and it replaces the ops.pointer > > > with the late one which contains all of it. > > > > Good idea. Actually, the late one will contain only hpet/pmtimer and I > > will set it only if tsc frequency was not determined only. > > If we determined tsc early in boot using one of the quick methods: > from cpuid/msr/quick_pit, can we assume that frequencies of all other > CPUs will be determined the same way? Or do we still have to fallback > to PIT/HPET/PMTIMER? I wondering if we support heterogeneous > multi-socket platforms with different CPUs, because that the only > platforms where I see such scenario is possible. The frequency for secondary CPUs is usually taken from the boot CPU and the only reason why recalibration can happen is when the CPU does not have a constant frequency TSC. For that case the quick PIT + hpet/pmtimer calibration bundle is required. So yes, the early calibration might work with quick PIT (those CPUs definitely do not have MSR/CPUID based calibration), but the recalibration might fail the quick PIT calibration for various reasons. Thanks, tglx