[PATCH qemu v3 0/2] target/arm: Improve user-mode compatibility with JITs

~jhogberg posted 2 patches 2 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/168722304495.6281.8113287217736957231-0@git.sr.ht
Maintainers: Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
target/arm/helper.c               |  47 ++++++++-
tests/tcg/aarch64/Makefile.target |   3 +-
tests/tcg/aarch64/icivau.c        | 169 ++++++++++++++++++++++++++++++
3 files changed, 215 insertions(+), 4 deletions(-)
create mode 100644 tests/tcg/aarch64/icivau.c
[PATCH qemu v3 0/2] target/arm: Improve user-mode compatibility with JITs
Posted by ~jhogberg 2 years, 7 months ago
The test cases have been changed in v3 to fix some issues pointed out in
code review. The main change is that the tests no longer naively copy C
code around, opting instead to have hard-coded binary payloads. Given
the small amount of code I found that the workarounds for position-
independence and figuring out the actual code length were at least as
ugly, but that's only my preference, please tell me if you'd prefer
something different.

----

When running in user-mode QEMU currently fails to emulate JITs that
use dual-mapped code to get around W^X restrictions, where one mapping
is writable and one is executable. As it has no way of knowing that a
write to the writable region is reflected in the executable one, it
fails to invalidate previously translated code which leads to a crash
at best.

(Note that system mode is unaffected as the softmmu is fully aware of
what is going on.)

This patch series catches changes to dual-mapped code by honoring the
cache management instructions required to make things work on actual
hardware.

See https://gitlab.com/qemu-project/qemu/-/issues/1034 for more
background information

John Högberg (2):
  target/arm: Handle IC IVAU to improve compatibility with JITs
  tests/tcg/aarch64: Add testcases for IC IVAU and dual-mapped code

 target/arm/helper.c               |  47 ++++++++-
 tests/tcg/aarch64/Makefile.target |   3 +-
 tests/tcg/aarch64/icivau.c        | 169 ++++++++++++++++++++++++++++++
 3 files changed, 215 insertions(+), 4 deletions(-)
 create mode 100644 tests/tcg/aarch64/icivau.c

-- 
2.38.5