linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RFC] parisc: Use local tlb purges only on PA2.0 machines
@ 2022-09-25 18:57 Helge Deller
  2022-09-25 20:02 ` John David Anglin
  0 siblings, 1 reply; 7+ messages in thread
From: Helge Deller @ 2022-09-25 18:57 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin

Allow usage of CPU-local tlb purges in pacache.S on PA2.0 machines only.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 9a0018f1f42c..7c23fcb737a9 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -31,6 +31,12 @@
 	.section .text.hot
 	.align	16

+#ifdef CONFIG_PA20
+#define ALT_COND_PACACHE	ALT_COND_ALWAYS
+#else
+#define ALT_COND_PACACHE	ALT_COND_NO_SMP
+#endif
+
 ENTRY_CFI(flush_tlb_all_local)
 	/*
 	 * The pitlbe and pdtlbe instructions should only be used to
@@ -539,15 +545,10 @@ ENTRY_CFI(copy_user_page_asm)

 	/* Purge any old translations */

-#ifdef CONFIG_PA20
-	pdtlb,l		%r0(%r28)
-	pdtlb,l		%r0(%r29)
-#else
 0:	pdtlb		%r0(%r28)
 1:	pdtlb		%r0(%r29)
-	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
-	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SMP, INSN_PxTLB)
-#endif
+	ALTERNATIVE(0b, 0b+4, ALT_COND_PACACHE, INSN_PxTLB)
+	ALTERNATIVE(1b, 1b+4, ALT_COND_PACACHE, INSN_PxTLB)

 #ifdef CONFIG_64BIT
 	/* PA8x00 CPUs can consume 2 loads or 1 store per cycle.
@@ -670,12 +671,8 @@ ENTRY_CFI(clear_user_page_asm)

 	/* Purge any old translation */

-#ifdef CONFIG_PA20
-	pdtlb,l		%r0(%r28)
-#else
 0:	pdtlb		%r0(%r28)
-	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
-#endif
+	ALTERNATIVE(0b, 0b+4, ALT_COND_PACACHE, INSN_PxTLB)

 #ifdef CONFIG_64BIT
 	ldi		(PAGE_SIZE / 128), %r1
@@ -736,12 +733,8 @@ ENTRY_CFI(flush_dcache_page_asm)

 	/* Purge any old translation */

-#ifdef CONFIG_PA20
-	pdtlb,l		%r0(%r28)
-#else
 0:	pdtlb		%r0(%r28)
-	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
-#endif
+	ALTERNATIVE(0b, 0b+4, ALT_COND_PACACHE, INSN_PxTLB)

 88:	ldil		L%dcache_stride, %r1
 	ldw		R%dcache_stride(%r1), r31
@@ -785,12 +778,8 @@ ENTRY_CFI(purge_dcache_page_asm)

 	/* Purge any old translation */

-#ifdef CONFIG_PA20
-	pdtlb,l		%r0(%r28)
-#else
 0:	pdtlb		%r0(%r28)
-	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
-#endif
+	ALTERNATIVE(0b, 0b+4, ALT_COND_PACACHE, INSN_PxTLB)

 88:	ldil		L%dcache_stride, %r1
 	ldw		R%dcache_stride(%r1), r31
@@ -837,17 +826,11 @@ ENTRY_CFI(flush_icache_page_asm)
 	 * have a flat address space, it's not clear which TLB will be
 	 * used.  So, we purge both entries.  */

-#ifdef CONFIG_PA20
-	pdtlb,l		%r0(%r28)
-1:	pitlb,l         %r0(%sr4,%r28)
-	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SPLIT_TLB, INSN_NOP)
-#else
 0:	pdtlb		%r0(%r28)
 1:	pitlb           %r0(%sr4,%r28)
-	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
-	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SMP, INSN_PxTLB)
+	ALTERNATIVE(0b, 0b+4, ALT_COND_PACACHE, INSN_PxTLB)
+	ALTERNATIVE(1b, 1b+4, ALT_COND_PACACHE, INSN_PxTLB)
 	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SPLIT_TLB, INSN_NOP)
-#endif

 88:	ldil		L%icache_stride, %r1
 	ldw		R%icache_stride(%r1), %r31

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

end of thread, other threads:[~2022-09-28  9:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25 18:57 [PATCH][RFC] parisc: Use local tlb purges only on PA2.0 machines Helge Deller
2022-09-25 20:02 ` John David Anglin
2022-09-25 20:11   ` Helge Deller
2022-09-25 20:28     ` John David Anglin
2022-09-27 20:06       ` Helge Deller
2022-09-27 22:06         ` John David Anglin
2022-09-28  9:25           ` Helge Deller

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