Do not preallocate the asid, wait until it is allcoated in pmap_setttb()
Simplifies the code by only having one location that does the asid
allocation.

There is no need to allocate the ASID direclty in pmap_activate as
the code in pmap setttb will do that allocation so this code is just
duplication that could potentially cause a race in the future.

diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c
index 4d0c58c3663..d1fa358b85f 100644
--- a/sys/arch/arm64/arm64/pmap.c
+++ b/sys/arch/arm64/arm64/pmap.c
@@ -1403,14 +1403,6 @@ pmap_activate(struct proc *p)
        pcb = &p->p_addr->u_pcb;
 
        // printf("%s: called on proc %p %p\n", __func__, p,  pcb->pcb_pagedir);
-       if (pm != pmap_kernel() && pm->pm_asid == -1) {
-               // this userland process has no asid, allocate one.
-               pmap_allocate_asid(pm);
-       }
-
-       if (pm != pmap_kernel())
-               pcb->pcb_pagedir = ((uint64_t)pm->pm_asid << 48) | pm->pm_pt0pa;
-
        psw = disable_interrupts();
        if (p == curproc && pm != pmap_kernel() && pm != curcpu()->ci_curpm) {
                // clean up old process
Dale Rahn                               dr...@dalerahn.com

Reply via email to