[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fd853558-f5ea-c320-adf0-457092c7949e@fujitsu.com>
Date: Fri, 28 Apr 2023 07:10:02 +0000
From: "Zhijian Li (Fujitsu)" <lizhijian@...itsu.com>
To: Jane Chu <jane.chu@...cle.com>, "x86@...nel.org" <x86@...nel.org>,
"nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>,
"kexec@...ts.infradead.org" <kexec@...ts.infradead.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Yasunori Gotou (Fujitsu)" <y-goto@...itsu.com>,
"Xiao Yang (Fujitsu)" <yangx.jy@...itsu.com>,
"Shiyang Ruan (Fujitsu)" <ruansy.fnst@...itsu.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Eric Biederman <ebiederm@...ssion.com>,
Takashi Iwai <tiwai@...e.de>, Baoquan He <bhe@...hat.com>,
Vlastimil Babka <vbabka@...e.cz>,
Sean Christopherson <seanjc@...gle.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Dan Williams <dan.j.williams@...el.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Ira Weiny <ira.weiny@...el.com>,
Raul E Rangel <rrangel@...omium.org>,
Colin Foster <colin.foster@...advantage.com>,
Vishal Verma <vishal.l.verma@...el.com>
Subject: Re: [RFC PATCH v2 3/3] resource, crash: Make kexec_file_load support
pmem
Jane,
On 28/04/2023 04:41, Jane Chu wrote:
>> diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
>> index cdd92ab43cda..dc9d03083565 100644
>> --- a/arch/x86/kernel/crash.c
>> +++ b/arch/x86/kernel/crash.c
>> @@ -178,6 +178,7 @@ static struct crash_mem *fill_up_crash_elf_data(void)
>> if (!nr_ranges)
>> return NULL;
>> + walk_pmem_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback);
>
> So this will overwrite 'nr_ranges' produced by the previous walk_system_ram_res() call, sure it's correct?
It depends on how the callback walk_system_ram_res() handle 'nr_ranges', so it's safe for this changes IMHO.
163 static int get_nr_ram_ranges_callback(struct resource *res, void *arg)
164 {
165 unsigned int *nr_ranges = arg;
166
167 (*nr_ranges)++;
168 return 0;
169 }
170
171 /* Gather all the required information to prepare elf headers for ram regions */
172 static struct crash_mem *fill_up_crash_elf_data(void)
173 {
174 unsigned int nr_ranges = 0;
175 struct crash_mem *cmem;
176
177 walk_system_ram_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback);
178 if (!nr_ranges)
179 return NULL;
180
181 walk_pmem_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback);
At last, nr_ranges = #ram_res + #pmem_res.
Thanks
Zhijian
>
> Regards,
> -jane
Powered by blists - more mailing lists