mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Baoquan He <bhe@redhat.com>
Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, akpm@linux-foundation.org, mingo@redhat.com,
	hpa@zytor.com, dyoung@redhat.com, tonli@redhat.com,
	keescook@chromium.org, takahiro.akashi@linaro.org,
	thgarnie@google.com, ats-kumagai@wm.jp.nec.com
Subject: Re: [PATCH] kexec: Export memory sections virtual addresses to vmcoreinfo
Date: Thu, 06 Oct 2016 15:07:53 -0500	[thread overview]
Message-ID: <877f9lckbq.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <1475743561-23912-1-git-send-email-bhe@redhat.com> (Baoquan He's message of "Thu, 6 Oct 2016 16:46:01 +0800")

Baoquan He <bhe@redhat.com> writes:

> KASLR memory randomization can randomize the base of the physical memory
> mapping (PAGE_OFFSET), vmalloc (VMALLOC_START) and vmemmap
> (VMEMMAP_START). These need be exported to VMCOREINFO so that user space
> utility, mainly makedumpfile can use them to identify the base of each
> memory section. Here using VMCOREINFO_NUMBER we can reuse the existing
> struct number_table in makedumpfile to import data easily.
>
> Since they are related to x86_64 only, put them into
> arch_crash_save_vmcoreinfo. And move the exportion of KERNEL_IMAGE_SIZE
> together since it's also for x86_64 only.

*Scratches my head*  I would have thought this information would have
better fit in the ELF header.  Where it actually has a field for virtual
address.  It also has a field for physical address, and a third field
for offset in the file (which is where the kdump finds these things in
memory aftewards).

Why do we need need more magic vmcoreinfo to handle this?

Eric

 
>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  arch/x86/kernel/machine_kexec_64.c | 4 ++++
>  kernel/kexec_core.c                | 3 ---
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
> index 5a294e4..e150dd7 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -337,6 +337,10 @@ void arch_crash_save_vmcoreinfo(void)
>  #endif
>  	vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
>  			      kaslr_offset());
> +	VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
> +	VMCOREINFO_NUMBER(PAGE_OFFSET);
> +	VMCOREINFO_NUMBER(VMALLOC_START);
> +	VMCOREINFO_NUMBER(VMEMMAP_START);
>  }
>  
>  /* arch-dependent functionality related to kexec file-based syscall */
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 5616755..8ad3a29e 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -1467,9 +1467,6 @@ static int __init crash_save_vmcoreinfo_init(void)
>  #endif
>  	VMCOREINFO_NUMBER(PG_head_mask);
>  	VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
> -#ifdef CONFIG_X86
> -	VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
> -#endif
>  #ifdef CONFIG_HUGETLB_PAGE
>  	VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);
>  #endif

  reply	other threads:[~2016-10-06 20:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  8:46 Baoquan He
2016-10-06 20:07 ` Eric W. Biederman [this message]
2016-10-11  7:41   ` Baoquan He
2016-10-11  8:19     ` Dave Young
2016-10-11  8:43       ` Dave Young
2016-10-12  0:26       ` Baoquan He
2016-10-12  9:09         ` Pratyush Anand
2016-10-13  8:53           ` Baoquan He
2016-10-14  3:13             ` Dave Young
2016-11-01  5:10 ` Dave Young
2016-11-01  5:33   ` Baoquan He
2016-11-01 14:13     ` Dave Anderson
2016-11-02  1:34       ` Baoquan He
2016-11-02 13:29         ` Dave Anderson
2016-11-02 13:48           ` Baoquan He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877f9lckbq.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=ats-kumagai@wm.jp.nec.com \
    --cc=bhe@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=tonli@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome