From: Marc Zyngier <maz@kernel.org>
To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
James Morse <james.morse@arm.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Hanjun Guo <guohanjun@huawei.com>,
Sudeep Holla <sudeep.holla@arm.com>,
Eric Biederman <ebiederm@xmission.com>,
Bhupesh SHARMA <bhupesh.sharma@linaro.org>,
AKASHI Takahiro <takahiro.akashi@linaro.org>,
Dave Young <dyoung@redhat.com>, Moritz Fischer <mdf@kernel.org>,
kernel-team@android.com
Subject: [PATCH 1/4] kexec_file: Make locate_mem_hole_callback global
Date: Wed, 26 May 2021 20:05:28 +0100 [thread overview]
Message-ID: <20210526190531.62751-2-maz@kernel.org> (raw)
In-Reply-To: <20210526190531.62751-1-maz@kernel.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.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
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
next prev parent reply other threads:[~2021-05-26 19:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 19:05 [PATCH 0/4] arm64: Make kexec_file_load honor iomem reservations Marc Zyngier
2021-05-26 19:05 ` Marc Zyngier [this message]
2021-05-26 19:05 ` [PATCH 2/4] kernel/resource: Populate child pointer in find_next_iomem_res() Marc Zyngier
2021-05-27 16:53 ` Catalin Marinas
2021-05-28 8:06 ` Marc Zyngier
2021-05-26 19:05 ` [PATCH 3/4] kernel/resource: Add walk_excluding_child_res() helper Marc Zyngier
2021-05-26 19:05 ` [PATCH 4/4] arm64: kexec_image: Implement arch_kexec_locate_mem_hole() Marc Zyngier
2021-05-27 17:37 ` Catalin Marinas
2021-05-28 9:05 ` Marc Zyngier
2021-05-27 17:39 ` [PATCH 0/4] arm64: Make kexec_file_load honor iomem reservations Catalin Marinas
2021-05-31 6:02 ` Ard Biesheuvel
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=20210526190531.62751-2-maz@kernel.org \
--to=maz@kernel.org \
--cc=ardb@kernel.org \
--cc=bhupesh.sharma@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=guohanjun@huawei.com \
--cc=james.morse@arm.com \
--cc=kernel-team@android.com \
--cc=kexec@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
--cc=mdf@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=takahiro.akashi@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).