From e9e8833da4f984304a5c8454b4631ca28fd61697 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 16 Feb 2018 15:56:00 -0500 Subject: [PATCH] cpu-exec: Add nochain debug flag Respect it to avoid linking TBs together. Backports commit 89a82cd4b6a90fe117fa715e2abe51d5c607560c from qemu --- qemu/cpu-exec.c | 3 ++- qemu/include/qemu/log.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qemu/cpu-exec.c b/qemu/cpu-exec.c index 20ddad7b..abc4b7b9 100644 --- a/qemu/cpu-exec.c +++ b/qemu/cpu-exec.c @@ -201,7 +201,8 @@ int cpu_exec(struct uc_struct *uc, CPUState *cpu) /* see if we can patch the calling TB. When the TB spans two pages, we cannot safely do a direct jump. */ - if (next_tb != 0 && tb->page_addr[1] == -1) { + if (next_tb != 0 && tb->page_addr[1] == -1 + && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { tb_add_jump((TranslationBlock *)(next_tb & ~TB_EXIT_MASK), next_tb & TB_EXIT_MASK, tb); } diff --git a/qemu/include/qemu/log.h b/qemu/include/qemu/log.h index 6f9ccdf7..34e35b2d 100644 --- a/qemu/include/qemu/log.h +++ b/qemu/include/qemu/log.h @@ -36,6 +36,7 @@ static inline bool qemu_log_enabled(void) #define CPU_LOG_RESET (1 << 9) #define LOG_UNIMP (1 << 10) #define LOG_GUEST_ERROR (1 << 11) +#define CPU_LOG_TB_NOCHAIN (1 << 13) /* Returns true if a bit is set in the current loglevel mask */