From 1a3c051aca98d2abf29b7ad7dc803e1a4bd31441 Mon Sep 17 00:00:00 2001 From: jhibbits Date: Sat, 6 Oct 2018 18:51:49 +0000 Subject: [PATCH] powerpc/pseries: EOI interrupts in XICS by setting lowest priority Discussing with Benjamin Herrenschmidt, OPAL_INT_GET_XIRR masks the returned priority, so must be resumed before more interrupts can be handled at this priority. Since there are only two priorities used in FreeBSD, we know that the previous priority in an EOI will always be 0xff (lowest priority). Reviewed by: nwhitehorn Approved by: re(rgrimes) Differential Revision: https://reviews.freebsd.org/D17361 --- sys/powerpc/pseries/xics.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/powerpc/pseries/xics.c b/sys/powerpc/pseries/xics.c index 802f0e8e4b6a..f8d24854fe80 100644 --- a/sys/powerpc/pseries/xics.c +++ b/sys/powerpc/pseries/xics.c @@ -381,17 +381,9 @@ xicp_dispatch(device_t dev, struct trapframe *tf) } xirr &= 0x00ffffff; - if (xirr == 0) { /* No more pending interrupts? */ - if (regs) - bus_write_1(regs, 4, 0xff); -#ifdef POWERNV - else if (sc->xics_emu) - opal_call(OPAL_INT_SET_CPPR, 0xff); -#endif - else - phyp_hcall(H_CPPR, (uint64_t)0xff); + if (xirr == 0) /* No more pending interrupts? */ break; - } + if (xirr == XICP_IPI) { /* Magic number for IPIs */ xirr = MAX_XICP_IRQS; /* Map to FreeBSD magic */ @@ -471,7 +463,7 @@ xicp_eoi(device_t dev, u_int irq) if (irq == MAX_XICP_IRQS) /* Remap IPI interrupt to internal value */ irq = XICP_IPI; - xirr = irq | (XICP_PRIORITY << 24); + xirr = irq | (0xff << 24); #ifdef POWERNV if (mfmsr() & PSL_HV) {