LoongArch: Load vmlinux.efi to the link address
Subsystems (2)
PATCH 1/1 LoongArch: Load vmlinux.efi to the link address
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
--- kexec/arch/loongarch/kexec-pei-loongarch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kexec/arch/loongarch/kexec-pei-loongarch.c +4 -2
@@ -87,7 +87,8 @@ int pei_loongarch_load(int argc, char **argv, const char *buf,/* Get kernel entry point */ info->entry = (void *)kernel_entry; - hole_min = kernel_segment + loongarch_mem.image_size; + hole_min = kernel_segment + loongarch_mem.text_offset + + loongarch_mem.image_size;/* Create and initialize elf core header segment */ if (info->kexec_flags &KEXEC_ON_CRASH ) {
@@ -100,7 +101,8 @@ int pei_loongarch_load(int argc, char **argv, const char *buf, }/* Load the kernel */ -add_segment (info, buf, len, kernel_segment, loongarch_mem.image_size); +add_segment (info, buf, len, kernel_segment + loongarch_mem.text_offset, + loongarch_mem.image_size);/* Prepare and load dtb and initrd data */ result =loongarch_load_other_segments (info, hole_min);
Signature · 7 lines
2.42.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedQuoted 42 lines · WANG Rui
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: 0000000000000000pei_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: yesloongarch_load_other_segments:333:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000This patch adds
text_offsetwhen adding kernel segment to load vmlinux.efi to the link address.
pei_loongarch_load:kernel_segment: 0000000000000000pei_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: yesloongarch_load_other_segments:335:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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
Quoted 1 line
Signed-off-by WANG Rui <[email protected]>
Thanks, applied.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 43 lines · WANG Rui
Quoted 42 lines
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: 0000000000000000pei_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: yesloongarch_load_other_segments:333:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000This patch adds
text_offsetwhen adding kernel segment to load vmlinux.efi to the link address.
pei_loongarch_load:kernel_segment: 0000000000000000pei_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: yesloongarch_load_other_segments:335:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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
Quoted 3 lines
Quoted 1 line
Signed-off-by WANG Rui <[email protected]>Thanks, applied.
Hi Simon,
The patch v1 breaks the real machine. Could you please revert it and just keep v2? Thanks.
- Rui
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 44 lines · WANG Rui
Quoted 44 lines · WANG Rui
Quoted 42 lines
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: 0000000000000000pei_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: yesloongarch_load_other_segments:333:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000This patch adds
text_offsetwhen adding kernel segment to load vmlinux.efi to the link address.
pei_loongarch_load:kernel_segment: 0000000000000000pei_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: yesloongarch_load_other_segments:335:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by WANG Rui <[email protected]>Thanks, applied.
Hi Simon,
The patch v1 breaks the real machine. Could you please revert it and just keep v2? Thanks.
Hmmm, if possible, I suggest resetting the old commit before v1 and only apply v2... The current status makes the history very very confusing.
Huacai
Quoted 3 lines
- Rui
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 47 lines · Huacai Chen
Quoted 46 lines · WANG Rui
Quoted 46 lines · WANG Rui
Quoted 43 lines
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: 0000000000000000pei_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: yesloongarch_load_other_segments:333:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000This patch adds
text_offsetwhen adding kernel segment to load vmlinux.efi to the link address.
pei_loongarch_load:kernel_segment: 0000000000000000pei_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: yesloongarch_load_other_segments:335:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000Signed-off-by WANG Rui <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Thanks, applied.
Hi Simon,
The patch v1 breaks the real machine. Could you please revert it and just keep v2? Thanks.
Hmmm, if possible, I suggest resetting the old commit before v1 and only apply v2... The current status makes the history very very confusing.
Thanks, I would rather not drop patches from the tree as it changes the hashes of the tree from that point. However, in this case, I agree that a simple revert makes things confusing, so I have done as you suggest
- v1 has been dropped from the tree.
Can you please check that the tree as of the following commit, which is now the HEAD commit of the main branch, is correct?
549466430ae6 ("LoongArch: Load vmlinux.efi to the link address")
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 63 lines · Simon Horman
Quoted 47 lines · Huacai Chen
Quoted 46 lines · WANG Rui
Quoted 46 lines · WANG Rui
Quoted 43 lines
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: 0000000000000000pei_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: yesloongarch_load_other_segments:333:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000This patch adds
text_offsetwhen adding kernel segment to load vmlinux.efi to the link address.
pei_loongarch_load:kernel_segment: 0000000000000000pei_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: yesloongarch_load_other_segments:335:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000Signed-off-by WANG Rui <[email protected]>Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Thanks, applied.
Hi Simon,
The patch v1 breaks the real machine. Could you please revert it and just keep v2? Thanks.
Hmmm, if possible, I suggest resetting the old commit before v1 and only apply v2... The current status makes the history very very confusing.
Thanks, I would rather not drop patches from the tree as it changes the hashes of the tree from that point. However, in this case, I agree that a simple revert makes things confusing, so I have done as you suggest
- v1 has been dropped from the tree.
Quoted 4 lines
Can you please check that the tree as of the following commit, which is now the HEAD commit of the main branch, is correct?
549466430ae6("LoongArch: Load vmlinux.efi to the link address")
Thank you, it is perfect now.
Huacai
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 64 lines · Huacai Chen
Quoted 63 lines · Simon Horman
Quoted 47 lines · Huacai Chen
Quoted 46 lines · WANG Rui
Quoted 46 lines · WANG Rui
Quoted 43 lines
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: 0000000000000000pei_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: yesloongarch_load_other_segments:333:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000This patch adds
text_offsetwhen adding kernel segment to load vmlinux.efi to the link address.
pei_loongarch_load:kernel_segment: 0000000000000000pei_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: yesloongarch_load_other_segments:335:
command_line: kexec console=ttyS0,115200
kexec_load: entry =0x15dc000flags =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 =0x4000Signed-off-by WANG Rui <[email protected]>Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Thanks, applied.
Hi Simon,
The patch v1 breaks the real machine. Could you please revert it and just keep v2? Thanks.
Hmmm, if possible, I suggest resetting the old commit before v1 and only apply v2... The current status makes the history very very confusing.
Thanks, I would rather not drop patches from the tree as it changes the hashes of the tree from that point. However, in this case, I agree that a simple revert makes things confusing, so I have done as you suggest
- v1 has been dropped from the tree.
Quoted 5 lines
Quoted 4 lines
Can you please check that the tree as of the following commit, which is now the HEAD commit of the main branch, is correct?
549466430ae6("LoongArch: Load vmlinux.efi to the link address")Thank you, it is perfect now.
Thanks for bringing this to my attention and thanks for checking.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec