From: Yinghai Lu <yhlu.kernel@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 11/16] x86: move back crashkernel back to setup.c
Date: Wed, 25 Jun 2008 17:57:13 -0700 [thread overview]
Message-ID: <200806251757.13333.yhlu.kernel@gmail.com> (raw)
In-Reply-To: <200806251748.06743.yhlu.kernel@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
---
arch/x86/kernel/setup.c | 58 +++++++++++++++++++++++++++++++++++++++++
arch/x86/kernel/setup_percpu.c | 57 ----------------------------------------
2 files changed, 58 insertions(+), 57 deletions(-)
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -397,6 +397,64 @@ void __init parse_setup_data(void)
}
/*
+ * --------- Crashkernel reservation ------------------------------
+ */
+
+#ifdef CONFIG_KEXEC
+static inline unsigned long long get_total_mem(void)
+{
+ unsigned long long total;
+
+ total = max_low_pfn - min_low_pfn;
+#ifdef CONFIG_HIGHMEM
+ total += highend_pfn - highstart_pfn;
+#endif
+
+ return total << PAGE_SHIFT;
+}
+
+void __init reserve_crashkernel(void)
+{
+ unsigned long long total_mem;
+ unsigned long long crash_size, crash_base;
+ int ret;
+
+ total_mem = get_total_mem();
+
+ ret = parse_crashkernel(boot_command_line, total_mem,
+ &crash_size, &crash_base);
+ if (ret == 0 && crash_size > 0) {
+ if (crash_base <= 0) {
+ printk(KERN_INFO "crashkernel reservation failed - "
+ "you have to specify a base address\n");
+ return;
+ }
+
+ if (reserve_bootmem_generic(crash_base, crash_size,
+ BOOTMEM_EXCLUSIVE) < 0) {
+ printk(KERN_INFO "crashkernel reservation failed - "
+ "memory is in use\n");
+ return;
+ }
+
+ printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
+ "for crashkernel (System RAM: %ldMB)\n",
+ (unsigned long)(crash_size >> 20),
+ (unsigned long)(crash_base >> 20),
+ (unsigned long)(total_mem >> 20));
+
+ crashk_res.start = crash_base;
+ crashk_res.end = crash_base + crash_size - 1;
+ insert_resource(&iomem_resource, &crashk_res);
+ }
+}
+#else
+void __init reserve_crashkernel(void)
+{
+}
+#endif
+
+/*
* Determine if we were loaded by an EFI loader. If so, then we have also been
* passed the efi memmap, systab, etc., so we should use these data structures
* for initialization. Note, the efi init code path is determined by the
Index: linux-2.6/arch/x86/kernel/setup_percpu.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_percpu.c
+++ linux-2.6/arch/x86/kernel/setup_percpu.c
@@ -387,63 +387,6 @@ EXPORT_SYMBOL(node_to_cpumask);
#endif /* X86_64_NUMA */
-/*
- * --------- Crashkernel reservation ------------------------------
- */
-
-static inline unsigned long long get_total_mem(void)
-{
- unsigned long long total;
-
- total = max_low_pfn - min_low_pfn;
-#ifdef CONFIG_HIGHMEM
- total += highend_pfn - highstart_pfn;
-#endif
-
- return total << PAGE_SHIFT;
-}
-
-#ifdef CONFIG_KEXEC
-void __init reserve_crashkernel(void)
-{
- unsigned long long total_mem;
- unsigned long long crash_size, crash_base;
- int ret;
-
- total_mem = get_total_mem();
-
- ret = parse_crashkernel(boot_command_line, total_mem,
- &crash_size, &crash_base);
- if (ret == 0 && crash_size > 0) {
- if (crash_base <= 0) {
- printk(KERN_INFO "crashkernel reservation failed - "
- "you have to specify a base address\n");
- return;
- }
-
- if (reserve_bootmem_generic(crash_base, crash_size,
- BOOTMEM_EXCLUSIVE) < 0) {
- printk(KERN_INFO "crashkernel reservation failed - "
- "memory is in use\n");
- return;
- }
-
- printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
- "for crashkernel (System RAM: %ldMB)\n",
- (unsigned long)(crash_size >> 20),
- (unsigned long)(crash_base >> 20),
- (unsigned long)(total_mem >> 20));
-
- crashk_res.start = crash_base;
- crashk_res.end = crash_base + crash_size - 1;
- insert_resource(&iomem_resource, &crashk_res);
- }
-}
-#else
-void __init reserve_crashkernel(void)
-{}
-#endif
-
static struct resource standard_io_resources[] = {
{ .name = "dma1", .start = 0x00, .end = 0x1f,
.flags = IORESOURCE_BUSY | IORESOURCE_IO },
next prev parent reply other threads:[~2008-06-26 1:05 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-26 0:48 [PATCH 00/16] x86: merge setup_32/64.c Yinghai Lu
2008-06-26 0:49 ` [PATCH 03/16] x86: update reserve_initrd to support 64bit Yinghai Lu
2008-06-26 0:50 ` [PATCH 04/16] x86: put global variable for 32bit all together Yinghai Lu
2008-06-26 0:51 ` [PATCH 05/16] x86: add extra includes for 64bit support Yinghai Lu
2008-06-26 0:52 ` [PATCH 06/16] x86: merge 64bit setup_arch into setup_32 Yinghai Lu
2008-06-26 0:53 ` [PATCH 07/16] x86: space to tab in setup_arch Yinghai Lu
2008-06-26 0:54 ` [PATCH 08/16] x86: rename setup_32.c to setup.c Yinghai Lu
2008-06-26 0:55 ` [PATCH 09/16] x86: move boot_params back " Yinghai Lu
2008-06-26 0:56 ` [PATCH 10/16] x86: move parse_setup_data " Yinghai Lu
2008-06-26 0:57 ` Yinghai Lu [this message]
2008-06-26 0:58 ` [PATCH 12/16] x86: move reserve_standard_io_resources " Yinghai Lu
2008-06-26 0:58 ` [PATCH 13/16] x86: move parse elfvorehdr " Yinghai Lu
2008-06-26 0:59 ` [PATCH 14/16] x86: make x86_find_smp_config depends on 64 bit too Yinghai Lu
2008-06-26 1:00 ` [PATCH 15/16] x86: change some functions in setup.c to static Yinghai Lu
2008-06-26 1:02 ` [PATCH 16/16] x86: we only have init_pg_tables_end for 32bit Yinghai Lu
2008-06-26 2:52 ` [PATCH] x86: clean up ARCH_SETUP Yinghai Lu
2008-06-26 13:26 ` Ingo Molnar
2008-06-26 4:51 ` [PATCH] x86: move fix mapping page table range early Yinghai Lu
2008-06-26 13:27 ` Ingo Molnar
2008-06-27 6:17 ` [PATCH] x86: early res print out alignment Yinghai Lu
2008-06-27 8:41 ` [PATCH] x86: let setup_arch call init_apic_mappings for 32bit Yinghai Lu
2008-06-28 6:37 ` Ingo Molnar
2008-06-27 22:36 ` [PATCH] x86: early res print out alignment v2 Yinghai Lu
2008-06-28 6:36 ` Ingo Molnar
2008-06-29 4:42 ` Yinghai Lu
2008-06-27 22:38 ` [PATCH] x86: fix init_memory_mapping over boundary Yinghai Lu
2008-06-28 5:47 ` [PATCH] x86: fix init_memory_mapping over boundary v2 Yinghai Lu
2008-06-28 6:35 ` Ingo Molnar
2008-06-28 7:01 ` Yinghai Lu
2008-06-28 7:02 ` Ingo Molnar
2008-06-28 7:19 ` Yinghai Lu
2008-06-28 7:21 ` Ingo Molnar
2008-06-28 7:42 ` Yinghai Lu
2008-06-28 7:22 ` Yinghai Lu
2008-06-28 7:47 ` Ingo Molnar
2008-06-28 10:30 ` Yinghai Lu
2008-06-28 11:07 ` Ingo Molnar
2008-06-28 17:38 ` Jeremy Fitzhardinge
2008-06-28 20:33 ` Yinghai Lu
2008-06-29 0:49 ` [PATCH] x86: fix init_memory_mapping over boundary v4 Yinghai Lu
2008-06-29 2:22 ` Jeremy Fitzhardinge
2008-06-29 4:40 ` Yinghai Lu
2008-06-29 5:18 ` Jeremy Fitzhardinge
2008-06-29 7:08 ` Ingo Molnar
2008-06-29 7:30 ` Yinghai Lu
2008-06-30 8:33 ` Ingo Molnar
2008-06-29 7:39 ` [PATCH] x86: fix init_memory_mapping over boundary v4 - diff to v3 Yinghai Lu
2008-06-29 9:48 ` Ingo Molnar
2008-06-29 0:49 ` [PATCH] x86: fix warning in e820_reserve_resources with 32bit Yinghai Lu
2008-06-29 9:49 ` Ingo Molnar
2008-06-26 9:47 ` [PATCH 00/16] x86: merge setup_32/64.c Ingo Molnar
2008-06-26 10:02 ` Ingo Molnar
2008-06-26 10:06 ` Yinghai Lu
2008-06-26 11:01 ` Ingo Molnar
2008-06-27 2:51 ` Huang, Ying
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=200806251757.13333.yhlu.kernel@gmail.com \
--to=yhlu.kernel@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.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