[PATCH] LoongArch: Load vmlinux.efi to the link address

WANG Rui wangrui at loongson.cn
Sat Dec 2 02:11:28 PST 2023


> On Fri, Nov 24, 2023 at 11:46:58PM +0800, WANG Rui wrote:
> > Currently, kexec loads vmlinux.efi to address 0 instead of the link
> > address. This causes kexec to fail to boot the new vmlinux.efi on qemu.
> > 
> >   pei_loongarch_load: kernel_segment: 0000000000000000
> >   pei_loongarch_load: kernel_entry:   00000000015dc000
> >   pei_loongarch_load: image_size:     0000000001f30000
> >   pei_loongarch_load: text_offset:    0000000000200000
> >   pei_loongarch_load: phys_offset:    0000000000000000
> >   pei_loongarch_load: PE format:      yes
> >   loongarch_load_other_segments:333: command_line: kexec console=ttyS0,115200
> >   kexec_load: entry = 0x15dc000 flags = 0x1020000
> >   nr_segments = 2
> >   segment[0].buf   = 0x7fffef664010
> >   segment[0].bufsz = 0x1de9a00
> >   segment[0].mem   = (nil)
> >   segment[0].memsz = 0x1f30000
> >   segment[1].buf   = 0x555555e480b0
> >   segment[1].bufsz = 0x200
> >   segment[1].mem   = 0x1f30000
> >   segment[1].memsz = 0x4000
> > 
> > This patch adds `text_offset` when adding kernel segment to load
> > vmlinux.efi to the link address.
> > 
> >   pei_loongarch_load: kernel_segment: 0000000000000000
> >   pei_loongarch_load: kernel_entry:   00000000015dc000
> >   pei_loongarch_load: image_size:     0000000001f30000
> >   pei_loongarch_load: text_offset:    0000000000200000
> >   pei_loongarch_load: phys_offset:    0000000000000000
> >   pei_loongarch_load: PE format:      yes
> >   loongarch_load_other_segments:335: command_line: kexec console=ttyS0,115200
> >   kexec_load: entry = 0x15dc000 flags = 0x1020000
> >   nr_segments = 2
> >   segment[0].buf   = 0x7ffff1a04010
> >   segment[0].bufsz = 0x1de9a00
> >   segment[0].mem   = 0x200000
> >   segment[0].memsz = 0x1f30000
> >   segment[1].buf   = 0x555555b28098
> >   segment[1].bufsz = 0x200
> >   segment[1].mem   = 0x2130000
> >   segment[1].memsz = 0x4000
> > 
> > Signed-off-by: WANG Rui <wangrui at loongson.cn>
> 
> Thanks, applied.

Hi Simon,

The patch v1 breaks the real machine. Could you please revert it and just keep v2? Thanks.

- Rui




More information about the kexec mailing list