[PATCH v4 00/14] target/arm: single-binary

Pierrick Bouvier posted 14 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260219040150.2098396-1-pierrick.bouvier@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Brian Cain <brian.cain@oss.qualcomm.com>, Helge Deller <deller@gmx.de>, Zhao Liu <zhao1.liu@intel.com>, Eduardo Habkost <eduardo@habkost.net>, Song Gao <gaosong@loongson.cn>, Laurent Vivier <laurent@vivier.eu>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Stafford Horne <shorne@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@rumtueddeln.de>, Max Filippov <jcmvbkbc@gmail.com>
include/tcg/tcg-op-common.h                   |   8 +
include/tcg/tcg-op.h                          |  29 -
include/tcg/tcg.h                             |   6 -
target/alpha/cpu-param.h                      |   2 -
target/arm/cpu-param.h                        |   7 -
target/arm/helper-a64.h                       |  14 +
target/arm/helper-mve.h                       |  14 +
target/arm/helper-sme.h                       |  14 +
target/arm/helper-sve.h                       |  14 +
target/arm/helper.h                           |  17 +-
.../tcg/{helper-a64.h => helper-a64-defs.h}   |   0
target/arm/tcg/{helper.h => helper-defs.h}    |   0
.../tcg/{helper-mve.h => helper-mve-defs.h}   |   0
.../tcg/{helper-sme.h => helper-sme-defs.h}   |   0
.../tcg/{helper-sve.h => helper-sve-defs.h}   |   0
target/arm/tcg/translate-a32.h                |   2 +-
target/arm/tcg/translate.h                    |  22 +-
target/arm/tcg/vec_internal.h                 |  49 ++
target/avr/cpu-param.h                        |   2 -
target/hexagon/cpu-param.h                    |   2 -
target/hppa/cpu-param.h                       |   2 -
target/i386/cpu-param.h                       |   2 -
target/loongarch/cpu-param.h                  |   2 -
target/m68k/cpu-param.h                       |   2 -
target/microblaze/cpu-param.h                 |   2 -
target/mips/cpu-param.h                       |   2 -
target/or1k/cpu-param.h                       |   2 -
target/ppc/cpu-param.h                        |   2 -
target/riscv/cpu-param.h                      |   7 -
target/rx/cpu-param.h                         |   2 -
target/s390x/cpu-param.h                      |   2 -
target/sh4/cpu-param.h                        |   2 -
target/sparc/cpu-param.h                      |   2 -
target/tricore/cpu-param.h                    |   2 -
target/xtensa/cpu-param.h                     |   2 -
tcg/tcg-internal.h                            |   6 +
target/alpha/translate.c                      |   4 +-
target/arm/debug_helper.c                     | 769 -----------------
target/arm/helper.c                           |   5 +-
target/arm/tcg/arith_helper.c                 |   4 +-
target/arm/tcg/crypto_helper.c                |   4 +-
target/arm/tcg/debug.c                        | 780 ++++++++++++++++++
target/arm/tcg/gengvec64.c                    |   3 +-
target/arm/tcg/helper-a64.c                   |   6 +-
target/arm/tcg/hflags.c                       |   4 +-
target/arm/tcg/m_helper.c                     |   2 +-
target/arm/tcg/mte_helper.c                   |   3 +-
target/arm/tcg/mve_helper.c                   |   6 +-
target/arm/tcg/neon_helper.c                  |   4 +-
target/arm/tcg/op_helper.c                    |   2 +-
target/arm/tcg/pauth_helper.c                 |   3 +-
target/arm/tcg/psci.c                         |   4 +-
target/arm/tcg/sme_helper.c                   |   5 +-
target/arm/tcg/sve_helper.c                   |   6 +-
target/arm/tcg/tlb_helper.c                   |   4 +-
target/arm/tcg/translate-a64.c                |   3 +
target/arm/tcg/translate-mve.c                |   1 +
target/arm/tcg/translate-sme.c                |   3 +
target/arm/tcg/translate-sve.c                |   3 +
target/arm/tcg/translate.c                    |  28 +-
target/arm/tcg/vec_helper.c                   | 224 +----
target/arm/tcg/vec_helper64.c                 | 142 ++++
target/arm/tcg/vfp_helper.c                   |   4 +-
target/avr/translate.c                        |   2 +-
target/hexagon/translate.c                    |   2 +-
target/i386/tcg/translate.c                   |   2 +-
target/loongarch/tcg/translate.c              |   2 +-
target/m68k/translate.c                       |   2 +-
target/microblaze/translate.c                 |   2 +-
target/or1k/translate.c                       |   2 +-
target/ppc/translate.c                        |   2 +-
target/rx/translate.c                         |   2 +-
target/sh4/translate.c                        |   4 +-
target/sparc/translate.c                      |   2 +-
target/tricore/translate.c                    |   2 +-
target/xtensa/translate.c                     |   2 +-
tcg/tcg.c                                     |   4 -
target/arm/tcg/meson.build                    |  13 +-
78 files changed, 1165 insertions(+), 1149 deletions(-)
create mode 100644 target/arm/helper-a64.h
create mode 100644 target/arm/helper-mve.h
create mode 100644 target/arm/helper-sme.h
create mode 100644 target/arm/helper-sve.h
rename target/arm/tcg/{helper-a64.h => helper-a64-defs.h} (100%)
rename target/arm/tcg/{helper.h => helper-defs.h} (100%)
rename target/arm/tcg/{helper-mve.h => helper-mve-defs.h} (100%)
rename target/arm/tcg/{helper-sme.h => helper-sme-defs.h} (100%)
rename target/arm/tcg/{helper-sve.h => helper-sve-defs.h} (100%)
create mode 100644 target/arm/tcg/debug.c
create mode 100644 target/arm/tcg/vec_helper64.c
[PATCH v4 00/14] target/arm: single-binary
Posted by Pierrick Bouvier 1 month ago
This series continues cleaning target/arm, especially tcg folder.

For now, it contains some cleanups in headers, and it splits helpers per
category, thus removing several usage of TARGET_AARCH64.
First version was simply splitting 32 vs 64-bit helpers, and Richard asked
to split per sub category.

v4
--

- add two patches from Peter removing helper in non-tcg files
  20260216160349.3079657-1-peter.maydell@linaro.org
  This fixes build failure with kvm-only and xen-only builds on aarch64.
  I didn't split helper and gen_helper headers. If that really matters, it can
  be done in v5.

v3
--

- translate.h: missing vaddr replacement
- move tcg_use_softmmu to tcg/tcg-internal.h to avoid duplicating compilation
  units between system and user builds.
- eradicate TARGET_INSN_START_EXTRA_WORDS by calling tcg_gen_insn_start with
  additional 0 parameters if needed.

v2
--

- add missing kvm_enabled() in arm-qmp-cmds.c
- didn't extract arm_wfi for tcg/psci.c. If that's a hard requirement, I can do
  it in next version.
- restricted scope of series to helper headers, so we can validate things one
  step at a time. Series will keep on growing once all patches are reviewed.
- translate.h: use vaddr where appropriate, as asked by Richard.

Peter Maydell (2):
  target/arm: Move TCG-specific code out of debug_helper.c
  target/arm: Don't require helper prototypes in helper.c

Pierrick Bouvier (12):
  target/arm: extract helper-mve.h from helper.h
  target/arm: extract helper-a64.h from helper.h
  target/arm: extract helper-sve.h from helper.h
  target/arm: extract helper-sme.h from helper.h
  tcg: move tcg_use_softmmu to tcg/tcg-internal.h
  target/arm: move exec/helper-* plumbery to helper.h
  target/arm/tcg/psci.c: make compilation unit common
  target/arm/tcg/cpu-v7m.c: make compilation unit common
  target/arm/tcg/vec_helper.c: make compilation unit common
  target/arm/tcg/translate.h: replace target_ulong with vaddr
  target/arm/tcg/translate.h: replace target_long with int64_t
  include/tcg/tcg-op.h: eradicate TARGET_INSN_START_EXTRA_WORDS

 include/tcg/tcg-op-common.h                   |   8 +
 include/tcg/tcg-op.h                          |  29 -
 include/tcg/tcg.h                             |   6 -
 target/alpha/cpu-param.h                      |   2 -
 target/arm/cpu-param.h                        |   7 -
 target/arm/helper-a64.h                       |  14 +
 target/arm/helper-mve.h                       |  14 +
 target/arm/helper-sme.h                       |  14 +
 target/arm/helper-sve.h                       |  14 +
 target/arm/helper.h                           |  17 +-
 .../tcg/{helper-a64.h => helper-a64-defs.h}   |   0
 target/arm/tcg/{helper.h => helper-defs.h}    |   0
 .../tcg/{helper-mve.h => helper-mve-defs.h}   |   0
 .../tcg/{helper-sme.h => helper-sme-defs.h}   |   0
 .../tcg/{helper-sve.h => helper-sve-defs.h}   |   0
 target/arm/tcg/translate-a32.h                |   2 +-
 target/arm/tcg/translate.h                    |  22 +-
 target/arm/tcg/vec_internal.h                 |  49 ++
 target/avr/cpu-param.h                        |   2 -
 target/hexagon/cpu-param.h                    |   2 -
 target/hppa/cpu-param.h                       |   2 -
 target/i386/cpu-param.h                       |   2 -
 target/loongarch/cpu-param.h                  |   2 -
 target/m68k/cpu-param.h                       |   2 -
 target/microblaze/cpu-param.h                 |   2 -
 target/mips/cpu-param.h                       |   2 -
 target/or1k/cpu-param.h                       |   2 -
 target/ppc/cpu-param.h                        |   2 -
 target/riscv/cpu-param.h                      |   7 -
 target/rx/cpu-param.h                         |   2 -
 target/s390x/cpu-param.h                      |   2 -
 target/sh4/cpu-param.h                        |   2 -
 target/sparc/cpu-param.h                      |   2 -
 target/tricore/cpu-param.h                    |   2 -
 target/xtensa/cpu-param.h                     |   2 -
 tcg/tcg-internal.h                            |   6 +
 target/alpha/translate.c                      |   4 +-
 target/arm/debug_helper.c                     | 769 -----------------
 target/arm/helper.c                           |   5 +-
 target/arm/tcg/arith_helper.c                 |   4 +-
 target/arm/tcg/crypto_helper.c                |   4 +-
 target/arm/tcg/debug.c                        | 780 ++++++++++++++++++
 target/arm/tcg/gengvec64.c                    |   3 +-
 target/arm/tcg/helper-a64.c                   |   6 +-
 target/arm/tcg/hflags.c                       |   4 +-
 target/arm/tcg/m_helper.c                     |   2 +-
 target/arm/tcg/mte_helper.c                   |   3 +-
 target/arm/tcg/mve_helper.c                   |   6 +-
 target/arm/tcg/neon_helper.c                  |   4 +-
 target/arm/tcg/op_helper.c                    |   2 +-
 target/arm/tcg/pauth_helper.c                 |   3 +-
 target/arm/tcg/psci.c                         |   4 +-
 target/arm/tcg/sme_helper.c                   |   5 +-
 target/arm/tcg/sve_helper.c                   |   6 +-
 target/arm/tcg/tlb_helper.c                   |   4 +-
 target/arm/tcg/translate-a64.c                |   3 +
 target/arm/tcg/translate-mve.c                |   1 +
 target/arm/tcg/translate-sme.c                |   3 +
 target/arm/tcg/translate-sve.c                |   3 +
 target/arm/tcg/translate.c                    |  28 +-
 target/arm/tcg/vec_helper.c                   | 224 +----
 target/arm/tcg/vec_helper64.c                 | 142 ++++
 target/arm/tcg/vfp_helper.c                   |   4 +-
 target/avr/translate.c                        |   2 +-
 target/hexagon/translate.c                    |   2 +-
 target/i386/tcg/translate.c                   |   2 +-
 target/loongarch/tcg/translate.c              |   2 +-
 target/m68k/translate.c                       |   2 +-
 target/microblaze/translate.c                 |   2 +-
 target/or1k/translate.c                       |   2 +-
 target/ppc/translate.c                        |   2 +-
 target/rx/translate.c                         |   2 +-
 target/sh4/translate.c                        |   4 +-
 target/sparc/translate.c                      |   2 +-
 target/tricore/translate.c                    |   2 +-
 target/xtensa/translate.c                     |   2 +-
 tcg/tcg.c                                     |   4 -
 target/arm/tcg/meson.build                    |  13 +-
 78 files changed, 1165 insertions(+), 1149 deletions(-)
 create mode 100644 target/arm/helper-a64.h
 create mode 100644 target/arm/helper-mve.h
 create mode 100644 target/arm/helper-sme.h
 create mode 100644 target/arm/helper-sve.h
 rename target/arm/tcg/{helper-a64.h => helper-a64-defs.h} (100%)
 rename target/arm/tcg/{helper.h => helper-defs.h} (100%)
 rename target/arm/tcg/{helper-mve.h => helper-mve-defs.h} (100%)
 rename target/arm/tcg/{helper-sme.h => helper-sme-defs.h} (100%)
 rename target/arm/tcg/{helper-sve.h => helper-sve-defs.h} (100%)
 create mode 100644 target/arm/tcg/debug.c
 create mode 100644 target/arm/tcg/vec_helper64.c

-- 
2.47.3
Re: [PATCH v4 00/14] target/arm: single-binary
Posted by Peter Maydell 1 month ago
On Thu, 19 Feb 2026 at 04:02, Pierrick Bouvier
<pierrick.bouvier@linaro.org> wrote:
>
> This series continues cleaning target/arm, especially tcg folder.
>
> For now, it contains some cleanups in headers, and it splits helpers per
> category, thus removing several usage of TARGET_AARCH64.
> First version was simply splitting 32 vs 64-bit helpers, and Richard asked
> to split per sub category.

Thanks, I've applied this to target-arm.next. Patchew says the
last patch here is the same as it was in v4, so I've copied
the R-by tags from Richard and Philippe across.

-- PMM
Re: [PATCH v4 00/14] target/arm: single-binary
Posted by Pierrick Bouvier 1 month ago
On 2/19/26 1:38 AM, Peter Maydell wrote:
> On Thu, 19 Feb 2026 at 04:02, Pierrick Bouvier
> <pierrick.bouvier@linaro.org> wrote:
>>
>> This series continues cleaning target/arm, especially tcg folder.
>>
>> For now, it contains some cleanups in headers, and it splits helpers per
>> category, thus removing several usage of TARGET_AARCH64.
>> First version was simply splitting 32 vs 64-bit helpers, and Richard asked
>> to split per sub category.
> 
> Thanks, I've applied this to target-arm.next. Patchew says the
> last patch here is the same as it was in v4, so I've copied
> the R-by tags from Richard and Philippe across.
> 
> -- PMM

Thanks.
It's indeed the same, except patch 8 which has changes to accomodate the 
two new patches in prelude.