Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh3/sh3 tlb_exception: in slow path, check for user...



details:   https://anonhg.NetBSD.org/src/rev/7733e1fcb1fd
branches:  trunk
changeset: 846879:7733e1fcb1fd
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Dec 03 12:39:00 2019 +0000

description:
tlb_exception: in slow path, check for usermode before calling userret().

diffstat:

 sys/arch/sh3/sh3/exception.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 36c8a840e542 -r 7733e1fcb1fd sys/arch/sh3/sh3/exception.c
--- a/sys/arch/sh3/sh3/exception.c      Tue Dec 03 11:50:45 2019 +0000
+++ b/sys/arch/sh3/sh3/exception.c      Tue Dec 03 12:39:00 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exception.c,v 1.71 2019/12/01 12:19:28 ad Exp $        */
+/*     $NetBSD: exception.c,v 1.72 2019/12/03 12:39:00 ad Exp $        */
 
 /*-
  * Copyright (c) 2002, 2019 The NetBSD Foundation, Inc. All rights reserved.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exception.c,v 1.71 2019/12/01 12:19:28 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exception.c,v 1.72 2019/12/03 12:39:00 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -233,6 +233,7 @@
        return;
 
  trapsignal:
+       KASSERT(usermode);
        ksi.ksi_trap = tf->tf_expevt;
        trapsignal(l, &ksi);
        userret(l);
@@ -400,7 +401,8 @@
        /* Page in. load PTE to TLB. */
        if (err == 0) {
                bool loaded;
-               userret(l);
+               if (usermode)
+                       userret(l);
                loaded = __pmap_pte_load(pmap, va, track);
 #if 0
                /*



Home | Main Index | Thread Index | Old Index