Skip to content

Commit 1ca3dec

Browse files
legoatermpe
authored andcommitted
powerpc/xive: Prevent page fault issues in the machine crash handler
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: 243e251 ("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
1 parent 1db550f commit 1ca3dec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/powerpc/sysdev/xive/common.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,15 @@ static int xive_irq_alloc_data(unsigned int virq, irq_hw_number_t hw)
10351035
xd->target = XIVE_INVALID_TARGET;
10361036
irq_set_handler_data(virq, xd);
10371037

1038+
/*
1039+
* Turn OFF by default the interrupt being mapped. A side
1040+
* effect of this check is the mapping the ESB page of the
1041+
* interrupt in the Linux address space. This prevents page
1042+
* fault issues in the crash handler which masks all
1043+
* interrupts.
1044+
*/
1045+
xive_esb_read(xd, XIVE_ESB_SET_PQ_01);
1046+
10381047
return 0;
10391048
}
10401049

0 commit comments

Comments
 (0)