From aeab0140432459d9bc3bcac6a69d19d10024d166 Mon Sep 17 00:00:00 2001
From: Wei Li <liwei391@huawei.com>
Date: Sat, 23 Mar 2019 16:30:15 +0800
Subject: [PATCH] irqchip/gic-v3: fix system hang caused by ftrace

hulk inclusion
category: bugfix
bugzilla: 12844
CVE: NA

-------------------------------------------------

When gicv3_pseudo_nmi is enabled, the system will hang when excuting
"echo function_graph > /sys/kernel/debug/tracing/current_tracer".
In the gic_handle_irq(), function gic_read_iar() always return 1023 after
ftrace_caller() is called. The root reason leading to this is not located.
Set the function gic_handle_irq() as "notrace" to workaround this issue.

Signed-off-by: Wei Li <liwei391@huawei.com>
Reviewed-by: Cheng Jian <cj.chengjian@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/irqchip/irq-gic-v3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 700a59a67bba..a3e7981ee365 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -491,7 +491,8 @@ static inline void gic_handle_nmi(u32 irqnr, struct pt_regs *regs)
 		gic_deactivate_unhandled(irqnr);
 }
 
-static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
+static asmlinkage void __exception_irq_entry notrace
+gic_handle_irq(struct pt_regs *regs)
 {
 	u32 irqnr;
 
-- 
GitLab