From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- ...-adjust-memblock_reserve-of-kernel-memory.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 bsp/meta-synopsys/recipes-kernel/linux/linux-arc/6001-ARC-adjust-memblock_reserve-of-kernel-memory.patch (limited to 'bsp/meta-synopsys/recipes-kernel/linux/linux-arc/6001-ARC-adjust-memblock_reserve-of-kernel-memory.patch') diff --git a/bsp/meta-synopsys/recipes-kernel/linux/linux-arc/6001-ARC-adjust-memblock_reserve-of-kernel-memory.patch b/bsp/meta-synopsys/recipes-kernel/linux/linux-arc/6001-ARC-adjust-memblock_reserve-of-kernel-memory.patch new file mode 100644 index 00000000..35a8c24b --- /dev/null +++ b/bsp/meta-synopsys/recipes-kernel/linux/linux-arc/6001-ARC-adjust-memblock_reserve-of-kernel-memory.patch @@ -0,0 +1,46 @@ +From 91e89cad429a9d65330a41a5cb7039671f1d6204 Mon Sep 17 00:00:00 2001 +From: Eugeniy Paltsev +Date: Wed, 19 Dec 2018 19:16:16 +0300 +Subject: [PATCH] ARC: adjust memblock_reserve of kernel memory + +In setup_arch_memory we reserve the memory area wherein the kernel +is located. Current implementation may reserve more memory than +it actually required in case of CONFIG_LINUX_LINK_BASE is not +equal to CONFIG_LINUX_RAM_BASE. This happens because we calculate +start of the reserved region relatively to the CONFIG_LINUX_RAM_BASE +and end of the region relatively to the CONFIG_LINUX_RAM_BASE. + +For example in case of HSDK board we wasted 256MiB of physical memory: +------------------->8------------------------------ +Memory: 770416K/1048576K available (5496K kernel code, + 240K rwdata, 1064K rodata, 2200K init, 275K bss, + 278160K reserved, 0K cma-reserved) +------------------->8------------------------------ + +Fix that. + +Fixes: 9ed68785f7f ("ARC: mm: Decouple RAM base address from kernel link addr") +Cc: stable@vger.kernel.org #4.14+ +Signed-off-by: Eugeniy Paltsev +Signed-off-by: Vineet Gupta +--- + arch/arc/mm/init.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c +index ba14506..f890b2f 100644 +--- a/arch/arc/mm/init.c ++++ b/arch/arc/mm/init.c +@@ -138,7 +138,8 @@ void __init setup_arch_memory(void) + */ + + memblock_add_node(low_mem_start, low_mem_sz, 0); +- memblock_reserve(low_mem_start, __pa(_end) - low_mem_start); ++ memblock_reserve(CONFIG_LINUX_LINK_BASE, ++ __pa(_end) - CONFIG_LINUX_LINK_BASE); + + #ifdef CONFIG_BLK_DEV_INITRD + if (initrd_start) +-- +1.8.3.1 + -- cgit 1.2.3-korg