hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/arch/arm64/kernel/hibernate-asm.S
....@@ -1,20 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Hibernate low-level support
34 *
45 * Copyright (C) 2016 ARM Ltd.
56 * Author: James Morse <james.morse@arm.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
187 */
198 #include <linux/linkage.h>
209 #include <linux/errno.h>
....@@ -33,13 +22,14 @@
3322 * Even switching to our copied tables will cause a changed output address at
3423 * each stage of the walk.
3524 */
36
-.macro break_before_make_ttbr_switch zero_page, page_table, tmp
25
+.macro break_before_make_ttbr_switch zero_page, page_table, tmp, tmp2
3726 phys_to_ttbr \tmp, \zero_page
3827 msr ttbr1_el1, \tmp
3928 isb
4029 tlbi vmalle1
4130 dsb nsh
4231 phys_to_ttbr \tmp, \page_table
32
+ offset_ttbr1 \tmp, \tmp2
4333 msr ttbr1_el1, \tmp
4434 isb
4535 .endm
....@@ -75,12 +65,12 @@
7565 * x5: physical address of a zero page that remains zero after resume
7666 */
7767 .pushsection ".hibernate_exit.text", "ax"
78
-ENTRY(swsusp_arch_suspend_exit)
68
+SYM_CODE_START(swsusp_arch_suspend_exit)
7969 /*
8070 * We execute from ttbr0, change ttbr1 to our copied linear map tables
8171 * with a break-before-make via the zero page
8272 */
83
- break_before_make_ttbr_switch x5, x0, x6
73
+ break_before_make_ttbr_switch x5, x0, x6, x8
8474
8575 mov x21, x1
8676 mov x30, x2
....@@ -111,7 +101,7 @@
111101 dsb ish /* wait for PoU cleaning to finish */
112102
113103 /* switch to the restored kernels page tables */
114
- break_before_make_ttbr_switch x25, x21, x6
104
+ break_before_make_ttbr_switch x25, x21, x6, x8
115105
116106 ic ialluis
117107 dsb ish
....@@ -120,9 +110,7 @@
120110 cbz x24, 3f /* Do we need to re-initialise EL2? */
121111 hvc #0
122112 3: ret
123
-
124
- .ltorg
125
-ENDPROC(swsusp_arch_suspend_exit)
113
+SYM_CODE_END(swsusp_arch_suspend_exit)
126114
127115 /*
128116 * Restore the hyp stub.
....@@ -131,15 +119,15 @@
131119 *
132120 * x24: The physical address of __hyp_stub_vectors
133121 */
134
-el1_sync:
122
+SYM_CODE_START_LOCAL(el1_sync)
135123 msr vbar_el2, x24
136124 eret
137
-ENDPROC(el1_sync)
125
+SYM_CODE_END(el1_sync)
138126
139127 .macro invalid_vector label
140
-\label:
128
+SYM_CODE_START_LOCAL(\label)
141129 b \label
142
-ENDPROC(\label)
130
+SYM_CODE_END(\label)
143131 .endm
144132
145133 invalid_vector el2_sync_invalid
....@@ -153,7 +141,7 @@
153141
154142 /* el2 vectors - switch el2 here while we restore the memory image. */
155143 .align 11
156
-ENTRY(hibernate_el2_vectors)
144
+SYM_CODE_START(hibernate_el2_vectors)
157145 ventry el2_sync_invalid // Synchronous EL2t
158146 ventry el2_irq_invalid // IRQ EL2t
159147 ventry el2_fiq_invalid // FIQ EL2t
....@@ -173,6 +161,6 @@
173161 ventry el1_irq_invalid // IRQ 32-bit EL1
174162 ventry el1_fiq_invalid // FIQ 32-bit EL1
175163 ventry el1_error_invalid // Error 32-bit EL1
176
-END(hibernate_el2_vectors)
164
+SYM_CODE_END(hibernate_el2_vectors)
177165
178166 .popsection