[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/20] target/riscv: move KVM only files to kvm subdir
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 12/20] target/riscv: move KVM only files to kvm subdir |
Date: |
Mon, 28 Aug 2023 18:47:31 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 |
On 25/8/23 15:08, Daniel Henrique Barboza wrote:
Move the files to a 'kvm' dir to promote more code separation between
accelerators and making our lives easier supporting build options such
as --disable-tcg.
Rename kvm.c to kvm-cpu.c to keep it in line with its TCG counterpart.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
hw/riscv/virt.c | 2 +-
target/riscv/cpu.c | 2 +-
target/riscv/{kvm.c => kvm/kvm-cpu.c} | 0
target/riscv/{ => kvm}/kvm-stub.c | 0
target/riscv/{ => kvm}/kvm_riscv.h | 0
target/riscv/kvm/meson.build | 2 ++
target/riscv/meson.build | 2 +-
7 files changed, 5 insertions(+), 3 deletions(-)
rename target/riscv/{kvm.c => kvm/kvm-cpu.c} (100%)
rename target/riscv/{ => kvm}/kvm-stub.c (100%)
rename target/riscv/{ => kvm}/kvm_riscv.h (100%)
create mode 100644 target/riscv/kvm/meson.build
+++ b/target/riscv/kvm/meson.build
@@ -0,0 +1,2 @@
+riscv_ss.add(when: 'CONFIG_KVM', if_true: files('kvm-cpu.c'),
+ if_false: files('kvm-stub.c'))
Hmm maybe we need to add:
-- >8 --
diff --git a/include/hw/core/accel-cpu.h b/include/hw/core/accel-cpu.h
index 5dbfd79955..65973b6f2e 100644
--- a/include/hw/core/accel-cpu.h
+++ b/include/hw/core/accel-cpu.h
@@ -33,6 +33,7 @@ typedef struct AccelCPUClass {
void (*cpu_class_init)(CPUClass *cc);
void (*cpu_instance_init)(CPUState *cpu);
bool (*cpu_realizefn)(CPUState *cpu, Error **errp);
+ ResettablePhases cpu_reset;
} AccelCPUClass;
---
and here:
static void kvm_cpu_accel_class_init(ObjectClass *oc, void *data)
{
AccelCPUClass *acc = ACCEL_CPU_CLASS(oc);
acc->cpu_instance_init = kvm_cpu_instance_init;
+ acc->cpu_reset.hold = kvm_riscv_reset_vcpu;
}
so then calling some accel_cpu_reset_hold() in riscv_cpu_reset_hold(),
would call kvm_riscv_reset_vcpu() and we can remove kvm-stub.c.
- [PATCH 08/20] target/riscv: move 'host' CPU declaration to kvm.c, (continued)
- [PATCH 08/20] target/riscv: move 'host' CPU declaration to kvm.c, Daniel Henrique Barboza, 2023/08/25
- [PATCH 10/20] target/riscv: move riscv_cpu_add_kvm_properties() to kvm.c, Daniel Henrique Barboza, 2023/08/25
- [PATCH 11/20] target/riscv: introduce KVM AccelCPUClass, Daniel Henrique Barboza, 2023/08/25
- [PATCH 12/20] target/riscv: move KVM only files to kvm subdir, Daniel Henrique Barboza, 2023/08/25
- Re: [PATCH 12/20] target/riscv: move KVM only files to kvm subdir,
Philippe Mathieu-Daudé <=
- Re: [PATCH 12/20] target/riscv: move KVM only files to kvm subdir, Andrew Jones, 2023/08/31
- [PATCH 13/20] target/riscv/kvm: refactor kvm_riscv_init_user_properties(), Daniel Henrique Barboza, 2023/08/25
- [PATCH 14/20] target/riscv/kvm: do not use riscv_cpu_add_misa_properties(), Daniel Henrique Barboza, 2023/08/25
- [PATCH 15/20] target/riscv/tcg: introduce tcg_cpu_instance_init(), Daniel Henrique Barboza, 2023/08/25
- [PATCH 16/20] target/riscv/tcg: move riscv_cpu_add_misa_properties() to tcg-cpu.c, Daniel Henrique Barboza, 2023/08/25