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, 24 Mar 2022 16:00:13 +0700
From:   Ammar Faizi <ammarfaizi2@...weeb.org>
To:     Alviro Iskandar Setiawan <alviro.iskandar@...weeb.org>,
        Willy Tarreau <w@....eu>
Cc:     "Paul E. McKenney" <paulmck@...nel.org>,
        Nugraha <richiisei@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
        David Laight <David.Laight@...lab.com>
Subject: Re: [PATCH v1 04/11] tools/nolibc: x86-64: Use appropriate register
 constraints if exist

On 3/24/22 3:33 PM, Alviro Iskandar Setiawan wrote:
> On Thu, Mar 24, 2022 at 2:57 PM Willy Tarreau <w@....eu> wrote:
>> On Thu, Mar 24, 2022 at 02:30:32PM +0700, Ammar Faizi wrote:
>>> Use appropriate register constraints if exist. Don't use register
>>> variables for all inputs.
>>>
>>> Register variables with "r" constraint should be used when we need to
>>> pass data through a specific register to extended inline assembly that
>>> doesn't have a specific register constraint associated with it (anything
>>> outside %rax, %rbx, %rcx, %rdx, %rsi, %rdi).
>>>
>>> It also simplifies the macro definition.
>>
>> I'm a bit bothered by this one because I went the exact opposite route
>> in the early design precisely because I found that the current one was
>> simpler. [...]
> [...]
>> I'd say that if there is any technical benefit in doing this (occasional
>> code improvement or better support for older or exotic compilers), I'd say
>> "ok go for it", but if it's only a matter of taste, I'm not convinced at
>> all and am rather seeing this as a regression. Now if there's rough
>> consensus around this approach I'll abide, but then I'd request that other
>> archs are adapted as well so that we don't keep a different approach only
>> for these two ones.
> 
> I don't see any technical benefit for x86-64, so I don't think there
> is a need in doing this. Though I personally prefer to use register
> constraints if they exist instead of register variables for everything
> (oh yeah, matter of taste since I don't have any technical argument to
> say it's better respecting the resulting codegen). The only real issue
> is for the syscall6() implementation on i386 as we've been bitten by a
> real compiler issue. In short, I am neutral on this change.

OK then, I will drop this patch in the next version. I agree that it
doesn't really show any technical benefit and there is no danger in
doing the current implementation.

And yes, the syscall6() for i386 is somewhat problematic and we've a
confirmed bug that lives in many versions of GCC and it's not even fixed
in the current trunk. It's proven that using register constraints can
be a valid workaround to deal with this bug.

2022-03-23 13:50:18 UTC, Jakub Jelinek wrote:
> Anyway, with the "b" etc. constraints (which is a good idea to use on
> x86 when it has single register constraints for those but can't be used
> on other arches which do not have such constraints) you just trigger
> slightly different path in the RA, [...]
See the discussion here:
    
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105032#c7

^^^ That is only for syscall6() on i386.

As such, I will drop this patch and another one that does this on i386.

Thanks!
-- 
Ammar Faizi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ