diff options
| author | Steven Rostedt <[email protected]> | 2025-04-02 14:49:07 +0000 |
|---|---|---|
| committer | Steven Rostedt (Google) <[email protected]> | 2025-04-02 15:02:27 +0000 |
| commit | e4d4b8670c44cdd22212cab3c576e2d317efa67c (patch) | |
| tree | 1fc4e4e532074bc7ae4290d35b3e6fe9bd2a00c5 /tools/lib/bpf/linker.c | |
| parent | tracing: Use vmap_page_range() to map memmap ring buffer (diff) | |
| download | kernel-e4d4b8670c44cdd22212cab3c576e2d317efa67c.tar.gz kernel-e4d4b8670c44cdd22212cab3c576e2d317efa67c.zip | |
ring-buffer: Use flush_kernel_vmap_range() over flush_dcache_folio()
Some architectures do not have data cache coherency between user and
kernel space. For these architectures, the cache needs to be flushed on
both the kernel and user addresses so that user space can see the updates
the kernel has made.
Instead of using flush_dcache_folio() and playing with virt_to_folio()
within the call to that function, use flush_kernel_vmap_range() which
takes the virtual address and does the work for those architectures that
need it.
This also fixes a bug where the flush of the reader page only flushed one
page. If the sub-buffer order is 1 or more, where the sub-buffer size
would be greater than a page, it would miss the rest of the sub-buffer
content, as the "reader page" is not just a page, but the size of a
sub-buffer.
Link: https://lore.kernel.org/all/CAG48ez3w0my4Rwttbc5tEbNsme6tc0mrSN95thjXUFaJ3aQ6SA@mail.gmail.com/
Cc: [email protected]
Cc: Linus Torvalds <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Vincent Donnefort <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Mike Rapoport <[email protected]>
Link: https://lore.kernel.org/[email protected]
Fixes: 117c39200d9d7 ("ring-buffer: Introducing ring-buffer mapping functions");
Suggested-by: Jann Horn <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'tools/lib/bpf/linker.c')
0 files changed, 0 insertions, 0 deletions
