Re: [PATCH v2 00/15] x86/boot: Rework PE header generation

From: Ingo Molnar
Date: Fri Sep 15 2023 - 07:31:10 EST



* Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> > Ard Biesheuvel (15):
> > x86/efi: Drop EFI stub .bss from .data section
> > x86/efi: Disregard setup header of loaded image
> > x86/efi: Drop alignment flags from PE section headers
> > x86/boot: Remove the 'bugger off' message
> > x86/boot: Omit compression buffer from PE/COFF image memory footprint
> > x86/boot: Drop redundant code setting the root device
> > x86/boot: Grab kernel_info offset from zoffset header directly
> > x86/boot: Drop references to startup_64
>
> I've applied these first 8 patches to tip:x86/boot with minor edits.
> (Please preserve existing comment capitalization conventions ...)
>
> > x86/boot: Set EFI handover offset directly in header asm
> > x86/boot: Define setup size in linker script
> > x86/boot: Derive file size from _edata symbol
> > x86/boot: Construct PE/COFF .text section from assembler
> > x86/boot: Drop PE/COFF .reloc section
> > x86/boot: Split off PE/COFF .data section
> > x86/boot: Increase section and file alignment to 4k/512
>
> The rest conflicted with recent upstream changes, and I suppose it's
> prudent to test these changes bit by bit anyway.

So, the first 8 patches broke the x86-64-defconfig-ish Qemu bzImage bootup,
due to the 8th patch:

988b52b207a9fe74c3699bda8c2256714926b94b is the first bad commit
commit 988b52b207a9fe74c3699bda8c2256714926b94b
Author: Ard Biesheuvel <ardb@xxxxxxxxxx>
Date: Tue Sep 12 09:01:01 2023 +0000

x86/boot: Define setup size in linker script

I've removed it for now - but this side effect was not expected.

Thanks,

Ingo