From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-96.mta0.migadu.com [91.218.175.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18DBE14A8B for ; Fri, 28 Aug 2026 02:10:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.96 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787883047; cv=none; b=XkMoXBn26cLjlKmXYBf6l0VLFFW/pyrWQXJi0kZV+dW2EmMGHWWDhlpl3LV/tLyhJzr/g7TpTsAbKadknEi578OYnJt1LDnfiZv3U3M56fALuKtmVNnJDJ6B0KIO4toVWKqHU/Yqo4zVEYX3dCcCGcAyTE9sxAqLeBAacnkrgvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787883047; c=relaxed/simple; bh=306qViCsI/fL3kh7CVfETFHgjEHNsKAvkMgPEdvlycI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jhlEh/WZOqIptjTg2lqSqJBnwHVJXM8EoioN4AQj1hr+8XOhbhsAPl9fdZ8p6cfVmLvR1ko5DZLus/mvE30C3SlPqO6Q/m6/MgpZZQBrU+dZdoErOyzHdAv0FjrPNb4VUsxeoYz5/6tpKn3MB3EQqe4t0UIZdJIUNTaT+70gwe8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=O/BI380/; arc=none smtp.client-ip=91.218.175.96 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="O/BI380/" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=306qViCsI/fL3kh7CVfETFHgjEHNsKAvkMgPEdvlycI=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787883044; v=1; x=1788487844; b=O/BI380/Nz/18+bn+FrTdCV90NZYvfYF3ijOMc92x4P2UWYpM2DtvorSkFWyx1MkRONPs1WS apOEvdOGROG4esnaVwm0YCYFALFbwe3wqyOzBqEu9eJ0x5heTjtW6UoJo3QnFtnhmAcmgLwPwwZ vCvB2JzxKUo+cnOzWSK6Q+4w= X-Envelope-To: linux-kernel@vger.kernel.org Received: by mta10.migadu.com with ESMTPS id 0947378481690cdb; Fri, 28 Aug 2026 02:10:44 +0000 X-Mizu-Trace-ID: 0947378481690cdb X-Migadu-Flow: FLOW_OUT Date: Fri, 28 Aug 2026 10:10:35 +0800 From: Baoquan He To: Sourabh Jain Cc: linux-kernel@vger.kernel.org, Albert Ou , Andrew Morton , Mike Rapoport , Palmer Dabbelt , Pasha Tatashin , Paul Walmsley , Pratyush Yadav , linux-riscv@lists.infradead.org, kexec@lists.infradead.org Subject: Re: [PATCH] kexec_file: remove unused arch_kexec_locate_mem_hole hook Message-ID: References: <20260827144452.508328-1-sourabhjain@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260827144452.508328-1-sourabhjain@linux.ibm.com> On 08/27/26 at 08:14pm, Sourabh Jain wrote: > No architecture provides an implementation of > arch_kexec_locate_mem_hole(). Use kexec_locate_mem_hole() directly > and remove the unused fallback wrapper from the kexec header. Since below commit, the last user was gone: commit 6e5250eaa665f ("powerpc/crash: use generic APIs to locate memory hole for kdump") Acked-by: Baoquan He > > This simplifies the kexec memory allocation path without changing > its behavior. > > Cc: Albert Ou > Cc: Andrew Morton > Cc: Baoquan He > Cc: Mike Rapoport > Cc: Palmer Dabbelt > Cc: Pasha Tatashin > Cc: Paul Walmsley > Cc: Pratyush Yadav > Cc: linux-riscv@lists.infradead.org > Cc: kexec@lists.infradead.org > Signed-off-by: Sourabh Jain > --- > arch/riscv/kernel/kexec_elf.c | 2 +- > include/linux/kexec.h | 15 --------------- > kernel/kexec_file.c | 2 +- > 3 files changed, 2 insertions(+), 17 deletions(-) > > diff --git a/arch/riscv/kernel/kexec_elf.c b/arch/riscv/kernel/kexec_elf.c > index 3e9a32acb8f2..ca5abbad59e5 100644 > --- a/arch/riscv/kernel/kexec_elf.c > +++ b/arch/riscv/kernel/kexec_elf.c > @@ -91,7 +91,7 @@ static int elf_find_pbase(struct kimage *image, unsigned long kernel_len, > kbuf.memsz = ALIGN(kernel_len, PAGE_SIZE); > kbuf.cma = NULL; > kbuf.top_down = false; > - ret = arch_kexec_locate_mem_hole(&kbuf); > + ret = kexec_locate_mem_hole(&kbuf); > if (!ret) { > *old_pbase = lowest_paddr; > *new_pbase = kbuf.mem; > diff --git a/include/linux/kexec.h b/include/linux/kexec.h > index 0af8ae4fdd08..e5f1cfc11fef 100644 > --- a/include/linux/kexec.h > +++ b/include/linux/kexec.h > @@ -259,21 +259,6 @@ int kexec_kernel_verify_pe_sig(const char *kernel, unsigned long kernel_len); > extern int kexec_add_buffer(struct kexec_buf *kbuf); > int kexec_locate_mem_hole(struct kexec_buf *kbuf); > > -#ifndef arch_kexec_locate_mem_hole > -/** > - * arch_kexec_locate_mem_hole - Find free memory to place the segments. > - * @kbuf: Parameters for the memory search. > - * > - * On success, kbuf->mem will have the start address of the memory region found. > - * > - * Return: 0 on success, negative errno on error. > - */ > -static inline int arch_kexec_locate_mem_hole(struct kexec_buf *kbuf) > -{ > - return kexec_locate_mem_hole(kbuf); > -} > -#endif > - > #ifndef arch_kexec_apply_relocations_add > /* > * arch_kexec_apply_relocations_add - apply relocations of type RELA > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > index 59fb9d71e9d8..9a981359addd 100644 > --- a/kernel/kexec_file.c > +++ b/kernel/kexec_file.c > @@ -784,7 +784,7 @@ int kexec_add_buffer(struct kexec_buf *kbuf) > kbuf->cma = NULL; > > /* Walk the RAM ranges and allocate a suitable range for the buffer */ > - ret = arch_kexec_locate_mem_hole(kbuf); > + ret = kexec_locate_mem_hole(kbuf); > if (ret) > return ret; > > -- > 2.55.0 >