Re: [v1 0/9] Early boot time stamps for x86

From: Pasha Tatashin
Date: Thu Mar 23 2017 - 10:39:57 EST


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