OSDN Git Service

tcg/ppc: Reorg goto_tb implementation
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 5 Dec 2022 23:45:02 +0000 (17:45 -0600)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 17 Jan 2023 20:36:16 +0000 (10:36 -1000)
commit20b6643324a79860dcdfe811ffe4a79942bca21e
treeebc1785b7fb8dcf5f23a931625dd2867d5426e2b
parentd59d83a1c38869b1e1a4f957eb939aaa8a342721
tcg/ppc: Reorg goto_tb implementation

The old ppc64 implementation replaces 2 or 4 insns, which leaves a race
condition in which a thread could be stopped at a PC in the middle of
the sequence, and when restarted does not see the complete address
computation and branches to nowhere.

The new implemetation replaces only one insn, swapping between

b       <dest>
and
mtctr r31

falling through to a general-case indirect branch.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/ppc/tcg-target.c.inc
tcg/ppc/tcg-target.h