mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "K.Prasad" <prasad@linux.vnet.ibm.com>
To: Borislav Petkov <bp@alien8.de>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel@vger.kernel.org, crash-utility@redhat.com,
	kexec@lists.infradead.org, Vivek Goyal <vgoyal@redhat.com>,
	Andi Kleen <andi@firstfloor.org>,
	"Luck, Tony" <tony.luck@intel.com>,
	anderson@redhat.com, tachibana@mxm.nes.nec.co.jp,
	oomichi@mxs.nes.nec.co.jp
Subject: Re: [Patch 1/4][kernel][slimdump] Add new elf-note of type NT_NOCOREDUMP to capture slimdump
Date: Wed, 5 Oct 2011 15:17:27 +0530	[thread overview]
Message-ID: <20111005094727.GB7485@in.ibm.com> (raw)
In-Reply-To: <20111005073111.GA13478@liondog.tnic>

On Wed, Oct 05, 2011 at 09:31:11AM +0200, Borislav Petkov wrote:
> On Wed, Oct 05, 2011 at 12:37:28PM +0530, K.Prasad wrote:
> > > Well, there are MCE types for which we need to panic but we don't
> > > necessarily corrupt memory. Your approach is to unconditionally avoid
> > > dumping core whenever we panic while you should look at the MCE
> > > signature and decide then whether to capture crashed kernel memory or
> > > not.
> > > 
> > > For example, if the MCE signature says UC DRAM error, then you can
> > > be pretty sure that there is a landmine somewhere in the DRAM region
> > > mapping the crashed kernel. If it is, say, a UC when doing data fills
> > > from L2 to L1, that doesn't necessarily mean that DRAM is corrupted. But
> > > even in the first case, you can evaluate the MCi_ADDR reported with the
> > > UC DRAM error and simply skip that particular cacheline when dumping the
> > > core instead of not capturing anything at all.
> > > 
> > 
> > True. Like stated by me earlier, there could be two possible outcomes
> > from capturing memory dump in such cases - they're either dangerous or
> > doesn't make sense.
> 
> Why, in the second example the only corruption is to the L2 cache so
> your memory image is intact. Why wouldn't you want to capture a memory
> dump then? It is business as usual in that case.
> 

We don't want to capture memory dump when the machine crashes due to
faulty cache, because the end-user derives no benefit by receiving a
bulky vmcore and running crash analysis tools over them. Instead a
'slimdump' that contains a meaningful message about the origin of crash
(and which can be understood by his analysis tools) would be better, or
so I thought.

There are possibly several hardware errors which cause system crash and
the kdump would capture full vmcore, although it doesn't make sense (I
wouldn't have cared about the second example, you cited, if they did not
generate MCE, but a different exception). In an ideal situation, each of
these error paths would 'subscribe' to slimdump and add a meaningful
message in the NT_NOCOREDUMP note instead of letting the user-space copy
the old kernel memory.

> > It is best to avoid a normal kdump in both cases,
> > although the elf-note doesn't distinguish between the two.
> > 
> > NT_NOCOREDUMP, in my opinion, is just the first step towards introducing
> > a framework where different code paths that lead to panic() can
> > 'opt-out' from kdump by adding an elf-note.
> > 
> > We can modify this to add more fine-grained messages using different elf-note
> > types (or use the elf-note name under the NT_NOCOREDUMP type) to
> > indicate the cause/type of crash.
> > 
> > I'd like to hear further from you and the rest of the community to see if
> > there's a need felt for such a change.
> 
> I'd make this conditional on whether you have had memory corruption or
> not by evaluating MCE signatures and acting accordingly.
>

Fine with me. I see that the various IA32_MCi_Status registers will hold
information about the error and use that to classify MCEs.

I think the best way to go about is to retain NT_NOCOREDUMP for non-DRAM
errors also, but use the note-name field in the elf-note and distinguish the
various types of errors...say, by using names such as "PANIC_MCE_DRAM",
"PANIC_MCE_CACHE", etc (similar to the error codes described in the Intel
manual). The upstream tools like 'makedumpfile' and 'crash' will have to
be taught to parse the elf-note name and act accordingly.

Thanks for your comments and review.

-- K.Prasad


  reply	other threads:[~2011-10-05  9:47 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03  7:07 [Patch 0/4] Slimdump framework using NT_NOCOREDUMP elf-note K.Prasad
2011-10-03  7:32 ` [Patch 1/4][kernel][slimdump] Add new elf-note of type NT_NOCOREDUMP to capture slimdump K.Prasad
2011-10-03 10:10   ` Eric W. Biederman
2011-10-03 12:03     ` K.Prasad
2011-10-04  6:34       ` Borislav Petkov
2011-10-05  7:07         ` K.Prasad
2011-10-05  7:31           ` Borislav Petkov
2011-10-05  9:47             ` K.Prasad [this message]
2011-10-05 12:41               ` Borislav Petkov
2011-10-05 15:52               ` Vivek Goyal
2011-10-05 16:00                 ` Valdis.Kletnieks
2011-10-05 16:16                   ` Borislav Petkov
2011-10-05 17:20                     ` Vivek Goyal
2011-10-05 17:13                   ` Vivek Goyal
2011-10-05 11:55             ` Valdis.Kletnieks
2011-10-05 12:31               ` Borislav Petkov
2011-10-05 15:19           ` Vivek Goyal
2011-10-05 15:30           ` Vivek Goyal
2011-10-03 22:53     ` Luck, Tony
2011-10-04 14:04   ` Vivek Goyal
2011-10-05  7:18     ` K.Prasad
2011-10-05  7:33       ` Borislav Petkov
2011-10-05  9:23         ` K.Prasad
2011-10-05 15:25       ` Vivek Goyal
2011-10-07 16:12         ` K.Prasad
2011-10-10  7:07           ` Borislav Petkov
2011-10-11 18:44             ` K.Prasad
2011-10-11 18:59               ` Luck, Tony
2011-10-12  0:20               ` Andi Kleen
2011-10-12 10:44               ` Borislav Petkov
2011-10-12 15:59                 ` Vivek Goyal
2011-10-12 15:51               ` Vivek Goyal
2011-10-14 11:30                 ` K.Prasad
2011-10-14 14:14                   ` Vivek Goyal
2011-10-18 17:41                     ` K.Prasad
2011-10-04 14:30   ` Vivek Goyal
2011-10-05  7:41     ` K.Prasad
2011-10-05 15:40       ` Vivek Goyal
     [not found]         ` <987664A83D2D224EAE907B061CE93D5301EE62D58D@orsmsx505.amr.corp.intel.com>
2011-10-05 16:25           ` Borislav Petkov
2011-10-05 17:10           ` Vivek Goyal
2011-10-05 17:20             ` Borislav Petkov
2011-10-05 17:29               ` Vivek Goyal
2011-10-05 17:43                 ` Borislav Petkov
2011-10-05 18:00                 ` Dave Anderson
2011-10-05 18:09                   ` Vivek Goyal
2011-10-04 15:04   ` Nick Bowler
2011-10-07 16:36     ` K.Prasad
2011-10-07 18:19       ` Nick Bowler
2011-10-03  7:35 ` [Patch 2/4][kexec-tools] Recognise NT_NOCOREDUMP elf-note type K.Prasad
2011-10-03  7:37 ` [Patch 3/4][makedumpfile] Capture slimdump if elf-note NT_NOCOREDUMP present K.Prasad
2011-10-03  7:45 ` [Patch 4/4][crash] Recognise elf-note of type NT_NOCOREDUMP before vmcore analysis K.Prasad

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=20111005094727.GB7485@in.ibm.com \
    --to=prasad@linux.vnet.ibm.com \
    --cc=anderson@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=bp@alien8.de \
    --cc=crash-utility@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oomichi@mxs.nes.nec.co.jp \
    --cc=tachibana@mxm.nes.nec.co.jp \
    --cc=tony.luck@intel.com \
    --cc=vgoyal@redhat.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

all inboxes | Powered by JetHome®