RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-12-02 Thread 河合英宏 / KAWAI,HIDEHIRO
> @@ -357,7 +358,15 @@ static void default_do_nmi(struct pt_regs *regs) > } > > /* Non-CPU-specific NMI: NMI sources can be processed on any CPU */ > - raw_spin_lock(_reason_lock); > + > + /* > + * Another CPU may be processing panic routines with holding > + *

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-12-02 Thread 河合英宏 / KAWAI,HIDEHIRO
> @@ -357,7 +358,15 @@ static void default_do_nmi(struct pt_regs *regs) > } > > /* Non-CPU-specific NMI: NMI sources can be processed on any CPU */ > - raw_spin_lock(_reason_lock); > + > + /* > + * Another CPU may be processing panic routines with holding > + *

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Wed, Nov 25, 2015 at 09:46:37AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: ... > > I prefer this, but we might want to add some more prefix or suffix. > > For example, "conditionally_run_crash_nmi_callback". > > That's unnecessary IMO. If you need to express that, you could write > that in a

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread Borislav Petkov
On Wed, Nov 25, 2015 at 09:46:37AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > Does *old* code mean the code without this patch *series* ? Yes. > I prefer this, but we might want to add some more prefix or suffix. > For example, "conditionally_run_crash_nmi_callback". That's unnecessary IMO. If you

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Wed, Nov 25, 2015 at 05:51:59AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > > `Infinite loop in NMI context' can happen: > > > > > > > > a. when a cpu panics on NMI while another cpu is processing panic > > > > b. when a cpu received an external or unknown NMI while another > > > > cpu

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread Borislav Petkov
On Wed, Nov 25, 2015 at 05:51:59AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > `Infinite loop in NMI context' can happen: > > > > > > a. when a cpu panics on NMI while another cpu is processing panic > > > b. when a cpu received an external or unknown NMI while another > > > cpu is

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Wed, Nov 25, 2015 at 09:46:37AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: ... > > I prefer this, but we might want to add some more prefix or suffix. > > For example, "conditionally_run_crash_nmi_callback". > > That's unnecessary IMO. If you need to express that, you could write > that in a

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Wed, Nov 25, 2015 at 05:51:59AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > > `Infinite loop in NMI context' can happen: > > > > > > > > a. when a cpu panics on NMI while another cpu is processing panic > > > > b. when a cpu received an external or unknown NMI while another > > > > cpu

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread Borislav Petkov
On Wed, Nov 25, 2015 at 09:46:37AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > Does *old* code mean the code without this patch *series* ? Yes. > I prefer this, but we might want to add some more prefix or suffix. > For example, "conditionally_run_crash_nmi_callback". That's unnecessary IMO. If you

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-25 Thread Borislav Petkov
On Wed, Nov 25, 2015 at 05:51:59AM +, 河合英宏 / KAWAI,HIDEHIRO wrote: > > > `Infinite loop in NMI context' can happen: > > > > > > a. when a cpu panics on NMI while another cpu is processing panic > > > b. when a cpu received an external or unknown NMI while another > > > cpu is

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Tue, Nov 24, 2015 at 11:48:53AM +0100, Borislav Petkov wrote: > > > > > + */ > > > + while (!raw_spin_trylock(_reason_lock)) > > > + poll_crash_ipi_and_callback(regs); > > > > Waaait a minute: so if we're getting NMIs broadcasted on every core but > > we're *not* crash dumping, we

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Fri, Nov 20, 2015 at 06:36:46PM +0900, Hidehiro Kawai wrote: > > nmi_shootdown_cpus(), a subroutine of crash_kexec(), sends NMI IPI > > to non-panic cpus to stop them while saving their register > >...to stop them and save their register... Thanks for the correction. > >

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Borislav Petkov
On Tue, Nov 24, 2015 at 02:37:00PM -0500, Steven Rostedt wrote: > On Tue, Nov 24, 2015 at 11:48:53AM +0100, Borislav Petkov wrote: > > > > > + */ > > > + while (!raw_spin_trylock(_reason_lock)) > > > + poll_crash_ipi_and_callback(regs); > > > > Waaait a minute: so if we're getting NMIs

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Steven Rostedt
On Tue, Nov 24, 2015 at 11:48:53AM +0100, Borislav Petkov wrote: > > > +*/ > > + while (!raw_spin_trylock(_reason_lock)) > > + poll_crash_ipi_and_callback(regs); > > Waaait a minute: so if we're getting NMIs broadcasted on every core but > we're *not* crash dumping, we will run

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Michal Hocko
On Fri 20-11-15 18:36:46, Hidehiro Kawai wrote: > nmi_shootdown_cpus(), a subroutine of crash_kexec(), sends NMI IPI > to non-panic cpus to stop them while saving their register > information and doing some cleanups for crash dumping. So if a > non-panic cpus is infinitely looping in NMI context,

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Borislav Petkov
On Fri, Nov 20, 2015 at 06:36:46PM +0900, Hidehiro Kawai wrote: > nmi_shootdown_cpus(), a subroutine of crash_kexec(), sends NMI IPI > to non-panic cpus to stop them while saving their register ...to stop them and save their register... > information and doing some cleanups for

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Borislav Petkov
On Tue, Nov 24, 2015 at 02:37:00PM -0500, Steven Rostedt wrote: > On Tue, Nov 24, 2015 at 11:48:53AM +0100, Borislav Petkov wrote: > > > > > + */ > > > + while (!raw_spin_trylock(_reason_lock)) > > > + poll_crash_ipi_and_callback(regs); > > > > Waaait a minute: so if we're getting NMIs

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Steven Rostedt
On Tue, Nov 24, 2015 at 11:48:53AM +0100, Borislav Petkov wrote: > > > +*/ > > + while (!raw_spin_trylock(_reason_lock)) > > + poll_crash_ipi_and_callback(regs); > > Waaait a minute: so if we're getting NMIs broadcasted on every core but > we're *not* crash dumping, we will run

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Fri, Nov 20, 2015 at 06:36:46PM +0900, Hidehiro Kawai wrote: > > nmi_shootdown_cpus(), a subroutine of crash_kexec(), sends NMI IPI > > to non-panic cpus to stop them while saving their register > >...to stop them and save their register... Thanks for the correction. > >

RE: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread 河合英宏 / KAWAI,HIDEHIRO
> On Tue, Nov 24, 2015 at 11:48:53AM +0100, Borislav Petkov wrote: > > > > > + */ > > > + while (!raw_spin_trylock(_reason_lock)) > > > + poll_crash_ipi_and_callback(regs); > > > > Waaait a minute: so if we're getting NMIs broadcasted on every core but > > we're *not* crash dumping, we

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Borislav Petkov
On Fri, Nov 20, 2015 at 06:36:46PM +0900, Hidehiro Kawai wrote: > nmi_shootdown_cpus(), a subroutine of crash_kexec(), sends NMI IPI > to non-panic cpus to stop them while saving their register ...to stop them and save their register... > information and doing some cleanups for

Re: [V5 PATCH 2/4] panic/x86: Allow cpus to save registers even if they are looping in NMI context

2015-11-24 Thread Michal Hocko
On Fri 20-11-15 18:36:46, Hidehiro Kawai wrote: > nmi_shootdown_cpus(), a subroutine of crash_kexec(), sends NMI IPI > to non-panic cpus to stop them while saving their register > information and doing some cleanups for crash dumping. So if a > non-panic cpus is infinitely looping in NMI context,