aboutsummaryrefslogtreecommitdiff
path: root/drivers/irqchip/irq-gic-v3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/irqchip/irq-gic-v3.c')
-rw-r--r--drivers/irqchip/irq-gic-v3.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 8d3d53f25768..7e9dc1c39f1f 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -377,7 +377,10 @@ static bool gic_handle_nmi(struct pt_regs *regs)
u64 irqnr;
struct pt_regs *old_regs;
- asm volatile("mrs_s %0, " __stringify(ICC_IAR1_EL1) : "=r"(irqnr));
+ asm volatile(ALTERNATIVE(
+ "mov %0, #1023",
+ "mrs_s %0, " __stringify(ICC_IAR1_EL1),
+ ARM64_HAS_SYSREG_GIC_CPUIF) : "=r"(irqnr));
/*
* If no IRQ is acknowledged at this point then we have entered the
@@ -385,7 +388,10 @@ static bool gic_handle_nmi(struct pt_regs *regs)
* If so then unmask the I-bit and return to normal handling.
*/
if (irqnr == ICC_IAR1_EL1_SPURIOUS) {
- asm volatile("msr daifclr, #2" : : : "memory");
+ asm volatile(ALTERNATIVE(
+ "nop",
+ "msr daifclr, #2",
+ ARM64_HAS_SYSREG_GIC_CPUIF) : : : "memory");
return false;
}
@@ -555,6 +561,15 @@ static void gic_cpu_sys_reg_init(void)
#ifndef CONFIG_USE_ICC_SYSREGS_FOR_IRQFLAGS
/* Set priority mask register */
gic_write_pmr(DEFAULT_PMR_VALUE);
+#else
+{
+ unsigned long pmr = DEFAULT_PMR_VALUE;
+
+ asm volatile(ALTERNATIVE(
+ "msr_s " __stringify(ICC_PMR_EL1) ", %0",
+ "nop",
+ ARM64_HAS_SYSREG_GIC_CPUIF) : : "r" (pmr));
+}
#endif
/*