Module Name: src
Committed By: snj
Date: Fri Apr 10 20:17:52 UTC 2015
Modified Files:
src/sys/arch/arm/arm32 [netbsd-7]: pmap.c
Log Message:
Pull up following revision(s) (requested by skrll in ticket #669):
sys/arch/arm/arm32/pmap.c: revision 1.318
Fix two bugs. pmap_is_cached fix for MULTIPROCESSOR (not just ASID on
local cpu -> any valid ASID on any cpu).
pmap_deactivate: update curcpu()->ci_pmap_cur_asid to KERNEL_PID too.
To generate a diff of this commit:
cvs rdiff -u -r1.295.2.3 -r1.295.2.4 src/sys/arch/arm/arm32/pmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.295.2.3 src/sys/arch/arm/arm32/pmap.c:1.295.2.4
--- src/sys/arch/arm/arm32/pmap.c:1.295.2.3 Mon Nov 10 19:57:26 2014
+++ src/sys/arch/arm/arm32/pmap.c Fri Apr 10 20:17:52 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.295.2.3 2014/11/10 19:57:26 martin Exp $ */
+/* $NetBSD: pmap.c,v 1.295.2.4 2015/04/10 20:17:52 snj Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -216,7 +216,7 @@
#include <arm/locore.h>
//#include <arm/arm32/katelib.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.295.2.3 2014/11/10 19:57:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.295.2.4 2015/04/10 20:17:52 snj Exp $");
//#define PMAP_DEBUG
#ifdef PMAP_DEBUG
@@ -938,9 +938,18 @@ static inline bool
pmap_is_cached(pmap_t pm)
{
#ifdef ARM_MMU_EXTENDED
+ if (pm == pmap_kernel())
+ return true;
+#ifdef MULTIPROCESSOR
+ // Is this pmap active on any CPU?
+ if (!kcpuset_iszero(pm->pm_active))
+ return true;
+#else
struct pmap_tlb_info * const ti = cpu_tlb_info(curcpu());
- if (pm == pmap_kernel() || PMAP_PAI_ASIDVALID_P(PMAP_PAI(pm, ti), ti))
+ // Is this pmap active?
+ if (PMAP_PAI_ASIDVALID_P(PMAP_PAI(pm, ti), ti))
return true;
+#endif
#else
struct cpu_info * const ci = curcpu();
if (pm == pmap_kernel() || ci->ci_pmap_lastuser == NULL
@@ -4949,6 +4958,7 @@ pmap_deactivate(struct lwp *l)
pmap_tlb_asid_deactivate(pm);
cpu_setttb(pmap_kernel()->pm_l1_pa, KERNEL_PID);
ci->ci_pmap_cur = pmap_kernel();
+ ci->ci_pmap_asid_cur = KERNEL_PID;
kpreempt_enable();
#else
/*