1 #include <lunaix/process.h>
2 #include <asm/aa64_mmu.h>
13 ttbr = read_sysreg(TTBR0_EL1);
16 We don't differentiate ASID for now
20 if (!BITS_GET(ttbr, TTBR_BADDR) == vms->vmroot) {
24 BITS_SET(ttbr, TTBR_BADDR, vms->vmroot);
26 set_sysreg(TTBR0_EL1, ttbr);
29 TODO a more fine grain control of flushing
30 Unlike x86, hardware will not flush TLB upon switching
33 as kernel address space are shared, flushing should be avoided,
35 1. enable the use of ASID and flush accordingly
36 2. enable the use of ASID and TTBR1 to house kernel,
37 use TCR_EL1.A1 to switch between ASIDs in TTBR0 and TTBR1.
38 3. range flushing (RVAAE1) on all memory regions used by user space.