mbox series

[00/10] target/arm: Pull TLBI insns out to their own source file

Message ID 20241210160452.2427965-1-peter.maydell@linaro.org (mailing list archive)
Headers show
Series target/arm: Pull TLBI insns out to their own source file | expand

Message

Peter Maydell Dec. 10, 2024, 4:04 p.m. UTC
target/arm/helper.c is very large and unwieldy at nearly 13,000 lines.
One subset of code that we can pull out into its own file is the cpreg
arrays and corresponding functions for the TLBI instructions: these
mostly stand separately from the other code in the file and have few
shared functions or other interactions with it. They make up about
10% of the existing helper.c code.

Because these are instructions they are only relevant for TCG and we
can make the new file only be built for CONFIG_TCG.
        
I split the move up into multiple pieces in the hope of making
it easier to review that way; but in the end the code should
all have wound up in the new file in the same order it was
in helper.c. (Hopefully this will make any backporting of patches
to stable branches smoother; it does mean that in some cases the
order of functions remains slightly odd.)

This is hardly the most urgent cleanup in the codebase;
and there are other parts that could probably be pulled out
(maybe the PMU emulation, and the timer/counter emulation?).
But I did the TLBI stuff because FEAT_XS is about to add more
TLB ops, so it felt worthwhile to move the code out to a
new file first.

thanks
-- PMM

Peter Maydell (10):
  target/arm: Move some TLBI insns to their own source file
  target/arm: Move TLBI insns for AArch32 EL2 to tlbi_insn_helper.c
  target/arm: Move AArch64 TLBI insns from v8_cp_reginfo[]
  target/arm: Move the AArch64 EL2 TLBI insns
  target/arm: Move AArch64 EL3 TLBI insns
  target/arm: Move TLBI range insns
  target/arm: Move the TLBI OS insns to tlb-insns.c.
  target/arm: Move small helper functions to tlb-insns.c
  target/arm: Move RME TLB insns to tlb-insns.c
  target/arm: Simplify condition for tlbi_el2_cp_reginfo[]

 target/arm/internals.h     |    9 +
 target/arm/helper.c        | 1208 +---------------------------------
 target/arm/tcg-stubs.c     |    5 +
 target/arm/tcg/tlb-insns.c | 1266 ++++++++++++++++++++++++++++++++++++
 target/arm/tcg/meson.build |    1 +
 5 files changed, 1284 insertions(+), 1205 deletions(-)
 create mode 100644 target/arm/tcg/tlb-insns.c