public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: anderson@redhat.com, kexec@lists.infradead.org,
	Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH] kexec: fix 64Gb limit on x86 w/ PAE
Date: Mon, 12 Apr 2010 15:58:25 +1000	[thread overview]
Message-ID: <20100412055825.GA10066@verge.net.au> (raw)
In-Reply-To: <20100409134111.GA27573@redhat.com>

On Fri, Apr 09, 2010 at 09:41:11AM -0400, Vivek Goyal wrote:
> On Fri, Apr 09, 2010 at 08:17:49AM -0400, Neil Horman wrote:
> > Version 2, with Simons consistency fixes and cleanups
> > 
> > Fix up x86 kexec to exclude memory on i686 kernels beyond 64GB limit
> > 
> > We found a problem recently on x86 systems.  If a 32 bit PAE enabled system
> > contains more then 64GB of physical ram, the kernel will truncate the max_pfn
> > value to 64GB.  Unfortunately it still leaves all the physical memory regions
> > present in /proc/iomem.  Since kexec builds its elf headers based on
> > /proc/iomem the elf headers indicate the size of memory is larger than what the
> > kernel is willing to address.  The result is that, during a copy of
> > /proc/vmcore, a read will return -EFAULT when the requested offset is beyond the
> > 64GB range, leaving the seemingly truncated vmcore useless, as the elf headers
> > indicate memory beyond what the file contains.
> > 
> > The fix for it is pretty straightforward, just ensure that, when on x86 systems,
> > we don't record any entries in the memory_range array that cross  the 64Gb mark.
> > This keeps us in line with the kernel and lets the copy finish sucessfully,
> > providing a workable core
> > 
> > Tested successfully by myself
> > Originally-authored-by: Dave Anderson <anderson@redhat.com>
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > 
> > 
> >  crashdump-x86.c |   15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> > index 9d37442..9d35b3e 100644
> > --- a/kexec/arch/i386/crashdump-x86.c
> > +++ b/kexec/arch/i386/crashdump-x86.c
> > @@ -34,6 +34,12 @@
> >  #include "crashdump-x86.h"
> >  #include <x86/x86-linux.h>
> >  
> > +/*
> > + * This defines the the last address that we can support access to
> > + * with a PAE enabled kernel
> > + */
> > +#define 64G_LIMIT 0xfffffffff
> > +
> >  extern struct arch_options_t arch_options;
> >  
> >  /* Forward Declaration. */
> > @@ -114,6 +120,15 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
> >  		if (end <= 0x0009ffff)
> >  			continue;
> >  
> > +		/*
> > +		 *  Exclude any segments starting at or beyond 64GB, and
> > +		 *  restrict any segments from ending at or beyond 64GB.
> > +		 */
> > +		if (start > 64GB_LIMIT)
> > +			continue;
> > +		if (end > 64GB_LIMIT)
> > +			end = 64GB_LIMIT;
> > +
> 
> Looks good to me.
> 
> Acked-by: Vivek Goyal <vgoyal@redhat.com>

Thanks Neil. Thanks Vivek. Thanks Dave. Applied :-)


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

      reply	other threads:[~2010-04-12  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08 16:46 [PATCH] kexec: fix 64Gb limit on x86 w/ PAE Neil Horman
2010-04-08 22:32 ` Simon Horman
2010-04-09  1:24   ` Neil Horman
2010-04-09  1:41     ` Simon Horman
2010-04-09 11:05       ` Neil Horman
2010-04-09 12:17       ` Neil Horman
2010-04-09 13:41         ` Vivek Goyal
2010-04-12  5:58           ` Simon Horman [this message]

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=20100412055825.GA10066@verge.net.au \
    --to=horms@verge.net.au \
    --cc=anderson@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=nhorman@tuxdriver.com \
    --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