[PATCH v3 1/3] kexec_load: Use new kexec flag for hotplug support

Sourabh Jain sourabhjain at linux.ibm.com
Mon Jul 8 00:55:47 PDT 2024


Hello Baoquan,

On 08/07/24 07:09, Baoquan He wrote:
> Hi Sourabh,
>
> On 07/07/24 at 08:54pm, Sourabh Jain wrote:
>> Kernel commit 79365026f869 (crash: add a new kexec flag for hotplug
>> support) has introduced a new kexec flag to generalize hotplug support.
>> The newly introduced kexec flags for hotplug allow architectures to
>> exclude all the required kexec segments from SHA calculation so that
>> the kernel can update them on hotplug events. This was not possible
>> earlier with the KEXEC_UPDATE_ELFCOREHDR kexec flags since it was added
>> only for the elfcorehdr segment.
>>
>> To enable architectures to control the list of kexec segments to exclude
>> when hotplug support is enabled, add a new architecture-specific
>> function named arch_do_exclude_segment. During the SHA calculation, this
>> function gets called to let the architecture decide whether a specific
>> kexec segment should be considered for SHA calculation or not.
>>
>> Note: To avoid breaking backward compatibility, the new kexec flag
>> KEXEC_CRASH_HOTPLUG_SUPPORT is not used for x86 for now.
> For x86, both KEXEC_UPDATE_ELFCOREHDR and KEXEC_CRASH_HOTPLUG_SUPPORT
> should be OK for kexec_file_load.

Do we even need these flags for kexec_file_load at all?
My understanding is that these flags are only needed for the kexec_load 
system call.


> Your change will make a difference
> between kexec_load and kexec_file_load.

I am confused by the above statement.

Given that we don't even send any of the above flags for 
kexec_file_load, I am not
sure how these changes make a difference between the two system calls.

> But I agree with you on the
> backward cmpatibility with KEXEC_CRASH_HOTPLUG_SUPPORT flag.
>
> Anyway, if it's in a hurry to catch up with Simon's new release, this is
> fine, we can change it later.

It would be great if we could consider this patch series for the next 
release, but not at
the cost of breaking any backward compatibility for x86. If you think 
these changes are
breaking anything for any kernel version, I would prefer to update my 
patch series.

> Otherwise, we may be better to remove the
> difference, namely, not making x86 only be able to accept
> KEXEC_UPDATE_ELFCOREHDR flag on kexec_load. My personal opinion

On x86, passing the KEXEC_CRASH_HOTPLUG_SUPPORT kexec bit to kernel 
versions 6.5 to 6.9
with the kexec_load system call will fail with -EINVAL. However, from 
kernel 6.10 onward,
both KEXEC_UPDATE_ELFCOREHDR and KEXEC_CRASH_HOTPLUG_SUPPORT kexec bits 
are acceptable for x86.

My proposal is to use KEXEC_UPDATE_ELFCOREHDR on x86 for some time 
(maybe a couple of kernel releases),
and eventually switch to KEXEC_CRASH_HOTPLUG_SUPPORT for x86 as well.

This proposal of shifting to the KEXEC_CRASH_HOTPLUG_SUPPORT kexec bit 
for x86 is also mentioned in the
comment for the get_hotplug_kexec_flag function.

Please let me know your opinion.

Thanks,
Sourabh Jain



More information about the kexec mailing list