qemu-e2k/linux-user
Alexander Graf 77a8f1a512 linux-user: Fix stale tbs after mmap
If we execute linux-user code that does the following:

  * A = mmap()
  * execute code in A
  * munmap(A)
  * B = mmap(), but mmap returns the same address as A
  * execute code in B

we end up executing a stale cached tb that contains translated code
from A, while we want new code from B.

This patch adds a TB flush for mmap'ed regions, before we return them,
avoiding the whole issue. It also adds a flush for munmap, so that we
don't execute stale TBs instead of getting a segfault.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-05-19 15:49:40 +00:00
..
alpha
arm
cris
i386
m68k
microblaze
mips
mips64
mipsn32
ppc
s390x
sh4
sparc
sparc64
unicore32
x86_64
cpu-uname.c
cpu-uname.h
elfload.c
errno_defs.h
flat.h
flatload.c
ioctls.h
linux_loop.h
linuxload.c
m68k-sim.c
main.c
mmap.c linux-user: Fix stale tbs after mmap 2012-05-19 15:49:40 +00:00
qemu-types.h
qemu.h
signal.c
socket.h
strace.c
strace.list
syscall_defs.h
syscall_types.h
syscall.c
target_flat.h
uaccess.c
vm86.c