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: <20160405151156.GE17541@pd.tnic>
Date:	Tue, 5 Apr 2016 17:11:56 +0200
From:	Borislav Petkov <bp@...en8.de>
To:	Brian Gerst <brgerst@...il.com>
Cc:	X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has()

On Tue, Apr 05, 2016 at 09:51:55AM -0400, Brian Gerst wrote:
> I think the general rule should be always use static_cpu_has() for
> runtime checks, since it reduces down to a single jmp/nop instruction
> after alternatives run.  Even if it's not a hot path, it saves a bit
> of runtime memory.

So gcc generates a MOV and a TEST for boot_cpu_has(). Not exactly the
bloat or slowdown.

So I look at those differently: static_cpu_has()

a) should be used on hotpaths

b) is used as such to annotate those - i.e., "ah, there's a
static_cpu_has(), this is a hot path, I better be careful what I'm doing
here."

boot_cpu_has() in all the rest.

And saving a couple of bytes per call site but increasing alternatives
application time by milli- or microseconds... Meh. I don't see it being
really worth the trouble. But this is just me.

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