diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2024-06-13 11:55:08 -0400 |
---|---|---|
committer | Mike Rapoport (IBM) <rppt@kernel.org> | 2024-06-19 18:05:14 +0300 |
commit | d9d814eebb1ae9742e7fd7f39730653b16326bd4 (patch) | |
tree | dcb83a31c4cf188d2f225ef870ca2d8c14f8ef41 /fs/pstore | |
parent | 1e4c64b71c9bf230b25fde12cbcceacfdc8b3332 (diff) |
pstore/ramoops: Add ramoops.mem_name= command line option
Add a method to find a region specified by reserve_mem=nn:align:name for
ramoops. Adding a kernel command line parameter:
reserve_mem=12M:4096:oops ramoops.mem_name=oops
Will use the size and location defined by the memmap parameter where it
finds the memory and labels it "oops". The "oops" in the ramoops option
is used to search for it.
This allows for arbitrary RAM to be used for ramoops if it is known that
the memory is not cleared on kernel crashes or soft reboots.
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20240613155527.591647061@goodmis.org
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/ram.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index b1a455f42e93..4311fcbc84f2 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -50,6 +50,10 @@ module_param_hw(mem_address, ullong, other, 0400); MODULE_PARM_DESC(mem_address, "start of reserved RAM used to store oops/panic logs"); +static char *mem_name; +module_param_named(mem_name, mem_name, charp, 0400); +MODULE_PARM_DESC(mem_name, "name of kernel param that holds addr"); + static ulong mem_size; module_param(mem_size, ulong, 0400); MODULE_PARM_DESC(mem_size, @@ -914,6 +918,16 @@ static void __init ramoops_register_dummy(void) { struct ramoops_platform_data pdata; + if (mem_name) { + phys_addr_t start; + phys_addr_t size; + + if (reserve_mem_find_by_name(mem_name, &start, &size)) { + mem_address = start; + mem_size = size; + } + } + /* * Prepare a dummy platform data structure to carry the module * parameters. If mem_size isn't set, then there are no module |