All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] arm64: Support HP Envy X2
@ 2019-01-25 11:45 Alexander Graf
  2019-01-25 11:45 ` [PATCH v5 1/3] mkimage: Use EFI32_HEADER_SIZE define in arm-efi case Alexander Graf
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Alexander Graf @ 2019-01-25 11:45 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Leif Lindholm, Peter Jones, Jon Masters

I got a new toy recently: 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 all
PE alignments to 4K always on all efi targets. This way we improve overall
compatibility - there surely will be more devices coming with similar
constraints.

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

v3 -> v4:

  - Reduce everything down to 1 patch which just adapts *all* alignment
    to GRUB_EFI_PAGE_SIZE (4k).

v4 -> v5:

  - Use GRUB_EFI_PAGE_SIZE
  - Add include to have above const defined
  - new patch: mkimage: Clarify file alignment in efi case

Alexander Graf (3):
  mkimage: Use EFI32_HEADER_SIZE define in arm-efi case
  mkimage: Align efi sections on 4k boundary
  mkimage: Clarify file alignment in efi case

 include/grub/efi/pe32.h | 10 ++++++++--
 util/mkimage.c          | 15 +++++----------
 2 files changed, 13 insertions(+), 12 deletions(-)

-- 
2.12.3



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-01-28 13:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 11:45 [PATCH v5 0/3] arm64: Support HP Envy X2 Alexander Graf
2019-01-25 11:45 ` [PATCH v5 1/3] mkimage: Use EFI32_HEADER_SIZE define in arm-efi case Alexander Graf
2019-01-28 12:18   ` Daniel Kiper
2019-01-25 11:45 ` [PATCH v5 2/3] mkimage: Align efi sections on 4k boundary Alexander Graf
2019-01-28 12:22   ` Daniel Kiper
2019-01-28 12:33     ` Alexander Graf
2019-01-28 13:03       ` Daniel Kiper
2019-01-25 11:45 ` [PATCH v5 3/3] mkimage: Clarify file alignment in efi case Alexander Graf
2019-01-28 12:27   ` Daniel Kiper
2019-01-28 12:34     ` Alexander Graf
2019-01-28 13:17       ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.