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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160421162611.GJ28821@pd.tnic>
Date:	Thu, 21 Apr 2016 18:26:11 +0200
From:	Borislav Petkov <bp@...en8.de>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] x86/vdso: Use RDPID in preference to LSL when
 available

On Thu, Apr 21, 2016 at 08:25:45AM -0700, Andy Lutomirski wrote:
> Didn't I?

Bah, I cut off the line which has the "=a" and then did the commenting.
Sorry about the noise.

> I thought about it, and there were two reasons:
> 
> 1. I don't think we want to use __getcpu in the kernel.  LSL is fairly
> slow, and we'd still need to mask off the node number.
> raw_smp_processor_id(), in contrast, is a single load.

Right.

> 2. I have no way to benchmark this thing.  I'm assuming the RDPID will
> be faster than LSL, but that doesn't mean it's faster than a load.
> (It could be -- it will save a cache line.)

But the RDPID reads an MSR. So it probably is microcode and thus slower
than a load... I guess one of the reasons for the RDPID is to avoid the
serialization cost of RDTSCP.

> So we might actually want something that does an alternative where the
> two choices are the percpu load and RDPID ; AND, but that wouldn't end
> up sharing code.  But I'll leave that to someone with an actual
> RDPID-supporting CPU :)

Right.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ