qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH  v4 00/54] plugins for TCG
@ 2019-07-31 16:06 Alex Bennée
  2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 01/54] target/arm: handle M-profile semihosting at translate time Alex Bennée
                   ` (56 more replies)
  0 siblings, 57 replies; 107+ messages in thread
From: Alex Bennée @ 2019-07-31 16:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: bobby.prani, cota, Alex Bennée, aaron

Hi,

This is the latest iteration of the plugins series. The main changes
from the last version are:

  - dropped passing of haddr to plugins

This makes the code for handling the plugins less invasive in the
softmmu path at the cost of offloading processing to the plugin if it
wants the value. We rely on the fact that the TLB is per vCPU so a
helper can just trigger a re-query of the TLB to get the final
address.

Part of that change involved embedding the MMU index in the meminfo
field for tracing. I see there are some other patches on the list for
messing with TCGMemOp so there might be a clash coming up.

  - translator_ld goes direct to softmmu/user functions

I also mark the [SOFTMMU_]CODE_ACCESS helpers as deprecated. There is
more work to be done to clean up all the current uses of code access
helpers but ideally the only thing that should be peaking at code is
the translator loop itself. However a bunch of helpers have taken to
using code loading functions to peak at the instruction just executed
to figure out what to do. Once those have been fixed then we can
remove those helpers.

Other more minor fixes can be found documented bellow the --- in the
individual patches.

This series also includes the semihosting patches as they are a
pre-requisite for the translator_ld patches for ARM.

Once the tree opens up for development again I hope to get the
semihosting and trivial clean-up patches merged quickly so the patch
count for the plugins patches proper can be reduced a bit.

The following patches need review
  patch 0004/target arm remove run time semihosting checks.patch
  patch 0005/includes remove stale smp max _cpus externs.patch
  patch 0007/trace add mmu_index to mem_info.patch
  patch 0011/docs devel add plugins.rst design document.patch
  patch 0012/configure add enable plugins MOVE TO END.patch
  patch 0015/plugin add implementation of the api.patch
  patch 0024/plugins implement helpers for resolving hwaddr.patch
  patch 0047/tests tcg enable plugin testing.patch
  patch 0048/tests plugin add a hotblocks plugin.patch
  patch 0050/tests plugin add instruction execution breakdown.patch
  patch 0051/tests plugin add hotpages plugin to breakdown mem.patch
  patch 0053/include exec wrap cpu_ldst.h in CONFIG_TCG.patch

Alex Bennée (18):
  target/arm: handle M-profile semihosting at translate time
  target/arm: handle A-profile T32 semihosting at translate time
  target/arm: handle A-profile A32 semihosting at translate time
  target/arm: remove run time semihosting checks
  includes: remove stale [smp|max]_cpus externs
  trace: add mmu_index to mem_info
  docs/devel: add plugins.rst design document
  configure: add --enable-plugins (MOVE TO END)
  plugin: add implementation of the api
  plugins: implement helpers for resolving hwaddr
  tests/tcg: enable plugin testing
  tests/plugin: add a hotblocks plugin
  plugin: add qemu_plugin_insn_disas helper
  tests/plugin: add instruction execution breakdown
  tests/plugin: add hotpages plugin to breakdown memory access patterns
  accel/stubs: reduce headers from tcg-stub
  include/exec: wrap cpu_ldst.h in CONFIG_TCG
  include/exec/cpu-defs.h: fix typo

Emilio G. Cota (34):
  trace: expand mem_info:size_shift to 4 bits
  tcg/README: fix typo s/afterwise/afterwards/
  cpu: introduce cpu_in_exclusive_context()
  translate-all: use cpu_in_exclusive_work_context() in tb_flush
  plugin: add user-facing API
  plugin: add core code
  queue: add QTAILQ_REMOVE_SEVERAL
  cputlb: document get_page_addr_code
  cputlb: introduce get_page_addr_code_hostp
  tcg: add tcg_gen_st_ptr
  plugin-gen: add module for TCG-related code
  atomic_template: fix indentation in GEN_ATOMIC_HELPER
  atomic_template: add inline trace/plugin helpers
  tcg: let plugins instrument virtual memory accesses
  translate-all: notify plugin code of tb_flush
  *-user: notify plugin of exit
  *-user: plugin syscalls
  cpu: hook plugin vcpu events
  plugin-gen: add plugin_insn_append
  translator: add translator_ld{ub,sw,uw,l,q}
  target/arm: fetch code with translator_ld
  target/ppc: fetch code with translator_ld
  target/sh4: fetch code with translator_ld
  target/i386: fetch code with translator_ld
  target/hppa: fetch code with translator_ld
  target/m68k: fetch code with translator_ld
  target/alpha: fetch code with translator_ld
  target/riscv: fetch code with translator_ld
  target/sparc: fetch code with translator_ld
  target/xtensa: fetch code with translator_ld
  target/openrisc: fetch code with translator_ld
  translator: inject instrumentation from plugins
  plugin: add API symbols to qemu-plugins.symbols
  tests/plugin: add sample plugins

Lluís Vilanova (2):
  vl: support -plugin option
  linux-user: support -plugin option

 Makefile                                  |  10 +-
 Makefile.target                           |   2 +
 accel/stubs/tcg-stub.c                    |   3 -
 accel/tcg/Makefile.objs                   |   1 +
 accel/tcg/atomic_common.inc.c             |  54 ++
 accel/tcg/atomic_template.h               |  96 ++-
 accel/tcg/cpu-exec.c                      |   8 +-
 accel/tcg/cputlb.c                        |  69 +-
 accel/tcg/plugin-gen.c                    | 977 ++++++++++++++++++++++
 accel/tcg/plugin-helpers.h                |   5 +
 accel/tcg/translate-all.c                 |  15 +-
 accel/tcg/translator.c                    |  20 +
 accel/tcg/user-exec.c                     |   3 +
 bsd-user/syscall.c                        |  24 +-
 configure                                 |  86 +-
 cpus-common.c                             |   4 +
 cpus.c                                    |  10 +
 disas.c                                   | 103 +++
 docs/devel/index.rst                      |   1 +
 docs/devel/plugins.rst                    | 107 +++
 exec.c                                    |   2 +
 include/disas/disas.h                     |   2 +
 include/exec/cpu-defs.h                   |   3 +-
 include/exec/cpu_ldst.h                   |  11 +
 include/exec/cpu_ldst_template.h          |  37 +-
 include/exec/cpu_ldst_useronly_template.h |  29 +-
 include/exec/exec-all.h                   |  81 +-
 include/exec/helper-gen.h                 |   1 +
 include/exec/helper-proto.h               |   1 +
 include/exec/helper-tcg.h                 |   1 +
 include/exec/plugin-gen.h                 |  71 ++
 include/exec/translator.h                 |  58 +-
 include/qemu/bswap.h                      |   5 +
 include/qemu/plugin.h                     | 261 ++++++
 include/qemu/qemu-plugin.h                | 360 ++++++++
 include/qemu/queue.h                      |  10 +
 include/qom/cpu.h                         |  19 +
 include/sysemu/sysemu.h                   |   2 -
 include/user/syscall-trace.h              |  40 +
 linux-user/exit.c                         |   1 +
 linux-user/main.c                         |  18 +
 linux-user/syscall.c                      |   7 +-
 plugins/.gitignore                        |   2 +
 plugins/Makefile.objs                     |  21 +
 plugins/api.c                             | 338 ++++++++
 plugins/core.c                            | 499 +++++++++++
 plugins/loader.c                          | 353 ++++++++
 plugins/plugin.h                          |  95 +++
 plugins/qemu-plugins.symbols              |  39 +
 qemu-options.hx                           |  17 +
 qom/cpu.c                                 |   2 +
 scripts/tracetool/transform.py            |   1 +
 target/alpha/translate.c                  |   2 +-
 target/arm/arm_ldst.h                     |  15 +-
 target/arm/helper.c                       |  90 +-
 target/arm/m_helper.c                     |  18 +-
 target/arm/translate.c                    |  64 +-
 target/hppa/translate.c                   |   2 +-
 target/i386/translate.c                   |  10 +-
 target/m68k/translate.c                   |   2 +-
 target/openrisc/translate.c               |   2 +-
 target/ppc/translate.c                    |   8 +-
 target/riscv/translate.c                  |   2 +-
 target/sh4/translate.c                    |   4 +-
 target/sparc/translate.c                  |   2 +-
 target/xtensa/translate.c                 |   4 +-
 tcg/README                                |   2 +-
 tcg/tcg-op.c                              |  40 +-
 tcg/tcg-op.h                              |  16 +
 tcg/tcg-opc.h                             |   3 +
 tcg/tcg.c                                 |  22 +
 tcg/tcg.h                                 |  23 +
 tests/Makefile.include                    |  10 +-
 tests/plugin/Makefile                     |  31 +
 tests/plugin/bb.c                         |  65 ++
 tests/plugin/empty.c                      |  29 +
 tests/plugin/hotblocks.c                  | 146 ++++
 tests/plugin/hotpages.c                   | 179 ++++
 tests/plugin/howvec.c                     | 301 +++++++
 tests/plugin/insn.c                       |  62 ++
 tests/plugin/mem.c                        |  96 +++
 tests/tcg/Makefile                        |  34 +
 tests/tcg/arm/Makefile.softmmu-target     |   1 +
 trace-events                              |   8 +-
 trace/mem-internal.h                      |  31 +-
 trace/mem.h                               |   7 +-
 vl.c                                      |  11 +
 87 files changed, 5067 insertions(+), 260 deletions(-)
 create mode 100644 accel/tcg/atomic_common.inc.c
 create mode 100644 accel/tcg/plugin-gen.c
 create mode 100644 accel/tcg/plugin-helpers.h
 create mode 100644 docs/devel/plugins.rst
 create mode 100644 include/exec/plugin-gen.h
 create mode 100644 include/qemu/plugin.h
 create mode 100644 include/qemu/qemu-plugin.h
 create mode 100644 include/user/syscall-trace.h
 create mode 100644 plugins/.gitignore
 create mode 100644 plugins/Makefile.objs
 create mode 100644 plugins/api.c
 create mode 100644 plugins/core.c
 create mode 100644 plugins/loader.c
 create mode 100644 plugins/plugin.h
 create mode 100644 plugins/qemu-plugins.symbols
 create mode 100644 tests/plugin/Makefile
 create mode 100644 tests/plugin/bb.c
 create mode 100644 tests/plugin/empty.c
 create mode 100644 tests/plugin/hotblocks.c
 create mode 100644 tests/plugin/hotpages.c
 create mode 100644 tests/plugin/howvec.c
 create mode 100644 tests/plugin/insn.c
 create mode 100644 tests/plugin/mem.c

-- 
2.20.1



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

end of thread, other threads:[~2019-10-11 18:46 UTC | newest]

Thread overview: 107+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 16:06 [Qemu-devel] [PATCH v4 00/54] plugins for TCG Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 01/54] target/arm: handle M-profile semihosting at translate time Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 02/54] target/arm: handle A-profile T32 " Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 03/54] target/arm: handle A-profile A32 " Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 04/54] target/arm: remove run time semihosting checks Alex Bennée
2019-08-01 13:27   ` Aaron Lindsay OS via Qemu-devel
2019-08-01 13:36     ` Peter Maydell
2019-08-01 14:53   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 05/54] includes: remove stale [smp|max]_cpus externs Alex Bennée
2019-08-01 14:54   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 06/54] trace: expand mem_info:size_shift to 4 bits Alex Bennée
2019-08-01 15:01   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 07/54] trace: add mmu_index to mem_info Alex Bennée
2019-08-01 15:17   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 08/54] tcg/README: fix typo s/afterwise/afterwards/ Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 09/54] cpu: introduce cpu_in_exclusive_context() Alex Bennée
2019-08-01 15:23   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 10/54] translate-all: use cpu_in_exclusive_work_context() in tb_flush Alex Bennée
2019-08-01 15:25   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 11/54] docs/devel: add plugins.rst design document Alex Bennée
2019-08-01 15:31   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 12/54] configure: add --enable-plugins (MOVE TO END) Alex Bennée
2019-08-01 15:33   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 13/54] plugin: add user-facing API Alex Bennée
2019-08-01 15:39   ` Richard Henderson
2019-08-02 18:25   ` Aaron Lindsay OS via Qemu-devel
2019-09-06 19:31     ` Alex Bennée
2019-09-10 16:24       ` Aaron Lindsay OS via Qemu-devel
2019-09-10 17:41         ` Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 14/54] plugin: add core code Alex Bennée
2019-08-01 15:58   ` Richard Henderson
2019-09-12  9:17   ` Daniel P. Berrangé
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 15/54] plugin: add implementation of the api Alex Bennée
2019-08-01 16:14   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 16/54] queue: add QTAILQ_REMOVE_SEVERAL Alex Bennée
2019-08-01 16:16   ` Richard Henderson
2019-08-01 16:16   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 17/54] cputlb: document get_page_addr_code Alex Bennée
2019-08-01 17:08   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 18/54] cputlb: introduce get_page_addr_code_hostp Alex Bennée
2019-08-01 17:10   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 19/54] tcg: add tcg_gen_st_ptr Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 20/54] plugin-gen: add module for TCG-related code Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 21/54] atomic_template: fix indentation in GEN_ATOMIC_HELPER Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 22/54] atomic_template: add inline trace/plugin helpers Alex Bennée
2019-08-01 18:23   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 23/54] tcg: let plugins instrument virtual memory accesses Alex Bennée
2019-08-01 18:29   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 24/54] plugins: implement helpers for resolving hwaddr Alex Bennée
2019-08-01 14:14   ` Aaron Lindsay OS via Qemu-devel
2019-08-01 18:37     ` Richard Henderson
2019-10-09 17:45     ` Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 25/54] translate-all: notify plugin code of tb_flush Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 26/54] *-user: notify plugin of exit Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 27/54] *-user: plugin syscalls Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 28/54] cpu: hook plugin vcpu events Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 29/54] plugin-gen: add plugin_insn_append Alex Bennée
2019-08-01 18:39   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 30/54] translator: add translator_ld{ub, sw, uw, l, q} Alex Bennée
2019-08-01 19:24   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 31/54] target/arm: fetch code with translator_ld Alex Bennée
2019-08-01 19:26   ` Richard Henderson
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 32/54] target/ppc: " Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 33/54] target/sh4: " Alex Bennée
2019-07-31 16:06 ` [Qemu-devel] [PATCH v4 34/54] target/i386: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 35/54] target/hppa: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 36/54] target/m68k: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 37/54] target/alpha: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 38/54] target/riscv: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 39/54] target/sparc: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 40/54] target/xtensa: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 41/54] target/openrisc: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 42/54] translator: inject instrumentation from plugins Alex Bennée
2019-08-01 19:35   ` Richard Henderson
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 43/54] plugin: add API symbols to qemu-plugins.symbols Alex Bennée
2019-08-01 19:42   ` Richard Henderson
2019-10-11 16:46     ` Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 44/54] vl: support -plugin option Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 45/54] linux-user: " Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 46/54] tests/plugin: add sample plugins Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 47/54] tests/tcg: enable plugin testing Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 48/54] tests/plugin: add a hotblocks plugin Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 49/54] plugin: add qemu_plugin_insn_disas helper Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 50/54] tests/plugin: add instruction execution breakdown Alex Bennée
2019-08-01 14:31   ` Aaron Lindsay OS via Qemu-devel
2019-10-09 18:49     ` Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 51/54] tests/plugin: add hotpages plugin to breakdown memory access patterns Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 52/54] accel/stubs: reduce headers from tcg-stub Alex Bennée
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 53/54] include/exec: wrap cpu_ldst.h in CONFIG_TCG Alex Bennée
2019-08-01 19:51   ` Richard Henderson
2019-07-31 16:07 ` [Qemu-devel] [PATCH v4 54/54] include/exec/cpu-defs.h: fix typo Alex Bennée
2019-07-31 17:00 ` [Qemu-devel] [PATCH v4 00/54] plugins for TCG no-reply
2019-08-01  4:19 ` Markus Armbruster
2019-09-06 19:52   ` Alex Bennée
2019-09-10 16:16     ` Aaron Lindsay OS via Qemu-devel
2019-09-10 17:37       ` Alex Bennée
2019-09-10 16:34     ` Peter Maydell
2019-09-12  6:46     ` [Qemu-devel] TCG plugins and the GPL (was: [PATCH v4 00/54] plugins for TCG) Markus Armbruster
2019-09-12  9:03       ` Alex Bennée
2019-09-12  9:21         ` Peter Maydell
2019-09-12 10:07           ` Alex Bennée
2019-09-12 10:16             ` Daniel P. Berrangé
2019-09-12 10:21               ` Peter Maydell
2019-09-12 10:18             ` Peter Maydell
2019-09-12 10:35               ` Alex Bennée
2019-09-12  9:32         ` Daniel P. Berrangé
2019-08-01 14:20 ` [Qemu-devel] [PATCH v4 00/54] plugins for TCG no-reply

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).