Port-arm archive

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

Re: earmhf issues on Beaglebone Black



On Tue, Jul 22, 2014 at 03:07:32PM -0700, Matt Thomas wrote:
> 
> On Jul 22, 2014, at 3:05 PM, Manuel Bouyer <bouyer%antioche.eu.org@localhost> 
> wrote:
> 
> > On Tue, Jul 22, 2014 at 02:58:39PM -0700, Matt Thomas wrote:
> >> 
> >> On Jul 22, 2014, at 2:45 PM, Manuel Bouyer 
> >> <bouyer%antioche.eu.org@localhost> wrote:
> >> 
> >>> AFAIK uvm_fault() is not called.
> >>> we enter data_abort_handler() with (fsr & FAULT_TYPE_MASK) == 0xe.
> >>> At line 278, data_aborts[fsr & FAULT_TYPE_MASK].func is not NULL
> >>> (it's dab_buserr() ) so we call it and goto to either do_trapsignal or 
> >>> out.
> >>> 
> >>> I just checked, both freebsd and linuxn handle fsr & FAULT_TYPE_MASK) == 
> >>> 0xe
> >>> as we do, I didn't see anything special.
> >> 
> >> I don't understand why the fault type is 0xe.  it should be 0x5.
> >> 
> >> can you print armreg_ttbr_read() and pm->pm_l1 as well?
> > 
> > Sure, here it is:
> > data_abort_handler: data_aborts fsr=0x80e far=0x20000
> > dab_buserr far 0x20000 -> NULL pm->pm_l1[far >> L1_S_SHIFT] = 0x0
> > pm->pm_l1 0x9f036000 armreg_ttbr_read() 0x9f03601b
> 
> What happens if you change the [14] entry to NULL?

I'm now running with the attached patch, which should have the same
effect as setting data_aborts[fsr].func to NULL.

I got
fsr 0x182e, continuing anyway
fsr 0x180e, continuing anyway
fsr 0x182e, continuing anyway

but no error from make so far, it's now building the first package.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: arm32/fault.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/arm32/fault.c,v
retrieving revision 1.100
diff -u -p -r1.100 fault.c
--- arm32/fault.c       12 Apr 2014 09:11:47 -0000      1.100
+++ arm32/fault.c       22 Jul 2014 22:13:43 -0000
@@ -275,6 +275,9 @@ data_abort_handler(trapframe_t *tf)
        curcpu()->ci_abt_evs[fsr & FAULT_TYPE_MASK].ev_count++;
 
        /* Invoke the appropriate handler, if necessary */
+       if ((fsr & FAULT_TYPE_MASK & 0xf) == 14) {
+               printf("fsr 0x%x, continuing anyway\n", fsr);
+       } else 
        if (__predict_false(data_aborts[fsr & FAULT_TYPE_MASK].func != NULL)) {
 #ifdef DIAGNOSTIC
                printf("%s: data_aborts fsr=0x%x far=0x%x\n",
@@ -492,6 +495,7 @@ data_abort_handler(trapframe_t *tf)
 
        if (user == 0) {
                if (pcb->pcb_onfault) {
+                       printf("va 0x%lx ftype 0x%x pcb_onfault %p error %d\n", 
va, ftype, pcb->pcb_onfault, error);
                        tf->tf_r0 = error;
                        tf->tf_pc = (register_t)(intptr_t) pcb->pcb_onfault;
                        return;
@@ -695,6 +699,21 @@ dab_buserr(trapframe_t *tf, u_int fsr, u
 #endif /* __XSCALE__ */
 
        if (pcb->pcb_onfault) {
+               void *onfault = pcb->pcb_onfault;
+               paddr_t pa;
+
+               pcb->pcb_onfault = NULL;
+               if 
(pmap_extract(vm_map_pmap(&curlwp->l_proc->p_vmspace->vm_map),
+                   far, &pa)) {
+                       printf("dab_buserr far 0x%x -> 0x%lx", far, pa);
+               } else {
+                       printf("dab_buserr far 0x%x -> NULL", far);
+               }
+               printf(" pm->pm_l1[far >> L1_S_SHIFT] = 0x%x\n",
+                   vm_map_pmap(&curlwp->l_proc->p_vmspace->vm_map)->pm_l1[far 
>> L1_S_SHIFT]);
+               printf("pm->pm_l1 %p armreg_ttbr_read() 0x%x\n",
+                   vm_map_pmap(&curlwp->l_proc->p_vmspace->vm_map)->pm_l1, 
armreg_ttbr_read());
+               pcb->pcb_onfault = onfault;
                KDASSERT(TRAP_USERMODE(tf) == 0);
                tf->tf_r0 = EFAULT;
                tf->tf_pc = (register_t)(intptr_t) pcb->pcb_onfault;


Home | Main Index | Thread Index | Old Index