All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Simon Horman <horms@verge.net.au>,
	"H. Peter Anvin" <hpa@zytor.com>, Vivek Goyal <vgoyal@redhat.com>,
	Haren Myneni <hbabu@us.ibm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Cc: Yinghai Lu <yinghai@kernel.org>, kexec@lists.infradead.org
Subject: [PATCH v6 6/6] kexec, x86: handle Crash low kernel range
Date: Thu, 13 Dec 2012 14:18:32 -0800	[thread overview]
Message-ID: <1355437112-9250-7-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1355437112-9250-1-git-send-email-yinghai@kernel.org>

kernel could have that in /proc/iomem, will use it for kdump kernel
for dma32

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 kexec/arch/i386/crashdump-x86.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 245402c..83bff5e 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -188,6 +188,8 @@ static struct memory_range crash_memory_range[CRASH_MAX_MEMORY_RANGES];
 
 /* Memory region reserved for storing panic kernel and other data. */
 static struct memory_range crash_reserved_mem;
+/* under 4G parts */
+static struct memory_range crash_reserved_low_mem;
 
 /* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to
  * create Elf headers. Keeping it separate from get_memory_ranges() as
@@ -282,6 +284,10 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
 	if (exclude_region(&memory_ranges, crash_reserved_mem.start,
 				crash_reserved_mem.end) < 0)
 		return -1;
+	if (crash_reserved_low_mem.start &&
+	    exclude_region(&memory_ranges, crash_reserved_low_mem.start,
+				crash_reserved_low_mem.end) < 0)
+		return -1;
 	if (gart) {
 		/* exclude GART region if the system has one */
 		if (exclude_region(&memory_ranges, gart_start, gart_end) < 0)
@@ -984,6 +990,12 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
 		return ENOCRASHKERNEL;
 	}
 
+	if (crash_reserved_low_mem.start) {
+		sz = crash_reserved_low_mem.end - crash_reserved_low_mem.start
+					 +1;
+		add_memmap(memmap_p, crash_reserved_low_mem.start, sz);
+	}
+
 	/* Create a backup region segment to store backup data*/
 	if (!(info->kexec_flags & KEXEC_PRESERVE_CONTEXT)) {
 		sz = (info->backup_src_size + align) & ~(align - 1);
@@ -1059,5 +1071,14 @@ int is_crashkernel_mem_reserved(void)
 	crash_reserved_mem.end = end;
 	crash_reserved_mem.type = RANGE_RAM;
 
+	/* If there is no Crash low kernel, still can go on */
+	if (parse_iomem_single("Crash kernel low\n", &start, &end) ||
+					start == end)
+		return 1;
+
+	crash_reserved_low_mem.start = start;
+	crash_reserved_low_mem.end = end;
+	crash_reserved_low_mem.type = RANGE_RAM;
+
 	return 1;
 }
-- 
1.7.10.4


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

  parent reply	other threads:[~2012-12-13 22:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13 22:18 [PATCH v6 0/6] kexec: put bzImage and ramdisk above 4G for x86 64bit Yinghai Lu
2012-12-13 22:18 ` [PATCH v6 1/6] kexec, x86: add boot header member for version 2.12 Yinghai Lu
2012-12-13 22:18 ` [PATCH v6 2/6] kexec, x86: clean boot_params area for entry-32bit path Yinghai Lu
2012-12-13 22:18 ` [PATCH v6 3/6] kexec, x86: Fix bzImage real-mode booting Yinghai Lu
2012-12-13 23:42   ` H. Peter Anvin
2012-12-14  0:06     ` Yinghai Lu
2012-12-13 22:18 ` [PATCH v6 4/6] kexec, x86: put ramdisk/cmd_line above 4G for 64bit bzImage Yinghai Lu
2012-12-13 22:18 ` [PATCH v6 5/6] kexec, x86_64: Load bzImage64 above 4G Yinghai Lu
2012-12-13 22:18 ` Yinghai Lu [this message]
2012-12-14  0:41 ` [PATCH v6 0/6] kexec: put bzImage and ramdisk above 4G for x86 64bit H. Peter Anvin
2012-12-14  0:47   ` Yinghai Lu

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=1355437112-9250-7-git-send-email-yinghai@kernel.org \
    --to=yinghai@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=hbabu@us.ibm.com \
    --cc=horms@verge.net.au \
    --cc=hpa@zytor.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 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.