Module Name:    src
Committed By:   thorpej
Date:           Fri Jul 16 19:02:22 UTC 2021

Modified Files:
        src/sys/arch/alpha/alpha: interrupt.c pmap.c
        src/sys/arch/alpha/include: intr.h

Log Message:
The Alpha AXP Architecture Reference Manual is explcit that the only
valid bits in the PSL are the IPL and USER bits, the latter of which
will always be clear when in the kernel, and that all other bits MBZ.
So, when reading the PSL to get the current IPL, don't bother masking
with ALPHA_PSL_IPL_MASK.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/alpha/alpha/interrupt.c
cvs rdiff -u -r1.297 -r1.298 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/alpha/include/intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/alpha/interrupt.c
diff -u src/sys/arch/alpha/alpha/interrupt.c:1.98 src/sys/arch/alpha/alpha/interrupt.c:1.99
--- src/sys/arch/alpha/alpha/interrupt.c:1.98	Sun Jul  4 22:42:35 2021
+++ src/sys/arch/alpha/alpha/interrupt.c	Fri Jul 16 19:02:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.98 2021/07/04 22:42:35 thorpej Exp $ */
+/* $NetBSD: interrupt.c,v 1.99 2021/07/16 19:02:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.98 2021/07/04 22:42:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.99 2021/07/16 19:02:22 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -502,7 +502,7 @@ void
 softint_trigger(uintptr_t const machdep)
 {
 	/* No need for an atomic; called at splhigh(). */
-	KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) == ALPHA_PSL_IPL_HIGH);
+	KASSERT(alpha_pal_rdps() == ALPHA_PSL_IPL_HIGH);
 	curcpu()->ci_ssir |= machdep;
 }
 
@@ -534,8 +534,7 @@ softint_init_md(lwp_t * const l, u_int c
 		ci->ci_ssir &= ~SOFTINT_##level##_MASK;			\
 		alpha_softint_switchto(l, IPL_SOFT##level,		\
 		    ci->ci_silwps[SOFTINT_##level]);			\
-		KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) ==	\
-		    ALPHA_PSL_IPL_HIGH);				\
+		KASSERT(alpha_pal_rdps() == ALPHA_PSL_IPL_HIGH);	\
 		continue;						\
 	}								\
 
@@ -553,7 +552,7 @@ alpha_softint_dispatch(int const ipl)
 	unsigned long ssir;
 	const unsigned long eligible = SOFTINTS_ELIGIBLE(ipl);
 
-	KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) == ALPHA_PSL_IPL_HIGH);
+	KASSERT(alpha_pal_rdps() == ALPHA_PSL_IPL_HIGH);
 
 	for (;;) {
 		ssir = ci->ci_ssir & eligible;

Index: src/sys/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.297 src/sys/arch/alpha/alpha/pmap.c:1.298
--- src/sys/arch/alpha/alpha/pmap.c:1.297	Sat Jul 10 20:22:37 2021
+++ src/sys/arch/alpha/alpha/pmap.c	Fri Jul 16 19:02:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.297 2021/07/10 20:22:37 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.298 2021/07/16 19:02:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.297 2021/07/10 20:22:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.298 2021/07/16 19:02:22 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1027,7 +1027,7 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 	 * interrupts and disable preemption.  It is critically important
 	 * that IPIs not be blocked in this routine.
 	 */
-	KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) < ALPHA_PSL_IPL_CLOCK);
+	KASSERT(alpha_pal_rdps() < ALPHA_PSL_IPL_CLOCK);
 	mutex_spin_enter(&tlb_lock);
 	tlb_evcnt.ev_count++;
 
@@ -1121,7 +1121,7 @@ pmap_tlb_shootnow(const struct pmap_tlb_
 				    tlb_pending);
 				printf("TLB CONTEXT = %p\n", tlb_context);
 				printf("TLB LOCAL IPL = %lu\n",
-				    alpha_pal_rdps() & ALPHA_PSL_IPL_MASK);
+				    alpha_pal_rdps());
 				panic("pmap_tlb_shootnow");
 			}
 		}

Index: src/sys/arch/alpha/include/intr.h
diff -u src/sys/arch/alpha/include/intr.h:1.84 src/sys/arch/alpha/include/intr.h:1.85
--- src/sys/arch/alpha/include/intr.h:1.84	Sun Jul  4 22:36:43 2021
+++ src/sys/arch/alpha/include/intr.h	Fri Jul 16 19:02:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.84 2021/07/04 22:36:43 thorpej Exp $ */
+/* $NetBSD: intr.h,v 1.85 2021/07/16 19:02:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -157,7 +157,7 @@ void	spllower(int);
 static __inline int
 _splraise(int s)
 {
-	int cur = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK;
+	int cur = (int)alpha_pal_rdps();
 	return (s > cur ? (int)alpha_pal_swpipl(s) : cur);
 }
 

Reply via email to