kernel-hardening.lists.openwall.com archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Muni Sekhar <munisekharrms@gmail.com>
Cc: kernel-hardening@lists.openwall.com
Subject: Re: How to get the crash dump if system hangs?
Date: Thu, 3 Oct 2019 14:36:07 -0700	[thread overview]
Message-ID: <201910031417.2AEEE7B@keescook> (raw)
In-Reply-To: <CAHhAz+jyZmLBsFBxLG_XmZRBrprrxa49T+07NhcrsH4Yi6jp6A@mail.gmail.com>

On Thu, Oct 03, 2019 at 10:18:48PM +0530, Muni Sekhar wrote:
> Thanks a lot for letting me know about pstore, will try this option.
> It will be helpful if you can share some pointers on 'how to enable
> software ECC'?

When I boot with pstore, I use a bunch of command line arguments to test
all its feature:

ramoops.mem_size=1048576
ramoops.ecc=1
ramoops.mem_address=0x440000000
ramoops.console_size=16384
ramoops.ftrace_size=16384
ramoops.pmsg_size=16384
ramoops.record_size=32768

but I'm using pmem driver to reserve the 1MB of memory at 0x440000000.

To do a RAM reservation on a regular system, you'll need to do something
like boot with:

memmap=1M!1023M

which says, reserve 1MB of memory at the 1023M offset. So this depends
on how much physical memory you have, etc, but you'll be able to see the
reservation after booting in /proc/iomem. e.g. for me, before:

...
00100000-bffd9fff : System RAM
...

with memmap:

...
00100000-3fefffff : System RAM
3ff00000-3fffffff : Persistent Memory (legacy)
40000000-bffd9fff : System RAM
...

So in that example, the address you'd want is 0x3ff00000

memmap=1M!1023M
ramoops.mem_size=1048576
ramoops.ecc=1
ramoops.mem_address=0x3ff00000
ramoops.console_size=16384
ramoops.ftrace_size=16384
ramoops.pmsg_size=16384
ramoops.record_size=32768

In dmesg you should see:

[    0.868818] pstore: Registered ramoops as persistent store backend
[    0.869713] ramoops: using 0x100000@0x3ff00000, ecc: 16

And if that address lines up with the "Persistent Memory (legacy)" line
in /proc/iomem you should be good to go.

Just mount /sys/fs/pstore and see if the console dump updates between
warm boots, then try some cold boots, see if the ECC works, etc.

Good luck!

-- 
Kees Cook

  reply	other threads:[~2019-10-03 21:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 20:17 How to get the crash dump if system hangs? Muni Sekhar
2019-09-30 23:51 ` Kees Cook
2019-10-03 16:48   ` Muni Sekhar
2019-10-03 21:36     ` Kees Cook [this message]
2019-10-10 15:49       ` Muni Sekhar
2019-10-10 16:56         ` Kees Cook
2019-10-10 17:15           ` Muni Sekhar
2019-10-10 18:31             ` Kees Cook
2019-10-11 14:03               ` Muni Sekhar
2019-10-25  2:10                 ` Muni Sekhar
2019-10-28 19:22                   ` Kees Cook
2019-10-20 19:01 youling257
2019-10-21  8:39 ` Lukas Odzioba
2019-10-21 10:22   ` youling 257
2019-11-02  5:42     ` youling 257
2019-10-20 19:31 youling257

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=201910031417.2AEEE7B@keescook \
    --to=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=munisekharrms@gmail.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;
as well as URLs for NNTP newsgroup(s).