linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* powerpc: Incorrect stw operand modifier in __set_pte_at
@ 2020-07-08 14:45 Mathieu Desnoyers
  2020-07-08 16:16 ` Christophe Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Desnoyers @ 2020-07-08 14:45 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras; +Cc: linuxppc-dev

Hi,

Reviewing use of the patterns "Un%Xn" with lwz and stw instructions
(where n should be the operand number) within the Linux kernel led
me to spot those 2 weird cases:

arch/powerpc/include/asm/nohash/pgtable.h:__set_pte_at()

                __asm__ __volatile__("\
                        stw%U0%X0 %2,%0\n\
                        eieio\n\
                        stw%U0%X0 %L2,%1"
                : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
                : "r" (pte) : "memory");

I would have expected the stw to be:

                        stw%U1%X1 %L2,%1"

and:
arch/powerpc/include/asm/book3s/32/pgtable.h:__set_pte_at()

        __asm__ __volatile__("\
                stw%U0%X0 %2,%0\n\
                eieio\n\
                stw%U0%X0 %L2,%1"
        : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
        : "r" (pte) : "memory");

where I would have expected:

                stw%U1%X1 %L2,%1"

Is it a bug or am I missing something ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-09  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-08 14:45 powerpc: Incorrect stw operand modifier in __set_pte_at Mathieu Desnoyers
2020-07-08 16:16 ` Christophe Leroy
2020-07-09  0:30   ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).