target/arm: Merge allocation of the cpreg and its name
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 1 May 2022 05:49:54 +0000 (22:49 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 5 May 2022 08:35:51 +0000 (09:35 +0100)
commitc27f5d3a83ed2959a6a1947708b588a6774a2aec
tree50ebe60847d744660289a9cdb4636c2d3cb73545
parent5860362d25f3afa99364d60295c09147a07055f1
target/arm: Merge allocation of the cpreg and its name

Simplify freeing cp_regs hash table entries by using a single
allocation for the entire value.

This fixes a theoretical bug if we were to ever free the entire
hash table, because we've been installing string literal constants
into the cpreg structure in define_arm_vh_e2h_redirects_aliases.
However, at present we only free entries created for AArch32
wildcard cpregs which get overwritten by more specific cpregs,
so this bug is never exposed.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220501055028.646596-13-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/cpu.c
target/arm/helper.c