Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Baoquan He <bhe@redhat.com>
Cc: "Thomas D." <whissi@whissi.de>,
	Kexec Mailing List <kexec@lists.infradead.org>,
	Kees Cook <keescook@chromium.org>,
	WANG Chao <chaowang@redhat.com>
Subject: Re: kexec fails to boot kernels where CONFIG_RANDOMIZE_BASE=y is set
Date: Fri, 22 Aug 2014 09:16:23 -0400	[thread overview]
Message-ID: <20140822131623.GI5954@redhat.com> (raw)
In-Reply-To: <20140822115902.GA12681@dhcp-16-116.nay.redhat.com>

On Fri, Aug 22, 2014 at 07:59:02PM +0800, Baoquan He wrote:

[..]
> So we have 2 choices for kexec/kdump:
> 1) kexec/kdump kernel need not randomize the kernel starting point.
> Since kexec/kdump kernel is only for testing or emergencey, its life is
> not too long.
> 
> 2) makes slots around the kernel input addr. This is only useful for
> kexec. I can't imagine why kdump need it. 
> 
> 
> 
> 
> Hi Thomas,
> Could you test below patch? 
> 
> 
> This is patch is from Lu Yinghai.
> ---
>  arch/x86/boot/compressed/misc.c |   14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6/arch/x86/boot/compressed/misc.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/boot/compressed/misc.c
> +++ linux-2.6/arch/x86/boot/compressed/misc.c
> @@ -235,8 +235,9 @@ static void error(char *x)
>  		asm("hlt");
>  }
>  
> -#if CONFIG_X86_NEED_RELOCS
> -static void handle_relocations(void *output, unsigned long output_len)
> +#ifdef CONFIG_X86_NEED_RELOCS
> +static void handle_relocations(void *output_orig, void *output,
> +			       unsigned long output_len)
>  {
>  	int *reloc;
>  	unsigned long delta, map, ptr;
> @@ -247,7 +248,7 @@ static void handle_relocations(void *out
>  	 * Calculate the delta between where vmlinux was linked to load
>  	 * and where it was actually loaded.
>  	 */
> -	delta = min_addr - LOAD_PHYSICAL_ADDR;
> +	delta = min_addr - (unsigned long)output_orig;

So what does this patch actuall do? If I try to trace back output_orig,
it seems to be same as LOAD_PHYSICAL_ADDR. That means there should not
be any effect of this change? Or did I not understand it.

Look at head_64.S

movq    $LOAD_PHYSICAL_ADDR, %rbp
...
...
movq    %rbp, %r8               /* output target address */
call    decompress_kernel       /* returns kernel location in %rax */

Thanks
Vivek

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

  parent reply	other threads:[~2014-08-22 13:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 21:02 kexec fails to boot kernels where CONFIG_RANDOMIZE_BASE=y is set Thomas D.
2014-08-18 14:57 ` Vivek Goyal
2014-08-19  9:07   ` WANG Chao
2014-08-20 14:33     ` Vivek Goyal
2014-08-21 15:57       ` Kees Cook
2014-08-21 18:10         ` Vivek Goyal
2014-08-21 19:02           ` Vivek Goyal
2014-08-21 19:27             ` Thomas D.
2014-08-22 18:18               ` Kexec failing in handle_relocations() (Was: Re: kexec fails to boot kernels where CONFIG_RANDOMIZE_BASE=y is set) Vivek Goyal
2014-08-21 19:16           ` kexec fails to boot kernels where CONFIG_RANDOMIZE_BASE=y is set Vivek Goyal
2014-08-22  3:19           ` WANG Chao
2014-08-22 11:59             ` Baoquan He
2014-08-22 12:30               ` Thomas D.
2014-08-22 12:40                 ` Vivek Goyal
2014-08-22 13:23                   ` Thomas D.
2014-08-22 13:16               ` Vivek Goyal [this message]
2014-08-22 14:44                 ` Baoquan He
2014-08-22 12:38             ` Vivek Goyal
2014-08-22 12:47               ` Thomas D.
2014-08-22 12:53                 ` Vivek Goyal
2014-08-22 14:59                   ` 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=20140822131623.GI5954@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=bhe@redhat.com \
    --cc=chaowang@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kexec@lists.infradead.org \
    --cc=whissi@whissi.de \
    /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