Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm32 Adapt this to the recent sys/uvm/pmap/pma...



details:   https://anonhg.NetBSD.org/src/rev/a2c6a2507667
branches:  trunk
changeset: 816616:a2c6a2507667
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Jul 14 15:51:41 2016 +0000

description:
Adapt this to the recent sys/uvm/pmap/pmap_tlb.c changes.  MP kernels
now don't trigger KASSERTs

diffstat:

 sys/arch/arm/arm32/pmap.c |  29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diffs (54 lines):

diff -r 4e11f08fad6a -r a2c6a2507667 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Thu Jul 14 15:50:31 2016 +0000
+++ b/sys/arch/arm/arm32/pmap.c Thu Jul 14 15:51:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.334 2016/07/14 05:00:51 skrll Exp $ */
+/*     $NetBSD: pmap.c,v 1.335 2016/07/14 15:51:41 skrll Exp $ */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,7 @@
 
 #include <arm/locore.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.334 2016/07/14 05:00:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.335 2016/07/14 15:51:41 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -5013,11 +5013,34 @@
                    "pmap/asid %p/%#x != %s cur pmap/asid %p/%#x", pm,
                    pm->pm_pai[0].pai_asid, curcpu()->ci_data.cpu_name,
                    curcpu()->ci_pmap_cur, curcpu()->ci_pmap_asid_cur);
+
+#ifdef MULTIPROCESSOR
                /*
                 * Finish up the pmap_remove_all() optimisation by flushing
                 * all our ASIDs.
                 */
-               pmap_tlb_asid_release_all(pm);
+               // This should be the last CPU with this pmap onproc
+               KASSERT(!kcpuset_isotherset(pm->pm_onproc, cpu_index(curcpu())));
+               if (kcpuset_isset(pm->pm_onproc, cpu_index(curcpu()))) {
+                       if (pm != pmap_kernel()) {
+                               struct cpu_info * const ci = curcpu();
+                               KASSERT(!cpu_intr_p());
+                               /*
+                                * The bits in pm_onproc that belong to this
+                                * TLB can be changed while this TLBs lock is
+                                * not held as long as we use atomic ops.
+                                */
+                               kcpuset_atomic_clear(pm->pm_onproc,
+                                   cpu_index(ci));
+                       }
+               }
+               KASSERT(kcpuset_iszero(pm->pm_onproc));
+#endif
+               struct pmap_asid_info * const pai =
+                   PMAP_PAI(pm, cpu_tlb_info(ci));
+
+               tlb_invalidate_asids(pai->pai_asid, pai->pai_asid);
+
 #else
                /*
                 * Finish up the pmap_remove_all() optimisation by flushing



Home | Main Index | Thread Index | Old Index