powerpc/xive: Prevent page fault issues in the machine crash handler
authorCédric Le Goater <clg@kaod.org>
Thu, 31 Oct 2019 06:31:00 +0000 (07:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:35:15 +0000 (20:35 +0100)
commit87682db0a14ae3c11528af61136cd9904923953f
tree57f54fbb4066ffd87c61ef59b5c87c216ac2737f
parente0dd31b9e5f4d1ff5edc36f12c52d1b997004fc4
powerpc/xive: Prevent page fault issues in the machine crash handler

commit 1ca3dec2b2dff9d286ce6cd64108bda0e98f9710 upstream.

When the machine crash handler is invoked, all interrupts are masked
but interrupts which have not been started yet do not have an ESB page
mapped in the Linux address space. This crashes the 'crash kexec'
sequence on sPAPR guests.

To fix, force the mapping of the ESB page when an interrupt is being
mapped in the Linux IRQ number space. This is done by setting the
initial state of the interrupt to OFF which is not necessarily the
case on PowerNV.

Fixes: 243e25112d06 ("powerpc/xive: Native exploitation of the XIVE interrupt controller")
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191031063100.3864-1-clg@kaod.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/sysdev/xive/common.c