On 1/9/26 16:31, Pierrick Bouvier wrote:
> We now need to stub aarch64_translator_ops. Those ops will never be
> called anyway for 32 bit target.
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> target/arm/tcg/stubs32.c | 2 ++
> target/arm/tcg/translate.c | 2 --
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/arm/tcg/stubs32.c b/target/arm/tcg/stubs32.c
> index c5a0bc61f47..ddb0610992b 100644
> --- a/target/arm/tcg/stubs32.c
> +++ b/target/arm/tcg/stubs32.c
> @@ -15,3 +15,5 @@ void a64_translate_init(void)
> {
> /* Don't initialize for 32 bits. Call site will be fixed later. */
> }
> +
> +const TranslatorOps aarch64_translator_ops;
This is unused data.
> diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c
> index 7128c633290..3cd05682ce8 100644
> --- a/target/arm/tcg/translate.c
> +++ b/target/arm/tcg/translate.c
> @@ -6863,11 +6863,9 @@ void arm_translate_code(CPUState *cpu, TranslationBlock *tb,
> if (EX_TBFLAG_AM32(tb_flags, THUMB)) {
> ops = &thumb_translator_ops;
> }
> -#ifdef TARGET_AARCH64
> if (EX_TBFLAG_ANY(tb_flags, AARCH64_STATE)) {
> ops = &aarch64_translator_ops;
> }
> -#endif
>
> translator_loop(cpu, tb, max_insns, pc, host_pc, ops, &dc.base);
> }
Perhaps better with a function wrapper, making aarch64_translator_ops static.
void aarch64_translate_code(CPUState *cpu, TranslationBlock *tb,
int *max_insns, vaddr pc, void *host_pc)
{
DisasContext dc = { };
translator_loop(cpu, tb, max_insns, pc, host_pc,
&aarch64_translator_ops, &dc.base);
}
void arm_translate_code(CPUState *cpu, TranslationBlock *tb,
int *max_insns, vaddr pc, void *host_pc)
{
CPUARMTBFlags tb_flags = arm_tbflags_from_tb(tb);
if (EX_TBFLAG_ANY(tb_flags, AARCH64_STATE)) {
aarch64_translate_code(cpu, tb, max_insns, pc, host_pc);
} else {
DisasContext dc = { };
translator_loop(cpu, tb, max_insns, pc, host_pc,
(EX_TBFLAG_AM32(tb_flags, THUMB)
? &thumb_translator_ops
: &arm_translator_ops),
&dc.base);
}
}
And then your stub file gets an assert for aarch64_translate_code.
r~