tcg: split the tcg code and separate tcg files
v3 cover tcg: split the tcg code and separate tcg files
In order to disable tcg, the first phase is to split some tcg code and separate those tcg related files into one directory. The next phase will disable tcg more easily and cleanly.
In the first phase, there are four patches to deal with split code and separate files.
1)split the tcg exec code.
a)split the tcg accelerators from accel.c file and re-name
tcg accelerator to tcg-all.c, like kvm-all.c did.
b)create one accel directory, which will include kvm,
tcg and general exec files.
2)move cputlb.c, cpu-exec-common.c and cpu-exec.c related tcg
exec file into accel/tcg/ subdirectory.
3)move tcg related backend files into accel/tcg/ directory
those files include translate-all.(ch), translate-common.c, tci.c and tcg-runtime.c.
4)move kvm and exec.c file.
a)move kvm related accelerator files into accel/kvm/ directory. b)move exec.c in accel/ directory.
c)stubs/ directory was created for kvm and tcg stub files.
after those changes are done, the file tree like below accel
├── accel.c
├── exec.c
├── kvm
│ ├── kvm-all.c
│ ├── Makefile.objs
│ └── trace-events
├── Makefile.objs
├── stubs
│ ├── kvm-stub.c
│ └── Makefile.objs
└── tcg
├── cpu-exec.c
├── cpu-exec-common.c
├── cputlb.c
├── Makefile.objs
├── tcg-all.c
├── tcg-runtime.c
├── tci.c
├── trace-events
├── translate-all.c
├── translate-all.h
└── translate-common.c3 directories, 19 files
v3: squash patches and move tcg related backend files to accel/tcg/
according to Paolo's comments.
add kvm and tcg exec related patches into one patchset.
Yang Zhong (4):
accel: split the tcg accelerator from accel.c file
tcg: move tcg related files into accel/tcg/ subdirectory
tcg: move tcg backend files into accel/tcg/
accel: move kvm related accelerator files into accel/
Makefile.objs | 3 +- Makefile.target | 10 +--- accel/Makefile.objs | 5 ++ accel.c => accel/accel.c | 27 ---------- exec.c => accel/exec.c | 0 accel/kvm/Makefile.objs | 1 + kvm-all.c => accel/kvm/kvm-all.c | 2 +- accel/kvm/trace-events | 13 +++++ accel/stubs/Makefile.objs | 1 + kvm-stub.c => accel/stubs/kvm-stub.c | 0 accel/tcg/Makefile.objs | 4 ++ cpu-exec-common.c => accel/tcg/cpu-exec-common.c | 0 cpu-exec.c => accel/tcg/cpu-exec.c | 2 +- cputlb.c => accel/tcg/cputlb.c | 0 accel/tcg/tcg-all.c | 61 ++++++++++++++++++++++ tcg-runtime.c => accel/tcg/tcg-runtime.c | 0 tci.c => accel/tcg/tci.c | 0 accel/tcg/trace-events | 10 ++++ translate-all.c => accel/tcg/translate-all.c | 2 +- translate-all.h => accel/tcg/translate-all.h | 0 translate-common.c => accel/tcg/translate-common.c | 0 configure | 2 +- trace-events | 21 -------- 23 files changed, 103 insertions(+), 61 deletions(-) create mode 100644 accel/Makefile.objs rename accel.c => accel/accel.c (87%) rename exec.c => accel/exec.c (100%) create mode 100644 accel/kvm/Makefile.objs rename kvm-all.c => accel/kvm/kvm-all.c (99%) create mode 100644 accel/kvm/trace-events create mode 100644 accel/stubs/Makefile.objs rename kvm-stub.c => accel/stubs/kvm-stub.c (100%) create mode 100644 accel/tcg/Makefile.objs rename cpu-exec-common.c => accel/tcg/cpu-exec-common.c (100%) rename cpu-exec.c => accel/tcg/cpu-exec.c (99%) rename cputlb.c => accel/tcg/cputlb.c (100%) create mode 100644 accel/tcg/tcg-all.c rename tcg-runtime.c => accel/tcg/tcg-runtime.c (100%) rename tci.c => accel/tcg/tci.c (100%) create mode 100644 accel/tcg/trace-events rename translate-all.c => accel/tcg/translate-all.c (99%) rename translate-all.h => accel/tcg/translate-all.h (100%) rename translate-common.c => accel/tcg/translate-common.c (100%)
Signature · 1 line
1.9.1
PATCH v3 3/4 tcg: move tcg backend files into accel/tcg/
move tcg-runtime.c, translate-all.(ch) and translate-common.c into accel/tcg/ subdirectory and updated related trace-events file.
--- Makefile.target | 5 +---- accel/tcg/Makefile.objs | 3 ++- tcg-runtime.c => accel/tcg/tcg-runtime.c | 0 tci.c => accel/tcg/tci.c | 0 accel/tcg/trace-events | 3 +++ translate-all.c => accel/tcg/translate-all.c | 2 +- translate-all.h => accel/tcg/translate-all.h | 0 translate-common.c => accel/tcg/translate-common.c | 0 configure | 2 +- trace-events | 4 ---- 10 files changed, 8 insertions(+), 11 deletions(-) rename tcg-runtime.c => accel/tcg/tcg-runtime.c (100%) rename tci.c => accel/tcg/tci.c (100%) rename translate-all.c => accel/tcg/translate-all.c (99%) rename translate-all.h => accel/tcg/translate-all.h (100%) rename translate-common.c => accel/tcg/translate-common.c (100%)
Makefile.target +1 -4
@@ -88,17 +88,14 @@ all: $(PROGS) stap ######################################################### # cpu emulator library -obj-y = exec.o translate-all.o +obj-y = exec.o obj-y += accel/ -obj-y += translate-common.o obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o -obj-$(CONFIG_TCG_INTERPRETER) += tci.o obj-y += tcg/tcg-common.o obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o obj-y += fpu/softfloat.o obj-y += target/$(TARGET_BASE_ARCH)/ obj-y += disas.o -obj-y += tcg-runtime.o obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
accel/tcg/Makefile.objs +2 -1
@@ -1,3 +1,4 @@ obj-$(CONFIG_SOFTMMU) += tcg-all.o obj-$(CONFIG_SOFTMMU) += cputlb.o -obj-y += cpu-exec.o cpu-exec-common.o +obj-y += cpu-exec.o cpu-exec-common.o tcg-runtime.o translate-all.o translate-common.o +obj-$(CONFIG_TCG_INTERPRETER) += tci.o
accel/tcg/tcg-runtime.c renamed from tcg-runtime.c +0 -0
accel/tcg/tci.c renamed from tci.c +0 -0
accel/tcg/trace-events +3 -0
@@ -5,3 +5,6 @@ disable exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR disable exec_tb_nocache(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR disable exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=%x" + +# translate-all.c +translate_block(void *tb, uintptr_t pc, uint8_t *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p"
accel/tcg/translate-all.c renamed from translate-all.c +1 -1
@@ -25,7 +25,7 @@#include "qemu-common.h" #define NO_CPU_IO_DEFS #include "cpu.h" -#include "trace-root.h" +#include "trace.h" #include "disas/disas.h" #include "exec/exec-all.h" #include "tcg.h"
accel/tcg/translate-all.h renamed from translate-all.h +0 -0
accel/tcg/translate-common.c renamed from translate-common.c +0 -0
configure +1 -1
@@ -402,7 +402,7 @@ QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" -QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include" +QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/accel/tcg -I\$(SRC_PATH)/include" if test "$debug_info" = "yes"; then CFLAGS="-g $CFLAGS" LDFLAGS="-g $LDFLAGS"
trace-events +0 -4
@@ -72,10 +72,6 @@ kvm_irqchip_commit_routes(void) "" kvm_irqchip_add_msi_route(int virq) "Adding MSI route virq=%d" kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d" -# TCG related tracing (mostly disabled by default) -# translate-all.c -translate_block(void *tb, uintptr_t pc, uint8_t *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p" - # memory.c memory_region_ops_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr %#"PRIx64" value %#"PRIx64" size %u" memory_region_ops_write(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr %#"PRIx64" value %#"PRIx64" size %u"
Signature · 1 line
1.9.1
PATCH v3 1/4 accel: split the tcg accelerator from accel.c file
In reply to Yang Zhongthere are some types of accelerators in qemu, and all accelerators have their own file except tcg. tcg accelerator is also defined in accel.c file. tcg accelerator file will be splited from accel.c and re-name to tcg-all.c. accel/ directory will be created to include kvm and tcg related files.
--- Makefile.objs | 1 - Makefile.target | 1 + accel/Makefile.objs | 2 ++ accel.c => accel/accel.c | 27 --------------------- accel/tcg/Makefile.objs | 1 + accel/tcg/tcg-all.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 28 deletions(-) create mode 100644 accel/Makefile.objs rename accel.c => accel/accel.c (87%) create mode 100644 accel/tcg/Makefile.objs create mode 100644 accel/tcg/tcg-all.c
Makefile.objs +0 -1
@@ -54,7 +54,6 @@ common-obj-$(CONFIG_SPICE) += spice-qemu-char.o common-obj-y += audio/ common-obj-y += hw/ -common-obj-y += accel.o common-obj-y += replay/
Makefile.target +1 -0
@@ -143,6 +143,7 @@ obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o obj-y += qtest.o bootdevice.o obj-y += hw/ obj-$(CONFIG_KVM) += kvm-all.o +obj-y += accel/ obj-y += memory.o cputlb.o obj-y += memory_mapping.o obj-y += dump.o
accel/Makefile.objs new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_SOFTMMU) += accel.o +obj-y += tcg/
accel/accel.c renamed from accel.c +0 -27
@@ -34,15 +34,6 @@#include "hw/xen/xen.h" #include "qom/object.h" -int tcg_tb_size; -static bool tcg_allowed = true; - -static int tcg_init (MachineState *ms) -{ -tcg_exec_init (tcg_tb_size *1024 *1024 ); -return 0 ; -} -static const TypeInfo accel_type = { .name =TYPE_ACCEL , .parent =TYPE_OBJECT ,
@@ -129,27 +120,9 @@ void configure_accelerator(MachineState *ms) } } - -static void tcg_accel_class_init (ObjectClass *oc,void *data) -{ -AccelClass *ac =ACCEL_CLASS (oc); - ac->name ="tcg" ; - ac->init_machine = tcg_init; - ac->allowed = &tcg_allowed; -} - -#define TYPE_TCG_ACCEL ACCEL_CLASS_NAME("tcg") - -static const TypeInfo tcg_accel_type = { - .name =TYPE_TCG_ACCEL , - .parent =TYPE_ACCEL , - .class_init = tcg_accel_class_init, -}; -static void register_accel_types (void ) {type_register_static (&accel_type); -type_register_static (&tcg_accel_type); }type_init (register_accel_types);
accel/tcg/Makefile.objs new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_SOFTMMU) += tcg-all.o
accel/tcg/tcg-all.c new file +61 -0
61 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 2/4 tcg: move tcg related files into accel/tcg/ subdirectory
In reply to Yang Zhongmove cputlb.c, cpu-exec-common.c and cpu-exec.c related tcg exec file into accel/tcg/ subdirectory.
--- Makefile.objs | 1 + Makefile.target | 7 +++---- accel/tcg/Makefile.objs | 2 ++ cpu-exec-common.c => accel/tcg/cpu-exec-common.c | 0 cpu-exec.c => accel/tcg/cpu-exec.c | 2 +- cputlb.c => accel/tcg/cputlb.c | 0 accel/tcg/trace-events | 7 +++++++ trace-events | 5 ----- 8 files changed, 14 insertions(+), 10 deletions(-) rename cpu-exec-common.c => accel/tcg/cpu-exec-common.c (100%) rename cpu-exec.c => accel/tcg/cpu-exec.c (99%) rename cputlb.c => accel/tcg/cputlb.c (100%) create mode 100644 accel/tcg/trace-events
Makefile.objs +1 -0
@@ -162,6 +162,7 @@ trace-events-subdirs += target/ppc trace-events-subdirs += qom trace-events-subdirs += linux-user trace-events-subdirs += qapi +trace-events-subdirs += accel/tcg trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
Makefile.target +3 -4
@@ -88,9 +88,9 @@ all: $(PROGS) stap ######################################################### # cpu emulator library -obj-y = exec.o translate-all.o cpu-exec.o +obj-y = exec.o translate-all.o +obj-y += accel/ obj-y += translate-common.o -obj-y += cpu-exec-common.o obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o obj-$(CONFIG_TCG_INTERPRETER) += tci.o obj-y += tcg/tcg-common.o
@@ -143,8 +143,7 @@ obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o obj-y += qtest.o bootdevice.o obj-y += hw/ obj-$(CONFIG_KVM) += kvm-all.o -obj-y += accel/ -obj-y += memory.o cputlb.o +obj-y += memory.o obj-y += memory_mapping.o obj-y += dump.o obj-y += migration/ram.o
accel/tcg/Makefile.objs +2 -0
@@ -1 +1,3 @@ obj-$(CONFIG_SOFTMMU) += tcg-all.o +obj-$(CONFIG_SOFTMMU) += cputlb.o +obj-y += cpu-exec.o cpu-exec-common.o
accel/tcg/cpu-exec-common.c renamed from cpu-exec-common.c +0 -0
accel/tcg/cpu-exec.c renamed from cpu-exec.c +1 -1
@@ -18,7 +18,7 @@*/ #include "qemu/osdep.h" #include "cpu.h" -#include "trace-root.h" +#include "trace.h" #include "disas/disas.h" #include "exec/exec-all.h" #include "tcg.h"
accel/tcg/cputlb.c renamed from cputlb.c +0 -0
accel/tcg/trace-events new file +7 -0
@@ -0,0 +1,7 @@ +# Trace events for debugging and performance instrumentation + +# TCG related tracing (mostly disabled by default) +# cpu-exec.c +disable exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR +disable exec_tb_nocache(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR +disable exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=%x"
trace-events +0 -5
@@ -73,11 +73,6 @@ kvm_irqchip_add_msi_route(int virq) "Adding MSI route virq=%d" kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d" # TCG related tracing (mostly disabled by default) -# cpu-exec.c -disable exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR -disable exec_tb_nocache(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR -disable exec_tb_exit(void *last_tb, unsigned int flags) "tb:%p flags=%x" - # translate-all.c translate_block(void *tb, uintptr_t pc, uint8_t *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p"
Signature · 1 line
1.9.1
PATCH v3 4/4 accel: move kvm related accelerator files into accel/
In reply to Yang Zhongmove kvm related accelerator files into accel/ subdirectory, also create one stub subdirectory, which will include accelerator's stub files.
--- Makefile.objs | 1 + Makefile.target | 3 --- accel/Makefile.objs | 3 +++ exec.c => accel/exec.c | 0 accel/kvm/Makefile.objs | 1 + kvm-all.c => accel/kvm/kvm-all.c | 2 +- accel/kvm/trace-events | 13 +++++++++++++ accel/stubs/Makefile.objs | 1 + kvm-stub.c => accel/stubs/kvm-stub.c | 0 trace-events | 12 ------------ 10 files changed, 20 insertions(+), 16 deletions(-) rename exec.c => accel/exec.c (100%) create mode 100644 accel/kvm/Makefile.objs rename kvm-all.c => accel/kvm/kvm-all.c (99%) create mode 100644 accel/kvm/trace-events create mode 100644 accel/stubs/Makefile.objs rename kvm-stub.c => accel/stubs/kvm-stub.c (100%)
Makefile.objs +1 -0
@@ -163,6 +163,7 @@ trace-events-subdirs += qom trace-events-subdirs += linux-user trace-events-subdirs += qapi trace-events-subdirs += accel/tcg +trace-events-subdirs += accel/kvm trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
Makefile.target +0 -3
@@ -88,7 +88,6 @@ all: $(PROGS) stap ######################################################### # cpu emulator library -obj-y = exec.o obj-y += accel/ obj-y += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o obj-y += tcg/tcg-common.o
@@ -98,7 +97,6 @@ obj-y += target/$(TARGET_BASE_ARCH)/ obj-y += disas.o obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decContext.o obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decNumber.o
@@ -139,7 +137,6 @@ ifdef CONFIG_SOFTMMU obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o obj-y += qtest.o bootdevice.o obj-y += hw/ -obj-$(CONFIG_KVM) += kvm-all.o obj-y += memory.o obj-y += memory_mapping.o obj-y += dump.o
accel/Makefile.objs +3 -0
@@ -1,2 +1,5 @@ obj-$(CONFIG_SOFTMMU) += accel.o +obj-y += exec.o +obj-y += kvm/ obj-y += tcg/ +obj-y += stubs/
accel/exec.c renamed from exec.c +0 -0
accel/kvm/Makefile.objs new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_KVM) += kvm-all.o
accel/kvm/kvm-all.c renamed from kvm-all.c +1 -1
@@ -35,7 +35,7 @@#include "exec/ram_addr.h" #include "exec/address-spaces.h" #include "qemu/event_notifier.h" -#include "trace-root.h" +#include "trace.h" #include "hw/irq.h" #include "hw/boards.h"
accel/kvm/trace-events new file +13 -0
@@ -0,0 +1,13 @@ +# Trace events for debugging and performance instrumentation + +# kvm-all.c +kvm_ioctl(int type, void *arg) "type 0x%x, arg %p" +kvm_vm_ioctl(int type, void *arg) "type 0x%x, arg %p" +kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type 0x%x, arg %p" +kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d" +kvm_device_ioctl(int fd, int type, void *arg) "dev fd %d, type 0x%x, arg %p" +kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retrieve ONEREG %" PRIu64 " from KVM: %s" +kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set ONEREG %" PRIu64 " to KVM: %s" +kvm_irqchip_commit_routes(void) "" +kvm_irqchip_add_msi_route(int virq) "Adding MSI route virq=%d" +kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d"
accel/stubs/Makefile.objs new file +1 -0
@@ -0,0 +1 @@ +obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
accel/stubs/kvm-stub.c renamed from kvm-stub.c +0 -0
trace-events +0 -12
@@ -60,18 +60,6 @@ dma_complete(void *dbs, int ret, void *cb) "dbs=%p ret=%d cb=%p" dma_blk_cb(void *dbs, int ret) "dbs=%p ret=%d" dma_map_wait(void *dbs) "dbs=%p" -# kvm-all.c -kvm_ioctl(int type, void *arg) "type 0x%x, arg %p" -kvm_vm_ioctl(int type, void *arg) "type 0x%x, arg %p" -kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type 0x%x, arg %p" -kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d" -kvm_device_ioctl(int fd, int type, void *arg) "dev fd %d, type 0x%x, arg %p" -kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retrieve ONEREG %" PRIu64 " from KVM: %s" -kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set ONEREG %" PRIu64 " to KVM: %s" -kvm_irqchip_commit_routes(void) "" -kvm_irqchip_add_msi_route(int virq) "Adding MSI route virq=%d" -kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d" - # memory.c memory_region_ops_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr %#"PRIx64" value %#"PRIx64" size %u" memory_region_ops_write(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr %#"PRIx64" value %#"PRIx64" size %u"
Signature · 1 line
1.9.1
Paolo Bonzini
AppliedQuoted 94 lines · Yang Zhong
In order to disable tcg, the first phase is to split some tcg code and separate those tcg related files into one directory. The next phase will disable tcg more easily and cleanly.
In the first phase, there are four patches to deal with split code and separate files.
1)split the tcg exec code.
a)split the tcg accelerators fromaccel.cfile and re-name
tcg accelerator totcg-all.c, likekvm-all.cdid.
b)create one accel directory, which will include kvm,
tcg and general exec files.
2)movecputlb.c,cpu-exec-common.candcpu-exec.crelated tcg
exec file into accel/tcg/ subdirectory.
3)move tcg related backend files into accel/tcg/ directory
those files include translate-all.(ch),translate-common.c,tci.candtcg-runtime.c.
4)move kvm andexec.cfile.
a)move kvm related accelerator files into accel/kvm/ directory. b)moveexec.cin accel/ directory.
c)stubs/ directory was created for kvm and tcg stub files.after those changes are done, the file tree like below accel
├── accel.c ├── exec.c ├── kvm │ ├── kvm-all.c │ ├── Makefile.objs │ └── trace-events ├── Makefile.objs ├── stubs │ ├── kvm-stub.c │ └── Makefile.objs └── tcg ├── cpu-exec.c ├── cpu-exec-common.c ├── cputlb.c ├── Makefile.objs ├── tcg-all.c ├── tcg-runtime.c ├── tci.c ├── trace-events ├── translate-all.c ├── translate-all.h └── translate-common.c3 directories, 19 files
v3: squash patches and move tcg related backend files to accel/tcg/
according to Paolo's comments.
add kvm and tcg exec related patches into one patchset.Yang Zhong (4):
accel: split the tcg accelerator fromaccel.cfile
tcg: move tcg related files into accel/tcg/ subdirectory
tcg: move tcg backend files into accel/tcg/
accel: move kvm related accelerator files into accel/Makefile.objs | 3 +- Makefile.target | 10 +--- accel/Makefile.objs | 5 ++ accel.c => accel/accel.c | 27 ---------- exec.c => accel/exec.c | 0 accel/kvm/Makefile.objs | 1 + kvm-all.c => accel/kvm/kvm-all.c | 2 +- accel/kvm/trace-events | 13 +++++ accel/stubs/Makefile.objs | 1 + kvm-stub.c => accel/stubs/kvm-stub.c | 0 accel/tcg/Makefile.objs | 4 ++ cpu-exec-common.c => accel/tcg/cpu-exec-common.c | 0 cpu-exec.c => accel/tcg/cpu-exec.c | 2 +- cputlb.c => accel/tcg/cputlb.c | 0 accel/tcg/tcg-all.c | 61 ++++++++++++++++++++++ tcg-runtime.c => accel/tcg/tcg-runtime.c | 0 tci.c => accel/tcg/tci.c | 0 accel/tcg/trace-events | 10 ++++ translate-all.c => accel/tcg/translate-all.c | 2 +- translate-all.h => accel/tcg/translate-all.h | 0 translate-common.c => accel/tcg/translate-common.c | 0 configure | 2 +- trace-events | 21 -------- 23 files changed, 103 insertions(+), 61 deletions(-) create mode 100644 accel/Makefile.objs rename accel.c => accel/accel.c (87%) rename exec.c => accel/exec.c (100%) create mode 100644 accel/kvm/Makefile.objs rename kvm-all.c => accel/kvm/kvm-all.c (99%) create mode 100644 accel/kvm/trace-events create mode 100644 accel/stubs/Makefile.objs rename kvm-stub.c => accel/stubs/kvm-stub.c (100%) create mode 100644 accel/tcg/Makefile.objs rename cpu-exec-common.c => accel/tcg/cpu-exec-common.c (100%) rename cpu-exec.c => accel/tcg/cpu-exec.c (99%)
Quoted 9 lines
rename cputlb.c => accel/tcg/cputlb.c (100%) create mode 100644 accel/tcg/tcg-all.c rename tcg-runtime.c => accel/tcg/tcg-runtime.c (100%) rename tci.c => accel/tcg/tci.c (100%) create mode 100644 accel/tcg/trace-events rename translate-all.c => accel/tcg/translate-all.c (99%) rename translate-all.h => accel/tcg/translate-all.h (100%) rename translate-common.c => accel/tcg/translate-common.c (100%)
Queued, thanks (except I'm not sure why you're moving exec.c, so I've undone that, and tcg-runtime.c probably fits better in tcg/).
Paolo
Quoted 107 lines · Paolo Bonzini
Quoted 94 lines · Yang Zhong
In order to disable tcg, the first phase is to split some tcg code and separate those tcg related files into one directory. The next phase will disable tcg more easily and cleanly.
In the first phase, there are four patches to deal with split code and separate files.
1)split the tcg exec code.
a)split the tcg accelerators fromaccel.cfile and re-name
tcg accelerator totcg-all.c, likekvm-all.cdid.
b)create one accel directory, which will include kvm,
tcg and general exec files.
2)movecputlb.c,cpu-exec-common.candcpu-exec.crelated tcg
exec file into accel/tcg/ subdirectory.
3)move tcg related backend files into accel/tcg/ directory
those files include translate-all.(ch),translate-common.c,tci.candtcg-runtime.c.
4)move kvm andexec.cfile.
a)move kvm related accelerator files into accel/kvm/ directory. b)moveexec.cin accel/ directory.
c)stubs/ directory was created for kvm and tcg stub files.after those changes are done, the file tree like below accel
├── accel.c ├── exec.c ├── kvm │ ├── kvm-all.c │ ├── Makefile.objs │ └── trace-events ├── Makefile.objs ├── stubs │ ├── kvm-stub.c │ └── Makefile.objs └── tcg ├── cpu-exec.c ├── cpu-exec-common.c ├── cputlb.c ├── Makefile.objs ├── tcg-all.c ├── tcg-runtime.c ├── tci.c ├── trace-events ├── translate-all.c ├── translate-all.h └── translate-common.c3 directories, 19 files
v3: squash patches and move tcg related backend files to accel/tcg/
according to Paolo's comments.
add kvm and tcg exec related patches into one patchset.Yang Zhong (4):
accel: split the tcg accelerator fromaccel.cfile
tcg: move tcg related files into accel/tcg/ subdirectory
tcg: move tcg backend files into accel/tcg/
accel: move kvm related accelerator files into accel/Makefile.objs | 3 +- Makefile.target | 10 +--- accel/Makefile.objs | 5 ++ accel.c => accel/accel.c | 27 ---------- exec.c => accel/exec.c | 0 accel/kvm/Makefile.objs | 1 + kvm-all.c => accel/kvm/kvm-all.c | 2 +- accel/kvm/trace-events | 13 +++++ accel/stubs/Makefile.objs | 1 + kvm-stub.c => accel/stubs/kvm-stub.c | 0 accel/tcg/Makefile.objs | 4 ++ cpu-exec-common.c => accel/tcg/cpu-exec-common.c | 0 cpu-exec.c => accel/tcg/cpu-exec.c | 2 +- cputlb.c => accel/tcg/cputlb.c | 0 accel/tcg/tcg-all.c | 61 ++++++++++++++++++++++ tcg-runtime.c => accel/tcg/tcg-runtime.c | 0 tci.c => accel/tcg/tci.c | 0 accel/tcg/trace-events | 10 ++++ translate-all.c => accel/tcg/translate-all.c | 2 +- translate-all.h => accel/tcg/translate-all.h | 0 translate-common.c => accel/tcg/translate-common.c | 0 configure | 2 +- trace-events | 21 -------- 23 files changed, 103 insertions(+), 61 deletions(-) create mode 100644 accel/Makefile.objs rename accel.c => accel/accel.c (87%) rename exec.c => accel/exec.c (100%) create mode 100644 accel/kvm/Makefile.objs rename kvm-all.c => accel/kvm/kvm-all.c (99%) create mode 100644 accel/kvm/trace-events create mode 100644 accel/stubs/Makefile.objs rename kvm-stub.c => accel/stubs/kvm-stub.c (100%) create mode 100644 accel/tcg/Makefile.objs rename cpu-exec-common.c => accel/tcg/cpu-exec-common.c (100%) rename cpu-exec.c => accel/tcg/cpu-exec.c (99%)Quoted 9 lines
rename cputlb.c => accel/tcg/cputlb.c (100%) create mode 100644 accel/tcg/tcg-all.c rename tcg-runtime.c => accel/tcg/tcg-runtime.c (100%) rename tci.c => accel/tcg/tci.c (100%) create mode 100644 accel/tcg/trace-events rename translate-all.c => accel/tcg/translate-all.c (99%) rename translate-all.h => accel/tcg/translate-all.h (100%) rename translate-common.c => accel/tcg/translate-common.c (100%)
Quoted 3 lines
Queued, thanks (except I'm not sure why you're moving
exec.c, so I've undone that, andtcg-runtime.cprobably fits better in tcg/).
Thanks Paolo for your great help!
as for exec.c, i ever thought this file is related with system and moved it to here.
You are right, tcg-runtime.c is BSD Licenced file, which should be moved to tcg/. Whether can i release V4 for those moving? thanks!
Regards,
Yang.
Quoted 1 line
Paolo
Quoted 7 lines · Zhong Yang
Quoted 4 lines
Quoted 1 line
Queued, thanks (except I'm not sure why you're moving
exec.c, so I've undone that, andtcg-runtime.cprobably fits better in tcg/).Thanks Paolo for your great help!
As for
exec.c, i ever thought this file is related with system and moved here.
If we do that, there would many more files to move (e.g. ioport.c, memory.c, user-exec.c). I think it's better to leave exec.c in the root for now.
Quoted 2 lines
You are right, since
tcg-runtime.cis BSD Licenced, it should be moved to tcg/. Whether can i release V4 to do this moving?
Don't worry, I can do the moving.
Paolo