accel/tcg/cpu-exec.c: Widen pc to vaddr

Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230621135633.1649-7-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Anton Johansson 2023-06-21 15:56:27 +02:00 committed by Richard Henderson
parent fb2c53cb71
commit f0a08b0913
1 changed files with 17 additions and 17 deletions

View File

@ -169,8 +169,8 @@ uint32_t curr_cflags(CPUState *cpu)
} }
struct tb_desc { struct tb_desc {
target_ulong pc; vaddr pc;
target_ulong cs_base; uint64_t cs_base;
CPUArchState *env; CPUArchState *env;
tb_page_addr_t page_addr0; tb_page_addr_t page_addr0;
uint32_t flags; uint32_t flags;
@ -193,7 +193,7 @@ static bool tb_lookup_cmp(const void *p, const void *d)
return true; return true;
} else { } else {
tb_page_addr_t phys_page1; tb_page_addr_t phys_page1;
target_ulong virt_page1; vaddr virt_page1;
/* /*
* We know that the first page matched, and an otherwise valid TB * We know that the first page matched, and an otherwise valid TB
@ -214,8 +214,8 @@ static bool tb_lookup_cmp(const void *p, const void *d)
return false; return false;
} }
static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, static TranslationBlock *tb_htable_lookup(CPUState *cpu, vaddr pc,
target_ulong cs_base, uint32_t flags, uint64_t cs_base, uint32_t flags,
uint32_t cflags) uint32_t cflags)
{ {
tb_page_addr_t phys_pc; tb_page_addr_t phys_pc;
@ -238,9 +238,9 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc,
} }
/* Might cause an exception, so have a longjmp destination ready */ /* Might cause an exception, so have a longjmp destination ready */
static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, static inline TranslationBlock *tb_lookup(CPUState *cpu, vaddr pc,
target_ulong cs_base, uint64_t cs_base, uint32_t flags,
uint32_t flags, uint32_t cflags) uint32_t cflags)
{ {
TranslationBlock *tb; TranslationBlock *tb;
CPUJumpCache *jc; CPUJumpCache *jc;
@ -292,13 +292,13 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc,
return tb; return tb;
} }
static void log_cpu_exec(target_ulong pc, CPUState *cpu, static void log_cpu_exec(vaddr pc, CPUState *cpu,
const TranslationBlock *tb) const TranslationBlock *tb)
{ {
if (qemu_log_in_addr_range(pc)) { if (qemu_log_in_addr_range(pc)) {
qemu_log_mask(CPU_LOG_EXEC, qemu_log_mask(CPU_LOG_EXEC,
"Trace %d: %p [%08" PRIx64 "Trace %d: %p [%08" PRIx64
"/" TARGET_FMT_lx "/%08x/%08x] %s\n", "/%" VADDR_PRIx "/%08x/%08x] %s\n",
cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc,
tb->flags, tb->cflags, lookup_symbol(pc)); tb->flags, tb->cflags, lookup_symbol(pc));
@ -323,7 +323,7 @@ static void log_cpu_exec(target_ulong pc, CPUState *cpu,
} }
} }
static bool check_for_breakpoints_slow(CPUState *cpu, target_ulong pc, static bool check_for_breakpoints_slow(CPUState *cpu, vaddr pc,
uint32_t *cflags) uint32_t *cflags)
{ {
CPUBreakpoint *bp; CPUBreakpoint *bp;
@ -389,7 +389,7 @@ static bool check_for_breakpoints_slow(CPUState *cpu, target_ulong pc,
return false; return false;
} }
static inline bool check_for_breakpoints(CPUState *cpu, target_ulong pc, static inline bool check_for_breakpoints(CPUState *cpu, vaddr pc,
uint32_t *cflags) uint32_t *cflags)
{ {
return unlikely(!QTAILQ_EMPTY(&cpu->breakpoints)) && return unlikely(!QTAILQ_EMPTY(&cpu->breakpoints)) &&
@ -485,10 +485,10 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit)
cc->set_pc(cpu, last_tb->pc); cc->set_pc(cpu, last_tb->pc);
} }
if (qemu_loglevel_mask(CPU_LOG_EXEC)) { if (qemu_loglevel_mask(CPU_LOG_EXEC)) {
target_ulong pc = log_pc(cpu, last_tb); vaddr pc = log_pc(cpu, last_tb);
if (qemu_log_in_addr_range(pc)) { if (qemu_log_in_addr_range(pc)) {
qemu_log("Stopped execution of TB chain before %p [" qemu_log("Stopped execution of TB chain before %p [%"
TARGET_FMT_lx "] %s\n", VADDR_PRIx "] %s\n",
last_tb->tc.ptr, pc, lookup_symbol(pc)); last_tb->tc.ptr, pc, lookup_symbol(pc));
} }
} }
@ -882,8 +882,8 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
} }
static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb,
target_ulong pc, vaddr pc, TranslationBlock **last_tb,
TranslationBlock **last_tb, int *tb_exit) int *tb_exit)
{ {
int32_t insns_left; int32_t insns_left;