Re: [PATCH v11 3/7] crash: add generic infrastructure for crash hotplug support

2022-09-09 Thread Eric DeVolder
On 8/30/22 22:26, Baoquan He wrote: On 08/26/22 at 01:37pm, Eric DeVolder wrote: CPU and memory change notifications are received in order to regenerate the elfcorehdr. To support cpu hotplug, a callback is registered to capture the CPUHP_AP_ONLINE_DYN online and offline events via cpuhp_set

[PATCH v12 5/7] kexec: exclude hot remove cpu from elfcorehdr notes

2022-09-09 Thread Eric DeVolder
Due to use of CPUHP_AP_ONLINE_DYN, upon CPU unplug, the CPU is still in the for_each_present_cpu() list when within the handle_hotplug_event(). Thus the CPU must be explicitly excluded when building the new list of CPUs. This change identifies in handle_hotplug_event() the CPU to be excluded, and

[PATCH v12 1/7] crash: move crash_prepare_elf64_headers

2022-09-09 Thread Eric DeVolder
At the outcome of this patch set, the crash_prepare_elf64_headers() is utilized on both the kexec_file_load and kexec_load paths. As such, need to move this function out of kexec_file.c and into a common location crash_core.c. No functionality change. Signed-off-by: Eric DeVolder Acked-by: Baoqu

[PATCH v12 2/7] crash: prototype change for crash_prepare_elf64_headers

2022-09-09 Thread Eric DeVolder
>From within crash_prepare_elf64_headers() there is a need to reference the struct kimage hotplug members. As such, this change passes the struct kimage as a parameter to the crash_prepare_elf64_headers(). The hotplug members are added in "crash: add generic infrastructure for crash hotplug support

[PATCH v12 3/7] crash: add generic infrastructure for crash hotplug support

2022-09-09 Thread Eric DeVolder
CPU and memory change notifications are received in order to regenerate the elfcorehdr. To support cpu hotplug, a callback is registered to capture the CPUHP_AP_ONLINE_DYN online and offline events via cpuhp_setup_state_nocalls(). To support memory hotplug, a notifier is registered to capture the

[PATCH v12 6/7] crash: memory and cpu hotplug sysfs attributes

2022-09-09 Thread Eric DeVolder
This introduces the crash_hotplug attribute for memory and CPUs for use by userspace. This change directly facilitates the udev rule for managing userspace re-loading of the crash kernel upon hot un/plug changes. For memory, this changeset introduces the crash_hotplug attribute to the /sys/device

[PATCH v12 7/7] x86/crash: Add x86 crash hotplug support

2022-09-09 Thread Eric DeVolder
For x86_64, when CPU or memory is hot un/plugged, the crash elfcorehdr, which describes the CPUs and memory in the system, must also be updated. When loading the crash kernel via kexec_load or kexec_file_load, the elfcorehdr is identified at run time in crash_core:handle_hotplug_event(). To updat

[PATCH v12 4/7] kexec: exclude elfcorehdr from the segment digest

2022-09-09 Thread Eric DeVolder
When a crash kernel is loaded via the kexec_file_load syscall, the kernel places the various segments (ie crash kernel, crash initrd, boot_params, elfcorehdr, purgatory, etc) in memory. For those architectures that utilize purgatory, a hash digest of the segments is calculated for integrity checkin

[PATCH v12 0/7] crash: Kernel handling of CPU and memory hot un/plug

2022-09-09 Thread Eric DeVolder
When the kdump service is loaded, if a CPU or memory is hot un/plugged, the crash elfcorehdr, which describes the CPUs and memory in the system, must also be updated, else the resulting vmcore is inaccurate (eg. missing either CPU context or memory regions). The current solution utilizes udev to i

Re: [PATCH v2 1/3] LoongArch: Add kexec support

2022-09-09 Thread Youling Tang
Hi, Huacai On 09/09/2022 04:16 PM, Huacai Chen wrote: Hi, Youling, On Fri, Sep 9, 2022 at 11:20 AM Youling Tang wrote: Add three new files, kexec.h, machine_kexec.c and relocate_kernel.S to the LoongArch architecture that add support for the kexec re-boot mechanis (CONFIG_KEXEC) on LoongArch

Re: [PATCH v2 2/3] LoongArch: Add kdump support

2022-09-09 Thread Youling Tang
Hi,Huacai On 09/09/2022 04:15 PM, Huacai Chen wrote: Hi, Youling, On Fri, Sep 9, 2022 at 11:20 AM Youling Tang wrote: This patch adds support for kdump, the kernel will reserve a region for the crash kernel and jump there on panic. Arch-specific functions are added to allow for implementing

Re: [PATCH v2 1/3] LoongArch: Add kexec support

2022-09-09 Thread Huacai Chen
Hi, Youling, On Fri, Sep 9, 2022 at 11:20 AM Youling Tang wrote: > > Add three new files, kexec.h, machine_kexec.c and relocate_kernel.S to the > LoongArch architecture that add support for the kexec re-boot mechanis > (CONFIG_KEXEC) on LoongArch platforms. > > Supports loading vmlinux (vmlinux.e

Re: [PATCH v2 2/3] LoongArch: Add kdump support

2022-09-09 Thread Huacai Chen
Hi, Youling, On Fri, Sep 9, 2022 at 11:20 AM Youling Tang wrote: > > This patch adds support for kdump, the kernel will reserve a region > for the crash kernel and jump there on panic. > > Arch-specific functions are added to allow for implementing a crash > dump file interface, /proc/vmcore, whi