Skip to content

kind/support(area/shim/pe.c): Default SectionAlignment #787

@vivekkoya

Description

@vivekkoya

I came across L551/L702 [1][5] where the alignment is set to 0x1000 (4K) if the alignment is zero. Any value other than 0 will pass through even if invalid by the UEFI specification [2]. I am curious on the reasoning behind how 0 is chosen for comparison. I have read through a similar discussion on edk2 [3] and understand this applies to x86-64. [4] Some time back, when reviewing KVM hypervisor boot logs for a Windows Server 2019/2022 VM using vTPM that was stuck in a boot loop, I saw 0x40 being passed and the sectionalignment with errors of a invalid passed value.

I am willing to provide logs. Please let me know if there are flaws in my thinking. Appreciate any help.
I see @vathpela @bluca have worked on this recently.

[1] https://git.proxmox.com/?p=efi-boot...5c44ef83e3cd3974f047343d99906b6989bbb;hb=HEAD
[2] https://uefi.org/specs/UEFI/2.9_A/07_Services_Boot_Services.html#efi-boot-services-allocatepages
[3] https://edk2.groups.io/g/devel/topic/linker_scripts_use_of_z/98045342
[4] llvm/llvm-project#117103
[5] https://github.com/rhboot/shim/blob/main/pe.c#L702

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions