target/arm: Move some TLBI insns to their own source file
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 10 Dec 2024 16:04:43 +0000 (16:04 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 13 Dec 2024 15:41:09 +0000 (15:41 +0000)
commit1e32ee23cdc5405a5b575286bbfa705d78da410c
tree4eb8e9b632b6b2fc264786b16b1bae54094b687e
parent08e199bbc6a4a9b9d929a472e14cc47116811afb
target/arm: Move some TLBI insns to their own source file

target/arm/helper.c is very large and unwieldy.  One subset of code
that we can pull out into its own file is the cpreg arrays and
corresponding functions for the TLBI instructions.

Because these are instructions they are only relevant for TCG and we
can make the new file only be built for CONFIG_TCG.

In this commit we move the AArch32 instructions from:
 not_v7_cp_reginfo[]
 v7_cp_reginfo[]
 v7mp_cp_reginfo[]
 v8_cp_reginfo[]
into a new file target/arm/tcg/tlb-insns.c.

A few small functions are used both by functions we haven't yet moved
across and by functions we have already moved.  We temporarily make
these global with a prototype in cpregs.h; when the move of all TLBI
insns is complete these will return to being file-local.

For CONFIG_TCG, this is just moving code around.  For a KVM only
build, these cpregs will no longer be added to the cpregs hashtable
for the CPU.  However this should not be a behaviour change, because:
 * we never try to migration sync or otherwise include
   ARM_CP_NO_RAW cpregs
 * for migration we treat the kernel's list of system registers
   as the authoritative one, so these TLBI insns were never
   in it anyway
The no-tcg stub of define_tlb_insn_regs() therefore does nothing.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241210160452.2427965-2-peter.maydell@linaro.org
target/arm/cpregs.h
target/arm/helper.c
target/arm/internals.h
target/arm/tcg-stubs.c
target/arm/tcg/meson.build
target/arm/tcg/tlb-insns.c [new file with mode: 0644]