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

next in thread | previous in thread | raw e-mail | index | archive | help

On 18-Jul-01 Terry Lambert wrote:
> 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.

I didn't say it was a good thing, I was just saying how it was done. :)
From Bill's description of the network stuff, it sounds like the unaligned
access on x86 is cheaper than the copy that would otherwise be done, so we
don't want AC checks in that case anyways.

> -- Terry

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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?XFMail.010718112506.jhb>