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

Re: "Unaligned access" on Alpha



many (i can say "all" for me) kernel unaligned accesses happen in the 
netfilter code. so if u r running a firewall of any kind on EV56 u have a 
real problem.
i wrote a small stupid (but working perfectly) patch that eliminates them to 
zero.
if interessted just ask and i will post it (again)

Linux alpha 2.4.23-grsec #2 Tue Dec 2 22:05:21 CET 2003 alpha unknown
20:54:17 up 7 days, 18:38,  8 users,  load average: 1.00, 1.00, 1.00
(dont care about the load the box is used for searching for big primes and the 
load is just OK)
cpu                     : Alpha
cpu model               : EV56
cpu variation           : 0
cpu revision            : 0
cpu serial number       : Linux_is_Great!
system type             : Miata
system variation        : 0
system revision         : 0
system serial number    : MILO-2.2-17
cycle frequency [Hz]    : 433061852 est.
timer frequency [Hz]    : 1024.00
page size [bytes]       : 8192
phys. address bits      : 40
max. addr. space #      : 127
BogoMIPS                : 860.60
kernel unaligned acc    : 0 (pc=0,va=0)
user unaligned acc      : 27 (pc=120305e88,va=1204ceae4)
platform string         : N/A
cpus detected           : 0

the box is also my internet gateway and runs NAT and statefull packet filter
as u can see
no kernel un acc`s at all
some in userspace, but thats ok
the box is rock stable even under nonstop 100% load
(i had to reboot because of power failure a week ago)
the box gets hot as hell!

cheers,

Juraj Holtak


On Sunday 29 February 2004 18:10, Falk Hueffner wrote:
> Kelledin <kelledin+DAXP@skarpsey.dyndns.org> writes:
> > Lately I've been looking closely at the compile logs on my EV56
> > box, and I've noticed a particular gcc warning occurring
> > frequently:
> >
> >     cast increases required alignment of target type.
> >
> > This worries me almost as much as casts between integers and
> > pointers of different size, but...even with all the warnings, I
> > don't get too many crashes.
>
> Well, not surprising, since this will only lead to a problem if a) the
> pointer is actually dereferenced and b) the alignment is actually
> wrong. Often this cannot occur and the warning is bogus.
>
> > Still, I'm compelled to wonder about the effect of unaligned
> > accesses, i.e. how severe is an unaligned access in user-space?  How
> > about in kernel-space?  How does the system handle them?
>
> A trap to PALcode occurs and the firmware hands over to the operating
> system. The OS emulates the access and resumes the program. Takes
> probably about 100-200 cycles.
>
> > I have a pretty clear idea what it would take to fix that warning
> > condition, but it occurs so frequently that I'm not sure it would be
> > worth the time. :/
>
> I don't think so, unless you actually see unaligned accesses in the
> syslog.
>
> --
> 	Falk



Reply to: