Re: UIO support for >32-bit physical addresses on 32-bit platforms

From: Hans J. Koch
Date: Wed Feb 24 2010 - 08:47:53 EST


On Tue, Feb 23, 2010 at 09:24:42PM -0600, Kumar Gala wrote:
> > Well, UIO is (up to now) completely independent of the architecture. If you've
> > got a good idea how to implement such mappings, feel free to come up with your
> > suggestions/patches. Just changing struct uio_mem.addr to u64 is certainly not
> > enough.
> >
> > I'll give it some thoughts myself, and will discuss the problem with friends,
> > maybe there's a nice solution. Help from your side is much appreciated.
>
> For my needs I believe changing uio_mem.addr to a u64 is sufficient for getting UIO_MEM_PHYS to work for the physical address being above 4G. I need the type to be large to represent a wider PFN range. Obviously there are limitations (ie, we can't make an IO region >4G in size, etc.)
>

Hmm, after some research it seems you're right. But the type for the addr
member of struct uio_mem should be phys_addr_t, not u64. phys_addr_t is
an u64 on systems that support it, and an u32 otherwise.

It'll probably work with UIO_MEM_LOGICAL and UIO_MEM_VIRTUAL as well.

Could you hack up a patch to that effect, and test it? If it works for you,
I think we should apply it.

Thanks for pointing this out.

Hans

> - k
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/