[PATCH v2] powerpc/xmon: Wait for secondaries before IPI'ing on system reset
Nicholas Piggin
npiggin at gmail.com
Mon May 1 12:03:00 AEST 2017
On Sun, 30 Apr 2017 22:27:58 +1000
Anton Blanchard <anton at samba.org> wrote:
> Hi Nick,
>
> > An externally triggered system reset (e.g., via QEMU nmi command, or
> > pseries reset button) can cause system reset interrupts on all CPUs.
> > In case this causes xmon to be entered, it is undesirable for the
> > primary (first) CPU into xmon to trigger an NMI IPI to others,
> > because this may cause a nested system reset interrupt.
> >
> > So spin for a time waiting for secondaries to join xmon before
> > performing the NMI IPI, similarly to what the crash dump code does.
>
> That reminds me of similar delays in our crash path:
>
> /*
> * The primary CPU waits a while for all secondary CPUs to enter. This is to
> * avoid sending an IPI if the secondary CPUs are entering
> * crash_kexec_secondary on their own (eg via a system reset).
> *
> * The secondary timeout has to be longer than the primary. Both timeouts are
> * in milliseconds.
> */
> #define PRIMARY_TIMEOUT 500
> #define SECONDARY_TIMEOUT 1000
>
> ...
>
> /*
> * If we came in via system reset, wait a while for the secondary
> * CPUs to enter.
> */
> if (TRAP(regs) == 0x100)
> mdelay(PRIMARY_TIMEOUT);
>
> We might want to consolidate the juggling we do. Not sure if many people use
> it, but kdb and kgdb may benefit if we make it common.
Good point, yes we definitely should consolidate these. I had a few misc patches
that were supposed to improve the crash paths to go after the NMI stacks and
IPIs series. I'll look at consolidating some of this timeout logic there, if
nobody beats me to it. Thanks.
More information about the Linuxppc-dev
mailing list