From: Bernhard Walle <bwalle@suse.de>
To: kexec@lists.infradead.org, akpm@linux-foundation.org
Cc: linux-arch@vger.kernel.org, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org
Subject: [patch 5/7] Use extended crashkernel command line on ppc64
Date: Tue, 25 Sep 2007 20:23:02 +0200 [thread overview]
Message-ID: <20070925182259.398924232@strauss.suse.de> (raw)
In-Reply-To: 20070925182257.900701776@strauss.suse.de
[-- Attachment #1: crashkernel-ppc64 --]
[-- Type: text/plain, Size: 2704 bytes --]
This patch adapts the ppc64 code to use the generic parse_crashkernel()
function introduced in the generic patch of that series.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
---
arch/powerpc/kernel/machine_kexec.c | 52 ++++++++++++++++++------------------
1 file changed, 26 insertions(+), 26 deletions(-)
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -61,45 +61,39 @@ NORET_TYPE void machine_kexec(struct kim
for(;;);
}
-static int __init early_parse_crashk(char *p)
+void __init reserve_crashkernel(void)
{
- unsigned long size;
-
- if (!p)
- return 1;
-
- size = memparse(p, &p);
+ unsigned long long crash_size, crash_base;
+ int ret;
- if (*p == '@')
- crashk_res.start = memparse(p + 1, &p);
- else
- crashk_res.start = KDUMP_KERNELBASE;
-
- crashk_res.end = crashk_res.start + size - 1;
-
- return 0;
-}
-early_param("crashkernel", early_parse_crashk);
+ /* this is necessary because of lmb_phys_mem_size() */
+ lmb_analyze();
-void __init reserve_crashkernel(void)
-{
- unsigned long size;
+ /* use common parsing */
+ ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(),
+ &crash_size, &crash_base);
+ if (ret == 0 && crash_size > 0) {
+ if (crash_base == 0)
+ crash_base = KDUMP_KERNELBASE;
+ crashk_res.start = crash_base;
+ } else {
+ /* handle the device tree */
+ crash_size = crashk_res.end - crashk_res.start + 1;
+ }
- if (crashk_res.start == 0)
+ if (crash_size == 0)
return;
/* We might have got these values via the command line or the
* device tree, either way sanitise them now. */
- size = crashk_res.end - crashk_res.start + 1;
-
if (crashk_res.start != KDUMP_KERNELBASE)
printk("Crash kernel location must be 0x%x\n",
KDUMP_KERNELBASE);
crashk_res.start = KDUMP_KERNELBASE;
- size = PAGE_ALIGN(size);
- crashk_res.end = crashk_res.start + size - 1;
+ crash_size = PAGE_ALIGN(crash_size);
+ crashk_res.end = crashk_res.start + crash_size - 1;
/* Crash kernel trumps memory limit */
if (memory_limit && memory_limit <= crashk_res.end) {
@@ -108,7 +102,13 @@ void __init reserve_crashkernel(void)
memory_limit);
}
- lmb_reserve(crashk_res.start, size);
+ printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
+ "for crashkernel (System RAM: %ldMB)\n",
+ (unsigned long)(crash_size >> 20),
+ (unsigned long)(crashk_res.start >> 20),
+ (unsigned long)(lmb_phys_mem_size() >> 20));
+
+ lmb_reserve(crashk_res.start, crash_size);
}
int overlaps_crashkernel(unsigned long start, unsigned long size)
--
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Bernhard Walle <bwalle@suse.de>
To: kexec@lists.infradead.org, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linuxppc-dev@ozlabs.org
Subject: [patch 5/7] Use extended crashkernel command line on ppc64
Date: Tue, 25 Sep 2007 20:23:02 +0200 [thread overview]
Message-ID: <20070925182259.398924232@strauss.suse.de> (raw)
In-Reply-To: 20070925182257.900701776@strauss.suse.de
[-- Attachment #1: crashkernel-ppc64 --]
[-- Type: text/plain, Size: 2560 bytes --]
This patch adapts the ppc64 code to use the generic parse_crashkernel()
function introduced in the generic patch of that series.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
---
arch/powerpc/kernel/machine_kexec.c | 52 ++++++++++++++++++------------------
1 file changed, 26 insertions(+), 26 deletions(-)
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -61,45 +61,39 @@ NORET_TYPE void machine_kexec(struct kim
for(;;);
}
-static int __init early_parse_crashk(char *p)
+void __init reserve_crashkernel(void)
{
- unsigned long size;
-
- if (!p)
- return 1;
-
- size = memparse(p, &p);
+ unsigned long long crash_size, crash_base;
+ int ret;
- if (*p == '@')
- crashk_res.start = memparse(p + 1, &p);
- else
- crashk_res.start = KDUMP_KERNELBASE;
-
- crashk_res.end = crashk_res.start + size - 1;
-
- return 0;
-}
-early_param("crashkernel", early_parse_crashk);
+ /* this is necessary because of lmb_phys_mem_size() */
+ lmb_analyze();
-void __init reserve_crashkernel(void)
-{
- unsigned long size;
+ /* use common parsing */
+ ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(),
+ &crash_size, &crash_base);
+ if (ret == 0 && crash_size > 0) {
+ if (crash_base == 0)
+ crash_base = KDUMP_KERNELBASE;
+ crashk_res.start = crash_base;
+ } else {
+ /* handle the device tree */
+ crash_size = crashk_res.end - crashk_res.start + 1;
+ }
- if (crashk_res.start == 0)
+ if (crash_size == 0)
return;
/* We might have got these values via the command line or the
* device tree, either way sanitise them now. */
- size = crashk_res.end - crashk_res.start + 1;
-
if (crashk_res.start != KDUMP_KERNELBASE)
printk("Crash kernel location must be 0x%x\n",
KDUMP_KERNELBASE);
crashk_res.start = KDUMP_KERNELBASE;
- size = PAGE_ALIGN(size);
- crashk_res.end = crashk_res.start + size - 1;
+ crash_size = PAGE_ALIGN(crash_size);
+ crashk_res.end = crashk_res.start + crash_size - 1;
/* Crash kernel trumps memory limit */
if (memory_limit && memory_limit <= crashk_res.end) {
@@ -108,7 +102,13 @@ void __init reserve_crashkernel(void)
memory_limit);
}
- lmb_reserve(crashk_res.start, size);
+ printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
+ "for crashkernel (System RAM: %ldMB)\n",
+ (unsigned long)(crash_size >> 20),
+ (unsigned long)(crashk_res.start >> 20),
+ (unsigned long)(lmb_phys_mem_size() >> 20));
+
+ lmb_reserve(crashk_res.start, crash_size);
}
int overlaps_crashkernel(unsigned long start, unsigned long size)
--
WARNING: multiple messages have this Message-ID (diff)
From: Bernhard Walle <bwalle@suse.de>
To: kexec@lists.infradead.org, akpm@linux-foundation.org
Cc: linux-arch@vger.kernel.org, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org
Subject: [patch 5/7] Use extended crashkernel command line on ppc64
Date: Tue, 25 Sep 2007 20:23:02 +0200 [thread overview]
Message-ID: <20070925182259.398924232@strauss.suse.de> (raw)
In-Reply-To: 20070925182257.900701776@strauss.suse.de
This patch adapts the ppc64 code to use the generic parse_crashkernel()
function introduced in the generic patch of that series.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
---
arch/powerpc/kernel/machine_kexec.c | 52 ++++++++++++++++++------------------
1 file changed, 26 insertions(+), 26 deletions(-)
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -61,45 +61,39 @@ NORET_TYPE void machine_kexec(struct kim
for(;;);
}
-static int __init early_parse_crashk(char *p)
+void __init reserve_crashkernel(void)
{
- unsigned long size;
-
- if (!p)
- return 1;
-
- size = memparse(p, &p);
+ unsigned long long crash_size, crash_base;
+ int ret;
- if (*p == '@')
- crashk_res.start = memparse(p + 1, &p);
- else
- crashk_res.start = KDUMP_KERNELBASE;
-
- crashk_res.end = crashk_res.start + size - 1;
-
- return 0;
-}
-early_param("crashkernel", early_parse_crashk);
+ /* this is necessary because of lmb_phys_mem_size() */
+ lmb_analyze();
-void __init reserve_crashkernel(void)
-{
- unsigned long size;
+ /* use common parsing */
+ ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(),
+ &crash_size, &crash_base);
+ if (ret == 0 && crash_size > 0) {
+ if (crash_base == 0)
+ crash_base = KDUMP_KERNELBASE;
+ crashk_res.start = crash_base;
+ } else {
+ /* handle the device tree */
+ crash_size = crashk_res.end - crashk_res.start + 1;
+ }
- if (crashk_res.start == 0)
+ if (crash_size == 0)
return;
/* We might have got these values via the command line or the
* device tree, either way sanitise them now. */
- size = crashk_res.end - crashk_res.start + 1;
-
if (crashk_res.start != KDUMP_KERNELBASE)
printk("Crash kernel location must be 0x%x\n",
KDUMP_KERNELBASE);
crashk_res.start = KDUMP_KERNELBASE;
- size = PAGE_ALIGN(size);
- crashk_res.end = crashk_res.start + size - 1;
+ crash_size = PAGE_ALIGN(crash_size);
+ crashk_res.end = crashk_res.start + crash_size - 1;
/* Crash kernel trumps memory limit */
if (memory_limit && memory_limit <= crashk_res.end) {
@@ -108,7 +102,13 @@ void __init reserve_crashkernel(void)
memory_limit);
}
- lmb_reserve(crashk_res.start, size);
+ printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
+ "for crashkernel (System RAM: %ldMB)\n",
+ (unsigned long)(crash_size >> 20),
+ (unsigned long)(crashk_res.start >> 20),
+ (unsigned long)(lmb_phys_mem_size() >> 20));
+
+ lmb_reserve(crashk_res.start, crash_size);
}
int overlaps_crashkernel(unsigned long start, unsigned long size)
--
next prev parent reply other threads:[~2007-09-25 18:23 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-25 18:22 [patch 0/7] Add extended crashkernel command line syntax Bernhard Walle
2007-09-25 18:22 ` Bernhard Walle
2007-09-25 18:22 ` [patch 1/7] Extended crashkernel command line Bernhard Walle
2007-09-25 18:22 ` Bernhard Walle
2007-09-25 20:53 ` Oleg Verych
2007-09-25 20:53 ` Oleg Verych
2007-09-26 8:34 ` Bernhard Walle
2007-09-26 8:34 ` Bernhard Walle
2007-09-26 16:16 ` Bernhard Walle
2007-09-26 16:16 ` Bernhard Walle
2007-09-26 18:18 ` Oleg Verych
2007-09-26 18:18 ` Oleg Verych
2007-09-26 18:18 ` Bernhard Walle
2007-09-26 18:18 ` Bernhard Walle
2007-09-26 21:05 ` Bernhard Walle
2007-09-26 21:05 ` Bernhard Walle
2007-09-26 21:32 ` reviewed (Re: [patch 1/7] Extended crashkernel command line) Oleg Verych
2007-09-26 21:32 ` Oleg Verych
2007-09-25 18:22 ` [patch 2/7] Use extended crashkernel command line on i386 Bernhard Walle
2007-09-25 18:22 ` Bernhard Walle
2007-09-25 18:23 ` [patch 3/7] Use extended crashkernel command line on x86_64 Bernhard Walle
2007-09-25 18:23 ` Bernhard Walle
2007-09-25 18:23 ` [patch 4/7] Use extended crashkernel command line on ia64 Bernhard Walle
2007-09-25 18:23 ` Bernhard Walle
2007-09-25 18:23 ` Bernhard Walle
2007-09-25 18:23 ` Bernhard Walle [this message]
2007-09-25 18:23 ` [patch 5/7] Use extended crashkernel command line on ppc64 Bernhard Walle
2007-09-25 18:23 ` Bernhard Walle
2007-09-25 19:45 ` Andrew Morton
2007-09-25 19:45 ` Andrew Morton
2007-09-25 19:45 ` Andrew Morton
2007-09-26 8:15 ` Bernhard Walle
2007-09-26 8:15 ` Bernhard Walle
2007-09-26 8:15 ` Bernhard Walle
2007-09-25 18:23 ` [patch 6/7] Use extended crashkernel command line on sh Bernhard Walle
2007-09-25 18:23 ` Bernhard Walle
2007-09-25 18:23 ` [patch 7/7] Add documentation for extended crashkernel syntax Bernhard Walle
2007-09-25 18:23 ` Bernhard Walle
-- strict thread matches above, loose matches on Subject: below --
2007-09-20 17:18 [patch 0/7] Add extended crashkernel command line syntax Bernhard Walle
2007-09-20 17:18 ` [patch 5/7] Use extended crashkernel command line on ppc64 Bernhard Walle
2007-09-20 17:18 ` Bernhard Walle
2007-09-20 17:18 ` Bernhard Walle
2007-09-13 16:14 [patch 0/7] Add extended crashkernel command line syntax Bernhard Walle
2007-09-13 16:14 ` [patch 5/7] Use extended crashkernel command line on ppc64 Bernhard Walle
2007-09-13 16:14 ` Bernhard Walle
2007-09-13 16:14 ` Bernhard Walle
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=20070925182259.398924232@strauss.suse.de \
--to=bwalle@suse.de \
--cc=akpm@linux-foundation.org \
--cc=kexec@lists.infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
/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.