[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 05/19] cpu: Introduce AccelvCPUState opaque structure
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 05/19] cpu: Introduce AccelvCPUState opaque structure |
Date: |
Wed, 3 Mar 2021 19:22:05 +0100 |
Introduce the opaque 'AccelvCPUState' structure which will
be declared by each accelerator. Forward-declare it in "cpu.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/hw/core/cpu.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 074199ce73c..d807645af2b 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -274,6 +274,9 @@ struct qemu_work_item;
#define CPU_UNSET_NUMA_NODE_ID -1
#define CPU_TRACE_DSTATE_MAX_EVENTS 32
+/* This structure is defined by each accelerator. */
+struct AccelvCPUState;
+
/**
* CPUState:
* @cpu_index: CPU index (informative).
@@ -312,6 +315,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_vcpu: Pointer to accelerator-specific AccelvCPUState field.
* @kvm_fd: vCPU file descriptor for KVM.
* @work_mutex: Lock to prevent multiple access to @work_list.
* @work_list: List of pending asynchronous work.
@@ -413,6 +417,7 @@ struct CPUState {
int32_t exception_index;
/* Accelerator-specific fields. */
+ struct AccelvCPUState *accel_vcpu;
int kvm_fd;
struct KVMState *kvm_state;
struct kvm_run *kvm_run;
--
2.26.2
- [RFC PATCH 00/19] accel: Introduce AccelvCPUState opaque structure, Philippe Mathieu-Daudé, 2021/03/03
- [PATCH 01/19] target/i386/hvf: Use boolean value for vcpu_dirty, Philippe Mathieu-Daudé, 2021/03/03
- [PATCH 02/19] target/s390x/kvm: Simplify debug code, Philippe Mathieu-Daudé, 2021/03/03
- [PATCH 03/19] target/s390x/kvm: Reduce deref by declaring 'struct kvm_run' on stack, Philippe Mathieu-Daudé, 2021/03/03
- [PATCH 04/19] cpu: Croup accelerator-specific fields altogether, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 05/19] cpu: Introduce AccelvCPUState opaque structure,
Philippe Mathieu-Daudé <=
- [RFC PATCH 06/19] accel/whpx: Add typedef for 'struct whpx_vcpu', Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 07/19] accel/whpx: Rename struct whpx_vcpu -> AccelvCPUState, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 08/19] accel/whpx: Use 'accel_vcpu' generic pointer, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 09/19] accel/hax: Add typedef for 'struct hax_vcpu_state', Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 10/19] accel/hax: Use 'accel_vcpu' generic pointer, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 11/19] accel/kvm: Introduce kvm_vcpu_state() helper, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 13/19] accel/kvm: Declare and allocate AccelvCPUState struct, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 12/19] accel/kvm: Use kvm_vcpu_state() when possible, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 14/19] accel/kvm: Move the 'kvm_fd' field to AccelvCPUState, Philippe Mathieu-Daudé, 2021/03/03
- [RFC PATCH 15/19] accel/kvm: Move the 'kvm_state' field to AccelvCPUState, Philippe Mathieu-Daudé, 2021/03/03