lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrX1LbZAiPH4x2Uby_cUUj2wgN92wc+5wvf-B3_9XdObWQ@mail.gmail.com>
Date:	Mon, 21 Jul 2014 14:56:49 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Borislav Petkov <bp@...en8.de>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>, x86-ml <x86@...nel.org>,
	lkml <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH] x86, TSC: Add a software TSC offset

On Mon, Jul 21, 2014 at 2:52 PM, Borislav Petkov <bp@...en8.de> wrote:
> On Mon, Jul 21, 2014 at 02:41:50PM -0700, Andy Lutomirski wrote:
>> How will this be compatible with the vdso?
>
> I've never thought about it yet. How compatible would you want it to be
> and what do you expect from it?

I expect that users of __vdso_clock_gettime (e.g. glibc) will get the
correct time :)  They use vread_tsc, and they can't use
preempt_disable, because they're in userspace.  They also can't
directly access per-cpu variables.

Turning off vdso tsc support on these machines would be an option.

>
> Remember, this is only attempting to be a hardware workaround for a
> smallish number of systems out there. Most of current machines should
> have stable and synched TSCs.

I actually own one of these systems.  It's a Sandy Bridge Core-i7
Extreme or something like that.

>
>> Also, IIRC, rdtscp does not need rdtsc_barrier(), whereas rdtsc does.
>> Getting this wrong will be a significant slowdown.
>
> This is too cryptic for me - get_cycles doesn't barrier around the TSC
> now either. Again, we will most likely end up not using RDTSCP anyway.

I wonder if that's a bug in get_cycles.

The basic issue is that rdtsc is not ordered with respect to nearby
loads, so it's fairly easy to see it behaving non-monotonically across
CPUs.  rdtscp is ordered, but it's a little slower.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ