« Previous | Next » 

Revision 77a8f1a5

ID77a8f1a5125457d845fac6aa0c2e1e2681d94f07

Added by Alexander Graf almost 12 years ago

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 <>
Signed-off-by: Alexander Graf <>
Reviewed-by: Peter Maydell <>
Acked-by: Riku Voipio <>
Signed-off-by: Blue Swirl <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences