From 1cfd4190a7565198a617aad7d0b85eaf04f72510 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 15 Feb 2018 13:06:59 -0500 Subject: [PATCH] tcg: assign cpu->current_tb in a simpler place TCG has not been reading cpu->current_tb from signal handlers for years. The code that synchronized cpu_exec with the signal handler is not needed anymore. Backports commit b0a46fa796504c7334202877a68c857e49f7c96c from qemu --- qemu/cpu-exec.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/qemu/cpu-exec.c b/qemu/cpu-exec.c index f05eb27b..0d7ef172 100644 --- a/qemu/cpu-exec.c +++ b/qemu/cpu-exec.c @@ -236,16 +236,12 @@ int cpu_exec(struct uc_struct *uc, CPUState *cpu) next_tb & TB_EXIT_MASK, tb); } - /* cpu_interrupt might be called while translating the - TB, but before it is linked into a potentially - infinite loop and becomes env->current_tb. Avoid - starting execution if there is a pending interrupt. */ - cpu->current_tb = tb; - barrier(); if (likely(!cpu->exit_request)) { tc_ptr = tb->tc_ptr; + cpu->current_tb = tb; /* execute the generated code */ next_tb = cpu_tb_exec(cpu, tc_ptr); // UNICORN + cpu->current_tb = NULL; switch (next_tb & TB_EXIT_MASK) { case TB_EXIT_REQUESTED: @@ -263,7 +259,6 @@ int cpu_exec(struct uc_struct *uc, CPUState *cpu) break; } } - cpu->current_tb = NULL; /* reset soft MMU for next block (it can currently only be set by a memory fault) */ } /* for(;;) */