[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 54/77] target/microblaze: Assert no overlap in flags making up tb
From: |
Richard Henderson |
Subject: |
[PATCH 54/77] target/microblaze: Assert no overlap in flags making up tb_flags |
Date: |
Tue, 25 Aug 2020 13:59:27 -0700 |
Create MSR_TB_MASK. Use it in cpu_get_tb_cpu_state, and check
that IFLAGS_TB_MASK does not overlap.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/microblaze/cpu.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
index 594501e4e7..2fc7cf26f1 100644
--- a/target/microblaze/cpu.h
+++ b/target/microblaze/cpu.h
@@ -261,8 +261,11 @@ struct CPUMBState {
#define DRTE_FLAG (1 << 17)
#define DRTB_FLAG (1 << 18)
#define D_FLAG (1 << 19) /* Bit in ESR. */
+
/* TB dependent CPUMBState. */
#define IFLAGS_TB_MASK (D_FLAG | IMM_FLAG | DRTI_FLAG | DRTE_FLAG | DRTB_FLAG)
+#define MSR_TB_MASK (MSR_UM | MSR_VM | MSR_EE)
+
uint32_t iflags;
#if !defined(CONFIG_USER_ONLY)
@@ -372,12 +375,14 @@ typedef MicroBlazeCPU ArchCPU;
#include "exec/cpu-all.h"
+/* Ensure there is no overlap between the two masks. */
+QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK);
+
static inline void cpu_get_tb_cpu_state(CPUMBState *env, target_ulong *pc,
target_ulong *cs_base, uint32_t *flags)
{
*pc = env->pc;
- *flags = (env->iflags & IFLAGS_TB_MASK) |
- (env->msr & (MSR_UM | MSR_VM | MSR_EE));
+ *flags = (env->iflags & IFLAGS_TB_MASK) | (env->msr & MSR_TB_MASK);
*cs_base = (*flags & IMM_FLAG ? env->imm : 0);
}
--
2.25.1
- [PATCH 44/77] target/microblaze: Convert dec_bit to decodetree, (continued)
- [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, 2020/08/25
- [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 <=
- [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
- [PATCH 62/77] target/microblaze: Try to keep imm and delay slot together, Richard Henderson, 2020/08/25