aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2024-04-02 09:26:15 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-04-09 16:17:42 -0400
commit3476bbecf61c5a2024f19357a5679e084557244b (patch)
tree7096c611f7c4933262a98623f3643d48001f6de8
parent90868f5e3e1edbf6eead29331fc55173600a2bcd (diff)
downloadlinux-trace-trace/memmap-top.tar.gz
pstore/ramoops: Add ramoops.mem_name= command line optiontrace/memmap-top
Add a method to find a region specified by memmap=nn*align:name for ramoops. Adding a kernel command line parameter: memmap=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. Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--fs/pstore/ram.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index b1a455f42e932..83ada9f351522 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -50,6 +50,11 @@ 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 (builtin only)");
+
static ulong mem_size;
module_param(mem_size, ulong, 0400);
MODULE_PARM_DESC(mem_size,
@@ -914,6 +919,23 @@ static void __init ramoops_register_dummy(void)
{
struct ramoops_platform_data pdata;
+#ifndef MODULE
+ /* Only allowed when builtin */
+ printk("RAMOOPS HERE\n");
+ if (mem_name) {
+ u64 start;
+ u64 size;
+
+ printk("RAMOOPS: %s\n", mem_name);
+ if (memmap_named(mem_name, &start, &size)) {
+ mem_address = start;
+ mem_size = size;
+
+ printk("FOUND RAMOOPS: %llx %llx\n", start, size);
+ }
+ }
+#endif
+
/*
* Prepare a dummy platform data structure to carry the module
* parameters. If mem_size isn't set, then there are no module