Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: WANG Chao <chaowang@redhat.com>
Cc: kexec@lists.infradead.org, ebiederm@xmission.com, vgoyal@redhat.com
Subject: Re: [kexec-tools PATCH] x86: extend kernel text size up to 1GB
Date: Fri, 14 Mar 2014 15:08:52 +0800	[thread overview]
Message-ID: <20140314070852.GC8248@dhcp-16-126.nay.redhat.com> (raw)
In-Reply-To: <20140314070357.GA22782@dhcp-17-89.nay.redhat.com>

On 03/14/14 at 03:03pm, WANG Chao wrote:
> On 03/14/14 at 02:47pm, Dave Young wrote:
> > On 03/14/14 at 02:12pm, Dave Young wrote:
> > > On 03/12/14 at 11:13am, WANG Chao wrote:
> > > > Currently kexec hard code X86_64_KERNEL_TEXT_SIZE to 512M. With kASLR
> > > > enabled (CONFIG_RANDOMIZED_BASE=y), kernel image base offset could be
> > > > randomized from 0 to 1GB and kexec-tools fails to get kernel virtual
> > > > address from /proc/kcore when the offset is >512M.
> > > > 
> > > > Now extend X86_64_KERNEL_TEXT_SIZE to 1GB to adapt kASLR.
> > > > 
> > > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > > ---
> > > >  kexec/arch/i386/crashdump-x86.h | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
> > > > index e68b626..a5b2dfd 100644
> > > > --- a/kexec/arch/i386/crashdump-x86.h
> > > > +++ b/kexec/arch/i386/crashdump-x86.h
> > > > @@ -18,7 +18,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
> > > >  #define X86_64_MAXMEM        		0x3fffffffffffUL
> > > >  
> > > >  /* Kernel text size */
> > > > -#define X86_64_KERNEL_TEXT_SIZE  (512UL*1024*1024)
> > > > +#define X86_64_KERNEL_TEXT_SIZE  (1UL*1024*1024*1024)
> > > 
> > > Should define a new macro such as: X86_KERNEL_TEXT_START_LIMIT (1UL*1024*1024*1024)
> > > and then check end addr with X86_64_KERNEL_TEXT_SIZE + X86_64_KERNEL_TEXT_SIZE
> > 
> > I means check ktext with range <1G - 1.5G>
> 
> You're right.
> 
> I think it's fine adding new macro X86_64_RANDOMIZE_BASE_MAX_OFFSET
> as 0x40000000 (1G) and doing the following check:
> 
> (start >= X86_64__START_KERNEL_map) &&
>  (start <= X86_64__START_KERNEL_map + X86_64_RANDOMIZE_MAX_BASE_OFFSET) &&
>  (end - start <= X86_64_KERNEL_TEXT_SIZE)

end - start < X86_64_KERNEL_TEXT_SIZE should be right, other wise I'm fine.

Thanks
Dave

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

  reply	other threads:[~2014-03-14  7:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12  3:13 [kexec-tools PATCH] x86: extend kernel text size up to 1GB WANG Chao
2014-03-14  6:12 ` Dave Young
2014-03-14  6:47   ` Dave Young
2014-03-14  7:03     ` WANG Chao
2014-03-14  7:08       ` Dave Young [this message]
2014-03-14  7:29         ` WANG Chao
2014-03-20  3:44           ` Simon Horman
2014-03-20  4:53             ` WANG Chao
2014-03-20  5:49               ` 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=20140314070852.GC8248@dhcp-16-126.nay.redhat.com \
    --to=dyoung@redhat.com \
    --cc=chaowang@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=vgoyal@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