Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm32/arm32 two changes to arm32 fault handling:



details:   https://anonhg.NetBSD.org/src/rev/c38ea01cdbc4
branches:  trunk
changeset: 499495:c38ea01cdbc4
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Nov 21 06:30:05 2000 +0000

description:
two changes to arm32 fault handling:
 - when pcb_onfault is set, allow UVM to attempt to resolve permission faults
   as well as translation faults (rather than immediately invoking the
   onfault handler for permission faults).  this is needed for UBC since
   it will be normal for uiomove() to fault on read-only mappings which
   will be made writable by the pager.
 - clear pcb_onfault before calling uvm_fault() and restore it afterward.
   if the fault handler generates a pagefault, we'd like to panic rather
   than invoking the onfault handler.

diffstat:

 sys/arch/arm32/arm32/fault.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 87ac709068dc -r c38ea01cdbc4 sys/arch/arm32/arm32/fault.c
--- a/sys/arch/arm32/arm32/fault.c      Tue Nov 21 06:24:26 2000 +0000
+++ b/sys/arch/arm32/arm32/fault.c      Tue Nov 21 06:30:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fault.c,v 1.45 2000/06/29 08:52:58 mrg Exp $   */
+/*     $NetBSD: fault.c,v 1.46 2000/11/21 06:30:05 chs Exp $   */
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -145,6 +145,7 @@
        int user;
        u_quad_t sticks = 0;
        int error;
+       void *onfault;
 
        /*
         * Must get fault address and status from the CPU before
@@ -180,8 +181,10 @@
 
        /* fusubailout is used by [fs]uswintr to avoid page faulting */
        if (pcb->pcb_onfault
-           && ((fault_code != FAULT_TRANS_S && fault_code != FAULT_TRANS_P)
+           && ((fault_code != FAULT_TRANS_S && fault_code != FAULT_TRANS_P &&
+                fault_code != FAULT_PERM_S && fault_code != FAULT_PERM_P)
                || pcb->pcb_onfault == fusubailout)) {
+
 copyfault:
 #ifdef DEBUG
                printf("Using pcb_onfault=%p addr=%08x st=%08x p=%p\n",
@@ -418,7 +421,10 @@
                }
 #endif /* DIAGNOSTIC */
 
+               onfault = pcb->pcb_onfault;
+               pcb->pcb_onfault = NULL;
                rv = uvm_fault(map, va, 0, ftype);
+               pcb->pcb_onfault = onfault;
                if (rv == KERN_SUCCESS)
                        goto out;
 



Home | Main Index | Thread Index | Old Index