[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130726102622.GA26073@pd.tnic>
Date: Fri, 26 Jul 2013 12:26:22 +0200
From: Borislav Petkov <bp@...en8.de>
To: Prarit Bhargava <prarit@...hat.com>
Cc: linux-kernel@...r.kernel.org, John Stultz <john.stultz@...aro.org>,
Dave Hansen <dave@...1.net>, x86@...nel.org
Subject: Re: [PATCH] x86, tsc add an initial read offset to __cycles_2_ns()
calculations
On Wed, Jul 24, 2013 at 12:03:20PM -0400, Prarit Bhargava wrote:
> +/*
> + * TSC can have non-zero values at boot time on Intel Xeon E5 (family 6,
> + * model 45) aka "SandyBridge" processors. This is documented in the
> + * Errata for the processors as BT81. As a result, we need to snapshot
> + * the TSC's initial value to avoid calculation overflows in the conversions
> + * of cycles to nanoseconds.
> + */
> +unsigned long long tsc_initial_value;
> +
> /*
> * Scheduler clock - returns current time in nanosec units.
> */
> @@ -979,6 +989,9 @@ void __init tsc_init(void)
> return;
> }
>
> + tsc_initial_value = get_cycles();
> + pr_info("TSC: tsc initial value = %lld\n", tsc_initial_value);
> +
And we probably don't need that info on processors unaffected by the
erratum...
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists