Skip to contentSkip to conversation

parisc: Fix itlb miss handler for 64-bit programs

PATCH New [email protected] 1 participant 2 messages Sep 10, 2024 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 parisc: Fix itlb miss handler for 64-bit programs

From: Helge Deller <[email protected]>

For an itlb miss when executing code above 4 Gb on ILP64 adjust the iasq/iaoq in the same way isr/ior was adjusted. This fixes signal delivery for the 64-bit static test program from
http://ftp.parisc-linux.org/src/64bit.tar.gz. Note that signals are handled by the signal trampoline code in the 64-bit VDSO which is mapped into high userspace memory region above 4GB for 64-bit processes.

---
 arch/parisc/kernel/entry.S | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/parisc/kernel/entry.S +2 -3
index ab23e61a6f01..838c27f93302 100644
@@ -1051,8 +1051,7 @@ ENTRY_CFI(intr_save)		/* for os_hpmc */
 	STREG           %r16, PT_ISR(%r29)
 	STREG           %r17, PT_IOR(%r29)
 
-#if 0 && defined(CONFIG_64BIT)
-	/* Revisit when we have 64-bit code above 4Gb */
+#if defined(CONFIG_64BIT)
 	b,n		intr_save2
 
 skip_save_ior:
@@ -1061,7 +1060,7 @@ skip_save_ior:
 	 * above.
 	 */
 	extrd,u,*	%r8,PSW_W_BIT,1,%r1
-	cmpib,COND(=),n	1,%r1,intr_save2
+	cmpib,COND(=),n	0,%r1,intr_save2
 	LDREG		PT_IASQ0(%r29), %r16
 	LDREG		PT_IAOQ0(%r29), %r17
 	/* adjust iasq/iaoq */
Signature · 1 line
2.46.0
#1 lore raw

PATCH 2/2 parisc: Use PRIV_USER instead of hardcoded value

From: Helge Deller <[email protected]>

---
 arch/parisc/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/traps.c +1 -1
index 1107ca819ac8..294b0e026c9a 100644
@@ -504,7 +504,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
 	if (((unsigned long)regs->iaoq[0] & 3) &&
 	    ((unsigned long)regs->iasq[0] != (unsigned long)regs->sr[7])) { 
 		/* Kill the user process later */
-		regs->iaoq[0] = 0 | 3;
+		regs->iaoq[0] = 0 | PRIV_USER;
 		regs->iaoq[1] = regs->iaoq[0] + 4;
 		regs->iasq[0] = regs->iasq[1] = regs->sr[7];
 		regs->gr[0] &= ~PSW_B;
Signature · 1 line
2.46.0