I got a new toy this week: An HP Envy X2 system. This is one of those shiny new Qualcomm Snapdragon based Windows tablet/notebook hybrid things.
While running Windows on those is actually not a terribly bad experience now that WSL is out, I would like to see Linux run on those as well in the future. Unfortunately as far as I'm aware so far nobody was able to run self built binaries on the built-in UEFI version. Turns out, it's a problem with aligning the start of the header to 4k. Once we do that, binaries can be loaded just fine and run. The reason behind that is simple: Its firmware tries to ensure NX protection flags and can do so only when the code is 4K aligned. So to maintain compatibility with that device, this patch set just bumps the header alignment to 4K always on arm64-efi and other efi targets. This way we improve overall compatibility - there surely will be more devices coming with similar constraints. We also extend that alignemnt to any section that follows afterwards, to ensure that other protection mechanisms will have a chance to protect individual sections with page table bits. This gets us into alignment with how the MS tools build UEFI applications, so we should not run into compatibility problems about alignment going forward. v1 -> v2: - Remove explicit device wording from patch - Use GRUB_EFI_PAGE_SIZE v2 -> v3: - Apply alignment to all architectures - new patch: mkimage: Align efi sections on 4k boundary Alexander Graf (4): mkimage: Simplify header size logic mkimage: Use EFI32_HEADER_SIZE define in arm-efi case mkimage: arm64-efi: Align header to page granularity mkimage: Align efi sections on 4k boundary util/mkimage.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) -- 2.12.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel