[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250912150855.2901211-6-eugen.hristev@linaro.org>
Date: Fri, 12 Sep 2025 18:08:44 +0300
From: Eugen Hristev <eugen.hristev@...aro.org>
To: linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
tglx@...utronix.de,
andersson@...nel.org,
pmladek@...e.com,
rdunlap@...radead.org,
corbet@....net,
david@...hat.com,
mhocko@...e.com
Cc: tudor.ambarus@...aro.org,
mukesh.ojha@....qualcomm.com,
linux-arm-kernel@...ts.infradead.org,
linux-hardening@...r.kernel.org,
jonechou@...gle.com,
rostedt@...dmis.org,
linux-doc@...r.kernel.org,
devicetree@...r.kernel.org,
Eugen Hristev <eugen.hristev@...aro.org>
Subject: [RFC][PATCH v3 05/16] kernel/vmcore_info: Register dynamic information into Kmemdump
Register vmcoreinfo information into kmemdump.
Because the size of the info is computed after all entries are being
added, there is no point in registering the whole page, rather, call
the kmemdump registration once everything is in place with the right size.
A second reason is that the vmcoreinfo is added as a region inside
the ELF coreimage note, there is no point in having blank space at the end.
Signed-off-by: Eugen Hristev <eugen.hristev@...aro.org>
---
kernel/vmcore_info.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/vmcore_info.c b/kernel/vmcore_info.c
index e066d31d08f8..3e2e846ba9c8 100644
--- a/kernel/vmcore_info.c
+++ b/kernel/vmcore_info.c
@@ -14,6 +14,7 @@
#include <linux/cpuhotplug.h>
#include <linux/memblock.h>
#include <linux/kmemleak.h>
+#include <linux/kmemdump.h>
#include <asm/page.h>
#include <asm/sections.h>
@@ -118,6 +119,12 @@ phys_addr_t __weak paddr_vmcoreinfo_note(void)
}
EXPORT_SYMBOL(paddr_vmcoreinfo_note);
+static void vmcoreinfo_kmemdump(void)
+{
+ kmemdump_register_id(KMEMDUMP_ID_COREIMAGE_VMCOREINFO,
+ (void *)vmcoreinfo_data, vmcoreinfo_size);
+}
+
static int __init crash_save_vmcoreinfo_init(void)
{
vmcoreinfo_data = (unsigned char *)get_zeroed_page(GFP_KERNEL);
@@ -227,6 +234,7 @@ static int __init crash_save_vmcoreinfo_init(void)
arch_crash_save_vmcoreinfo();
update_vmcoreinfo_note();
+ vmcoreinfo_kmemdump();
return 0;
}
--
2.43.0
Powered by blists - more mailing lists