public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Prarit Bhargava <prarit@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	John Stultz <john.stultz@linaro.org>, Dave Hansen <dave@sr71.net>,
	x86@kernel.org
Subject: Re: [PATCH] x86, tsc add an initial read offset to __cycles_2_ns() calculations
Date: Fri, 26 Jul 2013 12:26:22 +0200	[thread overview]
Message-ID: <20130726102622.GA26073@pd.tnic> (raw)
In-Reply-To: <1374681800-7237-1-git-send-email-prarit@redhat.com>

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.
--

      parent reply	other threads:[~2013-07-26 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-24 16:03 [PATCH] x86, tsc add an initial read offset to __cycles_2_ns() calculations Prarit Bhargava
2013-07-26  9:12 ` Peter Zijlstra
2013-07-26 10:26 ` Borislav Petkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130726102622.GA26073@pd.tnic \
    --to=bp@alien8.de \
    --cc=dave@sr71.net \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox