From owner-freebsd-hackers Wed Jul 18 11:25: 9 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id BF6D037B401 for ; Wed, 18 Jul 2001 11:25:04 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.4/8.11.2) with ESMTP id f6IIOwv08317; Wed, 18 Jul 2001 11:24:59 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3B55B71C.CA7704BD@mindspring.com> Date: Wed, 18 Jul 2001 11:25:06 -0700 (PDT) From: John Baldwin To: Terry Lambert Subject: Re: x86 unaligned access followup. Cc: hackers@FreeBSD.org, Matthew Jacob Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 -- 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