From patchwork Fri Mar 24 13:18:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13186755 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7BF3C6FD1C for ; Fri, 24 Mar 2023 13:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=buMSj9OTTT9HMZ+PAhM1AX170U7Pe3H+HQAwPjz7zgY=; b=p6+e51OKPml4BG wXQhLx9UMxI8GcMJ5cDiPPjKJOcyuzMFtF3ISaomgcEtV2uDth7gTDuJy7gql4LBuvWvQIjUddazw VCF+l1DGaZGdPBwzTX/UkHvJVcO4SlxT990B9Jbey6xp1kXA8lZutz42ktJ6DXLwkLOcuXUCL3EKl Jfl+TIhb1Lde1Wzy1O4ZmcgujpTFr5fru5LsJDYqqKhI29olLlYIUJNeOmTyehFzNUbcp01GHxhTC RvneT/Ztym8JfF2si+H7lfT8YejuuBPpWFNLxn1V38XKpobnoIPFlLd+KBQfGlTeGC09Z5MYL+W4p 3qVSqA8kkzwwcdJXcOjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pfhKH-004SvU-2e; Fri, 24 Mar 2023 13:19:25 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pfhK4-004Spq-1w for linux-arm-kernel@lists.infradead.org; Fri, 24 Mar 2023 13:19:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679663951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oqnpIZ5GkpM+kmmJnZqA1o1ZNLYJuti4DYPr6Ni2jEw=; b=N515RUu9ALD4Xv2eZt+IlhJqSrWciRQanYwShqZVpdphHun0N1hnhJnMKSP8p//kDHbcnN MVZse3FhPsJIYcTXopTHDYGTmAn5RolGZcqhCloWH9ikcmismlYjE3ebB6CrSeRtklwbRy PwjLCnONnIf7Wa3KVbF07C9cGHCkClU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-553-GK-E1deeOayVA85ZKw2nlA-1; Fri, 24 Mar 2023 09:19:06 -0400 X-MC-Unique: GK-E1deeOayVA85ZKw2nlA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B647A801206; Fri, 24 Mar 2023 13:19:05 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-55.pek2.redhat.com [10.72.12.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B494492B0A; Fri, 24 Mar 2023 13:19:00 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, horms@kernel.org, thunder.leizhen@huawei.com, John.p.donnelly@oracle.com, will@kernel.org, kexec@lists.infradead.org, ardb@kernel.org, rppt@kernel.org, linux-arm-kernel@lists.infradead.org, Baoquan He Subject: [PATCH 3/3] arm64: kdump: defer the crashkernel reservation for platforms with no DMA memory zones Date: Fri, 24 Mar 2023 21:18:38 +0800 Message-Id: <20230324131838.409996-4-bhe@redhat.com> In-Reply-To: <20230324131838.409996-1-bhe@redhat.com> References: <20230324131838.409996-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230324_061912_715089_B2B41858 X-CRM114-Status: GOOD ( 11.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In commit 031495635b46 ("arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones"), reserve_crashkernel() is called much earlier in arm64_memblock_init() to avoid causing base apge mapping on platforms with no DMA meomry zones. With taking off protection on crashkernel memory region, no need to call reserve_crashkernel() specially in advance. The deferred invocation of reserve_crashkernel() in bootmem_init() can cover all cases. Signed-off-by: Baoquan He --- arch/arm64/include/asm/memory.h | 5 ----- arch/arm64/mm/init.c | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 78e5163836a0..efcd68154a3a 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -374,11 +374,6 @@ static inline void *phys_to_virt(phys_addr_t x) }) void dump_mem_limit(void); - -static inline bool defer_reserve_crashkernel(void) -{ - return IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32); -} #endif /* !ASSEMBLY */ /* diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 58a0bb2c17f1..b888de59e0b7 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -408,9 +408,6 @@ void __init arm64_memblock_init(void) early_init_fdt_scan_reserved_mem(); - if (!defer_reserve_crashkernel()) - reserve_crashkernel(); - high_memory = __va(memblock_end_of_DRAM() - 1) + 1; } @@ -457,8 +454,7 @@ void __init bootmem_init(void) * request_standard_resources() depends on crashkernel's memory being * reserved, so do it here. */ - if (defer_reserve_crashkernel()) - reserve_crashkernel(); + reserve_crashkernel(); memblock_dump_all(); }