Thread (40 messages) 40 messages, 5 authors, 2021-02-26

Re: [PATCH v14 01/11] x86: kdump: replace the hard-coded alignment with macro CRASH_ALIGN

From: Baoquan He <bhe@redhat.com>
Date: 2021-02-25 07:27:52
Also in: kexec, linux-doc, lkml

On 02/24/21 at 02:19pm, Catalin Marinas wrote:
On Sat, Jan 30, 2021 at 03:10:15PM +0800, Chen Zhou wrote:
quoted
Move CRASH_ALIGN to header asm/kexec.h for later use. Besides, the
alignment of crash kernel regions in x86 is 16M(CRASH_ALIGN), but
function reserve_crashkernel() also used 1M alignment. So just
replace hard-coded alignment 1M with macro CRASH_ALIGN.
[...]
quoted
@@ -510,7 +507,7 @@ static void __init reserve_crashkernel(void)
 	} else {
 		unsigned long long start;
 
-		start = memblock_phys_alloc_range(crash_size, SZ_1M, crash_base,
+		start = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, crash_base,
 						  crash_base + crash_size);
 		if (start != crash_base) {
 			pr_info("crashkernel reservation failed - memory is in use.\n");
There is a small functional change here for x86. Prior to this patch,
crash_base passed by the user on the command line is allowed to be 1MB
aligned. With this patch, such reservation will fail.

Is the current behaviour a bug in the current x86 code or it does allow
1MB-aligned reservations?
Hmm, you are right. Here we should keep 1MB alignment as is because
users specify the address and size, their intention should be respected.
The 1MB alignment for fixed memory region reservation was introduced in
below commit, but it doesn't tell what is Eric's request at that time, I
guess it meant respecting users' specifying.

commit 44280733e71ad15377735b42d8538c109c94d7e3
Author: Yinghai Lu [off-list ref]
Date:   Sun Nov 22 17:18:49 2009 -0800

    x86: Change crash kernel to reserve via reserve_early()
    
    use find_e820_area()/reserve_early() instead.
    
    -v2: address Eric's request, to restore original semantics.
         will fail, if the provided address can not be used.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help