Module Name: src Committed By: matt Date: Fri Mar 28 21:43:49 UTC 2014
Modified Files: src/sys/arch/arm/arm: ast.c Log Message: Make sure the pmap is activated before returning to userland. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/arm/ast.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/arm/ast.c diff -u src/sys/arch/arm/arm/ast.c:1.22 src/sys/arch/arm/arm/ast.c:1.23 --- src/sys/arch/arm/arm/ast.c:1.22 Sun Aug 18 06:28:18 2013 +++ src/sys/arch/arm/arm/ast.c Fri Mar 28 21:43:49 2014 @@ -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 @@ userret(struct lwp *l) /* 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