arm64: shrink the tramp_alias macro
PATCH 2/3 arm64: shrink the tramp_alias macro
From: Remi Denis-Courmont <[email protected]>
Aliases should be negative 48-bits values. They can be generated with 3 instructions: MOVN (lsl 32), MOVK (lsl 1) and MOVK.
So far, the mov_q macro set bits 63-12, and a separate ADD instruction sets the low 12 bits. This patch takes the last MOVK out of the mov_q macro, and merges it with the ADD instruction. (This depends on the earlier mov_q patch.)
--- arch/arm64/kernel/entry.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kernel/entry.S +2 -2
@@ -120,8 +120,8 @@ alternative_else_nop_endif .endm .macro tramp_alias, dst, sym - mov_q \dst, TRAMP_VALIAS - add \dst, \dst, #(\sym - .entry.tramp.text) + mov_q \dst, (TRAMP_VALIAS | 0xffff) + movk \dst, #(TRAMP_VALIAS + \sym - .entry.tramp.text) & 0xffff .endm // This macro corrupts x0-x3. It is the caller's duty
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Rutland
reviewerQuoted 20 lines · Rémi Denis-Courmont
From: Remi Denis-Courmont <[email protected]>
Aliases should be negative 48-bits values. They can be generated with 3 instructions: MOVN (lsl 32), MOVK (lsl 1) and MOVK.
So far, the
mov_qmacro set bits 63-12, and a separate ADD instruction sets the low 12 bits. This patch takes the last MOVK out of themov_qmacro, and merges it with the ADD instruction. (This depends on the earliermov_qpatch.)Signed-off-by Remi Denis-Courmont <[email protected]>--- arch/arm64/kernel/entry.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm64/kernel/entry.S +0
-0
arch/arm64/kernel/entry.S alternative_else_nop_endif · line 125
Quoted 8 lines
arch/arm64/kernel/entry.S +2
-2@@ -120,8 +120,8 @@ alternative_else_nop_endif .endm .macro tramp_alias, dst, sym - mov_q \dst, TRAMP_VALIAS - add \dst, \dst, #(\sym - .entry.tramp.text) + mov_q \dst, (TRAMP_VALIAS | 0xffff) + movk \dst, #(TRAMP_VALIAS + \sym - .entry.tramp.text) & 0xffff .endm
I think this is more legible as-is, and would prefer to leave it that way.
Thanks,
Mark.
Quoted 10 lines
arch/arm64/kernel/entry.S +0
-0// This macro corrupts x0-x3. It is the caller's dutySignature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel