[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 12/27] accel/tcg: Replace `tb_pc()` with `tb->pc`
From: |
Anton Johansson |
Subject: |
[PATCH v3 12/27] accel/tcg: Replace `tb_pc()` with `tb->pc` |
Date: |
Mon, 27 Feb 2023 14:51:47 +0100 |
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/cpu-exec.c | 6 +++---
accel/tcg/internal.h | 2 +-
accel/tcg/tb-maint.c | 8 ++++----
accel/tcg/translate-all.c | 4 ++--
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 5efa8bf42a..9fb0fabf95 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -185,7 +185,7 @@ static bool tb_lookup_cmp(const void *p, const void *d)
const TranslationBlock *tb = p;
const struct tb_desc *desc = d;
- if ((tb_cflags(tb) & CF_PCREL || tb_pc(tb) == desc->pc) &&
+ if ((tb_cflags(tb) & CF_PCREL || tb->pc == desc->pc) &&
tb_page_addr0(tb) == desc->page_addr0 &&
tb->cs_base == desc->cs_base &&
tb->flags == desc->flags &&
@@ -281,7 +281,7 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu,
target_ulong pc,
tb = qatomic_rcu_read(&jc->array[hash].tb);
if (likely(tb &&
- tb_pc(tb) == pc &&
+ tb->pc == pc &&
tb->cs_base == cs_base &&
tb->flags == flags &&
tb->trace_vcpu_dstate == *cpu->trace_dstate &&
@@ -486,7 +486,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int
*tb_exit)
} else {
tcg_debug_assert(!(tb_cflags(last_tb) & CF_PCREL));
assert(cc->set_pc);
- cc->set_pc(cpu, tb_pc(last_tb));
+ cc->set_pc(cpu, last_tb->pc);
}
if (qemu_loglevel_mask(CPU_LOG_EXEC)) {
target_ulong pc = log_pc(cpu, last_tb);
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
index 261924e7fa..17b52ecdb7 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal.h
@@ -60,7 +60,7 @@ static inline target_ulong log_pc(CPUState *cpu, const
TranslationBlock *tb)
if (tb_cflags(tb) & CF_PCREL) {
return cpu->cc->get_pc(cpu);
} else {
- return tb_pc(tb);
+ return tb->pc;
}
}
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 2dbc2ce172..efefa08ee1 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -44,7 +44,7 @@ static bool tb_cmp(const void *ap, const void *bp)
const TranslationBlock *a = ap;
const TranslationBlock *b = bp;
- return ((tb_cflags(a) & CF_PCREL || tb_pc(a) == tb_pc(b)) &&
+ return ((tb_cflags(a) & CF_PCREL || a->pc == b->pc) &&
a->cs_base == b->cs_base &&
a->flags == b->flags &&
(tb_cflags(a) & ~CF_INVALID) == (tb_cflags(b) & ~CF_INVALID) &&
@@ -853,7 +853,7 @@ static void tb_jmp_cache_inval_tb(TranslationBlock *tb)
tcg_flush_jmp_cache(cpu);
}
} else {
- uint32_t h = tb_jmp_cache_hash_func(tb_pc(tb));
+ uint32_t h = tb_jmp_cache_hash_func(tb->pc);
CPU_FOREACH(cpu) {
CPUJumpCache *jc = cpu->tb_jmp_cache;
@@ -885,7 +885,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb,
bool rm_from_page_list)
/* remove the TB from the hash list */
phys_pc = tb_page_addr0(tb);
- h = tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb_pc(tb)),
+ h = tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc),
tb->flags, orig_cflags, tb->trace_vcpu_dstate);
if (!qht_remove(&tb_ctx.htable, tb, h)) {
return;
@@ -966,7 +966,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb,
tb_page_addr_t phys_pc,
tb_record(tb, p, p2);
/* add in the hash table */
- h = tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb_pc(tb)),
+ h = tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb->pc),
tb->flags, tb->cflags, tb->trace_vcpu_dstate);
qht_insert(&tb_ctx.htable, tb, h, &existing_tb);
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 6ae3cc9d71..389d0a940b 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -135,7 +135,7 @@ static int encode_search(TranslationBlock *tb, uint8_t
*block)
for (j = 0; j < TARGET_INSN_START_WORDS; ++j) {
if (i == 0) {
- prev = (!(tb_cflags(tb) & CF_PCREL) && j == 0 ? tb_pc(tb) : 0);
+ prev = (!(tb_cflags(tb) & CF_PCREL) && j == 0 ? tb->pc : 0);
} else {
prev = tcg_ctx->gen_insn_data[i - 1][j];
}
@@ -171,7 +171,7 @@ static int cpu_unwind_data_from_tb(TranslationBlock *tb,
uintptr_t host_pc,
memset(data, 0, sizeof(uint64_t) * TARGET_INSN_START_WORDS);
if (!(tb_cflags(tb) & CF_PCREL)) {
- data[0] = tb_pc(tb);
+ data[0] = tb->pc;
}
/*
--
2.39.1
- [PATCH v3 02/27] target/i386: set `CF_PCREL` in `x86_cpu_realizefn`, (continued)
- [PATCH v3 02/27] target/i386: set `CF_PCREL` in `x86_cpu_realizefn`, Anton Johansson, 2023/02/27
- [PATCH v3 04/27] accel/tcg: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 01/27] include/exec: Introduce `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 03/27] target/arm: set `CF_PCREL` in `arm_cpu_realizefn`, Anton Johansson, 2023/02/27
- [PATCH v3 05/27] include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 08/27] include/exec: Remove `TARGET_TB_PCREL` define, Anton Johansson, 2023/02/27
- [PATCH v3 09/27] target/arm: Remove `TARGET_TB_PCREL` define, Anton Johansson, 2023/02/27
- [PATCH v3 06/27] target/arm: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 07/27] target/i386: Replace `TARGET_TB_PCREL` with `CF_PCREL`, Anton Johansson, 2023/02/27
- [PATCH v3 10/27] target/i386: Remove `TARGET_TB_PCREL` define, Anton Johansson, 2023/02/27
- [PATCH v3 12/27] accel/tcg: Replace `tb_pc()` with `tb->pc`,
Anton Johansson <=
- [PATCH v3 11/27] accel/tcg: Move jmp-cache `CF_PCREL` checks to caller, Anton Johansson, 2023/02/27
- [PATCH v3 15/27] target/sh4: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 23/27] target/hppa: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 24/27] target/hexagon: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 14/27] target/sparc: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 22/27] target/i386: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 20/27] target/microblaze: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 13/27] target/tricore: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27
- [PATCH v3 16/27] target/rx: Replace `tb_pc()` with `tb->pc`, Anton Johansson, 2023/02/27