arm64: entry: Add macro for reading symbol addresses from the trampoline
authorJames Morse <james.morse@arm.com>
Tue, 15 Mar 2022 18:24:09 +0000 (18:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 Mar 2022 12:40:15 +0000 (13:40 +0100)
commit1bb1944970a9dc2d05160e014a2aac634b0eca48
treebedc664db3e8dd1bd82504998227de206d0d4442
parent3abf6e8a7aa0fad437481d27ba0a249b9f22f131
arm64: entry: Add macro for reading symbol addresses from the trampoline

commit b28a8eebe81c186fdb1a0078263b30576c8e1f42 upstream.

The trampoline code needs to use the address of symbols in the wider
kernel, e.g. vectors. PC-relative addressing wouldn't work as the
trampoline code doesn't run at the address the linker expected.

tramp_ventry uses a literal pool, unless CONFIG_RANDOMIZE_BASE is
set, in which case it uses the data page as a literal pool because
the data page can be unmapped when running in user-space, which is
required for CPUs vulnerable to meltdown.

Pull this logic out as a macro, instead of adding a third copy
of it.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kernel/entry.S