From 21440a9cd9bea4d8d2c41064cc9d9a06e30e4d96 Mon Sep 17 00:00:00 2001 From: Xiongfeng Wang Date: Wed, 17 Apr 2019 21:16:13 +0800 Subject: [PATCH] arm64: kexec: only clear EOI for SDEI in NMI context euler inclusion category: bugfix Bugzilla: 12567 CVE: N/A ---------------------------------------- We need to clear EOI for the secure timer only when we panic from sdei_handler. If we clear EOI for the secure timer in normal panic routiue, it has no bad effect on Hi1620, but it may cause undefine behavior on Hi1616. So add a check for NMI context before we clear EOI for the secure timer. Fixes: dd397d5febc4("sdei_watchdog: clear EOI of the secure timer before kdump") Signed-off-by: Xiongfeng Wang Reviewed-by: Wei Li Signed-off-by: Yang Yingliang --- arch/arm64/kernel/machine_kexec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 3c0e9383d7e0..e3b427446d2b 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -268,7 +268,8 @@ void machine_crash_shutdown(struct pt_regs *regs) * interrupt failed to trigger in the second kernel. So we clear eoi * of the secure timer before booting the second kernel. */ - sdei_watchdog_clear_eoi(); + if (in_nmi()) + sdei_watchdog_clear_eoi(); /* for crashing cpu */ crash_save_cpu(regs, smp_processor_id()); -- GitLab