From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.redhat.com ([209.132.183.28]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eWIZ8-0007kC-0B for kexec@lists.infradead.org; Tue, 02 Jan 2018 09:08:58 +0000 Date: Tue, 2 Jan 2018 17:08:36 +0800 From: Baoquan He Subject: Re: [PATCH] handle renamed init_level4_pgt -> init_top_pgt Message-ID: <20180102090836.GA2338@x1> References: <0910DD04CBD6DE4193FCF86B9C00BE9701F22E63@BPXM01GP.gisp.nec.co.jp> <0910DD04CBD6DE4193FCF86B9C00BE9701F2A617@BPXM01GP.gisp.nec.co.jp> <20171220072443.GA7413@dhcp-128-65.nay.redhat.com> <0910DD04CBD6DE4193FCF86B9C00BE9701F2D609@BPXM01GP.gisp.nec.co.jp> <20171222045444.GA978@dhcp-128-65.nay.redhat.com> <20171222054829.GA21523@dhcp-128-65.nay.redhat.com> <0910DD04CBD6DE4193FCF86B9C00BE9701F31899@BPXM01GP.gisp.nec.co.jp> <20180102085703.GA18368@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180102085703.GA18368@dhcp-128-65.nay.redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Dave Young Cc: Atsushi Kumagai , Jeff Mahoney , "kexec@lists.infradead.org" , Keiichirou Suzuki On 01/02/18 at 04:57pm, Dave Young wrote: > The root cause is this commit makes mem_section as a pointer instead of > the static array. > > VMCOREINFO_SYMBOL() expand it as &mem_section, this is not correct in > the test case any more. > > This hack code works for me: > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index b3663896278e..f5fe6068ae39 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -376,6 +376,8 @@ phys_addr_t __weak paddr_vmcoreinfo_note(void) > { > return __pa(vmcoreinfo_note); > } > +#define VMCOREINFO_SYMBOL_HACK(name) \ > + vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)name) Oh, you made a new one. We may use vmcoreinfo_append_str directly since there's an existing one in crash_save_vmcoreinfo(): vmcoreinfo_append_str("CRASHTIME=%ld\n", get_seconds()); The thing is that VMCOREINFO_SYMBOL will reference symbol. While checking all exported symbol, all of them are array names. So here the value of &array_name is equal to the address of the first element of array. Now the first exception appeared, mem_section, which could be not an array name, but a pointer pointing at the allocated memory. For this issue, we either change as Dave mentioned two options, or can we adjust VMCOREINFO_SYMBOL(name)? > > static int __init crash_save_vmcoreinfo_init(void) > { > @@ -410,10 +412,11 @@ static int __init crash_save_vmcoreinfo_init(void) > VMCOREINFO_SYMBOL(contig_page_data); > #endif > #ifdef CONFIG_SPARSEMEM > - VMCOREINFO_SYMBOL(mem_section); > + VMCOREINFO_SYMBOL_HACK(mem_section); > VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS); > VMCOREINFO_STRUCT_SIZE(mem_section); > VMCOREINFO_OFFSET(mem_section, section_mem_map); > + > #endif > VMCOREINFO_STRUCT_SIZE(page); > VMCOREINFO_STRUCT_SIZE(pglist_data); > > > But probably we need this instead, but I can not test it because I do > not know how to fix makedumpfile to use a _NUMBER instead of a SYMBOL. > Thus bring up the issue, seeking for thoughts and discussion. > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index b3663896278e..dfa2238e2c28 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -410,10 +410,17 @@ static int __init crash_save_vmcoreinfo_init(void) > VMCOREINFO_SYMBOL(contig_page_data); > #endif > #ifdef CONFIG_SPARSEMEM > +#ifdef CONFIG_SPARSEMEM_EXTREME > + VMCOREINFO_NUMBER(mem_section); > +#else > VMCOREINFO_SYMBOL(mem_section); > +#endif > VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS); > VMCOREINFO_STRUCT_SIZE(mem_section); > VMCOREINFO_OFFSET(mem_section, section_mem_map); > > [snip] > > Thanks > Dave _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec