From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once 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> From: Pavel Tatashin Message-ID: Date: Thu, 19 Jul 2018 16:46:43 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-Archive: List-Post: To: Thomas Gleixner 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 List-ID: On 07/19/2018 04:44 PM, Thomas Gleixner wrote: > 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. OK, good, I implemented with this in-mind. I will send out a new series shortly. Thank you, Pavel > > Thanks, > > tglx >