diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-03-29 19:13:09 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-06-28 13:55:35 +0200 |
commit | 642ce52d8ea9e1f80aa6013ad55bb66e51f1c76e (patch) | |
tree | 87e83eb4cb639d5b560a91be4d49701966e6524e /target | |
parent | f861b3f39063619b2d169cbacf455a00c22a1584 (diff) | |
download | qemu-642ce52d8ea9e1f80aa6013ad55bb66e51f1c76e.zip qemu-642ce52d8ea9e1f80aa6013ad55bb66e51f1c76e.tar.gz qemu-642ce52d8ea9e1f80aa6013ad55bb66e51f1c76e.tar.bz2 |
accel: Move HAX hThread to accelerator context
hThread variable is only used by the HAX accelerator,
so move it to the accelerator specific context.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230624174121.11508-9-philmd@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/i386/hax/hax-accel-ops.c | 2 | ||||
-rw-r--r-- | target/i386/hax/hax-all.c | 2 | ||||
-rw-r--r-- | target/i386/hax/hax-i386.h | 3 | ||||
-rw-r--r-- | target/i386/hax/hax-windows.c | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/target/i386/hax/hax-accel-ops.c b/target/i386/hax/hax-accel-ops.c index a8512ef..5031096 100644 --- a/target/i386/hax/hax-accel-ops.c +++ b/target/i386/hax/hax-accel-ops.c @@ -73,7 +73,7 @@ static void hax_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); assert(cpu->accel); #ifdef _WIN32 - cpu->hThread = qemu_thread_get_handle(cpu->thread); + cpu->accel->hThread = qemu_thread_get_handle(cpu->thread); #endif } diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c index 9d9011c..18d78e5 100644 --- a/target/i386/hax/hax-all.c +++ b/target/i386/hax/hax-all.c @@ -206,7 +206,7 @@ int hax_vcpu_destroy(CPUState *cpu) hax_close_fd(vcpu->fd); hax_global.vm->vcpus[vcpu->vcpu_id] = NULL; #ifdef _WIN32 - CloseHandle(cpu->hThread); + CloseHandle(vcpu->hThread); #endif g_free(vcpu); cpu->accel = NULL; diff --git a/target/i386/hax/hax-i386.h b/target/i386/hax/hax-i386.h index 4372ee5..87153f4 100644 --- a/target/i386/hax/hax-i386.h +++ b/target/i386/hax/hax-i386.h @@ -27,6 +27,9 @@ typedef HANDLE hax_fd; extern struct hax_state hax_global; struct AccelCPUState { +#ifdef _WIN32 + HANDLE hThread; +#endif hax_fd fd; int vcpu_id; struct hax_tunnel *tunnel; diff --git a/target/i386/hax/hax-windows.c b/target/i386/hax/hax-windows.c index bf4b0ad..4bf6cc0 100644 --- a/target/i386/hax/hax-windows.c +++ b/target/i386/hax/hax-windows.c @@ -476,7 +476,7 @@ void hax_kick_vcpu_thread(CPUState *cpu) */ cpu->exit_request = 1; if (!qemu_cpu_is_self(cpu)) { - if (!QueueUserAPC(dummy_apc_func, cpu->hThread, 0)) { + if (!QueueUserAPC(dummy_apc_func, cpu->accel->hThread, 0)) { fprintf(stderr, "%s: QueueUserAPC failed with error %lu\n", __func__, GetLastError()); exit(1); |