Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Apr 2006 10:48:26 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Scott Long <scottl@samsco.org>
Cc:        cvs-all@FreeBSD.org, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org, Warner Losh <imp@bsdimp.com>
Subject:   Re: cvs commit: src/sys/dev/bce if_bcereg.h
Message-ID:  <20060426103623.M1847@epsplex.bde.org>
In-Reply-To: <444EB6A1.3060901@samsco.org>
References:  <444E7750.206@samsco.org> <200604251540.00170.jhb@freebsd.org> <444E7BFE.4040800@samsco.org> <20060425.173236.74726638.imp@bsdimp.com> <444EB6A1.3060901@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 25 Apr 2006, Scott Long wrote:

> Warner Losh wrote:
>> The problem is that PAE's bus_size_t is a 32-bit quantity, when it
>> should be a 64-bit quantity:
>> 
>> #ifdef PAE
>> typedef uint64_t bus_addr_t;
>> #else
>> typedef uint32_t bus_addr_t;
>> #endif
>> typedef uint32_t bus_size_t;

No, it should be a 32-bit quantity like it is.

> The next problem is that the boundary argument of bus_dma_tag_create()
> is a bus_size_t.  For all PCI Express devices, you need to be able to
> stick a value of 0x100000000 (2^32) in here, have busdma do the right
> thing with it, and not have the compiler complain.  I'm torn between
> declaring that the boundary is actually an address and thus should be
> declared as a bus_addr_t, and declaring that bus_size_t should be
> 64-bits on PAE just like it is on real 64-bit platforms.  The right

I think the boundary is sometimes an address, so it needs to always
have the type of an address.  It's never exactly a size.

> answer is probably to do both.  This means a core API change to busdma
> and therefore to 90% of the hardware drivers in the tree, so it's not
> easy to justify MFC'ing it.  It can be mostly worked around now anyways.
>
> Does this sound accurate and/or reasonable?

Supporting sizes >= 4G sounds unreasonable.  How can a single device
need or even address so much space, even on 64-bit arches?  For vm,
virtual memory is sort of a device, but even it is limited to 4G on
32-bit arches, and PAE on i386 isn't pessimized by using a larger than
necessary vm_size_t.

Bruce



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