public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fernando Luis Vazquez Cao <fernando@intellilink.co.jp>
To: vgoyal@in.ibm.com
Cc: linux-kernel@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	ak@suse.de, fastboot@lists.osdl.org
Subject: Re: [PATCH 0/5] stack overflow safe kdump (2.6.15-i386)
Date: Thu, 19 Jan 2006 15:07:55 +0900	[thread overview]
Message-ID: <1137650875.2985.39.camel@localhost.localdomain> (raw)
In-Reply-To: <20060118015649.GE23143@in.ibm.com>

On Tue, 2006-01-17 at 20:56 -0500, Vivek Goyal wrote:
> On Mon, Jan 16, 2006 at 10:23:15PM +0900, Fernando Luis Vazquez Cao wrote:
> > Hi,
> > 
> > The following set of patches aims at making kdump robust against stack
> > overflows. 
> > 
> > In this new version I tried to incorporate all the ideas received after
> > a previous post. However, there is still room for further improvements
> > some of which I point out below (see "->"). I would appreciate your
> > comments before I start working on them.
> > 
> > This patch set does the following:
> > 
> > * Substitute "smp_processor_id" with the stack overflow-safe
> > "safe_smp_processor_id" in the reboot path to the second kernel.
> > 
> > * Use a private 4K stack for the NMI handler (if CONFIG_4KSTACKS
> > enabled).
> > 
> > * On the event of a system crash:
> >    - Replace NMI trap vector with "crash_nmi".
> >    - Replace NMI handler with "do_crash_nmi".
> > 
> > List of patches (the last two should be applied in the order of
> > appearance):
> > 
> > [1/5] safe_smp_processor_id: Stack overflow safe implementation of
> > smp_processor_id.
> > 
> > [2/5] use_safe_smp_processor_id: Replace smp_processor_id with
> > safe_smp_processor_id in arch/i386/kernel/crash.c.
> > 
> > [3/5] fault: Take stack overflows into account in do_page_fault.
> > 
> > [4/5] nmi_vector: In the nmi path, we have the problem that both nmi_enter and
> > nmi_exit in do_nmi (see code below) make heavy use of "current" indirectly
> > (specially through the kernel preemption code). To avoid this execution path the
> > nmi trap handler is substituted with a stack overflow safe replacement.
> > 
> >    -> Regarding the implementation, I have some doubts:
> >       - Should the NMI vector replaced atomically?
> >       - Should the NMI watchdog be stopped? Should NMIs be disabled in the crash
> >         path of each CPU?
> >       This is important because after replacing the nmi handler the NMI
> >       watchdog will continue generating interrupts that need to be handled
> >       properly. If we can avoid this a kdump-specific nmi vector handler
> >       (ENTRY(crash_nmi)) could be safely used.
> 
> Can we have something like per cpu flag which will be set if NMI is received
> after crash (after replacing the trap vector). If another NMI occurs on 
> the same cpu and if flag is set, return and don't process it further.
The problem is that when one CPU crashes in a SMP system and the NMI
watchdog is enabled, the others will continue receiving NMI from the
watchdog and will eventually also receive the NMI from the crashing CPU.
The NMI handler has to be able to process both adequately if we cannot
stop the NMI watchdog atomically. Even if we used such a flag we would
need to figure out the originator of the NMI.

Regards,

Fernando


  reply	other threads:[~2006-01-19  6:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-16 13:23 [PATCH 0/5] stack overflow safe kdump (2.6.15-i386) Fernando Luis Vazquez Cao
2006-01-18  1:56 ` Vivek Goyal
2006-01-19  6:07   ` Fernando Luis Vazquez Cao [this message]
2006-01-20 13:20     ` Vivek Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1137650875.2985.39.camel@localhost.localdomain \
    --to=fernando@intellilink.co.jp \
    --cc=ak@suse.de \
    --cc=ebiederm@xmission.com \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox