From: Andy Lutomirski <luto@amacapital.net>
To: Borislav Petkov <bp@alien8.de>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] x86, TSC: Add a software TSC offset
Date: Mon, 21 Jul 2014 12:34:40 -0700 [thread overview]
Message-ID: <53CD6B50.5010404@mit.edu> (raw)
In-Reply-To: <20140719130602.GA5101@pd.tnic>
On 07/19/2014 06:06 AM, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
>
> There are machines which do have stable and always-running TSCs but the
> last get started at different points in time by the platform, causing
> the TSCs to have a small constant diff.
>
> It has been tried a couple of times to resync those during that
> sync check but the procedure is error prone and flaky, and not 100%
> successful.
>
> So, instead of doing that, let's not touch the TSCs at all but save a
> per-CPU TSC offset which we add to the TSC value we've read from the
> Time-Stamp Counter. The hope is thus to still salvage the TSC on those
> machines.
>
> For that to work, we need to populate the TSC AUX MSR with the core ID
> prior to doing the TSC sync check so that RDTSCP can give us the correct
> core number and we can add the offset atomically. And yes, we need a
> X86_FEATURE_RDTSCP CPU for the whole deal to work. Older ones simply
> lose.
I'm sure I'm missing something, but where is tsc_offset used outside the
tsc startup code? Is it somehow getting programmed into the TSC config
registers?
--Andy
next prev parent reply other threads:[~2014-07-21 19:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-19 13:06 [PATCH] x86, TSC: Add a software TSC offset Borislav Petkov
2014-07-19 13:28 ` Borislav Petkov
2014-07-21 19:34 ` Andy Lutomirski [this message]
2014-07-21 21:35 ` Borislav Petkov
2014-07-21 21:41 ` Andy Lutomirski
2014-07-21 21:52 ` Borislav Petkov
2014-07-21 21:56 ` Andy Lutomirski
2014-07-21 22:06 ` Thomas Gleixner
2014-07-21 22:11 ` Thomas Gleixner
2014-07-21 22:14 ` Andy Lutomirski
2014-07-21 22:08 ` Borislav Petkov
2014-07-21 22:13 ` Andy Lutomirski
2014-07-21 22:30 ` Borislav Petkov
2014-07-21 22:43 ` Andy Lutomirski
2014-07-21 23:01 ` Borislav Petkov
2014-07-22 8:00 ` Peter Zijlstra
2014-07-22 7:57 ` Peter Zijlstra
2014-07-22 2:40 ` Steven Rostedt
2014-07-22 8:59 ` Borislav Petkov
2014-07-22 12:05 ` Borislav Petkov
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=53CD6B50.5010404@mit.edu \
--to=luto@amacapital.net \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--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