mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
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>
This commit is contained in:
parent
f861b3f390
commit
642ce52d8e
5 changed files with 6 additions and 4 deletions
|
@ -338,7 +338,6 @@ struct CPUState {
|
||||||
|
|
||||||
struct QemuThread *thread;
|
struct QemuThread *thread;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HANDLE hThread;
|
|
||||||
QemuSemaphore sem;
|
QemuSemaphore sem;
|
||||||
#endif
|
#endif
|
||||||
int thread_id;
|
int thread_id;
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void hax_start_vcpu_thread(CPUState *cpu)
|
||||||
cpu, QEMU_THREAD_JOINABLE);
|
cpu, QEMU_THREAD_JOINABLE);
|
||||||
assert(cpu->accel);
|
assert(cpu->accel);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
cpu->hThread = qemu_thread_get_handle(cpu->thread);
|
cpu->accel->hThread = qemu_thread_get_handle(cpu->thread);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ int hax_vcpu_destroy(CPUState *cpu)
|
||||||
hax_close_fd(vcpu->fd);
|
hax_close_fd(vcpu->fd);
|
||||||
hax_global.vm->vcpus[vcpu->vcpu_id] = NULL;
|
hax_global.vm->vcpus[vcpu->vcpu_id] = NULL;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
CloseHandle(cpu->hThread);
|
CloseHandle(vcpu->hThread);
|
||||||
#endif
|
#endif
|
||||||
g_free(vcpu);
|
g_free(vcpu);
|
||||||
cpu->accel = NULL;
|
cpu->accel = NULL;
|
||||||
|
|
|
@ -27,6 +27,9 @@ typedef HANDLE hax_fd;
|
||||||
extern struct hax_state hax_global;
|
extern struct hax_state hax_global;
|
||||||
|
|
||||||
struct AccelCPUState {
|
struct AccelCPUState {
|
||||||
|
#ifdef _WIN32
|
||||||
|
HANDLE hThread;
|
||||||
|
#endif
|
||||||
hax_fd fd;
|
hax_fd fd;
|
||||||
int vcpu_id;
|
int vcpu_id;
|
||||||
struct hax_tunnel *tunnel;
|
struct hax_tunnel *tunnel;
|
||||||
|
|
|
@ -476,7 +476,7 @@ void hax_kick_vcpu_thread(CPUState *cpu)
|
||||||
*/
|
*/
|
||||||
cpu->exit_request = 1;
|
cpu->exit_request = 1;
|
||||||
if (!qemu_cpu_is_self(cpu)) {
|
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",
|
fprintf(stderr, "%s: QueueUserAPC failed with error %lu\n",
|
||||||
__func__, GetLastError());
|
__func__, GetLastError());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue