LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Ahmed S. Darwish" <firstname.lastname@example.org>
To: Jani Nikula <email@example.com>
Cc: "David Airlie" <firstname.lastname@example.org>,
"Daniel Vetter" <email@example.com>,
"Joonas Lahtinen" <firstname.lastname@example.org>,
"Rodrigo Vivi" <email@example.com>,
"Alex Deucher" <firstname.lastname@example.org>,
"Christian König" <email@example.com>,
"David Zhou" <David1.Zhou@amd.com>,
"Ard Biesheuvel" <firstname.lastname@example.org>,
"Matt Fleming" <email@example.com>,
"Linus Torvalds" <firstname.lastname@example.org>,
"Greg Kroah-Hartman" <email@example.com>,
"John Ogness" <firstname.lastname@example.org>,
Subject: Re: DRM-based Oops viewer
Date: Mon, 11 Mar 2019 23:12:23 +0100 [thread overview]
Message-ID: <20190311221223.GA3344@darwi-home-pc> (raw)
On Mon, Mar 11, 2019 at 11:04:19AM +0200, Jani Nikula wrote:
> On Sun, 10 Mar 2019, "Ahmed S. Darwish" <email@example.com> wrote:
> > Hello DRM/UEFI maintainers,
> > Several years ago, I wrote a set of patches to dump the kernel
> > log to disk upon panic -- through BIOS INT 0x13 services. 
> > The overwhelming response was that it's unsafe to do this in a
> > generic manner. Linus proposed a video-based viewer instead: 
> > 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.
> > Of course it's 2019 now though, and it's quite known that
> > Intel is officially obsoleting the PC/AT BIOS by 2020.. 
> > Researching whether this can be done from UEFI, it was also clear
> > that UEFI "Runtime Services" do not provide any re-initialization
> > routines. 
> > The maximum possible that UEFI can provide is a GOP-provided
> > framebuffer that's ready to use by the OS -- even after the UEFI
> > boot phase is marked as done through ExitBootServices(). 
> > Of course, once native drivers like i915 or radeon take over,
> > such a framebuffer is toast... 
> > Thus a possible remaining option, is to display the oops through
> > "minimal" DRM drivers provided for each HW variant... Since
> > these special drivers will run only and fully under a panic()
> > context though, several constraints exist:
> > - The code should be fully synchronous (irqs are disabled)
> > - It should not allocate any dynamic memory
> > - It should make minimal assumptions about HW state
> > - It should not chain into any other kernel subsystem
> > - It has ample freedom to use delay-based loops and the
> > like, the kernel is already dead.
> > How feasible is it to have such a special "DRM viewoops"
> > framework + its minimal drivers in the kernel?
> Please first better define what you want to achieve.
Oh I thought this was clear..
What I want to achieve is:
- for normal day-to-day x86 laptops users
- properly inform the user when a kernel panic happens during
a running graphical session (e.g. wayland/gnome/kde/...).
The current situation is dismal: the screen _just freezes_, and
users are left wondering what the heck has really happened to
their system (?)
Some out-of-the-box notification mechanism, for everyday distros
like Fedora and Ubuntu that can be enabled by default, would
improve the situation considerably..
Yes, there are many _developer_ features that can mitigate the
issue somewhat, but they're not really useful for everyday "normal"
- netconsole is definitely not an option. It implies a lab
setting where two machines are always connected through a
- ramoops is _completely irrelevant_ for normal users. It's
mostly for embedded systems and the like; requires intimate
knowledge of the hardware by the user translated into DT
bindings or special platform_data struct..
- kexec/kdump partially solves the save-to-disk problem, but
doesn't solve the user notification part..
Maybe a new "kexec/kview" solution can be useful, but
distributions don't enable kexec/k* solutions _by default_.
Maybe they fear the extra burden of maintaining two kernels
at the same time? or the requirement of reserving memory
for the crashkernel beforehand?
Linux should not just "freeze the screen" upon panic, even
if a crashkernel is not present .. _some_ sane default
built-in user notification mechanism should be there.
- efivars are neat, they partially solve the save-to-disk
problem, but does not solve the user notification problem.
Moreover, they always carry the risk of bricking laptops..
> Do you want to store the dmesg or oops (like your original series
> suggests) or do you want to display the oops?
The original save-to-disk series was only shown for context.
This is a pure display solution; no disk is invovled at all.
> Do you want the facility to be functioning at all times, or only
> when specifically requested in advance by the user?
At all times, as a basic "sane default" for laptop-oriented
distributions to enable (think ubuntu, fedora, mint, etc.)
> If you want to display the oops, do you want it to
> also work when the display is disabled at the time of the oops?
If the screen is disabled, then this is definitely out of scope.
This only deals with classical laptop usage scenarios, where we
want to notify the user that something went wrong at the kernel
> the display is at attached to a port on a dock?
This is a much bigger scope that's not important at this stage.
If I'm attaching my laptop to a projector and the kernel panics,
notifying the user only in the main laptop screen should be
> There's at least kdump, ramoops, and netconsole that can be used to
> achieve some of what you want. How do they fall short for you?
Hopfully my answers above provided more insight of why these
solutions fall short..
> > The target is to start from i915, since that's what in my
> > laptop now, and work from there..
> > Some final notes:
> > - The NT kernel has a similar concept, but for storage instead.
> > They're used to dump core under kernel panic() situations,
> > and are called "Minoport storage drivers". 
> > - Since Windows 7+, a very fancy Blue Screen of Death is
> > displayed, with Unicode and whatnot, implying GPU drivers
> > involvement. 
> > - Mac OS X also does something similar 
> > - On Linux laptops, the current situation is _really_ bad.
> > In any graphical session, type "echo c > /proc/sysrq-trigger";
> > the screen will just completely freeze...
> > Desired first goal: just print the panic() log
> > Thanks a lot,
> >  https://lore.kernel.org/lkml/20110125134748.GA10051@laptop
> >  https://lore.kernel.org/lkml/AANLkTinU0KYiCd4p=z+=ojbkeEoT2G+CAYvdRU02KJEn@mail.gmail.com
> >  https://uefi.org/sites/default/files/resources/Brian_Richardson_Intel_Final.pdf
> >  UEFI v2.7 spec, Chapter 8, "Services — Runtime Services"
> >  UEFI v2.7 spec, Section 12.9, "Graphics Output Protocol"
> > "The Graphics Output Protocol supports this capability by
> > providing the EFI OS loader access to a hardware frame buffer
> > and enough information to allow the OS to draw directly to
> > the graphics output device."
> >  linux/drivers/gpu/drm/i915/i915_drv.c::i915_kick_out_firmware_fb()
> > linux/drivers/gpu/drm/radeon/radeon_drv.c::radeon_pci_probe()
> >  https://docs.microsoft.com/en-us/windows-hardware/drivers/storage/restrictions-on-miniport-drivers-that-manage-the-boot-drive
> >  https://upload.wikimedia.org/wikipedia/commons/archive/5/56/20181019151937%21Bsodwindows10.png
> >  https://upload.wikimedia.org/wikipedia/commons/4/4a/Mac_OS_X_10.2_Kernel_Panic.jpg
> > --darwi
> > http://darwish.chasingpointers.com
> Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2019-03-11 22:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-10 1:31 Ahmed S. Darwish
2019-03-10 8:44 ` Martin Steigerwald
2019-03-11 9:04 ` Jani Nikula
2019-03-11 13:49 ` Daniel Vetter
2019-03-11 23:39 ` Ahmed S. Darwish
2019-03-11 22:12 ` Ahmed S. Darwish [this message]
2019-03-12 10:20 ` Jani Nikula
2019-03-11 12:10 ` Joonas Lahtinen
2019-03-11 17:47 ` Noralf Trønnes
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--subject='Re: DRM-based Oops viewer' \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox