All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: qemu-devel@nongnu.org
Cc: "Emilio G. Cota" <cota@braap.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Richard Henderson" <rth@twiddle.net>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH v11 00/29] translate: [tcg] Generic translation framework
Date: Wed, 28 Jun 2017 15:16:40 +0300	[thread overview]
Message-ID: <149865219962.17063.10630533069463266646.stgit@frigg.lan> (raw)

This series proposes a generic (target-agnostic) instruction translation
framework.

It basically provides a generic main loop for instruction disassembly, which
calls target-specific functions when necessary. This generalization makes
inserting new code in the main loop easier, and helps in keeping all targets in
synch as to the contents of it.

This series also paves the way towards adding events to trace guest code
execution (BBLs and instructions).

I've ported i386/x86-64 and arm/aarch64 as an example to see how it fits in the
current organization, but will port the rest when this series gets merged.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---

Changes in v11
==============

* Convert gen_intermediate_code_a64 [Emilio G. Cota].
* Replace "cpu_env" argument in icount functions with "tcg_ctx.cpu_env"
  [Emilio G. Cota].
* Drop QTAILQ_FOREACH_CONTINUE and cpu_breakpoint_get in favour of an explicit
  breakpoint traversal [Richard Henderson].
* Rename translate-block.[ch] into translator.[ch] [Emilio G. Cota].
* Revert DJ_* names into DISAS_*, and provide generic DISAS_TARGET_* enum values
  instead of defining them as integers on each target.
* Do not use DisasContextBase directly in target code (helps the compiler's
  alias analysis) [Richard Henderson].
* Make all generic translator hooks mandatory [Richard Henderson].
* Rename TranslatorOps::disas_insn as TranslatorOps::translate_insn
  [Richard Henderson].
* Generalize TranslatorOps::disas_flags into TranslatorOps::disas_log to support
  future targets [Richard Henderson].
* Split arm and aarch64 changes in different patches [Emilio G. Cota].
* Make translator op structs constant [Richard Henderson].
* Write a single entry point for both arm and aarch64 translation
  [Richard Henderson].
* Change format of commit titles [Emilio G. Cota].
* Remove cross-page check from generic code (it's already embedded in more
  complex, and mandatory, checks in most targets).


Changes in v10
==============

* Rebase on 931892e8a6.
* Fix build errors for hppa, nios2 and openrisc.


Changes in v9
=============

* Further increase inter-mail sleep time during sending.


Changes in v8
=============

* Increase inter-mail sleep time during sending (list keeps refusing some emails
  due to an excessive send rate).


Changes in v7
=============

* Change BreakpointHitType (BH_*) for BreakpointCheckType (BC_*).
* Move target-specific translation functions to a struct (TranslatorOps).
* Split target-specific changes into multiple patches.
* Rebase on edf8bc9842.


Changes in v6
=============

* Rebase on upstream master (64175afc69).
* Reorder fields in DisasContextBase to minimize padding [Richard Henderson].


Changes in v5
=============

* Remove stray uses of "restrict" keyword.


Changes in v4
=============

* Document new macro QTAILQ_FOREACH_CONTINUE [Peter Maydell].
* Fix coding style errors reported by checkpatch.
* Remove use of "restrict" in added functions; it makes older gcc versions barf
  about compilation errors.


Changes in v3
=============

* Rebase on 0737f32daf.


Changes in v2
=============

* Port ARM and AARCH64 targets.
* Fold single-stepping checks into "max_insns" [Richard Henderson].
* Move instruction start marks to target code [Richard Henderson].
* Add target hook for TB start.
* Check for TCG temporary leaks.
* Move instruction disassembly into a target hook.
* Make breakpoint_hit() return an enum to accomodate target's needs (ARM).


Lluís Vilanova (29):
      Pass generic CPUState to gen_intermediate_code()
      cpu-exec: Avoid global variables in icount-related functions
      target: [tcg] Use a generic enum for DISAS_ values
      target: [tcg] Add generic translation framework
      target/i386: [tcg] Port to DisasContextBase
      target/i386: [tcg] Refactor init_disas_context
      target/i386: [tcg] Refactor init_globals
      target/i386: [tcg] Refactor insn_start
      target/i386: [tcg] Refactor breakpoint_check
      target/i386: [tcg] Refactor translate_insn
      target/i386: [tcg] Refactor tb_stop
      target/i386: [tcg] Refactor disas_log
      target/i386: [tcg] Port to generic translation framework
      target/arm: [tcg] Port to DisasContextBase
      target/arm: [tcg] Port to init_disas_context
      target/arm: [tcg,a64] Port to init_disas_context
      target/arm: [tcg] Port to init_globals
      target/arm: [tcg] Port to tb_start
      target/arm: [tcg] Port to insn_start
      target/arm: [tcg,a64] Port to insn_start
      target/arm: [tcg] Port to breakpoint_check
      target/arm: [tcg,a64] Port to breakpoint_check
      target/arm: [tcg] Port to translate_insn
      target/arm: [tcg,a64] Port to translate_insn
      target/arm: [tcg] Port to tb_stop
      target/arm: [tcg,a64] Port to tb_stop
      target/arm: [tcg] Port to disas_log
      target/arm: [tcg,a64] Port to disas_log
      target/arm: [tcg] Port to generic translation framework


 accel/tcg/Makefile.objs       |    1 
 accel/tcg/translate-all.c     |    2 
 accel/tcg/translator.c        |  153 +++++++++++++++
 include/exec/exec-all.h       |    8 -
 include/exec/gen-icount.h     |   10 -
 include/exec/translator.h     |  142 ++++++++++++++
 target/alpha/translate.c      |   11 -
 target/arm/translate-a64.c    |  280 +++++++++++++--------------
 target/arm/translate.c        |  419 +++++++++++++++++++++--------------------
 target/arm/translate.h        |   41 ++--
 target/cris/translate.c       |   24 +-
 target/hppa/translate.c       |    5 
 target/i386/translate.c       |  306 +++++++++++++++---------------
 target/lm32/translate.c       |   28 ++-
 target/m68k/translate.c       |   22 +-
 target/microblaze/translate.c |   28 ++-
 target/mips/translate.c       |   15 +
 target/moxie/translate.c      |   14 +
 target/nios2/translate.c      |   11 +
 target/openrisc/translate.c   |   26 ++-
 target/ppc/translate.c        |   15 +
 target/s390x/translate.c      |   16 +-
 target/sh4/translate.c        |   15 +
 target/sparc/translate.c      |   11 -
 target/tilegx/translate.c     |    7 -
 target/tricore/translate.c    |    9 -
 target/unicore32/translate.c  |   24 +-
 target/xtensa/translate.c     |   17 +-
 28 files changed, 996 insertions(+), 664 deletions(-)
 create mode 100644 accel/tcg/translator.c
 create mode 100644 include/exec/translator.h


To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Emilio G. Cota <cota@braap.org>

             reply	other threads:[~2017-06-28 12:17 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 12:16 Lluís Vilanova [this message]
2017-06-28 12:20 ` [Qemu-devel] [PATCH v11 01/29] Pass generic CPUState to gen_intermediate_code() Lluís Vilanova
2017-06-29 22:52   ` Emilio G. Cota
2017-06-30 18:46     ` Richard Henderson
2017-07-01 22:44   ` Richard Henderson
2017-06-28 12:24 ` [Qemu-devel] [PATCH v11 02/29] cpu-exec: Avoid global variables in icount-related functions Lluís Vilanova
2017-06-29 22:56   ` Emilio G. Cota
2017-06-28 12:28 ` [Qemu-devel] [PATCH v11 03/29] target: [tcg] Use a generic enum for DISAS_ values Lluís Vilanova
2017-06-29 23:09   ` Emilio G. Cota
2017-07-01 22:48   ` Richard Henderson
2017-06-28 12:32 ` [Qemu-devel] [PATCH v11 04/29] target: [tcg] Add generic translation framework Lluís Vilanova
2017-06-30  0:02   ` Emilio G. Cota
2017-07-01 22:57     ` Richard Henderson
2017-06-30  1:18   ` Emilio G. Cota
2017-07-01 23:37   ` Richard Henderson
2017-07-04 18:59     ` Lluís Vilanova
2017-07-04 19:14       ` Peter Maydell
2017-07-04 22:31         ` Richard Henderson
2017-07-04 22:34           ` Peter Maydell
2017-06-28 12:36 ` [Qemu-devel] [PATCH v11 05/29] target/i386: [tcg] Port to DisasContextBase Lluís Vilanova
2017-06-29 23:33   ` Emilio G. Cota
2017-07-01 23:39   ` Richard Henderson
2017-06-28 12:40 ` [Qemu-devel] [PATCH v11 06/29] target/i386: [tcg] Refactor init_disas_context Lluís Vilanova
2017-06-29 23:51   ` Emilio G. Cota
2017-07-07  7:41     ` Lluís Vilanova
2017-07-01 23:50   ` Richard Henderson
2017-06-28 12:44 ` [Qemu-devel] [PATCH v11 07/29] target/i386: [tcg] Refactor init_globals Lluís Vilanova
2017-06-30  0:06   ` Emilio G. Cota
2017-07-02  0:25   ` Richard Henderson
2017-06-28 12:48 ` [Qemu-devel] [PATCH v11 08/29] target/i386: [tcg] Refactor insn_start Lluís Vilanova
2017-06-30  0:08   ` Emilio G. Cota
2017-07-02  0:26   ` Richard Henderson
2017-06-28 12:52 ` [Qemu-devel] [PATCH v11 09/29] target/i386: [tcg] Refactor breakpoint_check Lluís Vilanova
2017-06-30  0:24   ` Emilio G. Cota
2017-07-02  0:28   ` Richard Henderson
2017-06-28 12:57 ` [Qemu-devel] [PATCH v11 10/29] target/i386: [tcg] Refactor translate_insn Lluís Vilanova
2017-06-30  0:41   ` Emilio G. Cota
2017-07-07  9:25     ` Lluís Vilanova
2017-07-07 15:18       ` Richard Henderson
2017-07-07 17:05         ` Lluís Vilanova
2017-07-02  0:41   ` Richard Henderson
2017-06-28 13:01 ` [Qemu-devel] [PATCH v11 11/29] target/i386: [tcg] Refactor tb_stop Lluís Vilanova
2017-06-30  0:47   ` Emilio G. Cota
2017-07-02  0:47   ` Richard Henderson
2017-06-28 13:05 ` [Qemu-devel] [PATCH v11 12/29] target/i386: [tcg] Refactor disas_log Lluís Vilanova
2017-06-30  0:50   ` Emilio G. Cota
2017-07-02  0:49   ` Richard Henderson
2017-06-28 13:09 ` [Qemu-devel] [PATCH v11 13/29] target/i386: [tcg] Port to generic translation framework Lluís Vilanova
2017-06-30  1:11   ` Emilio G. Cota
2017-07-07 10:27     ` Lluís Vilanova
2017-07-07 10:29     ` Lluís Vilanova
2017-07-02  0:52   ` Richard Henderson
2017-06-28 13:13 ` [Qemu-devel] [PATCH v11 14/29] target/arm: [tcg] Port to DisasContextBase Lluís Vilanova
2017-07-02  1:00   ` Richard Henderson
2017-06-28 13:17 ` [Qemu-devel] [PATCH v11 15/29] target/arm: [tcg] Port to init_disas_context Lluís Vilanova
2017-07-02  1:04   ` Richard Henderson
2017-06-28 13:21 ` [Qemu-devel] [PATCH v11 16/29] target/arm: [tcg, a64] " Lluís Vilanova
2017-07-02  1:13   ` Richard Henderson
2017-06-28 13:25 ` [Qemu-devel] [PATCH v11 17/29] target/arm: [tcg] Port to init_globals Lluís Vilanova
2017-07-02  1:14   ` Richard Henderson
2017-06-28 13:29 ` [Qemu-devel] [PATCH v11 18/29] target/arm: [tcg] Port to tb_start Lluís Vilanova
2017-07-02  1:17   ` Richard Henderson
2017-06-28 13:33 ` [Qemu-devel] [PATCH v11 19/29] target/arm: [tcg] Port to insn_start Lluís Vilanova
2017-07-02  1:18   ` Richard Henderson
2017-06-28 13:37 ` [Qemu-devel] [PATCH v11 20/29] target/arm: [tcg, a64] " Lluís Vilanova
2017-07-02  1:19   ` Richard Henderson
2017-06-28 13:41 ` [Qemu-devel] [PATCH v11 21/29] target/arm: [tcg] Port to breakpoint_check Lluís Vilanova
2017-07-02  1:21   ` Richard Henderson
2017-06-28 13:45 ` [Qemu-devel] [PATCH v11 22/29] target/arm: [tcg, a64] " Lluís Vilanova
2017-07-02  1:22   ` Richard Henderson
2017-06-28 13:49 ` [Qemu-devel] [PATCH v11 23/29] target/arm: [tcg] Port to translate_insn Lluís Vilanova
2017-07-02  1:34   ` Richard Henderson
2017-07-07 11:13     ` Lluís Vilanova
2017-07-07 15:26       ` Richard Henderson
2017-07-07 17:18         ` Lluís Vilanova
2017-07-07 17:38           ` Richard Henderson
2017-07-10 13:47             ` Lluís Vilanova
2017-07-10 15:28               ` Richard Henderson
2017-07-07 17:33         ` Peter Maydell
2017-07-07 17:48           ` Richard Henderson
2017-06-28 13:53 ` [Qemu-devel] [PATCH v11 24/29] target/arm: [tcg, a64] " Lluís Vilanova
2017-07-02  1:42   ` Richard Henderson
2017-07-07 11:18     ` Lluís Vilanova
2017-07-07 15:46       ` Richard Henderson
2017-07-07 16:19         ` Emilio G. Cota
2017-07-07 17:33           ` Lluís Vilanova
2017-07-07 17:32         ` Lluís Vilanova
2017-07-07 17:41           ` Richard Henderson
2017-07-11 15:56             ` Lluís Vilanova
2017-06-28 13:57 ` [Qemu-devel] [PATCH v11 25/29] target/arm: [tcg] Port to tb_stop Lluís Vilanova
2017-07-02  1:45   ` Richard Henderson
2017-06-28 14:01 ` [Qemu-devel] [PATCH v11 26/29] target/arm: [tcg, a64] " Lluís Vilanova
2017-07-02  1:48   ` Richard Henderson
2017-06-28 14:05 ` [Qemu-devel] [PATCH v11 27/29] target/arm: [tcg] Port to disas_log Lluís Vilanova
2017-07-02  1:49   ` Richard Henderson
2017-06-28 14:09 ` [Qemu-devel] [PATCH v11 28/29] target/arm: [tcg, a64] " Lluís Vilanova
2017-07-02  1:50   ` Richard Henderson
2017-06-28 14:13 ` [Qemu-devel] [PATCH v11 29/29] target/arm: [tcg] Port to generic translation framework Lluís Vilanova
2017-07-02  1:54   ` Richard Henderson
2017-07-07 11:26     ` Lluís Vilanova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=149865219962.17063.10630533069463266646.stgit@frigg.lan \
    --to=vilanova@ac.upc.edu \
    --cc=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=crosthwaite.peter@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.