#define TCR_TG1_4K (UL(2) << TCR_TG1_SHIFT)
#define TCR_TG1_64K (UL(3) << TCR_TG1_SHIFT)
+ #define TCR_IPS_SHIFT 32
+ #define TCR_IPS_MASK (UL(7) << TCR_IPS_SHIFT)
+#define TCR_A1 (UL(1) << 22)
#define TCR_ASID16 (UL(1) << 36)
#define TCR_TBI0 (UL(1) << 37)
#define TCR_HA (UL(1) << 39)
* - pgd_phys - physical address of new TTB
*/
ENTRY(cpu_do_switch_mm)
- phys_to_ttbr x0, x2
- pre_ttbr0_update_workaround x2, x3, x4
+ mrs x2, ttbr1_el1
mmid x1, x1 // get mm->context.id
bfi x2, x1, #48, #16 // set the ASID
- msr ttbr0_el1, x2 // set TTBR0
+ msr ttbr1_el1, x2 // in TTBR1 (since TCR.A1 is set)
+ isb
- msr ttbr0_el1, x0 // now update TTBR0
++ phys_to_ttbr x0, x2
++ msr ttbr0_el1, x2 // now update TTBR0
isb
- post_ttbr0_update_workaround
+ post_ttbr_update_workaround
ret
ENDPROC(cpu_do_switch_mm)