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:	Wed, 24 Aug 2011 15:02:47 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	"H. Peter Anvin" <hpa@...or.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>,
	the arch/x86 maintainers <x86@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Nick Piggin <npiggin@...nel.dk>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Subject: Re: [PATCH 07/12] x86: use cmpxchg_flag() where applicable

On 08/24/2011 02:56 PM, Linus Torvalds wrote:
> Ok, I see nothing horrible in this series.
>
> The one reaction I have is that the cmpxchg_flag() thing returns an
> 8-bit value, but then a lot of the users end up having to extend it to
> a full "int" purely for calling convention reasons (eg I think
> 'down_write_trylock()' will have 'sete + movzl' - not a new problem,
> but since the whole point was to remove extraneous instructions and we
> no longer have the silly 'testl', it now annoys me more).
>
> So it seems a bit sad. But I guess it doesn't really matter.

It's still annoying because in practice sete sets a result, but most
users are just going to have to testb it to do a conditional anyway -
it's a pity there's no way to tell gcc that an asm has already set the
flags, and it can generate a jcc/setcc based on that.

I experimented with a variant based on "asm goto", so that the
conditional control flow is done by the asm itself, and gcc should be
able to make use of that (via constant folding).  But the resulting code
wasn't very spectacular, with quite a few unnecessary jumps.

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