Commit 211ceca
arm64: entry: Simplify tramp_alias macro and tramp_exit routine
The tramp_alias macro constructs the virtual alias of a symbol in the
trampoline text mapping, based on its kernel text address, and does so
in a way that is more convoluted than necessary. So let's simplify that.
Also, now that the address of the vector table is kept in a per-CPU
variable, there is no need to defer the load and the assignment of
VBAR_EL1 to tramp_exit(). This means we can use a PC-relative reference
to the per-CPU variable instead of storing its absolute address in a
global variable in the trampoline rodata.
And given that tramp_alias no longer needs a temp register, this means
we can restore X30 earlier as well, and only leave X29 for tramp_exit()
to restore.
While at it, give some related symbols static linkage, considering that
they are only referenced from the object file that defines them.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20230418143604.1176437-3-ardb@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>1 parent 0936243 commit 211ceca
1 file changed
Lines changed: 20 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
| |||
436 | 435 | | |
437 | 436 | | |
438 | 437 | | |
439 | | - | |
440 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
| |||
728 | 732 | | |
729 | 733 | | |
730 | 734 | | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | 735 | | |
746 | 736 | | |
747 | 737 | | |
| |||
762 | 752 | | |
763 | 753 | | |
764 | 754 | | |
765 | | - | |
| 755 | + | |
766 | 756 | | |
767 | 757 | | |
768 | 758 | | |
| |||
771 | 761 | | |
772 | 762 | | |
773 | 763 | | |
774 | | - | |
775 | | - | |
776 | | - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
777 | 770 | | |
778 | 771 | | |
779 | 772 | | |
| |||
1067 | 1060 | | |
1068 | 1061 | | |
1069 | 1062 | | |
1070 | | - | |
| 1063 | + | |
1071 | 1064 | | |
1072 | 1065 | | |
1073 | 1066 | | |
| |||
0 commit comments