Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jun 2005 20:24:46 -0600
From:      Scott Long <scottl@samsco.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-hackers@freebsd.org, hselasky@c2i.net
Subject:   Re: Obvious bug in /sys/i386/include/bus.h
Message-ID:  <42AE3FEE.6040207@samsco.org>
In-Reply-To: <20050613.172307.81090793.imp@bsdimp.com>
References:  <200506131412.38967.hselasky@c2i.net> <20050613.172307.81090793.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote:
> In message: <200506131412.38967.hselasky@c2i.net>
>             Hans Petter Selasky <hselasky@c2i.net> writes:
> : So can someone have this fixed, or is there a reason not to fix it. The one 
> : who wrote the code has done the same mistake with every one of the 
> : bus_space_XXXX that does memory mapped I/O. It currently breaks my drivers.
> 
> One isn't supposed to call these routines with count == 0.  One could
> say your drivers are broken :-)
> 
> Back when these were written, small optimizations like this were made
> to make things go faster.  Now that cache sizes are bigger, a few
> extra instructions likely wouldn't affect things too much.  Best to
> measure the effects of your proposed changes on real workloads...
> 
> Warner

I'm torn between saying, "this is the kernel and the kernel is an 
unforgiving mistress," and "defensive programming is good."  We still 
have viable and popular platforms that are based on i486, so I'd rather
not see us unwind the small optimizations that are still valid there.

Scott



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42AE3FEE.6040207>