The patch titled Subject: kexec_file: clean up arch_kexec_kernel_image_load has been added to the -mm mm-nonmm-unstable branch. Its filename is kexec_file-clean-up-arch_kexec_kernel_image_load.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kexec_file-clean-up-arch_kexec_kernel_image_load.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Baoquan He <bhe@xxxxxxxxxx> Subject: kexec_file: clean up arch_kexec_kernel_image_load Date: Wed, 23 Feb 2022 19:32:25 +0800 arch_kexec_kernel_image_load() has a common weak version which is a wrapper of kexec_image_load_default() , and has only one arch dependent version in x86_64. Now the x86_64 dependent function is not needed any more. So clean it up. And also rename kexec_image_load_default() to kexec_kernel_image_load() for better reflecting its functionality. Link: https://lkml.kernel.org/r/20220223113225.63106-3-bhe@xxxxxxxxxx Signed-off-by: Baoquan He <bhe@xxxxxxxxxx> Acked-by: Dave Young <dyoung@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/x86/kernel/machine_kexec_64.c | 11 ----------- include/linux/kexec.h | 1 - kernel/kexec_file.c | 9 ++------- 3 files changed, 2 insertions(+), 19 deletions(-) --- a/arch/x86/kernel/machine_kexec_64.c~kexec_file-clean-up-arch_kexec_kernel_image_load +++ a/arch/x86/kernel/machine_kexec_64.c @@ -374,17 +374,6 @@ void machine_kexec(struct kimage *image) /* arch-dependent functionality related to kexec file-based syscall */ #ifdef CONFIG_KEXEC_FILE -void *arch_kexec_kernel_image_load(struct kimage *image) -{ - if (!image->fops || !image->fops->load) - return ERR_PTR(-ENOEXEC); - - return image->fops->load(image, image->kernel_buf, - image->kernel_buf_len, image->initrd_buf, - image->initrd_buf_len, image->cmdline_buf, - image->cmdline_buf_len); -} - /* * Apply purgatory relocations. * --- a/include/linux/kexec.h~kexec_file-clean-up-arch_kexec_kernel_image_load +++ a/include/linux/kexec.h @@ -192,7 +192,6 @@ void *kexec_purgatory_get_symbol_addr(st /* Architectures may override the below functions */ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf, unsigned long buf_len); -void *arch_kexec_kernel_image_load(struct kimage *image); int arch_kimage_file_post_load_cleanup(struct kimage *image); #ifdef CONFIG_KEXEC_SIG int arch_kexec_kernel_verify_sig(struct kimage *image, void *buf, --- a/kernel/kexec_file.c~kexec_file-clean-up-arch_kexec_kernel_image_load +++ a/kernel/kexec_file.c @@ -60,7 +60,7 @@ int __weak arch_kexec_kernel_image_probe return kexec_image_probe_default(image, buf, buf_len); } -static void *kexec_image_load_default(struct kimage *image) +static void *kexec_kernel_image_load(struct kimage *image) { if (!image->fops || !image->fops->load) return ERR_PTR(-ENOEXEC); @@ -71,11 +71,6 @@ static void *kexec_image_load_default(st image->cmdline_buf_len); } -void * __weak arch_kexec_kernel_image_load(struct kimage *image) -{ - return kexec_image_load_default(image); -} - int kexec_image_post_load_cleanup_default(struct kimage *image) { if (!image->fops || !image->fops->cleanup) @@ -245,7 +240,7 @@ kimage_file_prepare_segments(struct kima ima_add_kexec_buffer(image); /* Call arch image load handlers */ - ldata = arch_kexec_kernel_image_load(image); + ldata = kexec_kernel_image_load(image); if (IS_ERR(ldata)) { ret = PTR_ERR(ldata); _ Patches currently in -mm which might be from bhe@xxxxxxxxxx are x86-kexec-fix-memory-leak-of-elf-header-buffer.patch kexec_file-clean-up-arch_kexec_kernel_image_load.patch