All of lore.kernel.org
 help / color / mirror / Atom feed
* efi/libstub: arm64: Double check image alignment at entry - checked against EFI_KIMG_ALIGN or SEGMENT_ALIGN
@ 2022-01-14  7:29 Mihai Carabas
  2022-01-14  7:52 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Mihai Carabas @ 2022-01-14  7:29 UTC (permalink / raw)
  To: ardb; +Cc: stable, benh, Karl Heubaum

Hello Ard,

In patch 'efi/libstub: arm64: Double check image alignment at entry'
(c32ac11da3f83bb42b986702a9b92f0a14ed4182) you added the following check:

if (!IS_ALIGNED((u64)_text, EFI_KIMG_ALIGN))
     efi_err("FIRMWARE BUG: kernel image not aligned on %ldk boundary\n", +
EFI_KIMG_ALIGN >> 10);

Unfortunatelly the kernel is aligned at SEGMENT_SIZE and this is the size
populated in the PE headers:

arch/arm64/kernel/efi-header.S: .long   SEGMENT_ALIGN
// SectionAlignment

EFI_KIMG_ALIGN is defined as: (SEGMENT_ALIGN > THREAD_ALIGN ? SEGMENT_ALIGN
: THREAD_ALIGN)

So it depends on THREAD_ALIGN. On newer builds these message started to
appear even though the loader (Grub) is taking into account the PE header
(which is stating 64K).

Did you want to also modify the alignment in the headers/linkers or may be
check against SEGMENT_ALIGN?

Thank you,
Mihai



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

end of thread, other threads:[~2022-01-14  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14  7:29 efi/libstub: arm64: Double check image alignment at entry - checked against EFI_KIMG_ALIGN or SEGMENT_ALIGN Mihai Carabas
2022-01-14  7:52 ` Ard Biesheuvel

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.