diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-10-20 13:06:41 +1000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-10-20 11:28:29 +0100 |
commit | abb80995d722814c2e3f314629ef4c5700424ae7 (patch) | |
tree | 7d84a1444710733b345846ccb2ebff52e9d1dbb0 /target/arm/cpu.c | |
parent | 35dbeb81778d5c772e7ce42ea06429c419e707f1 (diff) | |
download | qemu-abb80995d722814c2e3f314629ef4c5700424ae7.zip qemu-abb80995d722814c2e3f314629ef4c5700424ae7.tar.gz qemu-abb80995d722814c2e3f314629ef4c5700424ae7.tar.bz2 |
target/arm: Enable TARGET_TB_PCREL
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20221020030641.2066807-10-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/cpu.c')
-rw-r--r-- | target/arm/cpu.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 94ca6f1..0bc5e9b 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -76,17 +76,18 @@ static vaddr arm_cpu_get_pc(CPUState *cs) void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { - ARMCPU *cpu = ARM_CPU(cs); - CPUARMState *env = &cpu->env; - - /* - * It's OK to look at env for the current mode here, because it's - * never possible for an AArch64 TB to chain to an AArch32 TB. - */ - if (is_a64(env)) { - env->pc = tb_pc(tb); - } else { - env->regs[15] = tb_pc(tb); + /* The program counter is always up to date with TARGET_TB_PCREL. */ + if (!TARGET_TB_PCREL) { + CPUARMState *env = cs->env_ptr; + /* + * It's OK to look at env for the current mode here, because it's + * never possible for an AArch64 TB to chain to an AArch32 TB. + */ + if (is_a64(env)) { + env->pc = tb_pc(tb); + } else { + env->regs[15] = tb_pc(tb); + } } } #endif /* CONFIG_TCG */ |