All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used
@ 2017-05-22  9:34 Hari Bathini
  2017-05-22  9:34 ` [PATCH 2/2] powerpc/fadump: update about offset where fadump is reserved Hari Bathini
  2017-06-05 10:21 ` [1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Hari Bathini @ 2017-05-22  9:34 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Prarit Bhargava, linuxppc-dev, Ankit Kumar, Dave Young,
	Mahesh J Salgaonkar

With commit 11550dc0a00b ("powerpc/fadump: reuse crashkernel parameter
for fadump memory reservation"), 'fadump_reserve_mem=' parameter is
deprecated in favor of 'crashkernel=' parameter. Add a warning if
'fadump_reserve_mem=' is still used.

Suggested-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/fadump.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 466569e..c0db844 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -212,6 +212,10 @@ static inline unsigned long fadump_calculate_reserve_size(void)
 	int ret;
 	unsigned long long base, size;
 
+	if (fw_dump.reserve_bootvar)
+		pr_warn("'fadump_reserve_mem=' parameter is deprecated in "
+			"favor of 'crashkernel=' parameter.\n");
+
 	/*
 	 * Check if the size is specified through crashkernel= cmdline
 	 * option. If yes, then use that but ignore base as fadump
@@ -220,8 +224,18 @@ static inline unsigned long fadump_calculate_reserve_size(void)
 	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
 				&size, &base);
 	if (ret == 0 && size > 0) {
+		if (fw_dump.reserve_bootvar)
+			pr_info("Using 'crashkernel=' parameter for"
+				" memory reservation.\n");
+
 		fw_dump.reserve_bootvar = (unsigned long)size;
 		return fw_dump.reserve_bootvar;
+	} else if (fw_dump.reserve_bootvar) {
+		/*
+		 * 'fadump_reserve_mem=' is being used to reserve memory
+		 * for firmware-assisted dump.
+		 */
+		return fw_dump.reserve_bootvar;
 	}
 
 	/* divide by 20 to get 5% of value */
@@ -377,6 +391,19 @@ static int __init early_fadump_param(char *p)
 }
 early_param("fadump", early_fadump_param);
 
+/*
+ * Look for fadump_reserve_mem= cmdline option
+ * TODO: Remove references to 'fadump_reserve_mem=' parameter,
+ *       the sooner 'crashkernel=' parameter is accustomed to.
+ */
+static int __init early_fadump_reserve_mem(char *p)
+{
+	if (p)
+		fw_dump.reserve_bootvar = memparse(p, &p);
+	return 0;
+}
+early_param("fadump_reserve_mem", early_fadump_reserve_mem);
+
 static void register_fw_dump(struct fadump_mem_struct *fdm)
 {
 	int rc;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] powerpc/fadump: update about offset where fadump is reserved
  2017-05-22  9:34 [PATCH 1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used Hari Bathini
@ 2017-05-22  9:34 ` Hari Bathini
  2017-05-22 10:55   ` Michal Suchánek
  2017-06-05 10:21 ` [1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Hari Bathini @ 2017-05-22  9:34 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Prarit Bhargava, linuxppc-dev, Ankit Kumar, Dave Young,
	Mahesh J Salgaonkar

With commit f6e6bedb7731 ("powerpc/fadump: Reserve memory at an offset
closer to bottom of RAM"), memory for fadump is no longer reserved at
the top of RAM. But there are still a few places which say so. Change
them appropriately.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
 Documentation/powerpc/firmware-assisted-dump.txt |    4 ++--
 arch/powerpc/kernel/fadump.c                     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/powerpc/firmware-assisted-dump.txt b/Documentation/powerpc/firmware-assisted-dump.txt
index 9cabaf8..bdd344a 100644
--- a/Documentation/powerpc/firmware-assisted-dump.txt
+++ b/Documentation/powerpc/firmware-assisted-dump.txt
@@ -61,8 +61,8 @@ as follows:
          boot successfully. For syntax of crashkernel= parameter,
          refer to Documentation/kdump/kdump.txt. If any offset is
          provided in crashkernel= parameter, it will be ignored
-         as fadump reserves memory at end of RAM for boot memory
-         dump preservation in case of a crash.
+         as fadump uses a predefined offset to reserve memory
+         for boot memory dump preservation in case of a crash.
 
 -- After the low memory (boot memory) area has been saved, the
    firmware will reset PCI and other hardware state.  It will
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index c0db844..63c4281 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -218,8 +218,8 @@ static inline unsigned long fadump_calculate_reserve_size(void)
 
 	/*
 	 * Check if the size is specified through crashkernel= cmdline
-	 * option. If yes, then use that but ignore base as fadump
-	 * reserves memory at end of RAM.
+	 * option. If yes, then use that but ignore base as fadump reserves
+	 * memory at a predefined offset.
 	 */
 	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
 				&size, &base);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] powerpc/fadump: update about offset where fadump is reserved
  2017-05-22  9:34 ` [PATCH 2/2] powerpc/fadump: update about offset where fadump is reserved Hari Bathini
@ 2017-05-22 10:55   ` Michal Suchánek
  2017-05-22 18:56     ` Hari Bathini
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Suchánek @ 2017-05-22 10:55 UTC (permalink / raw)
  To: Hari Bathini
  Cc: Michael Ellerman, Prarit Bhargava, linuxppc-dev, Ankit Kumar,
	Dave Young, Mahesh J Salgaonkar

On Mon, 22 May 2017 15:04:47 +0530
Hari Bathini <hbathini@linux.vnet.ibm.com> wrote:

> With commit f6e6bedb7731 ("powerpc/fadump: Reserve memory at an offset
> closer to bottom of RAM"), memory for fadump is no longer reserved at
> the top of RAM. But there are still a few places which say so. Change
> them appropriately.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
> ---
>  Documentation/powerpc/firmware-assisted-dump.txt |    4 ++--
>  arch/powerpc/kernel/fadump.c                     |    4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/powerpc/firmware-assisted-dump.txt
> b/Documentation/powerpc/firmware-assisted-dump.txt index
> 9cabaf8..bdd344a 100644 ---
> a/Documentation/powerpc/firmware-assisted-dump.txt +++
> b/Documentation/powerpc/firmware-assisted-dump.txt @@ -61,8 +61,8 @@
> as follows: boot successfully. For syntax of crashkernel= parameter,
>           refer to Documentation/kdump/kdump.txt. If any offset is
>           provided in crashkernel= parameter, it will be ignored
> -         as fadump reserves memory at end of RAM for boot memory
> -         dump preservation in case of a crash.
> +         as fadump uses a predefined offset to reserve memory
> +         for boot memory dump preservation in case of a crash.

What is the reason for fadump to prefer a random offset calculated by
the kernel over a random offset supplied by the user?

Since the random offset calculated by the kernel was recently adjusted
to counter issues with fadump registration maybe it would be reasonable
to allow the user to supply a custom random offset and override the
kernel-calculated random offset if they want to do so.

PS 'random' meaning in no relationship to actual system topology that
would warrant this offset to be in any way better than any other.

Thanks

Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] powerpc/fadump: update about offset where fadump is reserved
  2017-05-22 10:55   ` Michal Suchánek
@ 2017-05-22 18:56     ` Hari Bathini
  0 siblings, 0 replies; 5+ messages in thread
From: Hari Bathini @ 2017-05-22 18:56 UTC (permalink / raw)
  To: Michal Suchánek
  Cc: Prarit Bhargava, Ankit Kumar, linuxppc-dev, Mahesh J Salgaonkar,
	Dave Young


Hi Michal,

Thanks for the review..

On Monday 22 May 2017 04:25 PM, Michal Suchánek wrote:
> On Mon, 22 May 2017 15:04:47 +0530
> Hari Bathini <hbathini@linux.vnet.ibm.com> wrote:
>
>> With commit f6e6bedb7731 ("powerpc/fadump: Reserve memory at an offset
>> closer to bottom of RAM"), memory for fadump is no longer reserved at
>> the top of RAM. But there are still a few places which say so. Change
>> them appropriately.
>>
>> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
>> ---
>>   Documentation/powerpc/firmware-assisted-dump.txt |    4 ++--
>>   arch/powerpc/kernel/fadump.c                     |    4 ++--
>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/powerpc/firmware-assisted-dump.txt
>> b/Documentation/powerpc/firmware-assisted-dump.txt index
>> 9cabaf8..bdd344a 100644 ---
>> a/Documentation/powerpc/firmware-assisted-dump.txt +++
>> b/Documentation/powerpc/firmware-assisted-dump.txt @@ -61,8 +61,8 @@
>> as follows: boot successfully. For syntax of crashkernel= parameter,
>>            refer to Documentation/kdump/kdump.txt. If any offset is
>>            provided in crashkernel= parameter, it will be ignored
>> -         as fadump reserves memory at end of RAM for boot memory
>> -         dump preservation in case of a crash.
>> +         as fadump uses a predefined offset to reserve memory
>> +         for boot memory dump preservation in case of a crash.
> What is the reason for fadump to prefer a random offset calculated by
> the kernel over a random offset supplied by the user?
>

An offset provided by user needs multiple checks failing which can be 
tricky.
While implementation is still possible, it makes the code complicated for no
practical gain as commit f6e6bedb7731 is already calculating the best 
possible
offset..

Thanks
Hari

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used
  2017-05-22  9:34 [PATCH 1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used Hari Bathini
  2017-05-22  9:34 ` [PATCH 2/2] powerpc/fadump: update about offset where fadump is reserved Hari Bathini
@ 2017-06-05 10:21 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2017-06-05 10:21 UTC (permalink / raw)
  To: Hari Bathini
  Cc: Prarit Bhargava, linuxppc-dev, Ankit Kumar, Dave Young,
	Mahesh J Salgaonkar

On Mon, 2017-05-22 at 09:34:23 UTC, Hari Bathini wrote:
> With commit 11550dc0a00b ("powerpc/fadump: reuse crashkernel parameter
> for fadump memory reservation"), 'fadump_reserve_mem=' parameter is
> deprecated in favor of 'crashkernel=' parameter. Add a warning if
> 'fadump_reserve_mem=' is still used.
> 
> Suggested-by: Prarit Bhargava <prarit@redhat.com>
> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/81d9eca502fcc360950ef476124626

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-05 10:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22  9:34 [PATCH 1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used Hari Bathini
2017-05-22  9:34 ` [PATCH 2/2] powerpc/fadump: update about offset where fadump is reserved Hari Bathini
2017-05-22 10:55   ` Michal Suchánek
2017-05-22 18:56     ` Hari Bathini
2017-06-05 10:21 ` [1/2] powerpc/fadump: add a warning when 'fadump_reserve_mem=' is used Michael Ellerman

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.