Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Do not try to recovery from data pag...



details:   https://anonhg.NetBSD.org/src/rev/867859575c98
branches:  trunk
changeset: 745027:867859575c98
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Feb 21 15:15:48 2020 +0000

description:
Do not try to recovery from data page fault in interrupt context;
catch up belatedly with powerpc/trap.c rev 1.49 and etc.:

    http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/powerpc/trap.c#rev1.49

diffstat:

 sys/arch/powerpc/ibm4xx/trap.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 5d12831411ba -r 867859575c98 sys/arch/powerpc/ibm4xx/trap.c
--- a/sys/arch/powerpc/ibm4xx/trap.c    Fri Feb 21 15:00:44 2020 +0000
+++ b/sys/arch/powerpc/ibm4xx/trap.c    Fri Feb 21 15:15:48 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.77 2020/02/21 14:49:57 rin Exp $    */
+/*     $NetBSD: trap.c,v 1.78 2020/02/21 15:15:48 rin Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.77 2020/02/21 14:49:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.78 2020/02/21 15:15:48 rin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -182,7 +182,15 @@
                {
                        struct vm_map *map;
                        vaddr_t va;
-                       struct faultbuf *fb = NULL;
+                       struct faultbuf *fb;
+
+                       pcb = lwp_getpcb(l);
+                       fb = pcb->pcb_onfault;
+
+                       if (curcpu()->ci_idepth >= 0) {
+                               rv = EFAULT;
+                               goto out;
+                       }
 
                        va = tf->tf_dear;
                        if (tf->tf_pid == KERNEL_PID) {
@@ -200,13 +208,12 @@
                            (ftype & VM_PROT_WRITE) ? "write" : "read",
                            (void *)va, tf->tf_esr));
 
-                       pcb = lwp_getpcb(l);
-                       fb = pcb->pcb_onfault;
                        pcb->pcb_onfault = NULL;
                        rv = uvm_fault(map, trunc_page(va), ftype);
                        pcb->pcb_onfault = fb;
                        if (rv == 0)
                                return;
+out:
                        if (fb != NULL) {
                                tf->tf_pid = KERNEL_PID;
                                tf->tf_srr0 = fb->fb_pc;



Home | Main Index | Thread Index | Old Index