public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: WeiXiong Liao <gmpy.liaowx@gmail.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
	Kamal Dasu <kdasu.kdev@gmail.com>
Subject: Re: Invalid pstore_blk use?
Date: Tue, 9 Aug 2022 16:06:08 -0700	[thread overview]
Message-ID: <202208091600.D19DFF9C7D@keescook> (raw)
In-Reply-To: <c5edaa34-6f85-c6a8-84f5-75413dc864ea@gmail.com>

On Tue, Aug 09, 2022 at 11:35:08AM -0700, Florian Fainelli wrote:
> Hi Kees, WeiXiong,
> 
> On 7/14/22 20:49, Florian Fainelli wrote:
> > Hi Kees, WeiXiong,
> > 
> > I am trying to make use of pstore_blk which is BTW exactly what I had
> > been looking for to store panic/console logs onto an eMMC partition.
> > 
> > Using the 5.10 kernel plus:
> > 
> > 7e2e92e9861b Revert "mark pstore-blk as broken"
> > 01c28bc8f389 pstore/blk: Use the normal block device I/O path
> > 2a7507999638 pstore/blk: remove {un,}register_pstore_blk
> > fef0b337cd25 pstore/zone: cap the maximum device size
> > 
> > or the android13-5.15 (at Merge 5.15.40 into android13-5.15) kernel with
> > no changes and using:
> > 
> > mount -t pstore pstore /sys/fs/pstore
> > modprobe pstore_blk blkdev=/dev/mmcblk1p9 best_effort=yes
> > 
> > upon triggering a crash with:
> > 
> > echo c > /proc/sysrq-trigger
> > 
> > and rebooting and remounting the pstore filesystem and loading
> > pstore_blk, I only have:
> > 
> > # ls /sys/fs/pstore/
> > console-pstore_blk-0
> > 
> > which contains the entire console log up to, but excluding the crash.
> > The kernel does show that pstore_blk was used for all 3 types of kmsg,
> > pmsg and console:
> > 
> > [   28.649514] pstore_zone: capping size to 128MiB
> > [   28.712894] pstore_zone: registered pstore_blk as backend for
> > kmsg(Oops) pmsg console
> > [   28.721145] pstore: Using crash dump compression: deflate
> > [   28.906253] printk: console [pstore_blk-1] enabled
> > [   28.911229] pstore: Registered pstore_blk as persistent store backend
> > [   28.917735] pstore_blk: attached pstore_blk:/dev/mmcblk1p9
> > (134217728) (no dedicated panic_write!)
> > 
> > there is no automatic reboot upon panic, so I just tend to reboot after
> > 2-3 seconds manually. The kernel is configured with the default
> > CONFIG_PSTORE_* options.
> > 
> > Is the observed behavior a limitation of the best_effort mode? If so, do
> > we have any plans to implementing a non-best effort mode for eMMC
> > devices?
> 
> Any feedback on my email? I did try to get kernel panics to be dumped out to

Hi! Sorry I lost this email originally. :)

> a dedicated /dev/mtdblock* partition for which there ought to be support for
> mtd->panic_write, but it still did not work any better. Is there something

With the mtdblock driver, do you still see:

    pstore_blk: attached pstore_blk:/dev/... (no dedicated panic_write!)
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^

> obvious that I am missing which prevents kernel panics from being logged?

Unfortunately it really depends on how the drivers are built. If the
block layer is shut down during a panic, pstore_blk won't catch the
panic. :(

-- 
Kees Cook

  reply	other threads:[~2022-08-09 23:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  3:49 Invalid pstore_blk use? Florian Fainelli
2022-08-09 18:35 ` Florian Fainelli
2022-08-09 23:06   ` Kees Cook [this message]
2022-11-18 20:41     ` Kamal Dasu
2022-12-07 18:31       ` Kamal Dasu
2022-12-07 22:13       ` Kees Cook
2022-12-09 21:19         ` Kamal Dasu

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=202208091600.D19DFF9C7D@keescook \
    --to=keescook@chromium.org \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=f.fainelli@gmail.com \
    --cc=gmpy.liaowx@gmail.com \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.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