linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/8xx: Reverse order entries are written by __set_pte_at()
@ 2022-09-28  6:29 Christophe Leroy
  2022-11-30  9:23 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Leroy @ 2022-09-28  6:29 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin; +Cc: linuxppc-dev, linux-kernel

At the time being, with 16k pages __set_pte_at() writes table entries
in reverse order:

 294:	91 49 00 0c 	stw     r10,12(r9)
 298:	91 49 00 08 	stw     r10,8(r9)
 29c:	91 49 00 04 	stw     r10,4(r9)
 2a0:	91 49 00 00 	stw     r10,0(r9)

Allthough there should be no impact at all as it stays in a single
cacheline, reverse the writing in a more natural order.

 288:	91 49 00 0c 	stw     r10,0(r9)
 28c:	91 49 00 08 	stw     r10,4(r9)
 290:	91 49 00 04 	stw     r10,8(r9)
 294:	91 49 00 00 	stw     r10,12(r9)

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/include/asm/nohash/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/nohash/pgtable.h b/arch/powerpc/include/asm/nohash/pgtable.h
index 4fd73c7412d0..d2e39823af09 100644
--- a/arch/powerpc/include/asm/nohash/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/pgtable.h
@@ -183,7 +183,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
 	 * cases, and 32-bit non-hash with 32-bit PTEs.
 	 */
 #if defined(CONFIG_PPC_8xx) && defined(CONFIG_PPC_16K_PAGES)
-	ptep->pte = ptep->pte1 = ptep->pte2 = ptep->pte3 = pte_val(pte);
+	ptep->pte3 = ptep->pte2 = ptep->pte1 = ptep->pte = pte_val(pte);
 #else
 	*ptep = pte;
 #endif
-- 
2.37.1


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

* Re: [PATCH] powerpc/8xx: Reverse order entries are written by __set_pte_at()
  2022-09-28  6:29 [PATCH] powerpc/8xx: Reverse order entries are written by __set_pte_at() Christophe Leroy
@ 2022-11-30  9:23 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-11-30  9:23 UTC (permalink / raw)
  To: Nicholas Piggin, Christophe Leroy, Michael Ellerman
  Cc: linuxppc-dev, linux-kernel

On Wed, 28 Sep 2022 08:29:22 +0200, Christophe Leroy wrote:
> At the time being, with 16k pages __set_pte_at() writes table entries
> in reverse order:
> 
>  294:	91 49 00 0c 	stw     r10,12(r9)
>  298:	91 49 00 08 	stw     r10,8(r9)
>  29c:	91 49 00 04 	stw     r10,4(r9)
>  2a0:	91 49 00 00 	stw     r10,0(r9)
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/8xx: Reverse order entries are written by __set_pte_at()
      https://git.kernel.org/powerpc/c/0b4721815c5328e08c3acdee4a53890e012d830b

cheers

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

end of thread, other threads:[~2022-11-30  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  6:29 [PATCH] powerpc/8xx: Reverse order entries are written by __set_pte_at() Christophe Leroy
2022-11-30  9:23 ` Michael Ellerman

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).