tcg: Toggle page execution for Apple Silicon
authorRoman Bolshakov <r.bolshakov@yadro.com>
Wed, 13 Jan 2021 03:28:07 +0000 (06:28 +0300)
committerRichard Henderson <richard.henderson@linaro.org>
Sat, 23 Jan 2021 22:13:00 +0000 (12:13 -1000)
commit653b87eb36045b506b79f0bb433016ef1c54bc9a
tree9072762b0292a3b668f5e55f94da53e1edb9c5a2
parent65269192241104342e3b1ba2b7b0f50e5042052e
tcg: Toggle page execution for Apple Silicon

Pages can't be both write and executable at the same time on Apple
Silicon. macOS provides public API to switch write protection [1] for
JIT applications, like TCG.

1. https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon

Tested-by: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20210113032806.18220-1-r.bolshakov@yadro.com>
[rth: Inline the qemu_thread_jit_* functions;
 drop the MAP_JIT change for a follow-on patch.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/cpu-exec.c
accel/tcg/translate-all.c
include/qemu/osdep.h
tcg/tcg.c