[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130507152401.GB12965@redhat.com>
Date: Tue, 7 May 2013 11:24:01 -0400
From: Vivek Goyal <vgoyal@...hat.com>
To: HATAYAMA Daisuke <d.hatayama@...fujitsu.com>
Cc: kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
lisa.mitchell@...com, kumagai-atsushi@....nes.nec.co.jp,
ebiederm@...ssion.com, zhangyanfei@...fujitsu.com,
akpm@...ux-foundation.org, cpw@....com, jingbai.ma@...com
Subject: Re: [PATCH v4 7/8] vmcore: treat memory chunks referenced by PT_LOAD
program header entries in page-size boundary in vmcore_list
On Tue, May 07, 2013 at 04:38:04PM +0900, HATAYAMA Daisuke wrote:
[..]
> >> /* Update the program header offset. */
> >>- phdr_ptr->p_offset = vmcore_off;
> >>- vmcore_off = vmcore_off + phdr_ptr->p_memsz;
> >>+ phdr_ptr->p_offset = vmcore_off + (paddr - start);
> >
> >What's paddr-start. Why following is not sufficient.
> >
> >phdr_ptr->p_offset = vmcore_off
> >
>
> (paddr - start) is offset of the memory program header refers to,
> from which kernel memory starts. Pictrically:
>
> vmcore_off +----------------------+
> | extra memory |
> | (non kernel memory) |
> phdr->p_offset = +----------------------+
> vmcore_off + (paddr - start) | |\
> | kernel memory | phdr->p_memsz
> | |/
> +----------------------+
> | extra memory |
> | (non kernel memory) |
> vmcore_off + size +----------------------+
Ok, got it. So PT_LOAD header refers to only part of memory and we
align start and end to PAGE_SIZE and then add that full chunk to
vmcore list. We update the phdr->offset to point to PT_LOAD
mapping. vc_list area can contain the page aligned extra memory at the
beginning and end and that can be read from old memory if user wishes
to.
So this is not an issue.
Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists