[PATCH] powerpc/xive: Prevent page fault issues in the machine crash handler

Michael Ellerman mpe at ellerman.id.au
Tue Nov 12 23:44:24 AEDT 2019


Cédric Le Goater <clg at kaod.org> writes:
> 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.

This sounds like it needs a Fixes/stable tag?

I used these:

  Fixes: 243e25112d06 ("powerpc/xive: Native exploitation of the XIVE interrupt controller")
  Cc: stable at vger.kernel.org # v4.12+

Please tell me if you think that's wrong.

cheers


> diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
> index df832b09e3e9..f5fadbd2533a 100644
> --- a/arch/powerpc/sysdev/xive/common.c
> +++ b/arch/powerpc/sysdev/xive/common.c
> @@ -1035,6 +1035,15 @@ static int xive_irq_alloc_data(unsigned int virq, irq_hw_number_t hw)
>  	xd->target = XIVE_INVALID_TARGET;
>  	irq_set_handler_data(virq, xd);
>  
> +	/*
> +	 * Turn OFF by default the interrupt being mapped. A side
> +	 * effect of this check is the mapping the ESB page of the
> +	 * interrupt in the Linux address space. This prevents page
> +	 * fault issues in the crash handler which masks all
> +	 * interrupts.
> +	 */
> +	xive_esb_read(xd, XIVE_ESB_SET_PQ_01);
> +
>  	return 0;
>  }
>  
> -- 
> 2.21.0


More information about the Linuxppc-dev mailing list