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
This commit is contained in:
Paolo Bonzini 2018-02-15 13:06:59 -05:00 committed by Lioncash
parent 96e5a7ced3
commit 1cfd4190a7
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -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(;;) */