From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D5A4C47080 for ; Mon, 31 May 2021 10:00:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2C205611CB for ; Mon, 31 May 2021 10:00:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C205611CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=0NV4lp2ROpcukXjM3F9KLKxi3a//KHBtJo4S0IWYWNI=; b=J5VM4TxKuTXyPD ooCSdDcgN+vAPJDYZ+tGtHcAQK+KLHUG12lU6DOZdThaQCBc3sbCoOCmKMtoWiNx2/BOQW5IDthia YBV7cm8iq93mZ4HKXKe7OziXgqFna5/VT07UunuEO/bPadOqtOejFN2zQ+fB34JW7VN+NHD65/jDF uu9GnLrfd+pfNssMNLaAYtzQ+o3m+M13jdRUgeH7b+q7oKqDYJi0OGrEOonQM3rl+X7oZafo94Tef AKemr2iwZLO5+ol99/2GGBIDXG0FDm5AJMmNbaA/ttjan6SrcwQosUb03d9HIyGsO2ROH2UFvPC6R QdTxkZgfRxlAdEMzpakA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnegg-00BkVU-KB; Mon, 31 May 2021 09:58:22 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnegM-00BkQ9-BJ; Mon, 31 May 2021 09:58:03 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89713611AC; Mon, 31 May 2021 09:58:01 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lnegI-004Z7v-Fx; Mon, 31 May 2021 10:57:58 +0100 From: Marc Zyngier To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , Mark Rutland , James Morse , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Eric Biederman , Bhupesh SHARMA , AKASHI Takahiro , Dave Young , Andrew Morton , Moritz Fischer , kernel-team@android.com Subject: [PATCH v2 2/5] kexec_file: Make locate_mem_hole_callback global Date: Mon, 31 May 2021 10:57:17 +0100 Message-Id: <20210531095720.77469-3-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210531095720.77469-1-maz@kernel.org> References: <20210531095720.77469-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, ardb@kernel.org, mark.rutland@arm.com, james.morse@arm.com, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, ebiederm@xmission.com, bhupesh.sharma@linaro.org, takahiro.akashi@linaro.org, dyoung@redhat.com, akpm@linux-foundation.org, mdf@kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_025802_463436_FDF12A74 X-CRM114-Status: GOOD ( 15.48 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order for architectures to make use of locate_mem_hole_callback() and avoid reinventing a square wheel, make this function global and rename it to kexec_locate_mem_hole_callback() to match the other global kexec symbols. Acked-by: Catalin Marinas Reviewed-by: Ard Biesheuvel Signed-off-by: Marc Zyngier --- include/linux/kexec.h | 1 + kernel/kexec_file.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 0c994ae37729..4b507efdb623 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -204,6 +204,7 @@ int arch_kexec_locate_mem_hole(struct kexec_buf *kbuf); extern int kexec_add_buffer(struct kexec_buf *kbuf); int kexec_locate_mem_hole(struct kexec_buf *kbuf); +int kexec_locate_mem_hole_callback(struct resource *res, void *arg); /* Alignment required for elf header segment */ #define ELF_CORE_HEADER_ALIGN 4096 diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 33400ff051a8..960aefc4501d 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -517,7 +517,7 @@ static int locate_mem_hole_bottom_up(unsigned long start, unsigned long end, return 1; } -static int locate_mem_hole_callback(struct resource *res, void *arg) +int kexec_locate_mem_hole_callback(struct resource *res, void *arg) { struct kexec_buf *kbuf = (struct kexec_buf *)arg; u64 start = res->start, end = res->end; @@ -634,9 +634,9 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf) return 0; if (!IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) - ret = kexec_walk_resources(kbuf, locate_mem_hole_callback); + ret = kexec_walk_resources(kbuf, kexec_locate_mem_hole_callback); else - ret = kexec_walk_memblock(kbuf, locate_mem_hole_callback); + ret = kexec_walk_memblock(kbuf, kexec_locate_mem_hole_callback); return ret == 1 ? 0 : -EADDRNOTAVAIL; } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel