Re: [PATCH v5 1/3] vmcore: Convert copy_oldmem_page() to take an iov_iter

2022-04-01 Thread Baoquan He
On 04/02/22 at 12:30pm, Baoquan He wrote: It's odd. I cann't see the content of patches in this series from my mailbox and mail client, but I can see them in lore.kernel.org. https://lore.kernel.org/all/20220402043008.458679-1-...@redhat.com/T/#u ___

[PATCH v5 3/3] vmcore: Convert read_from_oldmem() to take an iov_iter

2022-04-01 Thread Baoquan He
From: "Matthew Wilcox (Oracle)" Remove the read_from_oldmem() wrapper introduced earlier and convert all the remaining callers to pass an iov_iter. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Acked-by: Baoquan He --- arch/x86/kernel/crash_dump_64.c | 7 +-

[PATCH v5 1/3] vmcore: Convert copy_oldmem_page() to take an iov_iter

2022-04-01 Thread Baoquan He
From: "Matthew Wilcox (Oracle)" Instead of passing in a 'buf' and 'userbuf' argument, pass in an iov_iter. s390 needs more work to pass the iov_iter down further, or refactor, but I'd be more comfortable if someone who can test on s390 did that work. It's more convenient to convert the whole of

[PATCH v5 2/3] vmcore: Convert __read_vmcore to use an iov_iter

2022-04-01 Thread Baoquan He
From: "Matthew Wilcox (Oracle)" This gets rid of copy_to() and let us use proc_read_iter() instead of proc_read(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Acked-by: Baoquan He --- fs/proc/vmcore.c | 82 ++-- 1 file

[PATCH v5 0/3] Convert vmcore to use an iov_iter

2022-04-01 Thread Baoquan He
Copy the description of v3 cover letter from Willy: === For some reason several people have been sending bad patches to fix compiler warnings in vmcore recently. Here's how it should be done. Compile-tested only on x86. As noted in the first patch, s390 should take this conversion a bit further,

Re: [PATCH v5 8/8] x86/crash: Add x86 crash hotplug support for kexec_load

2022-04-01 Thread Eric DeVolder
On 3/31/22 06:10, Baoquan He wrote: On 03/03/22 at 11:27am, Eric DeVolder wrote: For kexec_file_load support, the loading of the crash kernel occurs entirely within the kernel, and as such the elfcorehdr is readily identified (so that it can be modified upon hotplug events). This change

Re: [PATCH v5 7/8] x86/crash: Add x86 crash hotplug support for kexec_file_load

2022-04-01 Thread Eric DeVolder
On 3/31/22 05:34, Baoquan He wrote: On 03/03/22 at 11:27am, Eric DeVolder wrote: 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. To update the elfcorehdr for x86_64, a new elfcorehdr must be

[PATCH v6 2/8] x86/crash: Introduce new options to support cpu and memory hotplug

2022-04-01 Thread Eric DeVolder
CRASH_HOTPLUG is to enable cpu and memory hotplug support of crash. CRASH_HOTPLUG_ELFCOREHDR_SZ is used to specify the maximum size of the elfcorehdr buffer/segment. This is a preparation for later usage. Signed-off-by: Eric DeVolder --- arch/x86/Kconfig | 26 ++ 1

Re: [PATCH v5 4/8] crash: generic crash hotplug support infrastructure

2022-04-01 Thread Eric DeVolder
On 3/28/22 20:10, Baoquan He wrote: On 03/28/22 at 11:08am, Eric DeVolder wrote: Baoquan, a comment below. eric On 3/24/22 09:37, Eric DeVolder wrote: On 3/24/22 09:33, Baoquan He wrote: On 03/24/22 at 08:53am, Eric DeVolder wrote: Baoquan, Thanks, I've offered a minor correction

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

2022-04-01 Thread Eric DeVolder
When the kdump service is loaded, if a CPU or memory is hot un/plugged, the crash elfcorehdr (for x86), 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

[PATCH v6 8/8] x86/crash: Add x86 crash hotplug support for kexec_load

2022-04-01 Thread Eric DeVolder
For kexec_file_load support, the loading of the crash kernel occurs entirely within the kernel, and as such the elfcorehdr is readily identified (so that it can be modified upon hotplug events). This change enables support for kexec_load by identifying the elfcorehdr segment in the

[PATCH v6 6/8] kexec: exclude hot remove cpu from elfcorehdr notes

2022-04-01 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 crash_hotplug_handler(). Thus the CPU must be explicitly excluded when building the new list of CPUs. This change identifies in crash_hotplug_handler() the CPU to be excluded,

[PATCH v6 3/8] crash: prototype change for crash_prepare_elf64_headers

2022-04-01 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(). This is preparation for later patch, no functionality change. Signed-off-by: Eric DeVolder

Re: [PATCH v5 2/8] x86/crash hp: Introduce CRASH_HOTPLUG configuration options

2022-04-01 Thread Eric DeVolder
On 3/21/22 06:59, Baoquan He wrote: On 03/03/22 at 11:27am, Eric DeVolder wrote: Support for CPU and memory hotplug for crash is controlled by the CRASH_HOTPLUG configuration option, introduced by this patch. The CRASH_HOTPLUG_ELFCOREHDR_SZ related configuration option is also introduced

[PATCH v6 4/8] crash: add generic infrastructure for crash hotplug support

2022-04-01 Thread Eric DeVolder
Upon CPU and memory changes, a generic crash_hotplug_handler() dispatches the hot plug/unplug event to the architecture specific arch_crash_hotplug_handler(). During the process, the kexec_mutex is held. To support cpu hotplug, a callback is registered to capture the CPUHP_AP_ONLINE_DYN online

[PATCH v6 1/8] x86/crash: fix minor typo/bug in debug message

2022-04-01 Thread Eric DeVolder
The pr_debug() intends to display the memsz member, but the parameter is actually the bufsz member (which is already displayed). Correct this to display memsz value. Signed-off-by: Eric DeVolder Acked-by: Baoquan He --- arch/x86/kernel/crash.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v6 7/8] x86/crash: Add x86 crash hotplug support for kexec_file_load

2022-04-01 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. To update the elfcorehdr for x86_64, a new elfcorehdr must be generated from the available CPUs and memory. The new elfcorehdr is prepared into a

[PATCH v6 5/8] kexec: exclude elfcorehdr from the segment digest

2022-04-01 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

[ANNOUNCE] kexec-tools 2.0.24-rc1

2022-04-01 Thread Simon Horman
Hi all, I am happy to announce the release of kexec-tools 2.0.24-rc1. This is an incremental feature pre-release. So long as no serious problems arise I intend to release kexec-tools 2.0.24 in a weeks time. Testing of 2.0.24-rc1 would be greatly appreciated. I do not have any outstanding

Re: [PATCH 0/2] misc improvement of code

2022-04-01 Thread Simon Horman
On Thu, Mar 31, 2022 at 01:59:32PM +0800, Pingfan Liu wrote: > > Cc: Simon Horman > To: kexec@lists.infradead.org > > Pingfan Liu (2): > arm64/crashdump-arm64: explicit type conversion to suppress compiler > warning > kexec/elf: assign one to align if sh_addralign equals zero > >

Re: [PATCH] arm64: fix static data relocations in machine_apply_elf_rel()

2022-04-01 Thread Simon Horman
On Thu, Mar 31, 2022 at 02:03:31PM +0800, Pingfan Liu wrote: > As for 'static data relocations', instead of patching an instruction (OR > ops), it should be assigned to value directly. > > Signed-off-by: Pingfan Liu > Cc: Geoff Levand > Cc: Catalin Marinas > Cc: Simon Horman > To:

Re: [PATCH 0/3] arm64: add support for new reloc type in kexec-arm64.c

2022-04-01 Thread Simon Horman
On Thu, Mar 31, 2022 at 11:38:04AM +0800, Pingfan Liu wrote: > With GCC 12 or Clang 13, kexec-tools can not load kernel successfully on > aarch64. This is caused by some unsupported reloc type in > arm64/kexec-arm64.c. > > This series add support for those reloc type. > > Cc: Geoff Levand > Cc: