summaryrefslogtreecommitdiffstats
path: root/kernel/kexec_file.c
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2017-10-20 10:30:51 -0400
committerThomas Gleixner <tglx@linutronix.de>2017-11-07 09:35:57 -0500
commit1d2e733b13b450e5854f4a8f8efcd77fa7362d62 (patch)
treea38738ce58e19cb5fb1f3d95e24e75cb1ab8fdf7 /kernel/kexec_file.c
parent4ac2aed837cbdbb21c12a28c04718e34c1dc225f (diff)
resource: Provide resource struct in resource walk callback
In preperation for a new function that will need additional resource information during the resource walk, update the resource walk callback to pass the resource structure. Since the current callback start and end arguments are pulled from the resource structure, the callback functions can obtain them from the resource structure directly. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Borislav Petkov <bp@suse.de> Tested-by: Borislav Petkov <bp@suse.de> Cc: kvm@vger.kernel.org Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Borislav Petkov <bp@alien8.de> Cc: linuxppc-dev@lists.ozlabs.org Link: https://lkml.kernel.org/r/20171020143059.3291-10-brijesh.singh@amd.com
Diffstat (limited to 'kernel/kexec_file.c')
-rw-r--r--kernel/kexec_file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index 9f48f4412297..e5bcd94c1efb 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -406,9 +406,10 @@ static int locate_mem_hole_bottom_up(unsigned long start, unsigned long end,
406 return 1; 406 return 1;
407} 407}
408 408
409static int locate_mem_hole_callback(u64 start, u64 end, void *arg) 409static int locate_mem_hole_callback(struct resource *res, void *arg)
410{ 410{
411 struct kexec_buf *kbuf = (struct kexec_buf *)arg; 411 struct kexec_buf *kbuf = (struct kexec_buf *)arg;
412 u64 start = res->start, end = res->end;
412 unsigned long sz = end - start + 1; 413 unsigned long sz = end - start + 1;
413 414
414 /* Returning 0 will take to next memory range */ 415 /* Returning 0 will take to next memory range */
@@ -437,7 +438,7 @@ static int locate_mem_hole_callback(u64 start, u64 end, void *arg)
437 * func returning non-zero, then zero will be returned. 438 * func returning non-zero, then zero will be returned.
438 */ 439 */
439int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf, 440int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf,
440 int (*func)(u64, u64, void *)) 441 int (*func)(struct resource *, void *))
441{ 442{
442 if (kbuf->image->type == KEXEC_TYPE_CRASH) 443 if (kbuf->image->type == KEXEC_TYPE_CRASH)
443 return walk_iomem_res_desc(crashk_res.desc, 444 return walk_iomem_res_desc(crashk_res.desc,