LWN.net Logo

Re: [PATCH 0/2][concept RFC] x86: BIOS-save kernel log to disk upon panic

From:  Linus Torvalds <torvalds-AT-linux-foundation.org>
To:  "Ahmed S. Darwish" <darwish.07-AT-gmail.com>
Subject:  Re: [PATCH 0/2][concept RFC] x86: BIOS-save kernel log to disk upon panic
Date:  Wed, 26 Jan 2011 06:25:19 +1000
Message-ID:  <AANLkTinU0KYiCd4p=z+=ojbkeEoT2G+CAYvdRU02KJEn@mail.gmail.com>
Cc:  "H. Peter Anvin" <hpa-AT-zytor.com>, Thomas Gleixner <tglx-AT-linutronix.de>, Ingo Molnar <mingo-AT-redhat.com>, X86-ML <x86-AT-kernel.org>, Tony Luck <tony.luck-AT-intel.com>, Dave Jones <davej-AT-redhat.com>, Andrew Morton <akpm-AT-linux-foundation.org>, Randy Dunlap <rdunlap-AT-xenotime.net>, Willy Tarreau <wtarreau-AT-hera.kernel.org>, Willy Tarreau <w-AT-1wt.eu>, Dirk Hohndel <hohndel-AT-infradead.org>, Dirk.Hohndel-AT-intel.com, IDE-ML <linux-ide-AT-vger.kernel.org>, LKML <linux-kernel-AT-vger.kernel.org>
Archive-link:  Article, Thread

On Tue, Jan 25, 2011 at 11:47 PM, Ahmed S. Darwish <darwish.07@gmail.com> wrote:
>
> I've faced some very early panics in latest kernel. Being a run of the mill
> x86 laptop, the machine is void of debugging aids like serial ports or
> network boot.
>
> As a possible solution, below patches prototypes the idea of persistently
> storing the kernel log ring to a hard disk partition using the enhanced BIOS
> 0x13 services.

Quite frankly, I'm not likely to _ever_ merge anything like this.

Over the years, many people have tried to write things to disk on
oops. I refuse to take it. No way in hell do I want the situation of
"the system is screwed, so let's overwrite the disk" to be something
the kernel I release might do. It's crazy. That disk is a lot more
important than the kernel, and overwriting it when we might have
serious memory corruption issues or something is not a thing I feel is
appropriate.

I also don't think that it's safe to use the BIOS routines. That's not
the environment they have been tested in  - the boot environment is
very different from the "running kernel" setup. Devices will have been
possibly remapped, virtual mappings are different, things are just
very random.

Some vendors have taken things like this in the past, but I just
wanted to say that I think it's too damn scary. I _really_ don't see
the point.

If you want to do the BIOS services thing, do it for video: copy the
oops to low RAM, return to real mode, re-run the graphics card POST
routines to initialize text-mode, and use the BIOS to print out the
oops.  That is WAY less scary than writing to disk.

                              Linus
--
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/


(Log in to post comments)

x86: BIOS-save kernel log to disk upon panic

Posted Feb 4, 2011 20:14 UTC (Fri) by oak (subscriber, #2786) [Link]

Was this about writing to a partition where one has other data? If yes, that indeed is a horrible idea.

However, mtdoops which writes to a *dedicated* partition has worked reliably for us for years (with hundreds of users) regardless of numerous memory corruptions and other kernel issues during the (ARM) kernel development.

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds