|
129 | 129 | msr cptr_el2, x0 // Disable copro. traps to EL2 |
130 | 130 | .endm |
131 | 131 |
|
132 | | -/* SVE register access */ |
133 | | -.macro __init_el2_nvhe_sve |
134 | | - mrs x1, id_aa64pfr0_el1 |
135 | | - ubfx x1, x1, #ID_AA64PFR0_SVE_SHIFT, #4 |
136 | | - cbz x1, .Lskip_sve_\@ |
137 | | - |
138 | | - bic x0, x0, #CPTR_EL2_TZ // Also disable SVE traps |
139 | | - msr cptr_el2, x0 // Disable copro. traps to EL2 |
140 | | - isb |
141 | | - mov x1, #ZCR_ELx_LEN_MASK // SVE: Enable full vector |
142 | | - msr_s SYS_ZCR_EL2, x1 // length for EL1. |
143 | | -.Lskip_sve_\@: |
144 | | -.endm |
145 | | - |
146 | | -/* SME register access and priority mapping */ |
147 | | -.macro __init_el2_nvhe_sme |
148 | | - mrs x1, id_aa64pfr1_el1 |
149 | | - ubfx x1, x1, #ID_AA64PFR1_SME_SHIFT, #4 |
150 | | - cbz x1, .Lskip_sme_\@ |
151 | | - |
152 | | - bic x0, x0, #CPTR_EL2_TSM // Also disable SME traps |
153 | | - msr cptr_el2, x0 // Disable copro. traps to EL2 |
154 | | - isb |
155 | | - |
156 | | - mrs x1, sctlr_el2 |
157 | | - orr x1, x1, #SCTLR_ELx_ENTP2 // Disable TPIDR2 traps |
158 | | - msr sctlr_el2, x1 |
159 | | - isb |
160 | | - |
161 | | - mov x1, #0 // SMCR controls |
162 | | - |
163 | | - mrs_s x2, SYS_ID_AA64SMFR0_EL1 |
164 | | - ubfx x2, x2, #ID_AA64SMFR0_EL1_FA64_SHIFT, #1 // Full FP in SM? |
165 | | - cbz x2, .Lskip_sme_fa64_\@ |
166 | | - |
167 | | - orr x1, x1, SMCR_ELx_FA64_MASK |
168 | | -.Lskip_sme_fa64_\@: |
169 | | - |
170 | | - orr x1, x1, #SMCR_ELx_LEN_MASK // Enable full SME vector |
171 | | - msr_s SYS_SMCR_EL2, x1 // length for EL1. |
172 | | - |
173 | | - mrs_s x1, SYS_SMIDR_EL1 // Priority mapping supported? |
174 | | - ubfx x1, x1, #SMIDR_EL1_SMPS_SHIFT, #1 |
175 | | - cbz x1, .Lskip_sme_\@ |
176 | | - |
177 | | - msr_s SYS_SMPRIMAP_EL2, xzr // Make all priorities equal |
178 | | - |
179 | | - mrs x1, id_aa64mmfr1_el1 // HCRX_EL2 present? |
180 | | - ubfx x1, x1, #ID_AA64MMFR1_HCX_SHIFT, #4 |
181 | | - cbz x1, .Lskip_sme_\@ |
182 | | - |
183 | | - mrs_s x1, SYS_HCRX_EL2 |
184 | | - orr x1, x1, #HCRX_EL2_SMPME_MASK // Enable priority mapping |
185 | | - msr_s SYS_HCRX_EL2, x1 |
186 | | - |
187 | | -.Lskip_sme_\@: |
188 | | -.endm |
189 | | - |
190 | 132 | /* Disable any fine grained traps */ |
191 | 133 | .macro __init_el2_fgt |
192 | 134 | mrs x1, id_aa64mmfr0_el1 |
|
250 | 192 | __init_el2_hstr |
251 | 193 | __init_el2_nvhe_idregs |
252 | 194 | __init_el2_nvhe_cptr |
253 | | - __init_el2_nvhe_sve |
254 | | - __init_el2_nvhe_sme |
255 | 195 | __init_el2_fgt |
256 | 196 | __init_el2_nvhe_prepare_eret |
257 | 197 | .endm |
|
0 commit comments