On 19/07/15(Sun) 18:33, Mark Kettenis wrote:
> So my "unlocking the reaper" diff that was committed the other day
> breaks the MP architectures that don't have an "mpsafe" pmap yet (see
> my commit message).  Is seems hppa's pmap is actually safe enough, but
> alpha, m88k, mips64 and powerpc aren't.  The diff below fixes alpha
> and powerpc with a big hammer.  Theo is currently building snapshots
> with this diff.
> 
> visa@, you'll probably want to add something similar.
> 
> miod@, mpi@, do you want me to move ahead and commit this temporary fix?

Yes please, at least for the powerpc pmap.

> Index: alpha/alpha/pmap.c
> ===================================================================
> RCS file: /home/cvs/src/sys/arch/alpha/alpha/pmap.c,v
> retrieving revision 1.77
> diff -u -p -r1.77 pmap.c
> --- alpha/alpha/pmap.c        23 Jun 2015 19:50:48 -0000      1.77
> +++ alpha/alpha/pmap.c        18 Jul 2015 18:09:42 -0000
> @@ -1190,7 +1190,9 @@ pmap_remove(pmap_t pmap, vaddr_t sva, va
>               printf("pmap_remove(%p, %lx, %lx)\n", pmap, sva, eva);
>  #endif
>  
> +     KERNEL_LOCK();
>       pmap_do_remove(pmap, sva, eva, TRUE);
> +     KERNEL_UNLOCK();
>  }
>  
>  /*
> Index: powerpc/include/pmap.h
> ===================================================================
> RCS file: /home/cvs/src/sys/arch/powerpc/include/pmap.h,v
> retrieving revision 1.57
> diff -u -p -r1.57 pmap.h
> --- powerpc/include/pmap.h    5 Jun 2015 11:38:19 -0000       1.57
> +++ powerpc/include/pmap.h    12 Jun 2015 09:57:14 -0000
> @@ -164,10 +164,12 @@ int reserve_dumppages(caddr_t p);
>  #endif       /* _KERNEL */
>  
>  struct vm_page_md {
> +     struct mutex pv_mtx;
>       LIST_HEAD(,pte_desc) pv_list;
>  };
>  
>  #define VM_MDPAGE_INIT(pg) do {                 \
> +     mtx_init(&(pg)->mdpage.pv_mtx, IPL_VM); \
>       LIST_INIT(&((pg)->mdpage.pv_list));     \
>  } while (0)
>  
> Index: powerpc/powerpc/pmap.c
> ===================================================================
> RCS file: /home/cvs/src/sys/arch/powerpc/powerpc/pmap.c,v
> retrieving revision 1.159
> diff -u -p -r1.159 pmap.c
> --- powerpc/powerpc/pmap.c    5 Jun 2015 10:15:54 -0000       1.159
> +++ powerpc/powerpc/pmap.c    18 Jul 2015 17:37:54 -0000
> @@ -642,6 +642,7 @@ pmap_remove(pmap_t pm, vaddr_t sva, vadd
>       struct pte_desc *pted;
>       vaddr_t va;
>  
> +     KERNEL_LOCK();
>       PMAP_VP_LOCK(pm);
>       for (va = sva; va < eva; va += PAGE_SIZE) {
>               pted = pmap_vp_lookup(pm, va);
> @@ -649,6 +650,7 @@ pmap_remove(pmap_t pm, vaddr_t sva, vadd
>                       pmap_remove_pted(pm, pted);
>       }
>       PMAP_VP_UNLOCK(pm);
> +     KERNEL_UNLOCK();
>  }
>  
>  /*
> 

Reply via email to