Re: [PATCH v15 1/7] crash: move crash_prepare_elf64_headers()

From: Petr Tesařík
Date: Mon Jan 16 2023 - 11:42:53 EST


Hi Eric,

On Thu, 12 Jan 2023 11:23:18 -0600
Eric DeVolder <eric.devolder@xxxxxxxxxx> wrote:

>[...]
> After looking into this for a bit, to allow hotplug without kexec_file would require quite a bit of
> code movement. Why? Because hotplug is basically built on top of (part of) the infrastructure that
> was needed for kexec_file.
>
> I'd be inclined to suggest that KEXEC_FILE be a required dependency for CRASH_HOTPLUG, ie:
>
> config CRASH_HOTPLUG
> bool "Update the crash elfcorehdr on system configuration changes"
> default n
> - depends on CRASH_DUMP && (HOTPLUG_CPU || MEMORY_HOTPLUG)
> + depends on CRASH_DUMP && KEXEC_FILE && (HOTPLUG_CPU || MEMORY_HOTPLUG)
>
>
> If that isn't feasible, then it would appear quite a bit of surgery is needed to properly separate
> out the items hotplug needs from kexec_file.
>
> Thoughts?

I would have thought that CPU hotplug can be handled in the kernel only
if the crash image was loaded by the kernel with kexec_file_load(2).
When the image is loaded with kexec_load(2), then all data structures
are prepared by the user-space utility kexec(8), and the kernel
generally has no idea how to handle them.

In short, I believe that by definition there must be this dependency of
CRASH_HOTPLUG on KEXEC_FILE.

Petr T