public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
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 <bhe@redhat.com>
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	[thread overview]
Message-ID: <20230324131838.409996-4-bhe@redhat.com> (raw)
In-Reply-To: <20230324131838.409996-1-bhe@redhat.com>

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 <bhe@redhat.com>
---
 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();
 }
-- 
2.34.1


  parent reply	other threads:[~2023-03-24 13:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 13:18 [PATCH 0/3] arm64: kdump : take off the protection on crashkernel memory region Baoquan He
2023-03-24 13:18 ` [PATCH 1/3] " Baoquan He
2023-03-25  1:56   ` Leizhen (ThunderTown)
2023-03-24 13:18 ` [PATCH 2/3] arm64: kdump: do not map crashkernel region specifically Baoquan He
2023-03-25  1:57   ` Leizhen (ThunderTown)
2023-03-24 13:18 ` Baoquan He [this message]
2023-03-25  2:04   ` [PATCH 3/3] arm64: kdump: defer the crashkernel reservation for platforms with no DMA memory zones Leizhen (ThunderTown)
2023-03-26 13:10     ` Baoquan He
2023-03-26 13:02   ` [PATCH v2 " Baoquan He
2023-03-27  1:26     ` Leizhen (ThunderTown)
2023-03-24 17:11 ` [PATCH 0/3] arm64: kdump : take off the protection on crashkernel memory region Catalin Marinas
2023-03-25  2:14   ` Leizhen (ThunderTown)
2023-03-25  3:00     ` Baoquan He
2023-03-25  6:02 ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230324131838.409996-4-bhe@redhat.com \
    --to=bhe@redhat.com \
    --cc=John.p.donnelly@oracle.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=horms@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rppt@kernel.org \
    --cc=thunder.leizhen@huawei.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox