All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Jiri Olsa <jolsa@redhat.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH,RFC] - make /proc/vmcore accesable on x86_64
Date: Fri, 22 Oct 2010 10:54:12 +0200	[thread overview]
Message-ID: <20101022085412.GA8267@verge.net.au> (raw)
In-Reply-To: <20101019150630.GA1870@jolsa.brq.redhat.com>

On Tue, Oct 19, 2010 at 05:06:30PM +0200, Jiri Olsa wrote:
> hi,
> 
> I was playing around with preserve context feature on x86_64
> and was not able to get the /proc/vmcore in the kexec-ed
> kernel until I aplied attached patch.
> 
> I'm not at all sure this is right fix ;) but it seems
> that /proc/vmcore is not loaded since the machine field in the
> elf header is wrong.
> 
> 
> If the x86_64 arch returns 0 (KEXEC_ARCH_DEFAULT) then following
> condition in load_crashdump_segments function will fill 386 as the
> machine for the vmcore elf header..
> 
> ...
> 
>         if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64)
>         {
>                 elf_info.machine = EM_X86_64;
>         } else {
>                 elf_info.machine       = EM_386;
>                 elf_info.lowmem_limit  = X86_MAXMEM;
>                 elf_info.get_note_info = get_crash_notes;
>         }
> ...
> 
> ending with kexec-ed kernel failing check for the machine,
> and disabling vmcore interface...
> 
> 
> I'm guessing that the reason is the load_crashdump_segments function
> being shared among 32 and 64 bits.. but again, not sure ;)
> 
> 
> My goal is to share data within the host and kexec-ed kernel,
> so I'd like to use the /proc/vmcore for that.. any other
> ideas are welcome :)

This approach seems reasonable to me.
I'll push it if a I don't hear any objections
in the near future.

> 
> 
> thanks,
> jirka
> ---
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 06e5ae9..40f989a 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -691,6 +691,8 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
>  	struct memory_range *mem_range, *memmap_p;
>  	struct crash_elf_info elf_info;
>  
> +	memset(&elf_info, 0x0, sizeof(elf_info));
> +
>  	/* Constant parts of the elf_info */
>  	elf_info.data             = ELFDATA2LSB;
>  	elf_info.backup_src_start = BACKUP_SRC_START;
> diff --git a/kexec/arch/x86_64/kexec-x86_64.c b/kexec/arch/x86_64/kexec-x86_64.c
> index 3092643..c34fd92 100644
> --- a/kexec/arch/x86_64/kexec-x86_64.c
> +++ b/kexec/arch/x86_64/kexec-x86_64.c
> @@ -134,10 +134,7 @@ int arch_process_options(int argc, char **argv)
>  }
>  
>  const struct arch_map_entry arches[] = {
> -	/* For compatibility with older patches
> -	 * use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_X86_64 here.
> -	 */
> -	{ "x86_64", KEXEC_ARCH_DEFAULT },
> +	{ "x86_64", KEXEC_ARCH_X86_64 },
>  	{ NULL, 0 },
>  };
>  
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2010-10-23  1:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 15:06 [PATCH,RFC] - make /proc/vmcore accesable on x86_64 Jiri Olsa
2010-10-22  8:54 ` Simon Horman [this message]
2010-10-28 12:16   ` Simon Horman
2010-10-29  7:54     ` [PATCH] " Jiri Olsa
2010-10-31  1:16       ` Simon Horman

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=20101022085412.GA8267@verge.net.au \
    --to=horms@verge.net.au \
    --cc=jolsa@redhat.com \
    --cc=kexec@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.