[PATCH] makedumpfile: Enable --mem-usage for s390x

bhe at redhat.com bhe at redhat.com
Mon Oct 27 21:46:20 PDT 2014


On 10/28/14 at 04:34am, Atsushi Kumagai wrote:
> >On 10/23/14 at 06:56am, Atsushi Kumagai wrote:

> >> I noticed that is_vmalloc_addr_x86_64() can't be used as is_phys_addr()
> >> due to the "kaslr issue". I fixed it in the common path as below, but
> >> --mem-usage still has the same issue since initial() will be invoked
> >> after get_kcore_dump_loads().
> >>
> >>   http://lists.infradead.org/pipermail/kexec/2014-October/012743.html
> >>
> >> I know it's so late, but I began to think the current implementation
> >> that invokes vaddr_to_paddr_XXX() before initial() is bad:
> >>
> >> show_mem_usage()
> >>   + get_kcore_dump_loads()
> >>     + process_dump_load()
> >>       + vaddr_to_paddr_XXX()
> >>   + initial()
> >
> >This is a bug. Seems that get_kcore_dump_loads() has to be called in
> >initial(). Since dumped vmcore need contains kernel text segment.
> >Without setting correct value for MODULES_VADDR, it will be equal to
> >__START_KERNEL_map, then calling is_vmalloc_addr() will filter kernel
> >text mapping segment too.
> >
> >Now it seems only one way to solve this, that is moving
> >get_kcore_dump_loads() into initial() just after
> >get_value_for_old_linux() is called.
> 
> I agree, I'll do it, thanks.

Actually hpa haven't merged my patchset. Seems he doesn't like current
kaslr design. I am not sure if we have gone too far to adjust
makedumpfile code to support kaslr. I'll ask him for comments or plans.

Thanks
Baoquan

> 
> 
> Atsushi Kumagai
> 
> >>   ...
> >>
> >> vaddr_to_paddr_XXX() does VtoP translation *properly*, so it needs
> >> several symbols. This design is OK since it's a general method.
> >> OTOH, we need a kludge which can be used under any situations and
> >> should use it for --mem-usage:
> >>
> >>   VtoP_kludge_s390x(unsigned long vaddr)
> >>   {
> >> 	/* s390 has 1:1 VtoP mapping that starts with zero. */
> >>   	return vaddr;
> >>   }
> >>
> >> also x86_64's can be implemented like below:
> >>
> >>   VtoP_kludge_x86_64(unsigned long vaddr)
> >>   {
> >> 	/* if the address is direct mapped, it's easy to translate. */
> >> 	unsigned long paddr = vaddr - PAGE_OFFSET;
> >> 	return paddr;
> >>   }
> >>



More information about the kexec mailing list