qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/15] add disable-tcg option for x86 build
@ 2017-07-03 10:12 Yang Zhong
  2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option Yang Zhong
                   ` (14 more replies)
  0 siblings, 15 replies; 27+ messages in thread
From: Yang Zhong @ 2017-07-03 10:12 UTC (permalink / raw)
  To: pbonzini, rth, thuth; +Cc: qemu-devel, anthony.xu, a.rigo, yang.zhong

This patchset rebased from Paolo's below patchset, which was based on
QEMU 2.0.50 version.
https://github.com/bonzini/qemu/tree/disable-tcg

Since qemu-system-x86_64 enabled kvm and TCG accelators by default, in
fact, the TCG accelator is NOT useful in the system build of x86 platform.
This patchset will disable TCG for x86 platform if --disable-tcg option is
added into ./configure command.

The new configure build command like below
(1)./configure
   tcg is defaultly enabled

(2)./configure --disable-tcg --target-list=x86_64-softmmu
   tcg is disabled in x86_64-softmmu

(3)./configure --disable-tcg --target-list=i386-softmmu
   tcg is disabled in i386-softmmu

How to verify disable-tcg option
(1)./configure
   a)all user and softmmu build are okay.
   b) CONFIG_TCG=y is set in $config_target_mak in all user and softmmu directory
   c)kvm starting vm is okay
     ./qemu-system-x86_64 -enable-kvm -cpu host -m 2G -smp cpus=4,cores=4,threads=1,\
       sockets=1 -drive format=raw,file=eywa.img,index=0,media=disk -nographic -serial \
       stdio -nodefaults
   d)tcg starting vm is okay
     ./qemu-system-x86_64 -m 2G -smp cpus=4,cores=4,threads=1,sockets=1 -drive format=raw,\
        file=eywa.img,index=0,media=disk -nographic -serial stdio -nodefaults

(2)./configure --disable-tcg --target-list=x86_64-softmmu
   a) softmmu build is okay.
   b) CONFIG_TCG=y is not set in $config_target_mak in x86_64-softmmu directory
   c) kvm starting vm is okay
     ./qemu-system-x86_64 -enable-kvm -cpu host -m 2G -smp cpus=4,cores=4,threads=1,\
       sockets=1 -drive format=raw,file=eywa.img,index=0,media=disk -nographic -serial \
       stdio -nodefaults
   d) tcg starting vm is aborted
      The log as below:
      "tcg" accelerator not found.
      No accelerator found!

(3)./configure --target-list=x86_64-softmmu,x86_64-linux-user
   ERROR: The current x86_64-linux-user can't support disable-tcg,
       only i386-softmmu|x86_64-softmmu support disable-tcg

(4)./configure --disable-tcg --target-list=arm-softmmu
   ERROR: The current arm-softmmu can't support disable-tcg,
       only i386-softmmu|x86_64-softmmu support disable-tcg

v2:
* updated patch 01 reviewed by Richard Henderson,Thomas Huth and Paolo.
  "echo "CONFIG_TCG" >> $config_target_mak" is more clean.
  add the error configure check for --disable-tcg.
  new patch is easy to extend to other platform.
* updated patch 02 reviewed by Paolo.
  remove CONFIG_TCG.
  add tcg_enabled() for tcg code.
* updated patch 03 reviewed by Paolo.
  move tcg_handle_interrupt() from translate-common.c to tcg-all.c.
* updated patch 09 reviewed by Paolo and Richard Henderson.
  moved the x86 related function out of stubs file.
  added patch 14 for x86 related tcg functions.
* updated the flush_icache_range() reviewed by Paolo.
  deleted this patch and the compile is still okay. So there will not this 
  patch in future release. 
* updated patch 12 reviewed by Richard Henderson.
  removed the CONFIG_TCG in CPUX86State struct. cpu-defs.h has disabled 
  CPU_COMMON_TLB if tcg is disabled.


Yang Zhong (15):
  configure: add the disable-tcg option
  vl: add tcg_enabled() for tcg related code
  tcg: tcg_handle_interrupt() function
  tcg: change tcg_enabled()
  tcg: move page_size_init() function
  kvmvapic: remove tcg related code
  tcg: move cpu_sync_bndcs_hflags() function
  tcg: make cpu_get_fp80()/cpu_set_fp80() static
  tcg: add the tcg-stub.c file into accel/stubs/
  tcg: move tb related lock functions
  tcg: split cpu_set_mxcsr() and make cpu_set_fpuc() inline
  tcg: disable tcg in CPUX86State struct
  tcg: add the CONFIG_TCG for header
  tcg: add the tcg_enabled() in target/i386/
  tcg: add the CONFIG_TCG into Makefiles

 Makefile.target              |  4 +-
 accel/Makefile.objs          |  2 +-
 accel/stubs/Makefile.objs    |  1 +
 accel/stubs/tcg-stub.c       | 94 ++++++++++++++++++++++++++++++++++++++++++++
 accel/tcg/Makefile.objs      |  2 +-
 accel/tcg/cpu-exec.c         |  1 +
 accel/tcg/cputlb.c           |  1 +
 accel/tcg/tcg-all.c          | 36 ++++++++++++++++-
 accel/tcg/translate-all.c    | 24 +----------
 accel/tcg/translate-all.h    |  3 ++
 accel/tcg/translate-common.c | 56 --------------------------
 bsd-user/main.c              |  1 +
 configure                    | 43 +++++++++++++++++++-
 exec.c                       | 20 ++++++++++
 hw/i386/kvmvapic.c           | 24 -----------
 include/exec/cpu-defs.h      |  4 +-
 include/exec/cputlb.h        |  2 +-
 include/exec/exec-all.h      | 53 +++++++++++++------------
 include/exec/helper-proto.h  |  2 +
 include/qemu-common.h        |  7 +++-
 include/sysemu/accel.h       |  2 +-
 linux-user/main.c            |  2 +-
 qom/cpu.c                    |  2 +
 target/i386/Makefile.objs    |  7 ++--
 target/i386/bpt_helper.c     | 26 +++++++++---
 target/i386/cpu.c            |  4 +-
 target/i386/cpu.h            | 22 +++++++++--
 target/i386/fpu_helper.c     | 29 +-------------
 target/i386/helper.c         | 34 +++++++++++++++-
 target/i386/machine.c        | 23 ++++++++++-
 target/i386/mpx_helper.c     | 30 --------------
 tcg/tcg.h                    |  4 --
 trace/control-target.c       |  1 -
 vl.c                         | 15 +++++--
 34 files changed, 358 insertions(+), 223 deletions(-)
 create mode 100644 accel/stubs/tcg-stub.c
 delete mode 100644 accel/tcg/translate-common.c

-- 
1.9.1

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-07-04  2:46 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03 10:12 [Qemu-devel] [PATCH v2 00/15] add disable-tcg option for x86 build Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 01/15] configure: add the disable-tcg option Yang Zhong
2017-07-03 10:20   ` Daniel P. Berrange
2017-07-03 10:25     ` Paolo Bonzini
2017-07-03 10:33       ` Daniel P. Berrange
2017-07-03 10:55         ` Paolo Bonzini
2017-07-03 11:40           ` Thomas Huth
2017-07-03 12:09           ` Daniel P. Berrange
2017-07-03 12:55             ` Paolo Bonzini
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 02/15] vl: add tcg_enabled() for tcg related code Yang Zhong
2017-07-03 12:30   ` Thomas Huth
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 03/15] tcg: tcg_handle_interrupt() function Yang Zhong
2017-07-03 12:35   ` Thomas Huth
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 04/15] tcg: change tcg_enabled() Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 05/15] tcg: move page_size_init() function Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 06/15] kvmvapic: remove tcg related code Yang Zhong
2017-07-03 14:28   ` Paolo Bonzini
2017-07-04  2:46     ` Zhong Yang
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 07/15] tcg: move cpu_sync_bndcs_hflags() function Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 08/15] tcg: make cpu_get_fp80()/cpu_set_fp80() static Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 09/15] tcg: add the tcg-stub.c file into accel/stubs/ Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 10/15] tcg: move tb related lock functions Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 11/15] tcg: split cpu_set_mxcsr() and make cpu_set_fpuc() inline Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 12/15] tcg: disable tcg in CPUX86State struct Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 13/15] tcg: add the CONFIG_TCG for header Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 14/15] tcg: add the tcg_enabled() in target/i386/ Yang Zhong
2017-07-03 10:12 ` [Qemu-devel] [PATCH v2 15/15] tcg: add the CONFIG_TCG into Makefiles Yang Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).