[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v1 01/10] i386: move kvm accel files into accel/kvm/
From: |
Claudio Fontana |
Subject: |
[RFC v1 01/10] i386: move kvm accel files into accel/kvm/ |
Date: |
Mon, 9 Nov 2020 18:27:46 +0100 |
Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
MAINTAINERS | 2 +-
hw/i386/fw_cfg.c | 2 +-
hw/i386/intel_iommu.c | 2 +-
hw/i386/kvm/apic.c | 2 +-
hw/i386/kvm/clock.c | 2 +-
hw/i386/microvm.c | 2 +-
hw/i386/pc.c | 2 +-
hw/i386/x86.c | 2 +-
meson.build | 1 +
target/i386/{ => accel/kvm}/hyperv-proto.h | 0
target/i386/{ => accel/kvm}/hyperv-stub.c | 0
target/i386/{ => accel/kvm}/hyperv.c | 0
target/i386/{ => accel/kvm}/hyperv.h | 0
target/i386/{ => accel/kvm}/kvm-stub.c | 0
target/i386/{ => accel/kvm}/kvm.c | 0
target/i386/{ => accel/kvm}/kvm_i386.h | 0
target/i386/accel/kvm/meson.build | 3 +++
target/i386/accel/kvm/trace-events | 7 +++++++
target/i386/accel/kvm/trace.h | 1 +
target/i386/cpu.c | 2 +-
target/i386/cpu.h | 2 +-
target/i386/helper.c | 2 +-
target/i386/machine.c | 4 ++--
target/i386/meson.build | 4 +---
target/i386/trace-events | 6 ------
25 files changed, 26 insertions(+), 22 deletions(-)
rename target/i386/{ => accel/kvm}/hyperv-proto.h (100%)
rename target/i386/{ => accel/kvm}/hyperv-stub.c (100%)
rename target/i386/{ => accel/kvm}/hyperv.c (100%)
rename target/i386/{ => accel/kvm}/hyperv.h (100%)
rename target/i386/{ => accel/kvm}/kvm-stub.c (100%)
rename target/i386/{ => accel/kvm}/kvm.c (100%)
rename target/i386/{ => accel/kvm}/kvm_i386.h (100%)
create mode 100644 target/i386/accel/kvm/meson.build
create mode 100644 target/i386/accel/kvm/trace-events
create mode 100644 target/i386/accel/kvm/trace.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 63223e1183..2ce9b36c02 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -420,7 +420,7 @@ M: Paolo Bonzini <pbonzini@redhat.com>
M: Marcelo Tosatti <mtosatti@redhat.com>
L: kvm@vger.kernel.org
S: Supported
-F: target/i386/kvm.c
+F: target/i386/accel/kvm/
F: scripts/kvm/vmxcap
Guest CPU Cores (other accelerators)
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index e06579490c..4d5ea83601 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -21,7 +21,7 @@
#include "hw/timer/hpet.h"
#include "hw/nvram/fw_cfg.h"
#include "e820_memory_layout.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#include CONFIG_DEVICES
struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 70ac837733..6a086173dc 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -37,7 +37,7 @@
#include "sysemu/kvm.h"
#include "sysemu/sysemu.h"
#include "hw/i386/apic_internal.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#include "migration/vmstate.h"
#include "trace.h"
diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c
index dd29906061..a04593d80d 100644
--- a/hw/i386/kvm/apic.c
+++ b/hw/i386/kvm/apic.c
@@ -17,7 +17,7 @@
#include "hw/pci/msi.h"
#include "sysemu/hw_accel.h"
#include "sysemu/kvm.h"
-#include "target/i386/kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
static inline void kvm_apic_set_reg(struct kvm_lapic_state *kapic,
int reg_id, uint32_t val)
diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
index 24fe5091b6..bd590f8ff2 100644
--- a/hw/i386/kvm/clock.c
+++ b/hw/i386/kvm/clock.c
@@ -20,7 +20,7 @@
#include "sysemu/kvm.h"
#include "sysemu/runstate.h"
#include "sysemu/hw_accel.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#include "migration/vmstate.h"
#include "hw/sysbus.h"
#include "hw/kvm/clock.h"
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 5428448b70..63712fff0a 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -51,7 +51,7 @@
#include "cpu.h"
#include "elf.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#include "hw/xen/start_info.h"
#define MICROVM_QBOOT_FILENAME "qboot.rom"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 5e6c0023e0..f19b3f357b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -61,7 +61,7 @@
#include "sysemu/qtest.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#include "hw/xen/xen.h"
#include "hw/xen/start_info.h"
#include "ui/qemu-spice.h"
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 5944fc44ed..71bc925ba5 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -52,7 +52,7 @@
#include "elf.h"
#include "standard-headers/asm-x86/bootparam.h"
#include CONFIG_DEVICES
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#define BIOS_FILENAME "bios.bin"
diff --git a/meson.build b/meson.build
index 39ac5cf6d8..eedf6d3f0f 100644
--- a/meson.build
+++ b/meson.build
@@ -1442,6 +1442,7 @@ trace_events_subdirs += [
'target/arm',
'target/hppa',
'target/i386',
+ 'target/i386/accel/kvm',
'target/mips',
'target/ppc',
'target/riscv',
diff --git a/target/i386/hyperv-proto.h b/target/i386/accel/kvm/hyperv-proto.h
similarity index 100%
rename from target/i386/hyperv-proto.h
rename to target/i386/accel/kvm/hyperv-proto.h
diff --git a/target/i386/hyperv-stub.c b/target/i386/accel/kvm/hyperv-stub.c
similarity index 100%
rename from target/i386/hyperv-stub.c
rename to target/i386/accel/kvm/hyperv-stub.c
diff --git a/target/i386/hyperv.c b/target/i386/accel/kvm/hyperv.c
similarity index 100%
rename from target/i386/hyperv.c
rename to target/i386/accel/kvm/hyperv.c
diff --git a/target/i386/hyperv.h b/target/i386/accel/kvm/hyperv.h
similarity index 100%
rename from target/i386/hyperv.h
rename to target/i386/accel/kvm/hyperv.h
diff --git a/target/i386/kvm-stub.c b/target/i386/accel/kvm/kvm-stub.c
similarity index 100%
rename from target/i386/kvm-stub.c
rename to target/i386/accel/kvm/kvm-stub.c
diff --git a/target/i386/kvm.c b/target/i386/accel/kvm/kvm.c
similarity index 100%
rename from target/i386/kvm.c
rename to target/i386/accel/kvm/kvm.c
diff --git a/target/i386/kvm_i386.h b/target/i386/accel/kvm/kvm_i386.h
similarity index 100%
rename from target/i386/kvm_i386.h
rename to target/i386/accel/kvm/kvm_i386.h
diff --git a/target/i386/accel/kvm/meson.build
b/target/i386/accel/kvm/meson.build
new file mode 100644
index 0000000000..1d66559187
--- /dev/null
+++ b/target/i386/accel/kvm/meson.build
@@ -0,0 +1,3 @@
+i386_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c'))
+i386_softmmu_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'))
+i386_softmmu_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'),
if_false: files('hyperv-stub.c'))
diff --git a/target/i386/accel/kvm/trace-events
b/target/i386/accel/kvm/trace-events
new file mode 100644
index 0000000000..b4e2d9e4ea
--- /dev/null
+++ b/target/i386/accel/kvm/trace-events
@@ -0,0 +1,7 @@
+# See docs/devel/tracing.txt for syntax documentation.
+
+# kvm.c
+kvm_x86_fixup_msi_error(uint32_t gsi) "VT-d failed to remap interrupt for GSI
%" PRIu32
+kvm_x86_add_msi_route(int virq) "Adding route entry for virq %d"
+kvm_x86_remove_msi_route(int virq) "Removing route entry for virq %d"
+kvm_x86_update_msi_routes(int num) "Updated %d MSI routes"
diff --git a/target/i386/accel/kvm/trace.h b/target/i386/accel/kvm/trace.h
new file mode 100644
index 0000000000..c82019982f
--- /dev/null
+++ b/target/i386/accel/kvm/trace.h
@@ -0,0 +1 @@
+#include "trace/trace-target_i386_accel_kvm.h"
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 0d8606958e..b1a55a2b79 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -30,7 +30,7 @@
#include "sysemu/hvf.h"
#include "sysemu/cpus.h"
#include "sysemu/xen.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#include "sev_i386.h"
#include "qemu/error-report.h"
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 51c1d5f60a..d1f4c2fd2c 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -22,7 +22,7 @@
#include "sysemu/tcg.h"
#include "cpu-qom.h"
-#include "hyperv-proto.h"
+#include "accel/kvm/hyperv-proto.h"
#include "exec/cpu-defs.h"
#include "qapi/qapi-types-common.h"
diff --git a/target/i386/helper.c b/target/i386/helper.c
index 32fa21a7bb..25f2bf3137 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -24,7 +24,7 @@
#include "qemu/qemu-print.h"
#include "sysemu/kvm.h"
#include "sysemu/runstate.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#ifndef CONFIG_USER_ONLY
#include "sysemu/tcg.h"
#include "sysemu/hw_accel.h"
diff --git a/target/i386/machine.c b/target/i386/machine.c
index 233e46bb70..aef1fd4aa7 100644
--- a/target/i386/machine.c
+++ b/target/i386/machine.c
@@ -3,9 +3,9 @@
#include "exec/exec-all.h"
#include "hw/isa/isa.h"
#include "migration/cpu.h"
-#include "hyperv.h"
+#include "accel/kvm/hyperv.h"
#include "hw/i386/x86.h"
-#include "kvm_i386.h"
+#include "accel/kvm/kvm_i386.h"
#include "sysemu/kvm.h"
#include "sysemu/tcg.h"
diff --git a/target/i386/meson.build b/target/i386/meson.build
index a1a02f3e99..629939b195 100644
--- a/target/i386/meson.build
+++ b/target/i386/meson.build
@@ -18,7 +18,6 @@ i386_ss.add(when: 'CONFIG_TCG', if_true: files(
'smm_helper.c',
'svm_helper.c',
'translate.c'), if_false: files('tcg-stub.c'))
-i386_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c'))
i386_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'), if_false:
files('sev-stub.c'))
i386_softmmu_ss = ss.source_set()
@@ -28,8 +27,6 @@ i386_softmmu_ss.add(files(
'machine.c',
'monitor.c',
))
-i386_softmmu_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'),
if_false: files('hyperv-stub.c'))
-i386_softmmu_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'))
i386_softmmu_ss.add(when: 'CONFIG_WHPX', if_true: files(
'whpx-all.c',
'whpx-cpus.c',
@@ -42,6 +39,7 @@ i386_softmmu_ss.add(when: 'CONFIG_HAX', if_true: files(
i386_softmmu_ss.add(when: ['CONFIG_HAX', 'CONFIG_POSIX'], if_true:
files('hax-posix.c'))
i386_softmmu_ss.add(when: ['CONFIG_HAX', 'CONFIG_WIN32'], if_true:
files('hax-windows.c'))
+subdir('accel/kvm')
subdir('hvf')
target_arch += {'i386': i386_ss}
diff --git a/target/i386/trace-events b/target/i386/trace-events
index 789c700d4a..d166f9d5e0 100644
--- a/target/i386/trace-events
+++ b/target/i386/trace-events
@@ -1,11 +1,5 @@
# See docs/devel/tracing.txt for syntax documentation.
-# kvm.c
-kvm_x86_fixup_msi_error(uint32_t gsi) "VT-d failed to remap interrupt for GSI
%" PRIu32
-kvm_x86_add_msi_route(int virq) "Adding route entry for virq %d"
-kvm_x86_remove_msi_route(int virq) "Removing route entry for virq %d"
-kvm_x86_update_msi_routes(int num) "Updated %d MSI routes"
-
# sev.c
kvm_sev_init(void) ""
kvm_memcrypt_register_region(void *addr, size_t len) "addr %p len 0x%zu"
--
2.26.2
- [RFC v1 00/10] i386 cleanup, Claudio Fontana, 2020/11/09
- [RFC v1 02/10] i386: move whpx accel files to accel/whpx/, Claudio Fontana, 2020/11/09
- [RFC v1 03/10] i386: move hax accel files to accel/hax/, Claudio Fontana, 2020/11/09
- [RFC v1 01/10] i386: move kvm accel files into accel/kvm/,
Claudio Fontana <=
- [RFC v1 04/10] i386: move hvf accel files into accel/hvf/, Claudio Fontana, 2020/11/09
- [RFC v1 05/10] i386: move TCG accel files into accel/tcg/, Claudio Fontana, 2020/11/09
- [RFC v1 08/10] module: introduce MODULE_INIT_ACCEL_CPU, Claudio Fontana, 2020/11/09
- [RFC v1 07/10] i386: move TCG cpu class initialization out of helper.c, Claudio Fontana, 2020/11/09
- [RFC v1 06/10] i386: move cpu dump out of helper.c into cpu-dump.c, Claudio Fontana, 2020/11/09
- [RFC v1 09/10] i386: split cpu.c and defer x86 models registration, Claudio Fontana, 2020/11/09