On Fri, 2024-11-08 at 12:26 +0100, H. Peter Anvin wrote:
> 
> > --- a/arch/x86/kernel/vmlinux.lds.S
> > +++ b/arch/x86/kernel/vmlinux.lds.S
> > @@ -100,7 +100,7 @@ const_pcpu_hot = pcpu_hot;
> >         . = ALIGN(PAGE_SIZE);                                   \
> >         __relocate_kernel_start = .;                            \
> >         *(.text.relocate_kernel);                               \
> > -       *(.rodata.relocate_kernel);                             \
> > +       *(.data.relocate_kernel);                               \
> >         __relocate_kernel_end = .;
> > #else
> > #define KEXEC_RELOCATE_KERNEL_TEXT
> 
> Looks good at first glance. I'm currently traveling so I haven't
> fully reviewed it though.

Turns out it doesn't help much. It's neater, obviously, but objtool
still wants to disassemble the .data.relocate_kernel section after it
gets included in the overall kernel text section.

So once I rebase the debugging support on top and add the GDT¹ into the
data section, it gets very unhappy:

arch/x86/tools/insn_decoder_test: warning: Found an x86 instruction decoder 
bug, please report this.
arch/x86/tools/insn_decoder_test: warning: ffffffff8219250a:    eb fd           
     1f 00 00 00 00 00 00 00 ff ff 00 00 00 9a cf 00     ................ff ff 
00 00 00 9a af 00 ff ff 00 00 00 92 cf 00     ................cc cc cc cc cc cc 
cc cc cc cc cc cc                 ............   jmp    
ffffffffarch/x86/tools/insn_decoder_test: warning: objdump says 23 bytes, but 
insn_get_length() says 2
arch/x86/tools/insn_decoder_test: error: malformed line 5236442:
82192509 <exc_handler+0x18e>

It's also still complaining that pr_nybble() and pr_qword() are
unreachable, although it doesn't say that of the exc_handler() function
which blatantly calls them. Although I can look at that harder if I do
factor it out to C code.

¹ 
https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/kexec-debug

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to