|
82 | 82 | bl restore_gp_pmcr_pauth_regs |
83 | 83 | 1: |
84 | 84 | #else |
85 | | - /* |
86 | | - * For SoCs which do not implement RAS, use DSB as a barrier to |
87 | | - * synchronize pending external aborts. |
88 | | - */ |
89 | | - dsb sy |
90 | | - |
91 | | - /* Unmask the SError interrupt */ |
92 | | - msr daifclr, #DAIF_ABT_BIT |
93 | | - |
94 | | - /* Use ISB for the above unmask operation to take effect immediately */ |
95 | | - isb |
96 | | - |
97 | | - /* |
98 | | - * Refer Note 1. No need to restore X30 as both handle_sync_exception |
99 | | - * and handle_interrupt_exception macro which follow this macro modify |
100 | | - * X30 anyway. |
101 | | - */ |
102 | | - str x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] |
103 | | - mov x30, #1 |
104 | | - str x30, [sp, #CTX_EL3STATE_OFFSET + CTX_IS_IN_EL3] |
105 | | - dmb sy |
106 | | -#endif |
107 | | - .endm |
108 | | - |
109 | | -#if !RAS_EXTENSION |
110 | 85 | /* |
111 | 86 | * Note 1: The explicit DSB at the entry of various exception vectors |
112 | 87 | * for handling exceptions from lower ELs can inadvertently trigger an |
|
121 | 96 | * flag execute without causing further exceptions. |
122 | 97 | */ |
123 | 98 |
|
124 | | - /* --------------------------------------------------------------------- |
125 | | - * This macro handles Asynchronous External Aborts. |
126 | | - * --------------------------------------------------------------------- |
127 | | - */ |
128 | | - .macro handle_async_ea |
129 | 99 | /* |
130 | | - * Use a barrier to synchronize pending external aborts. |
| 100 | + * For SoCs which do not implement RAS, use DSB as a barrier to |
| 101 | + * synchronize pending external aborts. |
131 | 102 | */ |
132 | 103 | dsb sy |
133 | 104 |
|
|
137 | 108 | /* Use ISB for the above unmask operation to take effect immediately */ |
138 | 109 | isb |
139 | 110 |
|
140 | | - /* Refer Note 1 */ |
| 111 | + /* |
| 112 | + * Refer Note 1. |
| 113 | + * No need to restore X30 as macros following this modify x30 anyway. |
| 114 | + */ |
141 | 115 | str x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] |
142 | 116 | mov x30, #1 |
143 | 117 | str x30, [sp, #CTX_EL3STATE_OFFSET + CTX_IS_IN_EL3] |
144 | 118 | dmb sy |
145 | | - |
146 | | - b handle_lower_el_async_ea |
147 | | - .endm |
148 | | - |
149 | | - /* |
150 | | - * This macro checks if the exception was taken due to SError in EL3 or |
151 | | - * because of pending asynchronous external aborts from lower EL that got |
152 | | - * triggered due to explicit synchronization in EL3. Refer Note 1. |
153 | | - */ |
154 | | - .macro check_if_serror_from_EL3 |
155 | | - /* Assumes SP_EL3 on entry */ |
156 | | - str x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] |
157 | | - ldr x30, [sp, #CTX_EL3STATE_OFFSET + CTX_IS_IN_EL3] |
158 | | - cbnz x30, exp_from_EL3 |
159 | | - |
160 | | - /* Handle asynchronous external abort from lower EL */ |
161 | | - b handle_lower_el_async_ea |
162 | | - |
163 | | -exp_from_EL3: |
164 | | - /* Jump to plat_handle_el3_ea which does not return */ |
165 | | - .endm |
166 | 119 | #endif |
| 120 | + .endm |
167 | 121 |
|
168 | 122 | /* --------------------------------------------------------------------- |
169 | 123 | * This macro handles Synchronous exceptions. |
@@ -356,7 +310,19 @@ end_vector_entry fiq_sp_elx |
356 | 310 |
|
357 | 311 | vector_entry serror_sp_elx |
358 | 312 | #if !RAS_EXTENSION |
359 | | - check_if_serror_from_EL3 |
| 313 | + /* |
| 314 | + * This will trigger if the exception was taken due to SError in EL3 or |
| 315 | + * because of pending asynchronous external aborts from lower EL that got |
| 316 | + * triggered due to explicit synchronization in EL3. Refer Note 1. |
| 317 | + */ |
| 318 | + /* Assumes SP_EL3 on entry */ |
| 319 | + str x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] |
| 320 | + ldr x30, [sp, #CTX_EL3STATE_OFFSET + CTX_IS_IN_EL3] |
| 321 | + cbnz x30, 1f |
| 322 | + |
| 323 | + /* Handle asynchronous external abort from lower EL */ |
| 324 | + b handle_lower_el_async_ea |
| 325 | +1: |
360 | 326 | #endif |
361 | 327 | no_ret plat_handle_el3_ea |
362 | 328 | end_vector_entry serror_sp_elx |
@@ -395,7 +361,8 @@ vector_entry serror_aarch64 |
395 | 361 | msr daifclr, #DAIF_ABT_BIT |
396 | 362 | b enter_lower_el_async_ea |
397 | 363 | #else |
398 | | - handle_async_ea |
| 364 | + check_and_unmask_ea |
| 365 | + b handle_lower_el_async_ea |
399 | 366 | #endif |
400 | 367 | end_vector_entry serror_aarch64 |
401 | 368 |
|
@@ -433,7 +400,8 @@ vector_entry serror_aarch32 |
433 | 400 | msr daifclr, #DAIF_ABT_BIT |
434 | 401 | b enter_lower_el_async_ea |
435 | 402 | #else |
436 | | - handle_async_ea |
| 403 | + check_and_unmask_ea |
| 404 | + b handle_lower_el_async_ea |
437 | 405 | #endif |
438 | 406 | end_vector_entry serror_aarch32 |
439 | 407 |
|
|
0 commit comments