From: Gerd Hoffmann <kraxel@redhat.com>
To: Xen Development Mailing List <xen-devel@lists.xensource.com>
Subject: [patch] crashkernel allocation failure #2
Date: Fri, 22 Jun 2007 11:46:07 +0200 [thread overview]
Message-ID: <467B9A5F.20403@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 780 bytes --]
Hi,
Reserving the crashkernel area fails on x86_64 machines with more than
one GB of main memory. The reason for this is that xen maps the
complete physical memory. For memory above 1G (which is covered by the
initial boot mappings) additional page tables are allocated, which
happed to be taken from the crashkernel area. Bummer.
The attached patch fixes that by taking care that the boot allocater
doesn't give out pages from the crash kernel area. It does also take
care that the crash kernel area doesn't overlap with the xen heap and
moves crash kernel area it if needed.
A side effect of the second change is that you can specify just
"crashkernel=64m" and have it moved to the right place just above the
xen heap automagically.
please apply,
Gerd
[-- Attachment #2: xen-crashkernel-2.patch --]
[-- Type: text/x-patch, Size: 1533 bytes --]
--- xen/arch/x86/setup.c.debug 2007-06-21 15:31:00.000000000 +0200
+++ xen/arch/x86/setup.c 2007-06-22 10:13:39.000000000 +0200
@@ -460,6 +460,11 @@
/* Initialise boot-time allocator with all RAM situated after modules. */
xenheap_phys_start = init_boot_allocator(__pa(&_end));
+ if (kexec_crash_area.size > 0 && kexec_crash_area.start < xenheap_phys_end) {
+ printk("Moving crashkernel start: %ldm -> %ldm\n",
+ kexec_crash_area.start >> 20, xenheap_phys_end >> 20);
+ kexec_crash_area.start = xenheap_phys_end;
+ }
nr_pages = 0;
for ( i = 0; i < e820.nr_map; i++ )
{
--- xen/common/page_alloc.c.debug 2007-06-21 15:31:00.000000000 +0200
+++ xen/common/page_alloc.c 2007-06-22 10:12:33.000000000 +0200
@@ -36,6 +36,7 @@
#include <xen/perfc.h>
#include <xen/numa.h>
#include <xen/nodemask.h>
+#include <xen/kexec.h>
#include <asm/page.h>
/*
@@ -262,9 +263,16 @@
unsigned long nr_pfns, unsigned long pfn_align)
{
unsigned long pg, i;
+ unsigned long start_mfn = first_valid_mfn;
+ unsigned long kexec_end = \
+ (kexec_crash_area.start + kexec_crash_area.size) >> PAGE_SHIFT;
+
+ /* make sure we don't give out pages from the crashkernel area */
+ if (start_mfn < kexec_end)
+ start_mfn = kexec_end;
/* Search forwards to obtain lowest available range. */
- for ( pg = first_valid_mfn & ~(pfn_align - 1);
+ for ( pg = start_mfn & ~(pfn_align - 1);
(pg + nr_pfns) <= max_page;
pg = (pg + i + pfn_align) & ~(pfn_align - 1) )
{
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2007-06-22 9:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-22 9:46 Gerd Hoffmann [this message]
2007-06-25 18:26 ` [patch] crashkernel allocation failure #2 Keir Fraser
2007-06-26 6:54 ` Gerd Hoffmann
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=467B9A5F.20403@redhat.com \
--to=kraxel@redhat.com \
--cc=xen-devel@lists.xensource.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 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.