Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm Make sure the pmap is activated before retu...



details:   https://anonhg.NetBSD.org/src/rev/4ffe472a11f9
branches:  trunk
changeset: 328172:4ffe472a11f9
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Mar 28 21:43:49 2014 +0000

description:
Make sure the pmap is activated before returning to userland.

diffstat:

 sys/arch/arm/arm/ast.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r ba639d9f8c1b -r 4ffe472a11f9 sys/arch/arm/arm/ast.c
--- a/sys/arch/arm/arm/ast.c    Fri Mar 28 21:43:01 2014 +0000
+++ b/sys/arch/arm/arm/ast.c    Fri Mar 28 21:43:49 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ast.c,v 1.22 2013/08/18 06:28:18 matt Exp $    */
+/*     $NetBSD: ast.c,v 1.23 2014/03/28 21:43:49 matt Exp $    */
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.22 2013/08/18 06:28:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.23 2014/03/28 21:43:49 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -74,6 +74,17 @@
        /* Invoke MI userret code */
        mi_userret(l);
 
+#if defined(__PROG32) && defined(ARM_MMU_EXTENDED)
+       /*
+        * If our ASID got released, access via TTBR0 will have been disabled.
+        * So if it is disabled, activate the lwp again to get a new ASID.
+        */
+       KASSERT(curcpu()->ci_pmap_cur == l->l_proc->p_vmspace->vm_map.pmap);
+       if (armreg_ttbcr_read() & TTBCR_S_PD0) {
+               pmap_activate(l);
+       }
+#endif
+
 #if defined(__PROG32) && defined(DIAGNOSTIC)
        KASSERT((lwp_trapframe(l)->tf_spsr & IF32_bits) == 0);
 #endif



Home | Main Index | Thread Index | Old Index