Messages in this thread | | | Date | Wed, 3 Dec 2008 21:34:40 -0800 | From | "Edward Estabrook" <> | Subject | Re: [PATCH 1/1] Userspace I/O (UIO): Add support for userspace DMA (corrected) |
| |
> Anyway, what about 64bit processors? What happens if they try to use a > valid address in this range? > > Is this value always an "invalid" value for all arches that Linux runs > on?
Yes. I have run this on 64-bit systems.
The offset parameter in UIO is used to specify the memory-mapping index of interest, where offset = N * getpagesize().
In include/linux/uio_driver.h we had: #define MAX_UIO_MAPS 5
so assuming a page size of 4k the maximum legal value was 0x5000.
This logic is equally true on in any architecture.
With the dynamic DMA allocation one can now have an arbitrarily large number of mappings. This magic number simply reduces the theoretical limit to the number of distinct mappings to of 1,048,574.
Note that even if the in-kernel driver-stub choose to overload the mmap method both the original code and these modifications would error out on any value which did not correlate with a valid memory-mapping index number before handing control to the overloaded implementation.
| |