summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorPeter Maydell2021-01-24 20:36:45 +0100
committerPeter Maydell2021-01-24 20:36:45 +0100
commite672f1d39755a6f7007dc8b04a9af43f1b7177ca (patch)
tree3ce562ea37f8f150f4c795cb42328ba98ea96aa0 /include/qemu
parentMerge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into ... (diff)
parenttcg: Restart code generation when we run out of temps (diff)
downloadqemu-e672f1d39755a6f7007dc8b04a9af43f1b7177ca.tar.gz
qemu-e672f1d39755a6f7007dc8b04a9af43f1b7177ca.tar.xz
qemu-e672f1d39755a6f7007dc8b04a9af43f1b7177ca.zip
Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210124' into staging
Fix tcg constant temp overflow. Fix running during atomic single-step. Partial support for apple silicon. Cleanups for accel/tcg. # gpg: Signature made Sun 24 Jan 2021 18:08:57 GMT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth-gitlab/tags/pull-tcg-20210124: tcg: Restart code generation when we run out of temps tcg: Toggle page execution for Apple Silicon accel/tcg: Restrict cpu_io_recompile() from other accelerators accel/tcg: Declare missing cpu_loop_exit*() stubs accel/tcg: Restrict tb_gen_code() from other accelerators accel/tcg: Move tb_flush_jmp_cache() to cputlb.c accel/tcg: Make cpu_gen_init() static tcg: Optimize inline dup_const for MO_64 qemu/compiler: Split out qemu_build_not_reached_always tcg: update the cpu running flag in cpu_exec_step_atomic Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/compiler.h5
-rw-r--r--include/qemu/osdep.h28
2 files changed, 31 insertions, 2 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index d620a841e4..cf28bb2bcd 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -215,9 +215,10 @@
* supports QEMU_ERROR, this will be reported at compile time; otherwise
* this will be reported at link time due to the missing symbol.
*/
-#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
extern void QEMU_NORETURN QEMU_ERROR("code path is reachable")
- qemu_build_not_reached(void);
+ qemu_build_not_reached_always(void);
+#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
+#define qemu_build_not_reached() qemu_build_not_reached_always()
#else
#define qemu_build_not_reached() g_assert_not_reached()
#endif
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index a434382c58..b6ffdc15bf 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -119,6 +119,10 @@ extern int daemon(int, int);
#include "sysemu/os-posix.h"
#endif
+#ifdef __APPLE__
+#include <AvailabilityMacros.h>
+#endif
+
#include "glib-compat.h"
#include "qemu/typedefs.h"
@@ -682,4 +686,28 @@ char *qemu_get_host_name(Error **errp);
*/
size_t qemu_get_host_physmem(void);
+/*
+ * Toggle write/execute on the pages marked MAP_JIT
+ * for the current thread.
+ */
+#if defined(MAC_OS_VERSION_11_0) && \
+ MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
+static inline void qemu_thread_jit_execute(void)
+{
+ if (__builtin_available(macOS 11.0, *)) {
+ pthread_jit_write_protect_np(true);
+ }
+}
+
+static inline void qemu_thread_jit_write(void)
+{
+ if (__builtin_available(macOS 11.0, *)) {
+ pthread_jit_write_protect_np(false);
+ }
+}
+#else
+static inline void qemu_thread_jit_write(void) {}
+static inline void qemu_thread_jit_execute(void) {}
+#endif
+
#endif