Fix: mmap: caches aliased on virtual addresses
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 19 Sep 2017 16:16:58 +0000 (12:16 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 19 Sep 2017 16:24:30 +0000 (12:24 -0400)
commit155b8d9b967828499487e40aaa239e1bf1bbbb23
tree6d64844b9b4e80f9066be6596009fdd6d825dbcc
parentcf101116238c2e18f6bf927822dbe47aa4e71dec
Fix: mmap: caches aliased on virtual addresses

Some architectures (e.g. implementations of arm64) implement their
caches based on the virtual addresses (rather than physical address).
It has the upside of making the cache access faster (no TLB lookup
required to access the cache line), but the downside of requiring
virtual mappings (e.g. kernel vs user-space) to be aligned on the number
of bits used for cache aliasing.

Perform dcache flushing for the entire sub-buffer in the get_subbuf
operation on those architectures, thus ensuring we don't end up with
cache aliasing issues.

An alternative approach we could eventually take would be to create a
kernel mapping for the ring buffer that is aligned with the user-space
mapping.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_frontend.c
This page took 0.026379 seconds and 4 git commands to generate.