diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-11-26 17:42:11 -0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-01-17 09:56:40 -1000 |
commit | becc452a367aa681ca0c1fcb688ae0f16b32b11f (patch) | |
tree | 7867e8461bac8a3fa50acae551cb80a340fcde8b /tcg/tcg.c | |
parent | b52a2c03b7d36694c21d70bcd46d68aaba5b0840 (diff) | |
download | qemu-becc452a367aa681ca0c1fcb688ae0f16b32b11f.zip qemu-becc452a367aa681ca0c1fcb688ae0f16b32b11f.tar.gz qemu-becc452a367aa681ca0c1fcb688ae0f16b32b11f.tar.bz2 |
tcg: Introduce get_jmp_target_addr
Similar to the existing set_jmp_reset_offset. Include the
rw->rx address space conversion done by arm and s390x, and
forgotten by mips and riscv.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r-- | tcg/tcg.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -323,6 +323,15 @@ static void G_GNUC_UNUSED set_jmp_insn_offset(TCGContext *s, int which) s->tb_jmp_insn_offset[which] = tcg_current_code_size(s); } +static uintptr_t G_GNUC_UNUSED get_jmp_target_addr(TCGContext *s, int which) +{ + /* + * Return the read-execute version of the pointer, for the benefit + * of any pc-relative addressing mode. + */ + return (uintptr_t)tcg_splitwx_to_rx(&s->tb_jmp_target_addr[which]); +} + /* Signal overflow, starting over with fewer guest insns. */ static G_NORETURN void tcg_raise_tb_overflow(TCGContext *s) |