Thread (27 messages) 27 messages, 6 authors, 2019-08-10

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

flat view

From: Segher Boessenkool <hidden>
Date: 2019-08-09 22:11:28
Also in: lkml

On Fri, Aug 09, 2019 at 10:12:56PM +0200, Arnd Bergmann wrote:
quoted hunk ↗ jump to hunk
@@ -106,7 +106,7 @@ static inline u##size name(const volatile u##size
__iomem *addr)    \
 {                                                                      \
        u##size ret;                                                    \
        __asm__ __volatile__("sync;"#insn" %0,%y1;twi 0,%0,0;isync"     \
-               : "=r" (ret) : "Z" (*addr) : "memory");                 \
+               : "=r" (ret) : "m" (*addr) : "memory");                 \
        return ret;                                                     \
 }
That will no longer compile something like
  u8 *p;
  u16 x = in_le16(p + 12);
(you'll get something like "invalid %y value, try using the 'Z' constraint").

So then you remove the %y, but that makes you get something like
  sync;lhbrx 3,12(3);twi 0,3,0;isync
which is completely wrong.


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help