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 If our ASID got released and access via TTB...



details:   https://anonhg.NetBSD.org/src/rev/69dcf9907647
branches:  trunk
changeset: 333320:69dcf9907647
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Oct 29 10:56:19 2014 +0000

description:
If our ASID got released and access via TTBR0 is disable make sure we
re-activate the lwp before calling mi_userret; otherwise bad things
happen, e.g. for signals.

diffstat:

 sys/arch/arm/arm/ast.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r e7208b1785cd -r 69dcf9907647 sys/arch/arm/arm/ast.c
--- a/sys/arch/arm/arm/ast.c    Wed Oct 29 10:53:41 2014 +0000
+++ b/sys/arch/arm/arm/ast.c    Wed Oct 29 10:56:19 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ast.c,v 1.24 2014/08/13 21:41:32 matt Exp $    */
+/*     $NetBSD: ast.c,v 1.25 2014/10/29 10:56:19 skrll Exp $   */
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.24 2014/08/13 21:41:32 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.25 2014/10/29 10:56:19 skrll Exp $");
 
 #include "opt_ddb.h"
 
@@ -71,9 +71,6 @@
 void
 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.
@@ -83,8 +80,12 @@
        if (armreg_ttbcr_read() & TTBCR_S_PD0) {
                pmap_activate(l);
        }
+       KASSERT(!(armreg_ttbcr_read() & TTBCR_S_PD0));
 #endif
 
+       /* Invoke MI userret code */
+       mi_userret(l);
+
 #if defined(__PROG32) && defined(DIAGNOSTIC)
        KASSERT(VALID_R15_PSR(lwp_trapframe(l)->tf_pc,
            lwp_trapframe(l)->tf_spsr));



Home | Main Index | Thread Index | Old Index