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]
Date:   Thu, 4 Oct 2018 11:18:47 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     will.deacon@....com, mingo@...nel.org
Cc:     linux-kernel@...r.kernel.org, longman@...hat.com,
        andrea.parri@...rulasolutions.com, tglx@...utronix.de,
        bigeasy@...utronix.de, hpa@...ux.intel.com, JBeulich@...e.com,
        bp@...en8.de
Subject: Re: [PATCH v2 3/4] x86/asm: Simplify GEN_*_RMWcc() macros

On Wed, Oct 03, 2018 at 03:03:00PM +0200, Peter Zijlstra wrote:
> +#define __GEN_RMWcc(fullop, _var, cc, clobbers, ...)			\
> +({									\
> +	__label__ cc_label;						\
>  	asm_volatile_goto (fullop "; j" #cc " %l[cc_label]"		\
> +			: : [var] "m" (_var), ## __VA_ARGS__		\
>  			: clobbers : cc_label);				\
> +	0;								\
>  cc_label:								\
> +	1;								\
> +})

That's obviously crap...

This one seems to actually compile and generate identical code:

#define __GEN_RMWcc(fullop, _var, cc, clobbers, ...)			\
({									\
	bool c = false;							\
	asm_volatile_goto (fullop "; j" #cc " %l[cc_label]"		\
			: : [var] "m" (_var), ## __VA_ARGS__		\
			: clobbers : cc_label);				\
	if (0) {							\
cc_label:	c = true;						\
	}								\
	c;								\
})

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ