From: linruizhe linruizhe@huawei.com
Dependencies: CONFIG_DETECT_HUNG_TASK=y CONFIG_WATCHDOG=y
Commandline Params: gic-version=3 irqchip.gicv3_pseudo_nmi=1 kgdboc=ttyAMA0,115200
Chen Jiahao (1): arm64: Fix the ipi backtrace warning when softlockup
arch/arm64/kernel/ipi_nmi.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
Li Zhengyu (1): arm64: Add non nmi ipi backtrace support
arch/arm64/kernel/ipi_nmi.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-)
From: Li Zhengyu lizhengyu3@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8PRY6 CVE: NA
--------------------------------
Use non nmi ipi to support backtrace on arm64 with nmi unsupported. It has been tested on qemu.
Signed-off-by: Li Zhengyu lizhengyu3@huawei.com Reviewed-by: Liao Chang liaochang1@huawei.com Reviewed-by: Wei Li liwei391@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Signed-off-by: linruizhe linruizhe@huawei.com --- arch/arm64/kernel/ipi_nmi.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/ipi_nmi.c b/arch/arm64/kernel/ipi_nmi.c index 9249e8b100aa..e76af4095117 100644 --- a/arch/arm64/kernel/ipi_nmi.c +++ b/arch/arm64/kernel/ipi_nmi.c @@ -33,12 +33,39 @@ void arm64_send_nmi(cpumask_t *mask) __ipi_send_mask(ipi_nmi_desc, mask); }
+static void ipi_cpu_backtrace(void *info) +{ + __printk_safe_enter(); + nmi_cpu_backtrace(get_irq_regs()); + __printk_safe_exit(); +} + +static DEFINE_PER_CPU(call_single_data_t, cpu_backtrace_csd) = + CSD_INIT(ipi_cpu_backtrace, NULL); + +static void arm64_send_ipi(cpumask_t *mask) +{ + call_single_data_t *csd; + int this_cpu = raw_smp_processor_id(); + int cpu; + int ret; + + for_each_online_cpu(cpu) { + if (cpu == this_cpu) + continue; + csd = &per_cpu(cpu_backtrace_csd, cpu); + ret = smp_call_function_single_async(cpu, csd); + if (ret) + pr_info("Sending IPI failed to CPU %d\n", cpu); + } +} + bool arch_trigger_cpumask_backtrace(const cpumask_t *mask, int exclude_cpu) { if (!ipi_nmi_desc) - return false; - - nmi_trigger_cpumask_backtrace(mask, exclude_cpu, arm64_send_nmi); + nmi_trigger_cpumask_backtrace(mask, exclude_cpu, arm64_send_ipi); + else + nmi_trigger_cpumask_backtrace(mask, exclude_cpu, arm64_send_nmi);
return true; }
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3731 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/6...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3731 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/6...