[PATCH 3/3] efi: enforce usable memory range after reserving regions

2022-01-10 Thread Frank van der Linden
The usable memory range may be restricted through parameters that did not come from EFI, like the FDT "linux,usable-memory-range" property. Enforce this range after the EFI memory map regions have been processed. Signed-off-by: Frank van der Linden --- drivers/firmware/efi/efi-init.c | 7 ++

[PATCH 1/3] memblock: define functions to set the usable memory range

2022-01-10 Thread Frank van der Linden
Some architectures might limit the usable memory range based on a firmware property, like "linux,usable-memory-range" for ARM crash kernels. This limit needs to be enforced after firmware memory map processing has been done, which might be e.g. FDT or EFI, or both. Define an interface for it that

[PATCH 0/3] usable memory range fixes (arm64/fdt/efi)

2022-01-10 Thread Frank van der Linden
b261dba2fdb2 ("arm64: kdump: Remove custom linux,usable-memory-range handling") moved capping memory ranges using the FDT-specified linux,usable-memory-range to the FDT code. This property is used to specify the memory range that a crash kernel runs in. While this correctly filters any memory rang

[PATCH 2/3] of: fdt: use memblock usable range interface

2022-01-10 Thread Frank van der Linden
Use the memblock usable range interface to set and enforce the usable memory range (if any). Signed-off-by: Frank van der Linden --- drivers/of/fdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 4546572af24b..b3c2a4124518 100644

Re: [RFC v2 0/6] crash: Kernel handling of CPU and memory hot un/plug

2022-01-10 Thread Eric DeVolder
On 1/10/22 02:04, Baoquan He wrote: Hi Eric, On 01/05/22 at 08:25am, Eric DeVolder wrote: Nudge... Fwiw, below is a working changeset to kexec userspace utility that allows the kexec_load path to work similarly to the kexec_file_load path of this RFC. With both the following userspace kex

[PATCH v3 6/6] crash hp: Add x86 crash hotplug support

2022-01-10 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 buffer,

[PATCH v3 5/6] crash hp: kexec_file changes for crash hotplug support

2022-01-10 Thread Eric DeVolder
Two important changes to note: The kexec_calculate_store_digests() changed to specifically EXCLUDE the elfcorehdr segment from its list of segments to check. This is an important change as it allows, in a hotplug environment, for the elfcorehdr segment (which contains the list of CPUs and memory r

[PATCH v3 1/6] crash: fix minor typo/bug in debug message

2022-01-10 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 deletion(

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

2022-01-10 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 utilizes

[PATCH v3 3/6] crash hp: definitions and prototype changes

2022-01-10 Thread Eric DeVolder
This change adds members to struct kimage to facilitate crash hotplug support. This change also defines crash hotplug events and associated prototypes. Signed-off-by: Eric DeVolder --- include/linux/kexec.h | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git

[PATCH v3 2/6] crash hp: Introduce CRASH_HOTPLUG configuration options

2022-01-10 Thread Eric DeVolder
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 with this patch. Signed-off-by: Eric DeVolder --- arch/x86/Kconfig | 26 +++

[PATCH v3 4/6] crash hp: generic crash hotplug support infrastructure

2022-01-10 Thread Eric DeVolder
This patch introduces a generic crash hot plug/unplug infrastructure for CPU and memory changes. Upon CPU and memory changes, a generic crash_hotplug_handler() obtains the appropriate lock, does some important house keeping and then dispatches the hot plug/unplug event to the architecture specific

Re: [PATCH v4 6/6] module: Move duplicate mod_check_sig users code to mod_parse_sig

2022-01-10 Thread kernel test robot
Hi Michal, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on s390/features linus/master jeyu/modules-next v5.16 next-20220110] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we

Re: [PATCH 1/1] s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()

2022-01-10 Thread Heiko Carstens
On Mon, Jan 10, 2022 at 04:23:05PM +0100, Alexander Egorenkov wrote: > Heiko Carstens writes: > > Given that Alexander is currently not available, I will resend his > > patch with an updated commit message. > > Many thanks for the review and taking care of the review finding. But it looks like t

Re: [PATCH 1/1] s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()

2022-01-10 Thread Alexander Egorenkov
Heiko Carstens writes: > > Given that Alexander is currently not available, I will resend his > patch with an updated commit message. Many thanks for the review and taking care of the review finding. Regards Alex ___ kexec mailing list kexec@lists.in

[PATCH v4 5/6] module: Use key_being_used_for for log messages in verify_appended_signature

2022-01-10 Thread Michal Suchanek
Add value for kexec appended signature and pass in key_being_used_for enum rather than a string to verify_appended_signature to produce log messages about the signature. Signed-off-by: Michal Suchanek --- arch/powerpc/kexec/elf_64.c | 2 +- arch/s390/kernel/machine_kexec_file.c

[PATCH v4 4/6] module: strip the signature marker in the verification function.

2022-01-10 Thread Michal Suchanek
It is stripped by each caller separately. Note: this changes the error for kexec_file from EKEYREJECTED to ENODATA when the signature marker is missing. Signed-off-by: Michal Suchanek --- v3: - Philipp Rudo : Update the commit with note about change of raturn value - the module_signatu

[PATCH v4 3/6] kexec_file: Don't opencode appended signature verification.

2022-01-10 Thread Michal Suchanek
Module verification already implements appeded signature verification. Reuse it for kexec_file. Signed-off-by: Michal Suchanek --- v3: - Philipp Rudo : Update the dependency on MODULE_SIG_FORMAT to MODULE_SIG - Include linux/verification.h - previously added in earlier patch v4: - kern

[PATCH v4 0/6] KEXEC_SIG with appended signature

2022-01-10 Thread Michal Suchanek
Hello, This is a refresh of the KEXEC_SIG series. This adds KEXEC_SIG support on powerpc and deduplicates the code dealing with appended signatures in the kernel. powerpc supports IMA_KEXEC but that's an exception rather than the norm. On the other hand, KEXEC_SIG is portable across platforms.

[PATCH v4 2/6] powerpc/kexec_file: Add KEXEC_SIG support.

2022-01-10 Thread Michal Suchanek
Copy the code from s390x Both powerpc and s390x use appended signature format (as opposed to EFI based patforms using PE format). Signed-off-by: Michal Suchanek --- v3: - Philipp Rudo : Update the comit message with explanation why the s390 code is usable on powerpc. - Include correct

[PATCH v4 6/6] module: Move duplicate mod_check_sig users code to mod_parse_sig

2022-01-10 Thread Michal Suchanek
Multiple users of mod_check_sig check for the marker, then call mod_check_sig, extract signature length, and remove the signature. Put this code in one place together with mod_check_sig. This changes the error from ENOENT to ENODATA for ima_read_modsig in the case the signature marker is missing.

[PATCH v4 1/6] s390/kexec_file: Don't opencode appended signature check.

2022-01-10 Thread Michal Suchanek
Module verification already implements appeded signature check. Reuse it for kexec_file. The kexec_file implementation uses EKEYREJECTED error in some cases when there is no key and the common implementation uses ENOPKG or EBADMSG instead. Signed-off-by: Michal Suchanek Acked-by: Heiko Carstens

[PATCH v5] arm64: support more than one crash kernel regions

2022-01-10 Thread Zhen Lei
From: Chen Zhou When crashkernel is reserved above 4G in memory, kernel should reserve some amount of low memory for swiotlb and some DMA buffers. So there may be two crash kernel regions, one is below 4G, the other is above 4G. Currently, there is only one crash kernel region on arm64, and pass

Re: [RFC v2 0/6] crash: Kernel handling of CPU and memory hot un/plug

2022-01-10 Thread Baoquan He
Hi Eric, On 01/05/22 at 08:25am, Eric DeVolder wrote: > Nudge... > > Fwiw, below is a working changeset to kexec userspace utility that allows the > kexec_load > path to work similarly to the kexec_file_load path of this RFC. With both the > following > userspace kexec patch and this RFC, both