Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/kexec: remove unnecessary arch_kexec_kernel_image_load()

Patch series "kexec: Remove unnecessary arch hook", v2.

There are no arch-specific things in arch_kexec_kernel_image_load(), so
remove it and just use the generic version.


This patch (of 2):

The x86 implementation of arch_kexec_kernel_image_load() is functionally
identical to the generic arch_kexec_kernel_image_load():

arch_kexec_kernel_image_load # x86
if (!image->fops || !image->fops->load)
return ERR_PTR(-ENOEXEC);
return image->fops->load(image, image->kernel_buf, ...)

arch_kexec_kernel_image_load # generic
kexec_image_load_default
if (!image->fops || !image->fops->load)
return ERR_PTR(-ENOEXEC);
return image->fops->load(image, image->kernel_buf, ...)

Remove the x86-specific version and use the generic
arch_kexec_kernel_image_load(). No functional change intended.

Link: https://lkml.kernel.org/r/20230307224416.907040-1-helgaas@kernel.org
Link: https://lkml.kernel.org/r/20230307224416.907040-2-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Bjorn Helgaas and committed by
Andrew Morton
7982722f a74d9a3f

-16
-3
arch/x86/include/asm/kexec.h
··· 200 200 const Elf_Shdr *symtab); 201 201 #define arch_kexec_apply_relocations_add arch_kexec_apply_relocations_add 202 202 203 - void *arch_kexec_kernel_image_load(struct kimage *image); 204 - #define arch_kexec_kernel_image_load arch_kexec_kernel_image_load 205 - 206 203 int arch_kimage_file_post_load_cleanup(struct kimage *image); 207 204 #define arch_kimage_file_post_load_cleanup arch_kimage_file_post_load_cleanup 208 205 #endif
-11
arch/x86/kernel/machine_kexec_64.c
··· 374 374 /* arch-dependent functionality related to kexec file-based syscall */ 375 375 376 376 #ifdef CONFIG_KEXEC_FILE 377 - void *arch_kexec_kernel_image_load(struct kimage *image) 378 - { 379 - if (!image->fops || !image->fops->load) 380 - return ERR_PTR(-ENOEXEC); 381 - 382 - return image->fops->load(image, image->kernel_buf, 383 - image->kernel_buf_len, image->initrd_buf, 384 - image->initrd_buf_len, image->cmdline_buf, 385 - image->cmdline_buf_len); 386 - } 387 - 388 377 /* 389 378 * Apply purgatory relocations. 390 379 *
-2
include/linux/kexec.h
··· 207 207 } 208 208 #endif 209 209 210 - #ifndef arch_kexec_kernel_image_load 211 210 static inline void *arch_kexec_kernel_image_load(struct kimage *image) 212 211 { 213 212 return kexec_image_load_default(image); 214 213 } 215 - #endif 216 214 217 215 #ifdef CONFIG_KEXEC_SIG 218 216 #ifdef CONFIG_SIGNED_PE_FILE_VERIFICATION