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