linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: head: pad Image header to 64 KB and unmap it
@ 2020-11-17 12:47 Ard Biesheuvel
  2020-11-17 12:47 ` [PATCH v2 1/3] arm64: omit [_text, _stext) from permanent kernel mapping Ard Biesheuvel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2020-11-17 12:47 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mark.rutland, will, catalin.marinas, james.morse, robin.murphy,
	Ard Biesheuvel

The EFI header definition was updated recently to increase the section
alignment to 64 KB, which causes the EFI loader to put the kernel Image
at an offset that is guaranteed to be compatible with the kernel's image
placement policy when CONFIG_RELOCATABLE=y, removing the need to move it
around in DRAM before boot.

This change failed to take into account that the first section in the
PE/COFF description should start at a 64 KB aligned boundary as well,
and so even though EFI loaders don't seem to care, the current PE/COFF
layout is not 100% compliant.

So let's fix this by padding the size of the .head region to 64 KB,
and while at it, removing it from the kernel's executable mapping, which
is now guaranteed to be possible regardless of the page size the kernel
is running with. And if we don't map it, we don't need to reserve it
either.

Changes since v1:
- drop the original first patch that fixed the actual bug - it has already
  been merged
- add Will's acks
- use a better NOP and a better name for the macro that emits it (#3)

Cc: catalin.marinas@arm.com
Cc: will@kernel.org
Cc: mark.rutland@arm.com
Cc: james.morse@arm.com
Cc: robin.murphy@arm.com

Ard Biesheuvel (3):
  arm64: omit [_text, _stext) from permanent kernel mapping
  arm64/head: avoid symbol names pointing into first 64 KB of kernel
    image
  arm64: head: tidy up the Image header definition

 arch/arm64/kernel/efi-header.S  | 84 ++++++++++++--------
 arch/arm64/kernel/head.S        | 19 +----
 arch/arm64/kernel/setup.c       |  4 +-
 arch/arm64/kernel/vmlinux.lds.S |  2 +-
 arch/arm64/mm/init.c            |  2 +-
 arch/arm64/mm/mmu.c             | 10 +--
 6 files changed, 60 insertions(+), 61 deletions(-)

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-11-17 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-17 12:47 [PATCH v2 0/3] arm64: head: pad Image header to 64 KB and unmap it Ard Biesheuvel
2020-11-17 12:47 ` [PATCH v2 1/3] arm64: omit [_text, _stext) from permanent kernel mapping Ard Biesheuvel
2020-11-17 12:47 ` [PATCH v2 2/3] arm64/head: avoid symbol names pointing into first 64 KB of kernel image Ard Biesheuvel
2020-11-17 12:47 ` [PATCH v2 3/3] arm64: head: tidy up the Image header definition Ard Biesheuvel
2020-11-17 18:08 ` [PATCH v2 0/3] arm64: head: pad Image header to 64 KB and unmap it Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).