From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755981AbdCWOjy (ORCPT ); Thu, 23 Mar 2017 10:39:54 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36343 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349AbdCWOjx (ORCPT ); Thu, 23 Mar 2017 10:39:53 -0400 Subject: Re: [v1 0/9] Early boot time stamps for x86 To: Thomas Gleixner References: <1490214265-899964-1-git-send-email-pasha.tatashin@oracle.com> <20170322202807.y34mrortprg5pi43@hirez.programming.kicks-ass.net> Cc: Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com From: Pasha Tatashin Message-ID: <0a628969-e4f6-a463-04e5-889e7b423602@oracle.com> Date: Thu, 23 Mar 2017 10:39:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, Thank you very much for looking at this patchset. Comments below: On 03/23/2017 06:56 AM, Thomas Gleixner wrote: > On Wed, 22 Mar 2017, Pasha Tatashin wrote: >> Yes, I am certain it is 0 or near 0 on reset on this machine. Because, I > > Emphasis on "this machine' > > It's not guaranteed especially not on reboot and not with creative BIOSes > fiddling with the TSC_ADJUST value. > > - It CANNOT be used to measure BIOS boot time reliably Yes, understood, I will remove comment about BIOS time from the next cover letter. However, I think the pr_info() with offset is still useful at least for those whose BIOS does not alter TSC_ADJUST, also it is consisten with every other clocksource in linux where offset is printed in pr_info(). From Intel PRM 2016/12: The time-stamp counter (as implemented in the P6 family, Pentium, Pentium M, Pentium 4, Intel Xeon, Intel Core Solo and Intel Core Duo processors and later processors) is a 64-bit counter that is set to 0 following a RESET of the processor Since early boot time stamps feature target processors that are later than "Pentium 4" because invariant TSC flag is checked, it is safe to assume that offset is going to be valid on power-on if TSC_ADJUST was not altered > > - If BIOS wreckaged TSC_ADJUST, then your whole time stamping goes out the > window once the kernel sanitized it. I will add a condition to tsc_early_init() to check for TSC_ADJUST if it is not 0, disable early TSC feature. Does this sound OK? Thank you, Pasha