Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jul 2001 09:19:40 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Matthew Jacob <mjacob@feral.com>, hackers@FreeBSD.org
Subject:   Re: x86 unaligned access followup.
Message-ID:  <3B55B71C.CA7704BD@mindspring.com>
References:  <XFMail.010717144858.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin wrote:
> >> Actually, since the 486, it's been possible for us to turn on unaligned
> >> access exceptions on the x86.  We should probably consider doing this, to
> >> ensure better performance, and to avoid the unnecessary bus overhead we
> >> eat for unaligned access today... not to mention how it could shake out
> >> the drivers.
> >
> >
> > Now *that* is a very cool idea. As Johnny Carson would say "I did not know
> > that". How would this be done? I assume it's some bit-flip for the chip?
> > D'ya have a sample bit 'o code for this?
> 
> It's the AC bit in eflags.

Note that this will not trap 64 bit unaligned accesses, only 32.

Also note that this will play hell with some of the recent
copy avoidance changes made by Bill Paul to the ethernet
drivers, to avoid the expense of copying the packet, with
the knowledge that there would be an increased overhead in
the resulting packet field unaligned accesses when decoding
IP packets...

A "shakedown cruise" could end up being very rough... you
would effectively need to check an "unaligned access in
kernel is OK" flag in many of these instances, and fall back
to doing the copy when it was false.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B55B71C.CA7704BD>