[RFC] mmaping with VIVT cache

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Sep 16 19:05:40 EDT 2010


On Wed, Sep 15, 2010 at 05:25:38PM -0700, P F wrote:
> The mmap'd buffer is allocated by vmalloc_32(), and later mapped with
> vmalloc_to_page()/vm_insert_page().  The DMA'd buffer is allocated by
> usb_buffer_alloc().  At the appropriate time, the DMA'd buffer is
> memcpy()'d into the mmap'd buffer, and userspace is allowed to handle it,
> at which point it is corrupt.

Ah, that's slightly different as you're not talking about the DMA buffers
themselves.

However, anyone who is not familiar with VIVT or aliasing VIPT caches is
going to be caught out by this sort of thing (which basically means most
ARMs, and at least some PA-RISC.)

I don't think we have any APIs in the kernel to handle aliasing between
the vmalloc space and userspace...



More information about the linux-arm-kernel mailing list