From: Alexander Graf <graf@amazon.com>
To: Steven Rostedt <rostedt@goodmis.org>,
<linux-kernel@vger.kernel.org>,
<linux-trace-kernel@vger.kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
Vincent Donnefort <vdonnefort@google.com>,
Joel Fernandes <joel@joelfernandes.org>,
"Daniel Bristot de Oliveira" <bristot@redhat.com>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>, <suleiman@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Vineeth Pillai <vineeth@bitbyteword.org>,
Youssef Esmat <youssefesmat@google.com>,
Beau Belgrave <beaub@linux.microsoft.com>,
"Baoquan He" <bhe@redhat.com>, Borislav Petkov <bp@alien8.de>,
"Paul E. McKenney" <paulmck@kernel.org>,
David Howells <dhowells@redhat.com>,
Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH v6 0/2] mm/memblock: Add "reserve_mem" to reserved named memory at boot up
Date: Thu, 13 Jun 2024 18:54:12 +0200 [thread overview]
Message-ID: <b0ed328f-c4e5-4e9b-ae4e-5c60703ab376@amazon.com> (raw)
In-Reply-To: <20240613155506.811013916@goodmis.org>
Hey Steve,
On 13.06.24 17:55, Steven Rostedt wrote:
> Reserve unspecified location of physical memory from kernel command line
>
> Background:
>
> In ChromeOS, we have 1 MB of pstore ramoops reserved so that we can extract
> dmesg output and some other information when a crash happens in the field.
> (This is only done when the user selects "Allow Google to collect data for
> improving the system"). But there are cases when there's a bug that
> requires more data to be retrieved to figure out what is happening. We would
> like to increase the pstore size, either temporarily, or maybe even
> permanently. The pstore on these devices are at a fixed location in RAM (as
> the RAM is not cleared on soft reboots nor crashes). The location is chosen
> by the BIOS (coreboot) and passed to the kernel via ACPI tables on x86.
> There's a driver that queries for this to initialize the pstore for
> ChromeOS:
>
> See drivers/platform/chrome/chromeos_pstore.c
>
> Problem:
>
> The problem is that, even though there's a process to change the kernel on
> these systems, and is done regularly to install updates, the firmware is
> updated much less frequently. Choosing the place in RAM also takes special
> care, and may be in a different address for different boards. Updating the
> size via firmware is a large effort and not something that many are willing
> to do for a temporary pstore size change.
(sorry for not commenting on earlier versions, I didn't see v1-v5 in my
inbox)
Do you have a "real" pstore on these systems that you could store
non-volatile variables in, such as persistent UEFI variables? If so, you
could create an actually persistent mapping for your trace pstore even
across kernel version updates as a general mechanism to create reserved
memblocks at fixed offsets.
> Requirement:
>
> Need a way to reserve memory that will be at a consistent location for
> every boot, if the kernel and system are the same. Does not need to work
> if rebooting to a different kernel, or if the system can change the
> memory layout between boots.
>
> The reserved memory can not be an hard coded address, as the same kernel /
> command line needs to run on several different machines. The picked memory
> reservation just needs to be the same for a given machine, but may be
With KASLR is enabled, doesn't this approach break too often to be
reliable enough for the data you want to extract?
Picking up the idea above, with a persistent variable we could even make
KASLR avoid that reserved pstore region in its search for a viable KASLR
offset.
Alex
Amazon Web Services Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
next prev parent reply other threads:[~2024-06-13 16:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 15:55 [PATCH v6 0/2] mm/memblock: Add "reserve_mem" to reserved named memory at boot up Steven Rostedt
2024-06-13 15:55 ` [PATCH v6 1/2] " Steven Rostedt
2024-06-18 12:55 ` Zhengyejian
2024-06-18 16:06 ` Steven Rostedt
2024-06-19 6:42 ` Mike Rapoport
2024-06-13 15:55 ` [PATCH v6 2/2] pstore/ramoops: Add ramoops.mem_name= command line option Steven Rostedt
2024-06-13 18:19 ` Guilherme G. Piccoli
2024-06-13 18:42 ` Steven Rostedt
2024-06-13 18:51 ` Guilherme G. Piccoli
2024-06-13 16:54 ` Alexander Graf [this message]
2024-06-13 17:12 ` [PATCH v6 0/2] mm/memblock: Add "reserve_mem" to reserved named memory at boot up Steven Rostedt
2024-06-17 7:07 ` Alexander Graf
2024-06-17 20:40 ` Steven Rostedt
2024-06-17 21:01 ` Alexander Graf
2024-06-17 21:18 ` Steven Rostedt
2024-06-18 10:21 ` Ard Biesheuvel
2024-06-18 11:47 ` Alexander Graf
2024-06-18 15:43 ` Steven Rostedt
2024-06-19 8:02 ` Mike Rapoport
2024-06-19 21:53 ` Mike Rapoport
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=b0ed328f-c4e5-4e9b-ae4e-5c60703ab376@amazon.com \
--to=graf@amazon.com \
--cc=akpm@linux-foundation.org \
--cc=beaub@linux.microsoft.com \
--cc=bhe@redhat.com \
--cc=bp@alien8.de \
--cc=bristot@redhat.com \
--cc=dhowells@redhat.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=suleiman@google.com \
--cc=tglx@linutronix.de \
--cc=vdonnefort@google.com \
--cc=vineeth@bitbyteword.org \
--cc=youssefesmat@google.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).