Re: kmem_alloc replacement in Tiger
Re: kmem_alloc replacement in Tiger
- Subject: Re: kmem_alloc replacement in Tiger
- From: Andrew Gallatin <email@hidden>
- Date: Thu, 2 Feb 2006 08:26:25 -0500 (EST)
Terry Lambert writes:
> On Feb 1, 2006, at 3:58 PM, Andrew Gallatin wrote:
>
> > Terry Lambert writes:
> >> [...]
> >
> > You've confused me. What 32-bit value? I wasn't asking about how
> > to handle a 64-bit user virtual address. We already do this.
>
> It sounded like you were trying to use a 32 bit physical address...
No, I'm complaining a 32-bit physical address (may be) all that IOKit will give
me, even though I'd love to get a 64-bit physical address. See below.
> > My concern was with avoiding bouncing a 64-bit physical address which
> > backs a 32-bit kernel virtual address (or a 32- or 64-bit user virtual
> > address).
>
> This should not be a problem, and should not require bouncing, unless
> there's a hardware limitation. The kernel itself only really deals
> with virtual addresses. Physical addresses are handled by the pmap
> layer. In practice, it's impossible to have a machine where you are
> using memory that has a pmap entry referring to it that can't refer to
> it because it didn't have enough bits to establish the mapping in the
> first place. The attempt to map it would have failed.
I don't argue with this. The problem is that there is no way for
a driver to call down to the pmap layer. I must go through IOKit.
And IOKit considers a physical address to be 32-bit:
typedef UInt32 IOPhysicalAddress;
and any supported way to get a physical address seems to wind its way
through a 32-bit varible at some point.
There does seem to be a 64-bit
IOMemoryDescriptor::getPhysicalSegment64 (see
xnu-792.6.56/iokit/Kernel/IOMemoryDescriptor.cpp). However it starts
by getting a 32-bit 'physical' address. If there is a gIOSystemMapper
(a DART I would assume), I think it finds the 64-bit physical address
by doing a lookup in the IOMMU based on the 32-bit physical address.
If there is no gIOSystemMapper (like on a G4 or an Intel box), it
just casts the 32-bit address to 64 bits.
So I'm worried that on a DART-less system, there is no way to get a
DMA address for a physical address over 4GB that does not involve
bounce pages. I'm hoping that I'm wrong (like the bouncer is a
gIOSystemMapper; that would only waste memory..).
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden