Port-amd64 archive

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

Re: unaligned memory access & SIGBUS

Le 11/04/12 17:42, Nicolas Joly a écrit :
njoly@lanfeust [tmp/malign]>  uname -a
NetBSD lanfeust.sis.pasteur.fr 6.99.4 NetBSD 6.99.4 (LANFEUST) #2: Mon
Apr  9 23:30:03 CEST 2012
njoly@lanfeust [tmp/malign]>  cc -o malign malign.c
njoly@lanfeust [tmp/malign]>  ./malign
PSL_AC needs to be part of PSL_USER?

Thanks for the tip, but simply adding it to PSL_USER do not change
anything; still no SIGBUS signal.

Unless someone beats me ;) i'll need to find some spare to understand
that part of code hoping to see what's going on.

FWIW I talked with Nicolas about this privately, and the fix is fairly straightforward once you know it: alignment checks only trap when the CR0_AM bit is set in %cr0. Our code does not set it, so the CPU does not trap AE.

I have a patch ready for it, will commit it after I convert its malign.c test to an ATF one.

I will ask for a pull-up, the patch is rather harmless.


Home | Main Index | Thread Index | Old Index