Skip to contentSkip to conversation

split the tcg accelerator from accel.c file

PATCH Superseded Yang Zhong 2 participants 6 messages May 18, 2017 Kbuild

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yang Zhong

author
#0 lore raw

PATCH 1/4 split the tcg accelerator from accel.c file

there are two accelerators in qemu, kvm and tcg. kvm accelerator is defined in kvm-all.c, but tcg accelerator is defined in accel.c file. we split tcg accelerator from accel.c file and create one new accel directory,which will include kvm and tcg accel files.

---
 Makefile.objs           |   1 -
 Makefile.target         |   1 +
 accel.c                 | 155 ------------------------------------------------
 accel/Makefile.objs     |   2 +
 accel/accel.c           | 128 +++++++++++++++++++++++++++++++++++++++
 accel/tcg/Makefile.objs |   1 +
 accel/tcg/tcg-all.c     |  61 +++++++++++++++++++
 7 files changed, 193 insertions(+), 156 deletions(-)
 delete mode 100644 accel.c
 create mode 100644 accel/Makefile.objs
 create mode 100644 accel/accel.c
 create mode 100644 accel/tcg/Makefile.objs
 create mode 100644 accel/tcg/tcg-all.c
Makefile.objs +0 -1
index 6167e7b..2a8de77 100644
@@ -55,7 +55,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
index 465a633..ba893a8 100644
@@ -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.c deleted +0 -155

155 lines not on this page · raw message

accel/Makefile.objs new file +2 -0
new file mode 100644
index 0000000..11ad823
@@ -0,0 +1,2 @@
+obj-$(CONFIG_SOFTMMU) += accel.o
+obj-y += tcg/
accel/accel.c new file +128 -0

128 lines not on this page · raw message

accel/tcg/Makefile.objs new file +1 -0
new file mode 100644
index 0000000..6e3211a
@@ -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
author
#1 lore raw

PATCH 2/4 move cputlb.c

move cputlb.c to accel/tcg/

---
 Makefile.target         |    2 +-
 accel/tcg/Makefile.objs |    1 +
 accel/tcg/cputlb.c      | 1051 +++++++++++++++++++++++++++++++++++++++++++++++
 cputlb.c                | 1051 -----------------------------------------------
 4 files changed, 1053 insertions(+), 1052 deletions(-)
 create mode 100644 accel/tcg/cputlb.c
 delete mode 100644 cputlb.c
Makefile.target +1 -1
index ba893a8..3e19fe9 100644
@@ -144,7 +144,7 @@ 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 migration/savevm.o
accel/tcg/Makefile.objs +1 -0
index 6e3211a..487570f 100644
@@ -1 +1,2 @@
 obj-$(CONFIG_SOFTMMU) += tcg-all.o
+obj-$(CONFIG_SOFTMMU) += cputlb.o
accel/tcg/cputlb.c new file +1051 -0

1,051 lines not on this page · raw message

cputlb.c deleted +0 -1051

1,051 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 3/4 move cpu-exec.c

In reply to Yang Zhong

move cpu-exec.c to ./accel/tcg/

---
 Makefile.objs           |   1 +
 Makefile.target         |   4 +-
 accel/tcg/Makefile.objs |   1 +
 accel/tcg/cpu-exec.c    | 686 ++++++++++++++++++++++++++++++++++++++++++++++++
 accel/tcg/trace-events  |   7 +
 cpu-exec.c              | 685 -----------------------------------------------
 trace-events            |   5 -
 7 files changed, 697 insertions(+), 692 deletions(-)
 create mode 100644 accel/tcg/cpu-exec.c
 create mode 100644 accel/tcg/trace-events
 delete mode 100644 cpu-exec.c
Makefile.objs +1 -0
index 2a8de77..6a33874 100644
@@ -163,6 +163,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 +2 -2
index 3e19fe9..709d07a 100644
@@ -88,7 +88,8 @@ 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
@@ -143,7 +144,6 @@ 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
 obj-y += memory_mapping.o
 obj-y += dump.o
accel/tcg/Makefile.objs +1 -0
index 487570f..6b75a31 100644
@@ -1,2 +1,3 @@
 obj-$(CONFIG_SOFTMMU) += tcg-all.o
 obj-$(CONFIG_SOFTMMU) += cputlb.o
+obj-y += cpu-exec.o
accel/tcg/cpu-exec.c new file +686 -0

686 lines not on this page · raw message

accel/tcg/trace-events new file +7 -0
new file mode 100644
index 0000000..f2db388
@@ -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"
cpu-exec.c deleted +0 -685

685 lines not on this page · raw message

trace-events +0 -5
index e582d63..153942d 100644
@@ -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
author
#3 lore raw

PATCH 4/4 move cpu-exec-common.c

In reply to Yang Zhong

move cpu-exec-common.c to accel/tcg

---
 Makefile.target             |  1 -
 accel/tcg/Makefile.objs     |  2 +-
 accel/tcg/cpu-exec-common.c | 82 +++++++++++++++++++++++++++++++++++++++++++++
 cpu-exec-common.c           | 82 ---------------------------------------------
 4 files changed, 83 insertions(+), 84 deletions(-)
 create mode 100644 accel/tcg/cpu-exec-common.c
 delete mode 100644 cpu-exec-common.c
Makefile.target +0 -1
index 709d07a..b083a76 100644
@@ -91,7 +91,6 @@ all: $(PROGS) stap
 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
accel/tcg/Makefile.objs +1 -1
index 6b75a31..940379b 100644
@@ -1,3 +1,3 @@
 obj-$(CONFIG_SOFTMMU) += tcg-all.o
 obj-$(CONFIG_SOFTMMU) += cputlb.o
-obj-y += cpu-exec.o
+obj-y += cpu-exec.o cpu-exec-common.o
accel/tcg/cpu-exec-common.c new file +82 -0

82 lines not on this page · raw message

cpu-exec-common.c deleted +0 -82

82 lines not on this page · raw message

Signature · 1 line
1.9.1
#4 lore raw
In reply to Yang Zhong
Quoted 4 lines · Yang Zhong

there are two accelerators in qemu, kvm and tcg. kvm accelerator is defined in kvm-all.c, but tcg accelerator is defined in accel.c file. we split tcg accelerator from accel.c file and create one new accel directory,which will

space after comma in English.

Quoted 2 lines

include kvm and tcg accel files.

Please remember to send a 0/4 cover letter when sending a series; our automated tooling works better that way. You can use 'git config format.coverletter auto' to make git do the right thing.

Quoted 15 lines
---
 Makefile.objs           |   1 -
 Makefile.target         |   1 +
 accel.c                 | 155 ------------------------------------------------
 accel/Makefile.objs     |   2 +
 accel/accel.c           | 128 +++++++++++++++++++++++++++++++++++++++
 accel/tcg/Makefile.objs |   1 +
 accel/tcg/tcg-all.c     |  61 +++++++++++++++++++
 7 files changed, 193 insertions(+), 156 deletions(-)
 delete mode 100644 accel.c
 create mode 100644 accel/Makefile.objs
 create mode 100644 accel/accel.c
 create mode 100644 accel/tcg/Makefile.objs
 create mode 100644 accel/tcg/tcg-all.c

You may also want to set 'git config diff.renames true' to make code motion patches take up less bandwidth (assuming that the new accel/accel.c is close enough for git to detect it as a rename from the old accel.c).

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#5 lore raw
In reply to Yang Zhong

On 05/18/2017 02:14 PM, Yang Zhong wrote:

Your system clock is way off. From the headers:

Quoted 3 lines

Received: from yangzhon-virtual.bj.intel.com ([10.238.145.52])

	by fmsmga002.fm.intel.com with ESMTP; 18 May 2017 04:17:51 -0700

Date: Fri, 19 May 2017 03:14:52 +0800

Your computer claimed to mail this at 19:14 UTC Thursday, but the next hop received it at 11:17 UTC (8 hours earlier). Please fix this, as it messes with mail clients that like to sort by threads with the most recent activity.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org