]> git.baikalelectronics.ru Git - kernel.git/commit
infiniband: Fix alignment of mmap cookies to support VIPT caching
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Fri, 10 Mar 2017 18:34:20 +0000 (11:34 -0700)
committerDoug Ledford <dledford@redhat.com>
Fri, 24 Mar 2017 20:50:51 +0000 (16:50 -0400)
commit472a2d81ee9f69cbcdcc9d48ce346469366ffdcd
treeebc218fa46b4ca0feb11029cb7acaab9d0086d1a
parent28e35b9977979155ef56ab5c0a4f4d2c6bc627c6
infiniband: Fix alignment of mmap cookies to support VIPT caching

When vmalloc_user is used to create memory that is supposed to be mmap'd
to user space, it is necessary for the mmap cookie (eg the offset) to be
aligned to SHMLBA.

This creates a situation where all virtual mappings of the same physical
page share the same virtual cache index and guarantees VIPT coherence.
Otherwise the cache is non-coherent and the kernel will not see writes
by userspace when reading the shared page (or vice-versa).

Reported-by: Josh Beavers <josh.beavers@gmail.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rdmavt/mmap.c
drivers/infiniband/sw/rxe/rxe_mmap.c