* [PATCH] arm64: Allocate elfcorehdr & crashkernel mem before any reservation
@ 2018-01-04 10:38 Poonam Aggrwal
2018-01-04 9:35 ` Poonam Aggrwal
0 siblings, 1 reply; 2+ messages in thread
From: Poonam Aggrwal @ 2018-01-04 10:38 UTC (permalink / raw)
To: linux-arm-kernel
From: Poonam Aggrwal <poonam.aggrwal@nxp.com>
Address for both crashkernel memory and elfcorehdr can be assigned
statically. For crashkernel memory it is via crashkernel=SIZE at ADDRESS
and elfcorehdr_addr via by kexec-utils in dump kernel device tree.
So memory should be reserved for both the above areas before any
other memory reservations are done. Otherwise overlaps may happen and
memory allocations will fail leading to failure in booting the
dump capture kernel.
Signed-off-by: Guanhua <guanhua.gao@nxp.com>
Signed-off-by: Poonam Aggrwal <poonam.aggrwal@nxp.com>
Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>
---
reworked based on the discussions:(with Will Deacon and Takahiro)
https://patchwork.kernel.org/patch/10104249/
arch/arm64/mm/init.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 00e7b90..24ce15d 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -453,6 +453,14 @@ void __init arm64_memblock_init(void)
* Register the kernel text, kernel data, initrd, and initial
* pagetables with memblock.
*/
+
+ /* make these the first reservations to avoid chances of
+ * overlap
+ */
+ reserve_elfcorehdr();
+
+ reserve_crashkernel();
+
memblock_reserve(__pa_symbol(_text), _end - _text);
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) {
@@ -472,10 +480,6 @@ void __init arm64_memblock_init(void)
else
arm64_dma_phys_limit = PHYS_MASK + 1;
- reserve_crashkernel();
-
- reserve_elfcorehdr();
-
high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
dma_contiguous_reserve(arm64_dma_phys_limit);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] arm64: Allocate elfcorehdr & crashkernel mem before any reservation
2018-01-04 10:38 [PATCH] arm64: Allocate elfcorehdr & crashkernel mem before any reservation Poonam Aggrwal
@ 2018-01-04 9:35 ` Poonam Aggrwal
0 siblings, 0 replies; 2+ messages in thread
From: Poonam Aggrwal @ 2018-01-04 9:35 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Poonam Aggrwal [mailto:poonam.aggrwal at codeaurora.org]
> Sent: Thursday, January 04, 2018 4:08 PM
> To: linux-arm-kernel at lists.infradead.org
> Cc: takahiro.akashi at linaro.org; james.morse at arm.com;
> will.deacon at arm.com; Poonam Aggrwal <poonam.aggrwal@nxp.com>; G.h.
> Gao <guanhua.gao@nxp.com>; Abhimanyu Saini <abhimanyu.saini@nxp.com>
> Subject: [PATCH] arm64: Allocate elfcorehdr & crashkernel mem before any
> reservation
>
> From: Poonam Aggrwal <poonam.aggrwal@nxp.com>
>
Please ignore this patch; will send another one with correct email address.
Regards
Poonam
> 2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-04 10:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04 10:38 [PATCH] arm64: Allocate elfcorehdr & crashkernel mem before any reservation Poonam Aggrwal
2018-01-04 9:35 ` Poonam Aggrwal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox