From: Yingliang Yang yangyingliang@huawei.com
hulk inclusion category: bugfix bugzilla: 46864 CVE: NA
-------------------------------------------------
The kexec will boot a captured kernel while the kernel panic. But it boots failed if the kernel panic in handler function of PPI. The reason is that the PPI has not been 'eoi', other interrupts can not be handled when booting the captured kernel. This patch fix this bug.
signed-off-by: Yingliang Yang yangyingliang@huawei.com Signed-off-by: Yufen Wang wangyufen@huawei.com Signed-off-by: Hanjun Guo hanjun.guo@linaro.org Signed-off-by: Chen Zhou chenzhou10@huawei.com --- arch/arm64/kernel/machine_kexec.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index a0b144cfaea7..b4a9d3697f3c 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -226,6 +226,22 @@ static void machine_kexec_mask_interrupts(void) if (!chip) continue;
+ /* + * Hisilicon Chips special handle for PPI interruts, should be no + * side effect for other chips + */ + if (desc->irq_data.hwirq > 15 && desc->irq_data.hwirq < 32) { + bool active = false; + + ret = irq_get_irqchip_state(i, IRQCHIP_STATE_ACTIVE, &active); + if (ret) { + pr_debug("Get irq active state failed.\n"); + } else { + if (active) + chip->irq_eoi(&desc->irq_data); + } + } + /* * First try to remove the active state. If this * fails, try to EOI the interrupt.