diff options
author | Dennis Zhou <dennis@kernel.org> | 2021-07-03 05:49:57 +0200 |
---|---|---|
committer | Dennis Zhou <dennis@kernel.org> | 2021-07-04 20:30:17 +0200 |
commit | 93274f1dd6b0a615b299beddf99871fe81f91275 (patch) | |
tree | 17da89981870f2d114e673fe57beeb80bc35a252 /mm/percpu-km.c | |
parent | Merge tag 'sound-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/t... (diff) | |
download | linux-93274f1dd6b0a615b299beddf99871fe81f91275.tar.xz linux-93274f1dd6b0a615b299beddf99871fe81f91275.zip |
percpu: flush tlb in pcpu_reclaim_populated()
Prior to "percpu: implement partial chunk depopulation",
pcpu_depopulate_chunk() was called only on the destruction path. This
meant the virtual address range was on its way back to vmalloc which
will handle flushing the tlbs for us.
However, with pcpu_reclaim_populated(), we are now calling
pcpu_depopulate_chunk() during the active lifecycle of a chunk.
Therefore, we need to flush the tlb as well otherwise we can end up
accessing the wrong page through an invalid tlb mapping as reported in
[1].
[1] https://lore.kernel.org/lkml/20210702191140.GA3166599@roeck-us.net/
Fixes: f183324133ea ("percpu: implement partial chunk depopulation")
Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Diffstat (limited to 'mm/percpu-km.c')
-rw-r--r-- | mm/percpu-km.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/percpu-km.c b/mm/percpu-km.c index c9d529dc7651..fe31aa19db81 100644 --- a/mm/percpu-km.c +++ b/mm/percpu-km.c @@ -32,6 +32,12 @@ #include <linux/log2.h> +static void pcpu_post_unmap_tlb_flush(struct pcpu_chunk *chunk, + int page_start, int page_end) +{ + /* nothing */ +} + static int pcpu_populate_chunk(struct pcpu_chunk *chunk, int page_start, int page_end, gfp_t gfp) { |