Skip to content

Mirror map JIT memory for TCG

Joelle van Dyne qemu-arm qemu-devel qemu-riscv 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/24 patches 0 repliesNew
  2. v1 posting 1/24 patches 0 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4tcg: add const hints for code pointersinclude/tcg/tcg.h tcg/aarch64/tcg-target.c.inc tcg/arm/tcg-target.c.inc +9 more+80 -630 replies
2/4tcg: implement mirror mapped JIT for Linuxaccel/tcg/cpu-exec.c accel/tcg/translate-all.c configure +3 more+108 -80 replies
3/4tcg: use mirror map JIT in code generationtcg/aarch64/tcg-target.c.inc tcg/aarch64/tcg-target.h tcg/arm/tcg-target.c.inc +17 more+303 -1300 replies
4/4tcg: make mirror mapped JIT optionalaccel/tcg/tcg-all.c accel/tcg/translate-all.c bsd-user/main.c +3 more+82 -230 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RESEND 0/4] Mirror map JIT memory for TCG

To aid in debugging TCG, we enable a "mirror map" feature that, when enabled, will use memfd_create() to create two mappings of the same memory for RW and RX. The feature is only built when targeting system emulation on Linux and configured with --enable-debug-tcg. It can be disabled with the runtime argument -accel tcg,mirror-jit=off.

Although this patch only enables this feature for Linux, the main goal of this is to enable, through a future patch, iOS JIT on older devices which require strict W^X separation.

Resending because of merge conflict to current master.

-j

Joelle van Dyne (4):
tcg: add const hints for code pointers
tcg: implement mirror mapped JIT for Linux
tcg: use mirror map JIT in code generation
tcg: make mirror mapped JIT optional

 configure                    |  13 +++++
 meson.build                  |   1 +
 include/exec/exec-all.h      |   8 +++
 include/sysemu/tcg.h         |   2 +-
 include/tcg/tcg.h            |  26 +++++++--
 tcg/aarch64/tcg-target.h     |  18 +++++-
 tcg/arm/tcg-target.h         |  15 ++++-
 tcg/i386/tcg-target.h        |  26 ++++++++-
 tcg/mips/tcg-target.h        |  12 +++-
 tcg/ppc/tcg-target.h         |  12 +++-
 tcg/riscv/tcg-target.h       |  13 ++++-
 tcg/s390/tcg-target.h        |  17 +++++-
 tcg/sparc/tcg-target.h       |  12 +++-
 tcg/tci/tcg-target.h         |   9 ++-
 accel/tcg/cpu-exec.c         |   7 ++-
 accel/tcg/tcg-all.c          |  31 +++++++++-
 accel/tcg/translate-all.c    | 106 +++++++++++++++++++++++++++++------
 bsd-user/main.c              |   2 +-
 linux-user/main.c            |   2 +-
 tcg/tcg.c                    |  60 +++++++++++++-------
 qemu-options.hx              |  11 ++++
 tcg/aarch64/tcg-target.c.inc |  48 +++++++++-------
 tcg/arm/tcg-target.c.inc     |  33 ++++++-----
 tcg/i386/tcg-target.c.inc    |  28 ++++-----
 tcg/mips/tcg-target.c.inc    |  64 ++++++++++++---------
 tcg/ppc/tcg-target.c.inc     |  57 ++++++++++++-------
 tcg/riscv/tcg-target.c.inc   |  51 +++++++++--------
 tcg/s390/tcg-target.c.inc    |  25 +++++----
 tcg/sparc/tcg-target.c.inc   |  33 ++++++-----
 tcg/tcg-ldst.c.inc           |   2 +-
 tcg/tcg-pool.c.inc           |   9 +--
 tcg/tci/tcg-target.c.inc     |   8 +--
 32 files changed, 555 insertions(+), 206 deletions(-)
Signature · 1 line
2.28.0