[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240306102846.1020868-7-lizhijian@fujitsu.com>
Date: Wed, 6 Mar 2024 18:28:45 +0800
From: Li Zhijian <lizhijian@...itsu.com>
To: linux-kernel@...r.kernel.org
Cc: y-goto@...itsu.com,
Alison Schofield <alison.schofield@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Baoquan He <bhe@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dan Williams <dan.j.williams@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Dave Jiang <dave.jiang@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
hpa@...or.com,
Ingo Molnar <mingo@...hat.com>,
Ira Weiny <ira.weiny@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Vishal Verma <vishal.l.verma@...el.com>,
linux-cxl@...r.kernel.org,
linux-mm@...ck.org,
nvdimm@...ts.linux.dev,
x86@...nel.org,
kexec@...ts.infradead.org,
Li Zhijian <lizhijian@...itsu.com>
Subject: [PATCH v3 6/7] x86/crash: make device backed vmemmap dumpable for kexec_file_load
Add resources with specific flags to PT_LOADs of the elfcorehdr so that
these resources can be dumpable. This change is for kexec_file_load(2)
while kexec_load(2) setups the PT_LOADs according to its parameters
by the callers which usually rely on resources' name from /proc/iomem
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Ingo Molnar <mingo@...hat.com>
CC: Borislav Petkov <bp@...en8.de>
CC: Dave Hansen <dave.hansen@...ux.intel.com>
CC: Baoquan He <bhe@...hat.com>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: "H. Peter Anvin" <hpa@...or.com>
CC: x86@...nel.org
Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
---
arch/x86/kernel/crash.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index b6b044356f1b..b8426fedd2cd 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -146,6 +146,8 @@ static struct crash_mem *fill_up_crash_elf_data(void)
if (!nr_ranges)
return NULL;
+ walk_device_backed_vmemmap_res(0, -1, &nr_ranges,
+ get_nr_ram_ranges_callback);
/*
* Exclusion of crash region and/or crashk_low_res may cause
* another range split. So add extra two slots here.
@@ -212,6 +214,9 @@ static int prepare_elf_headers(void **addr, unsigned long *sz,
if (ret)
goto out;
+ walk_device_backed_vmemmap_res(0, -1, cmem,
+ prepare_elf64_ram_headers_callback);
+
/* Exclude unwanted mem ranges */
ret = elf_header_exclude_ranges(cmem);
if (ret)
--
2.29.2
Powered by blists - more mailing lists