#
fb5bc347 |
| 06-Oct-2025 |
Linus Torvalds <torvalds@linux-foundation.org> |
Merge tag 'loongarch-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
Pull LoongArch updates from Huacai Chen:
- Initialize acpi_gbl_use_global_lock to false
- Al
Merge tag 'loongarch-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
Pull LoongArch updates from Huacai Chen:
- Initialize acpi_gbl_use_global_lock to false
- Allow specify SIMD width via kernel parameters
- Add kexec_file (both EFI & ELF format) support
- Add PER_VMA_LOCK for page fault handling support
- Improve BPF trampoline support
- Update the default config file
- Some bug fixes and other small changes
* tag 'loongarch-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: (23 commits) LoongArch: Update Loongson-3 default config file LoongArch: BPF: Sign-extend struct ops return values properly LoongArch: BPF: Make error handling robust in arch_prepare_bpf_trampoline() LoongArch: BPF: Make trampoline size stable LoongArch: BPF: Don't align trampoline size LoongArch: BPF: No support of struct argument in trampoline programs LoongArch: BPF: No text_poke() for kernel text LoongArch: BPF: Remove duplicated bpf_flush_icache() LoongArch: BPF: Remove duplicated flags check LoongArch: BPF: Fix uninitialized symbol 'retval_off' LoongArch: BPF: Optimize sign-extention mov instructions LoongArch: Handle new atomic instructions for probes LoongArch: Try VMA lock-based page fault handling first LoongArch: Automatically disable kaslr if boot from kexec_file LoongArch: Add crash dump support for kexec_file LoongArch: Add ELF binary support for kexec_file LoongArch: Add EFI binary support for kexec_file LoongArch: Add preparatory infrastructure for kexec_file LoongArch: Add struct loongarch_image_header for kernel LoongArch: Allow specify SIMD width via kernel parameters ...
show more ...
|
#
1bcca862 |
| 02-Oct-2025 |
Youling Tang <tangyouling@kylinos.cn> |
LoongArch: Add crash dump support for kexec_file
Enabling crash dump (kdump) includes: - Prepare contents of ELF header of a core dump file, /proc/vmcore, using crash_prepare_elf64_headers(). - Ad
LoongArch: Add crash dump support for kexec_file
Enabling crash dump (kdump) includes: - Prepare contents of ELF header of a core dump file, /proc/vmcore, using crash_prepare_elf64_headers(). - Add "mem=size@start" parameter to the command line and pass it to the capture kernel. Limit the runtime memory area of the captured kernel to avoid disrupting the production kernel's runtime state. - Add "elfcorehdr=size@start" parameter to the cmdline.
The basic usage for kdump (add the cmdline parameter crashkernel=512M to grub.cfg for production kernel):
1) Load capture kernel image (vmlinux.efi or vmlinux can both be used): # kexec -s -p vmlinuz.efi --initrd=initrd.img --reuse-cmdline
2) Do something to crash, like: # echo c > /proc/sysrq-trigger
Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
show more ...
|
#
fc9c112f |
| 02-Oct-2025 |
Youling Tang <tangyouling@kylinos.cn> |
LoongArch: Add ELF binary support for kexec_file
This patch creates kexec_elf_ops to load ELF binary file for kexec_file_load() syscall.
However, for `kbuf->memsz` and `kbuf->buf_min`, special hand
LoongArch: Add ELF binary support for kexec_file
This patch creates kexec_elf_ops to load ELF binary file for kexec_file_load() syscall.
However, for `kbuf->memsz` and `kbuf->buf_min`, special handling is required, and the generic `kexec_elf_load()` cannot be used directly.
$ readelf -l vmlinux ... Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align LOAD 0x0000000000010000 0x9000000000200000 0x9000000000200000 0x0000000002747a00 0x000000000287a0d8 RWE 0x10000 NOTE 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 R 0x8
phdr->p_paddr should have been a physical address, but it is a virtual address on the current LoongArch. This will cause kexec_file to fail when loading the kernel and need to be converted to a physical address.
From the above MemSiz, it can be seen that 0x287a0d8 isn't page aligned. Although kexec_add_buffer() will perform PAGE_SIZE alignment on kbuf-> memsz, there is still a stampeding in the loaded kernel space and initrd space. The initrd resolution failed when starting the second kernel.
It can be known from the link script vmlinux.lds.S that, BSS_SECTION(0, SZ_64K, 8) . = ALIGN(PECOFF_SEGMENT_ALIGN);
It needs to be aligned according to SZ_64K, so that after alignment, its size is consistent with _kernel_asize.
The basic usage (vmlinux):
1) Load second kernel image: # kexec -s -l vmlinux --initrd=initrd.img --reuse-cmdline
2) Startup second kernel: # kexec -e
Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
show more ...
|
#
55d990f0 |
| 02-Oct-2025 |
Youling Tang <tangyouling@kylinos.cn> |
LoongArch: Add EFI binary support for kexec_file
This patch creates kexec_efi_ops to load EFI binary file for kexec_file_load() syscall.
The efi_kexec_load() as two parts: - the first part loads th
LoongArch: Add EFI binary support for kexec_file
This patch creates kexec_efi_ops to load EFI binary file for kexec_file_load() syscall.
The efi_kexec_load() as two parts: - the first part loads the kernel image (vmlinuz.efi or vmlinux.efi) - the second part loads other segments (e.g: initrd, cmdline, etc)
Currently, pez (vmlinuz.efi) and pei (vmlinux.efi) format images are supported.
The basic usage (vmlinuz.efi or vmlinux.efi):
1) Load second kernel image: # kexec -s -l vmlinuz.efi --initrd=initrd.img --reuse-cmdline
2) Startup second kernel: # kexec -e
Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
show more ...
|
#
d162feec |
| 02-Oct-2025 |
Youling Tang <tangyouling@kylinos.cn> |
LoongArch: Add preparatory infrastructure for kexec_file
Add some preparatory infrastructure: - Add command line processing. - Add support for loading other segments. - Other minor modifications.
T
LoongArch: Add preparatory infrastructure for kexec_file
Add some preparatory infrastructure: - Add command line processing. - Add support for loading other segments. - Other minor modifications.
This initrd will be passed to the second kernel via the command line 'initrd=start,size'.
The 'kexec_file' command line parameter indicates that the kernel is loaded via kexec_file.
Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
show more ...
|