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: <53A1A942.1090001@zytor.com>
Date:	Wed, 18 Jun 2014 07:59:14 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Dave Hansen <dave.hansen@...el.com>,
	Borislav Petkov <bp@...en8.de>,
	Qiaowei Ren <qiaowei.ren@...el.com>
CC:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 03/10] x86, mpx: add macro cpu_has_mpx

On 06/18/2014 07:35 AM, Dave Hansen wrote:
> 
> It looks like static_cpu_has() is the right thing to use instead of
> boot_cpu_has().  But, this doesn't just obfuscate things.
> 
> We actually _want_ the compiler to cull code out when the config option
> is off.  Things like do_bounds() will see code savings with _some_ kind
> of #ifdef rather than using static_cpu_has().
> 
> So, we can either use the well worn, consistent with other features in
> x86, cpu_has_$foo approach.  Or, we can roll our own macros.
> 

We could do something like:

#define MPX_ENABLED (IS_ENABLED(CONFIG_X86_MPX) &&
static_cpu_has(X86_FEATURE_MPX))

	-hpa

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