From patchwork Fri Aug 19 04:11:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 12948296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBA46C32771 for ; Fri, 19 Aug 2022 04:12:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 156798E0001; Fri, 19 Aug 2022 00:12:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 106968D0002; Fri, 19 Aug 2022 00:12:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F11068E0001; Fri, 19 Aug 2022 00:12:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E40B38D0002 for ; Fri, 19 Aug 2022 00:12:20 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B9E461404DB for ; Fri, 19 Aug 2022 04:12:20 +0000 (UTC) X-FDA: 79815020040.23.8D9830B Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf08.hostedemail.com (Postfix) with ESMTP id 4BA33160007 for ; Fri, 19 Aug 2022 04:12:20 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 72E1FB825A9; Fri, 19 Aug 2022 04:12:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86439C43470; Fri, 19 Aug 2022 04:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660882337; bh=OJw5ok0VWpXV3rCiT2RPnbejds8oP9obR0Vq/h7CFMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kk7a5L2fGYglj/X+iysS0UCkB1aNmS+LAXX5gdRkSk6QWLPtsYWlXgpsLQSX4/2m6 xSAnTQjm8z1SSGIu8AvMC+WvtHiaUkHJXdotVu+VIGcGwbSuWAa+pd3D9TwA5hO/xV SeQY4tvS/87p9KJbLFiypyt5avneNb1U2JMS3OHFQ8Wg6vRfY+VP9ARAPb3z3fFNQe huyGcQmXx05+a+1zofD5JiK4ztPPW2Jk7PfQ9e7+JOYJ2Xd9K53aTQjezSdfbXcy+C tUZwCybmYrgTbhNUX0ean/n/TqOYsmBrz6//+A5XGGyoJP5834TNnLWwbx8TiIrg1s Q0eNNmNBjqIyQ== From: Mike Rapoport To: linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Catalin Marinas , Guanghui Feng , Mark Rutland , Mike Rapoport , Mike Rapoport , Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/5] arm64: rename defer_reserve_crashkernel() to have_zone_dma() Date: Fri, 19 Aug 2022 07:11:52 +0300 Message-Id: <20220819041156.873873-2-rppt@kernel.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220819041156.873873-1-rppt@kernel.org> References: <20220819041156.873873-1-rppt@kernel.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660882339; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=R4ywyJaaqViCFo5thr1iZPt0MOnEaUbXpBihi/KPduA=; b=AhNOK0ryDek4UkFpIAg9voNo1MdQOLiaTVwASrILX3gJP8gjFxo7VjnDY7TVAVRgwGJ80J 7d/u8Zj8gRRmNYbukM3pd4aFB370UlkpTlMhbVhi++SH8He6+uCfTOFqkTmhr+bmFRv8yy Lb0FkmT9OorzWzhvWQFDRU8hcvqx7eM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kk7a5L2f; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660882339; a=rsa-sha256; cv=none; b=BtYCtQUMGNfEQIkqzzCiSJlrHleEBcep/be4l5lI6UBSIsaWq5kbtR2bv9KRjmJNCt0NQ4 SPKDwwnw/Ny03slSQQWZT4+R9TwWh9mXbARcsY6ZRotnixtOtj6wKpjHM9CPHZxbTTX9DD +7hl44TMmtQjs4MsetfNc4mbKaI5Nfs= X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kk7a5L2f; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: syg6xh5s44easkpdtce96xucfezubwa9 X-Rspamd-Queue-Id: 4BA33160007 X-Rspamd-Server: rspam05 X-HE-Tag: 1660882340-643255 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Mike Rapoport The new name better describes what the function does and does not restrict its use to crash kernel reservations. Signed-off-by: Mike Rapoport --- arch/arm64/include/asm/memory.h | 2 +- arch/arm64/mm/init.c | 4 ++-- arch/arm64/mm/mmu.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 9dd08cd339c3..27fce129b97e 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -364,7 +364,7 @@ static inline void *phys_to_virt(phys_addr_t x) void dump_mem_limit(void); -static inline bool defer_reserve_crashkernel(void) +static inline bool have_zone_dma(void) { return IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32); } diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index b9af30be813e..a6585d50a76c 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -389,7 +389,7 @@ void __init arm64_memblock_init(void) early_init_fdt_scan_reserved_mem(); - if (!defer_reserve_crashkernel()) + if (!have_zone_dma()) reserve_crashkernel(); high_memory = __va(memblock_end_of_DRAM() - 1) + 1; @@ -438,7 +438,7 @@ void __init bootmem_init(void) * request_standard_resources() depends on crashkernel's memory being * reserved, so do it here. */ - if (defer_reserve_crashkernel()) + if (have_zone_dma()) reserve_crashkernel(); memblock_dump_all(); diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index db7c4e6ae57b..bf303f1dea25 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -548,7 +548,7 @@ static void __init map_mem(pgd_t *pgdp) #ifdef CONFIG_KEXEC_CORE if (crash_mem_map) { - if (defer_reserve_crashkernel()) + if (have_zone_dma()) flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS; else if (crashk_res.end) memblock_mark_nomap(crashk_res.start, @@ -589,7 +589,7 @@ static void __init map_mem(pgd_t *pgdp) * through /sys/kernel/kexec_crash_size interface. */ #ifdef CONFIG_KEXEC_CORE - if (crash_mem_map && !defer_reserve_crashkernel()) { + if (crash_mem_map && !have_zone_dma()) { if (crashk_res.end) { __map_memblock(pgdp, crashk_res.start, crashk_res.end + 1,