[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190809220301.Horde.AR6y4Bx4WGIq58V9K0En9g4@messagerie.si.c-s.fr>
Date: Fri, 09 Aug 2019 22:03:01 +0200
From: Christophe Leroy <christophe.leroy@....fr>
To: Arnd Bergmann <arnd@...db.de>
Cc: clang-built-linux <clang-built-linux@...glegroups.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Paul Mackerras <paulus@...ba.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
kbuild test robot <lkp@...el.com>,
Nathan Chancellor <natechancellor@...il.com>,
Segher Boessenkool <segher@...nel.crashing.org>,
Michael Ellerman <mpe@...erman.id.au>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH] powerpc: fix inline asm constraints for dcbz
Arnd Bergmann <arnd@...db.de> a écrit :
> On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built
> Linux <clang-built-linux@...glegroups.com> wrote:
>
>> static inline void dcbz(void *addr)
>> {
>> - __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory");
>> + __asm__ __volatile__ ("dcbz %y0" : "=Z"(*(u8 *)addr) :: "memory");
>> }
>>
>> static inline void dcbi(void *addr)
>> {
>> - __asm__ __volatile__ ("dcbi %y0" : : "Z"(*(u8 *)addr) : "memory");
>> + __asm__ __volatile__ ("dcbi %y0" : "=Z"(*(u8 *)addr) :: "memory");
>> }
>
> I think the result of the discussion was that an output argument only kind-of
> makes sense for dcbz, but for the others it's really an input, and clang is
> wrong in the way it handles the "Z" constraint by making a copy, which it
> doesn't do for "m".
>
> I'm not sure whether it's correct to use "m" instead of "Z" here, which
> would be a better workaround if that works. More importantly though,
> clang really needs to be fixed to handle "Z" correctly.
As the benefit is null, I think the best is probably to reverse my
original commit until at least CLang is fixed, as initialy suggested
by mpe
Christophe
Powered by blists - more mailing lists