Skip to contentSkip to conversation

x86/crash: Update the stale comment in reserve_crashkernel()

PATCH In review Xunlei Pang 4 participants 4 messages Jan 23, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/crash: Update the stale comment in reserve_crashkernel()

CRASH_KERNEL_ADDR_MAX has been missing for a long time, update it with more detailed explanation.

Cc Robert LeBlanc <[email protected]>
Cc Baoquan He <[email protected]>
---
 arch/x86/kernel/setup.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/setup.c +3 -1
index 4cfba94..c32a167 100644
@@ -575,7 +575,9 @@ static void __init reserve_crashkernel(void)
 	/* 0 means: find the address automatically */
 	if (crash_base <= 0) {
 		/*
-		 *  kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
+		 * Set CRASH_ADDR_LOW_MAX upper bound for crash memory
+		 * as old kexec-tools loads bzImage below that, unless
+		 * "crashkernel=size[KMG],high" is specified.
 		 */
 		crash_base = memblock_find_in_range(CRASH_ALIGN,
 						    high ? CRASH_ADDR_HIGH_MAX
Signature · 1 line
1.8.3.1
#1 lore raw
x86/crash: Update the stale comment in reserve_crashkernel()
Commit-ID:  a8d4c8246b290ce97f88752d833804843041ac84
Gitweb:     http://git.kernel.org/tip/a8d4c8246b290ce97f88752d833804843041ac84
Author:     Xunlei Pang <[email protected]>
AuthorDate: Mon, 23 Jan 2017 14:48:23 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 23 Jan 2017 08:57:55 +0100

x86/crash: Update the stale comment in reserve_crashkernel()

CRASH_KERNEL_ADDR_MAX has been missing for a long time, update it with a more detailed explanation.

Cc Andrew Morton <[email protected]>
Cc Baoquan He <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Young <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Robert LeBlanc <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/kernel/setup.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/setup.c +3 -1
index 4cfba94..eb69b14 100644
@@ -575,7 +575,9 @@ static void __init reserve_crashkernel(void)
 	/* 0 means: find the address automatically */
 	if (crash_base <= 0) {
 		/*
-		 *  kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
+		 * Set CRASH_ADDR_LOW_MAX upper bound for crash memory,
+		 * as old kexec-tools loads bzImage below that, unless
+		 * "crashkernel=size[KMG],high" is specified.
 		 */
 		crash_base = memblock_find_in_range(CRASH_ALIGN,
 						    high ? CRASH_ADDR_HIGH_MAX
#2 lore raw
In reply to Xunlei Pang

Hi, Xunlei

Quoted 15 lines · Xunlei Pang

CRASH_KERNEL_ADDR_MAX has been missing for a long time, update it with more detailed explanation.

Cc Robert LeBlanc <[email protected]>
Cc Baoquan He <[email protected]>
---
 arch/x86/kernel/setup.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/setup.c +0 -0
index 4cfba94..c32a167 100644

arch/x86/kernel/setup.c static void __init reserve_crashkernel(void) · line 580

Quoted 7 lines
arch/x86/kernel/setup.c +3 -1
@@ -575,7 +575,9 @@ static void __init reserve_crashkernel(void)
 	/* 0 means: find the address automatically */
 	if (crash_base <= 0) {
 		/*
-		 *  kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
+		 * Set CRASH_ADDR_LOW_MAX upper bound for crash memory
+		 * as old kexec-tools loads bzImage below that, unless
+		 * "crashkernel=size[KMG],high" is specified.

There is already comment before the define of those macros, also there are 32bit case which has a different reason about 512M there as well.

So it looks better to just drop the one line comment without adding further comments here.

Quoted 6 lines
arch/x86/kernel/setup.c +0 -0
 		 */
 		crash_base = memblock_find_in_range(CRASH_ALIGN,
 						    high ? CRASH_ADDR_HIGH_MAX
Signature · 1 line
1.8.3.1

Thanks
Dave

#3 lore raw
Quoted 13 lines · Dave Young

Hi, Xunlei

Quoted 10 lines · Xunlei Pang

CRASH_KERNEL_ADDR_MAX has been missing for a long time, update it with more detailed explanation.

Cc Robert LeBlanc <[email protected]>
Cc Baoquan He <[email protected]>
---
 arch/x86/kernel/setup.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 15 lines

arch/x86/kernel/setup.c static void __init reserve_crashkernel(void) · line 580

Quoted 12 lines
arch/x86/kernel/setup.c +3 -1
index 4cfba94..c32a167 100644
@@ -575,7 +575,9 @@ static void __init reserve_crashkernel(void)
 	/* 0 means: find the address automatically */
 	if (crash_base <= 0) {
 		/*
-		 *  kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
+		 * Set CRASH_ADDR_LOW_MAX upper bound for crash memory
+		 * as old kexec-tools loads bzImage below that, unless
+		 * "crashkernel=size[KMG],high" is specified.

There is already comment before the define of those macros, also there are 32bit case which has a different reason about 512M there as well.

If we see from the kexec's perspective, we have a common CRASH_ADDR_LOW_MAX definition for both x86 32-bit and 64-bit(32-bit x86 has the same value defined for CRASH_ADDR_LOW_MAX and CRASH_ADDR_HIGH_MAX), so old kexec will load below CRASH_ADDR_LOW_MAX, so I think the description is fine :-)

Regards,
Xunlei

Quoted 16 lines

So it looks better to just drop the one line comment without adding further comments here.

Quoted 6 lines
arch/x86/kernel/setup.c +0 -0
 		 */
 		crash_base = memblock_find_in_range(CRASH_ALIGN,
 						    high ? CRASH_ADDR_HIGH_MAX
Signature · 1 line
1.8.3.1

Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec