From: Ard Biesheuvel <ardb@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com,
james.morse@arm.com, robin.murphy@arm.com,
Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH v2 0/3] arm64: head: pad Image header to 64 KB and unmap it
Date: Tue, 17 Nov 2020 13:47:26 +0100 [thread overview]
Message-ID: <20201117124729.12642-1-ardb@kernel.org> (raw)
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
next reply other threads:[~2020-11-17 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-17 12:47 Ard Biesheuvel [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201117124729.12642-1-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).