]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: entry: Allow tramp_alias to access symbols after the 4K boundary
authorJames Morse <james.morse@arm.com>
Fri, 18 Mar 2022 17:48:28 +0000 (17:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Mar 2022 08:10:42 +0000 (09:10 +0100)
commitebcdd80d0016c7445e8395cec99b9ce266a26001
treeb53904cc006e05d7d1b0c42e2d6ea6158845b455
parent266b1ef1368e06ac4c5a89eb9774ef2bbaa54e19
arm64: entry: Allow tramp_alias to access symbols after the 4K boundary

commit 6c5bf79b69f911560fbf82214c0971af6e58e682 upstream.

Systems using kpti enter and exit the kernel through a trampoline mapping
that is always mapped, even when the kernel is not. tramp_valias is a macro
to find the address of a symbol in the trampoline mapping.

Adding extra sets of vectors will expand the size of the entry.tramp.text
section to beyond 4K. tramp_valias will be unable to generate addresses
for symbols beyond 4K as it uses the 12 bit immediate of the add
instruction.

As there are now two registers available when tramp_alias is called,
use the extra register to avoid the 4K limit of the 12 bit immediate.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/entry.S