@@ -330,4 +330,17 @@ static inline void local_errnmi_enable(void)
irqflags.fields.allint = 0;
local_allint_restore(irqflags);
}
+
+/*
+ * local_nmi_enable - Enable NMI with or without superpriority.
+ */
+static inline void local_nmi_enable(void)
+{
+ arch_irqflags_t irqflags;
+
+ irqflags.fields.daif = read_sysreg(daif);
+ irqflags.fields.pmr = GIC_PRIO_IRQOFF;
+ irqflags.fields.allint = 0;
+ local_allint_restore(irqflags);
+}
#endif
@@ -33,6 +33,7 @@
#include <asm/exception.h>
#include <asm/smp_plat.h>
#include <asm/virt.h>
+#include <asm/daifflags.h>
#include "irq-gic-common.h"
@@ -813,10 +814,7 @@ static void __gic_handle_irq_from_irqson(struct pt_regs *regs)
nmi_exit();
}
- if (gic_prio_masking_enabled()) {
- gic_pmr_mask_irqs();
- gic_arch_enable_irqs();
- }
+ local_nmi_enable();
if (!is_nmi)
__gic_handle_irq(irqnr, regs);
It has a better maintainability to use the local_nmi_enable() in GIC driver to unmask NMI and keep regular IRQ and FIQ maskable, instead of writing raw value into DAIF, PMR and ALLINT directly. Signed-off-by: Liao Chang <liaochang1@huawei.com> --- arch/arm64/include/asm/daifflags.h | 13 +++++++++++++ drivers/irqchip/irq-gic-v3.c | 6 ++---- 2 files changed, 15 insertions(+), 4 deletions(-)