From f861b3f39063619b2d169cbacf455a00c22a1584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 29 Mar 2023 19:01:49 +0200 Subject: accel: Rename HAX 'struct hax_vcpu_state' -> AccelCPUState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want all accelerators to share the same opaque pointer in CPUState. Start with the HAX context, renaming its forward declarated structure 'hax_vcpu_state' as 'AccelCPUState'. Document the CPUState field. Directly use the typedef. Remove the amusing but now unnecessary casts in NVMM / WHPX. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230624174121.11508-8-philmd@linaro.org> --- include/hw/core/cpu.h | 5 ++--- include/qemu/typedefs.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 63c25ce106..45e30911e7 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -241,7 +241,6 @@ typedef struct SavedIOTLB { struct KVMState; struct kvm_run; -struct hax_vcpu_state; struct hvf_vcpu_state; /* work queue */ @@ -309,6 +308,7 @@ struct qemu_work_item; * @next_cpu: Next CPU sharing TB cache. * @opaque: User data. * @mem_io_pc: Host Program Counter at which the memory was accessed. + * @accel: Pointer to accelerator specific state. * @kvm_fd: vCPU file descriptor for KVM. * @work_mutex: Lock to prevent multiple access to @work_list. * @work_list: List of pending asynchronous work. @@ -424,6 +424,7 @@ struct CPUState { uint32_t can_do_io; int32_t exception_index; + AccelCPUState *accel; /* shared by kvm, hax and hvf */ bool vcpu_dirty; @@ -443,8 +444,6 @@ struct CPUState { /* Used for user-only emulation of prctl(PR_SET_UNALIGN). */ bool prctl_unalign_sigbus; - struct hax_vcpu_state *accel; - struct hvf_vcpu_state *hvf; /* track IOMMUs whose translations we've cached in the TCG TLB */ diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 8c1840bfc1..834b0e47a0 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -21,6 +21,7 @@ * Incomplete struct types * Please keep this list in case-insensitive alphabetical order. */ +typedef struct AccelCPUState AccelCPUState; typedef struct AccelState AccelState; typedef struct AdapterInfo AdapterInfo; typedef struct AddressSpace AddressSpace; -- cgit v1.2.3