[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC/PATCH v0 10/12] gunyah: CPU execution loop
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [RFC/PATCH v0 10/12] gunyah: CPU execution loop |
Date: |
Thu, 12 Oct 2023 06:43:38 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 |
On 11/10/23 18:52, Srivatsa Vaddagiri wrote:
Complete the cpu execution loop. At this time, we recognize exits
associated with only MMIO access. Future patches will add support for
recognizing other exit reasons, such as PSCI calls made by guest.
Signed-off-by: Srivatsa Vaddagiri <quic_svaddagi@quicinc.com>
---
accel/gunyah/gunyah-accel-ops.c | 1 +
accel/gunyah/gunyah-all.c | 216 ++++++++++++++++++++++++++++++--
include/hw/core/cpu.h | 6 +
include/sysemu/gunyah.h | 1 +
include/sysemu/gunyah_int.h | 3 +
target/arm/gunyah.c | 13 ++
6 files changed, 229 insertions(+), 11 deletions(-)
@@ -110,17 +125,6 @@ int gunyah_create_vm(void)
return 0;
}
-void *gunyah_cpu_thread_fn(void *arg)
-{
- CPUState *cpu = arg;
-
- do {
- /* Do nothing */
- } while (!cpu->unplug || cpu_can_run(cpu));
-
- return NULL;
-}
This diff could be nicer if you define gunyah_cpu_thread_fn()
in the final place in previous patches, so you don't need to
move it here.
#define gunyah_slots_lock(s) qemu_mutex_lock(&s->slots_lock)
#define gunyah_slots_unlock(s) qemu_mutex_unlock(&s->slots_lock)
[...]
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index fdcbe87352..b3901e134d 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -240,6 +240,7 @@ typedef struct SavedIOTLB {
struct KVMState;
struct kvm_run;
+struct gh_vcpu_run;
/* work queue */
@@ -443,6 +444,11 @@ struct CPUState {
/* track IOMMUs whose translations we've cached in the TCG TLB */
GArray *iommu_notifiers;
+
+ struct {
+ int fd;
+ struct gh_vcpu_run *run;
+ } gunyah;
NACK. Please declare as struct AccelCPUState in gunyah_int.h.
};
- [RFC/PATCH v0 00/12] Gunyah hypervisor support, Srivatsa Vaddagiri, 2023/10/11
- [RFC/PATCH v0 08/12] gunyah: Specific device-tree location, Srivatsa Vaddagiri, 2023/10/11
- [RFC/PATCH v0 09/12] gunyah: Customize device-tree, Srivatsa Vaddagiri, 2023/10/11
- [RFC/PATCH v0 10/12] gunyah: CPU execution loop, Srivatsa Vaddagiri, 2023/10/11
- Re: [RFC/PATCH v0 10/12] gunyah: CPU execution loop,
Philippe Mathieu-Daudé <=
- [RFC/PATCH v0 11/12] gunyah: Workarounds (NOT FOR MERGE), Srivatsa Vaddagiri, 2023/10/11
- [RFC/PATCH v0 02/12] update-linux-headers: Include gunyah.h, Srivatsa Vaddagiri, 2023/10/11
- [RFC/PATCH v0 03/12] gunyah: Basic support, Srivatsa Vaddagiri, 2023/10/11
- [RFC/PATCH v0 04/12] gunyah: Add VM properties, Srivatsa Vaddagiri, 2023/10/11
- [RFC/PATCH v0 07/12] gunyah: Add gicv3 interrupt controller, Srivatsa Vaddagiri, 2023/10/11