Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1194940

Re: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to panic on NMI

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to panic on NMI
Date 2015-07-29 10:30 +0200
Message-ID <pRuUr-2EV-31@gated-at.bofh.it> (permalink)
References <pQIZs-iy-5@gated-at.bofh.it> <pQIZs-iy-9@gated-at.bofh.it> <pQRJn-4Ft-15@gated-at.bofh.it> <pR2v7-3xf-7@gated-at.bofh.it> <pRspA-7rV-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 29-07-15 05:48:47, 河合英宏 / KAWAI,HIDEHIRO wrote:
> Hi,
> 
> > From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Hidehiro Kawai
> > (2015/07/27 23:34), Michal Hocko wrote:
> > > On Mon 27-07-15 10:58:50, Hidehiro Kawai wrote:
> [...]
> > > The check could be also relaxed a bit and nmi_panic would
> > > return only if the ongoing panic is the current cpu when we really have
> > > to return and allow the preempted panic to finish.
> > 
> > It's reasonable.  I'll do that in the next version.
> 
> I noticed atomic_read() is insufficient.  Please consider the following
> scenario.
> 
> CPU 1: call panic() in the normal context
> CPU 0: call nmi_panic(), check the value of panic_cpu, then call panic()
> CPU 1: set 1 to panic_cpu
> CPU 0: fail to set 0 to panic_cpu, then do an infinite loop
> CPU 1: call crash_kexec(), then call kdump_nmi_shootdown_cpus()
> 
> At this point, since CPU 0 loops in NMI context, it never executes
> the NMI handler registered by kdump_nmi_shootdown_cpus().  This means
> that no register states are saved and no cleanups for VMX/SVM are
> performed.

Yes this is true but it is no different from the current state, isn't
it? So if you want to handle that then it deserves a separate patch.
It is certainly not harmful wrt. panic behavior.

> So, we should still use atomic_cmpxchg() in nmi_panic() to
> prevent other cpus from running panic routines.

Not sure what you mean by that.

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to panic  on NMI Michal Hocko <mhocko@kernel.org> - 2015-07-27 16:40 +0200
  Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to panic  on NMI Michal Hocko <mhocko@kernel.org> - 2015-07-28 10:10 +0200
  RE: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI 河合英宏 / KAWAI,HIDEHIRO   <hidehiro.kawai.ez@hitachi.com> - 2015-07-29 07:50 +0200
    Re: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI Michal Hocko <mhocko@kernel.org> - 2015-07-29 10:30 +0200
      RE: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI 河合英宏 / KAWAI,HIDEHIRO   <hidehiro.kawai.ez@hitachi.com> - 2015-07-29 11:10 +0200
        Re: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI Michal Hocko <mhocko@kernel.org> - 2015-07-29 11:30 +0200
          RE: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI 河合英宏 / KAWAI,HIDEHIRO   <hidehiro.kawai.ez@hitachi.com> - 2015-07-30 03:50 +0200
            RE: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI 河合英宏 / KAWAI,HIDEHIRO   <hidehiro.kawai.ez@hitachi.com> - 2015-07-30 09:40 +0200
              Re: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI Michal Hocko <mhocko@kernel.org> - 2015-07-30 10:00 +0200
                RE: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI 河合英宏 / KAWAI,HIDEHIRO   <hidehiro.kawai.ez@hitachi.com> - 2015-07-30 10:10 +0200
            Re: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI Michal Hocko <mhocko@kernel.org> - 2015-07-30 09:50 +0200
              Re: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI Michal Hocko <mhocko@kernel.org> - 2015-08-04 11:20 +0200
                RE: Re: [V2 PATCH 1/3] x86/panic: Fix re-entrance problem due to  panic on NMI 河合英宏 / KAWAI,HIDEHIRO   <hidehiro.kawai.ez@hitachi.com> - 2015-08-04 14:00 +0200

csiph-web