
From: Wei Li <liwei391@huawei.com> hulk inclusion category: bugfix bugzilla: 28145 CVE: NA ------------------------------------------------- The nmi_enter() may has been called in el1_irq. When processing IPI_CPU_CRASH_STOP in handle_IPI(), don't call nmi_enter() again if interrupt is disabled (already in NMI context). Fixes: e753aae7e448 ("arm64: Fix interrupt tracing in the presence of NMIs") Signed-off-by: Wei Li <liwei391@huawei.com> Reviewed-by: Hanjun Guo <guohanjun@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- arch/arm64/kernel/smp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 50c98ab..b13a2d2 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -924,9 +924,10 @@ void handle_IPI(int ipinr, struct pt_regs *regs) case IPI_CPU_CRASH_STOP: if (IS_ENABLED(CONFIG_KEXEC_CORE)) { - if (gic_supports_pseudo_nmis()) - nmi_enter(); - else + if (gic_supports_pseudo_nmis()) { + if (irqs_enabled) + nmi_enter(); + } else irq_enter(); ipi_cpu_crash_stop(cpu, regs); -- 1.8.3