Mask off IPL flags before storing the IPL for an interrupt.
authorjmatthew <jmatthew@openbsd.org>
Sun, 5 Mar 2023 04:30:08 +0000 (04:30 +0000)
committerjmatthew <jmatthew@openbsd.org>
Sun, 5 Mar 2023 04:30:08 +0000 (04:30 +0000)
This fixes the IPL calculations in mpic_calc_mask() in the presence
of IPL_MPSAFE interrupts such as mvneta(4).

ok patrick@ kettenis@ dlg@

sys/arch/armv7/marvell/mvmpic.c

index 194d47f..11d05bf 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: mvmpic.c,v 1.5 2021/10/24 17:52:27 mpi Exp $ */
+/* $OpenBSD: mvmpic.c,v 1.6 2023/03/05 04:30:08 jmatthew Exp $ */
 /*
  * Copyright (c) 2007,2009,2011 Dale Rahn <drahn@openbsd.org>
  * Copyright (c) 2015 Patrick Wildt <patrick@blueri.se>
@@ -257,7 +257,7 @@ mpic_intr_establish(void *cookie, int *cells, int level,
        ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
        ih->ih_func = func;
        ih->ih_arg = arg;
-       ih->ih_ipl = level;
+       ih->ih_ipl = level & IPL_IRQMASK;
        ih->ih_irq = irqno;
        ih->ih_name = name;
        ih->ih_sc = sc;