[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 51/77] target/microblaze: Cache mem_index in DisasContext
From: |
Richard Henderson |
Subject: |
[PATCH 51/77] target/microblaze: Cache mem_index in DisasContext |
Date: |
Tue, 25 Aug 2020 13:59:24 -0700 |
Ideally, nothing outside the top-level of translation even
has access to env. Cache the value in init_disas_context.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/microblaze/translate.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index cb490488a6..8a251b35d9 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -73,6 +73,7 @@ typedef struct DisasContext {
unsigned int delayed_branch;
unsigned int tb_flags, synced_flags; /* tb dependent flags. */
unsigned int clear_imm;
+ int mem_index;
#define JMP_NOJMP 0
#define JMP_DIRECT 1
@@ -175,8 +176,7 @@ static bool trap_illegal(DisasContext *dc, bool cond)
*/
static bool trap_userspace(DisasContext *dc, bool cond)
{
- int mem_index = cpu_mmu_index(&dc->cpu->env, false);
- bool cond_user = cond && mem_index == MMU_USER_IDX;
+ bool cond_user = cond && dc->mem_index == MMU_USER_IDX;
if (cond_user && (dc->tb_flags & MSR_EE)) {
gen_raise_hw_excp(dc, ESR_EC_PRIVINSN);
@@ -954,7 +954,7 @@ static void dec_load(DisasContext *dc)
TCGv addr;
unsigned int size;
bool rev = false, ex = false, ea = false;
- int mem_index = cpu_mmu_index(&dc->cpu->env, false);
+ int mem_index = dc->mem_index;
MemOp mop;
mop = dc->opcode & 3;
@@ -1063,7 +1063,7 @@ static void dec_store(DisasContext *dc)
TCGLabel *swx_skip = NULL;
unsigned int size;
bool rev = false, ex = false, ea = false;
- int mem_index = cpu_mmu_index(&dc->cpu->env, false);
+ int mem_index = dc->mem_index;
MemOp mop;
mop = dc->opcode & 3;
@@ -1532,6 +1532,7 @@ static void mb_tr_init_disas_context(DisasContextBase
*dcb, CPUState *cs)
dc->ext_imm = dc->base.tb->cs_base;
dc->r0 = NULL;
dc->r0_set = false;
+ dc->mem_index = cpu_mmu_index(&cpu->env, false);
bound = -(dc->base.pc_first | TARGET_PAGE_MASK) / 4;
dc->base.max_insns = MIN(dc->base.max_insns, bound);
--
2.25.1
- [PATCH 40/77] target/microblaze: Convert dec_and, dec_or, dec_xor to decodetree, (continued)
- [PATCH 40/77] target/microblaze: Convert dec_and, dec_or, dec_xor to decodetree, Richard Henderson, 2020/08/25
- [PATCH 43/77] target/microblaze: Unwind properly when raising divide-by-zero, Richard Henderson, 2020/08/25
- [PATCH 41/77] target/microblaze: Convert dec_mul to decodetree, Richard Henderson, 2020/08/25
- [PATCH 44/77] target/microblaze: Convert dec_bit to decodetree, Richard Henderson, 2020/08/25
- [PATCH 45/77] target/microblaze: Convert dec_barrel to decodetree, Richard Henderson, 2020/08/25
- [PATCH 47/77] target/microblaze: Convert dec_fpu to decodetree, Richard Henderson, 2020/08/25
- [PATCH 46/77] target/microblaze: Convert dec_imm to decodetree, Richard Henderson, 2020/08/25
- [PATCH 48/77] target/microblaze: Fix cpu unwind for fpu exceptions, Richard Henderson, 2020/08/25
- [PATCH 49/77] target/microblaze: Mark fpu helpers TCG_CALL_NO_WG, Richard Henderson, 2020/08/25
- [PATCH 50/77] target/microblaze: Replace MSR_EE_FLAG with MSR_EE, Richard Henderson, 2020/08/25
- [PATCH 51/77] target/microblaze: Cache mem_index in DisasContext,
Richard Henderson <=
- [PATCH 52/77] target/microblaze: Fix cpu unwind for stackprot, Richard Henderson, 2020/08/25
- [PATCH 53/77] target/microblaze: Convert dec_load and dec_store to decodetree, Richard Henderson, 2020/08/25
- [PATCH 54/77] target/microblaze: Assert no overlap in flags making up tb_flags, Richard Henderson, 2020/08/25
- [PATCH 57/77] tcg: Add tcg_get_insn_start_param, Richard Henderson, 2020/08/25
- [PATCH 55/77] target/microblaze: Move bimm to BIMM_FLAG, Richard Henderson, 2020/08/25
- [PATCH 56/77] target/microblaze: Store "current" iflags in insn_start, Richard Henderson, 2020/08/25
- [PATCH 58/77] target/microblaze: Use cc->do_unaligned_access, Richard Henderson, 2020/08/25
- [PATCH 59/77] target/microblaze: Replace clear_imm with tb_flags_to_set, Richard Henderson, 2020/08/25
- [PATCH 60/77] target/microblaze: Replace delayed_branch with tb_flags_to_set, Richard Henderson, 2020/08/25
- [PATCH 61/77] target/microblaze: Tidy mb_cpu_dump_state, Richard Henderson, 2020/08/25