lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Dec 2020 18:23:22 +0800
From:   Chen Zhou <chenzhou10@...wei.com>
To:     <catalin.marinas@....com>, <will@...nel.org>
CC:     <ardb@...nel.org>, <akpm@...ux-foundation.org>,
        <nsaenzjulienne@...e.de>, <rppt@...nel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <chenzhou10@...wei.com>,
        <guohanjun@...wei.com>, <huawei.libin@...wei.com>
Subject: [PATCH v2 3/3] arm64: mm: reserve CMA and crashkernel in ZONE_DMA if enabled

Currently, CMA and crashkernel are reserved in ZONE_DMA32, which
is OK for majority of devices. But the ones that need them in ZONE_DMA
need to configure it explicitly.

Since patchset "arm64: Default to 32-bit wide ZONE_DMA", ZONE_DMA's
size is fine-tuned. So we could directly reserve CMA and crashkernel
in ZONE_DMA if CONFIG_ZONE_DMA is enabled, otherwise, reserving in
ZONE_DMA32.

Signed-off-by: Chen Zhou <chenzhou10@...wei.com>
Suggested-by: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
---
 arch/arm64/mm/init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 64a0e8f551d6..26de149b21c7 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -85,7 +85,8 @@ static void __init reserve_crashkernel(void)
 
 	if (crash_base == 0) {
 		/* Current arm64 boot protocol requires 2MB alignment */
-		crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit,
+		crash_base = memblock_find_in_range(0,
+				arm64_dma_phys_limit ? : arm64_dma32_phys_limit,
 				crash_size, SZ_2M);
 		if (crash_base == 0) {
 			pr_warn("cannot allocate crashkernel (size:0x%llx)\n",
@@ -443,7 +444,7 @@ void __init bootmem_init(void)
 	 */
 	reserve_crashkernel();
 
-	dma_contiguous_reserve(arm64_dma32_phys_limit);
+	dma_contiguous_reserve(arm64_dma_phys_limit ? : arm64_dma32_phys_limit);
 
 	memblock_dump_all();
 }
-- 
2.20.1

Powered by blists - more mailing lists