arm alignment faults...

John-Mark Gurney jmg at funkthat.com
Sun Jun 29 03:38:32 UTC 2014


So, one of the little projects I'd like to see is the removal of
ETHER_ALIGN from the tree..  This bogosity can (and does) cause the use
of bouncing durning DMA ops on all ethernet frames...

In investigating this issue, I found CPU_CONTROL_AFLT_ENABLE... The
interesting part is that it looks like most of the code in arm/cpufunc.c
has dead code:
        cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE
                 | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE
                 | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE
                 | CPU_CONTROL_WBUF_ENABLE | CPU_CONTROL_ROM_ENABLE
                 | CPU_CONTROL_BEND_ENABLE | CPU_CONTROL_AFLT_ENABLE
                 | CPU_CONTROL_LABT_ENABLE | CPU_CONTROL_VECRELOC
                 | CPU_CONTROL_ROUNDROBIN;

#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS
        cpuctrl |= CPU_CONTROL_AFLT_ENABLE;
#endif

If you define ARM32_DISABLE_ALIGNMENT_FAULTS, you'll still get alignment
faults since that is what is specified above...  If anything, the code
needs to be changed to:
#ifdef ARM32_DISABLE_ALIGNMENT_FAULTS
        cpuctrl &= ~CPU_CONTROL_AFLT_ENABLE;
#endif

Though mv_pj4b is the only one to get this correct...

It looks like it was this way when the original code was imported..

Shall we just delete the ifndef ARM32_DISABLE_ALIGNMENT_FAULTS sections
then?

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-arm mailing list