Index: sys/arm64/arm64/gic_v3.c =================================================================== --- sys/arm64/arm64/gic_v3.c +++ sys/arm64/arm64/gic_v3.c @@ -48,6 +48,7 @@ #include #include +#include #include #include "pic_if.h" @@ -230,7 +231,20 @@ uint64_t active_irq; while (1) { + if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, + CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0)) { + /* THUNDERX: ERRATUM 22978 */ + __asm __volatile("nop;nop;nop;nop;"); + __asm __volatile("nop;nop;nop;nop;"); active_irq = gic_icc_read(IAR1); + /* THUNDERX: ERRATUM 23154 */ + __asm __volatile("nop;nop;nop;nop;"); + /* !23154 */ + __asm __volatile("dsb sy;"); + /* !22978 */ + } else { + active_irq = gic_icc_read(IAR1); + } if (__predict_false(active_irq == ICC_IAR1_EL1_SPUR)) break;