@@ -11,6 +11,7 @@
#include "exec/cpu-common.h"
#include "exec/translation-block.h"
+#include "accel/tcg/vcpu-state.h"
extern int64_t max_delay;
extern int64_t max_advance;
@@ -13,6 +13,7 @@
#define TCG_ACCEL_OPS_H
#include "sysemu/cpus.h"
+#include "accel/tcg/vcpu-state.h"
void tcg_cpu_destroy(CPUState *cpu);
int tcg_cpu_exec(CPUState *cpu);
@@ -13,6 +13,8 @@
* @plugin_state: per-CPU plugin state
*/
struct AccelCPUState {
+ sigjmp_buf jmp_env;
+
#ifdef CONFIG_USER_ONLY
TaskState *ts;
#endif /* !CONFIG_USER_ONLY */
@@ -475,7 +475,6 @@ struct CPUState {
int64_t icount_budget;
int64_t icount_extra;
uint64_t random_seed;
- sigjmp_buf jmp_env;
QemuMutex work_mutex;
QSIMPLEQ_HEAD(, qemu_work_item) work_list;
@@ -38,7 +38,7 @@ void cpu_loop_exit(CPUState *cpu)
cpu->neg.can_do_io = true;
/* Undo any setting in generated code. */
qemu_plugin_disable_mem_helpers(cpu);
- siglongjmp(cpu->jmp_env, 1);
+ siglongjmp(cpu->accel->jmp_env, 1);
}
void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
@@ -553,7 +553,7 @@ static void cpu_exec_longjmp_cleanup(CPUState *cpu)
* support such a thing. We'd have to properly register unwind info
* for the JIT for EH, rather that just for GDB.
*
- * Alternative 2: Set and restore cpu->jmp_env in tb_gen_code to
+ * Alternative 2: Set and restore cpu->accel->jmp_env in tb_gen_code to
* capture the cpu_loop_exit longjmp, perform the cleanup, and
* jump again to arrive here.
*/
@@ -577,7 +577,7 @@ void cpu_exec_step_atomic(CPUState *cpu)
uint32_t flags, cflags;
int tb_exit;
- if (sigsetjmp(cpu->jmp_env, 0) == 0) {
+ if (sigsetjmp(cpu->accel->jmp_env, 0) == 0) {
start_exclusive();
g_assert(cpu == current_cpu);
g_assert(!cpu->running);
@@ -1038,7 +1038,7 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc)
static int cpu_exec_setjmp(CPUState *cpu, SyncClocks *sc)
{
/* Prepare setjmp context for exception handling. */
- if (unlikely(sigsetjmp(cpu->jmp_env, 0) != 0)) {
+ if (unlikely(sigsetjmp(cpu->accel->jmp_env, 0) != 0)) {
cpu_exec_longjmp_cleanup(cpu);
}