|
294 | 294 | .Lskip_gcs_\@: |
295 | 295 | .endm |
296 | 296 |
|
297 | | -.macro __init_el2_mpam |
298 | | - /* Memory Partitioning And Monitoring: disable EL2 traps */ |
299 | | - mrs x1, id_aa64pfr0_el1 |
300 | | - ubfx x0, x1, #ID_AA64PFR0_EL1_MPAM_SHIFT, #4 |
301 | | - cbz x0, .Lskip_mpam_\@ // skip if no MPAM |
302 | | - msr_s SYS_MPAM2_EL2, xzr // use the default partition |
303 | | - // and disable lower traps |
304 | | - mrs_s x0, SYS_MPAMIDR_EL1 |
305 | | - tbz x0, #MPAMIDR_EL1_HAS_HCR_SHIFT, .Lskip_mpam_\@ // skip if no MPAMHCR reg |
306 | | - msr_s SYS_MPAMHCR_EL2, xzr // clear TRAP_MPAMIDR_EL1 -> EL2 |
307 | | -.Lskip_mpam_\@: |
308 | | -.endm |
309 | | - |
310 | 297 | /** |
311 | 298 | * Initialize EL2 registers to sane values. This should be called early on all |
312 | 299 | * cores that were booted in EL2. Note that everything gets initialised as |
|
324 | 311 | __init_el2_stage2 |
325 | 312 | __init_el2_gicv3 |
326 | 313 | __init_el2_hstr |
327 | | - __init_el2_mpam |
328 | 314 | __init_el2_nvhe_idregs |
329 | 315 | __init_el2_cptr |
330 | 316 | __init_el2_fgt |
|
371 | 357 | #endif |
372 | 358 |
|
373 | 359 | .macro finalise_el2_state |
| 360 | + check_override id_aa64pfr0, ID_AA64PFR0_EL1_MPAM_SHIFT, .Linit_mpam_\@, .Lskip_mpam_\@, x1, x2 |
| 361 | + |
| 362 | +.Linit_mpam_\@: |
| 363 | + msr_s SYS_MPAM2_EL2, xzr // use the default partition |
| 364 | + // and disable lower traps |
| 365 | + mrs_s x0, SYS_MPAMIDR_EL1 |
| 366 | + tbz x0, #MPAMIDR_EL1_HAS_HCR_SHIFT, .Lskip_mpam_\@ // skip if no MPAMHCR reg |
| 367 | + msr_s SYS_MPAMHCR_EL2, xzr // clear TRAP_MPAMIDR_EL1 -> EL2 |
| 368 | + |
| 369 | +.Lskip_mpam_\@: |
374 | 370 | check_override id_aa64pfr0, ID_AA64PFR0_EL1_SVE_SHIFT, .Linit_sve_\@, .Lskip_sve_\@, x1, x2 |
375 | 371 |
|
376 | 372 | .Linit_sve_\@: /* SVE register access */ |
|
0 commit comments