Thread (35 messages) 35 messages, 5 authors, 2021-10-09

[PATCHv2 4/5] irqchip/GICv3: let gic_handle_irq() utilize irqentry on arm64

From: Pingfan Liu <hidden>
Date: 2021-09-24 13:33:20
Also in: lkml
Subsystem: arm generic interrupt controller drivers, arm64 port (aarch64 architecture), irqchip drivers, the rest · Maintainers: Marc Zyngier, Catalin Marinas, Will Deacon, Thomas Gleixner, Linus Torvalds

The call to rcu_irq_enter() originated from gic_handle_irq() is
redundant now, since arm64 has enter_from_kernel_mode() akin to
irqenter_entry(), which has already called rcu_irq_enter().

Based on code analysis, the redundant can raise some mistake, e.g.
rcu_data->dynticks_nmi_nesting inc 2, which causes
rcu_is_cpu_rrupt_from_idle() unexpected.

So eliminate the call to irq_enter() in handle_domain_irq(). And
accordingly supplementing irq_enter_rcu().

Signed-off-by: Pingfan Liu <redacted>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Julien Thierry <redacted>
Cc: Thomas Gleixner <redacted>
Cc: Yuichi Ito <redacted>
Cc: linux-kernel@vger.kernel.org
To: linux-arm-kernel@lists.infradead.org
---
 arch/arm64/Kconfig           | 1 +
 drivers/irqchip/irq-gic-v3.c | 2 ++
 2 files changed, 3 insertions(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 5c7ae4c3954b..d29bae38a951 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -98,6 +98,7 @@ config ARM64
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
 	select ARM_AMBA
 	select ARM_ARCH_TIMER
+	select HAVE_ARCH_IRQENTRY
 	select ARM_GIC
 	select AUDIT_ARCH_COMPAT_GENERIC
 	select ARM_GIC_V2M if PCI
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 89dcec902a82..906538fa8771 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -729,10 +729,12 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
 	else
 		isb();
 
+	irq_enter_rcu();
 	if (handle_domain_irq(gic_data.domain, irqnr, regs)) {
 		WARN_ONCE(true, "Unexpected interrupt received!\n");
 		gic_deactivate_unhandled(irqnr);
 	}
+	irq_exit_rcu();
 }
 
 static u32 gic_get_pribits(void)
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help