[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 07/12] accel/tcg: Widen pc to vaddr in CPUJumpCache
From: |
Anton Johansson |
Subject: |
[PATCH v3 07/12] accel/tcg: Widen pc to vaddr in CPUJumpCache |
Date: |
Wed, 21 Jun 2023 15:56:28 +0200 |
Related functions dealing with the jump cache are also updated.
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/cputlb.c | 2 +-
accel/tcg/tb-hash.h | 12 ++++++------
accel/tcg/tb-jmp-cache.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index cc53d0fb64..bdf400f6e6 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -99,7 +99,7 @@ static void tlb_window_reset(CPUTLBDesc *desc, int64_t ns,
desc->window_max_entries = max_entries;
}
-static void tb_jmp_cache_clear_page(CPUState *cpu, target_ulong page_addr)
+static void tb_jmp_cache_clear_page(CPUState *cpu, vaddr page_addr)
{
CPUJumpCache *jc = cpu->tb_jmp_cache;
int i, i0;
diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h
index 2ba2193731..a0c61f25cd 100644
--- a/accel/tcg/tb-hash.h
+++ b/accel/tcg/tb-hash.h
@@ -35,16 +35,16 @@
#define TB_JMP_ADDR_MASK (TB_JMP_PAGE_SIZE - 1)
#define TB_JMP_PAGE_MASK (TB_JMP_CACHE_SIZE - TB_JMP_PAGE_SIZE)
-static inline unsigned int tb_jmp_cache_hash_page(target_ulong pc)
+static inline unsigned int tb_jmp_cache_hash_page(vaddr pc)
{
- target_ulong tmp;
+ vaddr tmp;
tmp = pc ^ (pc >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS));
return (tmp >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS)) & TB_JMP_PAGE_MASK;
}
-static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc)
+static inline unsigned int tb_jmp_cache_hash_func(vaddr pc)
{
- target_ulong tmp;
+ vaddr tmp;
tmp = pc ^ (pc >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS));
return (((tmp >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS)) & TB_JMP_PAGE_MASK)
| (tmp & TB_JMP_ADDR_MASK));
@@ -53,7 +53,7 @@ static inline unsigned int
tb_jmp_cache_hash_func(target_ulong pc)
#else
/* In user-mode we can get better hashing because we do not have a TLB */
-static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc)
+static inline unsigned int tb_jmp_cache_hash_func(vaddr pc)
{
return (pc ^ (pc >> TB_JMP_CACHE_BITS)) & (TB_JMP_CACHE_SIZE - 1);
}
@@ -61,7 +61,7 @@ static inline unsigned int
tb_jmp_cache_hash_func(target_ulong pc)
#endif /* CONFIG_SOFTMMU */
static inline
-uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc,
+uint32_t tb_hash_func(tb_page_addr_t phys_pc, vaddr pc,
uint32_t flags, uint64_t flags2, uint32_t cf_mask)
{
return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask);
diff --git a/accel/tcg/tb-jmp-cache.h b/accel/tcg/tb-jmp-cache.h
index bee87eb840..bb424c8a05 100644
--- a/accel/tcg/tb-jmp-cache.h
+++ b/accel/tcg/tb-jmp-cache.h
@@ -21,7 +21,7 @@ struct CPUJumpCache {
struct rcu_head rcu;
struct {
TranslationBlock *tb;
- target_ulong pc;
+ vaddr pc;
} array[TB_JMP_CACHE_SIZE];
};
--
2.41.0
- [PATCH v3 00/12] Start replacing target_ulong with vaddr, Anton Johansson, 2023/06/21
- [PATCH v3 02/12] accel/tcg/translate-all.c: Widen pc and cs_base, Anton Johansson, 2023/06/21
- [PATCH v3 01/12] accel: Replace target_ulong in tlb_*(), Anton Johansson, 2023/06/21
- [PATCH v3 05/12] accel/tcg/cputlb.c: Widen addr in MMULookupPageData, Anton Johansson, 2023/06/21
- [PATCH v3 04/12] accel/tcg/cputlb.c: Widen CPUTLBEntry access functions, Anton Johansson, 2023/06/21
- [PATCH v3 03/12] target: Widen pc/cs_base in cpu_get_tb_cpu_state, Anton Johansson, 2023/06/21
- [PATCH v3 08/12] accel: Replace target_ulong with vaddr in probe_*(), Anton Johansson, 2023/06/21
- [PATCH v3 06/12] accel/tcg/cpu-exec.c: Widen pc to vaddr, Anton Johansson, 2023/06/21
- [PATCH v3 07/12] accel/tcg: Widen pc to vaddr in CPUJumpCache,
Anton Johansson <=
- [PATCH v3 09/12] accel/tcg: Replace target_ulong with vaddr in *_mmu_lookup(), Anton Johansson, 2023/06/21
- [PATCH v3 10/12] accel/tcg: Replace target_ulong with vaddr in translator_*(), Anton Johansson, 2023/06/21
- [PATCH v3 11/12] accel/tcg: Replace target_ulong with vaddr in page_*(), Anton Johansson, 2023/06/21
- [PATCH v3 12/12] cpu: Replace target_ulong with hwaddr in tb_invalidate_phys_addr(), Anton Johansson, 2023/06/21
- Re: [PATCH v3 00/12] Start replacing target_ulong with vaddr, Richard Henderson, 2023/06/23