[PATCH -next] crash_core: Remove duplicated include in crash_core.c

2023-09-14 Thread Yang Li
./kernel/crash_core.c: linux/kexec.h is included more than once. Signed-off-by: Yang Li --- kernel/crash_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 1a77d466eaed..90fc1b636ba0 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c

[PATCH 7/7] RISC-V: Support loading Image binary file

2023-09-14 Thread Song Shuai
Add image-riscv file_type to probe/load Image file type, As for kexec_load, find the pbase aligned text_offset from image header and prepare segments for this syscall. for kexec_file_load, setup the related options and let kernel part to deal with the Image. Signed-off-by: Song Shuai --- kexec

[PATCH 6/7] RISC-V: Separate elf_riscv_find_pbase out

2023-09-14 Thread Song Shuai
The is the preparative patch for RISC-V kexec Image file support. Separate the elf_riscv_find_pbase() function out to allow kernel_load syscall load Image binary file. Signed-off-by: Song Shuai --- kexec/arch/riscv/kexec-elf-riscv.c | 72 +- kexec/arch/riscv/kexec-ri

[PATCH 5/7] RISC-V: Enable kexe_file_load

2023-09-14 Thread Song Shuai
From: Li Zhengyu Create prepare_kexec_file_options() function to prepare the options to kexec_file_load syscall, and it would be used in elf_riscv_load() or the future image_riscv_load(). The patch comes from the RISC-V Linux kernel_file_load support[1], So its author should be Li Zhengyu. [1]:

[PATCH 4/7] RISC-V: Correct the usage of command line option

2023-09-14 Thread Song Shuai
RISC-V process OPT_CMDLINE with the "command-line" partten, but the riscv_opts_usage shows the "cmdline" option. So correct the usage's output. Signed-off-by: Song Shuai --- kexec/arch/riscv/kexec-riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec/arch/riscv/kexec-

[PATCH 3/7] RISC-V: Get memory ranges from iomem

2023-09-14 Thread Song Shuai
When booting with UEFI, Linux marks the Runtime Code/Data memory as no-map and then exports it to "Reserved" iomem_resource. Kexc-tools uses dtb_get_memory_ranges() function to get memory ranges via parsing dtb, but it can't see the Reserved EFI Runtime memory. That would corrupt EFI Runtime memor

[PATCH 2/7] RISC-V: Fix the undeclared ‘EM_RISCV’ build failure

2023-09-14 Thread Song Shuai
Use local `elf.h` instead of `linux/elf.h` to fix this build error: ``` kexec/arch/riscv/crashdump-riscv.c:17:13: error: ‘EM_RISCV’ undeclared here (not in a function); did you mean ‘EM_CRIS’? .machine = EM_RISCV, ^~~~ EM_CRIS ``` Signed-off-by: Song Shuai --- k

[PATCH 1/7] RISC-V: Use linux,usable-memory-range for crash kernel

2023-09-14 Thread Song Shuai
Now we use "memeory::linux,usable-memory" to indicate the available memory for the crash kernel. While booting with UEFI, the crash kernel would use efi.memmap to re-populate memblock and then first kernel's memory would be corrputed. Consequently, the /proc/vmcore file failed to create in my loca

[PATCH 0/7] Kexec-tools: Improve RISC-V port

2023-09-14 Thread Song Shuai
Hi, This series is created to improve RISC-V port of kexec-tools, and is based on the horms/kexec-tools:build-test-riscv-v2 branch. For your convenience, here is my Github branch for kexec-tools: https://github.com/sugarfillet/kexec-tools/commits/rv-Image The first four patches fixes some build

Re: [PATCH v1 1/2] zboot: enable arm64 kexec_load for zboot image

2023-09-14 Thread Pingfan Liu
On Thu, Sep 14, 2023 at 4:50 PM Dave Young wrote: > > kexec_file_load support of zboot kernel image decompressed the vmlinuz, > so in kexec_load code just load the kernel with reading the decompressed > kernel fd into a new buffer and use it directly. > > Signed-off-by: Dave Young > --- > includ

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Jarkko Sakkinen
On Thu Sep 14, 2023 at 7:11 PM EEST, Jan Hendrik Farr wrote: > > BTW, would not be a bad idea to extend CC list to at least Matthew and > > James Bottomley on this patch. > > Sure. Added Matthew and James in CC > > Also, I already made some minor changes. cmdline is now used from the > syscall if t

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Jan Hendrik Farr
On Thu, Sep 14, 2023, at 8:51 PM, Philipp Rudo wrote: > [...] > > In this context I hope it is also clear to you that when more and more > people rely on the spec you need a more formal process when including > changes. Especially when the change might break the implementation of > others. So no mo

Re: [PATCH v3] x86/purgatory: Remove LTO flags

2023-09-14 Thread Sami Tolvanen
On Thu, Sep 14, 2023 at 10:02 AM Song Liu wrote: > > -flto* implies -ffunction-sections. With LTO enabled, ld.lld generates > multiple .text sections for purgatory.ro: > > $ readelf -S purgatory.ro | grep " .text" > [ 1] .text PROGBITS 0040 > [ 7] .te

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Philipp Rudo
Hi Jan, On Wed, 13 Sep 2023 16:42:33 +0200 "Jan Hendrik Farr" wrote: > On Wed, Sep 13, 2023, at 4:00 PM, Philipp Rudo wrote: [...] > In [5] Luca writes: > > [...] we fully intend for the UKI format to be an open and stable > > specification, that anybody can support and rely on. > But that i

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Philipp Rudo
Hi Lennart, On Thu, 14 Sep 2023 11:32:20 +0200 Lennart Poettering wrote: > On Mi, 13.09.23 16:00, Philipp Rudo (pr...@redhat.com) wrote: > > > For example there are two definitions for the UKI which contradict each > > other. > > The dedicated one [1] you have cited earlier and the one in the

Re: [PATCH v3] x86/purgatory: Remove LTO flags

2023-09-14 Thread Nick Desaulniers
On Thu, Sep 14, 2023 at 10:02 AM Song Liu wrote: > > -flto* implies -ffunction-sections. With LTO enabled, ld.lld generates > multiple .text sections for purgatory.ro: > > $ readelf -S purgatory.ro | grep " .text" > [ 1] .text PROGBITS 0040 > [ 7] .te

Re: [PATCH] x86/boot/compressed: Reserve more memory for page tables

2023-09-14 Thread Kirill A. Shutemov
On Thu, Sep 14, 2023 at 08:51:50AM -0700, Dave Hansen wrote: > On 9/14/23 05:30, Kirill A. Shutemov wrote: > > +/* > > + * Total number of page table kernel_add_identity_map() can allocate, > > + * including page tables consumed by startup_32(). > > + */ > > +# define BOOT_PGT_SIZE (32*

Re: [PATCH v2] x86/purgatory: Remove LTO flags

2023-09-14 Thread Song Liu
On Thu, Sep 14, 2023 at 9:34 AM Nick Desaulniers wrote: > > On Thu, Sep 14, 2023 at 9:31 AM Song Liu wrote: > > > > What would be the next step for this work? We hope to back port it > > to our production kernel soon. > > Please send a v3 with the fixes tag updated. I wouldn't mind if you > adde

[PATCH v3] x86/purgatory: Remove LTO flags

2023-09-14 Thread Song Liu
-flto* implies -ffunction-sections. With LTO enabled, ld.lld generates multiple .text sections for purgatory.ro: $ readelf -S purgatory.ro | grep " .text" [ 1] .text PROGBITS 0040 [ 7] .text.purgatory PROGBITS 20e0 [

Re: [PATCH v2] x86/purgatory: Remove LTO flags

2023-09-14 Thread Nick Desaulniers
On Thu, Sep 14, 2023 at 9:31 AM Song Liu wrote: > > What would be the next step for this work? We hope to back port it > to our production kernel soon. Please send a v3 with the fixes tag updated. I wouldn't mind if you added a comment to the commit message to the effect of: We could also add t

Re: [PATCH v2] x86/purgatory: Remove LTO flags

2023-09-14 Thread Song Liu
Hi folks, On Fri, Sep 8, 2023 at 4:13 PM Song Liu wrote: > > With LTO enabled, ld.lld generates multiple .text sections for > purgatory.ro: > > $ readelf -S purgatory.ro | grep " .text" > [ 1] .text PROGBITS 0040 > [ 7] .text.purgatory PROGBITS

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Jan Hendrik Farr
> BTW, would not be a bad idea to extend CC list to at least Matthew and > James Bottomley on this patch. Sure. Added Matthew and James in CC Also, I already made some minor changes. cmdline is now used from the syscall if there is no .cmdline section included in the UKI. find_section now return

Re: [PATCH] x86/boot/compressed: Reserve more memory for page tables

2023-09-14 Thread Dave Hansen
On 9/14/23 05:30, Kirill A. Shutemov wrote: > +/* > + * Total number of page table kernel_add_identity_map() can allocate, > + * including page tables consumed by startup_32(). > + */ > +# define BOOT_PGT_SIZE (32*4096) I agree that needing to know this in advance *exactly* is troubl

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Jarkko Sakkinen
On Thu Sep 14, 2023 at 3:26 PM EEST, Jarkko Sakkinen wrote: > On Thu Sep 14, 2023 at 12:32 PM EEST, Lennart Poettering wrote: > > On Mi, 13.09.23 16:00, Philipp Rudo (pr...@redhat.com) wrote: > > > > > For example there are two definitions for the UKI which contradict each > > > other. > > > The d

Re: [PATCH] makedumpfile: ppc64: do page traversal if vmemmap_list not populated

2023-09-14 Thread Sachin Sant
> On 14-Sep-2023, at 2:52 PM, Aditya Gupta wrote: > > Currently 'makedumpfile' fails to collect vmcore on upstream kernel, > with the errors: > >readpage_elf: Attempt to read non-existent page at 0x4000. >readmem: type_addr: 0, addr:0, size:8 >get_vmemmap_list_info: Can

[PATCH] x86/boot/compressed: Reserve more memory for page tables

2023-09-14 Thread Kirill A. Shutemov
The decompressor has a hard limit on the number of page tables it can allocate. This limit is defined at compile-time and will cause boot failure if it is reached. The kernel is very strict and calculates the limit precisely for the worst-case scenario based on the current configuration. However,

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Jarkko Sakkinen
On Thu Sep 14, 2023 at 12:32 PM EEST, Lennart Poettering wrote: > On Mi, 13.09.23 16:00, Philipp Rudo (pr...@redhat.com) wrote: > > > For example there are two definitions for the UKI which contradict each > > other. > > The dedicated one [1] you have cited earlier and the one in the BLS for > >

Re: [PATCH 0/1] x86/kexec: UKI support

2023-09-14 Thread Jarkko Sakkinen
On Thu Sep 14, 2023 at 12:11 PM EEST, Lennart Poettering wrote: > On Mi, 13.09.23 17:45, Jarkko Sakkinen (jar...@kernel.org) wrote: > > > On Tue Sep 12, 2023 at 11:49 PM EEST, Jan Hendrik Farr wrote: > > > > > > > These are sort of "tautological" arguments. There must be some > > > > objective reas

Re: [PATCH 0/1] x86/kexec: UKI support

2023-09-14 Thread Jarkko Sakkinen
On Thu Sep 14, 2023 at 11:48 AM EEST, Lennart Poettering wrote: > On Di, 12.09.23 17:32, Jan Hendrik Farr (ker...@jfarr.cc) wrote: > > > >> The format itself is rather simple. It's just a PE file (as required > > >> by the UEFI spec) that contains a small stub application in the .text, > > >> .data

Re: [PATCH] makedumpfile: ppc64: do page traversal if vmemmap_list not populated

2023-09-14 Thread Aditya Gupta
To be able to test this on a system with Radix MMU, the kernel needs to be patched with given kernel patch, since makedumpfile requires 'cpu_features.mmu_features' to check if MMU was Radix MMU: https://lore.kernel.org/linuxppc-dev/20230911091409.415662-1-adit...@linux.ibm.com/T/#u Or, the vmlinu

Re: [PATCH v1 1/2] zboot: enable arm64 kexec_load for zboot image

2023-09-14 Thread Baoquan He
On 09/14/23 at 04:49pm, Dave Young wrote: > kexec_file_load support of zboot kernel image decompressed the vmlinuz, > so in kexec_load code just load the kernel with reading the decompressed > kernel fd into a new buffer and use it directly. > > Signed-off-by: Dave Young > --- > include/kexec-pe

Re: [PATCH v2 0/2] x86/kexec: UKI Support

2023-09-14 Thread Lennart Poettering
On Mi, 13.09.23 16:00, Philipp Rudo (pr...@redhat.com) wrote: > For example there are two definitions for the UKI which contradict each other. > The dedicated one [1] you have cited earlier and the one in the BLS for type > #2 > entries [2]. In [1] the .linux and .initrd sections are mandatory an

[PATCH] makedumpfile: ppc64: do page traversal if vmemmap_list not populated

2023-09-14 Thread Aditya Gupta
Currently 'makedumpfile' fails to collect vmcore on upstream kernel, with the errors: readpage_elf: Attempt to read non-existent page at 0x4000. readmem: type_addr: 0, addr:0, size:8 get_vmemmap_list_info: Can't get vmemmap region addresses get_machdep_info_ppc64: Can't

Re: [PATCH 0/1] x86/kexec: UKI support

2023-09-14 Thread Lennart Poettering
On Mi, 13.09.23 17:45, Jarkko Sakkinen (jar...@kernel.org) wrote: > On Tue Sep 12, 2023 at 11:49 PM EEST, Jan Hendrik Farr wrote: > > > > > These are sort of "tautological" arguments. There must be some > > > objective reasons why this architecture was chosen instead of > > > other (i.e. using wha

Re: [PATCH 0/1] x86/kexec: UKI support

2023-09-14 Thread Lennart Poettering
On Di, 12.09.23 17:32, Jan Hendrik Farr (ker...@jfarr.cc) wrote: > >> The format itself is rather simple. It's just a PE file (as required > >> by the UEFI spec) that contains a small stub application in the .text, > >> .data, etc sections that is responsible for invoking the contained > >> kernel

[PATCH v1 2/2] zboot: add loongarch kexec_load support

2023-09-14 Thread Dave Young
Copy arm64 code and change for loongarch so that the kexec -c can load a zboot image. Note: probe zboot image first otherwise the pei-loongarch file type will be used. Signed-off-by: Dave Young --- kexec/arch/loongarch/Makefile | 1 + kexec/arch/loongarch/image-header.h| 1

[PATCH v1 0/2] zboot: enable kexec_load for zboot kernel images

2023-09-14 Thread Dave Young
The current kexec-tools only support kexec_file_load for zboot kernel images on arm64. This series tweak a bit of the code so kexec_load can also load zboot images on both arm64 and loongarch. V1 changes: - dup the kernel_fd so that kexec_file_load can work since slurp_fd will close it. - code cl

[PATCH v1 1/2] zboot: enable arm64 kexec_load for zboot image

2023-09-14 Thread Dave Young
kexec_file_load support of zboot kernel image decompressed the vmlinuz, so in kexec_load code just load the kernel with reading the decompressed kernel fd into a new buffer and use it directly. Signed-off-by: Dave Young --- include/kexec-pe-zboot.h | 3 ++- kexec/arch/arm64/kexec-

Re: [PATCH v3 6/9] x86: kdump: use generic interface to simplify crashkernel reservation code

2023-09-14 Thread kernel test robot
Hi Baoquan, kernel test robot noticed the following build warnings: [auto build test WARNING on powerpc/next] [also build test WARNING on powerpc/fixes linus/master v6.6-rc1 next-20230914] [cannot apply to arm64/for-next/core tip/x86/core] [If your patch is applied to the wrong git tree, kindly