linux_dsm_epyc7002/include
Linus Torvalds eb66ae0308 mremap: properly flush TLB before releasing the page
Jann Horn points out that our TLB flushing was subtly wrong for the
mremap() case.  What makes mremap() special is that we don't follow the
usual "add page to list of pages to be freed, then flush tlb, and then
free pages".  No, mremap() obviously just _moves_ the page from one page
table location to another.

That matters, because mremap() thus doesn't directly control the
lifetime of the moved page with a freelist: instead, the lifetime of the
page is controlled by the page table locking, that serializes access to
the entry.

As a result, we need to flush the TLB not just before releasing the lock
for the source location (to avoid any concurrent accesses to the entry),
but also before we release the destination page table lock (to avoid the
TLB being flushed after somebody else has already done something to that
page).

This also makes the whole "need_flush" logic unnecessary, since we now
always end up flushing the TLB for every valid entry.

Reported-and-tested-by: Jann Horn <jannh@google.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Tested-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-18 11:30:52 +02:00
..
acpi
asm-generic vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections 2018-10-12 08:55:29 +11:00
clocksource
crypto
drm drm/cma-helper: Fix crash in fbdev error path 2018-10-02 13:03:34 +02:00
dt-bindings
keys
kvm
linux mremap: properly flush TLB before releasing the page 2018-10-18 11:30:52 +02:00
math-emu
media media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 06:32:51 -04:00
memory
misc
net net: ipv4: update fnhe_pmtu when first hop's MTU changes 2018-10-10 22:44:46 -07:00
pcmcia
ras
rdma
scsi
soc soc: fsl: qbman: add APIs to retrieve the probing status 2018-09-27 15:43:35 -05:00
sound ASoC: Fixes for v4.19 2018-09-17 18:59:21 +02:00
target
trace RxRPC fixes 2018-10-10 22:27:38 -07:00
uapi RxRPC fixes 2018-10-10 22:27:38 -07:00
video
xen xen/balloon: add runtime control for scrubbing ballooned out pages 2018-09-14 08:51:10 -04:00