[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/62] include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL`
From: |
Richard Henderson |
Subject: |
[PULL 09/62] include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL` |
Date: |
Tue, 28 Feb 2023 16:55:50 -1000 |
From: Anton Johansson via <qemu-devel@nongnu.org>
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230227135202.9710-6-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/exec/exec-all.h | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 1574eabac8..6af001bfde 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -506,22 +506,20 @@ struct tb_tc {
};
struct TranslationBlock {
-#if !TARGET_TB_PCREL
/*
* Guest PC corresponding to this block. This must be the true
* virtual address. Therefore e.g. x86 stores EIP + CS_BASE, and
* targets like Arm, MIPS, HP-PA, which reuse low bits for ISA or
* privilege, must store those bits elsewhere.
*
- * If TARGET_TB_PCREL, the opcodes for the TranslationBlock are
- * written such that the TB is associated only with the physical
- * page and may be run in any virtual address context. In this case,
- * PC must always be taken from ENV in a target-specific manner.
+ * If CF_PCREL, the opcodes for the TranslationBlock are written
+ * such that the TB is associated only with the physical page and
+ * may be run in any virtual address context. In this case, PC
+ * must always be taken from ENV in a target-specific manner.
* Unwind information is taken as offsets from the page, to be
* deposited into the "current" PC.
*/
target_ulong pc;
-#endif
/*
* Target-specific data associated with the TranslationBlock, e.g.:
@@ -615,22 +613,19 @@ struct TranslationBlock {
uintptr_t jmp_dest[2];
};
-/* Hide the read to avoid ifdefs for TARGET_TB_PCREL. */
-static inline target_ulong tb_pc(const TranslationBlock *tb)
-{
-#if TARGET_TB_PCREL
- qemu_build_not_reached();
-#else
- return tb->pc;
-#endif
-}
-
/* Hide the qatomic_read to make code a little easier on the eyes */
static inline uint32_t tb_cflags(const TranslationBlock *tb)
{
return qatomic_read(&tb->cflags);
}
+/* Hide the read to avoid ifdefs for CF_PCREL. */
+static inline target_ulong tb_pc(const TranslationBlock *tb)
+{
+ assert(!(tb_cflags(tb) & CF_PCREL));
+ return tb->pc;
+}
+
static inline tb_page_addr_t tb_page_addr0(const TranslationBlock *tb)
{
#ifdef CONFIG_USER_ONLY
--
2.34.1
- [PULL 01/62] exec/helper-head: Include missing "fpu/softfloat-types.h" header, (continued)
- [PULL 01/62] exec/helper-head: Include missing "fpu/softfloat-types.h" header, Richard Henderson, 2023/02/28
- [PULL 02/62] softmmu: Use memmove in flatview_write_continue, Richard Henderson, 2023/02/28
- [PULL 03/62] accel/tcg: Add 'size' param to probe_access_flags(), Richard Henderson, 2023/02/28
- [PULL 04/62] accel/tcg: Add 'size' param to probe_access_full, Richard Henderson, 2023/02/28
- [PULL 05/62] include/exec: Introduce `CF_PCREL`, Richard Henderson, 2023/02/28
- [PULL 06/62] target/i386: set `CF_PCREL` in `x86_cpu_realizefn`, Richard Henderson, 2023/02/28
- [PULL 07/62] target/arm: set `CF_PCREL` in `arm_cpu_realizefn`, Richard Henderson, 2023/02/28
- [PULL 10/62] target/arm: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Richard Henderson, 2023/02/28
- [PULL 08/62] accel/tcg: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Richard Henderson, 2023/02/28
- [PULL 13/62] target/arm: Remove `TARGET_TB_PCREL` define, Richard Henderson, 2023/02/28
- [PULL 09/62] include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL`,
Richard Henderson <=
- [PULL 14/62] target/i386: Remove `TARGET_TB_PCREL` define, Richard Henderson, 2023/02/28
- [PULL 11/62] target/i386: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Richard Henderson, 2023/02/28
- [PULL 12/62] include/exec: Remove `TARGET_TB_PCREL` define, Richard Henderson, 2023/02/28
- [PULL 18/62] target/sparc: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 16/62] accel/tcg: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 20/62] target/rx: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 17/62] target/tricore: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 21/62] target/riscv: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 15/62] accel/tcg: Move jmp-cache `CF_PCREL` checks to caller, Richard Henderson, 2023/02/28
- [PULL 19/62] target/sh4: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28